diff --git a/dist/force-ui.asset.php b/dist/force-ui.asset.php index 32f78087..e05894a7 100644 --- a/dist/force-ui.asset.php +++ b/dist/force-ui.asset.php @@ -1 +1 @@ - array('react', 'react-dom'), 'version' => '078fc74692ede3c0d6af'); + array('react', 'react-dom'), 'version' => 'cb8b68fc4b596e83b76c'); diff --git a/dist/force-ui.js b/dist/force-ui.js index 225de06f..9ab8dd4a 100644 --- a/dist/force-ui.js +++ b/dist/force-ui.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["force-ui.[file].js"]=t():e["force-ui.[file].js"]=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={316:function(e,t,n){function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{A:function(){return i}});var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=r((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},20:function(e,t,n){var r=n(609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},848:function(e,t,n){e.exports=n(20)},609:function(e){e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{Alert:function(){return Dp},Avatar:function(){return tt},Badge:function(){return Ye},Breadcrumb:function(){return JE},BreadcrumbEllipsis:function(){return nS},BreadcrumbItem:function(){return QE},BreadcrumbLink:function(){return eS},BreadcrumbList:function(){return ZE},BreadcrumbPage:function(){return rS},BreadcrumbSeparator:function(){return tS},Button:function(){return le},ButtonGroup:function(){return yi},Checkbox:function(){return Te},Container:function(){return Ip},Dialog:function(){return TS},Drawer:function(){return l_},EditorInput:function(){return gE},Input:function(){return ct},Label:function(){return ht},Loader:function(){return gt},Menu:function(){return AE},ProgressBar:function(){return vt},ProgressSteps:function(){return _E},RadioButton:function(){return Ue},RadioButtonGroup:function(){return Ve},Select:function(){return gh},Sidebar:function(){return $E},Skeleton:function(){return PE},Switch:function(){return ge},Tabs:function(){return Jf},TextArea:function(){return et},Title:function(){return pt},Toaster:function(){return ep},Tooltip:function(){return di},Topbar:function(){return AS},toast:function(){return jh}});var o=n(609),i=n.n(o);const s=e=>{const t=u(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),a(n,t)||c(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},a=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?a(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find((({validator:e})=>e(i)))?.classGroupId},l=/^\[(.+)\]$/,c=e=>{if(l.test(e)){const t=l.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},u=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return p(Object.entries(e.classGroups),n).forEach((([e,n])=>{d(n,r,e,t)})),r},d=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return h(e)?void d(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{d(o,f(t,e),n,r)}))}else(""===e?t:f(t,e)).classGroupId=n}))},f=(e,t)=>{let n=e;return t.split("-").forEach((e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n},h=e=>e.isThemeGetter,p=(e,t)=>t?e.map((([e,n])=>[e,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,n])=>[t+e,n]))):e))])):e,m=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},g=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,s=e=>{const n=[];let s,a=0,l=0;for(let c=0;cl?s-l:void 0}};return n?e=>n({className:e,parseClassName:s}):s},v=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach((e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)})),t.push(...n.sort()),t},y=/\s+/;function b(){let e,t,n=0,r="";for(;n{if("string"==typeof e)return e;let t,n="";for(let r=0;rt(e)),e());return n=(e=>({cache:m(e.cacheSize),parseClassName:g(e),...s(e)}))(c),r=n.cache.get,o=n.cache.set,i=a,a(l)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(y);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),h=r(f?u.substring(0,d):u);if(!h){if(!f){a=t+(a.length>0?" "+a:a);continue}if(h=r(u),!h){a=t+(a.length>0?" "+a:a);continue}f=!1}const p=v(l).join(":"),m=c?p+"!":p,g=m+h;if(i.includes(g))continue;i.push(g);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(b.apply(null,arguments))}}const E=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},S=/^\[(?:([a-z-]+):)?(.+)\]$/i,_=/^\d+\/\d+$/,k=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,P=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,O=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N=e=>j(e)||k.has(e)||_.test(e),A=e=>H(e,"length",q),j=e=>Boolean(e)&&!Number.isNaN(Number(e)),M=e=>H(e,"number",j),I=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&j(e.slice(0,-1)),L=e=>S.test(e),F=e=>C.test(e),z=new Set(["length","size","percentage"]),B=e=>H(e,z,Y),V=e=>H(e,"position",Y),W=new Set(["image","url"]),U=e=>H(e,W,X),$=e=>H(e,"",G),K=()=>!0,H=(e,t,n)=>{const r=S.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},q=e=>P.test(e)&&!T.test(e),Y=()=>!1,G=e=>O.test(e),X=e=>R.test(e),J=(Symbol.toStringTag,()=>{const e=E("colors"),t=E("spacing"),n=E("blur"),r=E("brightness"),o=E("borderColor"),i=E("borderRadius"),s=E("borderSpacing"),a=E("borderWidth"),l=E("contrast"),c=E("grayscale"),u=E("hueRotate"),d=E("invert"),f=E("gap"),h=E("gradientColorStops"),p=E("gradientColorStopPositions"),m=E("inset"),g=E("margin"),v=E("opacity"),y=E("padding"),b=E("saturate"),x=E("scale"),w=E("sepia"),S=E("skew"),_=E("space"),k=E("translate"),C=()=>["auto",L,t],P=()=>[L,t],T=()=>["",N,A],O=()=>["auto",j,L],R=()=>["","0",L],z=()=>[j,L];return{cacheSize:500,separator:":",theme:{colors:[K],spacing:[N,A],blur:["none","",F,L],brightness:z(),borderColor:[e],borderRadius:["none","","full",F,L],borderSpacing:P(),borderWidth:T(),contrast:z(),grayscale:R(),hueRotate:z(),invert:R(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[D,A],inset:C(),margin:C(),opacity:z(),padding:P(),saturate:z(),scale:z(),sepia:R(),skew:z(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",L]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,L]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",I,L]}],"grid-cols":[{"grid-cols":[K]}],"col-start-end":[{col:["auto",{span:["full",I,L]},L]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[K]}],"row-start-end":[{row:["auto",{span:[I,L]},L]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,A]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",M]}],"font-family":[{font:[K]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",j,M]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",N,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",N,A]}],"underline-offset":[{"underline-offset":["auto",N,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",V]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",B]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[N,L]}],"outline-w":[{outline:[N,A]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[N,A]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,$]}],"shadow-color":[{shadow:[K]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",F,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[I,L]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[N,A,M]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Z=w(J);function Q(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;tsvg]:h-4 [&>svg]:w-4",sm:"p-2 rounded-sm [&>svg]:h-4 [&>svg]:w-4",md:"p-2.5 rounded-md text-sm [&>svg]:h-5 [&>svg]:w-5",lg:"p-3 rounded-lg text-base [&>svg]:h-6 [&>svg]:w-6"})||void 0===o?void 0:o[u],A=null,j="";E&&(j="flex items-center justify-center gap-1","left"===_?s=E:A=E);var M=p;return i().createElement(M,se({ref:t,type:f,className:te(j,"border border-solid cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",N,O,R,T,m),disabled:y},P),s,g,A)})),le=ae;let ce=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var ue=["id","onChange","value","defaultValue","size","disabled","label","name","className"];function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ");var ye={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const be=(0,o.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>(0,o.createElement)("svg",{ref:c,...ye,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:ve("lucide",i),...l},[...a.map((([e,t])=>(0,o.createElement)(e,t))),...Array.isArray(s)?s:[s]]))),xe=(e,t)=>{const n=(0,o.forwardRef)((({className:n,...r},i)=>{return(0,o.createElement)(be,{ref:i,iconNode:t,className:ve(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s}));return n.displayName=`${e}`,n},we=xe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Ee=xe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Se=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"},Ae=["id","label","value","children","disabled","icon","inlineIcon","hideSelection","reversePosition","borderOn","badgeItem","useSwitch"],je=["id","children","value","disabled","size"];function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4"},h):null,r,b&&React.createElement("span",{className:_,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(Ke,null),React.createElement("span",{className:"absolute -inset-1"}))):null},qe=(0,o.forwardRef)(He);qe.displayName="Badge";var Ye=qe,Ge=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-3 [&>svg]:w-3 text-xs",sm:"w-6 h-6 [&>svg]:h-4 [&>svg]:w-4 text-sm",md:"w-8 h-8 [&>svg]:h-5 [&>svg]:w-5 text-base",lg:"w-10 h-10 [&>svg]:h-6 [&>svg]:w-6 text-lg"})||void 0===n?void 0:n[l],v=null===(r={none:"",subtle:"border border-solid border-border-transparent-subtle",ring:"border-4 border-solid border-border-white"})||void 0===r?void 0:r[f&&"none"===u?"subtle":u],y=f?"bg-cover bg-center bg-no-repeat":"";return React.createElement("div",{className:te("rounded-full overflow-hidden flex items-center justify-center",!f&&m,g,v,y,p),style:f?{backgroundImage:"url(".concat(f,")")}:{}},h?"string"==typeof h?null==h||null===(o=h[0])||void 0===o?void 0:o.toUpperCase():h:null)};const nt=xe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var rt=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?j(t[0].name):j(null):t=e.target.value,P||"file"===i||R(t),"function"==typeof g&&g(t))},D="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full focus:outline-none",L={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},F={sm:"text-xs",md:"text-base",lg:"text-base"},z={sm:E?"pl-8":"",md:E?"pl-9":"",lg:E?"pl-10":""},B={sm:_?"pr-8":"",md:_?"pr-9":"",lg:_?"pr-10":""},V=p?"hover:border-border-disabled":"hover:border-border-strong",W="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",U=y?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",$=y?"focus:border-focus-error-border focus:ring-field-color-error":"",K=p?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",H=p?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",q="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",Y=p?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",G=A?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===i?React.createElement("div",{className:te("relative flex focus-within:z-10",f)},React.createElement("input",ot({ref:t,id:C,type:"file",className:te(D,H,L[u],F[u],W,V,$,G),disabled:p,onChange:I,onInvalid:x},k)),React.createElement("div",{className:te(Y,"right-0 pr-3",{sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6"}[u])},React.createElement(nt,null))):React.createElement("div",{className:te("relative flex focus-within:z-10",f)},E?React.createElement("div",{className:te(q,"left-0 pl-3",F[u])},E):null,React.createElement("input",ot({ref:t,id:C,type:i,className:te(D,K,L[u],F[u],z[u],B[u],W,V,U),disabled:p,onChange:I,onInvalid:x,value:M()},k)),_?React.createElement("div",{className:te(q,"right-0 pr-3",F[u])},_):null)},lt=(0,o.forwardRef)(at);lt.displayName="Input";var ct=lt,ut=["children","tag","size","className","variant","required"];function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[l],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[f],g,u)},m),r)})),ht=ft,pt=function(e){var t=e.title,n=void 0===t?null:t,r=e.description,o=void 0===r?null:r,i=e.icon,s=void 0===i?null:i,a=e.iconPosition,l=void 0===a?"right":a,c=e.tag,u=void 0===c?"h2":c,d=e.size,f=void 0===d?"sm":d,h=e.className,p=void 0===h?"":h,m={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!n)return null;var g=function(){var e=u;return React.createElement(e,{className:te("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[f])},n)};return o?React.createElement("div",{className:p},React.createElement("div",null,s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:te("text-text-secondary font-normal",{xs:"text-base",sm:"text-lg",md:"text-xl",lg:"text-2xl"}[f])},o)):React.createElement("div",{className:p},s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g())};const mt=xe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var gt=function(e){var t,n,r=e.variant,o=void 0===r?"primary":r,i=e.size,s=void 0===i?"md":i,a=e.icon,l=void 0===a?null:a,c=e.className,u=void 0===c?"":c,d=null===(t={primary:"text-brand-primary-600 bg-background-primary",secondary:"text-background-primary bg-brand-primary-600"})||void 0===t?void 0:t[o],f=null===(n={sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6",xl:"[&>svg]:h-8 [&>svg]:w-8"})||void 0===n?void 0:n[s];return React.createElement("span",{className:te("flex",f,d,u)},l||React.createElement(mt,{className:"animate-spin"}))},vt=function(e){var t=e.progress,n=void 0===t?0:t,r=e.speed,o=void 0===r?200:r,i=e.className,s=void 0===i?"":i;if(!n)return null;var a=n;n<0&&(a=0),n>100&&(a=100);var l="translateX(-".concat(100-a,"%)"),c="h-2 rounded-full bg-background-brand absolute left-0 top-0 w-full bottom-0 origin-left transition-transform duration-".concat(o," ease-linear");return React.createElement("div",{className:te("h-2 rounded-full bg-misc-progress-background overflow-hidden relative",s),role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},React.createElement("div",{className:c,style:{transform:l}}))};function yt(e){return wt(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function xt(e){var t;return null==(t=(wt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function wt(e){return e instanceof Node||e instanceof bt(e).Node}function Et(e){return e instanceof Element||e instanceof bt(e).Element}function St(e){return e instanceof HTMLElement||e instanceof bt(e).HTMLElement}function _t(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot)}function kt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ct(e){return["table","td","th"].includes(yt(e))}function Pt(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Tt(e){const t=Ot(),n=Et(e)?Nt(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Ot(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Rt(e){return["html","body","#document"].includes(yt(e))}function Nt(e){return bt(e).getComputedStyle(e)}function At(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if("html"===yt(e))return e;const t=e.assignedSlot||e.parentNode||_t(e)&&e.host||xt(e);return _t(t)?t.host:t}function Mt(e){const t=jt(e);return Rt(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&kt(t)?t:Mt(t)}function It(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Mt(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=bt(o);if(i){const e=Dt(s);return t.concat(s,s.visualViewport||[],kt(o)?o:[],e&&n?It(e):[])}return t.concat(o,It(o,[],n))}function Dt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Ft(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_t(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function zt(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Bt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Vt(e){return!(0!==e.mozInputSource||!e.isTrusted)||($t()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Wt(e){return!Bt().includes("jsdom/")&&(!$t()&&0===e.width&&0===e.height||$t()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function Ut(){return/apple/i.test(navigator.vendor)}function $t(){const e=/android/i;return e.test(zt())||e.test(Bt())}function Kt(){return zt().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ht(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qt(e){return(null==e?void 0:e.ownerDocument)||document}function Yt(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Gt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Xt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Jt(e){return St(e)&&e.matches(Xt)}function Zt(e){e.preventDefault(),e.stopPropagation()}function Qt(e){return!!e&&"combobox"===e.getAttribute("role")&&Jt(e)}const en=Math.min,tn=Math.max,nn=Math.round,rn=Math.floor,on=e=>({x:e,y:e}),sn={left:"right",right:"left",bottom:"top",top:"bottom"},an={start:"end",end:"start"};function ln(e,t,n){return tn(e,en(t,n))}function cn(e,t){return"function"==typeof e?e(t):e}function un(e){return e.split("-")[0]}function dn(e){return e.split("-")[1]}function fn(e){return"x"===e?"y":"x"}function hn(e){return"y"===e?"height":"width"}function pn(e){return["top","bottom"].includes(un(e))?"y":"x"}function mn(e){return fn(pn(e))}function gn(e){return e.replace(/start|end/g,(e=>an[e]))}function vn(e){return e.replace(/left|right|bottom|top/g,(e=>sn[e]))}function yn(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 bn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var xn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),wn="undefined"==typeof Element,En=wn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Sn=!wn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},kn=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Cn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!kn(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{En.call(s,xn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!kn(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},Pn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Tn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Pn(e)?0:e.tabIndex},On=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Rn=function(e){return"INPUT"===e.tagName},Nn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},An=function(e,t){return!(t.disabled||kn(t)||function(e){return Rn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=En.call(e,"details>summary:first-of-type")?e.parentElement:e;if(En.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Nn(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=Sn(e);if(s&&!s.shadowRoot&&!0===r(s))return Nn(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&Sn(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=Sn(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},In=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,s=i?t.scopeParent:t,a=function(e,t){var n=Tn(e);return n<0&&t&&!Pn(e)?0:n}(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(On).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Dn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Cn([e],t.includeContainer,{filter:jn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Mn}):function(e,t,n){if(kn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(xn));return t&&En.call(e,xn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,jn.bind(null,t)),In(n)},Ln=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==En.call(e,xn)&&jn(t,e)},Fn=window.ReactDOM;function zn(e,t,n){let{reference:r,floating:o}=e;const i=pn(t),s=mn(t),a=hn(s),l=un(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.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-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(dn(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function Bn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=cn(t,e),p=yn(h),m=a[f?"floating"===d?"reference":"floating":d],g=bn(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=bn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function Vn(e){const t=Nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=St(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=nn(n)!==i||nn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Wn(e){return Et(e)?e:e.contextElement}function Un(e){const t=Wn(e);if(!St(t))return on(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Vn(t);let s=(i?nn(n.width):n.width)/r,a=(i?nn(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const $n=on(0);function Kn(e){const t=bt(e);return Ot()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$n}function Hn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Wn(e);let s=on(1);t&&(r?Et(r)&&(s=Un(r)):s=Un(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==bt(e))&&t}(i,n,r)?Kn(i):on(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=bt(i),t=r&&Et(r)?bt(r):r;let n=e,o=Dt(n);for(;o&&r&&t!==n;){const e=Un(o),t=o.getBoundingClientRect(),r=Nt(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=bt(o),o=Dt(n)}}return bn({width:u,height:d,x:l,y:c})}function qn(e){return Hn(xt(e)).left+At(e).scrollLeft}function Yn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=bt(e),r=xt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=Ot();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=xt(e),n=At(e),r=e.ownerDocument.body,o=tn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+qn(e);const a=-n.scrollTop;return"rtl"===Nt(r).direction&&(s+=tn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(xt(e));else if(Et(t))r=function(e,t){const n=Hn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=St(e)?Un(e):on(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Kn(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return bn(r)}function Gn(e,t){const n=jt(e);return!(n===t||!Et(n)||Rt(n))&&("fixed"===Nt(n).position||Gn(n,t))}function Xn(e,t,n){const r=St(t),o=xt(t),i="fixed"===n,s=Hn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=on(0);if(r||!r&&!i)if(("body"!==yt(t)||kt(o))&&(a=At(t)),r){const e=Hn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=qn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Jn(e){return"static"===Nt(e).position}function Zn(e,t){return St(e)&&"fixed"!==Nt(e).position?t?t(e):e.offsetParent:null}function Qn(e,t){const n=bt(e);if(Pt(e))return n;if(!St(e)){let t=jt(e);for(;t&&!Rt(t);){if(Et(t)&&!Jn(t))return t;t=jt(t)}return n}let r=Zn(e,t);for(;r&&Ct(r)&&Jn(r);)r=Zn(r,t);return r&&Rt(r)&&Jn(r)&&!Tt(r)?n:r||function(e){let t=jt(e);for(;St(t)&&!Rt(t);){if(Tt(t))return t;if(Pt(t))return null;t=jt(t)}return null}(e)||n}const er={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=xt(r),a=!!t&&Pt(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=on(1);const u=on(0),d=St(r);if((d||!d&&!i)&&(("body"!==yt(r)||kt(s))&&(l=At(r)),St(r))){const e=Hn(r);c=Un(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:xt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Pt(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=It(e,[],!1).filter((e=>Et(e)&&"body"!==yt(e))),o=null;const i="fixed"===Nt(e).position;let s=i?jt(e):e;for(;Et(s)&&!Rt(s);){const t=Nt(s),n=Tt(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||kt(s)&&!n&&Gn(e,s))?r=r.filter((e=>e!==s)):o=t,s=jt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Yn(t,n,o);return e.top=tn(r.top,e.top),e.right=en(r.right,e.right),e.bottom=en(r.bottom,e.bottom),e.left=tn(r.left,e.left),e}),Yn(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Qn,getElementRects:async function(e){const t=this.getOffsetParent||Qn,n=this.getDimensions,r=await n(e.floating);return{reference:Xn(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}=Vn(e);return{width:t,height:n}},getScale:Un,isElement:Et,isRTL:function(e){return"rtl"===Nt(e).direction}};function tr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Wn(e),u=o||i?[...c?It(c):[],...It(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=xt(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h={rootMargin:-rn(u)+"px "+-rn(o.clientWidth-(c+d))+"px "+-rn(o.clientHeight-(u+f))+"px "+-rn(c)+"px",threshold:tn(0,en(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?Hn(e):null;return l&&function t(){const r=Hn(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const nr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=un(n),a=dn(n),l="y"===pn(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=cn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},rr=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=cn(e,t),c={x:n,y:r},u=await Bn(t,l),d=pn(un(o)),f=fn(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=ln(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=ln(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},or=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=cn(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=un(o),y=pn(a),b=un(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[vn(a)]:function(e){const t=vn(e);return[gn(e),t,gn(t)]}(a)),E="none"!==p;!f&&E&&w.push(...function(e,t,n,r){const o=dn(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(un(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(gn)))),i}(a,m,p,x));const S=[a,...w],_=await Bn(t,g),k=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&k.push(_[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=dn(e),o=mn(e),i=hn(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=vn(s)),[s,vn(s)]}(o,s,x);k.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:o,overflows:k}],!k.every((e=>e<=0))){var P,T;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(T=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(h){case"bestFit":{var O;const e=null==(O=C.filter((e=>{if(E){const t=pn(e.placement);return t===y||"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:O[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},ir=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=cn(e,t),l=await Bn(t,a),c=un(n),u=dn(n),d="y"===pn(n),{width:f,height:h}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,y=en(h-l[p],g),b=en(f-l[m],v),x=!t.middlewareData.shift;let w=y,E=b;if(d?E=u||x?en(b,v):v:w=u||x?en(y,g):g,x&&!u){const e=tn(l.left,0),t=tn(l.right,0),n=tn(l.top,0),r=tn(l.bottom,0);d?E=f-2*(0!==e||0!==t?e+t:tn(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:tn(l.top,l.bottom))}await s({...t,availableWidth:E,availableHeight:w});const S=await o.getDimensions(i.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},sr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=cn(e,t)||{};if(null==c)return{};const d=yn(u),f={x:n,y:r},h=mn(o),p=hn(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],E=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==s.isElement?void 0:s.isElement(E))||(S=a.floating[b]||i.floating[p]);const _=x/2-w/2,k=S/2-m[p]/2-1,C=en(d[v],k),P=en(d[y],k),T=C,O=S-m[p]-P,R=S/2-m[p]/2+_,N=ln(T,R,O),A=!l.arrow&&null!=dn(o)&&R!==N&&i.reference[p]/2-(R{const r=new Map,o={platform:er,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=zn(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const hr=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?sr({element:n.current,padding:r}).fn(t):{}:n?sr({element:n,padding:r}).fn(t):{};var o}}),pr=(e,t)=>({...nr(e),options:[e,t]}),mr=(e,t)=>({...or(e),options:[e,t]}),gr=(e,t)=>({...hr(e),options:[e,t]}),vr={...o},yr=vr.useInsertionEffect||(e=>e());function br(e){const t=o.useRef((()=>{}));return yr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function Cr(e,t){return Tr(e,{disabledIndices:t})}function Pr(e,t){return Tr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Tr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t;const s=e.current;let a=n;do{a+=r?-i:i}while(a>=0&&a<=s.length-1&&Nr(s,a,o));return a}function Or(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function Rr(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function Nr(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Ar=0;function jr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ar);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ar=requestAnimationFrame(i)}var Mr="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function Ir(){return Ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+Lr++,zr=vr.useId||function(){const[e,t]=o.useState((()=>Dr?Fr():void 0));return Mr((()=>{null==e&&t(Fr())}),[]),o.useEffect((()=>{Dr=!0}),[]),e},Br=o.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:h,style:{transform:p,...m}={},...g}=e,v=zr(),[y,b]=o.useState(!1);if(Mr((()=>{r&&"rtl"===Nt(r).direction&&b(!0)}),[r]),!r)return null;const[x,w]=n.split("-"),E="top"===x||"bottom"===x;let S=d;(E&&null!=s&&s.x||!E&&null!=s&&s.y)&&(S=null);const _=2*u,k=_/2,C=a/2*(c/-8+1),P=l/2*c/4,T=!!h,O=S&&"end"===w?"bottom":"top";let R=S&&"end"===w?"right":"left";S&&y&&(R="end"===w?"left":"right");const N=null!=(null==i?void 0:i.x)?S||i.x:"",A=null!=(null==i?void 0:i.y)?S||i.y:"",j=h||"M0,0 H"+a+" L"+(a-C)+","+(l-P)+" Q"+a/2+","+l+" "+C+","+(l-P)+" Z",M={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",Ir({},g,{"aria-hidden":!0,ref:t,width:T?a:a+_,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[R]:N,[O]:A,[x]:E||T?"100%":"calc(100% - "+_/2+"px)",transform:""+M+(null!=p?p:""),...m}}),_>0&&o.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:_+(h?0:1),d:j}),o.createElement("path",{stroke:_&&!h?g.fill:"none",d:j}),o.createElement("clipPath",{id:v},o.createElement("rect",{x:-k,y:k*(T?-1:1),width:a+_,height:a})))}));const Vr=o.createContext(null),Wr=o.createContext(null),Ur=()=>{var e;return(null==(e=o.useContext(Vr))?void 0:e.id)||null},$r=()=>o.useContext(Wr);function Kr(e){return"data-floating-ui-"+e}function Hr(e){const t=(0,o.useRef)(e);return Mr((()=>{t.current=e})),t}const qr=Kr("safe-polygon");function Yr(e,t,n){return n&&!Ht(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Gr(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Xr=new WeakMap,Jr=new WeakSet,Zr={},Qr=0;const eo=e=>e&&(e.host||eo(e.parentNode)),to=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=eo(t);return e.contains(n)?n:null})).filter((e=>null!=e));function no(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=qt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=to(t,e),a=new Set,l=new Set(s),c=[];Zr[o]||(Zr[o]=new WeakMap);const u=Zr[o];return s.forEach((function e(t){t&&!a.has(t)&&(a.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==yt(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Xr.get(t)||0)+1,s=(u.get(t)||0)+1;Xr.set(t,r),u.set(t,s),c.push(t),1===r&&n&&Jr.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Qr++,()=>{c.forEach((e=>{const t=(Xr.get(e)||0)-1,n=(u.get(e)||0)-1;Xr.set(e,t),u.set(e,n),t||(!Jr.has(e)&&i&&e.removeAttribute(i),Jr.delete(e)),n||e.removeAttribute(o)})),Qr--,Qr||(Xr=new WeakMap,Xr=new WeakMap,Jr=new WeakSet,Zr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const ro=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function oo(e,t){const n=Dn(e,ro());"prev"===t&&n.reverse();const r=n.indexOf(Lt(qt(e)));return n.slice(r+1)[0]}function io(){return oo(document.body,"next")}function so(){return oo(document.body,"prev")}function ao(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ft(n,r)}function lo(e){Dn(e,ro()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function co(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const uo={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function fo(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const ho=o.forwardRef((function(e,t){const[n,r]=o.useState();Mr((()=>(Ut()&&r("button"),document.addEventListener("keydown",fo),()=>{document.removeEventListener("keydown",fo)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Kr("focus-guard")]:"",style:uo};return o.createElement("span",Ir({},e,i))})),po=o.createContext(null),mo=Kr("portal");function go(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=zr(),i=vo(),[s,a]=o.useState(null),l=o.useRef(null);return Mr((()=>()=>{null==s||s.remove(),queueMicrotask((()=>{l.current=null}))}),[s]),Mr((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(mo,""),e.appendChild(n),l.current=n,a(n)}),[t,r]),Mr((()=>{if(!r)return;if(l.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!Et(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const s=document.createElement("div");s.id=r,s.setAttribute(mo,""),e=o||e,e.appendChild(s),l.current=s,a(s)}),[t,n,r,i]),s}({id:n,root:r}),[a,l]=o.useState(null),c=o.useRef(null),u=o.useRef(null),d=o.useRef(null),f=o.useRef(null),h=null==a?void 0:a.modal,p=null==a?void 0:a.open,m=!!a&&!a.modal&&a.open&&i&&!(!r&&!s);return o.useEffect((()=>{if(s&&i&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&ao(e)&&("focusin"===e.type?co:lo)(s)}}),[s,i,h]),o.useEffect((()=>{s&&(p||co(s))}),[p,s]),o.createElement(po.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:l})),[i,s])},m&&s&&o.createElement(ho,{"data-type":"outside",ref:c,onFocus:e=>{if(ao(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=so()||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),m&&s&&o.createElement("span",{"aria-owns":s.id,style:uo}),s&&Fn.createPortal(t,s),m&&s&&o.createElement(ho,{"data-type":"outside",ref:u,onFocus:e=>{if(ao(e,s)){var t;null==(t=f.current)||t.focus()}else{const t=io()||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const vo=()=>o.useContext(po),yo="data-floating-ui-focusable";function bo(e){return e?e.hasAttribute(yo)?e:e.querySelector("["+yo+"]")||e:null}const xo=20;let wo=[];function Eo(e){wo=wo.filter((e=>e.isConnected));let t=e;if(t&&"body"!==yt(t)){if(!Ln(t,ro())){const e=Dn(t,ro())[0];e&&(t=e)}wo.push(t),wo.length>xo&&(wo=wo.slice(-xo))}}function So(){return wo.slice().reverse().find((e=>e.isConnected))}const _o=o.forwardRef((function(e,t){return o.createElement("button",Ir({},e,{type:"button",ref:t,tabIndex:-1,style:uo}))}));function ko(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:v,dataRef:y,floatingId:b,elements:{domReference:x,floating:w}}=t,E="number"==typeof a&&a<0,S=Qt(x)&&E,_=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||s,k=Hr(i),C=Hr(a),P=Hr(l),T=$r(),O=vo(),R=o.useRef(null),N=o.useRef(null),A=o.useRef(!1),j=o.useRef(!1),M=o.useRef(-1),I=null!=O,D=bo(w),L=br((function(e){return void 0===e&&(e=D),e?Dn(e,ro()):[]})),F=br((e=>{const t=L(e);return k.current.map((e=>x&&"reference"===e?x:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function z(e){return!r&&d&&u?o.createElement(_o,{ref:"start"===e?R:N,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}o.useEffect((()=>{A.current=!1}),[r]),o.useEffect((()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){Ft(D,Lt(qt(D)))&&0===L().length&&!S&&Zt(e);const t=F(),n=Gt(e);"reference"===k.current[0]&&n===x&&(Zt(e),e.shiftKey?jr(t[t.length-1]):jr(t[1])),"floating"===k.current[1]&&n===D&&e.shiftKey&&(Zt(e),jr(t[0]))}}const t=qt(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,x,D,u,k,S,L,F]),o.useEffect((()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Gt(e),n=L().indexOf(t);-1!==n&&(M.current=n)}}),[r,w,L]),o.useEffect((()=>{if(!r&&f)return w&&St(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout((()=>{j.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(Ft(x,t)||Ft(w,t)||Ft(t,w)||Ft(null==O?void 0:O.portalNode,t)||null!=t&&t.hasAttribute(Kr("focus-guard"))||T&&(Gr(T.nodesRef.current,m).find((e=>{var n,r;return Ft(null==(n=e.context)?void 0:n.elements.floating,t)||Ft(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(T.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(c&&n&&Lt(qt(D))===qt(D).body){St(D)&&D.focus();const e=M.current,t=L(),n=t[e]||t[t.length-1]||D;St(n)&&n.focus()}!S&&u||!t||!n||j.current||t===So()||(A.current=!0,g(!1,e,"focus-out"))}))}}),[r,x,w,D,u,m,T,O,g,f,c,L,S]),o.useEffect((()=>{var e;if(r)return;const t=Array.from((null==O||null==(e=O.portalNode)?void 0:e.querySelectorAll("["+Kr("portal")+"]"))||[]);if(w){const e=[w,...t,R.current,N.current,k.current.includes("reference")||S?x:null].filter((e=>null!=e)),n=u||S?no(e,_,!_):no(e);return()=>{n()}}}),[r,x,w,u,k,O,S,_]),Mr((()=>{if(r||!St(D))return;const e=Lt(qt(D));queueMicrotask((()=>{const t=F(D),n=C.current,r=("number"==typeof n?t[n]:n.current)||D,o=Ft(D,e);E||o||!h||jr(r,{preventScroll:r===D})}))}),[r,h,D,E,F,C]),Mr((()=>{if(r||!D)return;let e=!1;const t=qt(D),n=Lt(t);let o=y.current.openEvent;const i=p.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&p.domReference.current&&Eo(p.domReference.current),"hover"===r&&"mouseleave"===i.type&&(A.current=!0),"outside-press"===r&&(s?(A.current=!1,e=!0):A.current=!(Vt(i)||Wt(i)))}return Eo(n),v.on("openchange",s),()=>{v.off("openchange",s);const r=Lt(t),a=Ft(w,r)||T&&Gr(T.nodesRef.current,m).some((e=>{var t;return Ft(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&Eo(p.domReference.current);const l=i||n,c=Dn(qt(l).body,ro());queueMicrotask((()=>{let n=So();!n&&St(l)&&w&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Kr("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||Ft(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,w)),P.current&&!A.current&&St(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,w,D,P,y,p,v,T,m]),Mr((()=>{if(!r&&O)return O.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{O.setFocusManagerState(null)}}),[r,O,u,h,g,p,f]),Mr((()=>{if(r)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(E)return;const e=()=>{const e=D.getAttribute("tabindex"),t=L(),n=Lt(qt(w)),r=t.indexOf(n);-1!==r&&(M.current=r),k.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,w,D,p,k,L,E]);const B=!r&&_&&(!u||!S)&&(I||u);return o.createElement(o.Fragment,null,B&&o.createElement(ho,{"data-type":"inside",ref:null==O?void 0:O.beforeInsideRef,onFocus:e=>{if(u){const e=F();jr("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(A.current=!1,ao(e,O.portalNode)){const e=io()||x;null==e||e.focus()}else{var t;null==(t=O.beforeOutsideRef.current)||t.focus()}}}),!S&&z("start"),n,z("end"),B&&o.createElement(ho,{"data-type":"inside",ref:null==O?void 0:O.afterInsideRef,onFocus:e=>{if(u)jr(F()[0]);else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(f&&(A.current=!0),ao(e,O.portalNode)){const e=so()||x;null==e||e.focus()}else{var t;null==(t=O.afterOutsideRef.current)||t.focus()}}}))}function Co(e){return St(e.target)&&"BUTTON"===e.target.tagName}function Po(e){return Jt(e)}function To(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0}=t,f=o.useRef(),h=o.useRef(!1),p=o.useMemo((()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==l&&(Ht(t,!0)&&u||(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===l&&f.current?f.current=void 0:Ht(t,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||Co(e)||(" "!==e.key||Po(s)||(e.preventDefault(),h.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||Co(e)||Po(s)||" "===e.key&&h.current&&(h.current=!1,r(!n||!c,e.nativeEvent,"click"))}})),[i,s,l,u,d,r,n,c]);return o.useMemo((()=>a?{reference:p}:{}),[a,p])}const Oo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ro={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},No=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Ao(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=$r(),v=br("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,b=o.useRef(!1),x=o.useRef(!1),{escapeKey:w,outsidePress:E}=No(p),{escapeKey:S,outsidePress:_}=No(m),k=br((e=>{var t;if(!n||!a||!l||"Escape"!==e.key)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=g?Gr(g.nodesRef.current,o):[];if(!w&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),C=br((e=>{var t;const n=()=>{var t;k(e),null==(t=Gt(e))||t.removeEventListener("keydown",n)};null==(t=Gt(e))||t.addEventListener("keydown",n)})),P=br((e=>{var t;const n=b.current;b.current=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const a=Gt(e),l="["+Kr("inert")+"]",c=qt(i.floating).querySelectorAll(l);let d=Et(a)?a:null;for(;d&&!Rt(d);){const e=jt(d);if(Rt(e)||!Et(e))break;d=e}if(c.length&&Et(a)&&!a.matches("html,body")&&!Ft(a,i.floating)&&Array.from(c).every((e=>!Ft(d,e))))return;if(St(a)&&R){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===Nt(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=g&&Gr(g.nodesRef.current,f).some((t=>{var n;return Yt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Yt(e,i.floating)||Yt(e,i.domReference)||h)return;const p=g?Gr(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),T=br((e=>{var t;const n=()=>{var t;P(e),null==(t=Gt(e))||t.removeEventListener(u,n)};null==(t=Gt(e))||t.addEventListener(u,n)}));o.useEffect((()=>{if(!n||!a)return;function e(e){r(!1,e,"ancestor-scroll")}s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=E;const t=qt(i.floating);l&&t.addEventListener("keydown",S?C:k,S),y&&t.addEventListener(u,_?T:P,_);let o=[];return h&&(Et(i.domReference)&&(o=It(i.domReference)),Et(i.floating)&&(o=o.concat(It(i.floating))),!Et(i.reference)&&i.reference&&i.reference.contextElement&&(o=o.concat(It(i.reference.contextElement)))),o=o.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),o.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{l&&t.removeEventListener("keydown",S?C:k,S),y&&t.removeEventListener(u,_?T:P,_),o.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[s,i,l,y,u,n,r,h,a,w,E,k,S,C,P,_,T]),o.useEffect((()=>{b.current=!1}),[y,u]);const O=o.useMemo((()=>({onKeyDown:k,[Oo[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,d,f]),R=o.useMemo((()=>({onKeyDown:k,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ro[u]]:()=>{b.current=!0}})),[k,u]);return o.useMemo((()=>a?{reference:O,floating:R}:{}),[a,O,R])}function jo(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=zr(),s=o.useRef({}),[a]=o.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),l=null!=Ur(),[c,u]=o.useState(r.reference),d=br(((e,t,r)=>{s.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),f=o.useMemo((()=>({setPositionReference:u})),[]),h=o.useMemo((()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference})),[c,r.reference,r.floating]);return o.useMemo((()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:a,floatingId:i,refs:f})),[t,d,h,a,i,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,a]=o.useState(null),[l,c]=o.useState(null),u=(null==i?void 0:i.reference)||s,d=o.useRef(null),f=$r();Mr((()=>{u&&(d.current=u)}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=o.useState(r);cr(h,r)||p(r);const[m,g]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=o.useCallback((e=>{e!==_.current&&(_.current=e,y(e))}),[]),w=s||m,E=a||v,S=o.useRef(null),_=o.useRef(null),k=o.useRef(d),C=null!=c,P=fr(c),T=fr(i),O=o.useCallback((()=>{if(!S.current||!_.current)return;const e={placement:t,strategy:n,middleware:h};T.current&&(e.platform=T.current),ar(S.current,_.current,e).then((e=>{const t={...e,isPositioned:!0};R.current&&!cr(k.current,t)&&(k.current=t,Fn.flushSync((()=>{f(t)})))}))}),[h,t,n,T]);lr((()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const R=o.useRef(!1);lr((()=>(R.current=!0,()=>{R.current=!1})),[]),lr((()=>{if(w&&(S.current=w),E&&(_.current=E),w&&E){if(P.current)return P.current(w,E,O);O()}}),[w,E,O,P,C]);const N=o.useMemo((()=>({reference:S,floating:_,setReference:b,setFloating:x})),[b,x]),A=o.useMemo((()=>({reference:w,floating:E})),[w,E]),j=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=dr(A.floating,d.x),r=dr(A.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...ur(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,A.floating,d.x,d.y]);return o.useMemo((()=>({...d,update:O,refs:N,elements:A,floatingStyles:j})),[d,O,N,A,j])}({...e,elements:{...i,...l&&{reference:l}}}),p=o.useCallback((e=>{const t=Et(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),m=o.useCallback((e=>{(Et(e)||null===e)&&(d.current=e,a(e)),(Et(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Et(e))&&h.refs.setReference(e)}),[h.refs]),g=o.useMemo((()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d})),[h.refs,m,p]),v=o.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=o.useMemo((()=>({...h,...r,refs:g,elements:v,nodeId:t})),[h,g,v,t,r]);return Mr((()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),o.useMemo((()=>({...h,context:y,refs:g,elements:v})),[h,g,v,y])}const Mo="active",Io="selected";function Do(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Mo]:t,[Io]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1,[yo]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[Mo,Io].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Lo(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),i=o.useCallback((t=>Do(t,e,"reference")),t),s=o.useCallback((t=>Do(t,e,"floating")),n),a=o.useCallback((t=>Do(t,e,"item")),r);return o.useMemo((()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a})),[i,s,a])}let Fo=!1;function zo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Bo(e,t){return zo(t,e===xr||e===wr,e===Er||e===Sr)}function Vo(e,t,n){return zo(t,e===wr,n?e===Er:e===Sr)||"Enter"===e||" "===e||""===e}function Wo(e,t,n){return zo(t,n?e===Sr:e===Er,e===xr)}function Uo(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:x="vertical",cols:w=1,scrollItemIntoView:E=!0,virtualItemRef:S,itemSizes:_,dense:k=!1}=t,C=Hr(bo(i.floating)),P=Ur(),T=$r(),O=br(l),R=o.useRef(g),N=o.useRef(null!=u?u:-1),A=o.useRef(null),j=o.useRef(!0),M=o.useRef(O),I=o.useRef(!!i.floating),D=o.useRef(n),L=o.useRef(!1),F=o.useRef(!1),z=Hr(b),B=Hr(n),V=Hr(E),W=Hr(u),[U,$]=o.useState(),[K,H]=o.useState(),q=br((function(e,t,n){function r(e){m?($(e.id),null==T||T.events.emit("virtualfocus",e),S&&(S.current=e)):jr(e,{preventScroll:!0,sync:!(!Kt()||!Ut())&&(Fo||L.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const i=e.current[t.current]||o;if(!i)return;o||r(i);const s=V.current;s&&G&&(n||!j.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));Mr((()=>{document.createElement("div").focus({get preventScroll(){return Fo=!0,!1}})}),[]),Mr((()=>{c&&(n&&i.floating?R.current&&null!=u&&(F.current=!0,N.current=u,O(u)):I.current&&(N.current=-1,M.current(null)))}),[c,n,i.floating,u,O]),Mr((()=>{if(c&&n&&i.floating)if(null==a){if(L.current=!1,null!=W.current)return;if(I.current&&(N.current=-1,q(s,N)),(!D.current||!I.current)&&R.current&&(null!=A.current||!0===R.current&&null==A.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(N.current=null==A.current||Vo(A.current,x,p)||h?Cr(s,z.current):Pr(s,z.current),A.current=null,O(N.current))};t()}}else kr(s,a)||(N.current=a,q(s,N,F.current),F.current=!1)}),[c,n,i.floating,a,W,h,s,x,p,O,q,z]),Mr((()=>{var e;if(!c||i.floating||!T||m||!I.current)return;const t=T.nodesRef.current,n=null==(e=t.find((e=>e.id===P)))||null==(e=e.context)?void 0:e.elements.floating,r=Lt(qt(i.floating)),o=t.some((e=>e.context&&Ft(e.context.elements.floating,r)));n&&!o&&j.current&&n.focus({preventScroll:!0})}),[c,i.floating,T,P,m]),Mr((()=>{if(c&&T&&m&&!P)return T.events.on("virtualfocus",e),()=>{T.events.off("virtualfocus",e)};function e(e){H(e.id),S&&(S.current=e)}}),[c,T,m,P,S]),Mr((()=>{M.current=O,I.current=!!i.floating})),Mr((()=>{n||(A.current=null)}),[n]),Mr((()=>{D.current=n}),[n]);const Y=null!=a,G=o.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&O(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;j.current&&"touch"!==t&&(N.current=-1,q(s,N),O(null),m||jr(C.current,{preventScroll:!0}))}}}}),[n,C,q,v,s,O,m]),X=br((e=>{if(j.current=!1,L.current=!0,!B.current&&e.currentTarget===C.current)return;if(h&&Wo(e.key,x,p))return Zt(e),r(!1,e.nativeEvent,"list-navigation"),void(St(i.domReference)&&!m&&i.domReference.focus());const t=N.current,o=Cr(s,b),a=Pr(s,b);if("Home"===e.key&&(Zt(e),N.current=o,O(N.current)),"End"===e.key&&(Zt(e),N.current=a,O(N.current)),w>1){const t=_||Array.from({length:s.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:s,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;nnull==r[e]))?(e.forEach((e=>{r[e]=i})),l=!0):o++}})),[...r]}(t,w,k),r=n.findIndex((e=>null!=e&&!Nr(s.current,e,b))),i=n.reduce(((e,t,n)=>null==t||Nr(s.current,t,b)?e:n),-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===xr){if(u&&Zt(n),-1===c)d=l;else if(d=Tr(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}kr(e,d)&&(d=c)}if(n.key===wr&&(u&&Zt(n),-1===c?d=a:(d=Tr(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=Tr(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),kr(e,d)&&(d=c)),"both"===r){const t=rn(c/i);n.key===Sr&&(u&&Zt(n),c%i!=i-1?(d=Tr(e,{startingIndex:c,disabledIndices:s}),o&&_r(d,i,t)&&(d=Tr(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=Tr(e,{startingIndex:c-c%i-1,disabledIndices:s})),_r(d,i,t)&&(d=c)),n.key===Er&&(u&&Zt(n),c%i!=0?(d=Tr(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&_r(d,i,t)&&(d=Tr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=Tr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),_r(d,i,t)&&(d=c));const r=rn(l/i)===t;kr(e,d)&&(d=o&&r?n.key===Er?l:Tr(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?s.current[e]:null))},{event:e,orientation:x,loop:f,cols:w,disabledIndices:Rr([...b||s.current.map(((e,t)=>Nr(s.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:i,prevIndex:Or(N.current>a?o:N.current,t,n,w,e.key===wr?"bl":e.key===Sr?"tr":"tl"),stopEvent:!0})];if(null!=l&&(N.current=l,O(N.current)),"both"===x)return}if(Bo(e.key,x)){if(Zt(e),n&&!m&&Lt(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=Vo(e.key,x,p)?o:a,void O(N.current);Vo(e.key,x,p)?N.current=f?t>=a?d&&t!==s.current.length?-1:o:Tr(s,{startingIndex:t,disabledIndices:b}):Math.min(a,Tr(s,{startingIndex:t,disabledIndices:b})):N.current=f?t<=o?d&&-1!==t?s.current.length:a:Tr(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(o,Tr(s,{startingIndex:t,decrement:!0,disabledIndices:b})),kr(s,N.current)?O(null):O(N.current)}})),J=o.useMemo((()=>m&&n&&Y&&{"aria-activedescendant":K||U}),[m,n,Y,K,U]),Z=o.useMemo((()=>({"aria-orientation":"both"===x?void 0:x,...!Qt(i.domReference)&&J,onKeyDown:X,onPointerMove(){j.current=!0}})),[J,X,i.domReference,x]),Q=o.useMemo((()=>{function e(e){"auto"===g&&Vt(e.nativeEvent)&&(R.current=!0)}return{...J,onKeyDown(e){j.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return zo(t,n?e===Er:e===Sr,e===wr)}(e.key,x,p),i=Wo(e.key,x,p),a=Bo(e.key,x),l=(h?o:a)||"Enter"===e.key||""===e.key.trim();if(m&&n){const n=null==T?void 0:T.nodesRef.current.find((e=>null==e.parentId)),r=T&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Gr(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(T.nodesRef.current,n.id):null;if(t&&r&&S){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||i){var c,d;const n=(null==(c=r.context)?void 0:c.elements.domReference)===e.currentTarget,a=i&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?s.current.find((e=>(null==e?void 0:e.id)===U)):null;a&&(Zt(e),a.dispatchEvent(t),H(void 0))}var f;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return Zt(e),void(null==(f=r.context.elements.domReference)||f.dispatchEvent(t))}return X(e)}(n||y||!t)&&(l&&(A.current=h&&a?null:e.key),h?o&&(Zt(e),n?(N.current=Cr(s,z.current),O(N.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=u&&(N.current=u),Zt(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):X(e),n&&O(N.current)))},onFocus(){n&&!m&&O(null)},onPointerDown:function(e){R.current=g,"auto"===g&&Wt(e.nativeEvent)&&(R.current=!0)},onMouseDown:e,onClick:e}}),[U,J,X,z,g,s,h,O,r,n,y,x,p,u,T,m,S]);return o.useMemo((()=>c?{reference:Q,floating:Z,item:G}:{}),[c,Q,Z,G])}const $o=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ko(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:a="dialog"}=t,l=null!=(n=$o.get(a))?n:a,c=zr(),u=null!=Ur(),d=o.useMemo((()=>"tooltip"===l||"label"===a?{["aria-"+("label"===a?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?i:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}}),[l,i,u,r,c,a]),f=o.useMemo((()=>{const e={id:i,...l&&{role:l}};return"tooltip"===l||"label"===a?e:{...e,..."menu"===l&&{"aria-labelledby":c}}}),[l,i,c,a]),h=o.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(a){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,a]);return o.useMemo((()=>s?{reference:d,floating:f,item:h}:{}),[s,d,f,h])}const Ho=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function qo(e,t){return"function"==typeof e?e(t):e}function Yo(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function Go(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:h,tree:p}=e;return function(e){function m(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],b=Gt(e),x="mouseleave"===e.type,w=Ft(d.floating,b),E=Ft(d.domReference,b),S=d.domReference.getBoundingClientRect(),_=d.floating.getBoundingClientRect(),k=u.split("-")[0],C=n>_.right-_.width/2,P=c>_.bottom-_.height/2,T=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,S),O=_.width>S.width,R=_.height>S.height,N=(O?S:_).left,A=(O?S:_).right,j=(R?S:_).top,M=(R?S:_).bottom;if(w&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&Et(e.relatedTarget)&&Ft(d.floating,e.relatedTarget))return;if(p&&Gr(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&c>=S.bottom-1||"bottom"===k&&c<=S.top+1||"left"===k&&n>=S.right-1||"right"===k&&n<=S.left+1)return m();let I=[];switch(k){case"top":I=[[N,S.top+1],[N,_.bottom-1],[A,_.bottom-1],[A,S.top+1]];break;case"bottom":I=[[N,_.top+1],[N,S.bottom-1],[A,S.bottom-1],[A,_.top+1]];break;case"left":I=[[_.right-1,M],[_.right-1,j],[S.left+1,j],[S.left+1,M]];break;case"right":I=[[S.right-1,M],[S.right-1,j],[_.left+1,j],[_.left+1,M]]}if(!Yo([g,v],I)){if(i&&!T)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}Yo([g,v],function(e){let[n,r]=e;switch(k){case"top":return[[O?n+t/2:C?n+4*t:n-4*t,r+t+1],[O?n-t/2:C?n+4*t:n-4*t,r+t+1],[_.left,C||O?_.bottom-t:_.top],[_.right,C?O?_.bottom-t:_.top:_.bottom-t]];case"bottom":return[[O?n+t/2:C?n+4*t:n-4*t,r-t],[O?n-t/2:C?n+4*t:n-4*t,r-t],[_.left,C||O?_.top+t:_.bottom],[_.right,C?O?_.top+t:_.bottom:_.top+t]];case"left":{const e=[n+t+1,R?r+t/2:P?r+4*t:r-4*t],o=[n+t+1,R?r-t/2:P?r+4*t:r-4*t];return[[P||R?_.right-t:_.left,_.top],[P?R?_.right-t:_.left:_.right-t,_.bottom],e,o]}case"right":return[[n-t,R?r+t/2:P?r+4*t:r-4*t],[n-t,R?r-t/2:P?r+4*t:r-4*t],[P||R?_.left+t:_.right,_.top],[P?R?_.left+t:_.right:_.left+t,_.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const Xo=xe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Jo=xe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Zo=xe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Qo="light",ei=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,i=void 0===r?Qo:r,s=e.variant,a=void 0===s?"neutral":s,l="[&>svg]:h-5 [&>svg]:w-5",c="light"===i?"text-icon-secondary":"text-icon-inverse";if(n&&(0,o.isValidElement)(n))return(0,o.cloneElement)(n,{className:te(l,c,n.props.className)});switch(a){case"neutral":return React.createElement(Xo,{className:te(l,c)});case"info":var u="light"===i?"text-support-info":"text-support-info-inverse";return React.createElement(Xo,{className:te(l,u)});case"success":var d="light"===i?"text-support-success":"text-support-success-inverse";return React.createElement(Ee,{className:te(l,d)});case"warning":var f="light"===i?"text-support-warning":"text-support-warning-inverse";return React.createElement(Jo,{className:te(l,f)});case"error":var h="light"===i?"text-support-error":"text-support-error-inverse";return React.createElement(Zo,{className:te(l,h)});default:return null}},ti=function(e){var t=e.actionType,n=void 0===t?"button":t,r=e.onAction,o=void 0===r?function(){}:r,i=e.actionLabel,s=void 0===i?"":i,a=e.theme,l=void 0===a?Qo:a,c="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none",u="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===l&&(u="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),n){case"button":return React.createElement(le,{variant:"outline",size:"xs",onClick:o,className:te("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(le,{variant:"link",size:"xs",onClick:o,className:te(c,u)},s);default:return null}},ni=function(e){var t=e.theme,n=void 0===t?Qo:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te("block",{light:"text-text-primary",dark:"text-text-inverse"}[n],"text-sm leading-5 font-semibold")},o)},ri=function(e){var t=e.theme,n=void 0===t?Qo:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},oi=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{})),C=o.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);o.useEffect((()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(E.current),S.current=!0)}}),[l,s]),o.useEffect((()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){C()&&r(!1,e,"hover")}const t=qt(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[a.floating,n,r,l,g,C]);const P=o.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Yr(v.current,"close",b.current);o&&!w.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[v,r]),T=br((()=>{k.current(),w.current=void 0})),O=br((()=>{if(_.current){const e=qt(a.floating).body;e.style.pointerEvents="",e.removeAttribute(qr),_.current=!1}}));o.useEffect((()=>{if(l&&Et(a.domReference)){var e;const t=a.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=a.floating)||e.addEventListener("mouseleave",c),h&&t.addEventListener("mousemove",o,{once:!0}),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",s),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=a.floating)||e.removeEventListener("mouseleave",c),h&&t.removeEventListener("mousemove",o),t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",s)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function o(e){if(clearTimeout(x.current),S.current=!1,d&&!Ht(b.current)||f>0&&!Yr(v.current,"open"))return;const t=Yr(v.current,"open",b.current);t?x.current=window.setTimeout((()=>{y.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function s(e){if(t())return;k.current();const r=qt(a.floating);if(clearTimeout(E.current),g.current&&i.current.floatingContext){n||clearTimeout(x.current),w.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){O(),T(),P(e,!0,"safe-polygon")}});const t=w.current;return r.addEventListener("mousemove",t),void(k.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==b.current||!Ft(a.floating,e.relatedTarget))&&P(e)}function c(e){t()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){O(),T(),P(e)}})(e))}}),[a,l,e,d,f,h,P,T,O,r,n,y,p,v,g,i]),Mr((()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&C()){_.current=!0;const e=a.floating;if(Et(a.domReference)&&e){var t;const n=qt(a.floating).body;n.setAttribute(qr,"");const r=a.domReference,o=null==p||null==(t=p.nodesRef.current.find((e=>e.id===m)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,n,m,a,p,g,C]),Mr((()=>{n||(b.current=void 0,T(),O())}),[n,T,O]),o.useEffect((()=>()=>{T(),clearTimeout(x.current),clearTimeout(E.current),O()}),[l,a.domReference,T,O]);const R=o.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){S.current||y.current||r(!0,t,"hover")}d&&!Ht(b.current)||n||0===f||(clearTimeout(E.current),"touch"===b.current?o():E.current=window.setTimeout(o,f))}}}),[d,r,n,y,f]),N=o.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){P(e.nativeEvent,!1)}})),[P]);return o.useMemo((()=>l?{reference:R,floating:N}:{}),[l,R,N])}(W,li({move:!1,enabled:!M&&N.includes("hover")},j&&{handleClose:Go()})),K=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),f=o.useRef(!0);o.useEffect((()=>{if(!l)return;const e=bt(a.domReference);function t(){!n&&St(a.domReference)&&a.domReference===Lt(qt(a.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,l]),o.useEffect((()=>{if(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]);const h=o.useMemo((()=>({onPointerDown(e){Wt(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=Gt(e.nativeEvent);if(c&&Et(t))try{if(Ut()&&Kt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!Jt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=Et(t)&&t.hasAttribute(Kr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var e;const i=Lt(a.domReference?a.domReference.ownerDocument:document);(t||i!==a.domReference)&&(Ft(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,i)||Ft(a.domReference,i)||o||r(!1,n,"focus"))}))}})),[s,a.domReference,r,c]);return o.useMemo((()=>l?{reference:h}:{}),[l,h])}(W,{enabled:!M&&N.includes("focus")}),H=Lo([U,$,K,Ao(W),Ko(W,{role:"tooltip"})]),q=H.getReferenceProps,Y=H.getFloatingProps,G=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:a=250}=t,l=e.placement,c=l.split("-")[0],u=o.useMemo((()=>({side:c,placement:l})),[c,l]),d="number"==typeof a,f=(d?a:a.open)||0,h=(d?a:a.close)||0,[p,m]=o.useState((()=>({...qo(s,u),...qo(n,u)}))),{isMounted:g,status:v}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,s=("number"==typeof i?i:i.close)||0,[a,l]=o.useState("unmounted"),c=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,s);return c||"close"!==a||l("unmounted"),Mr((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:c,status:a}}(e,{duration:a}),y=Hr(n),b=Hr(r),x=Hr(i),w=Hr(s);return Mr((()=>{const e=qo(y.current,u),t=qo(x.current,u),n=qo(w.current,u),r=qo(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&m((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&m({transitionProperty:Object.keys(r).map(Ho).join(","),transitionDuration:f+"ms",...n,...r}),"close"===v){const r=t||e;m({transitionProperty:Object.keys(r).map(Ho).join(","),transitionDuration:h+"ms",...n,...r})}}),[h,x,y,b,w,f,v,u]),{isMounted:g,styles:p}}(W,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),X=G.isMounted,J=G.styles,Z=null===(t={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"})||void 0===t?void 0:t[l],Q="dark"===l?"text-tooltip-background-dark":"text-tooltip-background-light";return i().createElement(i().Fragment,null,(0,o.isValidElement)(y)&&(0,o.cloneElement)(y,li(li({},y.props),{},{ref:oi(y.ref,B.setReference),className:te(y.props.className)},q())),i().createElement(go,{id:S,root:w},X&&i().createElement("div",si({className:te("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",Z,"max-w-80 w-fit",b),ref:B.setFloating,style:li(li({},V),J)},Y()),i().createElement("div",null,!!f&&i().createElement("span",{className:"font-semibold"},f),!!h&&i().createElement("div",{className:"font-normal"},h)),m&&i().createElement(Br,{ref:F,context:W,placement:u,className:te("fill-current",Q)}))))},fi=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function hi(){return hi=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[g],"border-0 border-r border-border-subtle border-solid",p===r?"bg-button-disabled":"",d?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",f?"rounded-tr rounded-br border-0":"",l);return i().createElement("button",hi({ref:t,className:y,disabled:u,onClick:function(e){m(e,{slug:r,text:s})}},h),"left"===v&&a&&i().createElement("span",{className:"mr-1"},a),s,"right"===v&&a&&i().createElement("span",{className:"ml-1"},a))},gi=(0,o.forwardRef)(mi);gi.displayName="Button";var vi={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,s=e.onChange,a=e.className,l=e.size,c=void 0===l?"md":l,u=e.iconPosition,d=void 0===u?"left":u,f=(0,o.useCallback)((function(e,t){s&&s({event:e,value:t})}),[s]),h=te("box-border flex border border-border-subtle border-solid rounded",a);return i().createElement("div",{className:h},i().createElement(pi.Provider,{value:{activeItem:r,onChange:f,size:c,iconPosition:d}},i().Children.map(t,(function(e,n){if(!(0,o.isValidElement)(e))return null;var r=0===n,s=n===i().Children.count(t)-1;return i().cloneElement(e,{index:n,isFirstChild:r,isLastChild:s})}))))},Button:gi},yi=vi;function bi(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}function xi(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const wi=e=>Array.isArray(e);function Ei(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function ki(e,t,n,r){if("function"==typeof t){const[o,i]=_i(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=_i(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Ci(e,t,n){const r=e.getProps();return ki(r,t,void 0!==n?n:r.custom,e)}const Pi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ti=["initial",...Pi],Oi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ri=new Set(Oi),Ni=e=>1e3*e,Ai=e=>e/1e3,ji={type:"spring",stiffness:500,damping:25,restSpeed:10},Mi={type:"keyframes",duration:.8},Ii={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Di=(e,{keyframes:t})=>t.length>2?Mi:Ri.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:ji:Ii;function Li(e,t){return e[t]||e.default||e}const Fi=e=>null!==e;function zi(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Fi),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const Bi=e=>e,Vi=["read","resolveKeyframes","update","preRender","render","postRender"];function Wi(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Vi.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:Vi.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t/^0[^.\s]+$/u.test(e);let Yi=Bi,Gi=Bi;const Xi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ji=e=>t=>"string"==typeof t&&t.startsWith(e),Zi=Ji("--"),Qi=Ji("var(--"),es=e=>!!Qi(e)&&ts.test(e.split("/*")[0].trim()),ts=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ns=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function rs(e,t,n=1){Gi(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=ns.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Xi(e)?parseFloat(e):e}return es(o)?rs(o,t,n+1):o}const os=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},ss={...is,transform:e=>os(0,1,e)},as={...is,default:1},ls=e=>Math.round(1e5*e)/1e5,cs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,us=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ds=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function fs(e){return"string"==typeof e}const hs=e=>({test:t=>fs(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ps=hs("deg"),ms=hs("%"),gs=hs("px"),vs=hs("vh"),ys=hs("vw"),bs={...ms,parse:e=>ms.parse(e)/100,transform:e=>ms.transform(100*e)},xs=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ws=e=>e===is||e===gs,Es=(e,t)=>parseFloat(e.split(", ")[t]),Ss=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Es(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Es(t[1],e):0}},_s=new Set(["x","y","z"]),ks=Oi.filter((e=>!_s.has(e))),Cs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ss(4,13),y:Ss(5,14)};Cs.translateX=Cs.x,Cs.translateY=Cs.y;const Ps=e=>t=>t.test(e),Ts=[is,gs,ms,ps,ys,vs,{test:e=>"auto"===e,parse:e=>e}],Os=e=>Ts.find(Ps(e)),Rs=new Set;let Ns=!1,As=!1;function js(){if(As){const e=Array.from(Rs).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return ks.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}As=!1,Ns=!1,Rs.forEach((e=>e.complete())),Rs.clear()}function Ms(){Rs.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(As=!0)}))}class Is{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Rs.add(this),Ns||(Ns=!0,Ui.read(Ms),Ui.resolveKeyframes(js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(fs(n)&&ds.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ls=(e,t,n)=>r=>{if(!fs(r))return r;const[o,i,s,a]=r.match(cs);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Fs={...is,transform:e=>Math.round((e=>os(0,255,e))(e))},zs={test:Ds("rgb","red"),parse:Ls("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Fs.transform(e)+", "+Fs.transform(t)+", "+Fs.transform(n)+", "+ls(ss.transform(r))+")"},Bs={test:Ds("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:zs.transform},Vs={test:Ds("hsl","hue"),parse:Ls("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ms.transform(ls(t))+", "+ms.transform(ls(n))+", "+ls(ss.transform(r))+")"},Ws={test:e=>zs.test(e)||Bs.test(e)||Vs.test(e),parse:e=>zs.test(e)?zs.parse(e):Vs.test(e)?Vs.parse(e):Bs.parse(e),transform:e=>fs(e)?e:e.hasOwnProperty("red")?zs.transform(e):Vs.transform(e)},Us="number",$s="color",Ks="var",Hs="var(",qs="${}",Ys=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Gs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Ys,(e=>(Ws.test(e)?(r.color.push(i),o.push($s),n.push(Ws.parse(e))):e.startsWith(Hs)?(r.var.push(i),o.push(Ks),n.push(e)):(r.number.push(i),o.push(Us),n.push(parseFloat(e))),++i,qs))).split(qs);return{values:n,split:s,indexes:r,types:o}}function Xs(e){return Gs(e).values}function Js(e){const{split:t,types:n}=Gs(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,Qs={test:function(e){var t,n;return isNaN(e)&&fs(e)&&((null===(t=e.match(cs))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(us))||void 0===n?void 0:n.length)||0)>0},parse:Xs,createTransformer:Js,getAnimatableNone:function(e){const t=Xs(e);return Js(e)(t.map(Zs))}},ea=new Set(["brightness","contrast","saturate","opacity"]);function ta(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(cs)||[];if(!r)return e;const o=n.replace(r,"");let i=ea.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const na=/\b([a-z-]*)\(.*?\)/gu,ra={...Qs,getAnimatableNone:e=>{const t=e.match(na);return t?t.map(ta).join(" "):e}},oa={...is,transform:Math.round},ia={borderWidth:gs,borderTopWidth:gs,borderRightWidth:gs,borderBottomWidth:gs,borderLeftWidth:gs,borderRadius:gs,radius:gs,borderTopLeftRadius:gs,borderTopRightRadius:gs,borderBottomRightRadius:gs,borderBottomLeftRadius:gs,width:gs,maxWidth:gs,height:gs,maxHeight:gs,size:gs,top:gs,right:gs,bottom:gs,left:gs,padding:gs,paddingTop:gs,paddingRight:gs,paddingBottom:gs,paddingLeft:gs,margin:gs,marginTop:gs,marginRight:gs,marginBottom:gs,marginLeft:gs,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:as,scaleX:as,scaleY:as,scaleZ:as,skew:ps,skewX:ps,skewY:ps,distance:gs,translateX:gs,translateY:gs,translateZ:gs,x:gs,y:gs,z:gs,perspective:gs,transformPerspective:gs,opacity:ss,originX:bs,originY:bs,originZ:gs,zIndex:oa,backgroundPositionX:gs,backgroundPositionY:gs,fillOpacity:ss,strokeOpacity:ss,numOctaves:oa},sa={...ia,color:Ws,backgroundColor:Ws,outlineColor:Ws,fill:Ws,stroke:Ws,borderColor:Ws,borderTopColor:Ws,borderRightColor:Ws,borderBottomColor:Ws,borderLeftColor:Ws,filter:ra,WebkitFilter:ra},aa=e=>sa[e];function la(e,t){let n=aa(e);return n!==ra&&(n=Qs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ca=new Set(["auto","none","0"]);class ua extends Is{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function da(e){let t;return()=>(void 0===t&&(t=e()),t)}let fa;function ha(){fa=void 0}const pa={now:()=>(void 0===fa&&pa.set(Ki.isProcessing?Ki.timestamp:performance.now()),fa),set:e=>{fa=e,queueMicrotask(ha)}},ma=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Qs.test(e)&&"0"!==e||e.startsWith("url(")));class ga{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=pa.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ms(),js()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=pa.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=ma(o,t),a=ma(i,t);return Yi(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function va(e,t){return t?e*(1e3/t):0}const ya=5;function ba(e,t,n){const r=Math.max(t-ya,0);return va(n-e(r),t-r)}const xa=.001,wa=.01,Ea=10,Sa=.05,_a=1;const ka=12;function Ca(e,t){return e*Math.sqrt(1-t*t)}const Pa=["duration","bounce"],Ta=["stiffness","damping","mass"];function Oa(e,t){return t.some((t=>void 0!==e[t]))}function Ra({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Oa(e,Ta)&&Oa(e,Pa)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Yi(e<=Ni(Ea),"Spring duration must be 10 seconds or less");let s=1-t;s=os(Sa,_a,s),e=os(wa,Ea,Ai(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Ca(t,s),l=Math.exp(-o);return xa-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Ca(Math.pow(t,2),s);return(-o(t)+xa>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-xa,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-p*g*t);return i-n*((h+p*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===p)y=e=>i-Math.exp(-g*e)*(m+(h+g*m)*e);else{const e=g*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*g*t),r=Math.min(e*t,300);return i-n*((h+p*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{const r=y(e);if(f)s.done=e>=u;else{let o=0;p<1&&(o=0===e?Ni(h):ba(y,e,r));const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function Na({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=e=>void 0===a?l:void 0===l||Math.abs(a-e)-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let x,w;const E=e=>{(e=>void 0!==a&&el)(f.value)&&(x=e,w=Ra({keyframes:[f.value,h(f.value)],velocity:ba(y,e,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),E(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}const Aa=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ja(e,t,n,r){if(e===t&&n===r)return Bi;return o=>0===o||1===o?o:Aa(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Aa(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,e,n),t,r)}const Ma=ja(.42,0,1,1),Ia=ja(0,0,.58,1),Da=ja(.42,0,.58,1),La=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Fa=e=>t=>1-e(1-t),za=e=>1-Math.sin(Math.acos(e)),Ba=Fa(za),Va=La(za),Wa=ja(.33,1.53,.69,.99),Ua=Fa(Wa),$a=La(Ua),Ka={linear:Bi,easeIn:Ma,easeInOut:Da,easeOut:Ia,circIn:za,circInOut:Va,circOut:Ba,backIn:Ua,backInOut:$a,backOut:Wa,anticipate:e=>(e*=2)<1?.5*Ua(e):.5*(2-Math.pow(2,-10*(e-1)))},Ha=e=>{if(Array.isArray(e)){Gi(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return ja(t,n,r,o)}return"string"==typeof e?(Gi(void 0!==Ka[e],`Invalid easing type '${e}'`),Ka[e]):e},qa=(e,t)=>n=>t(e(n)),Ya=(...e)=>e.reduce(qa),Ga=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Xa=(e,t,n)=>e+(t-e)*n;function Ja(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Za(e,t){return n=>n>0?t:e}const Qa=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},el=[Bs,zs,Vs];function tl(e){const t=(e=>el.find((t=>t.test(e))))(e);if(Yi(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===Vs&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Ja(a,r,e+1/3),i=Ja(a,r,e),s=Ja(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const nl=(e,t)=>{const n=tl(e),r=tl(t);if(!n||!r)return Za(e,t);const o={...n};return e=>(o.red=Qa(n.red,r.red,e),o.green=Qa(n.green,r.green,e),o.blue=Qa(n.blue,r.blue,e),o.alpha=Xa(n.alpha,r.alpha,e),zs.transform(o))},rl=new Set(["none","hidden"]);function ol(e,t){return n=>Xa(e,t,n)}function il(e){return"number"==typeof e?ol:"string"==typeof e?es(e)?Za:Ws.test(e)?nl:ll:Array.isArray(e)?sl:"object"==typeof e?Ws.test(e)?nl:al:Za}function sl(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>il(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const ll=(e,t)=>{const n=Qs.createTransformer(t),r=Gs(e),o=Gs(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?rl.has(e)&&!o.values.length||rl.has(t)&&!r.values.length?function(e,t){return rl.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Ya(sl(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;iArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Ha):Ha(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Ga(0,t,r);e.push(Xa(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Gi(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||cl,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(os(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Da)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const dl=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Ui.update(t,!0),stop:()=>$i(t),now:()=>Ki.isProcessing?Ki.timestamp:pa.now()}},fl={decay:Na,inertia:Na,tween:ul,keyframes:ul,spring:Ra},hl=e=>e/100;class pl extends ga{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Is;this.resolver=new i(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=fl[t]||ul;let a,l;s!==ul&&"number"!=typeof e[0]&&(a=Ya(hl,cl(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:h,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===h?(n=1-n,p&&(n-=p/u)):"mirror"===h&&(b=i)),y=os(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return E&&void 0!==r&&(x.value=zi(a,this.options,r)),m&&m(x.value),E&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Ai(e.calculatedDuration):0}get time(){return Ai(this.currentTime)}set time(e){e=Ni(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ai(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=dl,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ml=new Set(["opacity","clipPath","filter","transform"]),gl=e=>Array.isArray(e)&&"number"==typeof e[0];function vl(e){return Boolean(!e||"string"==typeof e&&e in bl||gl(e)||Array.isArray(e)&&e.every(vl))}const yl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yl([0,.65,.55,1]),circOut:yl([.55,0,1,.45]),backIn:yl([.31,.01,.66,-.59]),backOut:yl([.33,1.53,.69,.99])};function xl(e){return wl(e)||bl.easeOut}function wl(e){return e?gl(e)?yl(e):Array.isArray(e)?e.map(xl):bl[e]:void 0}const El=da((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class Sl extends ga{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new ua(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l,startTime:c}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||!vl(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new pl({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,o=u.times,i=u.ease,s="keyframes"}var u;const d=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=wl(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return d.startTime=null!=c?c:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:n}=this.options;a.set(zi(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Ai(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Ai(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Ni(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Bi;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Bi}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new pl({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Ni(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return El()&&n&&ml.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const _l=da((()=>void 0!==window.ScrollTimeline));class kl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!_l()||!t.attachTimeline)return t.pause(),function(e,n){let r;const o=()=>{const{currentTime:e}=n,o=(null===e?0:e.value)/100;r!==o&&(e=>{t.time=t.duration*e})(o),r=o};return Ui.update(o,!0),()=>$i(o)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Cl=(e,t,n,r={},o,i,s)=>a=>{const l=Li(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=Ni(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),s&&s()},onStop:s,name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(l)||(d={...d,...Di(e,d)}),d.duration&&(d.duration=Ni(d.duration)),d.repeatDelay&&(d.repeatDelay=Ni(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let f=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(f=!0)),f&&!i&&void 0!==t.get()){const e=zi(d.keyframes,l);if(void 0!==e)return Ui.update((()=>{d.onUpdate(e),d.onComplete()})),new kl([])}return!i&&Sl.supports(d)?new Sl(d):new pl(d)},Pl=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),Tl=e=>wi(e)?e[e.length-1]||0:e;function Ol(e,t){-1===e.indexOf(t)&&e.push(t)}function Rl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Nl{constructor(){this.subscriptions=[]}add(e){return Ol(this.subscriptions,e),()=>Rl(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=pa.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=pa.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Nl);const n=this.events[e].add(t);return"change"===e?()=>{n(),Ui.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Al.current&&Al.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=pa.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return va(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ml(e,t){return new jl(e,t)}function Il(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ml(n))}const Dl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ll="data-"+Dl("framerAppearId");function Fl(e){return e.props[Ll]}function zl(e){return Ri.has(e)?"transform":ml.has(e)?Dl(e):void 0}class Bl extends jl{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=zl(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(Rl(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Vl=e=>Boolean(e&&e.getVelocity);function Wl(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new Bl("auto"),e.addValue("willChange",r)),o=r,Boolean(Vl(o)&&o.add)?r.add(t):void 0;var o}function Ul({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function $l(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&Ul(u,t))continue;const a={delay:n,...Li(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=Fl(e);if(n){const e=window.MotionHandoffAnimation(n,t,Ui);null!==e&&(a.startTime=e,d=!0)}}r.start(Cl(t,r,o,e.shouldReduceMotion&&Ri.has(t)?{type:!1}:a,e,d,Wl(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{Ui.update((()=>{a&&function(e,t){const n=Ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Il(e,t,Tl(i[t]))}(e,a)}))})),c}function Kl(e,t,n={}){var r;const o=Ci(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all($l(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Hl).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Kl(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Hl(e,t){return e.sortNodePosition(t)}const ql=[...Pi].reverse(),Yl=Pi.length;function Gl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Xl(){return{animate:Gl(!0),whileInView:Gl(),whileHover:Gl(),whileTap:Gl(),whileDrag:Gl(),whileFocus:Gl(),exit:Gl()}}class Jl{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Zl=0;const Ql={animation:{Feature:class extends Jl{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Kl(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Kl(e,t,n);else{const o="function"==typeof t?Ci(e,t,n.custom):t;r=Promise.all($l(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=Xl(),r=!0;const o=t=>(n,r)=>{var o;const i=Ci(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&v),w=!1;const E=Array.isArray(g)?g:[g];let S=E.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:_={}}=m,k={..._,...S},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=S[e],n=_[e];if(u.hasOwnProperty(e))continue;let r=!1;r=wi(t)&&wi(n)?!Ei(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(x=!1),!x||b&&!w||l.push(...E.map((e=>({animation:e,options:{type:p}}))))}var f,h;if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Xl(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();xi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Jl{constructor(){super(...arguments),this.id=Zl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},ec=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function tc(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const nc=e=>t=>ec(t)&&e(t,tc(t));function rc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function oc(e,t,n,r){return rc(e,t,nc(n),r)}const ic=(e,t)=>Math.abs(e-t);class sc{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=cc(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=ic(e.x,t.x),r=ic(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Ki;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ac(t,this.transformPagePoint),Ui.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=cc("pointercancel"===e.type?this.lastMoveEventInfo:ac(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!ec(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=ac(tc(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Ki;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,cc(i,this.history)),this.removeListeners=Ya(oc(this.contextWindow,"pointermove",this.handlePointerMove),oc(this.contextWindow,"pointerup",this.handlePointerUp),oc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),$i(this.updatePoint)}}function ac(e,t){return t?{point:t(e.point)}:e}function lc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cc({point:e},t){return{point:e,delta:lc(e,dc(t)),offset:lc(e,uc(t)),velocity:fc(t,.1)}}function uc(e){return e[0]}function dc(e){return e[e.length-1]}function fc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=dc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ni(t)));)n--;if(!r)return{x:0,y:0};const i=Ai(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function hc(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const pc=hc("dragHorizontal"),mc=hc("dragVertical");function gc(e){let t=!1;if("y"===e)t=mc();else if("x"===e)t=pc();else{const e=pc(),n=mc();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function vc(){const e=gc(!0);return!e||(e(),!1)}function yc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const bc=.9999,xc=1.0001,wc=-.01,Ec=.01;function Sc(e){return e.max-e.min}function _c(e,t,n,r=.5){e.origin=r,e.originPoint=Xa(t.min,t.max,e.origin),e.scale=Sc(n)/Sc(t),e.translate=Xa(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bc&&e.scale<=xc||isNaN(e.scale))&&(e.scale=1),(e.translate>=wc&&e.translate<=Ec||isNaN(e.translate))&&(e.translate=0)}function kc(e,t,n,r){_c(e.x,t.x,n.x,r?r.originX:void 0),_c(e.y,t.y,n.y,r?r.originY:void 0)}function Cc(e,t,n){e.min=n.min+t.min,e.max=e.min+Sc(t)}function Pc(e,t,n){e.min=t.min-n.min,e.max=e.min+Sc(t)}function Tc(e,t,n){Pc(e.x,t.x,n.x),Pc(e.y,t.y,n.y)}function Oc(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Rc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Ic=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Dc(e){return[e("x"),e("y")]}function Lc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Fc(e){return void 0===e||1===e}function zc({scale:e,scaleX:t,scaleY:n}){return!Fc(e)||!Fc(t)||!Fc(n)}function Bc(e){return zc(e)||Vc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vc(e){return Wc(e.x)||Wc(e.y)}function Wc(e){return e&&"0%"!==e}function Uc(e,t,n){return n+t*(e-n)}function $c(e,t,n,r,o){return void 0!==o&&(e=Uc(e,o,r)),Uc(e,n,r)+t}function Kc(e,t=0,n=1,r,o){e.min=$c(e.min,t,n,r,o),e.max=$c(e.max,t,n,r,o)}function Hc(e,{x:t,y:n}){Kc(e.x,t.translate,t.scale,t.originPoint),Kc(e.y,n.translate,n.scale,n.originPoint)}const qc=.999999999999,Yc=1.0000000000001;function Gc(e,t){e.min=e.min+t,e.max=e.max+t}function Xc(e,t,n,r,o=.5){Kc(e,t,n,Xa(e.min,e.max,o),r)}function Jc(e,t){Xc(e.x,t.x,t.scaleX,t.scale,t.originX),Xc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zc(e,t){return Lc(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Qc=({current:e})=>e?e.ownerDocument.defaultView:null,eu=new WeakMap;class tu{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ic(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new sc(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(tc(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();if(r&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=gc(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Dc((e=>{let t=this.getAxisMotionValue(e).get()||0;if(ms.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=Sc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&Ui.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Wl(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Dc((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Qc(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=t;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Ui.postRender((()=>i(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!nu(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Xa(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&yc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Oc(e.x,n,o),y:Oc(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Nc){return!1===e?e=0:!0===e&&(e=Nc),{x:Ac(e,"left","right"),y:Ac(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Dc((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!yc(e))return!1;const n=e.current;Gi(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Zc(e,n),{scroll:o}=t;return o&&(Gc(r.x,o.offset.x),Gc(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Rc(e.x,t.x),y:Rc(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Lc(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Dc((s=>{if(!nu(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(Cl(e,n,0,t,this.visualElement,!1,Wl(this.visualElement,e)))}stopAnimation(){Dc((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Dc((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Dc((t=>{const{drag:n}=this.getProps();if(!nu(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Xa(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!yc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Dc((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Sc(e),o=Sc(t);return o>r?n=Ga(t.min,t.max-r,e.min):r>o&&(n=Ga(e.min,e.max-o,t.min)),os(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Dc((t=>{if(!nu(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Xa(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;eu.set(this.visualElement,this);const e=oc(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();yc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Ui.read(t);const o=rc(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Dc((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Nc,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function nu(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ru=e=>(t,n)=>{e&&Ui.postRender((()=>e(t,n)))};var ou=n(848);const iu=(0,o.createContext)(null),su=(0,o.createContext)({}),au=(0,o.createContext)({}),lu={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uu={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!gs.test(e))return e;e=parseFloat(e)}return`${cu(e,t.target.x)}% ${cu(e,t.target.y)}%`}},du={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Qs.parse(e);if(o.length>5)return r;const i=Qs.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Xa(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}},fu={},{schedule:hu,cancel:pu}=Wi(queueMicrotask,!1);class mu extends o.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=vu,Object.assign(fu,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),lu.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Ui.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hu.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function gu(e){const[t,n]=function(){const e=(0,o.useContext)(iu);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=(0,o.useId)();(0,o.useEffect)((()=>r(i)),[]);const s=(0,o.useCallback)((()=>n&&n(i)),[i,n]);return!t&&n?[!1,s]:[!0]}(),r=(0,o.useContext)(su);return(0,ou.jsx)(mu,{...e,layoutGroup:r,switchLayoutGroup:(0,o.useContext)(au),isPresent:t,safeToRemove:n})}const vu={borderRadius:{...uu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uu,borderTopRightRadius:uu,borderBottomLeftRadius:uu,borderBottomRightRadius:uu,boxShadow:du},yu=["TopLeft","TopRight","BottomLeft","BottomRight"],bu=yu.length,xu=e=>"string"==typeof e?parseFloat(e):e,wu=e=>"number"==typeof e||gs.test(e);function Eu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Su=ku(0,.5,Ba),_u=ku(.5,.95,Bi);function ku(e,t,n){return r=>rt?1:n(Ga(e,t,r))}function Cu(e,t){e.min=t.min,e.max=t.max}function Pu(e,t){Cu(e.x,t.x),Cu(e.y,t.y)}function Tu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ou(e,t,n,r,o){return e=Uc(e-=t,1/n,r),void 0!==o&&(e=Uc(e,1/o,r)),e}function Ru(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(ms.test(t)&&(t=parseFloat(t),t=Xa(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=Xa(i.min,i.max,r);e===i&&(a-=t),e.min=Ou(e.min,t,n,a,o),e.max=Ou(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Nu=["x","scaleX","originX"],Au=["y","scaleY","originY"];function ju(e,t,n,r){Ru(e.x,t,Nu,n?n.x:void 0,r?r.x:void 0),Ru(e.y,t,Au,n?n.y:void 0,r?r.y:void 0)}function Mu(e){return 0===e.translate&&1===e.scale}function Iu(e){return Mu(e.x)&&Mu(e.y)}function Du(e,t){return e.min===t.min&&e.max===t.max}function Lu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fu(e,t){return Lu(e.x,t.x)&&Lu(e.y,t.y)}function zu(e){return Sc(e.x)/Sc(e.y)}function Bu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Vu{constructor(){this.members=[]}add(e){Ol(this.members,e),e.scheduleRender()}remove(e){if(Rl(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Wu=(e,t)=>e.depth-t.depth;class Uu{constructor(){this.children=[],this.isDirty=!1}add(e){Ol(this.children,e),this.isDirty=!0}remove(e){Rl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Wu),this.isDirty=!1,this.children.forEach(e)}}function $u(e){const t=Vl(e)?e.get():e;return Pl(t)?t.toValue():t}const Ku={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Hu="undefined"!=typeof window&&void 0!==window.MotionDebug,qu=["","X","Y","Z"],Yu={visibility:"hidden"};let Gu=0;function Xu(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ju(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Fl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ui,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ju(r)}function Zu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Gu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Hu&&(Ku.totalNodes=Ku.resolvedTargetDeltas=Ku.recalculatedProjection=0),this.nodes.forEach(td),this.nodes.forEach(ld),this.nodes.forEach(cd),this.nodes.forEach(nd),Hu&&window.MotionDebug.record(Ku)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e){const t=pa.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&($i(n),e(o-250))};return Ui.read(n,!0),()=>$i(n)}(r),lu.hasAnimatedSinceResize&&(lu.hasAnimatedSinceResize=!1,this.nodes.forEach(ad))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||md,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Fu(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Li(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||ad(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$i(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ud),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ju(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eqc&&(t.x=1),t.yqc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Ic());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Tu(this.prevProjectionDelta.x,this.projectionDelta.x),Tu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),kc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Bu(this.projectionDelta.x,this.prevProjectionDelta.x)&&Bu(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Hu&&Ku.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Mc(),this.projectionDelta=Mc(),this.projectionDeltaWithTransform=Mc()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Mc();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Ic(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(pd));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;fd(i.x,e.x,n),fd(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tc(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=s,g=n,hd(h.x,p.x,m.x,g),hd(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Du(l.x,f.x)&&Du(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d=Ic()),Pu(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Xa(0,void 0!==n.opacity?n.opacity:1,Su(r)),e.opacityExit=Xa(void 0!==t.opacity?t.opacity:1,0,_u(r))):i&&(e.opacity=Xa(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{lu.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Vl(0)?0:Ml(0);return r.start(Cl("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&bd(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Ic();const t=Sc(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Sc(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Pu(t,n),Jc(t,o),kc(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vu),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Xu("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(od),this.root.sharedNodes.clear()}}}function Qu(e){e.updateLayout()}function ed(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?Dc((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Sc(r);r.min=t[e].min,r.max=r.min+o})):bd(o,n.layoutBox,t)&&Dc((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Sc(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s=Mc();kc(s,t,n.layoutBox);const a=Mc();i?kc(a,e.applyTransform(r,!0),n.measuredBox):kc(a,t,n.layoutBox);const l=!Iu(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=Ic();Tc(s,n.layoutBox,o.layoutBox);const a=Ic();Tc(a,t,i.layoutBox),Fu(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function td(e){Hu&&Ku.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function nd(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rd(e){e.clearSnapshot()}function od(e){e.clearMeasurements()}function id(e){e.isLayoutDirty=!1}function sd(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ad(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ld(e){e.resolveTargetDelta()}function cd(e){e.calcProjection()}function ud(e){e.resetSkewAndRotation()}function dd(e){e.removeLeadSnapshot()}function fd(e,t,n){e.translate=Xa(t.translate,0,n),e.scale=Xa(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function hd(e,t,n,r){e.min=Xa(t.min,n.min,r),e.max=Xa(t.max,n.max,r)}function pd(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const md={duration:.45,ease:[.4,0,.1,1]},gd=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),vd=gd("applewebkit/")&&!gd("chrome/")?Math.round:Bi;function yd(e){e.min=vd(e.min),e.max=vd(e.max)}function bd(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=zu(t),o=zu(n),!(Math.abs(r-o)<=.2));var r,o}function xd(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const wd=Zu({attachResizeListener:(e,t)=>rc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ed={current:void 0},Sd=Zu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ed.current){const e=new wd({});e.mount(window),e.setOptions({layoutScroll:!0}),Ed.current=e}return Ed.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),_d={pan:{Feature:class extends Jl{constructor(){super(...arguments),this.removePointerDownListener=Bi}onPointerDown(e){this.session=new sc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ru(e),onStart:ru(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Ui.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=oc(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Jl{constructor(e){super(e),this.removeGroupControls=Bi,this.removeListeners=Bi,this.controls=new tu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bi}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Sd,MeasureLayout:gu}};function kd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return oc(e.current,n,((n,o)=>{if("touch"===n.pointerType||vc())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Ui.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const Cd=(e,t)=>!!t&&(e===t||Cd(e,t.parentElement));function Pd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,tc(n))}const Td=new WeakMap,Od=new WeakMap,Rd=e=>{const t=Td.get(e.target);t&&t(e)},Nd=e=>{e.forEach(Rd)};const Ad={some:0,all:1},jd={inView:{Feature:class extends Jl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Ad[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;Od.has(n)||Od.set(n,{});const r=Od.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Nd,{root:e,...t})),r[o]}(t);return Td.set(e,n),r.observe(e),()=>{Td.delete(e),r.unobserve(e)}}(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Jl{constructor(){super(...arguments),this.removeStartListeners=Bi,this.removeEndListeners=Bi,this.removeAccessibleListeners=Bi,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=oc(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||Cd(this.node.current,e.target)?n:r;i&&Ui.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=oc(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ya(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=rc(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=rc(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&Pd("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Ui.postRender((()=>n(e,t)))}))})),Pd("down",((e,t)=>{this.startPress(e,t)})))})),t=rc(this.node.current,"blur",(()=>{this.isPressing&&Pd("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ya(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Ui.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!vc()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Ui.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=oc(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=rc(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ya(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Jl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ya(rc(this.node.current,"focus",(()=>this.onFocus())),rc(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Jl{mount(){this.unmount=Ya(kd(this.node,!0),kd(this.node,!1))}unmount(){}}}},Md={layout:{ProjectionNode:Sd,MeasureLayout:gu}},Id=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Dd=(0,o.createContext)({}),Ld="undefined"!=typeof window,Fd=Ld?o.useLayoutEffect:o.useEffect,zd=(0,o.createContext)({strict:!1});let Bd=!1;function Vd(e,t,n,r,i){var s;const{visualElement:a}=(0,o.useContext)(Dd),l=(0,o.useContext)(zd),c=(0,o.useContext)(iu),u=(0,o.useContext)(Id).reducedMotion,d=(0,o.useRef)();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const f=d.current,h=(0,o.useContext)(au);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ud(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&yc(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,i,h),(0,o.useInsertionEffect)((()=>{f&&f.update(n,c)}));const p=n[Ll],m=(0,o.useRef)(Boolean(p)&&!window.MotionHandoffIsComplete&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,p)));return Fd((()=>{f&&(f.updateFeatures(),hu.render(f.render),m.current&&f.animationState&&f.animationState.animateChanges())})),(0,o.useEffect)((()=>{f&&(!m.current&&f.animationState&&f.animationState.animateChanges(),m.current=!1,Bd||(Bd=!0,queueMicrotask(Wd)))})),f}function Wd(){window.MotionHandoffIsComplete=!0}function Ud(e){if(e)return!1!==e.options.allowProjection?e.projection:Ud(e.parent)}function $d(e,t,n){return(0,o.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):yc(n)&&(n.current=r))}),[t])}function Kd(e){return xi(e.animate)||Ti.some((t=>Si(e[t])))}function Hd(e){return Boolean(Kd(e)||e.variants)}function qd(e){return Array.isArray(e)?e.join(" "):e}const Yd={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Gd={};for(const e in Yd)Gd[e]={isEnabled:t=>Yd[e].some((e=>!!t[e]))};const Xd=Symbol.for("motionComponentSymbol");function Jd({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&function(e){for(const t in e)Gd[t]={...Gd[t],...e[t]}}(e);const s=(0,o.forwardRef)((function(e,s){let a;const l={...(0,o.useContext)(Id),...e,layoutId:Zd(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Kd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Si(t)?t:void 0,animate:Si(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Dd));return(0,o.useMemo)((()=>({initial:t,animate:n})),[qd(t),qd(n)])}(e),d=r(e,c);if(!c&&Ld){(0,o.useContext)(zd).strict;const e=function(e){const{drag:t,layout:n}=Gd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);a=e.MeasureLayout,u.visualElement=Vd(i,d,l,t,e.ProjectionNode)}return(0,ou.jsxs)(Dd.Provider,{value:u,children:[a&&u.visualElement?(0,ou.jsx)(a,{visualElement:u.visualElement,...l}):null,n(i,e,$d(d,u.visualElement,s),d,c,u.visualElement)]})}));return s[Xd]=i,s}function Zd({layoutId:e}){const t=(0,o.useContext)(su).id;return t&&void 0!==e?t+"-"+e:e}const Qd=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ef(e){return"string"==typeof e&&!e.includes("-")&&!!(Qd.indexOf(e)>-1||/[A-Z]/u.test(e))}function tf(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const nf=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function rf(e,t,n,r){tf(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(nf.has(n)?n:Dl(n),t.attrs[n])}function of(e,{layout:t,layoutId:n}){return Ri.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!fu[e]||"opacity"===e)}function sf(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Vl(o[s])||t.style&&Vl(t.style[s])||of(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function af(e,t,n){const r=sf(e,t,n);for(const n in e)(Vl(e[n])||Vl(t[n]))&&(r[-1!==Oi.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function lf(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const cf=e=>(t,n)=>{const r=(0,o.useContext)(Dd),i=(0,o.useContext)(iu),s=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:ff(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,i,n);return n?s():lf(s)};function uf(e,t){const n=zl(t);n&&Ol(e,n)}function df(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[p?n.length-1:0]),null!==n&&(s[t]=n)}for(const e in t)s[e]=t[e]})),l&&(d&&!1!==u&&!xi(d)&&df(e,d,(e=>{for(const t in e)uf(a,t)})),a.length&&(s.willChange=a.join(","))),s}const hf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),pf=()=>({...hf(),attrs:{}}),mf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,gf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vf=Oi.length;function yf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(Ri.has(e))s=!0;else if(Zi(e))o[e]=n;else{const t=mf(n,ia[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i"string"==typeof e&&"svg"===e.toLowerCase(),_f={useVisualState:cf({scrapeMotionValuesFromProps:af,createRenderState:pf,onMount:(e,t,{renderState:n,latestValues:r})=>{Ui.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Ui.render((()=>{Ef(n,r,Sf(t.tagName),e.transformTemplate),rf(t,n)}))}})},kf={useVisualState:cf({applyWillChange:!0,scrapeMotionValuesFromProps:sf,createRenderState:hf})};function Cf(e,t,n){for(const r in t)Vl(t[r])||of(r,n)||(e[r]=t[r])}function Pf(e,t){const n={},r=function(e,t){const n={};return Cf(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)((()=>{const n=hf();return yf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Tf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Of(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Tf.has(e)}let Rf=e=>!Of(e);try{(Nf=n(316).A)&&(Rf=e=>e.startsWith("on")?!Of(e):Nf(e))}catch(e){}var Nf;function Af(e,t,n,r){const i=(0,o.useMemo)((()=>{const n=pf();return Ef(n,t,Sf(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Cf(t,e.style,e),i.style={...t,...i.style}}return i}function jf(e=!1){return(t,n,r,{latestValues:i},s)=>{const a=(ef(t)?Af:Pf)(n,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Rf(o)||!0===n&&Of(o)||!t&&!Of(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==o.Fragment?{...l,...a,ref:r}:{},{children:u}=n,d=(0,o.useMemo)((()=>Vl(u)?u.get():u),[u]);return(0,o.createElement)(t,{...c,children:d})}}function Mf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Jd({...ef(n)?_f:kf,preloadedFeatures:e,useRender:jf(r),createVisualElement:t,Component:n})}}const If={current:null},Df={current:!1},Lf=new WeakMap,Ff=[...Ts,Ws,Qs],zf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Bf=Ti.length;class Vf{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Is,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Ui.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Kd(t),this.isVariantNode=Hd(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Vl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Lf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Df.current||function(){if(Df.current=!0,Ld)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>If.current=e.matches;e.addListener(t),t()}else If.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||If.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Lf.delete(this.current),this.projection&&this.projection.unmount(),$i(this.notifyUpdate),$i(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Ri.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Ui.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Gd){const t=Gd[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ic()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Ml(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Xi(r)||qi(r))?r=parseFloat(r):!(e=>Ff.find(Ps(e)))(r)&&Qs.test(t)&&(r=la(e,t)),this.setBaseTarget(e,Vl(r)?r.get():r)),Vl(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=ki(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Vl(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Nl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Wf extends Vf{constructor(){super(...arguments),this.KeyframeResolver=ua}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class Uf extends Wf{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=tf}readValueFromInstance(e,t){if(Ri.has(t)){const e=aa(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Zi(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Zc(e,t)}build(e,t,n){yf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return sf(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Vl(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class $f extends Wf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ic}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ri.has(t)){const e=aa(t);return e&&e.default||0}return t=nf.has(t)?t:Dl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return af(e,t,n)}build(e,t,n){Ef(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){rf(e,t,0,r)}mount(e){this.isSVGTag=Sf(e.tagName),super.mount(e)}}const Kf=bi(Mf({...Ql,...jd,..._d,...Md},((e,t)=>ef(e)?new $f(t):new Uf(t,{allowProjection:e!==o.Fragment}))));var Hf=["slug","text","icon","className","disabled","badge"];function qf(){return qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:box-border flex items-center ".concat("full"===y?"w-full":""," ").concat(S),k=te(_,x,w,t,E,"underline"!==p?"bg-tab-background":"",l);return i().createElement("div",{className:k},i().createElement(Yf.Provider,{value:{activeItem:s,onChange:b,size:u,variant:p,orientation:f,iconPosition:g,width:y}},i().Children.map(n,(function(e){return(0,o.isValidElement)(e)?i().cloneElement(e):null}))))},Tab:Xf};const Zf=xe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Qf=xe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),eh=xe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var th={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2 py-2 rounded text-xs font-medium leading-4 min-h-[2.25rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-xs",searchbarIcon:"[&>svg]:size-4",label:"text-xs font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-2.5 py-2.5 rounded-md text-xs font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-3 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-base font-medium"}},nh="group-disabled:text-field-color-disabled",rh=["value","selected","children"];function oh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||ah(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ih(){return ih=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{r&&(clearTimeout(m.current),y.current=null,g.current="")}),[r]),Mr((()=>{var e;r&&""===g.current&&(v.current=null!=(e=null!=p?p:a)?e:-1)}),[r,p,a]);const S=br((e=>{e?i.current.typing||(i.current.typing=e,x(e)):i.current.typing&&(i.current.typing=e,x(e))})),_=br((e=>{function t(e,t,n){const r=w.current?w.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=s.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?S(!1):" "===e.key&&Zt(e)),null==n||E.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Zt(e),S(!0)),n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",v.current=y.current),g.current+=e.key,clearTimeout(m.current),m.current=setTimeout((()=>{g.current="",v.current=y.current,S(!1)}),f);const o=v.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",S(!1))})),k=o.useMemo((()=>({onKeyDown:_})),[_]),C=o.useMemo((()=>({onKeyDown:_,onKeyUp(e){" "===e.key&&S(!1)}})),[_,S]);return o.useMemo((()=>u?{reference:k,floating:C}:{}),[u,k,C])}(B,{listRef:W,activeIndex:N,selectedIndex:M,onMatch:T?A:I,onTypingChange:function(e){U.current=e}}),G=Lo([K,H,q,$].concat(sh(m?[]:[Y]))),X=G.getReferenceProps,J=G.getFloatingProps,Z=G.getItemProps,Q=function(e,t){if(h)return function(e,t){var n,r=sh(null!==(n=C())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===ch(e)?e[u]===t[u]:e===t}))&&(r.push(t),b||E(r),I(e),F.reference.current.focus(),O(!1),k(""),"function"==typeof l&&l(r))}(e,t);I(e),b||E(t),F.reference.current.focus(),O(!1),k(""),"function"==typeof l&&l(t)},ee=(0,o.useCallback)((function(e,t){V.current[e]=t}),[]);return React.createElement(hh.Provider,{value:{selectedIndex:M,setSelectedIndex:I,activeIndex:N,setActiveIndex:A,selected:w,setSelected:E,handleSelect:Q,combobox:m,sizeValue:i,multiple:h,onChange:l,isTypingRef:U,getItemProps:Z,onClickItem:function(e,t){Q(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Q(t,n))," "!==e.key||U.current||(e.preventDefault(),Q(t,n))},getValues:C,selectId:y,getReferenceProps:X,isOpen:T,value:s,updateListRef:ee,refs:F,listContentRef:W,by:u,getFloatingProps:J,floatingStyles:z,context:B,searchKeyword:_,setSearchKeyword:k,disabled:v}},d)};mh.Button=function(e){var t,n,r,i=e.children,s=e.icon,a=void 0===s?null:s,l=e.placeholder,c=void 0===l?"Select an option":l,u=e.optionIcon,d=void 0===u?null:u,f=e.displayBy,h=void 0===f?"name":f,p=e.label,m=ph(),g=m.sizeValue,v=m.getReferenceProps,y=m.getValues,b=m.selectId,x=m.refs,w=m.isOpen,E=m.multiple,S=m.combobox,_=m.setSelected,k=m.onChange,C=m.isControlled,P=m.disabled,T=m.by,O=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[g],R=(0,o.useCallback)((function(){if(a)return a;var e="text-field-placeholder group-disabled:text-icon-disabled";return S?React.createElement(Zf,{className:e}):React.createElement(Qf,{className:e})}),[a]),N=(0,o.useCallback)((function(){var e=y();if(!e)return null;if("function"==typeof i){var t=dh({value:e},E?{onClose:A}:{});return i(t)}if(E)return e.map((function(e,t){return React.createElement(Ye,{icon:d,type:"rounded",key:t,size:O,onMouseDown:A(e),label:"object"===ch(e)?e[h]:e,closable:!0,disabled:P})}));var n="object"===ch(e)?e[h]:e;return(0,o.isValidElement)(i)&&(n=i),React.createElement("span",{className:te(th[g].displaySelected,nh)},n)}),[y]),A=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=sh(null!==(n=y())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===ch(t)?t[T]===e[T]:t===e}));-1!==o&&(r.splice(o,1),C||_(r),"function"==typeof k&&k(r))}};return React.createElement("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border"},React.createElement("label",{className:te(null===(n=th[g])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:b},p),React.createElement("button",ih({id:b,ref:x.setReference,className:te("flex items-center justify-between border border-solid w-full box-border transition-colors duration-150 bg-white","border focus-visible:outline-none border-solid border-field-border",!w&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",th[g].selectButton,E&&th[g].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:P},v()),React.createElement("div",{className:te("flex-1 grid items-center justify-start gap-1.5 ",y()&&"flex flex-wrap")},N(),(E?!(null!==(r=y())&&void 0!==r&&r.length):!y())&&React.createElement("div",{className:te("[grid-area:1/1/2/3] text-field-input",th[g].displaySelected,nh)},c)),React.createElement("div",{className:te("flex items-center [&>svg]:shrink-0",th[g].icon)},R())))},mh.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,i=e.searchPlaceholder,s=void 0===i?"Search...":i,a=e.dropdownPortalRoot,l=void 0===a?null:a,c=e.dropdownPortalId,u=void 0===c?"":c,d=ph(),f=d.isOpen,h=d.context,p=d.refs,m=d.combobox,g=d.floatingStyles,v=d.getFloatingProps,y=d.sizeValue,b=d.setSearchKeyword,x=d.setActiveIndex,w=d.setSelectedIndex,E=d.value,S=d.selected,_=d.getValues,k=d.searchKeyword,C=d.listContentRef,P=d.by,T=(0,o.useMemo)((function(){var e=_(),n=0;return e&&(n=o.Children.toArray(t).findIndex((function(t){return"object"===ch(t.props.value)?t.props.value[P]===e[P]:t.props.value===e}))),-1===n?0:n}),[E,S,t]);(0,o.useLayoutEffect)((function(){x(T),w(T)}),[]);var O=(0,o.useMemo)((function(){return o.Children.map(t,(function(e,t){if(!(0,o.isValidElement)(e))return null;if(k){var n=e.props.value;if("object"===ch(n)){if(-1===n[r].toLowerCase().indexOf(k.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(k.toLowerCase()))return null}return(0,o.cloneElement)(e,dh(dh({},e.props),{},{index:t}))}))}),[k,E,S,t]),R=o.Children.count(O);return(0,o.useEffect)((function(){C.current=[],o.Children.forEach(t,(function(e){if((0,o.isValidElement)(e)&&e.props.value){if(k){var t=e.props.value;if("object"===ch(t)){if(-1===t[r].toLowerCase().indexOf(k.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(k.toLowerCase()))return}C.current.push(e.props.value)}}))}),[k]),React.createElement(React.Fragment,null,f&&React.createElement(go,{id:u,root:l},React.createElement(ko,{context:h,modal:!1},React.createElement("div",ih({ref:p.setFloating,className:te("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",m&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",th[y].dropdown,!m&&"h-full"),style:dh({},g)},v()),m&&React.createElement("div",{className:te(th[y].searchbarWrapper)},React.createElement(eh,{className:te("text-icon-secondary shrink-0",th[y].searchbarIcon)}),React.createElement("input",{className:te("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",th[y].searchbar),type:"search",name:"keyword",placeholder:s,onChange:function(e){return b(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:te("overflow-y-auto",!m&&"w-full h-full",th[y].dropdownItemsWrapper)},!!R&&O,!R&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},mh.Option=function(e){var t=e.value,n=e.selected,r=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"neutral"},t))}},{key:"success",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"success"},t))}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"error"},t))}},{key:"warning",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"warning"},t))}},{key:"info",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"info"},t))}},{key:"custom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({jsx:e,type:"custom"},t))}}],t&&Eh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Ah=new Nh,jh=Object.seal(Object.assign((function(e,t){return Ah.default(e,t)}),{success:Ah.success.bind(Ah),error:Ah.error.bind(Ah),warning:Ah.warning.bind(Ah),info:Ah.info.bind(Ah),custom:Ah.custom.bind(Ah),dismiss:Ah.dismiss.bind(Ah),update:Ah.update.bind(Ah)},{getHistory:Ah.history.bind(Ah)})),Mh=!1,Ih={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},Dh={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},Lh="bg-background-inverse border-background-inverse",Fh={light:"text-icon-secondary",dark:"text-icon-inverse"};class zh extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Bh({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,o.useContext)(Id);return(0,o.useInsertionEffect)((()=>{const{width:e,height:o,top:a,left:l}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,ou.jsx)(zh,{isPresent:t,childRef:r,sizeRef:i,children:o.cloneElement(e,{ref:r})})}const Vh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const l=lf(Wh),c=(0,o.useId)(),u=(0,o.useMemo)((()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))})),s?[Math.random()]:[n]);return(0,o.useMemo)((()=>{l.forEach(((e,t)=>l.set(t,!1)))}),[n]),o.useEffect((()=>{!n&&!l.size&&r&&r()}),[n]),"popLayout"===a&&(e=(0,ou.jsx)(Bh,{isPresent:n,children:e})),(0,ou.jsx)(iu.Provider,{value:u,children:e})};function Wh(){return new Map}const Uh=e=>e.key||"";function $h(e){const t=[];return o.Children.forEach(e,(e=>{(0,o.isValidElement)(e)&&t.push(e)})),t}const Kh=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync"})=>{Gi(!t,"Replace exitBeforeEnter with mode='wait'");const l=(0,o.useMemo)((()=>$h(e)),[e]),c=l.map(Uh),u=(0,o.useRef)(!0),d=(0,o.useRef)(l),f=lf((()=>new Map)),[h,p]=(0,o.useState)(l),[m,g]=(0,o.useState)(l);Fd((()=>{u.current=!1,d.current=l;for(let e=0;e{const t=Uh(e),o=l===m||c.includes(t);return(0,ou.jsx)(Vh,{isPresent:o,initial:!(u.current&&!r)&&void 0,custom:o?void 0:n,presenceAffectsLayout:s,mode:a,onExitComplete:o?void 0:()=>{if(!f.has(t))return;f.set(t,!0);let e=!0;f.forEach((t=>{t||(e=!1)})),e&&(null==y||y(),g(d.current),i&&i())},children:e},t)}))})};function Hh(e){return Hh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hh(e)}function qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:u;if(l&&!(u<0))return x.current=(new Date).getTime(),setTimeout((function(){b(e.id)}),t)};(0,o.useEffect)((function(){var e=u;return E.current=S(t,e),function(){clearTimeout(E.current)}}),[]),(0,o.useEffect)((function(){null!=t&&t.dismiss&&b(t.id)}),[t]);var _,k,C,P,T,O,R,N,A,j,M=function(){var e,n;null==t||null===(e=t.action)||void 0===e||null===(n=e.onClick)||void 0===n||n.call(e,(function(){return b(t.id)}))},I=null;return"stack"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Lh:null===(_=Dh)||void 0===_?void 0:_[y],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(E.current),w.current=(new Date).getTime()},onMouseLeave:function(){E.current=S(t,u-(w.current-x.current))}},"custom"!==t.type?React.createElement(React.Fragment,null,React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},ei({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},ni({title:r,theme:f}),ri({content:s,theme:f}),(null==t||null===(k=t.action)||void 0===k?void 0:k.label)&&"function"==typeof(null==t||null===(C=t.action)||void 0===C?void 0:C.onClick)&&React.createElement("div",{className:"mt-2.5"},ti({actionLabel:null==t||null===(P=t.action)||void 0===P?void 0:P.label,actionType:null!==(T=null==t||null===(O=t.action)||void 0===O?void 0:O.type)&&void 0!==T?T:"button",onAction:M,theme:f}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(R=Fh[f])&&void 0!==R?R:Fh.light),onClick:function(){return b(t.id)}},React.createElement(Ke,null)))):null==t||null===(N=t.jsx)||void 0===N?void 0:N.call(t,{close:function(){return b(t.id)},action:null!=t&&t.action?Yh(Yh({},null==t?void 0:t.action),{},{onClick:M}):null}))),"inline"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Lh:null===(A=Dh)||void 0===A?void 0:A[y],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},ei({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},ni({title:r,theme:f}),ri({content:s,theme:f})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(j=Fh[f])&&void 0!==j?j:Fh.light),onClick:function(){return b(t.id)}},React.createElement(Ke,null))))),I},ep=(Zh=function(e){var t,n,r,i=e.position,s=void 0===i?"top-right":i,a=e.design,l=void 0===a?"stack":a,c=e.theme,u=void 0===c?"light":c,d=e.className,f=void 0===d?"":d,h=e.autoDismiss,p=void 0===h||h,m=e.dismissAfter,g=void 0===m?5e3:m,v=(n=(0,o.useState)([]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(n,r)||Xh(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],b=v[1];(0,o.useEffect)((function(){Ah.subscribe((function(e){null!=e&&e.dismiss?b((function(t){return t.map((function(t){return t.id===e.id?Yh(Yh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,Fn.flushSync)((function(){return b((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?Yh(Yh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return Jh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Xh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[e])}))}))}))}))}),[]);var x=function(e){b((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:te("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=Ih[s])&&void 0!==t?t:Ih["top-right"],f)},React.createElement(Kh,{initial:!1},y.map((function(e){var t,n,r,o,i;return React.createElement(Kf.li,{key:e.id,positionTransition:!0,initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:"toast-".concat(e.id)},React.createElement(Qh,{toastItem:e,title:e.title,content:null==e?void 0:e.description,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t?t:null,design:null!==(n=null==e?void 0:e.design)&&void 0!==n?n:l,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:p,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:g,removeToast:x,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:u}))}))))},(0,o.memo)((function(e){var t=e.singleTon;return Mh&&t?null:(Mh=!0,React.createElement(Zh,e))}))),tp={sm:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"}},np={sm:{xs:"gap-2",sm:"gap-4",md:"gap-5",lg:"gap-6",xl:"gap-6","2xl":"gap-8"},md:{xs:"md:gap-2",sm:"md:gap-4",md:"md:gap-5",lg:"md:gap-6",xl:"md:gap-6","2xl":"md:gap-8"},lg:{xs:"lg:gap-2",sm:"lg:gap-4",md:"lg:gap-5",lg:"lg:gap-6",xl:"lg:gap-6","2xl":"lg:gap-8"}},rp={sm:{xs:"gap-x-2",sm:"gap-x-4",md:"gap-x-5",lg:"gap-x-6",xl:"gap-x-6","2xl":"gap-x-8"},md:{xs:"md:gap-x-2",sm:"md:gap-x-4",md:"md:gap-x-5",lg:"md:gap-x-6",xl:"md:gap-x-6","2xl":"md:gap-x-8"},lg:{xs:"lg:gap-x-2",sm:"lg:gap-x-4",md:"lg:gap-x-5",lg:"lg:gap-x-6",xl:"lg:gap-x-6","2xl":"lg:gap-x-8"}},op={sm:{xs:"gap-y-2",sm:"gap-y-4",md:"gap-y-5",lg:"gap-y-6",xl:"gap-y-6","2xl":"gap-y-8"},md:{xs:"md:gap-y-2",sm:"md:gap-y-4",md:"md:gap-y-5",lg:"md:gap-y-6",xl:"md:gap-y-6","2xl":"md:gap-y-8"},lg:{xs:"lg:gap-y-2",sm:"lg:gap-y-4",md:"lg:gap-y-5",lg:"lg:gap-y-6",xl:"lg:gap-y-6","2xl":"lg:gap-y-8"}},ip={sm:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},sp={sm:{1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4",5:"col-start-5",6:"col-start-6",7:"col-start-7",8:"col-start-8",9:"col-start-9",10:"col-start-10",11:"col-start-11",12:"col-start-12"},md:{1:"md:col-start-1",2:"md:col-start-2",3:"md:col-start-3",4:"md:col-start-4",5:"md:col-start-5",6:"md:col-start-6",7:"md:col-start-7",8:"md:col-start-8",9:"md:col-start-9",10:"md:col-start-10",11:"md:col-start-11",12:"md:col-start-12"},lg:{1:"lg:col-start-1",2:"lg:col-start-2",3:"lg:col-start-3",4:"lg:col-start-4",5:"lg:col-start-5",6:"lg:col-start-6",7:"lg:col-start-7",8:"lg:col-start-8",9:"lg:col-start-9",10:"lg:col-start-10",11:"lg:col-start-11",12:"lg:col-start-12"}},ap={sm:{row:"grid-flow-row",column:"grid-flow-col","row-dense":"grid-flow-row-dense","column-dense":"grid-flow-col-dense"},md:{row:"md:grid-flow-row",column:"md:grid-flow-col","row-dense":"md:grid-flow-row-dense","column-dense":"md:grid-flow-col-dense"},lg:{row:"lg:grid-flow-row",column:"lg:grid-flow-col","row-dense":"lg:grid-flow-row-dense","column-dense":"lg:grid-flow-col-dense"}},lp={sm:{normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},md:{normal:"md:justify-normal",start:"md:justify-start",end:"md:justify-end",center:"md:justify-center",between:"md:justify-between",around:"md:justify-around",evenly:"md:justify-evenly",stretch:"md:justify-stretch"},lg:{normal:"lg:justify-normal",start:"lg:justify-start",end:"lg:justify-end",center:"lg:justify-center",between:"lg:justify-between",around:"lg:justify-around",evenly:"lg:justify-evenly",stretch:"lg:justify-stretch"}},cp={sm:{start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},md:{start:"md:items-start",end:"md:items-end",center:"md:items-center",baseline:"md:items-baseline",stretch:"md:items-stretch"},lg:{start:"lg:items-start",end:"lg:items-end",center:"lg:items-center",baseline:"lg:items-baseline",stretch:"lg:items-stretch"}},up={sm:{start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"},md:{start:"md:self-start",end:"md:self-end",center:"md:self-center",baseline:"md:self-baseline",stretch:"md:self-stretch"},lg:{start:"lg:self-start",end:"lg:self-end",center:"lg:self-center",baseline:"lg:self-baseline",stretch:"lg:self-stretch"}},dp={sm:{auto:"justify-self-auto",start:"justify-self-start",end:"justify-self-end",center:"justify-self-center",baseline:"justify-self-baseline",stretch:"justify-self-stretch"},md:{auto:"md:justify-self-auto",start:"md:justify-self-start",end:"md:justify-self-end",center:"md:justify-self-center",baseline:"md:justify-self-baseline",stretch:"md:justify-self-stretch"},lg:{auto:"lg:justify-self-auto",start:"lg:justify-self-start",end:"lg:justify-self-end",center:"lg:justify-self-center",baseline:"lg:justify-self-baseline",stretch:"lg:justify-self-stretch"}},fp={sm:{row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},md:{row:"md:flex-row","row-reverse":"md:flex-row-reverse",column:"md:flex-col","column-reverse":"md:flex-col-reverse"},lg:{row:"lg:flex-row","row-reverse":"lg:flex-row-reverse",column:"lg:flex-col","column-reverse":"lg:flex-col-reverse"}},hp={sm:{wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse",nowrap:"flex-nowrap"},md:{wrap:"md:flex-wrap","wrap-reverse":"md:flex-wrap-reverse",nowrap:"md:flex-nowrap"},lg:{wrap:"lg:flex-wrap","wrap-reverse":"lg:flex-wrap-reverse",nowrap:"lg:flex-nowrap"}},pp={sm:{1:"w-full",2:"w-1/2",3:"w-1/3",4:"w-1/4",5:"w-1/5",6:"w-1/6",7:"w-1/7",8:"w-1/8",9:"w-1/9",10:"w-1/10",11:"w-1/11",12:"w-1/12"},md:{1:"md:w-full",2:"md:w-1/2",3:"md:w-1/3",4:"md:w-1/4",5:"md:w-1/5",6:"md:w-1/6",7:"md:w-1/7",8:"md:w-1/8",9:"md:w-1/9",10:"md:w-1/10",11:"md:w-1/11",12:"md:w-1/12"},lg:{1:"lg:w-full",2:"lg:w-1/2",3:"lg:w-1/3",4:"lg:w-1/4",5:"lg:w-1/5",6:"lg:w-1/6",7:"lg:w-1/7",8:"lg:w-1/8",9:"lg:w-1/9",10:"lg:w-1/10",11:"lg:w-1/11",12:"lg:w-1/12"}},mp={sm:{1:"order-1",2:"order-2",3:"order-3",4:"order-4",5:"order-5",6:"order-6",7:"order-7",8:"order-8",9:"order-9",10:"order-10",11:"order-11",12:"order-12",first:"order-first",last:"order-last",none:"order-none"},md:{1:"md:order-1",2:"md:order-2",3:"md:order-3",4:"md:order-4",5:"md:order-5",6:"md:order-6",7:"md:order-7",8:"md:order-8",9:"md:order-9",10:"md:order-10",11:"md:order-11",12:"md:order-12",first:"md:order-first",last:"md:order-last",none:"md:order-none"},lg:{1:"lg:order-1",2:"lg:order-2",3:"lg:order-3",4:"lg:order-4",5:"lg:order-5",6:"lg:order-6",7:"lg:order-7",8:"lg:order-8",9:"lg:order-9",10:"lg:order-10",11:"lg:order-11",12:"lg:order-12",first:"lg:order-first",last:"lg:order-last",none:"lg:order-none"}},gp={sm:{0:"grow-0",1:"grow"},md:{0:"md:grow-0",1:"md:grow"},lg:{0:"lg:grow-0",1:"lg:grow"}},vp={sm:{0:"shrink-0",1:"shrink"},md:{0:"md:shrink-0",1:"md:shrink"},lg:{0:"lg:shrink-0",1:"lg:shrink"}};function yp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n3&&void 0!==arguments[3]?arguments[3]:"sm",f=[];switch(bp(e)){case"object":for(var h=0,p=Object.entries(e);hspan:first-child]:shrink-0"},ni({title:g,theme:u}),ri({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4 [&_svg]:size-5"},(null==_?void 0:_.label)&&"function"==typeof(null==_?void 0:_.onClick)&&React.createElement("div",{className:"flex"},ti({actionLabel:null==_?void 0:_.label,actionType:null!==(n=null==_?void 0:_.type)&&void 0!==n?n:"button",onAction:R,theme:u})),React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(r=O[u])&&void 0!==r?r:O.light),onClick:function(){return k()}},React.createElement(Ke,null))))},Lp=(Mp=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const Vp={},Wp={},Up={},$p={},Kp={},Hp={},qp={},Yp={},Gp={},Xp={},Jp={},Zp={},Qp={},em={},tm={},nm={},rm={},om={},im={},sm={},am={},lm={},cm={},um={},dm={},fm={},hm={},pm={},mm={},gm={},vm={},ym={},bm={},xm={},wm={},Em={},Sm={},_m={},km={},Cm={},Pm="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Tm=Pm&&"documentMode"in document?document.documentMode:null,Om=Pm&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Rm=Pm&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Nm=!(!Pm||!("InputEvent"in window)||Tm)&&"getTargetRanges"in new window.InputEvent("input"),Am=Pm&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),jm=Pm&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Mm=Pm&&/Android/.test(navigator.userAgent),Im=Pm&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Dm=Pm&&Mm&&Im,Lm=Pm&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Im,Fm=1,zm=3,Bm=0,Vm=2,Wm=0,Um=1,$m=2,Km=4,Hm=8,qm=3|Km|Hm|240,Ym=1,Gm=2,Xm=3,Jm=4,Zm=5,Qm=6,eg=Am||jm||Lm?" ":"​",tg="\n\n",ng=Rm?" ":eg,rg="֑-߿יִ-﷽ﹰ-ﻼ",og="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ig=new RegExp("^[^"+og+"]*["+rg+"]"),sg=new RegExp("^[^"+rg+"]*["+og+"]"),ag={bold:1,code:16,highlight:128,italic:2,strikethrough:Km,subscript:32,superscript:64,underline:Hm},lg={directionless:1,unmergeable:2},cg={center:Gm,end:Qm,justify:Jm,left:Ym,right:Xm,start:Zm},ug={[Gm]:"center",[Qm]:"end",[Jm]:"justify",[Ym]:"left",[Xm]:"right",[Zm]:"start"},dg={normal:0,segmented:2,token:1},fg={[Wm]:"normal",[$m]:"segmented",[Um]:"token"};var hg,pg=(hg=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;egg;try{lx(e,(()=>{const o=jb()||function(e){return e.getEditorState().read((()=>{const e=jb();return null!==e?e.clone():null}))}(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n0){let t=0;for(let o=0;o0)for(const[t,n]of i)if(ux(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{Sg(e,t,n)}))}function Cg(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==i||null!==r&&r!==s||null!==o&&o!==a)}function Pg(e,t){const n=e.mergeWithSibling(t),r=Jb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Tg(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&ub(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Cg(t,r)){r=Pg(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&ub(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Cg(r,n)){r=Pg(r,n);break}break}n.remove()}}else r.remove()}function Og(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),ub(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!ux(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let Rg=1;const Ng="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Ag(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return hx(qg(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==Dg(t))}function jg(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Ag(t)&&Ig(t)===e}catch(e){return!1}}function Mg(e){return e instanceof Px}function Ig(e){let t=e;for(;null!=t;){const e=Dg(t);if(Mg(e))return e;t=Ev(t)}return null}function Dg(e){return e?e.__lexicalEditor:null}function Lg(e){return e.isToken()||e.isSegmented()}function Fg(e){return e.nodeType===zm}function zg(e){let t=e;for(;null!=t;){if(Fg(t))return t;t=t.firstChild}return null}function Bg(e,t,n){const r=ag[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~ag.superscript:"superscript"===t&&(o&=~ag.subscript),o}function Vg(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling();if(null===o)if(null!==i){const e=i.getWritable();r.__first=i.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===i)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function Wg(e){Gb();const t=e.getLatest(),n=t.__parent,r=Xb(),o=Jb(),i=r._nodeMap,s=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,i,s);const a=t.__key;o._dirtyType=1,ux(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function Ug(e){Yb();const t=Jb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Kg(n);null!==e&&e.getWritable()}if(null!==e){const t=Kg(e);null!==t&&t.getWritable()}}}function $g(){return qb()?null:Jb()._compositionKey}function Kg(e,t){const n=(t||Xb())._nodeMap.get(e);return void 0===n?null:n}function Hg(e,t){const n=e[`__lexicalKey_${Jb()._key}`];return void 0!==n?Kg(n,t):null}function qg(e,t){let n=e;for(;null!=n;){const e=Hg(n,t);if(null!==e)return e;n=Ev(n)}return null}function Yg(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Gg(e){return e.read((()=>Xg().getTextContent()))}function Xg(){return Jg(Xb())}function Jg(e){return e._nodeMap.get("root")}function Zg(e){Yb();const t=Xb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Qg(e){const t=Jb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Ev(n)}return null}(e,t);return null===n?e===t.getRootElement()?Kg("root"):null:Kg(n)}function ev(e,t){return t?e.getTextContentSize():0}function tv(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function nv(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function rv(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ov(e){return e.nodeType===zm?e.nodeValue:null}function iv(e,t,n){const r=Ov(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=ov(o);const r=qg(o);if(null!==t&&ub(r)){if(t===eg&&n){const e=n.length;t=n,i=e,s=e}null!==t&&sv(r,t,i,s,e)}}}function sv(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===eg&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(Ug(null),Am||jm||Lm)i.remove();else{const e=Jb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=Mb(),l=i.getTextContentSize(),c=$g(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||xb(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!i.canInsertTextBefore()&&!s||o.focus.key===e.__key&&o.focus.offset===l&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const d=jb();if(!xb(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=cb(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function av(e){return"ArrowLeft"===e}function lv(e){return"ArrowRight"===e}function cv(e,t){return Om?e:t}function uv(e){return"Enter"===e}function dv(e){return"Backspace"===e}function fv(e){return"Delete"===e}function hv(e,t,n){return"a"===e.toLowerCase()&&cv(t,n)}function pv(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=mg(o);return n[t]=e,e}return o}function mv(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&pg(33,i);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(s,d?"updated":o)}function gv(e,t,n){const r=e.getParent();let o=n,i=e;return null!==r&&(t&&0===n?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function vv(e,t){const n=e.offset;if("element"===e.type)return gv(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?gv(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function yv(e){const t=_v(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function bv(e,t,n){return ix(e,t,n)}function xv(e){return!mx(e)&&!e.isLastChild()&&!e.isInline()}function wv(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&pg(75,t),n}function Ev(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Sv(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function _v(e){const t=e._window;return null===t&&pg(78),t}function kv(e){return mx(e)||ux(e)&&e.isShadowRoot()}function Cv(e){const t=Jb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&pg(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||pg(98),t}return e}function Pv(e,t){!mx(e.getParent())||ux(t)||hx(t)||pg(99)}function Tv(e){return(hx(e)||ux(e)&&!e.canBeEmpty())&&!e.isInline()}function _n(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Ov(e){return Pm?(e||window).getSelection():null}function Rv(e){return 1===e.nodeType}function Nv(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Av(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function jv(e){if(mx(e)||hx(e)&&!e.isInline())return!0;if(!ux(e)||kv(e))return!1;const t=e.getFirstChild(),n=null===t||Hy(t)||ub(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Mv(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Iv=new WeakMap,Dv=new Map;function Lv(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Fv(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(ux(s)&&Fv(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let zv,Bv,Vv,Wv,Uv,$v,Kv,Hv,qv,Yv,Gv="",Xv="",Jv=null,Zv="",Qv="",ey=!1,ty=!1,ny=null;function ry(e,t){const n=Kv.get(e);if(null!==t){const n=yy(e);n.parentNode===t&&t.removeChild(n)}if(Hv.has(e)||Bv._keyToDOMMap.delete(e),ux(n)){const e=py(n,Kv);oy(e,0,e.length-1,null)}void 0!==n&&mv(Yv,Vv,Wv,n,"destroyed")}function oy(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&ry(t,r)}}function iy(e,t){e.setProperty("text-align",t)}const sy="40px";function ay(e,t){const n=zv.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||sy;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function ly(e,t){const n=e.style;0===t?iy(n,""):t===Ym?iy(n,"left"):t===Gm?iy(n,"center"):t===Xm?iy(n,"right"):t===Jm?iy(n,"justify"):t===Zm?iy(n,"start"):t===Qm&&iy(n,"end")}function cy(e,t,n){const r=Hv.get(e);void 0===r&&pg(60);const o=r.createDOM(zv,Bv);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,Bv),ub(r)?o.setAttribute("data-lexical-text","true"):hx(r)&&o.setAttribute("data-lexical-decorator","true"),ux(r)){const e=r.__indent,t=r.__size;if(0!==e&&ay(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=Xv;Xv="",uy(e,n,0,t,r,null),hy(n,r),Xv=o}(py(r,Hv),e,r,o)}const n=r.__format;0!==n&&ly(o,n),r.isInline()||fy(null,r,o),xv(r)&&(Gv+=tg,Qv+=tg)}else{const t=r.getTextContent();if(hx(r)){const t=r.decorate(Bv,zv);null!==t&&gy(e,t),o.contentEditable="false"}else ub(r)&&(r.isDirectionless()||(Xv+=t));Gv+=t,Qv+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return mv(Yv,Vv,Wv,r,"created"),o}function uy(e,t,n,r,o,i){const s=Gv;Gv="";let a=n;for(;a<=r;++a){cy(e[a],o,i);const t=Hv.get(e[a]);null!==t&&ub(t)&&(null===Jv&&(Jv=t.getFormat()),""===Zv&&(Zv=t.getStyle()))}xv(t)&&(Gv+=tg),o.__lexicalTextContent=Gv,Gv=s+Gv}function dy(e,t){const n=t.get(e);return Hy(n)||hx(n)&&n.isInline()}function fy(e,t,n){const r=null!==e&&(0===e.__size||dy(e.__last,Kv)),o=0===t.__size||dy(t.__last,Hv);if(r){if(!o){const e=n.__lexicalLineBreak;if(null!=e)try{n.removeChild(e)}catch(t){if("object"==typeof t&&null!=t){const r=`${t.toString()} Parent: ${n.tagName}, child: ${e.tagName}.`;throw new Error(r)}throw t}n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function hy(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==Xv||r!==ny){const n=""===Xv,i=n?ny:(o=Xv,ig.test(o)?"rtl":sg.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=zv.theme;let a=null!==r?s[r]:void 0,l=null!==i?s[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=mg(a);a=s[r]=e}o.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=mg(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}ty||(e.getWritable().__dir=i)}ny=i,t.__lexicalDirTextContent=Xv,t.__lexicalDir=i}var o}function py(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&pg(101),n.push(r),r=e.__next}return n}function my(e,t){const n=Kv.get(e);let r=Hv.get(e);void 0!==n&&void 0!==r||pg(61);const o=ey||$v.has(e)||Uv.has(e),i=wv(Bv,e);if(n===r&&!o){if(ux(n)){const e=i.__lexicalTextContent;void 0!==e&&(Gv+=e,Qv+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(Xv+=t)}else{const e=n.getTextContent();ub(n)&&!n.isDirectionless()&&(Xv+=e),Qv+=e,Gv+=e}return i}if(n!==r&&o&&mv(Yv,Vv,Wv,r,"updated"),r.updateDOM(n,i,zv)){const n=cy(e,null,null);return null===t&&pg(62),t.replaceChild(n,i),ry(e,null),n}if(ux(n)&&ux(r)){const e=r.__indent;e!==n.__indent&&ay(i,e);const t=r.__format;t!==n.__format&&ly(i,t),o&&(function(e,t,n){const r=Xv;var o;Xv="",Jv=null,Zv="",function(e,t,n){const r=Gv,o=e.__size,i=t.__size;if(Gv="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)my(r,n);else{const e=yy(r),t=cy(o,null,null);try{n.replaceChild(t,e)}catch(i){if("object"==typeof i&&null!=i){const s=`${i.toString()} Parent: ${n.tagName}, new child: {tag: ${t.tagName} key: ${o}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(s)}throw i}ry(r,null)}const s=Hv.get(o);ub(s)&&(null===Jv&&(Jv=s.getFormat()),""===Zv&&(Zv=s.getStyle()))}else{const r=py(e,Kv),s=py(t,Hv);if(0===o)0!==i&&uy(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;oy(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,i){const s=r-1,a=o-1;let l,c,u=i.firstChild,d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f];if(e===r)u=vy(my(r,i)),d++,f++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),s=l.has(r);if(o)if(s){const e=wv(Bv,r);e===u?u=vy(my(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),my(r,i)),d++,f++}else cy(r,i,u),f++;else u=vy(yy(e)),ry(e,i),d++}const o=Hv.get(r);null!==o&&ub(o)&&(null===Jv&&(Jv=o.getFormat()),""===Zv&&(Zv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];uy(n,e,f,a,i,void 0===t?null:Bv.getElementByKey(t))}else p&&!h&&oy(t,d,s,i)}(t,r,s,o,i,n)}xv(t)&&(Gv+=tg),n.__lexicalTextContent=Gv,Gv=r+Gv}(e,t,n),hy(t,n),Sx(o=t)&&null!=Jv&&Jv!==o.__textFormat&&!ty&&(o.setTextFormat(Jv),o.setTextStyle(Zv)),function(e){Sx(e)&&""!==Zv&&Zv!==e.__textStyle&&!ty&&e.setTextStyle(Zv)}(t),Xv=r}(n,r,i),mx(r)||r.isInline()||fy(n,r,i)),xv(r)&&(Gv+=tg,Qv+=tg)}else{const t=r.getTextContent();if(hx(r)){const t=r.decorate(Bv,zv);null!==t&&gy(e,t)}else ub(r)&&!r.isDirectionless()&&(Xv+=t);Gv+=t,Qv+=t}if(!ty&&mx(r)&&r.__cachedText!==Qv){const e=r.getWritable();e.__cachedText=Qv,r=e}return i}function gy(e,t){let n=Bv._pendingDecorators;const r=Bv._decorators;if(null===n){if(r[e]===t)return;n=Yg(Bv)}n[e]=t}function vy(e){let t=e.nextSibling;return null!==t&&t===Bv._blockCursorElement&&(t=t.nextSibling),t}function yy(e){const t=qv.get(e);return void 0===t&&pg(75,e),t}const by=Object.freeze({}),xy=[["keydown",function(e,t){if(wy=e.timeStamp,Ey=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;bv(t,em,e)||null!=n&&(function(e,t,n,r){return lv(e)&&!t&&!r&&!n}(n,o,s,i)?bv(t,tm,e):function(e,t,n,r,o){return lv(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?bv(t,nm,e):function(e,t,n,r){return av(e)&&!t&&!r&&!n}(n,o,s,i)?bv(t,rm,e):function(e,t,n,r,o){return av(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?bv(t,om,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?bv(t,im,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?bv(t,sm,e):function(e,t){return uv(e)&&t}(n,r)?(Ty=!0,bv(t,am,e)):function(e){return" "===e}(n)?bv(t,lm,e):function(e,t){return Om&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),Ty=!0,bv(t,$p,!0)):function(e,t){return uv(e)&&!t}(n,r)?(Ty=!1,bv(t,am,e)):function(e,t,n,r){return Om?!t&&!n&&(dv(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&dv(e)}(n,s,i,o)?dv(n)?bv(t,cm,e):(e.preventDefault(),bv(t,Up,!0)):function(e){return"Escape"===e}(n)?bv(t,um,e):function(e,t,n,r,o){return Om?!(n||r||o)&&(fv(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&fv(e)}(n,o,r,s,i)?fv(n)?bv(t,dm,e):(e.preventDefault(),bv(t,Up,!1)):function(e,t,n){return dv(e)&&(Om?t:n)}(n,s,o)?(e.preventDefault(),bv(t,Gp,!0)):function(e,t,n){return fv(e)&&(Om?t:n)}(n,s,o)?(e.preventDefault(),bv(t,Gp,!1)):function(e,t){return Om&&t&&dv(e)}(n,i)?(e.preventDefault(),bv(t,Xp,!0)):function(e,t){return Om&&t&&fv(e)}(n,i)?(e.preventDefault(),bv(t,Xp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&cv(n,r)}(n,s,i,o)?(e.preventDefault(),bv(t,Jp,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&cv(n,r)}(n,s,i,o)?(e.preventDefault(),bv(t,Jp,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&cv(n,r)}(n,s,i,o)?(e.preventDefault(),bv(t,Jp,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?bv(t,fm,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&cv(n,r)}(n,r,i,o)?(e.preventDefault(),bv(t,Zp,void 0)):function(e,t,n,r){return Om?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),bv(t,Qp,void 0)):Eb(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(Om?n:r)}(n,r,i,o)?(e.preventDefault(),bv(t,vm,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(Om?n:r)}(n,r,i,o)?(e.preventDefault(),bv(t,ym,e)):hv(n,i,o)&&(e.preventDefault(),bv(t,bm,e)):!Rm&&hv(n,i,o)&&(e.preventDefault(),bv(t,bm,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&bv(t,Cm,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&lx(t,(()=>{hx(qg(n))||(Py=!0)}))}],["compositionstart",function(e,t){lx(t,(()=>{const n=jb();if(xb(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();Ug(r.key),(e.timeStamp{Iy(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),lx(t,(()=>{const n=jb(),r=e.data,o=My(e);if(null!=r&&xb(n)&&Ny(n,o,r,e.timeStamp,!1)){Oy&&(Iy(t,r),Oy=!1);const o=n.anchor.getNode(),i=Ov(t._window);if(null===i)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;Nm&&!n.isCollapsed()&&ub(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===ov(i.anchorNode)||bv(t,Hp,r);const c=r.length;Rm&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Am||jm||Lm||!t.isComposing()||(wy=0,Ug(null))}else iv(!1,t,null!==r?r:void 0),Oy&&(Iy(t,r||void 0),Oy=!1);Yb(),_g(Jb())})),_y=null}],["click",function(e,t){lx(t,(()=>{const n=jb(),r=Ov(t._window),o=Mb();if(r)if(xb(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!mx(i)&&1===Xg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(ux(i)?i.select(0):i.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const i=n.nodeType;i!==Fm&&i!==zm||Zg(Ab(o,r,t,e))}}bv(t,Wp,e)}))}],["cut",by],["copy",by],["dragstart",by],["dragover",by],["dragend",by],["paste",by],["focus",by],["blur",by],["drop",by]];Nm&&xy.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=My(e);"deleteCompositionText"===n||Rm&&yv(t)||"insertCompositionText"!==n&&lx(t,(()=>{const o=jb();if("deleteContentBackward"===n){if(null===o){const e=Mb();if(!xb(e))return;Zg(e.clone())}if(xb(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===Ey&&i{lx(t,(()=>{Ug(null)}))}),30),xb(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),ub(e)||pg(142),o.style=e.getStyle()}}else{Ug(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;Dm&&n&&!i||bv(t,Up,!0)}return}}var i;if(!xb(o))return;const s=e.data;null!==_y&&iv(!1,t,_y),o.dirty&&null===_y||!o.isCollapsed()||mx(o.anchor.getNode())||null===r||o.applyDOMRange(r),_y=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":bv(t,Hp,e);break;case"insertFromComposition":Ug(null),bv(t,Hp,e);break;case"insertLineBreak":Ug(null),bv(t,$p,!1);break;case"insertParagraph":Ug(null),Ty&&!jm?(Ty=!1,bv(t,$p,!1)):bv(t,Kp,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":bv(t,qp,e);break;case"deleteByComposition":(function(e,t){return e!==t||ux(e)||ux(t)||!e.isToken()||!t.isToken()})(c,u)&&bv(t,Yp,e);break;case"deleteByDrag":case"deleteByCut":bv(t,Yp,e);break;case"deleteContent":bv(t,Up,!1);break;case"deleteWordBackward":bv(t,Gp,!0);break;case"deleteWordForward":bv(t,Gp,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":bv(t,Xp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":bv(t,Xp,!1);break;case"formatStrikeThrough":bv(t,Jp,"strikethrough");break;case"formatBold":bv(t,Jp,"bold");break;case"formatItalic":bv(t,Jp,"italic");break;case"formatUnderline":bv(t,Jp,"underline");break;case"historyUndo":bv(t,Zp,void 0);break;case"historyRedo":bv(t,Qp,void 0)}else{if("\n"===s)e.preventDefault(),bv(t,$p,!1);else if(s===tg)e.preventDefault(),bv(t,Kp,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&Ny(o,r,s,e.timeStamp,!0)?(e.preventDefault(),bv(t,Hp,s)):_y=s;Sy=e.timeStamp}}))}(e,t)]);let wy=0,Ey=null,Sy=0,_y=null;const ky=new WeakMap;let Cy=!1,Py=!1,Ty=!1,Oy=!1,Ry=[0,"",0,"root",0];function Ny(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=Jb(),c=Ov(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!ub(a)||(!o&&(!Nm||Sy1||(o||!Nm)&&null!==f&&!a.isComposing()&&u!==zg(f)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(ub(t)||ux(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Ay(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===zm&&0!==t&&t!==e.nodeValue.length}function jy(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Cy&&(Cy=!1,Ay(r,o)&&Ay(i,s))||lx(t,(()=>{if(!n)return void Zg(null);if(!jg(t,r,i))return;const a=jb();if(xb(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=_v(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=Ry,f=Xg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=Mb(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==Fm&&i!==zm||Zg(Ab(t,n,r,e))})));const o=nv(r),i=o[o.length-1],s=i._key,a=Ly.get(s),l=a||i;l!==r&&jy(n,l,!1),jy(n,r,!0),r!==i?Ly.set(s,r):a&&Ly.delete(s)}function zy(e){e._lexicalHandled=!0}function By(e){return!0===e._lexicalHandled}function Vy(e,t,n){Yb();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=jb();if(!xb(t)||!ux(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return Sv(o,e)&&n.set(e.__key,0,"element"),Sv(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(xb(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(Lb(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(Lb(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Eb(i)&&t&&e.isSelected()&&e.selectPrevious();if(xb(i)&&t&&!s){const t=e.getIndexWithinParent();Vg(e),Ib(i,o,t,-1)}else Vg(e);n||kv(o)||o.canBeEmpty()||!o.isEmpty()||Vy(o,t),t&&mx(o)&&o.isEmpty()&&o.selectEnd()}class Wy{static getType(){pg(64,this.name)}static clone(e){pg(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,function(e,t){if(null!=t)return void(e.__key=t);Yb(),Gb();const n=Jb(),r=Xb(),o=""+Rg++;r._nodeMap.set(o,e),ux(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}(this,e)}getType(){return this.__type}isInline(){pg(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Kg(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||jb();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(ub(this))return n;if(xb(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(hx(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor,r=n.getNode();if(n.offset===r.getChildrenSize()&&r.is(e)&&r.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Kg(e)}getParentOrThrow(){const e=this.getParent();return null===e&&pg(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(kv(t))return ux(e)||e===this&&hx(e)||pg(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&pg(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Kg(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Kg(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();ux(this)&&t.unshift(this),ux(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const i=new Set(n);for(let e=0;e{s.append(e)}))),xb(n)){Zg(n);const e=n.anchor,t=n.focus;e.key===o&&vb(e,s),t.key===o&&vb(t,s)}return $g()===o&&Ug(i),s}insertAfter(e,t=!0){Yb(),Pv(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=jb();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(Vg(r),xb(i)){const e=o.__key,n=i.anchor,r=i.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&xb(i)){const e=this.getIndexWithinParent();Ib(i,c,e+1);const t=c.__key;s&&i.anchor.set(t,e+2,"element"),a&&i.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){Yb(),Pv(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;Vg(r);const i=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===i?s.__first=o:i.getWritable().__next=o,s.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=jb();return t&&xb(c)&&Ib(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Ex()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Yb();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(ux(n))return n.select();if(!ub(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Yb();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(ux(n))return n.select(0,0);if(!ub(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class Uy extends Wy{static getType(){return"linebreak"}static clone(e){return new Uy(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Av(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&qy(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&qy(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Av(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&qy(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&qy(r))return!0}return!1}(e)?null:{conversion:$y,priority:0}}}static importJSON(e){return Ky()}exportJSON(){return{type:"linebreak",version:1}}}function $y(e){return{node:Ky()}}function Ky(){return Cv(new Uy)}function Hy(e){return e instanceof Uy}function qy(e){return e.nodeType===zm&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Yy(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Gy(e,t){return 1&t?"strong":2&t?"em":"span"}function Xy(e,t,n,r,o){const i=r.classList;let s=pv(o,"base");void 0!==s&&i.add(...s),s=pv(o,"underlineStrikethrough");let a=!1;const l=t&Hm&&t&Km;void 0!==s&&(n&Hm&&n&Km?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in ag){const r=ag[e];if(s=pv(o,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&i.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||i.add(...s)}else t&r&&i.remove(...s)}}function Jy(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?eg:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||Rm){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:ib,priority:0}),b:()=>({conversion:nb,priority:0}),code:()=>({conversion:lb,priority:0}),em:()=>({conversion:lb,priority:0}),i:()=>({conversion:lb,priority:0}),s:()=>({conversion:lb,priority:0}),span:()=>({conversion:tb,priority:0}),strong:()=>({conversion:lb,priority:0}),sub:()=>({conversion:lb,priority:0}),sup:()=>({conversion:lb,priority:0}),u:()=>({conversion:lb,priority:0})}}static importJSON(e){const t=cb(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&Rv(t)||pg(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Qy(t,"b")),this.hasFormat("italic")&&(t=Qy(t,"i")),this.hasFormat("strikethrough")&&(t=Qy(t,"s")),this.hasFormat("underline")&&(t=Qy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?ag[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?lg[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Bg(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=dg[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Yb();let n=e,r=t;const o=jb(),i=this.getTextContent(),s=this.__key;if("string"==typeof i){const e=i.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!xb(o))return Rb(s,n,s,r,"text","text");{const e=$g();e!==o.anchor.key&&e!==o.focus.key||Ug(s),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),i=o.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=jb();if(r&&xb(l)){const t=e+s;l.setTextNodeRange(o,t,o,t)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Yb();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=$g(),i=new Set(e),s=[],a=n.length;let l="";for(let e=0;eb&&e.offset<=l&&(e.key=a,e.offset-=b,v.dirty=!0),t.key===r&&"text"===t.type&&t.offset>b&&t.offset<=l&&(t.key=a,t.offset-=b,v.dirty=!0)}o===r&&Ug(a),b=l,y.push(i)}if(null!==d){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&Wg(t),null!==n&&Wg(n)}(this);const e=d.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),xb(v)&&Ib(v,d,t,c-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||pg(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;$g()===r&&Ug(n);const s=jb();if(xb(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(Fb(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(Fb(a,t,n,e,i),s.dirty=!0)}const a=e.__text,l=t?a+o:o+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function tb(e){return{forChild:db(e.style),node:null}}function nb(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:db(t.style,n?void 0:"bold"),node:null}}const rb=new WeakMap;function ob(e){return"PRE"===e.nodeName||e.nodeType===Fm&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function ib(e){const t=e;null===e.parentElement&&pg(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=rb.get(n))&&!ob(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=sb(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:cb(n)}}function sb(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===Fm){const e=n.style.display;if(""===e&&!Nv(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===zm)return n;if("BR"===n.nodeName)return null}}const ab={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function lb(e){const t=ab[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:db(e.style,t),node:null}}function cb(e=""){return Cv(new eb(e))}function ub(e){return e instanceof eb}function db(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o="700"===n||"bold"===n,i=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>ub(e)?(o&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class fb extends eb{static getType(){return"tab"}static clone(e){return new fb(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=hb();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){pg(126)}setDetail(e){pg(127)}setMode(e){pg(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function hb(){return Cv(new fb)}class pb{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(ux(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(ux(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!ux(t)){const e=t.getNextSibling();if(ub(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function vb(e,t){if(ux(t)){const n=t.getLastDescendant();ux(n)||ub(n)?gb(e,n):gb(e,t)}else gb(e,t)}function yb(e,t,n,r){e.key=t,e.offset=n,e.type=r}class bb{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Eb(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new bb(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(ub(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e0?[]:[s]:s.getNodesBetween(a),qb()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){yb(this.anchor,e.__key,t,"text"),yb(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[s,a]=_b(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||ux(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(o)?m||g.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===f)d.select();else{const t=cb(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e0&&(m===p.getTextContentSize()||Lg(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(ux(e)||hx(e))&&!e.isInline()))){ux(t)||pg(135);const r=zb(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Ex();let n=null;for(let r=0;rl?l:a,t=a>l?a:l,n=i.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[i]}const c=r.isBefore(o);if(ub(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(ub(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,i="move"===e,s=vv(r,t);if(hx(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=Nb();return e.add(s.__key),void Zg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(ub(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(i&&o.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return ux(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(i&&o.set(l,a,"element"))}}const a=Jb(),l=Ov(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!ux(s)||s.isInline()||s.canBeEmpty()||_n(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=mx(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(kv(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){const n=this.getNodes(),o=[];let i=!1;for(let e=0;e0)if(t){const e=o[0];ux(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];ux(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,i=n.type;yb(n,t.key,t.offset,t.type),yb(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&ux(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(ux(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=vv(r,e);if(hx(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&ux(n)&&0===n.getChildrenSize()){n.remove();const e=Nb();e.add(o.__key),Zg(e)}else o.remove(),Jb().dispatchCommand(Vp,void 0);return}if(!e&&ux(o)&&ux(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,i=o.getTextContentSize();if(o.is(n)||e&&t!==i||!e&&0!==t)return void kb(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,i=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==i)return void kb(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,i=r.offset,s=en||r){o.splice(e,1),r&&(a=void 0);break}}const l=o.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function Cb(e,t,n,r){let o,i=t;if(e.nodeType===Fm){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],d=!1;if(u===c)u=a[i+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&i--}if(o=Qg(u),ub(o))i=ev(o,s);else{let r=Qg(e);if(null===r)return null;if(ux(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(ux(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=ux(e)?e:e.getParentOrThrow()),i=0}ub(e)?(o=e,r=null,i=ev(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&hx(r)&&Qg(e)===r?n:n+1,r=r.getParentOrThrow()}if(ux(r))return mb(r.__key,i,"element")}}else o=Qg(e);return ub(o)?mb(o.__key,i,"text"):null}function Pb(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),i=o.getParent();if(t){if((n||!t)&&null===r&&ux(i)&&i.isInline()){const t=i.getPreviousSibling();ub(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else ux(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):ub(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),i=o.getParent();if(t&&ux(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&ux(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();ub(t)&&(e.key=t.__key,e.offset=0)}}}function Tb(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);Pb(e,r,o),Pb(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=Jb();if(i.isComposing()&&i._compositionKey!==e.key&&xb(n)){const r=n.anchor,o=n.focus;yb(e,r.key,r.offset,r.type),yb(t,o.key,o.offset,o.type)}}}function Ob(e,t,n,r,o,i){if(null===e||null===n||!jg(o,e,n))return null;const s=Cb(e,t,xb(i)?i.anchor:null,o);if(null===s)return null;const a=Cb(n,r,xb(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=Qg(e),r=Qg(n);if(hx(t)&&hx(r))return null}return Tb(s,a,i),[s,a]}function Rb(e,t,n,r,o,i){const s=Xb(),a=new wb(mb(e,t,o),mb(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Nb(){return new bb(new Set)}function Ab(e,t,n,r){const o=n._window;if(null===o)return null;const i=r||o.event,s=i?i.type:void 0,a="selectionchange"===s,l=!vg&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(xb(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&xb(e)&&!jg(n,c,u))return e.clone();const h=Ob(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new wb(p,m,xb(e)?e.format:0,xb(e)?e.style:"")}function jb(){return Xb()._selection}function Mb(){return Jb()._editorState._selection}function Ib(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n0||n0||n=e,s=o?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(ub(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(ux(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(ub(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(ux(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(ub(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Lb(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,ub(r)?(s=r.getTextContentSize(),a="text"):ux(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,ub(o)?a="text":ux(o)&&(a="element")),null!==i&&null!==a?e.set(i,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Fb(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function zb(e){let t=e;e.isCollapsed()||t.removeText();const n=jb();xb(n)&&(t=n),xb(t)||pg(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!jv(o);)[o,i]=Bb(o,i);return i}function Bb(e,t){const n=e.getParent();if(!n){const e=Ex();return Xg().append(e),e.select(),[Xg(),0]}if(ub(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!ux(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new wb(mb(e.__key,t,"element"),mb(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let Vb=null,Wb=null,Ub=!1,$b=!1,Kb=0;const Hb={characterData:!0,childList:!0,subtree:!0};function qb(){return Ub||null!==Vb&&Vb._readOnly}function Yb(){Ub&&pg(13)}function Gb(){Kb>99&&pg(14)}function Xb(){return null===Vb&&pg(195,Zb()),Vb}function Jb(){return null===Wb&&pg(196,Zb()),Wb}function Zb(){let e=0;const t=new Set,n=Px.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const o=Dg(r);if(Mg(o))e++;else if(o){let e=String(o.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function Qb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&pg(30,t),n}(e,r);let i=n.get(r);void 0===i&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let e=0;e0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:i,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=_v(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(il&&(n=s-l),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;i-=t,s-=t}if(t)break;c=Ev(c)}}(n,t,i)}}Cy=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(xb(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,i=o.getNode(),s=o.offset;let a=!1,l=null;if(s===i.getChildrenSize())Tv(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(Tv(t)){const n=t.getPreviousSibling();(null===n||Tv(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(i.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=mg(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&_n(r,e,t)})(e,r,a),null!==h&&h.observe(r,Hb)}finally{Wb=d,Vb=c}}null!==p&&function(e,t,n,r,o){const i=Array.from(e._listeners.mutation),s=i.length;for(let e=0;e{r=ix(e,t,n)})),r}const r=nv(e);for(let o=4;o>=0;o--)for(let i=0;i0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=o.get(e);ub(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Tg(r),void 0!==r&&ex(r,i)&&Qb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){Kb++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=o.get(n);void 0!==l&&ex(l,i)&&Qb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,Kb++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),sx(e),function(e,t,n,r){const o=e._nodeMap,i=t._nodeMap,s=[];for(const[e]of r){const t=i.get(e);void 0!==t&&(t.isAttached()||(ux(t)&&Fv(t,e,o,i,s,r),o.has(e)||r.delete(e),s.push(e)))}for(const e of s)i.delete(e);for(const e of n){const t=i.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),i.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(xb(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||pg(19)}else Eb(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=Vm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void rx(e)}finally{Vb=d,Ub=f,Wb=h,e._updating=p,Kb=0}const m=e._dirtyType!==Bm||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,rx(e)):u&&Ng((()=>{rx(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function lx(e,t,n){e._updating?e._updates.push([t,n]):ax(e,t,n)}class cx extends Wy{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return ug[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Jb()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(ub(t)&&e.push(t),ux(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;ux(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;ux(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return ux(e)&&e.getLastDescendant()||e||null}const r=t[e];return ux(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Kg(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&pg(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Kg(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&pg(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;re.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?cg[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),i=this.getWritable(),s=i.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n({root:vx(Xg())})))}}class bx extends cx{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class xx extends cx{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ag[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new xx(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=pv(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:wx,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Rv(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Ex();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Ex();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||ub(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function wx(e){const t=Ex();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Ex(){return Cv(new xx)}function Sx(e){return e instanceof xx}const kx=1;function Cx(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=gx(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=Bm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;null!==i&&(i.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class Px{constructor(e,t,n,r,o,i,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=Bm,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=rv(),this._onError=o,this._htmlConversions=i,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&pg(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&pg(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,r);const i=n&&n.skipInitialization;return void 0===i||i||this.initializeMutationListener(t,r),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&pg(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=function(e){if(!e._readOnly&&e.isEmpty())return Dv;e._readOnly||pg(192);let t=Iv.get(e);if(!t){t=new Map,Iv.set(e,t);for(const[n,r]of e._nodeMap){const e=r.__type;let o=t.get(e);o||(o=new Map,t.set(e,o)),o.set(n,r)}}return t}(n).get(t.getType());if(!r)return;const o=new Map;for(const e of r.keys())o.set(e,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var i;return i=e.getType(),lx(this,(()=>{const e=Xb();if(e.isEmpty())return;if("root"===i)return void Xg().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return bv(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=pv(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Cx(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=ky.get(t);void 0===n&&pg(162);const r=n-1;r>=0||pg(164),ky.set(t,r),0===r&&t.removeEventListener("selectionchange",Fy);const o=Dg(e);Mg(o)?(function(e){if(null!==e._parentEditor){const t=nv(e),n=t[t.length-1]._key;Ly.get(n)===e&&Ly.delete(n)}else Ly.delete(e._key)}(o),e.__lexicalEditor=null):o&&pg(198);const i=Dy(e);for(let e=0;e{By(e)||(zy(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if(By(e))return;zy(e);const n=t.isEditable();switch(r){case"cut":return n&&bv(t,ym,e);case"copy":return bv(t,vm,e);case"paste":return n&&bv(t,qp,e);case"dragstart":return n&&bv(t,pm,e);case"dragover":return n&&bv(t,mm,e);case"dragend":return n&&bv(t,gm,e);case"focus":return n&&bv(t,_m,e);case"blur":return n&&bv(t,km,e);case"drop":return n&&bv(t,hm,e)}};e.addEventListener(r,s),o.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;ox("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&pg(38),_g(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),rx(this)),this._pendingEditorState=e,this._dirtyType=Vm,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),rx(this)}parseEditorState(e,t){return function(e,t,n){const r=gx(),o=Vb,i=Ub,s=Wb,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Vb=r,Ub=!1,Wb=t;try{const o=t._nodes;tx(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,Vb=o,Ub=i,Wb=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return rx(this),this.getEditorState().read(e,{editor:this})}update(e,t){lx(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),lx(this,(()=>{const e=jb(),n=Xg();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Ov(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ox("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Px.version="0.17.1+prod.esm";const Tx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ox=Tx?o.useLayoutEffect:o.useEffect,Rx={tag:"history-merge"};function Nx({initialConfig:e,children:t}){const n=(0,o.useMemo)((()=>{const{theme:t,namespace:n,nodes:r,onError:o,editorState:i,html:s}=e,a=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t),l=function(e){const t=e||{},n=Wb,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=gx(),a=t.namespace||(null!==o?o._config.namespace:rv()),l=t.editorState,c=[px,eb,Uy,fb,xx,bx,...t.nodes||[]],{onError:u,html:d}=t,f=void 0===t.editable||t.editable;let h;if(void 0===e&&null!==n)h=n._nodes;else{h=new Map;for(let e=0;e{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(h,d?d.import:void 0),f);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=Vm),p}({editable:e.editable,html:s,namespace:n,nodes:r,onError:e=>o(e,l),theme:t});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=Xg();if(t.isEmpty()){const n=Ex();t.append(n);const r=Tx?document.activeElement:null;(null!==jb()||null!==r&&r===e.getRootElement())&&n.select()}}),Rx);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Rx);break}case"object":e.setEditorState(t,Rx);break;case"function":e.update((()=>{Xg().isEmpty()&&t(e)}),Rx)}}(l,i),[l,a]}),[]);return Ox((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,ou.jsx)(Fp.Provider,{value:n,children:t})}const Ax="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function jx(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Mx(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=Xg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=Xg().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Fx(e,t){const n=vv(e.focus,t);return hx(n)&&!n.isIsolated()||ux(n)&&!n.isInline()&&!n.canBeEmpty()}function zx(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(mx(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function Bx(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=ux(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=Lv(t);e=ub(e)&&null!==r?function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,i=e.isBackward(),s=r.getNode(),a=o.getNode(),l=t.is(s),c=t.is(a);if(l||c){const[n,r]=_b(e),o=s.is(a),l=t.is(i?a:s),c=t.is(i?s:a);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):l?(d=i?r:n,u=void 0):c&&(d=0,u=i?n:r),t.__text=t.__text.slice(d,u),t}}return t}(r,e):e,s=e}const a=ux(s)?s.getChildren():[],l=e._nodes.get(s.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let n=0;n{if(null!==e){const r=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}(e,KeyboardEvent)?null:e.clipboardData,o=jb();if(null!==o&&null!=r){e.preventDefault();const i=function(e,t=jb()){return null==t&&Vx(166),xb(t)&&t.isCollapsed()||0===t.getNodes().length?"":function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===n.g.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const r=document.createElement("div"),o=Xg().getChildren();for(let n=0;ne.getDecorators()));return Jx((()=>e.registerDecoratorListener((e=>{(0,Fn.flushSync)((()=>{r(e)}))}))),[e]),(0,o.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,o.useMemo)((()=>{const r=[],i=Object.keys(n);for(let s=0;se._onError(t),children:(0,ou.jsx)(o.Suspense,{fallback:null,children:n[a]})}),c=e.getElementByKey(a);null!==c&&r.push((0,Fn.createPortal)(l,c,a))}return r}),[t,n,e])}(r,n);return function(e){Jx((()=>Lx(function(e){return Lx(e.registerCommand(Up,(e=>{const t=jb();return!!xb(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(Gp,(e=>{const t=jb();return!!xb(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(Xp,(e=>{const t=jb();return!!xb(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(Hp,(e=>{const t=jb();if(!xb(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)Wx(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(Yp,(()=>{const e=jb();return!!xb(e)&&(e.removeText(),!0)}),0),e.registerCommand($p,(e=>{const t=jb();return!!xb(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Kp,(()=>{const e=jb();return!!xb(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(rm,(e=>{const t=jb();if(!xb(t))return!1;const n=e,r=n.shiftKey;return!!Fx(t,!0)&&(n.preventDefault(),zx(t,r,!0),!0)}),0),e.registerCommand(tm,(e=>{const t=jb();if(!xb(t))return!1;const n=e,r=n.shiftKey;return!!Fx(t,!1)&&(n.preventDefault(),zx(t,r,!1),!0)}),0),e.registerCommand(cm,(t=>!!xb(jb())&&(t.preventDefault(),e.dispatchCommand(Up,!0))),0),e.registerCommand(dm,(t=>!!xb(jb())&&(t.preventDefault(),e.dispatchCommand(Up,!1))),0),e.registerCommand(am,(t=>{if(!xb(jb()))return!1;if(null!==t){if((qx||Hx||Gx)&&Kx)return!1;t.preventDefault()}return e.dispatchCommand($p,!1)}),0),e.registerCommand(bm,(()=>(function(){const e=Xg();Zg(function(e){return Og(e.anchor),Og(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(vm,(t=>!!xb(jb())&&(Xx(t,e),!0)),0),e.registerCommand(ym,(t=>!!xb(jb())&&(function(e,t){Xx(e,t),t.update((()=>{const e=jb();xb(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(qp,(t=>!!xb(jb())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=jb(),{clipboardData:n}=e;null!=n&&xb(t)&&Wx(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(hm,(e=>!!xb(jb())&&(e.preventDefault(),!0)),0),e.registerCommand(pm,(e=>!!xb(jb())&&(e.preventDefault(),!0)),0))}(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,s,a,l]=t;e.update((()=>{const e=jb();if(xb(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(ub(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),ub(l)){c=s,u=s+a;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(r),(0,ou.jsxs)(ou.Fragment,{children:[e,(0,ou.jsx)(ew,{content:t}),i]})}function ew({content:e}){const[t]=zp(),n=function(e){const[t,n]=(0,o.useState)((()=>Zx(e)));return Jx((()=>{function t(){const t=Zx(e);n(t)}return t(),Lx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=zp(),n=(0,o.useMemo)((()=>e(t)),[t,e]),r=(0,o.useRef)(n.initialValueFn()),[i,s]=(0,o.useState)(r.current);return Ax((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,s(o)),t((e=>{r.current=e,s(e)}))}),[n,e]),i}(jx);return n?"function"==typeof e?e(r):e:null}const tw="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,nw=(0,o.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaExpanded:s,ariaLabel:a,ariaLabelledBy:l,ariaMultiline:c,ariaOwns:u,ariaRequired:d,autoCapitalize:f,className:h,id:p,role:m="textbox",spellCheck:g=!0,style:v,tabIndex:y,"data-testid":b,...x},w){const[E,S]=(0,o.useState)(e.isEditable()),_=(0,o.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),k=(0,o.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(w,_)),[_,w]);return tw((()=>(S(e.isEditable()),e.registerEditableListener((e=>{S(e)})))),[e]),(0,ou.jsx)("div",{...x,"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":i,"aria-expanded":E&&"combobox"===m?!!s:void 0,"aria-label":a,"aria-labelledby":l,"aria-multiline":c,"aria-owns":E?u:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:f,className:h,contentEditable:E,"data-testid":b,id:p,ref:k,role:E?m:void 0,spellCheck:g,style:v,tabIndex:y})}));function rw(e){return e.getEditorState().read(Mx(e.isComposing()))}const ow=(0,o.forwardRef)((function(e,t){const{placeholder:n,...r}=e,[o]=zp();return(0,ou.jsxs)(ou.Fragment,{children:[(0,ou.jsx)(nw,{editor:o,...r,ref:t}),null!=n&&(0,ou.jsx)(iw,{editor:o,content:n})]})}));function iw({content:e,editor:t}){const n=function(e){const[t,n]=(0,o.useState)((()=>rw(e)));return tw((()=>{function t(){const t=rw(e);n(t)}return t(),Lx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,o.useState)(t.isEditable());if((0,o.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let s=null;return"function"==typeof e?s=e(r):null!==e&&(s=e),null===s?null:(0,ou.jsx)("div",{"aria-hidden":!0,children:s})}const sw=0,aw=1,lw=2,cw=0,uw=1,dw=2,fw=3,hw=4;function pw(e){e.undoStack=[],e.redoStack=[],e.current=null}function mw({delay:e,externalHistoryState:t}){const[n]=zp();return function(e,t,n=1e3){const r=(0,o.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,o.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=cw;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=cw,n=u,lw;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return cw;const i=t._selection,s=e._selection;if(o)return uw;if(!(xb(i)&&xb(s)&&s.isCollapsed()&&i.isCollapsed()))return cw;const a=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||mx(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return cw;if(a.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&ub(r)&&1===r.__text.length&&1===i.anchor.offset?dw:cw}const l=a[0],c=e._nodeMap.get(l.__key);if(!ub(c)||!ub(l)||c.__mode!==l.__mode)return cw;const u=c.__text,d=l.__text;if(u===d)return cw;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return cw;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?dw:-1===g&&m===p+1?fw:-1===g&&m===p?hw:cw}(o,i,a,l,e.isComposing()),f=(()=>{const f=null===s||s.editor===e,h=c.has("history-push");if(!h&&f&&c.has("history-merge"))return sw;if(null===o)return aw;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==cw&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?sw:aw:null!==p?sw:lw})();return n=u,r=d,f}}(e,n),o=Lx(e.registerCommand(Zp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Em,!0)),0===r.length&&e.dispatchCommand(Sm,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(Qp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(Sm,!0));const i=n.pop();0===n.length&&e.dispatchCommand(Em,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(xm,(()=>(pw(t),!1)),0),e.registerCommand(wm,(()=>(pw(t),e.dispatchCommand(Em,!1),e.dispatchCommand(Sm,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:s,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const f=r(o,n,l,i,s,a);if(f===aw)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Em,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Sm,!0));else if(f===lw)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function gw(e,t){return gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gw(e,t)}var vw={error:null},yw=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===i.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(o,r,l)}))}),[r,e,t,n]),null}function Ew({editorRef:e}){const[t]=zp();return o.useEffect((()=>{"function"==typeof e?e(t):"object"==typeof e&&(e.current=t)}),[t]),null}var Sw={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",lg:"py-2.5 px-3 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.6875rem]"},_w={sm:"p-1.5 rounded-md max-h-[10.75rem]",md:"p-2 rounded-lg max-h-[13.5rem]",lg:"p-2 rounded-lg max-h-[13.5rem]"},kw={sm:"p-1.5 rounded text-sm leading-5 font-normal",md:"p-2 rounded-md text-base leading-6 font-normal",lg:"p-2 rounded-md text-base leading-6 font-normal"};const Cw="startTransition",Pw="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,Tw=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function Ow(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{d(0)}),[f]);const h=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&l?function(e){const t=jb();if(!xb(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,i=r.getTextContent().slice(0,o),s=e.replaceableString.length,a=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(i,e.matchingString,s);if(a<0)return null;let l;return 0===a?[l]=r.splitText(o):[,l]=r.splitText(a,o),l}(r.match):null;a(n,t,e,r.match?r.match.matchingString:"")}))}),[t,l,r.match,a,e]),p=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),Pw((()=>{null===i?d(null):null===u&&p(0)}),[i,u,p]),(0,o.useEffect)((()=>Lx(t.registerCommand(Rw,(({option:e})=>!(!e.ref||null==e.ref.current||(Tw(e.ref.current),0))),c))),[t,p,c]),(0,o.useEffect)((()=>Lx(t.registerCommand(sm,(e=>{const n=e;if(null!==i&&i.length&&null!==u){const e=u!==i.length-1?u+1:0;p(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(Rw,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),c),t.registerCommand(im,(e=>{const t=e;if(null!==i&&i.length&&null!==u){const e=0!==u?u-1:i.length-1;p(e);const n=i[e];null!=n.ref&&n.ref.current&&Tw(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),t.registerCommand(um,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),c),t.registerCommand(fm,(e=>{const t=e;return null!==i&&null!==u&&null!=i[u]&&(t.preventDefault(),t.stopImmediatePropagation(),h(i[u]),!0)}),c),t.registerCommand(am,(e=>null!==i&&null!==u&&null!=i[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(i[u]),!0)),c))),[h,e,t,i,u,p,c]),s(n,(0,o.useMemo)((()=>({options:i,selectOptionAndCleanUp:h,selectedIndex:u,setHighlightedIndex:d})),[h,u,i]),r.match?r.match.matchingString:"")}function Aw({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:s,menuRenderFn:a,triggerFn:l,anchorClassName:c,commandPriority:u=kx,parent:d}){const[f]=zp(),[h,p]=(0,o.useState)(null),m=function(e,t,n,r=document.body){const[i]=zp(),s=(0,o.useRef)(document.createElement("div")),a=(0,o.useCallback)((()=>{s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),o=s.current,a=o.firstChild;if(null!==t&&null!==e){const{left:i,top:l,width:c,height:u}=e.getRect(),d=s.current.offsetHeight;if(o.style.top=`${l+window.pageYOffset+d+3}px`,o.style.left=`${i+window.pageXOffset}px`,o.style.height=`${u}px`,o.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,s=t.getBoundingClientRect();i+r>s.right&&(o.style.left=`${s.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>s.bottom)&&l-s.top>n+u&&(o.style.top=l-n+window.pageYOffset-u+"px")}o.isConnected||(null!=n&&(o.className=n),o.setAttribute("aria-label","Typeahead menu"),o.setAttribute("id","typeahead-menu"),o.setAttribute("role","listbox"),o.style.display="block",o.style.position="absolute",r.append(o)),s.current=o,t.setAttribute("aria-controls","typeahead-menu")}}),[i,e,n,r]);(0,o.useEffect)((()=>{const t=i.getRootElement();if(null!==e)return a(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&e.remove()}}),[i,a,e]);const l=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[i]=zp();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=i.getRootElement(),o=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let s=!1,a=Ow(t,o);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Ow(t,o);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,i,r,n,e])}(e,s.current,a,l),s}(h,p,c,d),g=(0,o.useCallback)((()=>{p(null),null!=s&&null!==h&&s()}),[s,h]),v=(0,o.useCallback)((e=>{p(e),null!=r&&null===h&&r(e)}),[r,h]);return(0,o.useEffect)((()=>{const e=f.registerUpdateListener((()=>{f.getEditorState().read((()=>{const e=f._window||window,n=e.document.createRange(),r=jb(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=jb();xb(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(f);if(!xb(r)||!r.isCollapsed()||null===o||null===n)return void g();const s=l(o,f);if(t(s?s.matchingString:null),null!==s&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=jb();if(xb(e)){const t=e.anchor.getNode().getPreviousSibling();return ub(t)&&t.isTextEntity()}return!1}))}(f,s.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,i=e,s=r.anchorOffset;if(null==o||null==s)return!1;try{t.setStart(o,i),t.setEnd(o,s)}catch(e){return!1}return!0}(s.leadOffset,n,e);if(null!==t)return a=()=>v({getRect:()=>n.getBoundingClientRect(),match:s}),void(Cw in i()?i()[Cw](a):a())}var a;g()}))}));return()=>{e()}}),[f,l,t,h,g,v]),null===h||null===f?null:(0,ou.jsx)(Nw,{close:g,resolution:h,editor:f,anchorElementRef:m,options:e,menuRenderFn:a,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:u})}function jw(e){return jw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jw(e)}function Mw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&void 0!==arguments[2]?arguments[2]:"name",r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eE(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,o.useState)([]),2),i=r[0],s=r[1];return(0,o.useEffect)((function(){if(null!==t){var r=tE.get(t);null!==r&&(void 0===r?(tE.set(t,null),nE(e,t,(function(e){tE.set(t,e),s(e)}),n)):s(r))}else s([])}),[t]),i},oE=["size","children","selected","className"];function iE(){return iE=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",p=[l].join(""),m="[^"+p+h+"\\s]",g="(?:\\.[ |$]| |["+h+"]|)",v=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m).concat(g,"){0,").concat(75,"}))$")),y=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m,"){0,").concat(50,"}))$")),b=lE(zp(),1)[0],x=lE((0,o.useState)(null),2),w=x[0],E=x[1],S=rE(t,w,r),_=(0,o.useCallback)((function(e,t,n){b.update((function(){var o=Hw(e.data,r,s);t&&t.replace(o),n()}))}),[b]),k=(0,o.useMemo)((function(){return S.map((function(e){return new Qw(e)}))}),[b,S]);return React.createElement(Aw,{onQueryChange:E,onSelectOption:_,triggerFn:function(e){var t=v.exec(e);if(null===t&&(t=y.exec(e)),null!==t){var n=t[1],r=t[3];if(r.length>=0)return{leadOffset:t.index+n.length,matchingString:r,replaceableString:t[2]}}return null},options:k,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,i=t.setHighlightedIndex;return e.current&&!(null==k||!k.length)&&React.createElement(u,{size:s},k.map((function(e,t){var a;return React.createElement(f,{key:t,ref:e.ref,size:s,selected:t===n,onMouseEnter:function(){i(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},dE={ltr:"ltr",rtl:"rtl",paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},list:{nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul",listitem:"editor-listItem",listitemChecked:"editor-listItemChecked",listitemUnchecked:"editor-listItemUnchecked"},hashtag:"editor-hashtag",image:"editor-image",link:"editor-link",text:{bold:"editor-textBold",code:"editor-textCode",italic:"editor-textItalic",strikethrough:"editor-textStrikethrough",subscript:"editor-textSubscript",superscript:"editor-textSuperscript",underline:"editor-textUnderline",underlineStrikethrough:"editor-textUnderlineStrikethrough"},code:"editor-code",codeHighlight:{atrule:"editor-tokenAttr",attr:"editor-tokenAttr",boolean:"editor-tokenProperty",builtin:"editor-tokenSelector",cdata:"editor-tokenComment",char:"editor-tokenSelector",class:"editor-tokenFunction","class-name":"editor-tokenFunction",comment:"editor-tokenComment",constant:"editor-tokenProperty",deleted:"editor-tokenProperty",doctype:"editor-tokenComment",entity:"editor-tokenOperator",function:"editor-tokenFunction",important:"editor-tokenVariable",inserted:"editor-tokenSelector",keyword:"editor-tokenAttr",namespace:"editor-tokenVariable",number:"editor-tokenProperty",operator:"editor-tokenOperator",prolog:"editor-tokenComment",property:"editor-tokenProperty",punctuation:"editor-tokenPunctuation",regex:"editor-tokenVariable",selector:"editor-tokenSelector",string:"editor-tokenSelector",symbol:"editor-tokenProperty",tag:"editor-tokenProperty",url:"editor-tokenOperator",variable:"editor-tokenVariable"}},fE=function(e){var t=e.content;return React.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-start text-field-placeholder"},t)};function hE(e){console.error(e)}var pE=function(e,t){var n,r,i=e.defaultValue,s=void 0===i?"":i,a=e.placeholder,l=void 0===a?"Press @ to view variable suggestions":a,c=e.onChange,u=e.size,d=void 0===u?"md":u,f=e.autoFocus,h=void 0!==f&&f,p=e.options,m=void 0===p?[]:p,g=e.by,v=void 0===g?"name":g,y=e.trigger,b=void 0===y?"@":y,x=e.menuComponent,w=e.menuItemComponent,E=e.className,S=e.disabled,_=void 0!==S&&S,k={namespace:"Editor",editorTheme:dE,onError:hE,nodes:[qw],editorState:s||'{\n "root": {\n "children": [\n {\n "children": [],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "paragraph",\n "version": 1,\n "textFormat": 0,\n "textStyle": ""\n }\n ],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "root",\n "version": 1\n }\n}',editable:!_};return(0,o.isValidElement)(x)&&(n=x),(0,o.isValidElement)(w)&&(r=w),React.createElement("div",{className:te("relative w-full","border border-solid focus-within:ring-2 focus-within:ring-offset-2 border-field-border hover:border-border-strong focus-within:!border-focus-border focus-within:ring-focus transition duration-150 ease-in-out",Sw[d],_&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(Nx,{initialConfig:k},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(Qx,{contentEditable:React.createElement(ow,{className:te("editor-content focus-visible:outline-none outline-none","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",E)}),placeholder:React.createElement(fE,{content:l}),ErrorBoundary:bw})),React.createElement(mw,null),React.createElement(uE,{menuComponent:n,menuItemComponent:r,size:d,by:v,optionsArray:m,trigger:b}),React.createElement(ww,{onChange:function(e,t){"function"==typeof c&&c(e,t)},ignoreSelectionChange:!0}),t&&React.createElement(Ew,{editorRef:t}),h&&React.createElement(Bp,null)))},mE=(0,o.forwardRef)(pE);mE.displayName="EditorInput";var gE=mE;const vE=xe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var yE=function(e,t){return te("rounded-full text-brand-primary-600 transition-colors duration-300",e[t].dot,e[t].ring)},bE=["variant","size","type","currentStep","children","className"],xE=["labelText","icon","stepClasses","isCurrent","isCompleted","className","type","variant","sizeClasses","size","isLast","index"];function wE(){return wE=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:size-4",md:"[&>svg]:size-5"})||void 0===n?void 0:n[g],b=function(){m(!p),u&&u(!p)};return i().createElement("div",null,i().createElement("div",{role:"button",tabIndex:"0",onClick:b,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||b()},className:te("text-text-primary bg-transparent cursor-pointer flex justify-between items-center p-1 gap-1",v,f),"aria-expanded":p},i().createElement("span",{className:"text-text-tertiary"},r),a&&i().createElement(Kf.span,{variants:{open:{rotate:180},closed:{rotate:0}},animate:p?"open":"closed",transition:{duration:.15},className:te("flex items-center text-border-strong",y)},i().createElement(Qf,null))),i().createElement(Kh,{initial:!1},p&&i().createElement(Kf.ul,{variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow-hidden flex gap-0.5 flex-col m-0 bg-white rounded-md p-0"},d)))},NE.Item=function(e){var t,n=e.disabled,r=void 0!==n&&n,o=e.active,s=e.onClick,a=e.children,l=e.className,c=RE().size,u=null===(t={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"})||void 0===t?void 0:t[c],d=r?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",f=o?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"";return i().createElement("li",{role:"menuitem",tabIndex:"0",onClick:s,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||s()},className:te("flex p-1 gap-1 items-center bg-transparent w-full border-none rounded text-text-secondary cursor-pointer m-0",u,"hover:bg-background-secondary hover:text-text-primary",d,f,"transition-colors duration-300 ease-in-out",l)},a)},NE.Separator=function(e){var t,n=e.variant,r=void 0===n?"solid":n,o=e.className,s=null===(t={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"})||void 0===t?void 0:t[r];return i().createElement(i().Fragment,null,i().createElement("hr",{className:te("w-full border-0 border-t border-border-subtle",s,o)}))};var AE=NE;const jE=xe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]),ME=xe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var IE=["children","className","onCollapseChange","collapsible","screenHeight","borderOn"];function DE(){return DE=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:block h-full",n)},t)};var AS=NS;function jS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{const t=u(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),a(n,t)||c(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},a=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?a(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find((({validator:e})=>e(i)))?.classGroupId},l=/^\[(.+)\]$/,c=e=>{if(l.test(e)){const t=l.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},u=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return p(Object.entries(e.classGroups),n).forEach((([e,n])=>{d(n,r,e,t)})),r},d=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return h(e)?void d(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{d(o,f(t,e),n,r)}))}else(""===e?t:f(t,e)).classGroupId=n}))},f=(e,t)=>{let n=e;return t.split("-").forEach((e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n},h=e=>e.isThemeGetter,p=(e,t)=>t?e.map((([e,n])=>[e,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,n])=>[t+e,n]))):e))])):e,m=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},g=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,s=e=>{const n=[];let s,a=0,l=0;for(let c=0;cl?s-l:void 0}};return n?e=>n({className:e,parseClassName:s}):s},v=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach((e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)})),t.push(...n.sort()),t},y=/\s+/;function b(){let e,t,n=0,r="";for(;n{if("string"==typeof e)return e;let t,n="";for(let r=0;rt(e)),e());return n=(e=>({cache:m(e.cacheSize),parseClassName:g(e),...s(e)}))(c),r=n.cache.get,o=n.cache.set,i=a,a(l)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(y);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),h=r(f?u.substring(0,d):u);if(!h){if(!f){a=t+(a.length>0?" "+a:a);continue}if(h=r(u),!h){a=t+(a.length>0?" "+a:a);continue}f=!1}const p=v(l).join(":"),m=c?p+"!":p,g=m+h;if(i.includes(g))continue;i.push(g);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(b.apply(null,arguments))}}const E=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},S=/^\[(?:([a-z-]+):)?(.+)\]$/i,_=/^\d+\/\d+$/,k=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,P=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,O=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N=e=>j(e)||k.has(e)||_.test(e),A=e=>H(e,"length",q),j=e=>Boolean(e)&&!Number.isNaN(Number(e)),M=e=>H(e,"number",j),I=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&j(e.slice(0,-1)),L=e=>S.test(e),F=e=>C.test(e),z=new Set(["length","size","percentage"]),B=e=>H(e,z,Y),V=e=>H(e,"position",Y),W=new Set(["image","url"]),U=e=>H(e,W,X),$=e=>H(e,"",G),K=()=>!0,H=(e,t,n)=>{const r=S.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},q=e=>P.test(e)&&!T.test(e),Y=()=>!1,G=e=>O.test(e),X=e=>R.test(e),J=(Symbol.toStringTag,()=>{const e=E("colors"),t=E("spacing"),n=E("blur"),r=E("brightness"),o=E("borderColor"),i=E("borderRadius"),s=E("borderSpacing"),a=E("borderWidth"),l=E("contrast"),c=E("grayscale"),u=E("hueRotate"),d=E("invert"),f=E("gap"),h=E("gradientColorStops"),p=E("gradientColorStopPositions"),m=E("inset"),g=E("margin"),v=E("opacity"),y=E("padding"),b=E("saturate"),x=E("scale"),w=E("sepia"),S=E("skew"),_=E("space"),k=E("translate"),C=()=>["auto",L,t],P=()=>[L,t],T=()=>["",N,A],O=()=>["auto",j,L],R=()=>["","0",L],z=()=>[j,L];return{cacheSize:500,separator:":",theme:{colors:[K],spacing:[N,A],blur:["none","",F,L],brightness:z(),borderColor:[e],borderRadius:["none","","full",F,L],borderSpacing:P(),borderWidth:T(),contrast:z(),grayscale:R(),hueRotate:z(),invert:R(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[D,A],inset:C(),margin:C(),opacity:z(),padding:P(),saturate:z(),scale:z(),sepia:R(),skew:z(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",L]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,L]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",I,L]}],"grid-cols":[{"grid-cols":[K]}],"col-start-end":[{col:["auto",{span:["full",I,L]},L]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[K]}],"row-start-end":[{row:["auto",{span:[I,L]},L]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,A]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",M]}],"font-family":[{font:[K]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",j,M]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",N,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",N,A]}],"underline-offset":[{"underline-offset":["auto",N,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",V]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",B]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[N,L]}],"outline-w":[{outline:[N,A]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[N,A]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,$]}],"shadow-color":[{shadow:[K]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",F,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[I,L]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[N,A,M]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Z=w(J);function Q(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;tsvg]:h-4 [&>svg]:w-4",sm:"p-2 rounded-sm [&>svg]:h-4 [&>svg]:w-4",md:"p-2.5 rounded-md text-sm [&>svg]:h-5 [&>svg]:w-5",lg:"p-3 rounded-lg text-base [&>svg]:h-6 [&>svg]:w-6"})||void 0===o?void 0:o[u],A=null,j="";E&&(j="flex items-center justify-center gap-1","left"===_?s=E:A=E);var M=p;return i().createElement(M,se({ref:t,type:f,className:te(j,"border border-solid cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",N,O,R,T,m),disabled:y},P),s,g,A)})),le=ae;let ce=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var ue=["id","onChange","value","defaultValue","size","disabled","label","name","className"];function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ");var ye={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const be=(0,o.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>(0,o.createElement)("svg",{ref:c,...ye,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:ve("lucide",i),...l},[...a.map((([e,t])=>(0,o.createElement)(e,t))),...Array.isArray(s)?s:[s]]))),xe=(e,t)=>{const n=(0,o.forwardRef)((({className:n,...r},i)=>{return(0,o.createElement)(be,{ref:i,iconNode:t,className:ve(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s}));return n.displayName=`${e}`,n},we=xe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Ee=xe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Se=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"},Ae=["id","label","value","children","disabled","icon","inlineIcon","hideSelection","reversePosition","borderOn","badgeItem","useSwitch"],je=["id","children","value","disabled","size"];function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4"},h):null,r,b&&React.createElement("span",{className:_,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(Ke,null),React.createElement("span",{className:"absolute -inset-1"}))):null},qe=(0,o.forwardRef)(He);qe.displayName="Badge";var Ye=qe,Ge=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function Xe(){return Xe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-3 [&>svg]:w-3 text-xs",sm:"w-6 h-6 [&>svg]:h-4 [&>svg]:w-4 text-sm",md:"w-8 h-8 [&>svg]:h-5 [&>svg]:w-5 text-base",lg:"w-10 h-10 [&>svg]:h-6 [&>svg]:w-6 text-lg"})||void 0===n?void 0:n[l],v=null===(r={none:"",subtle:"border border-solid border-border-transparent-subtle",ring:"border-4 border-solid border-border-white"})||void 0===r?void 0:r[f&&"none"===u?"subtle":u],y=f?"bg-cover bg-center bg-no-repeat":"";return React.createElement("div",{className:te("rounded-full overflow-hidden flex items-center justify-center",!f&&m,g,v,y,p),style:f?{backgroundImage:"url(".concat(f,")")}:{}},h?"string"==typeof h?null==h||null===(o=h[0])||void 0===o?void 0:o.toUpperCase():h:null)};const nt=xe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var rt=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?j(t[0].name):j(null):t=e.target.value,P||"file"===i||R(t),"function"==typeof g&&g(t))},D="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full focus:outline-none",L={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},F={sm:"text-xs",md:"text-base",lg:"text-base"},z={sm:E?"pl-8":"",md:E?"pl-9":"",lg:E?"pl-10":""},B={sm:_?"pr-8":"",md:_?"pr-9":"",lg:_?"pr-10":""},V=p?"hover:border-border-disabled":"hover:border-border-strong",W="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",U=y?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",$=y?"focus:border-focus-error-border focus:ring-field-color-error":"",K=p?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",H=p?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",q="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",Y=p?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",G=A?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===i?React.createElement("div",{className:te("relative flex focus-within:z-10",f)},React.createElement("input",ot({ref:t,id:C,type:"file",className:te(D,H,L[u],F[u],W,V,$,G),disabled:p,onChange:I,onInvalid:x},k)),React.createElement("div",{className:te(Y,"right-0 pr-3",{sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6"}[u])},React.createElement(nt,null))):React.createElement("div",{className:te("relative flex focus-within:z-10",f)},E?React.createElement("div",{className:te(q,"left-0 pl-3",F[u])},E):null,React.createElement("input",ot({ref:t,id:C,type:i,className:te(D,K,L[u],F[u],z[u],B[u],W,V,U),disabled:p,onChange:I,onInvalid:x,value:M()},k)),_?React.createElement("div",{className:te(q,"right-0 pr-3",F[u])},_):null)},lt=(0,o.forwardRef)(at);lt.displayName="Input";var ct=lt,ut=["children","tag","size","className","variant","required"];function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[l],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[f],g,u)},m),r)})),ht=ft,pt=function(e){var t=e.title,n=void 0===t?null:t,r=e.description,o=void 0===r?null:r,i=e.icon,s=void 0===i?null:i,a=e.iconPosition,l=void 0===a?"right":a,c=e.tag,u=void 0===c?"h2":c,d=e.size,f=void 0===d?"sm":d,h=e.className,p=void 0===h?"":h,m={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!n)return null;var g=function(){var e=u;return React.createElement(e,{className:te("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[f])},n)};return o?React.createElement("div",{className:p},React.createElement("div",null,s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:te("text-text-secondary font-normal",{xs:"text-base",sm:"text-lg",md:"text-xl",lg:"text-2xl"}[f])},o)):React.createElement("div",{className:p},s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g())};const mt=xe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var gt=function(e){var t,n,r=e.variant,o=void 0===r?"primary":r,i=e.size,s=void 0===i?"md":i,a=e.icon,l=void 0===a?null:a,c=e.className,u=void 0===c?"":c,d=null===(t={primary:"text-brand-primary-600 bg-background-primary",secondary:"text-background-primary bg-brand-primary-600"})||void 0===t?void 0:t[o],f=null===(n={sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6",xl:"[&>svg]:h-8 [&>svg]:w-8"})||void 0===n?void 0:n[s];return React.createElement("span",{className:te("flex",f,d,u)},l||React.createElement(mt,{className:"animate-spin"}))},vt=function(e){var t=e.progress,n=void 0===t?0:t,r=e.speed,o=void 0===r?200:r,i=e.className,s=void 0===i?"":i;if(!n)return null;var a=n;n<0&&(a=0),n>100&&(a=100);var l="translateX(-".concat(100-a,"%)"),c="h-2 rounded-full bg-background-brand absolute left-0 top-0 w-full bottom-0 origin-left transition-transform duration-".concat(o," ease-linear");return React.createElement("div",{className:te("h-2 rounded-full bg-misc-progress-background overflow-hidden relative",s),role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},React.createElement("div",{className:c,style:{transform:l}}))};function yt(e){return wt(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function xt(e){var t;return null==(t=(wt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function wt(e){return e instanceof Node||e instanceof bt(e).Node}function Et(e){return e instanceof Element||e instanceof bt(e).Element}function St(e){return e instanceof HTMLElement||e instanceof bt(e).HTMLElement}function _t(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot)}function kt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ct(e){return["table","td","th"].includes(yt(e))}function Pt(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Tt(e){const t=Ot(),n=Et(e)?Nt(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Ot(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Rt(e){return["html","body","#document"].includes(yt(e))}function Nt(e){return bt(e).getComputedStyle(e)}function At(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if("html"===yt(e))return e;const t=e.assignedSlot||e.parentNode||_t(e)&&e.host||xt(e);return _t(t)?t.host:t}function Mt(e){const t=jt(e);return Rt(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&kt(t)?t:Mt(t)}function It(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Mt(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=bt(o);if(i){const e=Dt(s);return t.concat(s,s.visualViewport||[],kt(o)?o:[],e&&n?It(e):[])}return t.concat(o,It(o,[],n))}function Dt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Ft(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_t(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function zt(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Bt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Vt(e){return!(0!==e.mozInputSource||!e.isTrusted)||($t()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Wt(e){return!Bt().includes("jsdom/")&&(!$t()&&0===e.width&&0===e.height||$t()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function Ut(){return/apple/i.test(navigator.vendor)}function $t(){const e=/android/i;return e.test(zt())||e.test(Bt())}function Kt(){return zt().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ht(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function qt(e){return(null==e?void 0:e.ownerDocument)||document}function Yt(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Gt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Xt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Jt(e){return St(e)&&e.matches(Xt)}function Zt(e){e.preventDefault(),e.stopPropagation()}function Qt(e){return!!e&&"combobox"===e.getAttribute("role")&&Jt(e)}const en=Math.min,tn=Math.max,nn=Math.round,rn=Math.floor,on=e=>({x:e,y:e}),sn={left:"right",right:"left",bottom:"top",top:"bottom"},an={start:"end",end:"start"};function ln(e,t,n){return tn(e,en(t,n))}function cn(e,t){return"function"==typeof e?e(t):e}function un(e){return e.split("-")[0]}function dn(e){return e.split("-")[1]}function fn(e){return"x"===e?"y":"x"}function hn(e){return"y"===e?"height":"width"}function pn(e){return["top","bottom"].includes(un(e))?"y":"x"}function mn(e){return fn(pn(e))}function gn(e){return e.replace(/start|end/g,(e=>an[e]))}function vn(e){return e.replace(/left|right|bottom|top/g,(e=>sn[e]))}function yn(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 bn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var xn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),wn="undefined"==typeof Element,En=wn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Sn=!wn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},kn=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Cn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!kn(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{En.call(s,xn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!kn(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},Pn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Tn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Pn(e)?0:e.tabIndex},On=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Rn=function(e){return"INPUT"===e.tagName},Nn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},An=function(e,t){return!(t.disabled||kn(t)||function(e){return Rn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=En.call(e,"details>summary:first-of-type")?e.parentElement:e;if(En.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Nn(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=Sn(e);if(s&&!s.shadowRoot&&!0===r(s))return Nn(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&Sn(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=Sn(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},In=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,s=i?t.scopeParent:t,a=function(e,t){var n=Tn(e);return n<0&&t&&!Pn(e)?0:n}(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(On).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Dn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Cn([e],t.includeContainer,{filter:jn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Mn}):function(e,t,n){if(kn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(xn));return t&&En.call(e,xn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,jn.bind(null,t)),In(n)},Ln=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==En.call(e,xn)&&jn(t,e)},Fn=window.ReactDOM;function zn(e,t,n){let{reference:r,floating:o}=e;const i=pn(t),s=mn(t),a=hn(s),l=un(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.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-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(dn(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function Bn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=cn(t,e),p=yn(h),m=a[f?"floating"===d?"reference":"floating":d],g=bn(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=bn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function Vn(e){const t=Nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=St(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=nn(n)!==i||nn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Wn(e){return Et(e)?e:e.contextElement}function Un(e){const t=Wn(e);if(!St(t))return on(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Vn(t);let s=(i?nn(n.width):n.width)/r,a=(i?nn(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const $n=on(0);function Kn(e){const t=bt(e);return Ot()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$n}function Hn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Wn(e);let s=on(1);t&&(r?Et(r)&&(s=Un(r)):s=Un(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==bt(e))&&t}(i,n,r)?Kn(i):on(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=bt(i),t=r&&Et(r)?bt(r):r;let n=e,o=Dt(n);for(;o&&r&&t!==n;){const e=Un(o),t=o.getBoundingClientRect(),r=Nt(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=bt(o),o=Dt(n)}}return bn({width:u,height:d,x:l,y:c})}function qn(e){return Hn(xt(e)).left+At(e).scrollLeft}function Yn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=bt(e),r=xt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=Ot();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=xt(e),n=At(e),r=e.ownerDocument.body,o=tn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+qn(e);const a=-n.scrollTop;return"rtl"===Nt(r).direction&&(s+=tn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(xt(e));else if(Et(t))r=function(e,t){const n=Hn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=St(e)?Un(e):on(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Kn(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return bn(r)}function Gn(e,t){const n=jt(e);return!(n===t||!Et(n)||Rt(n))&&("fixed"===Nt(n).position||Gn(n,t))}function Xn(e,t,n){const r=St(t),o=xt(t),i="fixed"===n,s=Hn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=on(0);if(r||!r&&!i)if(("body"!==yt(t)||kt(o))&&(a=At(t)),r){const e=Hn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=qn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Jn(e){return"static"===Nt(e).position}function Zn(e,t){return St(e)&&"fixed"!==Nt(e).position?t?t(e):e.offsetParent:null}function Qn(e,t){const n=bt(e);if(Pt(e))return n;if(!St(e)){let t=jt(e);for(;t&&!Rt(t);){if(Et(t)&&!Jn(t))return t;t=jt(t)}return n}let r=Zn(e,t);for(;r&&Ct(r)&&Jn(r);)r=Zn(r,t);return r&&Rt(r)&&Jn(r)&&!Tt(r)?n:r||function(e){let t=jt(e);for(;St(t)&&!Rt(t);){if(Tt(t))return t;if(Pt(t))return null;t=jt(t)}return null}(e)||n}const er={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=xt(r),a=!!t&&Pt(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=on(1);const u=on(0),d=St(r);if((d||!d&&!i)&&(("body"!==yt(r)||kt(s))&&(l=At(r)),St(r))){const e=Hn(r);c=Un(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:xt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Pt(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=It(e,[],!1).filter((e=>Et(e)&&"body"!==yt(e))),o=null;const i="fixed"===Nt(e).position;let s=i?jt(e):e;for(;Et(s)&&!Rt(s);){const t=Nt(s),n=Tt(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||kt(s)&&!n&&Gn(e,s))?r=r.filter((e=>e!==s)):o=t,s=jt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Yn(t,n,o);return e.top=tn(r.top,e.top),e.right=en(r.right,e.right),e.bottom=en(r.bottom,e.bottom),e.left=tn(r.left,e.left),e}),Yn(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Qn,getElementRects:async function(e){const t=this.getOffsetParent||Qn,n=this.getDimensions,r=await n(e.floating);return{reference:Xn(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}=Vn(e);return{width:t,height:n}},getScale:Un,isElement:Et,isRTL:function(e){return"rtl"===Nt(e).direction}};function tr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Wn(e),u=o||i?[...c?It(c):[],...It(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=xt(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h={rootMargin:-rn(u)+"px "+-rn(o.clientWidth-(c+d))+"px "+-rn(o.clientHeight-(u+f))+"px "+-rn(c)+"px",threshold:tn(0,en(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?Hn(e):null;return l&&function t(){const r=Hn(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const nr=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=un(n),a=dn(n),l="y"===pn(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=cn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},rr=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=cn(e,t),c={x:n,y:r},u=await Bn(t,l),d=pn(un(o)),f=fn(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=ln(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=ln(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},or=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=cn(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=un(o),y=pn(a),b=un(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[vn(a)]:function(e){const t=vn(e);return[gn(e),t,gn(t)]}(a)),E="none"!==p;!f&&E&&w.push(...function(e,t,n,r){const o=dn(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(un(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(gn)))),i}(a,m,p,x));const S=[a,...w],_=await Bn(t,g),k=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&k.push(_[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=dn(e),o=mn(e),i=hn(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=vn(s)),[s,vn(s)]}(o,s,x);k.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:o,overflows:k}],!k.every((e=>e<=0))){var P,T;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(T=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(h){case"bestFit":{var O;const e=null==(O=C.filter((e=>{if(E){const t=pn(e.placement);return t===y||"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:O[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},ir=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=cn(e,t),l=await Bn(t,a),c=un(n),u=dn(n),d="y"===pn(n),{width:f,height:h}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,y=en(h-l[p],g),b=en(f-l[m],v),x=!t.middlewareData.shift;let w=y,E=b;if(d?E=u||x?en(b,v):v:w=u||x?en(y,g):g,x&&!u){const e=tn(l.left,0),t=tn(l.right,0),n=tn(l.top,0),r=tn(l.bottom,0);d?E=f-2*(0!==e||0!==t?e+t:tn(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:tn(l.top,l.bottom))}await s({...t,availableWidth:E,availableHeight:w});const S=await o.getDimensions(i.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},sr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=cn(e,t)||{};if(null==c)return{};const d=yn(u),f={x:n,y:r},h=mn(o),p=hn(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],E=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==s.isElement?void 0:s.isElement(E))||(S=a.floating[b]||i.floating[p]);const _=x/2-w/2,k=S/2-m[p]/2-1,C=en(d[v],k),P=en(d[y],k),T=C,O=S-m[p]-P,R=S/2-m[p]/2+_,N=ln(T,R,O),A=!l.arrow&&null!=dn(o)&&R!==N&&i.reference[p]/2-(R{const r=new Map,o={platform:er,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=zn(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const hr=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?sr({element:n.current,padding:r}).fn(t):{}:n?sr({element:n,padding:r}).fn(t):{};var o}}),pr=(e,t)=>({...nr(e),options:[e,t]}),mr=(e,t)=>({...or(e),options:[e,t]}),gr=(e,t)=>({...hr(e),options:[e,t]}),vr={...o},yr=vr.useInsertionEffect||(e=>e());function br(e){const t=o.useRef((()=>{}));return yr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function Cr(e,t){return Tr(e,{disabledIndices:t})}function Pr(e,t){return Tr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Tr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t;const s=e.current;let a=n;do{a+=r?-i:i}while(a>=0&&a<=s.length-1&&Nr(s,a,o));return a}function Or(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function Rr(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function Nr(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Ar=0;function jr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ar);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ar=requestAnimationFrame(i)}var Mr="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function Ir(){return Ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+Lr++,zr=vr.useId||function(){const[e,t]=o.useState((()=>Dr?Fr():void 0));return Mr((()=>{null==e&&t(Fr())}),[]),o.useEffect((()=>{Dr=!0}),[]),e},Br=o.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:h,style:{transform:p,...m}={},...g}=e,v=zr(),[y,b]=o.useState(!1);if(Mr((()=>{r&&"rtl"===Nt(r).direction&&b(!0)}),[r]),!r)return null;const[x,w]=n.split("-"),E="top"===x||"bottom"===x;let S=d;(E&&null!=s&&s.x||!E&&null!=s&&s.y)&&(S=null);const _=2*u,k=_/2,C=a/2*(c/-8+1),P=l/2*c/4,T=!!h,O=S&&"end"===w?"bottom":"top";let R=S&&"end"===w?"right":"left";S&&y&&(R="end"===w?"left":"right");const N=null!=(null==i?void 0:i.x)?S||i.x:"",A=null!=(null==i?void 0:i.y)?S||i.y:"",j=h||"M0,0 H"+a+" L"+(a-C)+","+(l-P)+" Q"+a/2+","+l+" "+C+","+(l-P)+" Z",M={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",Ir({},g,{"aria-hidden":!0,ref:t,width:T?a:a+_,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[R]:N,[O]:A,[x]:E||T?"100%":"calc(100% - "+_/2+"px)",transform:""+M+(null!=p?p:""),...m}}),_>0&&o.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:_+(h?0:1),d:j}),o.createElement("path",{stroke:_&&!h?g.fill:"none",d:j}),o.createElement("clipPath",{id:v},o.createElement("rect",{x:-k,y:k*(T?-1:1),width:a+_,height:a})))}));const Vr=o.createContext(null),Wr=o.createContext(null),Ur=()=>{var e;return(null==(e=o.useContext(Vr))?void 0:e.id)||null},$r=()=>o.useContext(Wr);function Kr(e){return"data-floating-ui-"+e}function Hr(e){const t=(0,o.useRef)(e);return Mr((()=>{t.current=e})),t}const qr=Kr("safe-polygon");function Yr(e,t,n){return n&&!Ht(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Gr(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Xr=new WeakMap,Jr=new WeakSet,Zr={},Qr=0;const eo=e=>e&&(e.host||eo(e.parentNode)),to=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=eo(t);return e.contains(n)?n:null})).filter((e=>null!=e));function no(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=qt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=to(t,e),a=new Set,l=new Set(s),c=[];Zr[o]||(Zr[o]=new WeakMap);const u=Zr[o];return s.forEach((function e(t){t&&!a.has(t)&&(a.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==yt(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Xr.get(t)||0)+1,s=(u.get(t)||0)+1;Xr.set(t,r),u.set(t,s),c.push(t),1===r&&n&&Jr.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Qr++,()=>{c.forEach((e=>{const t=(Xr.get(e)||0)-1,n=(u.get(e)||0)-1;Xr.set(e,t),u.set(e,n),t||(!Jr.has(e)&&i&&e.removeAttribute(i),Jr.delete(e)),n||e.removeAttribute(o)})),Qr--,Qr||(Xr=new WeakMap,Xr=new WeakMap,Jr=new WeakSet,Zr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const ro=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function oo(e,t){const n=Dn(e,ro());"prev"===t&&n.reverse();const r=n.indexOf(Lt(qt(e)));return n.slice(r+1)[0]}function io(){return oo(document.body,"next")}function so(){return oo(document.body,"prev")}function ao(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ft(n,r)}function lo(e){Dn(e,ro()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function co(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const uo={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function fo(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const ho=o.forwardRef((function(e,t){const[n,r]=o.useState();Mr((()=>(Ut()&&r("button"),document.addEventListener("keydown",fo),()=>{document.removeEventListener("keydown",fo)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Kr("focus-guard")]:"",style:uo};return o.createElement("span",Ir({},e,i))})),po=o.createContext(null),mo=Kr("portal");function go(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=zr(),i=vo(),[s,a]=o.useState(null),l=o.useRef(null);return Mr((()=>()=>{null==s||s.remove(),queueMicrotask((()=>{l.current=null}))}),[s]),Mr((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(mo,""),e.appendChild(n),l.current=n,a(n)}),[t,r]),Mr((()=>{if(!r)return;if(l.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!Et(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const s=document.createElement("div");s.id=r,s.setAttribute(mo,""),e=o||e,e.appendChild(s),l.current=s,a(s)}),[t,n,r,i]),s}({id:n,root:r}),[a,l]=o.useState(null),c=o.useRef(null),u=o.useRef(null),d=o.useRef(null),f=o.useRef(null),h=null==a?void 0:a.modal,p=null==a?void 0:a.open,m=!!a&&!a.modal&&a.open&&i&&!(!r&&!s);return o.useEffect((()=>{if(s&&i&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&ao(e)&&("focusin"===e.type?co:lo)(s)}}),[s,i,h]),o.useEffect((()=>{s&&(p||co(s))}),[p,s]),o.createElement(po.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:l})),[i,s])},m&&s&&o.createElement(ho,{"data-type":"outside",ref:c,onFocus:e=>{if(ao(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=so()||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),m&&s&&o.createElement("span",{"aria-owns":s.id,style:uo}),s&&Fn.createPortal(t,s),m&&s&&o.createElement(ho,{"data-type":"outside",ref:u,onFocus:e=>{if(ao(e,s)){var t;null==(t=f.current)||t.focus()}else{const t=io()||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const vo=()=>o.useContext(po),yo="data-floating-ui-focusable";function bo(e){return e?e.hasAttribute(yo)?e:e.querySelector("["+yo+"]")||e:null}const xo=20;let wo=[];function Eo(e){wo=wo.filter((e=>e.isConnected));let t=e;if(t&&"body"!==yt(t)){if(!Ln(t,ro())){const e=Dn(t,ro())[0];e&&(t=e)}wo.push(t),wo.length>xo&&(wo=wo.slice(-xo))}}function So(){return wo.slice().reverse().find((e=>e.isConnected))}const _o=o.forwardRef((function(e,t){return o.createElement("button",Ir({},e,{type:"button",ref:t,tabIndex:-1,style:uo}))}));function ko(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:v,dataRef:y,floatingId:b,elements:{domReference:x,floating:w}}=t,E="number"==typeof a&&a<0,S=Qt(x)&&E,_=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||s,k=Hr(i),C=Hr(a),P=Hr(l),T=$r(),O=vo(),R=o.useRef(null),N=o.useRef(null),A=o.useRef(!1),j=o.useRef(!1),M=o.useRef(-1),I=null!=O,D=bo(w),L=br((function(e){return void 0===e&&(e=D),e?Dn(e,ro()):[]})),F=br((e=>{const t=L(e);return k.current.map((e=>x&&"reference"===e?x:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function z(e){return!r&&d&&u?o.createElement(_o,{ref:"start"===e?R:N,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}o.useEffect((()=>{A.current=!1}),[r]),o.useEffect((()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){Ft(D,Lt(qt(D)))&&0===L().length&&!S&&Zt(e);const t=F(),n=Gt(e);"reference"===k.current[0]&&n===x&&(Zt(e),e.shiftKey?jr(t[t.length-1]):jr(t[1])),"floating"===k.current[1]&&n===D&&e.shiftKey&&(Zt(e),jr(t[0]))}}const t=qt(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,x,D,u,k,S,L,F]),o.useEffect((()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Gt(e),n=L().indexOf(t);-1!==n&&(M.current=n)}}),[r,w,L]),o.useEffect((()=>{if(!r&&f)return w&&St(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout((()=>{j.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(Ft(x,t)||Ft(w,t)||Ft(t,w)||Ft(null==O?void 0:O.portalNode,t)||null!=t&&t.hasAttribute(Kr("focus-guard"))||T&&(Gr(T.nodesRef.current,m).find((e=>{var n,r;return Ft(null==(n=e.context)?void 0:n.elements.floating,t)||Ft(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(T.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(c&&n&&Lt(qt(D))===qt(D).body){St(D)&&D.focus();const e=M.current,t=L(),n=t[e]||t[t.length-1]||D;St(n)&&n.focus()}!S&&u||!t||!n||j.current||t===So()||(A.current=!0,g(!1,e,"focus-out"))}))}}),[r,x,w,D,u,m,T,O,g,f,c,L,S]),o.useEffect((()=>{var e;if(r)return;const t=Array.from((null==O||null==(e=O.portalNode)?void 0:e.querySelectorAll("["+Kr("portal")+"]"))||[]);if(w){const e=[w,...t,R.current,N.current,k.current.includes("reference")||S?x:null].filter((e=>null!=e)),n=u||S?no(e,_,!_):no(e);return()=>{n()}}}),[r,x,w,u,k,O,S,_]),Mr((()=>{if(r||!St(D))return;const e=Lt(qt(D));queueMicrotask((()=>{const t=F(D),n=C.current,r=("number"==typeof n?t[n]:n.current)||D,o=Ft(D,e);E||o||!h||jr(r,{preventScroll:r===D})}))}),[r,h,D,E,F,C]),Mr((()=>{if(r||!D)return;let e=!1;const t=qt(D),n=Lt(t);let o=y.current.openEvent;const i=p.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&p.domReference.current&&Eo(p.domReference.current),"hover"===r&&"mouseleave"===i.type&&(A.current=!0),"outside-press"===r&&(s?(A.current=!1,e=!0):A.current=!(Vt(i)||Wt(i)))}return Eo(n),v.on("openchange",s),()=>{v.off("openchange",s);const r=Lt(t),a=Ft(w,r)||T&&Gr(T.nodesRef.current,m).some((e=>{var t;return Ft(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&Eo(p.domReference.current);const l=i||n,c=Dn(qt(l).body,ro());queueMicrotask((()=>{let n=So();!n&&St(l)&&w&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Kr("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||Ft(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,w)),P.current&&!A.current&&St(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,w,D,P,y,p,v,T,m]),Mr((()=>{if(!r&&O)return O.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{O.setFocusManagerState(null)}}),[r,O,u,h,g,p,f]),Mr((()=>{if(r)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(E)return;const e=()=>{const e=D.getAttribute("tabindex"),t=L(),n=Lt(qt(w)),r=t.indexOf(n);-1!==r&&(M.current=r),k.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,w,D,p,k,L,E]);const B=!r&&_&&(!u||!S)&&(I||u);return o.createElement(o.Fragment,null,B&&o.createElement(ho,{"data-type":"inside",ref:null==O?void 0:O.beforeInsideRef,onFocus:e=>{if(u){const e=F();jr("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(A.current=!1,ao(e,O.portalNode)){const e=io()||x;null==e||e.focus()}else{var t;null==(t=O.beforeOutsideRef.current)||t.focus()}}}),!S&&z("start"),n,z("end"),B&&o.createElement(ho,{"data-type":"inside",ref:null==O?void 0:O.afterInsideRef,onFocus:e=>{if(u)jr(F()[0]);else if(null!=O&&O.preserveTabOrder&&O.portalNode)if(f&&(A.current=!0),ao(e,O.portalNode)){const e=so()||x;null==e||e.focus()}else{var t;null==(t=O.afterOutsideRef.current)||t.focus()}}}))}function Co(e){return St(e.target)&&"BUTTON"===e.target.tagName}function Po(e){return Jt(e)}function To(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0}=t,f=o.useRef(),h=o.useRef(!1),p=o.useMemo((()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==l&&(Ht(t,!0)&&u||(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===l&&f.current?f.current=void 0:Ht(t,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||Co(e)||(" "!==e.key||Po(s)||(e.preventDefault(),h.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||Co(e)||Po(s)||" "===e.key&&h.current&&(h.current=!1,r(!n||!c,e.nativeEvent,"click"))}})),[i,s,l,u,d,r,n,c]);return o.useMemo((()=>a?{reference:p}:{}),[a,p])}const Oo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ro={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},No=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Ao(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=$r(),v=br("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,b=o.useRef(!1),x=o.useRef(!1),{escapeKey:w,outsidePress:E}=No(p),{escapeKey:S,outsidePress:_}=No(m),k=br((e=>{var t;if(!n||!a||!l||"Escape"!==e.key)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=g?Gr(g.nodesRef.current,o):[];if(!w&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),C=br((e=>{var t;const n=()=>{var t;k(e),null==(t=Gt(e))||t.removeEventListener("keydown",n)};null==(t=Gt(e))||t.addEventListener("keydown",n)})),P=br((e=>{var t;const n=b.current;b.current=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const a=Gt(e),l="["+Kr("inert")+"]",c=qt(i.floating).querySelectorAll(l);let d=Et(a)?a:null;for(;d&&!Rt(d);){const e=jt(d);if(Rt(e)||!Et(e))break;d=e}if(c.length&&Et(a)&&!a.matches("html,body")&&!Ft(a,i.floating)&&Array.from(c).every((e=>!Ft(d,e))))return;if(St(a)&&R){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===Nt(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=g&&Gr(g.nodesRef.current,f).some((t=>{var n;return Yt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Yt(e,i.floating)||Yt(e,i.domReference)||h)return;const p=g?Gr(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),T=br((e=>{var t;const n=()=>{var t;P(e),null==(t=Gt(e))||t.removeEventListener(u,n)};null==(t=Gt(e))||t.addEventListener(u,n)}));o.useEffect((()=>{if(!n||!a)return;function e(e){r(!1,e,"ancestor-scroll")}s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=E;const t=qt(i.floating);l&&t.addEventListener("keydown",S?C:k,S),y&&t.addEventListener(u,_?T:P,_);let o=[];return h&&(Et(i.domReference)&&(o=It(i.domReference)),Et(i.floating)&&(o=o.concat(It(i.floating))),!Et(i.reference)&&i.reference&&i.reference.contextElement&&(o=o.concat(It(i.reference.contextElement)))),o=o.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),o.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{l&&t.removeEventListener("keydown",S?C:k,S),y&&t.removeEventListener(u,_?T:P,_),o.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[s,i,l,y,u,n,r,h,a,w,E,k,S,C,P,_,T]),o.useEffect((()=>{b.current=!1}),[y,u]);const O=o.useMemo((()=>({onKeyDown:k,[Oo[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,d,f]),R=o.useMemo((()=>({onKeyDown:k,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ro[u]]:()=>{b.current=!0}})),[k,u]);return o.useMemo((()=>a?{reference:O,floating:R}:{}),[a,O,R])}function jo(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=zr(),s=o.useRef({}),[a]=o.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),l=null!=Ur(),[c,u]=o.useState(r.reference),d=br(((e,t,r)=>{s.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),f=o.useMemo((()=>({setPositionReference:u})),[]),h=o.useMemo((()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference})),[c,r.reference,r.floating]);return o.useMemo((()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:a,floatingId:i,refs:f})),[t,d,h,a,i,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,a]=o.useState(null),[l,c]=o.useState(null),u=(null==i?void 0:i.reference)||s,d=o.useRef(null),f=$r();Mr((()=>{u&&(d.current=u)}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=o.useState(r);cr(h,r)||p(r);const[m,g]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=o.useCallback((e=>{e!==_.current&&(_.current=e,y(e))}),[]),w=s||m,E=a||v,S=o.useRef(null),_=o.useRef(null),k=o.useRef(d),C=null!=c,P=fr(c),T=fr(i),O=o.useCallback((()=>{if(!S.current||!_.current)return;const e={placement:t,strategy:n,middleware:h};T.current&&(e.platform=T.current),ar(S.current,_.current,e).then((e=>{const t={...e,isPositioned:!0};R.current&&!cr(k.current,t)&&(k.current=t,Fn.flushSync((()=>{f(t)})))}))}),[h,t,n,T]);lr((()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const R=o.useRef(!1);lr((()=>(R.current=!0,()=>{R.current=!1})),[]),lr((()=>{if(w&&(S.current=w),E&&(_.current=E),w&&E){if(P.current)return P.current(w,E,O);O()}}),[w,E,O,P,C]);const N=o.useMemo((()=>({reference:S,floating:_,setReference:b,setFloating:x})),[b,x]),A=o.useMemo((()=>({reference:w,floating:E})),[w,E]),j=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=dr(A.floating,d.x),r=dr(A.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...ur(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,A.floating,d.x,d.y]);return o.useMemo((()=>({...d,update:O,refs:N,elements:A,floatingStyles:j})),[d,O,N,A,j])}({...e,elements:{...i,...l&&{reference:l}}}),p=o.useCallback((e=>{const t=Et(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),m=o.useCallback((e=>{(Et(e)||null===e)&&(d.current=e,a(e)),(Et(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Et(e))&&h.refs.setReference(e)}),[h.refs]),g=o.useMemo((()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d})),[h.refs,m,p]),v=o.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=o.useMemo((()=>({...h,...r,refs:g,elements:v,nodeId:t})),[h,g,v,t,r]);return Mr((()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),o.useMemo((()=>({...h,context:y,refs:g,elements:v})),[h,g,v,y])}const Mo="active",Io="selected";function Do(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Mo]:t,[Io]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1,[yo]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[Mo,Io].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Lo(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),i=o.useCallback((t=>Do(t,e,"reference")),t),s=o.useCallback((t=>Do(t,e,"floating")),n),a=o.useCallback((t=>Do(t,e,"item")),r);return o.useMemo((()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a})),[i,s,a])}let Fo=!1;function zo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Bo(e,t){return zo(t,e===xr||e===wr,e===Er||e===Sr)}function Vo(e,t,n){return zo(t,e===wr,n?e===Er:e===Sr)||"Enter"===e||" "===e||""===e}function Wo(e,t,n){return zo(t,n?e===Sr:e===Er,e===xr)}function Uo(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:x="vertical",cols:w=1,scrollItemIntoView:E=!0,virtualItemRef:S,itemSizes:_,dense:k=!1}=t,C=Hr(bo(i.floating)),P=Ur(),T=$r(),O=br(l),R=o.useRef(g),N=o.useRef(null!=u?u:-1),A=o.useRef(null),j=o.useRef(!0),M=o.useRef(O),I=o.useRef(!!i.floating),D=o.useRef(n),L=o.useRef(!1),F=o.useRef(!1),z=Hr(b),B=Hr(n),V=Hr(E),W=Hr(u),[U,$]=o.useState(),[K,H]=o.useState(),q=br((function(e,t,n){function r(e){m?($(e.id),null==T||T.events.emit("virtualfocus",e),S&&(S.current=e)):jr(e,{preventScroll:!0,sync:!(!Kt()||!Ut())&&(Fo||L.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const i=e.current[t.current]||o;if(!i)return;o||r(i);const s=V.current;s&&G&&(n||!j.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));Mr((()=>{document.createElement("div").focus({get preventScroll(){return Fo=!0,!1}})}),[]),Mr((()=>{c&&(n&&i.floating?R.current&&null!=u&&(F.current=!0,N.current=u,O(u)):I.current&&(N.current=-1,M.current(null)))}),[c,n,i.floating,u,O]),Mr((()=>{if(c&&n&&i.floating)if(null==a){if(L.current=!1,null!=W.current)return;if(I.current&&(N.current=-1,q(s,N)),(!D.current||!I.current)&&R.current&&(null!=A.current||!0===R.current&&null==A.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(N.current=null==A.current||Vo(A.current,x,p)||h?Cr(s,z.current):Pr(s,z.current),A.current=null,O(N.current))};t()}}else kr(s,a)||(N.current=a,q(s,N,F.current),F.current=!1)}),[c,n,i.floating,a,W,h,s,x,p,O,q,z]),Mr((()=>{var e;if(!c||i.floating||!T||m||!I.current)return;const t=T.nodesRef.current,n=null==(e=t.find((e=>e.id===P)))||null==(e=e.context)?void 0:e.elements.floating,r=Lt(qt(i.floating)),o=t.some((e=>e.context&&Ft(e.context.elements.floating,r)));n&&!o&&j.current&&n.focus({preventScroll:!0})}),[c,i.floating,T,P,m]),Mr((()=>{if(c&&T&&m&&!P)return T.events.on("virtualfocus",e),()=>{T.events.off("virtualfocus",e)};function e(e){H(e.id),S&&(S.current=e)}}),[c,T,m,P,S]),Mr((()=>{M.current=O,I.current=!!i.floating})),Mr((()=>{n||(A.current=null)}),[n]),Mr((()=>{D.current=n}),[n]);const Y=null!=a,G=o.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&O(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;j.current&&"touch"!==t&&(N.current=-1,q(s,N),O(null),m||jr(C.current,{preventScroll:!0}))}}}}),[n,C,q,v,s,O,m]),X=br((e=>{if(j.current=!1,L.current=!0,!B.current&&e.currentTarget===C.current)return;if(h&&Wo(e.key,x,p))return Zt(e),r(!1,e.nativeEvent,"list-navigation"),void(St(i.domReference)&&!m&&i.domReference.focus());const t=N.current,o=Cr(s,b),a=Pr(s,b);if("Home"===e.key&&(Zt(e),N.current=o,O(N.current)),"End"===e.key&&(Zt(e),N.current=a,O(N.current)),w>1){const t=_||Array.from({length:s.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:s,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;nnull==r[e]))?(e.forEach((e=>{r[e]=i})),l=!0):o++}})),[...r]}(t,w,k),r=n.findIndex((e=>null!=e&&!Nr(s.current,e,b))),i=n.reduce(((e,t,n)=>null==t||Nr(s.current,t,b)?e:n),-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===xr){if(u&&Zt(n),-1===c)d=l;else if(d=Tr(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}kr(e,d)&&(d=c)}if(n.key===wr&&(u&&Zt(n),-1===c?d=a:(d=Tr(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=Tr(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),kr(e,d)&&(d=c)),"both"===r){const t=rn(c/i);n.key===Sr&&(u&&Zt(n),c%i!=i-1?(d=Tr(e,{startingIndex:c,disabledIndices:s}),o&&_r(d,i,t)&&(d=Tr(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=Tr(e,{startingIndex:c-c%i-1,disabledIndices:s})),_r(d,i,t)&&(d=c)),n.key===Er&&(u&&Zt(n),c%i!=0?(d=Tr(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&_r(d,i,t)&&(d=Tr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=Tr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),_r(d,i,t)&&(d=c));const r=rn(l/i)===t;kr(e,d)&&(d=o&&r?n.key===Er?l:Tr(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?s.current[e]:null))},{event:e,orientation:x,loop:f,cols:w,disabledIndices:Rr([...b||s.current.map(((e,t)=>Nr(s.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:i,prevIndex:Or(N.current>a?o:N.current,t,n,w,e.key===wr?"bl":e.key===Sr?"tr":"tl"),stopEvent:!0})];if(null!=l&&(N.current=l,O(N.current)),"both"===x)return}if(Bo(e.key,x)){if(Zt(e),n&&!m&&Lt(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=Vo(e.key,x,p)?o:a,void O(N.current);Vo(e.key,x,p)?N.current=f?t>=a?d&&t!==s.current.length?-1:o:Tr(s,{startingIndex:t,disabledIndices:b}):Math.min(a,Tr(s,{startingIndex:t,disabledIndices:b})):N.current=f?t<=o?d&&-1!==t?s.current.length:a:Tr(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(o,Tr(s,{startingIndex:t,decrement:!0,disabledIndices:b})),kr(s,N.current)?O(null):O(N.current)}})),J=o.useMemo((()=>m&&n&&Y&&{"aria-activedescendant":K||U}),[m,n,Y,K,U]),Z=o.useMemo((()=>({"aria-orientation":"both"===x?void 0:x,...!Qt(i.domReference)&&J,onKeyDown:X,onPointerMove(){j.current=!0}})),[J,X,i.domReference,x]),Q=o.useMemo((()=>{function e(e){"auto"===g&&Vt(e.nativeEvent)&&(R.current=!0)}return{...J,onKeyDown(e){j.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return zo(t,n?e===Er:e===Sr,e===wr)}(e.key,x,p),i=Wo(e.key,x,p),a=Bo(e.key,x),l=(h?o:a)||"Enter"===e.key||""===e.key.trim();if(m&&n){const n=null==T?void 0:T.nodesRef.current.find((e=>null==e.parentId)),r=T&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Gr(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(T.nodesRef.current,n.id):null;if(t&&r&&S){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||i){var c,d;const n=(null==(c=r.context)?void 0:c.elements.domReference)===e.currentTarget,a=i&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?s.current.find((e=>(null==e?void 0:e.id)===U)):null;a&&(Zt(e),a.dispatchEvent(t),H(void 0))}var f;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return Zt(e),void(null==(f=r.context.elements.domReference)||f.dispatchEvent(t))}return X(e)}(n||y||!t)&&(l&&(A.current=h&&a?null:e.key),h?o&&(Zt(e),n?(N.current=Cr(s,z.current),O(N.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=u&&(N.current=u),Zt(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):X(e),n&&O(N.current)))},onFocus(){n&&!m&&O(null)},onPointerDown:function(e){R.current=g,"auto"===g&&Wt(e.nativeEvent)&&(R.current=!0)},onMouseDown:e,onClick:e}}),[U,J,X,z,g,s,h,O,r,n,y,x,p,u,T,m,S]);return o.useMemo((()=>c?{reference:Q,floating:Z,item:G}:{}),[c,Q,Z,G])}const $o=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ko(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:a="dialog"}=t,l=null!=(n=$o.get(a))?n:a,c=zr(),u=null!=Ur(),d=o.useMemo((()=>"tooltip"===l||"label"===a?{["aria-"+("label"===a?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?i:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}}),[l,i,u,r,c,a]),f=o.useMemo((()=>{const e={id:i,...l&&{role:l}};return"tooltip"===l||"label"===a?e:{...e,..."menu"===l&&{"aria-labelledby":c}}}),[l,i,c,a]),h=o.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(a){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,a]);return o.useMemo((()=>s?{reference:d,floating:f,item:h}:{}),[s,d,f,h])}const Ho=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function qo(e,t){return"function"==typeof e?e(t):e}function Yo(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function Go(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:h,tree:p}=e;return function(e){function m(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],b=Gt(e),x="mouseleave"===e.type,w=Ft(d.floating,b),E=Ft(d.domReference,b),S=d.domReference.getBoundingClientRect(),_=d.floating.getBoundingClientRect(),k=u.split("-")[0],C=n>_.right-_.width/2,P=c>_.bottom-_.height/2,T=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,S),O=_.width>S.width,R=_.height>S.height,N=(O?S:_).left,A=(O?S:_).right,j=(R?S:_).top,M=(R?S:_).bottom;if(w&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&Et(e.relatedTarget)&&Ft(d.floating,e.relatedTarget))return;if(p&&Gr(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&c>=S.bottom-1||"bottom"===k&&c<=S.top+1||"left"===k&&n>=S.right-1||"right"===k&&n<=S.left+1)return m();let I=[];switch(k){case"top":I=[[N,S.top+1],[N,_.bottom-1],[A,_.bottom-1],[A,S.top+1]];break;case"bottom":I=[[N,_.top+1],[N,S.bottom-1],[A,S.bottom-1],[A,_.top+1]];break;case"left":I=[[_.right-1,M],[_.right-1,j],[S.left+1,j],[S.left+1,M]];break;case"right":I=[[S.right-1,M],[S.right-1,j],[_.left+1,j],[_.left+1,M]]}if(!Yo([g,v],I)){if(i&&!T)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}Yo([g,v],function(e){let[n,r]=e;switch(k){case"top":return[[O?n+t/2:C?n+4*t:n-4*t,r+t+1],[O?n-t/2:C?n+4*t:n-4*t,r+t+1],[_.left,C||O?_.bottom-t:_.top],[_.right,C?O?_.bottom-t:_.top:_.bottom-t]];case"bottom":return[[O?n+t/2:C?n+4*t:n-4*t,r-t],[O?n-t/2:C?n+4*t:n-4*t,r-t],[_.left,C||O?_.top+t:_.bottom],[_.right,C?O?_.top+t:_.bottom:_.top+t]];case"left":{const e=[n+t+1,R?r+t/2:P?r+4*t:r-4*t],o=[n+t+1,R?r-t/2:P?r+4*t:r-4*t];return[[P||R?_.right-t:_.left,_.top],[P?R?_.right-t:_.left:_.right-t,_.bottom],e,o]}case"right":return[[n-t,R?r+t/2:P?r+4*t:r-4*t],[n-t,R?r-t/2:P?r+4*t:r-4*t],[P||R?_.left+t:_.right,_.top],[P?R?_.left+t:_.right:_.left+t,_.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const Xo=xe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Jo=xe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Zo=xe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Qo="light",ei=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,i=void 0===r?Qo:r,s=e.variant,a=void 0===s?"neutral":s,l="[&>svg]:h-5 [&>svg]:w-5",c="light"===i?"text-icon-secondary":"text-icon-inverse";if(n&&(0,o.isValidElement)(n))return(0,o.cloneElement)(n,{className:te(l,c,n.props.className)});switch(a){case"neutral":return React.createElement(Xo,{className:te(l,c)});case"info":var u="light"===i?"text-support-info":"text-support-info-inverse";return React.createElement(Xo,{className:te(l,u)});case"success":var d="light"===i?"text-support-success":"text-support-success-inverse";return React.createElement(Ee,{className:te(l,d)});case"warning":var f="light"===i?"text-support-warning":"text-support-warning-inverse";return React.createElement(Jo,{className:te(l,f)});case"error":var h="light"===i?"text-support-error":"text-support-error-inverse";return React.createElement(Zo,{className:te(l,h)});default:return null}},ti=function(e){var t=e.actionType,n=void 0===t?"button":t,r=e.onAction,o=void 0===r?function(){}:r,i=e.actionLabel,s=void 0===i?"":i,a=e.theme,l=void 0===a?Qo:a,c="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none",u="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===l&&(u="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),n){case"button":return React.createElement(le,{variant:"outline",size:"xs",onClick:o,className:te("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(le,{variant:"link",size:"xs",onClick:o,className:te(c,u)},s);default:return null}},ni=function(e){var t=e.theme,n=void 0===t?Qo:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te("block",{light:"text-text-primary",dark:"text-text-inverse"}[n],"text-sm leading-5 font-semibold")},o)},ri=function(e){var t=e.theme,n=void 0===t?Qo:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},oi=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{})),C=o.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);o.useEffect((()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(E.current),S.current=!0)}}),[l,s]),o.useEffect((()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){C()&&r(!1,e,"hover")}const t=qt(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[a.floating,n,r,l,g,C]);const P=o.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Yr(v.current,"close",b.current);o&&!w.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[v,r]),T=br((()=>{k.current(),w.current=void 0})),O=br((()=>{if(_.current){const e=qt(a.floating).body;e.style.pointerEvents="",e.removeAttribute(qr),_.current=!1}}));o.useEffect((()=>{if(l&&Et(a.domReference)){var e;const t=a.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=a.floating)||e.addEventListener("mouseleave",c),h&&t.addEventListener("mousemove",o,{once:!0}),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",s),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=a.floating)||e.removeEventListener("mouseleave",c),h&&t.removeEventListener("mousemove",o),t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",s)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function o(e){if(clearTimeout(x.current),S.current=!1,d&&!Ht(b.current)||f>0&&!Yr(v.current,"open"))return;const t=Yr(v.current,"open",b.current);t?x.current=window.setTimeout((()=>{y.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function s(e){if(t())return;k.current();const r=qt(a.floating);if(clearTimeout(E.current),g.current&&i.current.floatingContext){n||clearTimeout(x.current),w.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){O(),T(),P(e,!0,"safe-polygon")}});const t=w.current;return r.addEventListener("mousemove",t),void(k.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==b.current||!Ft(a.floating,e.relatedTarget))&&P(e)}function c(e){t()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){O(),T(),P(e)}})(e))}}),[a,l,e,d,f,h,P,T,O,r,n,y,p,v,g,i]),Mr((()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&C()){_.current=!0;const e=a.floating;if(Et(a.domReference)&&e){var t;const n=qt(a.floating).body;n.setAttribute(qr,"");const r=a.domReference,o=null==p||null==(t=p.nodesRef.current.find((e=>e.id===m)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,n,m,a,p,g,C]),Mr((()=>{n||(b.current=void 0,T(),O())}),[n,T,O]),o.useEffect((()=>()=>{T(),clearTimeout(x.current),clearTimeout(E.current),O()}),[l,a.domReference,T,O]);const R=o.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){S.current||y.current||r(!0,t,"hover")}d&&!Ht(b.current)||n||0===f||(clearTimeout(E.current),"touch"===b.current?o():E.current=window.setTimeout(o,f))}}}),[d,r,n,y,f]),N=o.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){P(e.nativeEvent,!1)}})),[P]);return o.useMemo((()=>l?{reference:R,floating:N}:{}),[l,R,N])}(W,li({move:!1,enabled:!M&&N.includes("hover")},j&&{handleClose:Go()})),K=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),f=o.useRef(!0);o.useEffect((()=>{if(!l)return;const e=bt(a.domReference);function t(){!n&&St(a.domReference)&&a.domReference===Lt(qt(a.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,l]),o.useEffect((()=>{if(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]);const h=o.useMemo((()=>({onPointerDown(e){Wt(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=Gt(e.nativeEvent);if(c&&Et(t))try{if(Ut()&&Kt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!Jt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=Et(t)&&t.hasAttribute(Kr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var e;const i=Lt(a.domReference?a.domReference.ownerDocument:document);(t||i!==a.domReference)&&(Ft(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,i)||Ft(a.domReference,i)||o||r(!1,n,"focus"))}))}})),[s,a.domReference,r,c]);return o.useMemo((()=>l?{reference:h}:{}),[l,h])}(W,{enabled:!M&&N.includes("focus")}),H=Lo([U,$,K,Ao(W),Ko(W,{role:"tooltip"})]),q=H.getReferenceProps,Y=H.getFloatingProps,G=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:a=250}=t,l=e.placement,c=l.split("-")[0],u=o.useMemo((()=>({side:c,placement:l})),[c,l]),d="number"==typeof a,f=(d?a:a.open)||0,h=(d?a:a.close)||0,[p,m]=o.useState((()=>({...qo(s,u),...qo(n,u)}))),{isMounted:g,status:v}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,s=("number"==typeof i?i:i.close)||0,[a,l]=o.useState("unmounted"),c=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,s);return c||"close"!==a||l("unmounted"),Mr((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:c,status:a}}(e,{duration:a}),y=Hr(n),b=Hr(r),x=Hr(i),w=Hr(s);return Mr((()=>{const e=qo(y.current,u),t=qo(x.current,u),n=qo(w.current,u),r=qo(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&m((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&m({transitionProperty:Object.keys(r).map(Ho).join(","),transitionDuration:f+"ms",...n,...r}),"close"===v){const r=t||e;m({transitionProperty:Object.keys(r).map(Ho).join(","),transitionDuration:h+"ms",...n,...r})}}),[h,x,y,b,w,f,v,u]),{isMounted:g,styles:p}}(W,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),X=G.isMounted,J=G.styles,Z=null===(t={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"})||void 0===t?void 0:t[l],Q="dark"===l?"text-tooltip-background-dark":"text-tooltip-background-light";return i().createElement(i().Fragment,null,(0,o.isValidElement)(y)&&(0,o.cloneElement)(y,li(li({},y.props),{},{ref:oi(y.ref,B.setReference),className:te(y.props.className)},q())),i().createElement(go,{id:S,root:w},X&&i().createElement("div",si({className:te("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",Z,"max-w-80 w-fit",b),ref:B.setFloating,style:li(li({},V),J)},Y()),i().createElement("div",null,!!f&&i().createElement("span",{className:"font-semibold"},f),!!h&&i().createElement("div",{className:"font-normal"},h)),m&&i().createElement(Br,{ref:F,context:W,placement:u,className:te("fill-current",Q)}))))},fi=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function hi(){return hi=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[g],"border-0 border-r border-border-subtle border-solid",p===r?"bg-button-disabled":"",d?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",f?"rounded-tr rounded-br border-0":"",l);return i().createElement("button",hi({ref:t,className:y,disabled:u,onClick:function(e){m(e,{slug:r,text:s})}},h),"left"===v&&a&&i().createElement("span",{className:"mr-1"},a),s,"right"===v&&a&&i().createElement("span",{className:"ml-1"},a))},gi=(0,o.forwardRef)(mi);gi.displayName="Button";var vi={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,s=e.onChange,a=e.className,l=e.size,c=void 0===l?"md":l,u=e.iconPosition,d=void 0===u?"left":u,f=(0,o.useCallback)((function(e,t){s&&s({event:e,value:t})}),[s]),h=te("box-border flex border border-border-subtle border-solid rounded",a);return i().createElement("div",{className:h},i().createElement(pi.Provider,{value:{activeItem:r,onChange:f,size:c,iconPosition:d}},i().Children.map(t,(function(e,n){if(!(0,o.isValidElement)(e))return null;var r=0===n,s=n===i().Children.count(t)-1;return i().cloneElement(e,{index:n,isFirstChild:r,isLastChild:s})}))))},Button:gi},yi=vi;function bi(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}function xi(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const wi=e=>Array.isArray(e);function Ei(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function ki(e,t,n,r){if("function"==typeof t){const[o,i]=_i(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=_i(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Ci(e,t,n){const r=e.getProps();return ki(r,t,void 0!==n?n:r.custom,e)}const Pi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ti=["initial",...Pi],Oi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ri=new Set(Oi),Ni=e=>1e3*e,Ai=e=>e/1e3,ji={type:"spring",stiffness:500,damping:25,restSpeed:10},Mi={type:"keyframes",duration:.8},Ii={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Di=(e,{keyframes:t})=>t.length>2?Mi:Ri.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:ji:Ii;function Li(e,t){return e[t]||e.default||e}const Fi=e=>null!==e;function zi(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Fi),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const Bi=e=>e,Vi=["read","resolveKeyframes","update","preRender","render","postRender"];function Wi(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Vi.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:Vi.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t/^0[^.\s]+$/u.test(e);let Yi=Bi,Gi=Bi;const Xi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ji=e=>t=>"string"==typeof t&&t.startsWith(e),Zi=Ji("--"),Qi=Ji("var(--"),es=e=>!!Qi(e)&&ts.test(e.split("/*")[0].trim()),ts=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ns=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function rs(e,t,n=1){Gi(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=ns.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Xi(e)?parseFloat(e):e}return es(o)?rs(o,t,n+1):o}const os=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},ss={...is,transform:e=>os(0,1,e)},as={...is,default:1},ls=e=>Math.round(1e5*e)/1e5,cs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,us=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ds=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function fs(e){return"string"==typeof e}const hs=e=>({test:t=>fs(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ps=hs("deg"),ms=hs("%"),gs=hs("px"),vs=hs("vh"),ys=hs("vw"),bs={...ms,parse:e=>ms.parse(e)/100,transform:e=>ms.transform(100*e)},xs=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ws=e=>e===is||e===gs,Es=(e,t)=>parseFloat(e.split(", ")[t]),Ss=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Es(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Es(t[1],e):0}},_s=new Set(["x","y","z"]),ks=Oi.filter((e=>!_s.has(e))),Cs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Ss(4,13),y:Ss(5,14)};Cs.translateX=Cs.x,Cs.translateY=Cs.y;const Ps=e=>t=>t.test(e),Ts=[is,gs,ms,ps,ys,vs,{test:e=>"auto"===e,parse:e=>e}],Os=e=>Ts.find(Ps(e)),Rs=new Set;let Ns=!1,As=!1;function js(){if(As){const e=Array.from(Rs).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return ks.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}As=!1,Ns=!1,Rs.forEach((e=>e.complete())),Rs.clear()}function Ms(){Rs.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(As=!0)}))}class Is{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Rs.add(this),Ns||(Ns=!0,Ui.read(Ms),Ui.resolveKeyframes(js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(fs(n)&&ds.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ls=(e,t,n)=>r=>{if(!fs(r))return r;const[o,i,s,a]=r.match(cs);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Fs={...is,transform:e=>Math.round((e=>os(0,255,e))(e))},zs={test:Ds("rgb","red"),parse:Ls("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Fs.transform(e)+", "+Fs.transform(t)+", "+Fs.transform(n)+", "+ls(ss.transform(r))+")"},Bs={test:Ds("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:zs.transform},Vs={test:Ds("hsl","hue"),parse:Ls("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ms.transform(ls(t))+", "+ms.transform(ls(n))+", "+ls(ss.transform(r))+")"},Ws={test:e=>zs.test(e)||Bs.test(e)||Vs.test(e),parse:e=>zs.test(e)?zs.parse(e):Vs.test(e)?Vs.parse(e):Bs.parse(e),transform:e=>fs(e)?e:e.hasOwnProperty("red")?zs.transform(e):Vs.transform(e)},Us="number",$s="color",Ks="var",Hs="var(",qs="${}",Ys=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Gs(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Ys,(e=>(Ws.test(e)?(r.color.push(i),o.push($s),n.push(Ws.parse(e))):e.startsWith(Hs)?(r.var.push(i),o.push(Ks),n.push(e)):(r.number.push(i),o.push(Us),n.push(parseFloat(e))),++i,qs))).split(qs);return{values:n,split:s,indexes:r,types:o}}function Xs(e){return Gs(e).values}function Js(e){const{split:t,types:n}=Gs(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,Qs={test:function(e){var t,n;return isNaN(e)&&fs(e)&&((null===(t=e.match(cs))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(us))||void 0===n?void 0:n.length)||0)>0},parse:Xs,createTransformer:Js,getAnimatableNone:function(e){const t=Xs(e);return Js(e)(t.map(Zs))}},ea=new Set(["brightness","contrast","saturate","opacity"]);function ta(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(cs)||[];if(!r)return e;const o=n.replace(r,"");let i=ea.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const na=/\b([a-z-]*)\(.*?\)/gu,ra={...Qs,getAnimatableNone:e=>{const t=e.match(na);return t?t.map(ta).join(" "):e}},oa={...is,transform:Math.round},ia={borderWidth:gs,borderTopWidth:gs,borderRightWidth:gs,borderBottomWidth:gs,borderLeftWidth:gs,borderRadius:gs,radius:gs,borderTopLeftRadius:gs,borderTopRightRadius:gs,borderBottomRightRadius:gs,borderBottomLeftRadius:gs,width:gs,maxWidth:gs,height:gs,maxHeight:gs,size:gs,top:gs,right:gs,bottom:gs,left:gs,padding:gs,paddingTop:gs,paddingRight:gs,paddingBottom:gs,paddingLeft:gs,margin:gs,marginTop:gs,marginRight:gs,marginBottom:gs,marginLeft:gs,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:as,scaleX:as,scaleY:as,scaleZ:as,skew:ps,skewX:ps,skewY:ps,distance:gs,translateX:gs,translateY:gs,translateZ:gs,x:gs,y:gs,z:gs,perspective:gs,transformPerspective:gs,opacity:ss,originX:bs,originY:bs,originZ:gs,zIndex:oa,backgroundPositionX:gs,backgroundPositionY:gs,fillOpacity:ss,strokeOpacity:ss,numOctaves:oa},sa={...ia,color:Ws,backgroundColor:Ws,outlineColor:Ws,fill:Ws,stroke:Ws,borderColor:Ws,borderTopColor:Ws,borderRightColor:Ws,borderBottomColor:Ws,borderLeftColor:Ws,filter:ra,WebkitFilter:ra},aa=e=>sa[e];function la(e,t){let n=aa(e);return n!==ra&&(n=Qs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ca=new Set(["auto","none","0"]);class ua extends Is{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function da(e){let t;return()=>(void 0===t&&(t=e()),t)}let fa;function ha(){fa=void 0}const pa={now:()=>(void 0===fa&&pa.set(Ki.isProcessing?Ki.timestamp:performance.now()),fa),set:e=>{fa=e,queueMicrotask(ha)}},ma=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Qs.test(e)&&"0"!==e||e.startsWith("url(")));class ga{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=pa.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ms(),js()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=pa.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=ma(o,t),a=ma(i,t);return Yi(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function va(e,t){return t?e*(1e3/t):0}const ya=5;function ba(e,t,n){const r=Math.max(t-ya,0);return va(n-e(r),t-r)}const xa=.001,wa=.01,Ea=10,Sa=.05,_a=1;const ka=12;function Ca(e,t){return e*Math.sqrt(1-t*t)}const Pa=["duration","bounce"],Ta=["stiffness","damping","mass"];function Oa(e,t){return t.some((t=>void 0!==e[t]))}function Ra({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Oa(e,Ta)&&Oa(e,Pa)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Yi(e<=Ni(Ea),"Spring duration must be 10 seconds or less");let s=1-t;s=os(Sa,_a,s),e=os(wa,Ea,Ai(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Ca(t,s),l=Math.exp(-o);return xa-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Ca(Math.pow(t,2),s);return(-o(t)+xa>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-xa,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-p*g*t);return i-n*((h+p*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===p)y=e=>i-Math.exp(-g*e)*(m+(h+g*m)*e);else{const e=g*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*g*t),r=Math.min(e*t,300);return i-n*((h+p*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{const r=y(e);if(f)s.done=e>=u;else{let o=0;p<1&&(o=0===e?Ni(h):ba(y,e,r));const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function Na({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=e=>void 0===a?l:void 0===l||Math.abs(a-e)-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let x,w;const E=e=>{(e=>void 0!==a&&el)(f.value)&&(x=e,w=Ra({keyframes:[f.value,h(f.value)],velocity:ba(y,e,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),E(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}const Aa=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ja(e,t,n,r){if(e===t&&n===r)return Bi;return o=>0===o||1===o?o:Aa(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Aa(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,e,n),t,r)}const Ma=ja(.42,0,1,1),Ia=ja(0,0,.58,1),Da=ja(.42,0,.58,1),La=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Fa=e=>t=>1-e(1-t),za=e=>1-Math.sin(Math.acos(e)),Ba=Fa(za),Va=La(za),Wa=ja(.33,1.53,.69,.99),Ua=Fa(Wa),$a=La(Ua),Ka={linear:Bi,easeIn:Ma,easeInOut:Da,easeOut:Ia,circIn:za,circInOut:Va,circOut:Ba,backIn:Ua,backInOut:$a,backOut:Wa,anticipate:e=>(e*=2)<1?.5*Ua(e):.5*(2-Math.pow(2,-10*(e-1)))},Ha=e=>{if(Array.isArray(e)){Gi(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return ja(t,n,r,o)}return"string"==typeof e?(Gi(void 0!==Ka[e],`Invalid easing type '${e}'`),Ka[e]):e},qa=(e,t)=>n=>t(e(n)),Ya=(...e)=>e.reduce(qa),Ga=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Xa=(e,t,n)=>e+(t-e)*n;function Ja(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Za(e,t){return n=>n>0?t:e}const Qa=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},el=[Bs,zs,Vs];function tl(e){const t=(e=>el.find((t=>t.test(e))))(e);if(Yi(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===Vs&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Ja(a,r,e+1/3),i=Ja(a,r,e),s=Ja(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const nl=(e,t)=>{const n=tl(e),r=tl(t);if(!n||!r)return Za(e,t);const o={...n};return e=>(o.red=Qa(n.red,r.red,e),o.green=Qa(n.green,r.green,e),o.blue=Qa(n.blue,r.blue,e),o.alpha=Xa(n.alpha,r.alpha,e),zs.transform(o))},rl=new Set(["none","hidden"]);function ol(e,t){return n=>Xa(e,t,n)}function il(e){return"number"==typeof e?ol:"string"==typeof e?es(e)?Za:Ws.test(e)?nl:ll:Array.isArray(e)?sl:"object"==typeof e?Ws.test(e)?nl:al:Za}function sl(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>il(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const ll=(e,t)=>{const n=Qs.createTransformer(t),r=Gs(e),o=Gs(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?rl.has(e)&&!o.values.length||rl.has(t)&&!r.values.length?function(e,t){return rl.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Ya(sl(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;iArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Ha):Ha(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Ga(0,t,r);e.push(Xa(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Gi(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||cl,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(os(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Da)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const dl=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Ui.update(t,!0),stop:()=>$i(t),now:()=>Ki.isProcessing?Ki.timestamp:pa.now()}},fl={decay:Na,inertia:Na,tween:ul,keyframes:ul,spring:Ra},hl=e=>e/100;class pl extends ga{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Is;this.resolver=new i(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=fl[t]||ul;let a,l;s!==ul&&"number"!=typeof e[0]&&(a=Ya(hl,cl(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:h,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===h?(n=1-n,p&&(n-=p/u)):"mirror"===h&&(b=i)),y=os(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return E&&void 0!==r&&(x.value=zi(a,this.options,r)),m&&m(x.value),E&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Ai(e.calculatedDuration):0}get time(){return Ai(this.currentTime)}set time(e){e=Ni(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ai(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=dl,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ml=new Set(["opacity","clipPath","filter","transform"]),gl=e=>Array.isArray(e)&&"number"==typeof e[0];function vl(e){return Boolean(!e||"string"==typeof e&&e in bl||gl(e)||Array.isArray(e)&&e.every(vl))}const yl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yl([0,.65,.55,1]),circOut:yl([.55,0,1,.45]),backIn:yl([.31,.01,.66,-.59]),backOut:yl([.33,1.53,.69,.99])};function xl(e){return wl(e)||bl.easeOut}function wl(e){return e?gl(e)?yl(e):Array.isArray(e)?e.map(xl):bl[e]:void 0}const El=da((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class Sl extends ga{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new ua(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l,startTime:c}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||!vl(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new pl({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,o=u.times,i=u.ease,s="keyframes"}var u;const d=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=wl(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return d.startTime=null!=c?c:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:n}=this.options;a.set(zi(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Ai(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Ai(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Ni(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Bi;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Bi}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new pl({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Ni(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return El()&&n&&ml.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const _l=da((()=>void 0!==window.ScrollTimeline));class kl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!_l()||!t.attachTimeline)return t.pause(),function(e,n){let r;const o=()=>{const{currentTime:e}=n,o=(null===e?0:e.value)/100;r!==o&&(e=>{t.time=t.duration*e})(o),r=o};return Ui.update(o,!0),()=>$i(o)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Cl=(e,t,n,r={},o,i,s)=>a=>{const l=Li(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=Ni(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),s&&s()},onStop:s,name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(l)||(d={...d,...Di(e,d)}),d.duration&&(d.duration=Ni(d.duration)),d.repeatDelay&&(d.repeatDelay=Ni(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let f=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(f=!0)),f&&!i&&void 0!==t.get()){const e=zi(d.keyframes,l);if(void 0!==e)return Ui.update((()=>{d.onUpdate(e),d.onComplete()})),new kl([])}return!i&&Sl.supports(d)?new Sl(d):new pl(d)},Pl=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),Tl=e=>wi(e)?e[e.length-1]||0:e;function Ol(e,t){-1===e.indexOf(t)&&e.push(t)}function Rl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Nl{constructor(){this.subscriptions=[]}add(e){return Ol(this.subscriptions,e),()=>Rl(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=pa.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=pa.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Nl);const n=this.events[e].add(t);return"change"===e?()=>{n(),Ui.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Al.current&&Al.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=pa.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return va(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ml(e,t){return new jl(e,t)}function Il(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ml(n))}const Dl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ll="data-"+Dl("framerAppearId");function Fl(e){return e.props[Ll]}function zl(e){return Ri.has(e)?"transform":ml.has(e)?Dl(e):void 0}class Bl extends jl{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=zl(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(Rl(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Vl=e=>Boolean(e&&e.getVelocity);function Wl(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new Bl("auto"),e.addValue("willChange",r)),o=r,Boolean(Vl(o)&&o.add)?r.add(t):void 0;var o}function Ul({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function $l(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&Ul(u,t))continue;const a={delay:n,...Li(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=Fl(e);if(n){const e=window.MotionHandoffAnimation(n,t,Ui);null!==e&&(a.startTime=e,d=!0)}}r.start(Cl(t,r,o,e.shouldReduceMotion&&Ri.has(t)?{type:!1}:a,e,d,Wl(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{Ui.update((()=>{a&&function(e,t){const n=Ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Il(e,t,Tl(i[t]))}(e,a)}))})),c}function Kl(e,t,n={}){var r;const o=Ci(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all($l(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Hl).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Kl(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Hl(e,t){return e.sortNodePosition(t)}const ql=[...Pi].reverse(),Yl=Pi.length;function Gl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Xl(){return{animate:Gl(!0),whileInView:Gl(),whileHover:Gl(),whileTap:Gl(),whileDrag:Gl(),whileFocus:Gl(),exit:Gl()}}class Jl{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Zl=0;const Ql={animation:{Feature:class extends Jl{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Kl(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Kl(e,t,n);else{const o="function"==typeof t?Ci(e,t,n.custom):t;r=Promise.all($l(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=Xl(),r=!0;const o=t=>(n,r)=>{var o;const i=Ci(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&v),w=!1;const E=Array.isArray(g)?g:[g];let S=E.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:_={}}=m,k={..._,...S},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=S[e],n=_[e];if(u.hasOwnProperty(e))continue;let r=!1;r=wi(t)&&wi(n)?!Ei(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(x=!1),!x||b&&!w||l.push(...E.map((e=>({animation:e,options:{type:p}}))))}var f,h;if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Xl(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();xi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Jl{constructor(){super(...arguments),this.id=Zl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},ec=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function tc(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const nc=e=>t=>ec(t)&&e(t,tc(t));function rc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function oc(e,t,n,r){return rc(e,t,nc(n),r)}const ic=(e,t)=>Math.abs(e-t);class sc{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=cc(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=ic(e.x,t.x),r=ic(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Ki;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ac(t,this.transformPagePoint),Ui.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=cc("pointercancel"===e.type?this.lastMoveEventInfo:ac(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!ec(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=ac(tc(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Ki;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,cc(i,this.history)),this.removeListeners=Ya(oc(this.contextWindow,"pointermove",this.handlePointerMove),oc(this.contextWindow,"pointerup",this.handlePointerUp),oc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),$i(this.updatePoint)}}function ac(e,t){return t?{point:t(e.point)}:e}function lc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cc({point:e},t){return{point:e,delta:lc(e,dc(t)),offset:lc(e,uc(t)),velocity:fc(t,.1)}}function uc(e){return e[0]}function dc(e){return e[e.length-1]}function fc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=dc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ni(t)));)n--;if(!r)return{x:0,y:0};const i=Ai(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function hc(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const pc=hc("dragHorizontal"),mc=hc("dragVertical");function gc(e){let t=!1;if("y"===e)t=mc();else if("x"===e)t=pc();else{const e=pc(),n=mc();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function vc(){const e=gc(!0);return!e||(e(),!1)}function yc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const bc=.9999,xc=1.0001,wc=-.01,Ec=.01;function Sc(e){return e.max-e.min}function _c(e,t,n,r=.5){e.origin=r,e.originPoint=Xa(t.min,t.max,e.origin),e.scale=Sc(n)/Sc(t),e.translate=Xa(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bc&&e.scale<=xc||isNaN(e.scale))&&(e.scale=1),(e.translate>=wc&&e.translate<=Ec||isNaN(e.translate))&&(e.translate=0)}function kc(e,t,n,r){_c(e.x,t.x,n.x,r?r.originX:void 0),_c(e.y,t.y,n.y,r?r.originY:void 0)}function Cc(e,t,n){e.min=n.min+t.min,e.max=e.min+Sc(t)}function Pc(e,t,n){e.min=t.min-n.min,e.max=e.min+Sc(t)}function Tc(e,t,n){Pc(e.x,t.x,n.x),Pc(e.y,t.y,n.y)}function Oc(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Rc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Ic=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Dc(e){return[e("x"),e("y")]}function Lc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Fc(e){return void 0===e||1===e}function zc({scale:e,scaleX:t,scaleY:n}){return!Fc(e)||!Fc(t)||!Fc(n)}function Bc(e){return zc(e)||Vc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vc(e){return Wc(e.x)||Wc(e.y)}function Wc(e){return e&&"0%"!==e}function Uc(e,t,n){return n+t*(e-n)}function $c(e,t,n,r,o){return void 0!==o&&(e=Uc(e,o,r)),Uc(e,n,r)+t}function Kc(e,t=0,n=1,r,o){e.min=$c(e.min,t,n,r,o),e.max=$c(e.max,t,n,r,o)}function Hc(e,{x:t,y:n}){Kc(e.x,t.translate,t.scale,t.originPoint),Kc(e.y,n.translate,n.scale,n.originPoint)}const qc=.999999999999,Yc=1.0000000000001;function Gc(e,t){e.min=e.min+t,e.max=e.max+t}function Xc(e,t,n,r,o=.5){Kc(e,t,n,Xa(e.min,e.max,o),r)}function Jc(e,t){Xc(e.x,t.x,t.scaleX,t.scale,t.originX),Xc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Zc(e,t){return Lc(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Qc=({current:e})=>e?e.ownerDocument.defaultView:null,eu=new WeakMap;class tu{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ic(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new sc(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(tc(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();if(r&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=gc(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Dc((e=>{let t=this.getAxisMotionValue(e).get()||0;if(ms.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=Sc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&Ui.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Wl(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Dc((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Qc(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=t;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Ui.postRender((()=>i(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!nu(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Xa(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&yc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Oc(e.x,n,o),y:Oc(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Nc){return!1===e?e=0:!0===e&&(e=Nc),{x:Ac(e,"left","right"),y:Ac(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Dc((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!yc(e))return!1;const n=e.current;Gi(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Zc(e,n),{scroll:o}=t;return o&&(Gc(r.x,o.offset.x),Gc(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Rc(e.x,t.x),y:Rc(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Lc(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Dc((s=>{if(!nu(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(Cl(e,n,0,t,this.visualElement,!1,Wl(this.visualElement,e)))}stopAnimation(){Dc((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Dc((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Dc((t=>{const{drag:n}=this.getProps();if(!nu(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Xa(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!yc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Dc((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Sc(e),o=Sc(t);return o>r?n=Ga(t.min,t.max-r,e.min):r>o&&(n=Ga(e.min,e.max-o,t.min)),os(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Dc((t=>{if(!nu(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Xa(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;eu.set(this.visualElement,this);const e=oc(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();yc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Ui.read(t);const o=rc(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Dc((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Nc,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function nu(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ru=e=>(t,n)=>{e&&Ui.postRender((()=>e(t,n)))};var ou=n(848);const iu=(0,o.createContext)(null),su=(0,o.createContext)({}),au=(0,o.createContext)({}),lu={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uu={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!gs.test(e))return e;e=parseFloat(e)}return`${cu(e,t.target.x)}% ${cu(e,t.target.y)}%`}},du={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Qs.parse(e);if(o.length>5)return r;const i=Qs.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Xa(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}},fu={},{schedule:hu,cancel:pu}=Wi(queueMicrotask,!1);class mu extends o.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=vu,Object.assign(fu,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),lu.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Ui.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hu.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function gu(e){const[t,n]=function(){const e=(0,o.useContext)(iu);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=(0,o.useId)();(0,o.useEffect)((()=>r(i)),[]);const s=(0,o.useCallback)((()=>n&&n(i)),[i,n]);return!t&&n?[!1,s]:[!0]}(),r=(0,o.useContext)(su);return(0,ou.jsx)(mu,{...e,layoutGroup:r,switchLayoutGroup:(0,o.useContext)(au),isPresent:t,safeToRemove:n})}const vu={borderRadius:{...uu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uu,borderTopRightRadius:uu,borderBottomLeftRadius:uu,borderBottomRightRadius:uu,boxShadow:du},yu=["TopLeft","TopRight","BottomLeft","BottomRight"],bu=yu.length,xu=e=>"string"==typeof e?parseFloat(e):e,wu=e=>"number"==typeof e||gs.test(e);function Eu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Su=ku(0,.5,Ba),_u=ku(.5,.95,Bi);function ku(e,t,n){return r=>rt?1:n(Ga(e,t,r))}function Cu(e,t){e.min=t.min,e.max=t.max}function Pu(e,t){Cu(e.x,t.x),Cu(e.y,t.y)}function Tu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ou(e,t,n,r,o){return e=Uc(e-=t,1/n,r),void 0!==o&&(e=Uc(e,1/o,r)),e}function Ru(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(ms.test(t)&&(t=parseFloat(t),t=Xa(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=Xa(i.min,i.max,r);e===i&&(a-=t),e.min=Ou(e.min,t,n,a,o),e.max=Ou(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Nu=["x","scaleX","originX"],Au=["y","scaleY","originY"];function ju(e,t,n,r){Ru(e.x,t,Nu,n?n.x:void 0,r?r.x:void 0),Ru(e.y,t,Au,n?n.y:void 0,r?r.y:void 0)}function Mu(e){return 0===e.translate&&1===e.scale}function Iu(e){return Mu(e.x)&&Mu(e.y)}function Du(e,t){return e.min===t.min&&e.max===t.max}function Lu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fu(e,t){return Lu(e.x,t.x)&&Lu(e.y,t.y)}function zu(e){return Sc(e.x)/Sc(e.y)}function Bu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Vu{constructor(){this.members=[]}add(e){Ol(this.members,e),e.scheduleRender()}remove(e){if(Rl(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Wu=(e,t)=>e.depth-t.depth;class Uu{constructor(){this.children=[],this.isDirty=!1}add(e){Ol(this.children,e),this.isDirty=!0}remove(e){Rl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Wu),this.isDirty=!1,this.children.forEach(e)}}function $u(e){const t=Vl(e)?e.get():e;return Pl(t)?t.toValue():t}const Ku={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Hu="undefined"!=typeof window&&void 0!==window.MotionDebug,qu=["","X","Y","Z"],Yu={visibility:"hidden"};let Gu=0;function Xu(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ju(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Fl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ui,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ju(r)}function Zu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Gu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Hu&&(Ku.totalNodes=Ku.resolvedTargetDeltas=Ku.recalculatedProjection=0),this.nodes.forEach(td),this.nodes.forEach(ld),this.nodes.forEach(cd),this.nodes.forEach(nd),Hu&&window.MotionDebug.record(Ku)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e){const t=pa.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&($i(n),e(o-250))};return Ui.read(n,!0),()=>$i(n)}(r),lu.hasAnimatedSinceResize&&(lu.hasAnimatedSinceResize=!1,this.nodes.forEach(ad))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||md,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Fu(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Li(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||ad(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$i(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ud),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ju(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eqc&&(t.x=1),t.yqc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Ic());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Tu(this.prevProjectionDelta.x,this.projectionDelta.x),Tu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),kc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Bu(this.projectionDelta.x,this.prevProjectionDelta.x)&&Bu(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Hu&&Ku.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Mc(),this.projectionDelta=Mc(),this.projectionDeltaWithTransform=Mc()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Mc();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Ic(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(pd));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;fd(i.x,e.x,n),fd(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tc(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=s,g=n,hd(h.x,p.x,m.x,g),hd(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Du(l.x,f.x)&&Du(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d=Ic()),Pu(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Xa(0,void 0!==n.opacity?n.opacity:1,Su(r)),e.opacityExit=Xa(void 0!==t.opacity?t.opacity:1,0,_u(r))):i&&(e.opacity=Xa(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{lu.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Vl(0)?0:Ml(0);return r.start(Cl("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&bd(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Ic();const t=Sc(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Sc(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Pu(t,n),Jc(t,o),kc(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vu),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Xu("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(od),this.root.sharedNodes.clear()}}}function Qu(e){e.updateLayout()}function ed(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?Dc((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Sc(r);r.min=t[e].min,r.max=r.min+o})):bd(o,n.layoutBox,t)&&Dc((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Sc(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s=Mc();kc(s,t,n.layoutBox);const a=Mc();i?kc(a,e.applyTransform(r,!0),n.measuredBox):kc(a,t,n.layoutBox);const l=!Iu(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=Ic();Tc(s,n.layoutBox,o.layoutBox);const a=Ic();Tc(a,t,i.layoutBox),Fu(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function td(e){Hu&&Ku.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function nd(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rd(e){e.clearSnapshot()}function od(e){e.clearMeasurements()}function id(e){e.isLayoutDirty=!1}function sd(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ad(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ld(e){e.resolveTargetDelta()}function cd(e){e.calcProjection()}function ud(e){e.resetSkewAndRotation()}function dd(e){e.removeLeadSnapshot()}function fd(e,t,n){e.translate=Xa(t.translate,0,n),e.scale=Xa(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function hd(e,t,n,r){e.min=Xa(t.min,n.min,r),e.max=Xa(t.max,n.max,r)}function pd(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const md={duration:.45,ease:[.4,0,.1,1]},gd=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),vd=gd("applewebkit/")&&!gd("chrome/")?Math.round:Bi;function yd(e){e.min=vd(e.min),e.max=vd(e.max)}function bd(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=zu(t),o=zu(n),!(Math.abs(r-o)<=.2));var r,o}function xd(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const wd=Zu({attachResizeListener:(e,t)=>rc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ed={current:void 0},Sd=Zu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ed.current){const e=new wd({});e.mount(window),e.setOptions({layoutScroll:!0}),Ed.current=e}return Ed.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),_d={pan:{Feature:class extends Jl{constructor(){super(...arguments),this.removePointerDownListener=Bi}onPointerDown(e){this.session=new sc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ru(e),onStart:ru(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Ui.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=oc(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Jl{constructor(e){super(e),this.removeGroupControls=Bi,this.removeListeners=Bi,this.controls=new tu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bi}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Sd,MeasureLayout:gu}};function kd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return oc(e.current,n,((n,o)=>{if("touch"===n.pointerType||vc())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Ui.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const Cd=(e,t)=>!!t&&(e===t||Cd(e,t.parentElement));function Pd(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,tc(n))}const Td=new WeakMap,Od=new WeakMap,Rd=e=>{const t=Td.get(e.target);t&&t(e)},Nd=e=>{e.forEach(Rd)};const Ad={some:0,all:1},jd={inView:{Feature:class extends Jl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Ad[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;Od.has(n)||Od.set(n,{});const r=Od.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Nd,{root:e,...t})),r[o]}(t);return Td.set(e,n),r.observe(e),()=>{Td.delete(e),r.unobserve(e)}}(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Jl{constructor(){super(...arguments),this.removeStartListeners=Bi,this.removeEndListeners=Bi,this.removeAccessibleListeners=Bi,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=oc(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||Cd(this.node.current,e.target)?n:r;i&&Ui.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=oc(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ya(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=rc(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=rc(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&Pd("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Ui.postRender((()=>n(e,t)))}))})),Pd("down",((e,t)=>{this.startPress(e,t)})))})),t=rc(this.node.current,"blur",(()=>{this.isPressing&&Pd("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ya(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Ui.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!vc()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Ui.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=oc(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=rc(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ya(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Jl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ya(rc(this.node.current,"focus",(()=>this.onFocus())),rc(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Jl{mount(){this.unmount=Ya(kd(this.node,!0),kd(this.node,!1))}unmount(){}}}},Md={layout:{ProjectionNode:Sd,MeasureLayout:gu}},Id=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Dd=(0,o.createContext)({}),Ld="undefined"!=typeof window,Fd=Ld?o.useLayoutEffect:o.useEffect,zd=(0,o.createContext)({strict:!1});let Bd=!1;function Vd(e,t,n,r,i){var s;const{visualElement:a}=(0,o.useContext)(Dd),l=(0,o.useContext)(zd),c=(0,o.useContext)(iu),u=(0,o.useContext)(Id).reducedMotion,d=(0,o.useRef)();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const f=d.current,h=(0,o.useContext)(au);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ud(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&yc(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,i,h),(0,o.useInsertionEffect)((()=>{f&&f.update(n,c)}));const p=n[Ll],m=(0,o.useRef)(Boolean(p)&&!window.MotionHandoffIsComplete&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,p)));return Fd((()=>{f&&(f.updateFeatures(),hu.render(f.render),m.current&&f.animationState&&f.animationState.animateChanges())})),(0,o.useEffect)((()=>{f&&(!m.current&&f.animationState&&f.animationState.animateChanges(),m.current=!1,Bd||(Bd=!0,queueMicrotask(Wd)))})),f}function Wd(){window.MotionHandoffIsComplete=!0}function Ud(e){if(e)return!1!==e.options.allowProjection?e.projection:Ud(e.parent)}function $d(e,t,n){return(0,o.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):yc(n)&&(n.current=r))}),[t])}function Kd(e){return xi(e.animate)||Ti.some((t=>Si(e[t])))}function Hd(e){return Boolean(Kd(e)||e.variants)}function qd(e){return Array.isArray(e)?e.join(" "):e}const Yd={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Gd={};for(const e in Yd)Gd[e]={isEnabled:t=>Yd[e].some((e=>!!t[e]))};const Xd=Symbol.for("motionComponentSymbol");function Jd({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&function(e){for(const t in e)Gd[t]={...Gd[t],...e[t]}}(e);const s=(0,o.forwardRef)((function(e,s){let a;const l={...(0,o.useContext)(Id),...e,layoutId:Zd(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Kd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Si(t)?t:void 0,animate:Si(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Dd));return(0,o.useMemo)((()=>({initial:t,animate:n})),[qd(t),qd(n)])}(e),d=r(e,c);if(!c&&Ld){(0,o.useContext)(zd).strict;const e=function(e){const{drag:t,layout:n}=Gd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);a=e.MeasureLayout,u.visualElement=Vd(i,d,l,t,e.ProjectionNode)}return(0,ou.jsxs)(Dd.Provider,{value:u,children:[a&&u.visualElement?(0,ou.jsx)(a,{visualElement:u.visualElement,...l}):null,n(i,e,$d(d,u.visualElement,s),d,c,u.visualElement)]})}));return s[Xd]=i,s}function Zd({layoutId:e}){const t=(0,o.useContext)(su).id;return t&&void 0!==e?t+"-"+e:e}const Qd=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ef(e){return"string"==typeof e&&!e.includes("-")&&!!(Qd.indexOf(e)>-1||/[A-Z]/u.test(e))}function tf(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const nf=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function rf(e,t,n,r){tf(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(nf.has(n)?n:Dl(n),t.attrs[n])}function of(e,{layout:t,layoutId:n}){return Ri.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!fu[e]||"opacity"===e)}function sf(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Vl(o[s])||t.style&&Vl(t.style[s])||of(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function af(e,t,n){const r=sf(e,t,n);for(const n in e)(Vl(e[n])||Vl(t[n]))&&(r[-1!==Oi.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function lf(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const cf=e=>(t,n)=>{const r=(0,o.useContext)(Dd),i=(0,o.useContext)(iu),s=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:ff(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,i,n);return n?s():lf(s)};function uf(e,t){const n=zl(t);n&&Ol(e,n)}function df(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[p?n.length-1:0]),null!==n&&(s[t]=n)}for(const e in t)s[e]=t[e]})),l&&(d&&!1!==u&&!xi(d)&&df(e,d,(e=>{for(const t in e)uf(a,t)})),a.length&&(s.willChange=a.join(","))),s}const hf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),pf=()=>({...hf(),attrs:{}}),mf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,gf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vf=Oi.length;function yf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(Ri.has(e))s=!0;else if(Zi(e))o[e]=n;else{const t=mf(n,ia[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i"string"==typeof e&&"svg"===e.toLowerCase(),_f={useVisualState:cf({scrapeMotionValuesFromProps:af,createRenderState:pf,onMount:(e,t,{renderState:n,latestValues:r})=>{Ui.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Ui.render((()=>{Ef(n,r,Sf(t.tagName),e.transformTemplate),rf(t,n)}))}})},kf={useVisualState:cf({applyWillChange:!0,scrapeMotionValuesFromProps:sf,createRenderState:hf})};function Cf(e,t,n){for(const r in t)Vl(t[r])||of(r,n)||(e[r]=t[r])}function Pf(e,t){const n={},r=function(e,t){const n={};return Cf(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)((()=>{const n=hf();return yf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Tf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Of(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Tf.has(e)}let Rf=e=>!Of(e);try{(Nf=n(316).A)&&(Rf=e=>e.startsWith("on")?!Of(e):Nf(e))}catch(e){}var Nf;function Af(e,t,n,r){const i=(0,o.useMemo)((()=>{const n=pf();return Ef(n,t,Sf(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Cf(t,e.style,e),i.style={...t,...i.style}}return i}function jf(e=!1){return(t,n,r,{latestValues:i},s)=>{const a=(ef(t)?Af:Pf)(n,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Rf(o)||!0===n&&Of(o)||!t&&!Of(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==o.Fragment?{...l,...a,ref:r}:{},{children:u}=n,d=(0,o.useMemo)((()=>Vl(u)?u.get():u),[u]);return(0,o.createElement)(t,{...c,children:d})}}function Mf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Jd({...ef(n)?_f:kf,preloadedFeatures:e,useRender:jf(r),createVisualElement:t,Component:n})}}const If={current:null},Df={current:!1},Lf=new WeakMap,Ff=[...Ts,Ws,Qs],zf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Bf=Ti.length;class Vf{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Is,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Ui.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Kd(t),this.isVariantNode=Hd(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Vl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Lf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Df.current||function(){if(Df.current=!0,Ld)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>If.current=e.matches;e.addListener(t),t()}else If.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||If.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Lf.delete(this.current),this.projection&&this.projection.unmount(),$i(this.notifyUpdate),$i(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Ri.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Ui.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Gd){const t=Gd[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ic()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Ml(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Xi(r)||qi(r))?r=parseFloat(r):!(e=>Ff.find(Ps(e)))(r)&&Qs.test(t)&&(r=la(e,t)),this.setBaseTarget(e,Vl(r)?r.get():r)),Vl(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=ki(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Vl(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Nl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Wf extends Vf{constructor(){super(...arguments),this.KeyframeResolver=ua}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class Uf extends Wf{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=tf}readValueFromInstance(e,t){if(Ri.has(t)){const e=aa(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Zi(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Zc(e,t)}build(e,t,n){yf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return sf(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Vl(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class $f extends Wf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ic}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ri.has(t)){const e=aa(t);return e&&e.default||0}return t=nf.has(t)?t:Dl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return af(e,t,n)}build(e,t,n){Ef(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){rf(e,t,0,r)}mount(e){this.isSVGTag=Sf(e.tagName),super.mount(e)}}const Kf=bi(Mf({...Ql,...jd,..._d,...Md},((e,t)=>ef(e)?new $f(t):new Uf(t,{allowProjection:e!==o.Fragment}))));var Hf=["slug","text","icon","className","disabled","badge"];function qf(){return qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:box-border flex items-center ".concat("full"===y?"w-full":""," ").concat(S),k=te(_,x,w,t,E,"underline"!==p?"bg-tab-background":"",l);return i().createElement("div",{className:k},i().createElement(Yf.Provider,{value:{activeItem:s,onChange:b,size:u,variant:p,orientation:f,iconPosition:g,width:y}},i().Children.map(n,(function(e){return(0,o.isValidElement)(e)?i().cloneElement(e):null}))))},Tab:Xf};const Zf=xe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Qf=xe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),eh=xe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var th={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2 py-2 rounded text-xs font-medium leading-4 min-h-[2.25rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-xs",searchbarIcon:"[&>svg]:size-4",label:"text-xs font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-2.5 py-2.5 rounded-md text-xs font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-3 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-base font-medium"}},nh="group-disabled:text-field-color-disabled",rh=["value","selected","children"];function oh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||ah(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ih(){return ih=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{r&&(clearTimeout(m.current),y.current=null,g.current="")}),[r]),Mr((()=>{var e;r&&""===g.current&&(v.current=null!=(e=null!=p?p:a)?e:-1)}),[r,p,a]);const S=br((e=>{e?i.current.typing||(i.current.typing=e,x(e)):i.current.typing&&(i.current.typing=e,x(e))})),_=br((e=>{function t(e,t,n){const r=w.current?w.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=s.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?S(!1):" "===e.key&&Zt(e)),null==n||E.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Zt(e),S(!0)),n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",v.current=y.current),g.current+=e.key,clearTimeout(m.current),m.current=setTimeout((()=>{g.current="",v.current=y.current,S(!1)}),f);const o=v.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",S(!1))})),k=o.useMemo((()=>({onKeyDown:_})),[_]),C=o.useMemo((()=>({onKeyDown:_,onKeyUp(e){" "===e.key&&S(!1)}})),[_,S]);return o.useMemo((()=>u?{reference:k,floating:C}:{}),[u,k,C])}(B,{listRef:W,activeIndex:N,selectedIndex:M,onMatch:T?A:I,onTypingChange:function(e){U.current=e}}),G=Lo([K,H,q,$].concat(sh(m?[]:[Y]))),X=G.getReferenceProps,J=G.getFloatingProps,Z=G.getItemProps,Q=function(e,t){if(h)return function(e,t){var n,r=sh(null!==(n=C())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===ch(e)?e[u]===t[u]:e===t}))&&(r.push(t),b||E(r),I(e),F.reference.current.focus(),O(!1),k(""),"function"==typeof l&&l(r))}(e,t);I(e),b||E(t),F.reference.current.focus(),O(!1),k(""),"function"==typeof l&&l(t)},ee=(0,o.useCallback)((function(e,t){V.current[e]=t}),[]);return React.createElement(hh.Provider,{value:{selectedIndex:M,setSelectedIndex:I,activeIndex:N,setActiveIndex:A,selected:w,setSelected:E,handleSelect:Q,combobox:m,sizeValue:i,multiple:h,onChange:l,isTypingRef:U,getItemProps:Z,onClickItem:function(e,t){Q(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Q(t,n))," "!==e.key||U.current||(e.preventDefault(),Q(t,n))},getValues:C,selectId:y,getReferenceProps:X,isOpen:T,value:s,updateListRef:ee,refs:F,listContentRef:W,by:u,getFloatingProps:J,floatingStyles:z,context:B,searchKeyword:_,setSearchKeyword:k,disabled:v}},d)};mh.Button=function(e){var t,n,r,i=e.children,s=e.icon,a=void 0===s?null:s,l=e.placeholder,c=void 0===l?"Select an option":l,u=e.optionIcon,d=void 0===u?null:u,f=e.displayBy,h=void 0===f?"name":f,p=e.label,m=ph(),g=m.sizeValue,v=m.getReferenceProps,y=m.getValues,b=m.selectId,x=m.refs,w=m.isOpen,E=m.multiple,S=m.combobox,_=m.setSelected,k=m.onChange,C=m.isControlled,P=m.disabled,T=m.by,O=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[g],R=(0,o.useCallback)((function(){if(a)return a;var e="text-field-placeholder group-disabled:text-icon-disabled";return S?React.createElement(Zf,{className:e}):React.createElement(Qf,{className:e})}),[a]),N=(0,o.useCallback)((function(){var e=y();if(!e)return null;if("function"==typeof i){var t=dh({value:e},E?{onClose:A}:{});return i(t)}if(E)return e.map((function(e,t){return React.createElement(Ye,{icon:d,type:"rounded",key:t,size:O,onMouseDown:A(e),label:"object"===ch(e)?e[h]:e,closable:!0,disabled:P})}));var n="object"===ch(e)?e[h]:e;return(0,o.isValidElement)(i)&&(n=i),React.createElement("span",{className:te(th[g].displaySelected,nh)},n)}),[y]),A=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=sh(null!==(n=y())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===ch(t)?t[T]===e[T]:t===e}));-1!==o&&(r.splice(o,1),C||_(r),"function"==typeof k&&k(r))}};return React.createElement("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border"},React.createElement("label",{className:te(null===(n=th[g])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:b},p),React.createElement("button",ih({id:b,ref:x.setReference,className:te("flex items-center justify-between border border-solid w-full box-border transition-colors duration-150 bg-white","border focus-visible:outline-none border-solid border-field-border",!w&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",th[g].selectButton,E&&th[g].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:P},v()),React.createElement("div",{className:te("flex-1 grid items-center justify-start gap-1.5 ",y()&&"flex flex-wrap")},N(),(E?!(null!==(r=y())&&void 0!==r&&r.length):!y())&&React.createElement("div",{className:te("[grid-area:1/1/2/3] text-field-input",th[g].displaySelected,nh)},c)),React.createElement("div",{className:te("flex items-center [&>svg]:shrink-0",th[g].icon)},R())))},mh.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,i=e.searchPlaceholder,s=void 0===i?"Search...":i,a=e.dropdownPortalRoot,l=void 0===a?null:a,c=e.dropdownPortalId,u=void 0===c?"":c,d=ph(),f=d.isOpen,h=d.context,p=d.refs,m=d.combobox,g=d.floatingStyles,v=d.getFloatingProps,y=d.sizeValue,b=d.setSearchKeyword,x=d.setActiveIndex,w=d.setSelectedIndex,E=d.value,S=d.selected,_=d.getValues,k=d.searchKeyword,C=d.listContentRef,P=d.by,T=(0,o.useMemo)((function(){var e=_(),n=0;return e&&(n=o.Children.toArray(t).findIndex((function(t){return"object"===ch(t.props.value)?t.props.value[P]===e[P]:t.props.value===e}))),-1===n?0:n}),[E,S,t]);(0,o.useLayoutEffect)((function(){x(T),w(T)}),[]);var O=(0,o.useMemo)((function(){return o.Children.map(t,(function(e,t){if(!(0,o.isValidElement)(e))return null;if(k){var n=e.props.value;if("object"===ch(n)){if(-1===n[r].toLowerCase().indexOf(k.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(k.toLowerCase()))return null}return(0,o.cloneElement)(e,dh(dh({},e.props),{},{index:t}))}))}),[k,E,S,t]),R=o.Children.count(O);return(0,o.useEffect)((function(){C.current=[],o.Children.forEach(t,(function(e){if((0,o.isValidElement)(e)&&e.props.value){if(k){var t=e.props.value;if("object"===ch(t)){if(-1===t[r].toLowerCase().indexOf(k.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(k.toLowerCase()))return}C.current.push(e.props.value)}}))}),[k]),React.createElement(React.Fragment,null,f&&React.createElement(go,{id:u,root:l},React.createElement(ko,{context:h,modal:!1},React.createElement("div",ih({ref:p.setFloating,className:te("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",m&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",th[y].dropdown,!m&&"h-full"),style:dh({},g)},v()),m&&React.createElement("div",{className:te(th[y].searchbarWrapper)},React.createElement(eh,{className:te("text-icon-secondary shrink-0",th[y].searchbarIcon)}),React.createElement("input",{className:te("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",th[y].searchbar),type:"search",name:"keyword",placeholder:s,onChange:function(e){return b(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:te("overflow-y-auto",!m&&"w-full h-full",th[y].dropdownItemsWrapper)},!!R&&O,!R&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},mh.Option=function(e){var t=e.value,n=e.selected,r=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"neutral"},t))}},{key:"success",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"success"},t))}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"error"},t))}},{key:"warning",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"warning"},t))}},{key:"info",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({message:e,type:"info"},t))}},{key:"custom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(xh({jsx:e,type:"custom"},t))}}],t&&Eh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Ah=new Nh,jh=Object.seal(Object.assign((function(e,t){return Ah.default(e,t)}),{success:Ah.success.bind(Ah),error:Ah.error.bind(Ah),warning:Ah.warning.bind(Ah),info:Ah.info.bind(Ah),custom:Ah.custom.bind(Ah),dismiss:Ah.dismiss.bind(Ah),update:Ah.update.bind(Ah)},{getHistory:Ah.history.bind(Ah)})),Mh=!1,Ih={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},Dh={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},Lh="bg-background-inverse border-background-inverse",Fh={light:"text-icon-secondary",dark:"text-icon-inverse"};class zh extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Bh({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,o.useContext)(Id);return(0,o.useInsertionEffect)((()=>{const{width:e,height:o,top:a,left:l}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,ou.jsx)(zh,{isPresent:t,childRef:r,sizeRef:i,children:o.cloneElement(e,{ref:r})})}const Vh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const l=lf(Wh),c=(0,o.useId)(),u=(0,o.useMemo)((()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))})),s?[Math.random()]:[n]);return(0,o.useMemo)((()=>{l.forEach(((e,t)=>l.set(t,!1)))}),[n]),o.useEffect((()=>{!n&&!l.size&&r&&r()}),[n]),"popLayout"===a&&(e=(0,ou.jsx)(Bh,{isPresent:n,children:e})),(0,ou.jsx)(iu.Provider,{value:u,children:e})};function Wh(){return new Map}const Uh=e=>e.key||"";function $h(e){const t=[];return o.Children.forEach(e,(e=>{(0,o.isValidElement)(e)&&t.push(e)})),t}const Kh=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync"})=>{Gi(!t,"Replace exitBeforeEnter with mode='wait'");const l=(0,o.useMemo)((()=>$h(e)),[e]),c=l.map(Uh),u=(0,o.useRef)(!0),d=(0,o.useRef)(l),f=lf((()=>new Map)),[h,p]=(0,o.useState)(l),[m,g]=(0,o.useState)(l);Fd((()=>{u.current=!1,d.current=l;for(let e=0;e{const t=Uh(e),o=l===m||c.includes(t);return(0,ou.jsx)(Vh,{isPresent:o,initial:!(u.current&&!r)&&void 0,custom:o?void 0:n,presenceAffectsLayout:s,mode:a,onExitComplete:o?void 0:()=>{if(!f.has(t))return;f.set(t,!0);let e=!0;f.forEach((t=>{t||(e=!1)})),e&&(null==y||y(),g(d.current),i&&i())},children:e},t)}))})};function Hh(e){return Hh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hh(e)}function qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:u;if(l&&!(u<0))return x.current=(new Date).getTime(),setTimeout((function(){b(e.id)}),t)};(0,o.useEffect)((function(){var e=u;return E.current=S(t,e),function(){clearTimeout(E.current)}}),[]),(0,o.useEffect)((function(){null!=t&&t.dismiss&&b(t.id)}),[t]);var _,k,C,P,T,O,R,N,A,j,M=function(){var e,n;null==t||null===(e=t.action)||void 0===e||null===(n=e.onClick)||void 0===n||n.call(e,(function(){return b(t.id)}))},I=null;return"stack"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Lh:null===(_=Dh)||void 0===_?void 0:_[y],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(E.current),w.current=(new Date).getTime()},onMouseLeave:function(){E.current=S(t,u-(w.current-x.current))}},"custom"!==t.type?React.createElement(React.Fragment,null,React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},ei({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},ni({title:r,theme:f}),ri({content:s,theme:f}),(null==t||null===(k=t.action)||void 0===k?void 0:k.label)&&"function"==typeof(null==t||null===(C=t.action)||void 0===C?void 0:C.onClick)&&React.createElement("div",{className:"mt-2.5"},ti({actionLabel:null==t||null===(P=t.action)||void 0===P?void 0:P.label,actionType:null!==(T=null==t||null===(O=t.action)||void 0===O?void 0:O.type)&&void 0!==T?T:"button",onAction:M,theme:f}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(R=Fh[f])&&void 0!==R?R:Fh.light),onClick:function(){return b(t.id)}},React.createElement(Ke,null)))):null==t||null===(N=t.jsx)||void 0===N?void 0:N.call(t,{close:function(){return b(t.id)},action:null!=t&&t.action?Yh(Yh({},null==t?void 0:t.action),{},{onClick:M}):null}))),"inline"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Lh:null===(A=Dh)||void 0===A?void 0:A[y],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},ei({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},ni({title:r,theme:f}),ri({content:s,theme:f})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(j=Fh[f])&&void 0!==j?j:Fh.light),onClick:function(){return b(t.id)}},React.createElement(Ke,null))))),I},ep=(Zh=function(e){var t,n,r,i=e.position,s=void 0===i?"top-right":i,a=e.design,l=void 0===a?"stack":a,c=e.theme,u=void 0===c?"light":c,d=e.className,f=void 0===d?"":d,h=e.autoDismiss,p=void 0===h||h,m=e.dismissAfter,g=void 0===m?5e3:m,v=(n=(0,o.useState)([]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(n,r)||Xh(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],b=v[1];(0,o.useEffect)((function(){Ah.subscribe((function(e){null!=e&&e.dismiss?b((function(t){return t.map((function(t){return t.id===e.id?Yh(Yh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,Fn.flushSync)((function(){return b((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?Yh(Yh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return Jh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Xh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[e])}))}))}))}))}),[]);var x=function(e){b((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:te("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=Ih[s])&&void 0!==t?t:Ih["top-right"],f)},React.createElement(Kh,{initial:!1},y.map((function(e){var t,n,r,o,i;return React.createElement(Kf.li,{key:e.id,positionTransition:!0,initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:"toast-".concat(e.id)},React.createElement(Qh,{toastItem:e,title:e.title,content:null==e?void 0:e.description,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t?t:null,design:null!==(n=null==e?void 0:e.design)&&void 0!==n?n:l,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:p,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:g,removeToast:x,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:u}))}))))},(0,o.memo)((function(e){var t=e.singleTon;return Mh&&t?null:(Mh=!0,React.createElement(Zh,e))}))),tp={sm:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"}},np={sm:{xs:"gap-2",sm:"gap-4",md:"gap-5",lg:"gap-6",xl:"gap-6","2xl":"gap-8"},md:{xs:"md:gap-2",sm:"md:gap-4",md:"md:gap-5",lg:"md:gap-6",xl:"md:gap-6","2xl":"md:gap-8"},lg:{xs:"lg:gap-2",sm:"lg:gap-4",md:"lg:gap-5",lg:"lg:gap-6",xl:"lg:gap-6","2xl":"lg:gap-8"}},rp={sm:{xs:"gap-x-2",sm:"gap-x-4",md:"gap-x-5",lg:"gap-x-6",xl:"gap-x-6","2xl":"gap-x-8"},md:{xs:"md:gap-x-2",sm:"md:gap-x-4",md:"md:gap-x-5",lg:"md:gap-x-6",xl:"md:gap-x-6","2xl":"md:gap-x-8"},lg:{xs:"lg:gap-x-2",sm:"lg:gap-x-4",md:"lg:gap-x-5",lg:"lg:gap-x-6",xl:"lg:gap-x-6","2xl":"lg:gap-x-8"}},op={sm:{xs:"gap-y-2",sm:"gap-y-4",md:"gap-y-5",lg:"gap-y-6",xl:"gap-y-6","2xl":"gap-y-8"},md:{xs:"md:gap-y-2",sm:"md:gap-y-4",md:"md:gap-y-5",lg:"md:gap-y-6",xl:"md:gap-y-6","2xl":"md:gap-y-8"},lg:{xs:"lg:gap-y-2",sm:"lg:gap-y-4",md:"lg:gap-y-5",lg:"lg:gap-y-6",xl:"lg:gap-y-6","2xl":"lg:gap-y-8"}},ip={sm:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},sp={sm:{1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4",5:"col-start-5",6:"col-start-6",7:"col-start-7",8:"col-start-8",9:"col-start-9",10:"col-start-10",11:"col-start-11",12:"col-start-12"},md:{1:"md:col-start-1",2:"md:col-start-2",3:"md:col-start-3",4:"md:col-start-4",5:"md:col-start-5",6:"md:col-start-6",7:"md:col-start-7",8:"md:col-start-8",9:"md:col-start-9",10:"md:col-start-10",11:"md:col-start-11",12:"md:col-start-12"},lg:{1:"lg:col-start-1",2:"lg:col-start-2",3:"lg:col-start-3",4:"lg:col-start-4",5:"lg:col-start-5",6:"lg:col-start-6",7:"lg:col-start-7",8:"lg:col-start-8",9:"lg:col-start-9",10:"lg:col-start-10",11:"lg:col-start-11",12:"lg:col-start-12"}},ap={sm:{row:"grid-flow-row",column:"grid-flow-col","row-dense":"grid-flow-row-dense","column-dense":"grid-flow-col-dense"},md:{row:"md:grid-flow-row",column:"md:grid-flow-col","row-dense":"md:grid-flow-row-dense","column-dense":"md:grid-flow-col-dense"},lg:{row:"lg:grid-flow-row",column:"lg:grid-flow-col","row-dense":"lg:grid-flow-row-dense","column-dense":"lg:grid-flow-col-dense"}},lp={sm:{normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},md:{normal:"md:justify-normal",start:"md:justify-start",end:"md:justify-end",center:"md:justify-center",between:"md:justify-between",around:"md:justify-around",evenly:"md:justify-evenly",stretch:"md:justify-stretch"},lg:{normal:"lg:justify-normal",start:"lg:justify-start",end:"lg:justify-end",center:"lg:justify-center",between:"lg:justify-between",around:"lg:justify-around",evenly:"lg:justify-evenly",stretch:"lg:justify-stretch"}},cp={sm:{start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},md:{start:"md:items-start",end:"md:items-end",center:"md:items-center",baseline:"md:items-baseline",stretch:"md:items-stretch"},lg:{start:"lg:items-start",end:"lg:items-end",center:"lg:items-center",baseline:"lg:items-baseline",stretch:"lg:items-stretch"}},up={sm:{start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"},md:{start:"md:self-start",end:"md:self-end",center:"md:self-center",baseline:"md:self-baseline",stretch:"md:self-stretch"},lg:{start:"lg:self-start",end:"lg:self-end",center:"lg:self-center",baseline:"lg:self-baseline",stretch:"lg:self-stretch"}},dp={sm:{auto:"justify-self-auto",start:"justify-self-start",end:"justify-self-end",center:"justify-self-center",baseline:"justify-self-baseline",stretch:"justify-self-stretch"},md:{auto:"md:justify-self-auto",start:"md:justify-self-start",end:"md:justify-self-end",center:"md:justify-self-center",baseline:"md:justify-self-baseline",stretch:"md:justify-self-stretch"},lg:{auto:"lg:justify-self-auto",start:"lg:justify-self-start",end:"lg:justify-self-end",center:"lg:justify-self-center",baseline:"lg:justify-self-baseline",stretch:"lg:justify-self-stretch"}},fp={sm:{row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},md:{row:"md:flex-row","row-reverse":"md:flex-row-reverse",column:"md:flex-col","column-reverse":"md:flex-col-reverse"},lg:{row:"lg:flex-row","row-reverse":"lg:flex-row-reverse",column:"lg:flex-col","column-reverse":"lg:flex-col-reverse"}},hp={sm:{wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse",nowrap:"flex-nowrap"},md:{wrap:"md:flex-wrap","wrap-reverse":"md:flex-wrap-reverse",nowrap:"md:flex-nowrap"},lg:{wrap:"lg:flex-wrap","wrap-reverse":"lg:flex-wrap-reverse",nowrap:"lg:flex-nowrap"}},pp={sm:{1:"w-full",2:"w-1/2",3:"w-1/3",4:"w-1/4",5:"w-1/5",6:"w-1/6",7:"w-1/7",8:"w-1/8",9:"w-1/9",10:"w-1/10",11:"w-1/11",12:"w-1/12"},md:{1:"md:w-full",2:"md:w-1/2",3:"md:w-1/3",4:"md:w-1/4",5:"md:w-1/5",6:"md:w-1/6",7:"md:w-1/7",8:"md:w-1/8",9:"md:w-1/9",10:"md:w-1/10",11:"md:w-1/11",12:"md:w-1/12"},lg:{1:"lg:w-full",2:"lg:w-1/2",3:"lg:w-1/3",4:"lg:w-1/4",5:"lg:w-1/5",6:"lg:w-1/6",7:"lg:w-1/7",8:"lg:w-1/8",9:"lg:w-1/9",10:"lg:w-1/10",11:"lg:w-1/11",12:"lg:w-1/12"}},mp={sm:{1:"order-1",2:"order-2",3:"order-3",4:"order-4",5:"order-5",6:"order-6",7:"order-7",8:"order-8",9:"order-9",10:"order-10",11:"order-11",12:"order-12",first:"order-first",last:"order-last",none:"order-none"},md:{1:"md:order-1",2:"md:order-2",3:"md:order-3",4:"md:order-4",5:"md:order-5",6:"md:order-6",7:"md:order-7",8:"md:order-8",9:"md:order-9",10:"md:order-10",11:"md:order-11",12:"md:order-12",first:"md:order-first",last:"md:order-last",none:"md:order-none"},lg:{1:"lg:order-1",2:"lg:order-2",3:"lg:order-3",4:"lg:order-4",5:"lg:order-5",6:"lg:order-6",7:"lg:order-7",8:"lg:order-8",9:"lg:order-9",10:"lg:order-10",11:"lg:order-11",12:"lg:order-12",first:"lg:order-first",last:"lg:order-last",none:"lg:order-none"}},gp={sm:{0:"grow-0",1:"grow"},md:{0:"md:grow-0",1:"md:grow"},lg:{0:"lg:grow-0",1:"lg:grow"}},vp={sm:{0:"shrink-0",1:"shrink"},md:{0:"md:shrink-0",1:"md:shrink"},lg:{0:"lg:shrink-0",1:"lg:shrink"}};function yp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n3&&void 0!==arguments[3]?arguments[3]:"sm",f=[];switch(bp(e)){case"object":for(var h=0,p=Object.entries(e);hspan:first-child]:shrink-0"},ni({title:g,theme:u}),ri({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4 [&_svg]:size-5"},(null==_?void 0:_.label)&&"function"==typeof(null==_?void 0:_.onClick)&&React.createElement("div",{className:"flex"},ti({actionLabel:null==_?void 0:_.label,actionType:null!==(n=null==_?void 0:_.type)&&void 0!==n?n:"button",onAction:R,theme:u})),React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(r=O[u])&&void 0!==r?r:O.light),onClick:function(){return k()}},React.createElement(Ke,null))))},Lp=(Mp=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const Vp={},Wp={},Up={},$p={},Kp={},Hp={},qp={},Yp={},Gp={},Xp={},Jp={},Zp={},Qp={},em={},tm={},nm={},rm={},om={},im={},sm={},am={},lm={},cm={},um={},dm={},fm={},hm={},pm={},mm={},gm={},vm={},ym={},bm={},xm={},wm={},Em={},Sm={},_m={},km={},Cm={},Pm="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Tm=Pm&&"documentMode"in document?document.documentMode:null,Om=Pm&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Rm=Pm&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Nm=!(!Pm||!("InputEvent"in window)||Tm)&&"getTargetRanges"in new window.InputEvent("input"),Am=Pm&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),jm=Pm&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Mm=Pm&&/Android/.test(navigator.userAgent),Im=Pm&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Dm=Pm&&Mm&&Im,Lm=Pm&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Im,Fm=1,zm=3,Bm=0,Vm=2,Wm=0,Um=1,$m=2,Km=4,Hm=8,qm=3|Km|Hm|240,Ym=1,Gm=2,Xm=3,Jm=4,Zm=5,Qm=6,eg=Am||jm||Lm?" ":"​",tg="\n\n",ng=Rm?" ":eg,rg="֑-߿יִ-﷽ﹰ-ﻼ",og="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ig=new RegExp("^[^"+og+"]*["+rg+"]"),sg=new RegExp("^[^"+rg+"]*["+og+"]"),ag={bold:1,code:16,highlight:128,italic:2,strikethrough:Km,subscript:32,superscript:64,underline:Hm},lg={directionless:1,unmergeable:2},cg={center:Gm,end:Qm,justify:Jm,left:Ym,right:Xm,start:Zm},ug={[Gm]:"center",[Qm]:"end",[Jm]:"justify",[Ym]:"left",[Xm]:"right",[Zm]:"start"},dg={normal:0,segmented:2,token:1},fg={[Wm]:"normal",[$m]:"segmented",[Um]:"token"};var hg,pg=(hg=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;egg;try{lx(e,(()=>{const o=jb()||function(e){return e.getEditorState().read((()=>{const e=jb();return null!==e?e.clone():null}))}(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n0){let t=0;for(let o=0;o0)for(const[t,n]of i)if(ux(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{Sg(e,t,n)}))}function Cg(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==i||null!==r&&r!==s||null!==o&&o!==a)}function Pg(e,t){const n=e.mergeWithSibling(t),r=Jb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Tg(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&ub(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Cg(t,r)){r=Pg(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&ub(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Cg(r,n)){r=Pg(r,n);break}break}n.remove()}}else r.remove()}function Og(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),ub(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!ux(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let Rg=1;const Ng="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Ag(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return hx(qg(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==Dg(t))}function jg(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Ag(t)&&Ig(t)===e}catch(e){return!1}}function Mg(e){return e instanceof Px}function Ig(e){let t=e;for(;null!=t;){const e=Dg(t);if(Mg(e))return e;t=Ev(t)}return null}function Dg(e){return e?e.__lexicalEditor:null}function Lg(e){return e.isToken()||e.isSegmented()}function Fg(e){return e.nodeType===zm}function zg(e){let t=e;for(;null!=t;){if(Fg(t))return t;t=t.firstChild}return null}function Bg(e,t,n){const r=ag[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~ag.superscript:"superscript"===t&&(o&=~ag.subscript),o}function Vg(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling();if(null===o)if(null!==i){const e=i.getWritable();r.__first=i.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===i)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function Wg(e){Gb();const t=e.getLatest(),n=t.__parent,r=Xb(),o=Jb(),i=r._nodeMap,s=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,i,s);const a=t.__key;o._dirtyType=1,ux(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function Ug(e){Yb();const t=Jb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Kg(n);null!==e&&e.getWritable()}if(null!==e){const t=Kg(e);null!==t&&t.getWritable()}}}function $g(){return qb()?null:Jb()._compositionKey}function Kg(e,t){const n=(t||Xb())._nodeMap.get(e);return void 0===n?null:n}function Hg(e,t){const n=e[`__lexicalKey_${Jb()._key}`];return void 0!==n?Kg(n,t):null}function qg(e,t){let n=e;for(;null!=n;){const e=Hg(n,t);if(null!==e)return e;n=Ev(n)}return null}function Yg(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Gg(e){return e.read((()=>Xg().getTextContent()))}function Xg(){return Jg(Xb())}function Jg(e){return e._nodeMap.get("root")}function Zg(e){Yb();const t=Xb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Qg(e){const t=Jb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Ev(n)}return null}(e,t);return null===n?e===t.getRootElement()?Kg("root"):null:Kg(n)}function ev(e,t){return t?e.getTextContentSize():0}function tv(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function nv(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function rv(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ov(e){return e.nodeType===zm?e.nodeValue:null}function iv(e,t,n){const r=Ov(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=ov(o);const r=qg(o);if(null!==t&&ub(r)){if(t===eg&&n){const e=n.length;t=n,i=e,s=e}null!==t&&sv(r,t,i,s,e)}}}function sv(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===eg&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(Ug(null),Am||jm||Lm)i.remove();else{const e=Jb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=Mb(),l=i.getTextContentSize(),c=$g(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||xb(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!i.canInsertTextBefore()&&!s||o.focus.key===e.__key&&o.focus.offset===l&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const d=jb();if(!xb(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=cb(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function av(e){return"ArrowLeft"===e}function lv(e){return"ArrowRight"===e}function cv(e,t){return Om?e:t}function uv(e){return"Enter"===e}function dv(e){return"Backspace"===e}function fv(e){return"Delete"===e}function hv(e,t,n){return"a"===e.toLowerCase()&&cv(t,n)}function pv(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=mg(o);return n[t]=e,e}return o}function mv(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&pg(33,i);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(s,d?"updated":o)}function gv(e,t,n){const r=e.getParent();let o=n,i=e;return null!==r&&(t&&0===n?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function vv(e,t){const n=e.offset;if("element"===e.type)return gv(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?gv(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function yv(e){const t=_v(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function bv(e,t,n){return ix(e,t,n)}function xv(e){return!mx(e)&&!e.isLastChild()&&!e.isInline()}function wv(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&pg(75,t),n}function Ev(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Sv(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function _v(e){const t=e._window;return null===t&&pg(78),t}function kv(e){return mx(e)||ux(e)&&e.isShadowRoot()}function Cv(e){const t=Jb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&pg(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||pg(98),t}return e}function Pv(e,t){!mx(e.getParent())||ux(t)||hx(t)||pg(99)}function Tv(e){return(hx(e)||ux(e)&&!e.canBeEmpty())&&!e.isInline()}function _n(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Ov(e){return Pm?(e||window).getSelection():null}function Rv(e){return 1===e.nodeType}function Nv(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Av(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function jv(e){if(mx(e)||hx(e)&&!e.isInline())return!0;if(!ux(e)||kv(e))return!1;const t=e.getFirstChild(),n=null===t||Hy(t)||ub(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Mv(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Iv=new WeakMap,Dv=new Map;function Lv(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Fv(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(ux(s)&&Fv(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let zv,Bv,Vv,Wv,Uv,$v,Kv,Hv,qv,Yv,Gv="",Xv="",Jv=null,Zv="",Qv="",ey=!1,ty=!1,ny=null;function ry(e,t){const n=Kv.get(e);if(null!==t){const n=yy(e);n.parentNode===t&&t.removeChild(n)}if(Hv.has(e)||Bv._keyToDOMMap.delete(e),ux(n)){const e=py(n,Kv);oy(e,0,e.length-1,null)}void 0!==n&&mv(Yv,Vv,Wv,n,"destroyed")}function oy(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&ry(t,r)}}function iy(e,t){e.setProperty("text-align",t)}const sy="40px";function ay(e,t){const n=zv.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||sy;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function ly(e,t){const n=e.style;0===t?iy(n,""):t===Ym?iy(n,"left"):t===Gm?iy(n,"center"):t===Xm?iy(n,"right"):t===Jm?iy(n,"justify"):t===Zm?iy(n,"start"):t===Qm&&iy(n,"end")}function cy(e,t,n){const r=Hv.get(e);void 0===r&&pg(60);const o=r.createDOM(zv,Bv);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,Bv),ub(r)?o.setAttribute("data-lexical-text","true"):hx(r)&&o.setAttribute("data-lexical-decorator","true"),ux(r)){const e=r.__indent,t=r.__size;if(0!==e&&ay(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=Xv;Xv="",uy(e,n,0,t,r,null),hy(n,r),Xv=o}(py(r,Hv),e,r,o)}const n=r.__format;0!==n&&ly(o,n),r.isInline()||fy(null,r,o),xv(r)&&(Gv+=tg,Qv+=tg)}else{const t=r.getTextContent();if(hx(r)){const t=r.decorate(Bv,zv);null!==t&&gy(e,t),o.contentEditable="false"}else ub(r)&&(r.isDirectionless()||(Xv+=t));Gv+=t,Qv+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return mv(Yv,Vv,Wv,r,"created"),o}function uy(e,t,n,r,o,i){const s=Gv;Gv="";let a=n;for(;a<=r;++a){cy(e[a],o,i);const t=Hv.get(e[a]);null!==t&&ub(t)&&(null===Jv&&(Jv=t.getFormat()),""===Zv&&(Zv=t.getStyle()))}xv(t)&&(Gv+=tg),o.__lexicalTextContent=Gv,Gv=s+Gv}function dy(e,t){const n=t.get(e);return Hy(n)||hx(n)&&n.isInline()}function fy(e,t,n){const r=null!==e&&(0===e.__size||dy(e.__last,Kv)),o=0===t.__size||dy(t.__last,Hv);if(r){if(!o){const e=n.__lexicalLineBreak;if(null!=e)try{n.removeChild(e)}catch(t){if("object"==typeof t&&null!=t){const r=`${t.toString()} Parent: ${n.tagName}, child: ${e.tagName}.`;throw new Error(r)}throw t}n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function hy(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==Xv||r!==ny){const n=""===Xv,i=n?ny:(o=Xv,ig.test(o)?"rtl":sg.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=zv.theme;let a=null!==r?s[r]:void 0,l=null!==i?s[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=mg(a);a=s[r]=e}o.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=mg(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}ty||(e.getWritable().__dir=i)}ny=i,t.__lexicalDirTextContent=Xv,t.__lexicalDir=i}var o}function py(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&pg(101),n.push(r),r=e.__next}return n}function my(e,t){const n=Kv.get(e);let r=Hv.get(e);void 0!==n&&void 0!==r||pg(61);const o=ey||$v.has(e)||Uv.has(e),i=wv(Bv,e);if(n===r&&!o){if(ux(n)){const e=i.__lexicalTextContent;void 0!==e&&(Gv+=e,Qv+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(Xv+=t)}else{const e=n.getTextContent();ub(n)&&!n.isDirectionless()&&(Xv+=e),Qv+=e,Gv+=e}return i}if(n!==r&&o&&mv(Yv,Vv,Wv,r,"updated"),r.updateDOM(n,i,zv)){const n=cy(e,null,null);return null===t&&pg(62),t.replaceChild(n,i),ry(e,null),n}if(ux(n)&&ux(r)){const e=r.__indent;e!==n.__indent&&ay(i,e);const t=r.__format;t!==n.__format&&ly(i,t),o&&(function(e,t,n){const r=Xv;var o;Xv="",Jv=null,Zv="",function(e,t,n){const r=Gv,o=e.__size,i=t.__size;if(Gv="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)my(r,n);else{const e=yy(r),t=cy(o,null,null);try{n.replaceChild(t,e)}catch(i){if("object"==typeof i&&null!=i){const s=`${i.toString()} Parent: ${n.tagName}, new child: {tag: ${t.tagName} key: ${o}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(s)}throw i}ry(r,null)}const s=Hv.get(o);ub(s)&&(null===Jv&&(Jv=s.getFormat()),""===Zv&&(Zv=s.getStyle()))}else{const r=py(e,Kv),s=py(t,Hv);if(0===o)0!==i&&uy(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;oy(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,i){const s=r-1,a=o-1;let l,c,u=i.firstChild,d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f];if(e===r)u=vy(my(r,i)),d++,f++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),s=l.has(r);if(o)if(s){const e=wv(Bv,r);e===u?u=vy(my(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),my(r,i)),d++,f++}else cy(r,i,u),f++;else u=vy(yy(e)),ry(e,i),d++}const o=Hv.get(r);null!==o&&ub(o)&&(null===Jv&&(Jv=o.getFormat()),""===Zv&&(Zv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];uy(n,e,f,a,i,void 0===t?null:Bv.getElementByKey(t))}else p&&!h&&oy(t,d,s,i)}(t,r,s,o,i,n)}xv(t)&&(Gv+=tg),n.__lexicalTextContent=Gv,Gv=r+Gv}(e,t,n),hy(t,n),Sx(o=t)&&null!=Jv&&Jv!==o.__textFormat&&!ty&&(o.setTextFormat(Jv),o.setTextStyle(Zv)),function(e){Sx(e)&&""!==Zv&&Zv!==e.__textStyle&&!ty&&e.setTextStyle(Zv)}(t),Xv=r}(n,r,i),mx(r)||r.isInline()||fy(n,r,i)),xv(r)&&(Gv+=tg,Qv+=tg)}else{const t=r.getTextContent();if(hx(r)){const t=r.decorate(Bv,zv);null!==t&&gy(e,t)}else ub(r)&&!r.isDirectionless()&&(Xv+=t);Gv+=t,Qv+=t}if(!ty&&mx(r)&&r.__cachedText!==Qv){const e=r.getWritable();e.__cachedText=Qv,r=e}return i}function gy(e,t){let n=Bv._pendingDecorators;const r=Bv._decorators;if(null===n){if(r[e]===t)return;n=Yg(Bv)}n[e]=t}function vy(e){let t=e.nextSibling;return null!==t&&t===Bv._blockCursorElement&&(t=t.nextSibling),t}function yy(e){const t=qv.get(e);return void 0===t&&pg(75,e),t}const by=Object.freeze({}),xy=[["keydown",function(e,t){if(wy=e.timeStamp,Ey=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;bv(t,em,e)||null!=n&&(function(e,t,n,r){return lv(e)&&!t&&!r&&!n}(n,o,s,i)?bv(t,tm,e):function(e,t,n,r,o){return lv(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?bv(t,nm,e):function(e,t,n,r){return av(e)&&!t&&!r&&!n}(n,o,s,i)?bv(t,rm,e):function(e,t,n,r,o){return av(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?bv(t,om,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?bv(t,im,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?bv(t,sm,e):function(e,t){return uv(e)&&t}(n,r)?(Ty=!0,bv(t,am,e)):function(e){return" "===e}(n)?bv(t,lm,e):function(e,t){return Om&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),Ty=!0,bv(t,$p,!0)):function(e,t){return uv(e)&&!t}(n,r)?(Ty=!1,bv(t,am,e)):function(e,t,n,r){return Om?!t&&!n&&(dv(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&dv(e)}(n,s,i,o)?dv(n)?bv(t,cm,e):(e.preventDefault(),bv(t,Up,!0)):function(e){return"Escape"===e}(n)?bv(t,um,e):function(e,t,n,r,o){return Om?!(n||r||o)&&(fv(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&fv(e)}(n,o,r,s,i)?fv(n)?bv(t,dm,e):(e.preventDefault(),bv(t,Up,!1)):function(e,t,n){return dv(e)&&(Om?t:n)}(n,s,o)?(e.preventDefault(),bv(t,Gp,!0)):function(e,t,n){return fv(e)&&(Om?t:n)}(n,s,o)?(e.preventDefault(),bv(t,Gp,!1)):function(e,t){return Om&&t&&dv(e)}(n,i)?(e.preventDefault(),bv(t,Xp,!0)):function(e,t){return Om&&t&&fv(e)}(n,i)?(e.preventDefault(),bv(t,Xp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&cv(n,r)}(n,s,i,o)?(e.preventDefault(),bv(t,Jp,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&cv(n,r)}(n,s,i,o)?(e.preventDefault(),bv(t,Jp,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&cv(n,r)}(n,s,i,o)?(e.preventDefault(),bv(t,Jp,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?bv(t,fm,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&cv(n,r)}(n,r,i,o)?(e.preventDefault(),bv(t,Zp,void 0)):function(e,t,n,r){return Om?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),bv(t,Qp,void 0)):Eb(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(Om?n:r)}(n,r,i,o)?(e.preventDefault(),bv(t,vm,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(Om?n:r)}(n,r,i,o)?(e.preventDefault(),bv(t,ym,e)):hv(n,i,o)&&(e.preventDefault(),bv(t,bm,e)):!Rm&&hv(n,i,o)&&(e.preventDefault(),bv(t,bm,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&bv(t,Cm,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&lx(t,(()=>{hx(qg(n))||(Py=!0)}))}],["compositionstart",function(e,t){lx(t,(()=>{const n=jb();if(xb(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();Ug(r.key),(e.timeStamp{Iy(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),lx(t,(()=>{const n=jb(),r=e.data,o=My(e);if(null!=r&&xb(n)&&Ny(n,o,r,e.timeStamp,!1)){Oy&&(Iy(t,r),Oy=!1);const o=n.anchor.getNode(),i=Ov(t._window);if(null===i)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;Nm&&!n.isCollapsed()&&ub(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===ov(i.anchorNode)||bv(t,Hp,r);const c=r.length;Rm&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Am||jm||Lm||!t.isComposing()||(wy=0,Ug(null))}else iv(!1,t,null!==r?r:void 0),Oy&&(Iy(t,r||void 0),Oy=!1);Yb(),_g(Jb())})),_y=null}],["click",function(e,t){lx(t,(()=>{const n=jb(),r=Ov(t._window),o=Mb();if(r)if(xb(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!mx(i)&&1===Xg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(ux(i)?i.select(0):i.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const i=n.nodeType;i!==Fm&&i!==zm||Zg(Ab(o,r,t,e))}}bv(t,Wp,e)}))}],["cut",by],["copy",by],["dragstart",by],["dragover",by],["dragend",by],["paste",by],["focus",by],["blur",by],["drop",by]];Nm&&xy.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=My(e);"deleteCompositionText"===n||Rm&&yv(t)||"insertCompositionText"!==n&&lx(t,(()=>{const o=jb();if("deleteContentBackward"===n){if(null===o){const e=Mb();if(!xb(e))return;Zg(e.clone())}if(xb(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===Ey&&i{lx(t,(()=>{Ug(null)}))}),30),xb(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),ub(e)||pg(142),o.style=e.getStyle()}}else{Ug(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;Dm&&n&&!i||bv(t,Up,!0)}return}}var i;if(!xb(o))return;const s=e.data;null!==_y&&iv(!1,t,_y),o.dirty&&null===_y||!o.isCollapsed()||mx(o.anchor.getNode())||null===r||o.applyDOMRange(r),_y=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":bv(t,Hp,e);break;case"insertFromComposition":Ug(null),bv(t,Hp,e);break;case"insertLineBreak":Ug(null),bv(t,$p,!1);break;case"insertParagraph":Ug(null),Ty&&!jm?(Ty=!1,bv(t,$p,!1)):bv(t,Kp,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":bv(t,qp,e);break;case"deleteByComposition":(function(e,t){return e!==t||ux(e)||ux(t)||!e.isToken()||!t.isToken()})(c,u)&&bv(t,Yp,e);break;case"deleteByDrag":case"deleteByCut":bv(t,Yp,e);break;case"deleteContent":bv(t,Up,!1);break;case"deleteWordBackward":bv(t,Gp,!0);break;case"deleteWordForward":bv(t,Gp,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":bv(t,Xp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":bv(t,Xp,!1);break;case"formatStrikeThrough":bv(t,Jp,"strikethrough");break;case"formatBold":bv(t,Jp,"bold");break;case"formatItalic":bv(t,Jp,"italic");break;case"formatUnderline":bv(t,Jp,"underline");break;case"historyUndo":bv(t,Zp,void 0);break;case"historyRedo":bv(t,Qp,void 0)}else{if("\n"===s)e.preventDefault(),bv(t,$p,!1);else if(s===tg)e.preventDefault(),bv(t,Kp,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&Ny(o,r,s,e.timeStamp,!0)?(e.preventDefault(),bv(t,Hp,s)):_y=s;Sy=e.timeStamp}}))}(e,t)]);let wy=0,Ey=null,Sy=0,_y=null;const ky=new WeakMap;let Cy=!1,Py=!1,Ty=!1,Oy=!1,Ry=[0,"",0,"root",0];function Ny(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=Jb(),c=Ov(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!ub(a)||(!o&&(!Nm||Sy1||(o||!Nm)&&null!==f&&!a.isComposing()&&u!==zg(f)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(ub(t)||ux(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Ay(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===zm&&0!==t&&t!==e.nodeValue.length}function jy(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Cy&&(Cy=!1,Ay(r,o)&&Ay(i,s))||lx(t,(()=>{if(!n)return void Zg(null);if(!jg(t,r,i))return;const a=jb();if(xb(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=_v(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=Ry,f=Xg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=Mb(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==Fm&&i!==zm||Zg(Ab(t,n,r,e))})));const o=nv(r),i=o[o.length-1],s=i._key,a=Ly.get(s),l=a||i;l!==r&&jy(n,l,!1),jy(n,r,!0),r!==i?Ly.set(s,r):a&&Ly.delete(s)}function zy(e){e._lexicalHandled=!0}function By(e){return!0===e._lexicalHandled}function Vy(e,t,n){Yb();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=jb();if(!xb(t)||!ux(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return Sv(o,e)&&n.set(e.__key,0,"element"),Sv(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(xb(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(Lb(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(Lb(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Eb(i)&&t&&e.isSelected()&&e.selectPrevious();if(xb(i)&&t&&!s){const t=e.getIndexWithinParent();Vg(e),Ib(i,o,t,-1)}else Vg(e);n||kv(o)||o.canBeEmpty()||!o.isEmpty()||Vy(o,t),t&&mx(o)&&o.isEmpty()&&o.selectEnd()}class Wy{static getType(){pg(64,this.name)}static clone(e){pg(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,function(e,t){if(null!=t)return void(e.__key=t);Yb(),Gb();const n=Jb(),r=Xb(),o=""+Rg++;r._nodeMap.set(o,e),ux(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}(this,e)}getType(){return this.__type}isInline(){pg(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Kg(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||jb();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(ub(this))return n;if(xb(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(hx(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor,r=n.getNode();if(n.offset===r.getChildrenSize()&&r.is(e)&&r.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Kg(e)}getParentOrThrow(){const e=this.getParent();return null===e&&pg(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(kv(t))return ux(e)||e===this&&hx(e)||pg(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&pg(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Kg(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Kg(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();ux(this)&&t.unshift(this),ux(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const i=new Set(n);for(let e=0;e{s.append(e)}))),xb(n)){Zg(n);const e=n.anchor,t=n.focus;e.key===o&&vb(e,s),t.key===o&&vb(t,s)}return $g()===o&&Ug(i),s}insertAfter(e,t=!0){Yb(),Pv(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=jb();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(Vg(r),xb(i)){const e=o.__key,n=i.anchor,r=i.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&xb(i)){const e=this.getIndexWithinParent();Ib(i,c,e+1);const t=c.__key;s&&i.anchor.set(t,e+2,"element"),a&&i.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){Yb(),Pv(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;Vg(r);const i=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===i?s.__first=o:i.getWritable().__next=o,s.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=jb();return t&&xb(c)&&Ib(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Ex()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Yb();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(ux(n))return n.select();if(!ub(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Yb();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(ux(n))return n.select(0,0);if(!ub(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class Uy extends Wy{static getType(){return"linebreak"}static clone(e){return new Uy(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Av(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&qy(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&qy(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Av(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&qy(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&qy(r))return!0}return!1}(e)?null:{conversion:$y,priority:0}}}static importJSON(e){return Ky()}exportJSON(){return{type:"linebreak",version:1}}}function $y(e){return{node:Ky()}}function Ky(){return Cv(new Uy)}function Hy(e){return e instanceof Uy}function qy(e){return e.nodeType===zm&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Yy(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Gy(e,t){return 1&t?"strong":2&t?"em":"span"}function Xy(e,t,n,r,o){const i=r.classList;let s=pv(o,"base");void 0!==s&&i.add(...s),s=pv(o,"underlineStrikethrough");let a=!1;const l=t&Hm&&t&Km;void 0!==s&&(n&Hm&&n&Km?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in ag){const r=ag[e];if(s=pv(o,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&i.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||i.add(...s)}else t&r&&i.remove(...s)}}function Jy(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?eg:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||Rm){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:ib,priority:0}),b:()=>({conversion:nb,priority:0}),code:()=>({conversion:lb,priority:0}),em:()=>({conversion:lb,priority:0}),i:()=>({conversion:lb,priority:0}),s:()=>({conversion:lb,priority:0}),span:()=>({conversion:tb,priority:0}),strong:()=>({conversion:lb,priority:0}),sub:()=>({conversion:lb,priority:0}),sup:()=>({conversion:lb,priority:0}),u:()=>({conversion:lb,priority:0})}}static importJSON(e){const t=cb(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&Rv(t)||pg(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Qy(t,"b")),this.hasFormat("italic")&&(t=Qy(t,"i")),this.hasFormat("strikethrough")&&(t=Qy(t,"s")),this.hasFormat("underline")&&(t=Qy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?ag[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?lg[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Bg(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=dg[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Yb();let n=e,r=t;const o=jb(),i=this.getTextContent(),s=this.__key;if("string"==typeof i){const e=i.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!xb(o))return Rb(s,n,s,r,"text","text");{const e=$g();e!==o.anchor.key&&e!==o.focus.key||Ug(s),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),i=o.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=jb();if(r&&xb(l)){const t=e+s;l.setTextNodeRange(o,t,o,t)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Yb();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=$g(),i=new Set(e),s=[],a=n.length;let l="";for(let e=0;eb&&e.offset<=l&&(e.key=a,e.offset-=b,v.dirty=!0),t.key===r&&"text"===t.type&&t.offset>b&&t.offset<=l&&(t.key=a,t.offset-=b,v.dirty=!0)}o===r&&Ug(a),b=l,y.push(i)}if(null!==d){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&Wg(t),null!==n&&Wg(n)}(this);const e=d.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),xb(v)&&Ib(v,d,t,c-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||pg(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;$g()===r&&Ug(n);const s=jb();if(xb(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(Fb(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(Fb(a,t,n,e,i),s.dirty=!0)}const a=e.__text,l=t?a+o:o+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function tb(e){return{forChild:db(e.style),node:null}}function nb(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:db(t.style,n?void 0:"bold"),node:null}}const rb=new WeakMap;function ob(e){return"PRE"===e.nodeName||e.nodeType===Fm&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function ib(e){const t=e;null===e.parentElement&&pg(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=rb.get(n))&&!ob(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=sb(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:cb(n)}}function sb(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===Fm){const e=n.style.display;if(""===e&&!Nv(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===zm)return n;if("BR"===n.nodeName)return null}}const ab={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function lb(e){const t=ab[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:db(e.style,t),node:null}}function cb(e=""){return Cv(new eb(e))}function ub(e){return e instanceof eb}function db(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o="700"===n||"bold"===n,i=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>ub(e)?(o&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class fb extends eb{static getType(){return"tab"}static clone(e){return new fb(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=hb();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){pg(126)}setDetail(e){pg(127)}setMode(e){pg(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function hb(){return Cv(new fb)}class pb{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(ux(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(ux(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!ux(t)){const e=t.getNextSibling();if(ub(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function vb(e,t){if(ux(t)){const n=t.getLastDescendant();ux(n)||ub(n)?gb(e,n):gb(e,t)}else gb(e,t)}function yb(e,t,n,r){e.key=t,e.offset=n,e.type=r}class bb{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Eb(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new bb(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(ub(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e0?[]:[s]:s.getNodesBetween(a),qb()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){yb(this.anchor,e.__key,t,"text"),yb(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[s,a]=_b(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||ux(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(o)?m||g.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===f)d.select();else{const t=cb(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e0&&(m===p.getTextContentSize()||Lg(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(ux(e)||hx(e))&&!e.isInline()))){ux(t)||pg(135);const r=zb(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Ex();let n=null;for(let r=0;rl?l:a,t=a>l?a:l,n=i.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[i]}const c=r.isBefore(o);if(ub(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(ub(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,i="move"===e,s=vv(r,t);if(hx(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=Nb();return e.add(s.__key),void Zg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(ub(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(i&&o.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return ux(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(i&&o.set(l,a,"element"))}}const a=Jb(),l=Ov(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!ux(s)||s.isInline()||s.canBeEmpty()||_n(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=mx(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(kv(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){const n=this.getNodes(),o=[];let i=!1;for(let e=0;e0)if(t){const e=o[0];ux(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];ux(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,i=n.type;yb(n,t.key,t.offset,t.type),yb(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&ux(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(ux(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=vv(r,e);if(hx(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&ux(n)&&0===n.getChildrenSize()){n.remove();const e=Nb();e.add(o.__key),Zg(e)}else o.remove(),Jb().dispatchCommand(Vp,void 0);return}if(!e&&ux(o)&&ux(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,i=o.getTextContentSize();if(o.is(n)||e&&t!==i||!e&&0!==t)return void kb(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,i=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==i)return void kb(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,i=r.offset,s=en||r){o.splice(e,1),r&&(a=void 0);break}}const l=o.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function Cb(e,t,n,r){let o,i=t;if(e.nodeType===Fm){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],d=!1;if(u===c)u=a[i+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&i--}if(o=Qg(u),ub(o))i=ev(o,s);else{let r=Qg(e);if(null===r)return null;if(ux(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(ux(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=ux(e)?e:e.getParentOrThrow()),i=0}ub(e)?(o=e,r=null,i=ev(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&hx(r)&&Qg(e)===r?n:n+1,r=r.getParentOrThrow()}if(ux(r))return mb(r.__key,i,"element")}}else o=Qg(e);return ub(o)?mb(o.__key,i,"text"):null}function Pb(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),i=o.getParent();if(t){if((n||!t)&&null===r&&ux(i)&&i.isInline()){const t=i.getPreviousSibling();ub(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else ux(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):ub(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),i=o.getParent();if(t&&ux(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&ux(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();ub(t)&&(e.key=t.__key,e.offset=0)}}}function Tb(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);Pb(e,r,o),Pb(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=Jb();if(i.isComposing()&&i._compositionKey!==e.key&&xb(n)){const r=n.anchor,o=n.focus;yb(e,r.key,r.offset,r.type),yb(t,o.key,o.offset,o.type)}}}function Ob(e,t,n,r,o,i){if(null===e||null===n||!jg(o,e,n))return null;const s=Cb(e,t,xb(i)?i.anchor:null,o);if(null===s)return null;const a=Cb(n,r,xb(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=Qg(e),r=Qg(n);if(hx(t)&&hx(r))return null}return Tb(s,a,i),[s,a]}function Rb(e,t,n,r,o,i){const s=Xb(),a=new wb(mb(e,t,o),mb(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Nb(){return new bb(new Set)}function Ab(e,t,n,r){const o=n._window;if(null===o)return null;const i=r||o.event,s=i?i.type:void 0,a="selectionchange"===s,l=!vg&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(xb(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&xb(e)&&!jg(n,c,u))return e.clone();const h=Ob(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new wb(p,m,xb(e)?e.format:0,xb(e)?e.style:"")}function jb(){return Xb()._selection}function Mb(){return Jb()._editorState._selection}function Ib(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=o.offset;if(n<=t&&r>0||n0||n0||n=e,s=o?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(ub(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(ux(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(ub(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(ux(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(ub(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Lb(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,ub(r)?(s=r.getTextContentSize(),a="text"):ux(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,ub(o)?a="text":ux(o)&&(a="element")),null!==i&&null!==a?e.set(i,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Fb(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function zb(e){let t=e;e.isCollapsed()||t.removeText();const n=jb();xb(n)&&(t=n),xb(t)||pg(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!jv(o);)[o,i]=Bb(o,i);return i}function Bb(e,t){const n=e.getParent();if(!n){const e=Ex();return Xg().append(e),e.select(),[Xg(),0]}if(ub(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!ux(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new wb(mb(e.__key,t,"element"),mb(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let Vb=null,Wb=null,Ub=!1,$b=!1,Kb=0;const Hb={characterData:!0,childList:!0,subtree:!0};function qb(){return Ub||null!==Vb&&Vb._readOnly}function Yb(){Ub&&pg(13)}function Gb(){Kb>99&&pg(14)}function Xb(){return null===Vb&&pg(195,Zb()),Vb}function Jb(){return null===Wb&&pg(196,Zb()),Wb}function Zb(){let e=0;const t=new Set,n=Px.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const o=Dg(r);if(Mg(o))e++;else if(o){let e=String(o.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function Qb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&pg(30,t),n}(e,r);let i=n.get(r);void 0===i&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let e=0;e0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:i,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=_v(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(il&&(n=s-l),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;i-=t,s-=t}if(t)break;c=Ev(c)}}(n,t,i)}}Cy=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(xb(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,i=o.getNode(),s=o.offset;let a=!1,l=null;if(s===i.getChildrenSize())Tv(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(Tv(t)){const n=t.getPreviousSibling();(null===n||Tv(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(i.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=mg(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&_n(r,e,t)})(e,r,a),null!==h&&h.observe(r,Hb)}finally{Wb=d,Vb=c}}null!==p&&function(e,t,n,r,o){const i=Array.from(e._listeners.mutation),s=i.length;for(let e=0;e{r=ix(e,t,n)})),r}const r=nv(e);for(let o=4;o>=0;o--)for(let i=0;i0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=o.get(e);ub(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Tg(r),void 0!==r&&ex(r,i)&&Qb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){Kb++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=o.get(n);void 0!==l&&ex(l,i)&&Qb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,Kb++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),sx(e),function(e,t,n,r){const o=e._nodeMap,i=t._nodeMap,s=[];for(const[e]of r){const t=i.get(e);void 0!==t&&(t.isAttached()||(ux(t)&&Fv(t,e,o,i,s,r),o.has(e)||r.delete(e),s.push(e)))}for(const e of s)i.delete(e);for(const e of n){const t=i.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),i.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(xb(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||pg(19)}else Eb(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=Vm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void rx(e)}finally{Vb=d,Ub=f,Wb=h,e._updating=p,Kb=0}const m=e._dirtyType!==Bm||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,rx(e)):u&&Ng((()=>{rx(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function lx(e,t,n){e._updating?e._updates.push([t,n]):ax(e,t,n)}class cx extends Wy{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return ug[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Jb()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(ub(t)&&e.push(t),ux(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;ux(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;ux(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return ux(e)&&e.getLastDescendant()||e||null}const r=t[e];return ux(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Kg(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&pg(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Kg(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&pg(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;re.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?cg[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),i=this.getWritable(),s=i.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n({root:vx(Xg())})))}}class bx extends cx{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class xx extends cx{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=ag[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new xx(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=pv(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:wx,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Rv(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Ex();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Ex();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||ub(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function wx(e){const t=Ex();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Ex(){return Cv(new xx)}function Sx(e){return e instanceof xx}const kx=1;function Cx(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=gx(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=Bm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;null!==i&&(i.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class Px{constructor(e,t,n,r,o,i,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=Bm,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=rv(),this._onError=o,this._htmlConversions=i,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&pg(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&pg(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,r);const i=n&&n.skipInitialization;return void 0===i||i||this.initializeMutationListener(t,r),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&pg(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=function(e){if(!e._readOnly&&e.isEmpty())return Dv;e._readOnly||pg(192);let t=Iv.get(e);if(!t){t=new Map,Iv.set(e,t);for(const[n,r]of e._nodeMap){const e=r.__type;let o=t.get(e);o||(o=new Map,t.set(e,o)),o.set(n,r)}}return t}(n).get(t.getType());if(!r)return;const o=new Map;for(const e of r.keys())o.set(e,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var i;return i=e.getType(),lx(this,(()=>{const e=Xb();if(e.isEmpty())return;if("root"===i)return void Xg().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return bv(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=pv(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Cx(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=ky.get(t);void 0===n&&pg(162);const r=n-1;r>=0||pg(164),ky.set(t,r),0===r&&t.removeEventListener("selectionchange",Fy);const o=Dg(e);Mg(o)?(function(e){if(null!==e._parentEditor){const t=nv(e),n=t[t.length-1]._key;Ly.get(n)===e&&Ly.delete(n)}else Ly.delete(e._key)}(o),e.__lexicalEditor=null):o&&pg(198);const i=Dy(e);for(let e=0;e{By(e)||(zy(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if(By(e))return;zy(e);const n=t.isEditable();switch(r){case"cut":return n&&bv(t,ym,e);case"copy":return bv(t,vm,e);case"paste":return n&&bv(t,qp,e);case"dragstart":return n&&bv(t,pm,e);case"dragover":return n&&bv(t,mm,e);case"dragend":return n&&bv(t,gm,e);case"focus":return n&&bv(t,_m,e);case"blur":return n&&bv(t,km,e);case"drop":return n&&bv(t,hm,e)}};e.addEventListener(r,s),o.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;ox("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&pg(38),_g(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),rx(this)),this._pendingEditorState=e,this._dirtyType=Vm,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),rx(this)}parseEditorState(e,t){return function(e,t,n){const r=gx(),o=Vb,i=Ub,s=Wb,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Vb=r,Ub=!1,Wb=t;try{const o=t._nodes;tx(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,Vb=o,Ub=i,Wb=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return rx(this),this.getEditorState().read(e,{editor:this})}update(e,t){lx(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),lx(this,(()=>{const e=jb(),n=Xg();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Ov(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ox("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Px.version="0.17.1+prod.esm";const Tx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ox=Tx?o.useLayoutEffect:o.useEffect,Rx={tag:"history-merge"};function Nx({initialConfig:e,children:t}){const n=(0,o.useMemo)((()=>{const{theme:t,namespace:n,nodes:r,onError:o,editorState:i,html:s}=e,a=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t),l=function(e){const t=e||{},n=Wb,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=gx(),a=t.namespace||(null!==o?o._config.namespace:rv()),l=t.editorState,c=[px,eb,Uy,fb,xx,bx,...t.nodes||[]],{onError:u,html:d}=t,f=void 0===t.editable||t.editable;let h;if(void 0===e&&null!==n)h=n._nodes;else{h=new Map;for(let e=0;e{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(h,d?d.import:void 0),f);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=Vm),p}({editable:e.editable,html:s,namespace:n,nodes:r,onError:e=>o(e,l),theme:t});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=Xg();if(t.isEmpty()){const n=Ex();t.append(n);const r=Tx?document.activeElement:null;(null!==jb()||null!==r&&r===e.getRootElement())&&n.select()}}),Rx);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Rx);break}case"object":e.setEditorState(t,Rx);break;case"function":e.update((()=>{Xg().isEmpty()&&t(e)}),Rx)}}(l,i),[l,a]}),[]);return Ox((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,ou.jsx)(Fp.Provider,{value:n,children:t})}const Ax="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function jx(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Mx(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=Xg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=Xg().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Fx(e,t){const n=vv(e.focus,t);return hx(n)&&!n.isIsolated()||ux(n)&&!n.isInline()&&!n.canBeEmpty()}function zx(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(mx(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function Bx(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=ux(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=Lv(t);e=ub(e)&&null!==r?function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,i=e.isBackward(),s=r.getNode(),a=o.getNode(),l=t.is(s),c=t.is(a);if(l||c){const[n,r]=_b(e),o=s.is(a),l=t.is(i?a:s),c=t.is(i?s:a);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):l?(d=i?r:n,u=void 0):c&&(d=0,u=i?n:r),t.__text=t.__text.slice(d,u),t}}return t}(r,e):e,s=e}const a=ux(s)?s.getChildren():[],l=e._nodes.get(s.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let n=0;n{if(null!==e){const r=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}(e,KeyboardEvent)?null:e.clipboardData,o=jb();if(null!==o&&null!=r){e.preventDefault();const i=function(e,t=jb()){return null==t&&Vx(166),xb(t)&&t.isCollapsed()||0===t.getNodes().length?"":function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===n.g.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const r=document.createElement("div"),o=Xg().getChildren();for(let n=0;ne.getDecorators()));return Jx((()=>e.registerDecoratorListener((e=>{(0,Fn.flushSync)((()=>{r(e)}))}))),[e]),(0,o.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,o.useMemo)((()=>{const r=[],i=Object.keys(n);for(let s=0;se._onError(t),children:(0,ou.jsx)(o.Suspense,{fallback:null,children:n[a]})}),c=e.getElementByKey(a);null!==c&&r.push((0,Fn.createPortal)(l,c,a))}return r}),[t,n,e])}(r,n);return function(e){Jx((()=>Lx(function(e){return Lx(e.registerCommand(Up,(e=>{const t=jb();return!!xb(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(Gp,(e=>{const t=jb();return!!xb(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(Xp,(e=>{const t=jb();return!!xb(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(Hp,(e=>{const t=jb();if(!xb(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)Wx(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(Yp,(()=>{const e=jb();return!!xb(e)&&(e.removeText(),!0)}),0),e.registerCommand($p,(e=>{const t=jb();return!!xb(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Kp,(()=>{const e=jb();return!!xb(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(rm,(e=>{const t=jb();if(!xb(t))return!1;const n=e,r=n.shiftKey;return!!Fx(t,!0)&&(n.preventDefault(),zx(t,r,!0),!0)}),0),e.registerCommand(tm,(e=>{const t=jb();if(!xb(t))return!1;const n=e,r=n.shiftKey;return!!Fx(t,!1)&&(n.preventDefault(),zx(t,r,!1),!0)}),0),e.registerCommand(cm,(t=>!!xb(jb())&&(t.preventDefault(),e.dispatchCommand(Up,!0))),0),e.registerCommand(dm,(t=>!!xb(jb())&&(t.preventDefault(),e.dispatchCommand(Up,!1))),0),e.registerCommand(am,(t=>{if(!xb(jb()))return!1;if(null!==t){if((qx||Hx||Gx)&&Kx)return!1;t.preventDefault()}return e.dispatchCommand($p,!1)}),0),e.registerCommand(bm,(()=>(function(){const e=Xg();Zg(function(e){return Og(e.anchor),Og(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(vm,(t=>!!xb(jb())&&(Xx(t,e),!0)),0),e.registerCommand(ym,(t=>!!xb(jb())&&(function(e,t){Xx(e,t),t.update((()=>{const e=jb();xb(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(qp,(t=>!!xb(jb())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=jb(),{clipboardData:n}=e;null!=n&&xb(t)&&Wx(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(hm,(e=>!!xb(jb())&&(e.preventDefault(),!0)),0),e.registerCommand(pm,(e=>!!xb(jb())&&(e.preventDefault(),!0)),0))}(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,s,a,l]=t;e.update((()=>{const e=jb();if(xb(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(ub(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),ub(l)){c=s,u=s+a;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(r),(0,ou.jsxs)(ou.Fragment,{children:[e,(0,ou.jsx)(ew,{content:t}),i]})}function ew({content:e}){const[t]=zp(),n=function(e){const[t,n]=(0,o.useState)((()=>Zx(e)));return Jx((()=>{function t(){const t=Zx(e);n(t)}return t(),Lx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=zp(),n=(0,o.useMemo)((()=>e(t)),[t,e]),r=(0,o.useRef)(n.initialValueFn()),[i,s]=(0,o.useState)(r.current);return Ax((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,s(o)),t((e=>{r.current=e,s(e)}))}),[n,e]),i}(jx);return n?"function"==typeof e?e(r):e:null}const tw="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,nw=(0,o.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaExpanded:s,ariaLabel:a,ariaLabelledBy:l,ariaMultiline:c,ariaOwns:u,ariaRequired:d,autoCapitalize:f,className:h,id:p,role:m="textbox",spellCheck:g=!0,style:v,tabIndex:y,"data-testid":b,...x},w){const[E,S]=(0,o.useState)(e.isEditable()),_=(0,o.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),k=(0,o.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(w,_)),[_,w]);return tw((()=>(S(e.isEditable()),e.registerEditableListener((e=>{S(e)})))),[e]),(0,ou.jsx)("div",{...x,"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":i,"aria-expanded":E&&"combobox"===m?!!s:void 0,"aria-label":a,"aria-labelledby":l,"aria-multiline":c,"aria-owns":E?u:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:f,className:h,contentEditable:E,"data-testid":b,id:p,ref:k,role:E?m:void 0,spellCheck:g,style:v,tabIndex:y})}));function rw(e){return e.getEditorState().read(Mx(e.isComposing()))}const ow=(0,o.forwardRef)((function(e,t){const{placeholder:n,...r}=e,[o]=zp();return(0,ou.jsxs)(ou.Fragment,{children:[(0,ou.jsx)(nw,{editor:o,...r,ref:t}),null!=n&&(0,ou.jsx)(iw,{editor:o,content:n})]})}));function iw({content:e,editor:t}){const n=function(e){const[t,n]=(0,o.useState)((()=>rw(e)));return tw((()=>{function t(){const t=rw(e);n(t)}return t(),Lx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,o.useState)(t.isEditable());if((0,o.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let s=null;return"function"==typeof e?s=e(r):null!==e&&(s=e),null===s?null:(0,ou.jsx)("div",{"aria-hidden":!0,children:s})}const sw=0,aw=1,lw=2,cw=0,uw=1,dw=2,fw=3,hw=4;function pw(e){e.undoStack=[],e.redoStack=[],e.current=null}function mw({delay:e,externalHistoryState:t}){const[n]=zp();return function(e,t,n=1e3){const r=(0,o.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,o.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=cw;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=cw,n=u,lw;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return cw;const i=t._selection,s=e._selection;if(o)return uw;if(!(xb(i)&&xb(s)&&s.isCollapsed()&&i.isCollapsed()))return cw;const a=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||mx(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return cw;if(a.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&ub(r)&&1===r.__text.length&&1===i.anchor.offset?dw:cw}const l=a[0],c=e._nodeMap.get(l.__key);if(!ub(c)||!ub(l)||c.__mode!==l.__mode)return cw;const u=c.__text,d=l.__text;if(u===d)return cw;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return cw;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?dw:-1===g&&m===p+1?fw:-1===g&&m===p?hw:cw}(o,i,a,l,e.isComposing()),f=(()=>{const f=null===s||s.editor===e,h=c.has("history-push");if(!h&&f&&c.has("history-merge"))return sw;if(null===o)return aw;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==cw&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?sw:aw:null!==p?sw:lw})();return n=u,r=d,f}}(e,n),o=Lx(e.registerCommand(Zp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Em,!0)),0===r.length&&e.dispatchCommand(Sm,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(Qp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(Sm,!0));const i=n.pop();0===n.length&&e.dispatchCommand(Em,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(xm,(()=>(pw(t),!1)),0),e.registerCommand(wm,(()=>(pw(t),e.dispatchCommand(Em,!1),e.dispatchCommand(Sm,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:s,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const f=r(o,n,l,i,s,a);if(f===aw)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Em,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Sm,!0));else if(f===lw)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function gw(e,t){return gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gw(e,t)}var vw={error:null},yw=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===i.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(o,r,l)}))}),[r,e,t,n]),null}function Ew({editorRef:e}){const[t]=zp();return o.useEffect((()=>{"function"==typeof e?e(t):"object"==typeof e&&(e.current=t)}),[t]),null}var Sw={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",lg:"py-2.5 px-3 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.6875rem]"},_w={sm:"p-1.5 rounded-md max-h-[10.75rem]",md:"p-2 rounded-lg max-h-[13.5rem]",lg:"p-2 rounded-lg max-h-[13.5rem]"},kw={sm:"p-1.5 rounded text-sm leading-5 font-normal",md:"p-2 rounded-md text-base leading-6 font-normal",lg:"p-2 rounded-md text-base leading-6 font-normal"};const Cw="startTransition",Pw="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,Tw=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function Ow(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{d(0)}),[f]);const h=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&l?function(e){const t=jb();if(!xb(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,i=r.getTextContent().slice(0,o),s=e.replaceableString.length,a=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(i,e.matchingString,s);if(a<0)return null;let l;return 0===a?[l]=r.splitText(o):[,l]=r.splitText(a,o),l}(r.match):null;a(n,t,e,r.match?r.match.matchingString:"")}))}),[t,l,r.match,a,e]),p=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),Pw((()=>{null===i?d(null):null===u&&p(0)}),[i,u,p]),(0,o.useEffect)((()=>Lx(t.registerCommand(Rw,(({option:e})=>!(!e.ref||null==e.ref.current||(Tw(e.ref.current),0))),c))),[t,p,c]),(0,o.useEffect)((()=>Lx(t.registerCommand(sm,(e=>{const n=e;if(null!==i&&i.length&&null!==u){const e=u!==i.length-1?u+1:0;p(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(Rw,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),c),t.registerCommand(im,(e=>{const t=e;if(null!==i&&i.length&&null!==u){const e=0!==u?u-1:i.length-1;p(e);const n=i[e];null!=n.ref&&n.ref.current&&Tw(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),t.registerCommand(um,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),c),t.registerCommand(fm,(e=>{const t=e;return null!==i&&null!==u&&null!=i[u]&&(t.preventDefault(),t.stopImmediatePropagation(),h(i[u]),!0)}),c),t.registerCommand(am,(e=>null!==i&&null!==u&&null!=i[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(i[u]),!0)),c))),[h,e,t,i,u,p,c]),s(n,(0,o.useMemo)((()=>({options:i,selectOptionAndCleanUp:h,selectedIndex:u,setHighlightedIndex:d})),[h,u,i]),r.match?r.match.matchingString:"")}function Aw({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:s,menuRenderFn:a,triggerFn:l,anchorClassName:c,commandPriority:u=kx,parent:d}){const[f]=zp(),[h,p]=(0,o.useState)(null),m=function(e,t,n,r=document.body){const[i]=zp(),s=(0,o.useRef)(document.createElement("div")),a=(0,o.useCallback)((()=>{s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),o=s.current,a=o.firstChild;if(null!==t&&null!==e){const{left:i,top:l,width:c,height:u}=e.getRect(),d=s.current.offsetHeight;if(o.style.top=`${l+window.pageYOffset+d+3}px`,o.style.left=`${i+window.pageXOffset}px`,o.style.height=`${u}px`,o.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,s=t.getBoundingClientRect();i+r>s.right&&(o.style.left=`${s.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>s.bottom)&&l-s.top>n+u&&(o.style.top=l-n+window.pageYOffset-u+"px")}o.isConnected||(null!=n&&(o.className=n),o.setAttribute("aria-label","Typeahead menu"),o.setAttribute("id","typeahead-menu"),o.setAttribute("role","listbox"),o.style.display="block",o.style.position="absolute",r.append(o)),s.current=o,t.setAttribute("aria-controls","typeahead-menu")}}),[i,e,n,r]);(0,o.useEffect)((()=>{const t=i.getRootElement();if(null!==e)return a(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&e.remove()}}),[i,a,e]);const l=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[i]=zp();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=i.getRootElement(),o=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let s=!1,a=Ow(t,o);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Ow(t,o);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,i,r,n,e])}(e,s.current,a,l),s}(h,p,c,d),g=(0,o.useCallback)((()=>{p(null),null!=s&&null!==h&&s()}),[s,h]),v=(0,o.useCallback)((e=>{p(e),null!=r&&null===h&&r(e)}),[r,h]);return(0,o.useEffect)((()=>{const e=f.registerUpdateListener((()=>{f.getEditorState().read((()=>{const e=f._window||window,n=e.document.createRange(),r=jb(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=jb();xb(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(f);if(!xb(r)||!r.isCollapsed()||null===o||null===n)return void g();const s=l(o,f);if(t(s?s.matchingString:null),null!==s&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=jb();if(xb(e)){const t=e.anchor.getNode().getPreviousSibling();return ub(t)&&t.isTextEntity()}return!1}))}(f,s.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,i=e,s=r.anchorOffset;if(null==o||null==s)return!1;try{t.setStart(o,i),t.setEnd(o,s)}catch(e){return!1}return!0}(s.leadOffset,n,e);if(null!==t)return a=()=>v({getRect:()=>n.getBoundingClientRect(),match:s}),void(Cw in i()?i()[Cw](a):a())}var a;g()}))}));return()=>{e()}}),[f,l,t,h,g,v]),null===h||null===f?null:(0,ou.jsx)(Nw,{close:g,resolution:h,editor:f,anchorElementRef:m,options:e,menuRenderFn:a,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:u})}function jw(e){return jw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jw(e)}function Mw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&void 0!==arguments[2]?arguments[2]:"name",r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eE(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eE(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,o.useState)([]),2),i=r[0],s=r[1];return(0,o.useEffect)((function(){if(null!==t){var r=tE.get(t);null!==r&&(void 0===r?(tE.set(t,null),nE(e,t,(function(e){tE.set(t,e),s(e)}),n)):s(r))}else s([])}),[t]),i},oE=["size","children","selected","className"];function iE(){return iE=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",p=[l].join(""),m="[^"+p+h+"\\s]",g="(?:\\.[ |$]| |["+h+"]|)",v=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m).concat(g,"){0,").concat(75,"}))$")),y=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m,"){0,").concat(50,"}))$")),b=lE(zp(),1)[0],x=lE((0,o.useState)(null),2),w=x[0],E=x[1],S=rE(t,w,r),_=(0,o.useCallback)((function(e,t,n){b.update((function(){var o=Hw(e.data,r,s);t&&t.replace(o),n()}))}),[b]),k=(0,o.useMemo)((function(){return S.map((function(e){return new Qw(e)}))}),[b,S]);return React.createElement(Aw,{onQueryChange:E,onSelectOption:_,triggerFn:function(e){var t=v.exec(e);if(null===t&&(t=y.exec(e)),null!==t){var n=t[1],r=t[3];if(r.length>=0)return{leadOffset:t.index+n.length,matchingString:r,replaceableString:t[2]}}return null},options:k,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,i=t.setHighlightedIndex;return e.current&&!(null==k||!k.length)&&React.createElement(u,{size:s},k.map((function(e,t){var a;return React.createElement(f,{key:t,ref:e.ref,size:s,selected:t===n,onMouseEnter:function(){i(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},dE={ltr:"ltr",rtl:"rtl",paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},list:{nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul",listitem:"editor-listItem",listitemChecked:"editor-listItemChecked",listitemUnchecked:"editor-listItemUnchecked"},hashtag:"editor-hashtag",image:"editor-image",link:"editor-link",text:{bold:"editor-textBold",code:"editor-textCode",italic:"editor-textItalic",strikethrough:"editor-textStrikethrough",subscript:"editor-textSubscript",superscript:"editor-textSuperscript",underline:"editor-textUnderline",underlineStrikethrough:"editor-textUnderlineStrikethrough"},code:"editor-code",codeHighlight:{atrule:"editor-tokenAttr",attr:"editor-tokenAttr",boolean:"editor-tokenProperty",builtin:"editor-tokenSelector",cdata:"editor-tokenComment",char:"editor-tokenSelector",class:"editor-tokenFunction","class-name":"editor-tokenFunction",comment:"editor-tokenComment",constant:"editor-tokenProperty",deleted:"editor-tokenProperty",doctype:"editor-tokenComment",entity:"editor-tokenOperator",function:"editor-tokenFunction",important:"editor-tokenVariable",inserted:"editor-tokenSelector",keyword:"editor-tokenAttr",namespace:"editor-tokenVariable",number:"editor-tokenProperty",operator:"editor-tokenOperator",prolog:"editor-tokenComment",property:"editor-tokenProperty",punctuation:"editor-tokenPunctuation",regex:"editor-tokenVariable",selector:"editor-tokenSelector",string:"editor-tokenSelector",symbol:"editor-tokenProperty",tag:"editor-tokenProperty",url:"editor-tokenOperator",variable:"editor-tokenVariable"}},fE=function(e){var t=e.content;return React.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-start text-field-placeholder"},t)};function hE(e){console.error(e)}var pE=function(e,t){var n,r,i=e.defaultValue,s=void 0===i?"":i,a=e.placeholder,l=void 0===a?"Press @ to view variable suggestions":a,c=e.onChange,u=e.size,d=void 0===u?"md":u,f=e.autoFocus,h=void 0!==f&&f,p=e.options,m=void 0===p?[]:p,g=e.by,v=void 0===g?"name":g,y=e.trigger,b=void 0===y?"@":y,x=e.menuComponent,w=e.menuItemComponent,E=e.className,S=e.disabled,_=void 0!==S&&S,k={namespace:"Editor",editorTheme:dE,onError:hE,nodes:[qw],editorState:s||'{\n "root": {\n "children": [\n {\n "children": [],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "paragraph",\n "version": 1,\n "textFormat": 0,\n "textStyle": ""\n }\n ],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "root",\n "version": 1\n }\n}',editable:!_};return(0,o.isValidElement)(x)&&(n=x),(0,o.isValidElement)(w)&&(r=w),React.createElement("div",{className:te("relative w-full","border border-solid focus-within:ring-2 focus-within:ring-offset-2 border-field-border hover:border-border-strong focus-within:!border-focus-border focus-within:ring-focus transition duration-150 ease-in-out",Sw[d],_&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(Nx,{initialConfig:k},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(Qx,{contentEditable:React.createElement(ow,{className:te("editor-content focus-visible:outline-none outline-none","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",E)}),placeholder:React.createElement(fE,{content:l}),ErrorBoundary:bw})),React.createElement(mw,null),React.createElement(uE,{menuComponent:n,menuItemComponent:r,size:d,by:v,optionsArray:m,trigger:b}),React.createElement(ww,{onChange:function(e,t){"function"==typeof c&&c(e,t)},ignoreSelectionChange:!0}),t&&React.createElement(Ew,{editorRef:t}),h&&React.createElement(Bp,null)))},mE=(0,o.forwardRef)(pE);mE.displayName="EditorInput";var gE=mE;const vE=xe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var yE=function(e,t){return te("rounded-full text-brand-primary-600 transition-colors duration-300",e[t].dot,e[t].ring)},bE=["variant","size","type","currentStep","children","className"],xE=["labelText","icon","stepClasses","isCurrent","isCompleted","className","type","variant","sizeClasses","size","isLast","index"];function wE(){return wE=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:size-4",md:"[&>svg]:size-5"})||void 0===n?void 0:n[g],b=function(){m(!p),u&&u(!p)};return i().createElement("div",null,i().createElement("div",{role:"button",tabIndex:"0",onClick:b,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||b()},className:te("text-text-primary bg-transparent cursor-pointer flex justify-between items-center p-1 gap-1",v,f),"aria-expanded":p},i().createElement("span",{className:"text-text-tertiary"},r),a&&i().createElement(Kf.span,{variants:{open:{rotate:180},closed:{rotate:0}},animate:p?"open":"closed",transition:{duration:.15},className:te("flex items-center text-border-strong",y)},i().createElement(Qf,null))),i().createElement(Kh,{initial:!1},p&&i().createElement(Kf.ul,{variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow-hidden flex gap-0.5 flex-col m-0 bg-white rounded-md p-0"},d)))},NE.Item=function(e){var t,n=e.disabled,r=void 0!==n&&n,o=e.active,s=e.onClick,a=e.children,l=e.className,c=RE().size,u=null===(t={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"})||void 0===t?void 0:t[c],d=r?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",f=o?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"";return i().createElement("li",{role:"menuitem",tabIndex:"0",onClick:s,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||s()},className:te("flex p-1 gap-1 items-center bg-transparent w-full border-none rounded text-text-secondary cursor-pointer m-0",u,"hover:bg-background-secondary hover:text-text-primary",d,f,"transition-colors duration-300 ease-in-out",l)},a)},NE.Separator=function(e){var t,n=e.variant,r=void 0===n?"solid":n,o=e.className,s=null===(t={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"})||void 0===t?void 0:t[r];return i().createElement(i().Fragment,null,i().createElement("hr",{className:te("w-full border-0 border-t border-border-subtle",s,o)}))};var AE=NE;const jE=xe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]),ME=xe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);var IE=["children","className","onCollapseChange","collapsible","screenHeight","borderOn"];function DE(){return DE=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:block h-full",n)},t)};var AS=NS;function jS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n { const handleScreenResize = () => { const isSmallScreen = window.innerWidth < 1280; - if ( isSmallScreen ) { + if ( ! collapsible ) { + setIsCollapsed( false ); + localStorage.removeItem( 'sidebar-collapsed' ); + } else if ( isSmallScreen ) { setIsCollapsed( true ); - - localStorage.setItem( 'sidebar-collapsed', JSON.stringify( true ) ); + localStorage.setItem( + 'sidebar-collapsed', + JSON.stringify( true ) + ); } else { - const storedState = localStorage.getItem( 'sidebar-collapsed' ); - setIsCollapsed( storedState ? JSON.parse( storedState ) : false ); + const storedState = + localStorage.getItem( 'sidebar-collapsed' ); + setIsCollapsed( + storedState ? JSON.parse( storedState ) : false + ); } if ( sideBarRef.current ) { @@ -62,7 +70,7 @@ const Sidebar = ( { return () => { window.removeEventListener( 'resize', handleScreenResize ); }; - }, [ screenHeight ] ); + }, [ screenHeight, collapsible ] ); return (