@zealicsolutions/web-ui 1.0.87-beta.15 → 1.0.87-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -9544,7 +9544,7 @@ var ot={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
9544
9544
  *
9545
9545
  * This source code is licensed under the ISC license.
9546
9546
  * See the LICENSE file in the root directory of this source tree.
9547
- */function At(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Rt(...e){return t=>{let r=!1;const n=e.map(e=>{const n=At(e,t);return!r&&"function"==typeof n&&(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():At(e[t],null)}}}}function Ft(...e){return a.useCallback(Rt(...e),e)}function Lt(e){const r=function(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(o.ref=t?Rt(t,e):e),a.cloneElement(r,o)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=a.forwardRef((e,n)=>{const{children:o,...i}=e,s=a.Children.toArray(o),l=s.find(qt);if(l){const e=l.props.children,o=s.map(t=>t===l?a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null:t);return t.jsx(r,{...i,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,o):null})}return t.jsx(r,{...i,ref:n,children:o})});return n.displayName=`${e}.Slot`,n}var Bt=Lt("Slot");var Vt=Symbol("radix.slottable");function It(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=Vt,r}function qt(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Vt}function Ht(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Ht(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function $t(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ht(e))&&(n&&(n+=" "),n+=t);return n}const Wt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Ut=$t,Yt=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Ut(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=Wt(t)||Wt(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return Ut(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},Zt=e=>{const t=Qt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Kt(r,t)||Xt(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},Kt=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?Kt(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(r=t.validators.find(({validator:e})=>e(i)))?void 0:r.classGroupId},Gt=/^\[(.+)\]$/,Xt=e=>{if(Gt.test(e)){const t=Gt.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Qt=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return rr(Object.entries(e.classGroups),r).forEach(([e,r])=>{Jt(r,n,e,t)}),n},Jt=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:er(t,e)).classGroupId=r)}if("function"==typeof e)return tr(e)?void Jt(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{Jt(o,er(t,e),r,n)})})},er=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},tr=e=>e.isThemeGetter,rr=(e,t)=>t?e.map(([e,r])=>{const n=r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e);return[e,n]}):e,nr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},or=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{const r=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===s){if(d===o&&(n||e.slice(c,c+a)===t)){r.push(e.slice(l,c)),l=c+a;continue}if("/"===d){i=c;continue}}"["===d?s++:"]"===d&&s--}const c=0===r.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:r,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i},ar=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},ir=/\s+/;function sr(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=lr(e))&&(n&&(n+=" "),n+=t);return n}const lr=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=lr(e[n]))&&(r&&(r+=" "),r+=t);return r};const cr=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},dr=/^\[(?:([a-z-]+):)?(.+)\]$/i,ur=/^\d+\/\d+$/,pr=new Set(["px","full","screen"]),hr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fr=/\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$/,mr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gr=e=>br(e)||pr.has(e)||ur.test(e),xr=e=>Nr(e,"length",zr),br=e=>!!e&&!Number.isNaN(Number(e)),kr=e=>Nr(e,"number",br),_r=e=>!!e&&Number.isInteger(Number(e)),wr=e=>e.endsWith("%")&&br(e.slice(0,-1)),Mr=e=>dr.test(e),Cr=e=>hr.test(e),Dr=new Set(["length","size","percentage"]),jr=e=>Nr(e,Dr,Ar),Or=e=>Nr(e,"position",Ar),Sr=new Set(["image","url"]),Pr=e=>Nr(e,Sr,Fr),Er=e=>Nr(e,"",Rr),Tr=()=>!0,Nr=(e,t,r)=>{const n=dr.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},zr=e=>fr.test(e)&&!mr.test(e),Ar=()=>!1,Rr=e=>vr.test(e),Fr=e=>yr.test(e),Lr=function(e,...t){let r,n,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:nr(e.cacheSize),parseClassName:or(e),...Zt(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(ir);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=r(t);let p=!!u,h=n(p?d.substring(0,u):d);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=n(d),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=ar(l).join(":"),m=c?f+"!":f,v=m+h;if(a.includes(v))continue;a.push(v);const y=o(h,p);for(let e=0;e<y.length;++e){const t=y[e];a.push(m+t)}s=t+(s.length>0?" "+s:s)}return s})(e,r);return o(e,a),a}return function(){return a(sr.apply(null,arguments))}}(()=>{const e=cr("colors"),t=cr("spacing"),r=cr("blur"),n=cr("brightness"),o=cr("borderColor"),a=cr("borderRadius"),i=cr("borderSpacing"),s=cr("borderWidth"),l=cr("contrast"),c=cr("grayscale"),d=cr("hueRotate"),u=cr("invert"),p=cr("gap"),h=cr("gradientColorStops"),f=cr("gradientColorStopPositions"),m=cr("inset"),v=cr("margin"),y=cr("opacity"),g=cr("padding"),x=cr("saturate"),b=cr("scale"),k=cr("sepia"),_=cr("skew"),w=cr("space"),M=cr("translate"),C=()=>["auto",Mr,t],D=()=>[Mr,t],j=()=>["",gr,xr],O=()=>["auto",br,Mr],S=()=>["","0",Mr],P=()=>[br,Mr];return{cacheSize:500,separator:":",theme:{colors:[Tr],spacing:[gr,xr],blur:["none","",Cr,Mr],brightness:P(),borderColor:[e],borderRadius:["none","","full",Cr,Mr],borderSpacing:D(),borderWidth:j(),contrast:P(),grayscale:S(),hueRotate:P(),invert:S(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[wr,xr],inset:C(),margin:C(),opacity:P(),padding:D(),saturate:P(),scale:P(),sepia:S(),skew:P(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Mr]}],container:["container"],columns:[{columns:[Cr]}],"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",Mr]}],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",_r,Mr]}],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",Mr]}],grow:[{grow:S()}],shrink:[{shrink:S()}],order:[{order:["first","last","none",_r,Mr]}],"grid-cols":[{"grid-cols":[Tr]}],"col-start-end":[{col:["auto",{span:["full",_r,Mr]},Mr]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[Tr]}],"row-start-end":[{row:["auto",{span:[_r,Mr]},Mr]}],"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",Mr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Mr]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"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:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Mr,t]}],"min-w":[{"min-w":[Mr,t,"min","max","fit"]}],"max-w":[{"max-w":[Mr,t,"none","full","min","max","fit","prose",{screen:[Cr]},Cr]}],h:[{h:[Mr,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Mr,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Mr,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Mr,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Cr,xr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",kr]}],"font-family":[{font:[Tr]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Mr]}],"line-clamp":[{"line-clamp":["none",br,kr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gr,Mr]}],"list-image":[{"list-image":["none",Mr]}],"list-style-type":[{list:["none","disc","decimal",Mr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"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",gr,xr]}],"underline-offset":[{"underline-offset":["auto",gr,Mr]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Mr]}],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",Mr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",Or]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Pr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"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-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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":[gr,Mr]}],"outline-w":[{outline:[gr,xr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[gr,xr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Cr,Er]}],"shadow-color":[{shadow:[Tr]}],opacity:[{opacity:[y]}],"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:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Cr,Mr]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Mr]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Mr]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Mr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[_r,Mr]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Mr]}],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",Mr]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Mr]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gr,xr,kr]}],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-s","border-color-e","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"]}}});function Br(...e){return Lr($t(e))}const Vr=Yt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ir=a.forwardRef(({className:e,variant:r,size:n,asChild:o=!1,...a},i)=>{const s=o?Bt:"button";return t.jsx(s,{className:Br(Vr({variant:r,size:n,className:e})),ref:i,...a})});Ir.displayName="Button";const qr=r.createContext({});function Hr(e){const t=r.useRef(null);return null===t.current&&(t.current=e()),t.current}const $r=r.createContext(null),Wr=r.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Ur extends a.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 Yr({children:e,isPresent:n}){const o=r.useId(),i=r.useRef(null),s=r.useRef({width:0,height:0,top:0,left:0}),{nonce:l}=r.useContext(Wr);return r.useInsertionEffect(()=>{const{width:e,height:t,top:r,left:a}=s.current;if(n||!i.current||!e||!t)return;i.current.dataset.motionPopId=o;const c=document.createElement("style");return l&&(c.nonce=l),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),t.jsx(Ur,{isPresent:n,childRef:i,sizeRef:s,children:a.cloneElement(e,{ref:i})})}const Zr=({children:e,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:l,mode:c})=>{const d=Hr(Kr),u=r.useId(),p=r.useCallback(e=>{d.set(e,!0);for(const e of d.values())if(!e)return;i&&i()},[d,i]),h=r.useMemo(()=>({id:u,initial:n,isPresent:o,custom:s,onExitComplete:p,register:e=>(d.set(e,!1),()=>d.delete(e))}),l?[Math.random(),p]:[o,p]);return r.useMemo(()=>{d.forEach((e,t)=>d.set(t,!1))},[o]),a.useEffect(()=>{!o&&!d.size&&i&&i()},[o]),"popLayout"===c&&(e=t.jsx(Yr,{isPresent:o,children:e})),t.jsx($r.Provider,{value:h,children:e})};function Kr(){return new Map}function Gr(e=!0){const t=r.useContext($r);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:a}=t,i=r.useId();r.useEffect(()=>{e&&a(i)},[e]);const s=r.useCallback(()=>e&&o&&o(i),[i,o,e]);return!n&&o?[!1,s]:[!0]}const Xr=e=>e.key||"";function Qr(e){const t=[];return r.Children.forEach(e,e=>{r.isValidElement(e)&&t.push(e)}),t}const Jr=typeof window<"u",en=Jr?r.useLayoutEffect:r.useEffect,tn=({children:e,custom:n,initial:o=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,d]=Gr(l),u=r.useMemo(()=>Qr(e),[e]),p=l&&!c?[]:u.map(Xr),h=r.useRef(!0),f=r.useRef(u),m=Hr(()=>new Map),[v,y]=r.useState(u),[g,x]=r.useState(u);en(()=>{h.current=!1,f.current=u;for(let e=0;e<g.length;e++){const t=Xr(g[e]);p.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}},[g,p.length,p.join("-")]);const b=[];if(u!==v){let e=[...u];for(let t=0;t<g.length;t++){const r=g[t],n=Xr(r);p.includes(n)||(e.splice(t,0,r),b.push(r))}return"wait"===s&&b.length&&(e=b),x(Qr(e)),void y(u)}"production"!==process.env.NODE_ENV&&"wait"===s&&g.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:k}=r.useContext(qr);return t.jsx(t.Fragment,{children:g.map(e=>{const r=Xr(e),v=!(l&&!c)&&(u===g||p.includes(r));return t.jsx(Zr,{isPresent:v,initial:!(h.current&&!o)&&void 0,custom:v?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:v?void 0:()=>{if(!m.has(r))return;m.set(r,!0);let e=!0;m.forEach(t=>{t||(e=!1)}),e&&(null==k||k(),x(f.current),l&&(null==d||d()),a&&a())},children:e},r)})})},rn=e=>e;let nn=rn,on=rn;function an(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(nn=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},on=(e,t)=>{if(!e)throw new Error(t)});const sn=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},ln=e=>1e3*e,cn=e=>e/1e3,dn=!1;const un=["read","resolveKeyframes","update","preRender","render","postRender"];function pn(e,t){let r=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=un.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&n?t:r;return o&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),a.delete(e)},process:e=>{i=e,n?o=!0:(n=!0,[t,r]=[r,t],t.forEach(s),t.clear(),n=!1,o&&(o=!1,l.process(e)))}};return l}(a),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=i,h=()=>{const a=performance.now();r=!1,o.delta=n?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),d.process(o),u.process(o),p.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))};return{schedule:un.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(r||(r=!0,n=!0,o.isProcessing||e(h)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<un.length;t++)i[un[t]].cancel(e)},state:o,steps:i}}const{schedule:hn,cancel:fn,state:mn,steps:vn}=pn(typeof requestAnimationFrame<"u"?requestAnimationFrame:rn,!0),yn=r.createContext({strict:!1}),gn={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"]},xn={};for(const e in gn)xn[e]={isEnabled:t=>gn[e].some(e=>!!t[e])};const bn=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 kn(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bn.has(e)}let _n=e=>!kn(e);try{!function(e){e&&(_n=t=>t.startsWith("on")?!kn(t):e(t))}(unt.default)}catch{}const wn=new Set;function Mn(e,t,r){e||wn.has(t)||(console.warn(t),wn.add(t))}const Cn=r.createContext({});function Dn(e){return"string"==typeof e||Array.isArray(e)}function jn(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const On=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...On];function Pn(e){return jn(e.animate)||Sn.some(t=>Dn(e[t]))}function En(e){return!(!Pn(e)&&!e.variants)}function Tn(e){const{initial:t,animate:n}=function(e,t){if(Pn(e)){const{initial:t,animate:r}=e;return{initial:!1===t||Dn(t)?t:void 0,animate:Dn(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,r.useContext(Cn));return r.useMemo(()=>({initial:t,animate:n}),[Nn(t),Nn(n)])}function Nn(e){return Array.isArray(e)?e.join(" "):e}const zn=Symbol.for("motionComponentSymbol");function An(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Rn(e,t,n){return r.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):An(n)&&(n.current=r))},[t])}const Fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ln="data-"+Fn("framerAppearId"),{schedule:Bn}=pn(queueMicrotask,!1),Vn=r.createContext({});function In(e,t,n,o,a){var i,s;const{visualElement:l}=r.useContext(Cn),c=r.useContext(yn),d=r.useContext($r),u=r.useContext(Wr).reducedMotion,p=r.useRef(null);o=o||c.renderer,!p.current&&o&&(p.current=o(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:u}));const h=p.current,f=r.useContext(Vn);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,r,n){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:qn(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&An(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}(p.current,n,a,f);const m=r.useRef(!1);r.useInsertionEffect(()=>{h&&m.current&&h.update(n,d)});const v=n[Ln],y=r.useRef(!!v&&!(null!==(i=window.MotionHandoffIsComplete)&&void 0!==i&&i.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return en(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Bn.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),r.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),y.current=!1))}),h}function qn(e){if(e)return!1!==e.options.allowProjection?e.projection:qn(e.parent)}function Hn({preloadedFeatures:e,createVisualElement:n,useRender:o,useVisualState:a,Component:i}){var s,l;function c(s,l){let c;const d={...r.useContext(Wr),...s,layoutId:$n(s)},{isStatic:u}=d,p=Tn(s),h=a(s,u);if(!u&&Jr){!function(e,t){const n=r.useContext(yn).strict;if("production"!==process.env.NODE_ENV&&t&&n){const t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?nn(!1,t):on(!1,t)}}(d,e);const t=function(e){const{drag:t,layout:r}=xn;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:null!=t&&t.isEnabled(e)||null!=r&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(d);c=t.MeasureLayout,p.visualElement=In(i,h,d,n,t.ProjectionNode)}return t.jsxs(Cn.Provider,{value:p,children:[c&&p.visualElement?t.jsx(c,{visualElement:p.visualElement,...d}):null,o(i,s,Rn(h,p.visualElement,l),h,u,p.visualElement)]})}e&&function(e){for(const t in e)xn[t]={...xn[t],...e[t]}}(e),c.displayName=`motion.${"string"==typeof i?i:`create(${null!==(l=null!==(s=i.displayName)&&void 0!==s?s:i.name)&&void 0!==l?l:""})`}`;const d=r.forwardRef(c);return d[zn]=i,d}function $n({layoutId:e}){const t=r.useContext(qr).id;return t&&void 0!==e?t+"-"+e:e}const Wn=["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 Un(e){return"string"==typeof e&&!e.includes("-")&&!!(Wn.indexOf(e)>-1||/[A-Z]/u.test(e))}function Yn(e){const t=[{},{}];return null==e||e.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function Zn(e,t,r,n){if("function"==typeof t){const[o,a]=Yn(n);t=t(void 0!==r?r:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=Yn(n);t=t(void 0!==r?r:e.custom,o,a)}return t}const Kn=e=>Array.isArray(e),Gn=e=>Kn(e)?e[e.length-1]||0:e,Xn=e=>!(!e||!e.getVelocity);function Qn(e){const t=Xn(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Jn=e=>(t,n)=>{const o=r.useContext(Cn),a=r.useContext($r),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},n,o,a){const i={latestValues:eo(n,o,a,e),renderState:t()};return r&&(i.onMount=e=>r({props:n,current:e,...i}),i.onUpdate=e=>r(e)),i}(e,t,o,a);return n?i():Hr(i)};function eo(e,t,r,n){const o={},a=n(e,{});for(const e in a)o[e]=Qn(a[e]);let{initial:i,animate:s}=e;const l=Pn(e),c=En(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let d=!!r&&!1===r.initial;d=d||!1===i;const u=d?s:i;if(u&&"boolean"!=typeof u&&!jn(u)){const t=Array.isArray(u)?u:[u];for(let r=0;r<t.length;r++){const n=Zn(e,t[r]);if(n){const{transitionEnd:e,transition:t,...r}=n;for(const e in r){let t=r[e];if(Array.isArray(t)){t=t[d?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const to=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ro=new Set(to),no=e=>t=>"string"==typeof t&&t.startsWith(e),oo=no("--"),ao=no("var(--"),io=e=>!!ao(e)&&so.test(e.split("/*")[0].trim()),so=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,lo=(e,t)=>t&&"number"==typeof e?t.transform(e):e,co=(e,t,r)=>r>t?t:r<e?e:r,uo={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},po={...uo,transform:e=>co(0,1,e)},ho={...uo,default:1},fo=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),mo=fo("deg"),vo=fo("%"),yo=fo("px"),go=fo("vh"),xo=fo("vw"),bo={...vo,parse:e=>vo.parse(e)/100,transform:e=>vo.transform(100*e)},ko={borderWidth:yo,borderTopWidth:yo,borderRightWidth:yo,borderBottomWidth:yo,borderLeftWidth:yo,borderRadius:yo,radius:yo,borderTopLeftRadius:yo,borderTopRightRadius:yo,borderBottomRightRadius:yo,borderBottomLeftRadius:yo,width:yo,maxWidth:yo,height:yo,maxHeight:yo,top:yo,right:yo,bottom:yo,left:yo,padding:yo,paddingTop:yo,paddingRight:yo,paddingBottom:yo,paddingLeft:yo,margin:yo,marginTop:yo,marginRight:yo,marginBottom:yo,marginLeft:yo,backgroundPositionX:yo,backgroundPositionY:yo},_o={rotate:mo,rotateX:mo,rotateY:mo,rotateZ:mo,scale:ho,scaleX:ho,scaleY:ho,scaleZ:ho,skew:mo,skewX:mo,skewY:mo,distance:yo,translateX:yo,translateY:yo,translateZ:yo,x:yo,y:yo,z:yo,perspective:yo,transformPerspective:yo,opacity:po,originX:bo,originY:bo,originZ:yo},wo={...uo,transform:Math.round},Mo={...ko,..._o,zIndex:wo,size:yo,fillOpacity:po,strokeOpacity:po,numOctaves:wo},Co={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Do=to.length;function jo(e,t,r){const{style:n,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const r=t[e];if(ro.has(e))i=!0;else if(oo(e))o[e]=r;else{const t=lo(r,Mo[e]);e.startsWith("origin")?(s=!0,a[e]=t):n[e]=t}}if(t.transform||(i||r?n.transform=function(e,t,r){let n="",o=!0;for(let a=0;a<Do;a++){const i=to[a],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||r){const e=lo(s,Mo[i]);l||(o=!1,n+=`${Co[i]||i}(${e}) `),r&&(t[i]=e)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:r=0}=a;n.transformOrigin=`${e} ${t} ${r}`}}const Oo={offset:"stroke-dashoffset",array:"stroke-dasharray"},So={offset:"strokeDashoffset",array:"strokeDasharray"};function Po(e,t,r){return"string"==typeof e?e:yo.transform(t+r*e)}function Eo(e,{attrX:t,attrY:r,attrScale:n,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},d,u){if(jo(e,c,u),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:f}=e;p.transform&&(f&&(h.transform=p.transform),delete p.transform),f&&(void 0!==o||void 0!==a||h.transform)&&(h.transformOrigin=function(e,t,r){return`${Po(t,e.x,e.width)} ${Po(r,e.y,e.height)}`}(f,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(p.x=t),void 0!==r&&(p.y=r),void 0!==n&&(p.scale=n),void 0!==i&&function(e,t,r=1,n=0,o=!0){e.pathLength=1;const a=o?Oo:So;e[a.offset]=yo.transform(-n);const i=yo.transform(t),s=yo.transform(r);e[a.array]=`${i} ${s}`}(p,i,s,l,!1)}const To=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),No=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),zo=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ao(e,{style:t,vars:r},n,o){Object.assign(e.style,t,o&&o.getProjectionStyles(n));for(const t in r)e.style.setProperty(t,r[t])}const Ro=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 Fo(e,t,r,n){Ao(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(Ro.has(r)?r:Fn(r),t.attrs[r])}const Lo={};function Bo(e,{layout:t,layoutId:r}){return ro.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!Lo[e]||"opacity"===e)}function Vo(e,t,r){var n;const{style:o}=e,a={};for(const i in o)(Xn(o[i])||t.style&&Xn(t.style[i])||Bo(i,e)||void 0!==(null===(n=null==r?void 0:r.getValue(i))||void 0===n?void 0:n.liveStyle))&&(a[i]=o[i]);return a}function Io(e,t,r){const n=Vo(e,t,r);for(const r in e)if(Xn(e[r])||Xn(t[r])){n[-1!==to.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}const qo=["x","y","width","height","cx","cy","r"],Ho={useVisualState:Jn({scrapeMotionValuesFromProps:Io,createRenderState:No,onUpdate:({props:e,prevProps:t,current:r,renderState:n,latestValues:o})=>{if(!r)return;let a=!!e.drag;if(!a)for(const e in o)if(ro.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let r=0;r<qo.length;r++){const n=qo[r];e[n]!==t[n]&&(i=!0)}i&&hn.read(()=>{(function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}})(r,n),hn.render(()=>{Eo(n,o,zo(r.tagName),e.transformTemplate),Fo(r,n)})})}})},$o={useVisualState:Jn({scrapeMotionValuesFromProps:Vo,createRenderState:To})};function Wo(e,t,r){for(const n in t)!Xn(t[n])&&!Bo(n,r)&&(e[n]=t[n])}function Uo(e,t){const n={};return Wo(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return r.useMemo(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return jo(r,t,e),Object.assign({},r.vars,r.style)},[t])}(e,t)),n}function Yo(e,t){const r={},n=Uo(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}function Zo(e,t,n,o){const a=r.useMemo(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Eo(r,t,zo(o),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const t={};Wo(t,e.style,e),a.style={...t,...a.style}}return a}function Ko(e=!1){return(t,n,o,{latestValues:a},i)=>{const s=(Un(t)?Zo:Yo)(n,a,i,t),l=function(e,t,r){const n={};for(const o in e)"values"===o&&"object"==typeof e.values||(_n(o)||!0===r&&kn(o)||!t&&!kn(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}(n,"string"==typeof t,e),c=t!==r.Fragment?{...l,...s,ref:o}:{},{children:d}=n,u=r.useMemo(()=>Xn(d)?d.get():d,[d]);return r.createElement(t,{...c,children:u})}}function Go(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Xo(e,t,r){const n=e.getProps();return Zn(n,t,void 0!==r?r:n.custom,e)}const Qo=an(()=>void 0!==window.ScrollTimeline);class Jo{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=t}attachTimeline(e,t){const r=this.animations.map(r=>Qo()&&r.attachTimeline?r.attachTimeline(e):"function"==typeof t?t(r):void 0);return()=>{r.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;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ea extends Jo{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function ta(e,t){return e?e[t]||e.default||e:void 0}const ra=2e4;function na(e){let t=0;let r=e.next(t);for(;!r.done&&t<ra;)t+=50,r=e.next(t);return t>=ra?1/0:t}function oa(e){return"function"==typeof e}function aa(e,t){e.timeline=t,e.onfinish=null}const ia=e=>Array.isArray(e)&&"number"==typeof e[0],sa={linearEasing:void 0};const la=function(e,t){const r=an(e);return()=>{var e;return null!==(e=sa[t])&&void 0!==e?e:r()}}(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ca=(e,t,r=10)=>{let n="";const o=Math.max(Math.round(t/r),2);for(let t=0;t<o;t++)n+=e(sn(0,o-1,t))+", ";return`linear(${n.substring(0,n.length-2)})`};function da(e){return!!("function"==typeof e&&la()||!e||"string"==typeof e&&(e in pa||la())||ia(e)||Array.isArray(e)&&e.every(da))}const ua=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,pa={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ua([0,.65,.55,1]),circOut:ua([.55,0,1,.45]),backIn:ua([.31,.01,.66,-.59]),backOut:ua([.33,1.53,.69,.99])};function ha(e,t){if(e)return"function"==typeof e&&la()?ca(e,t):ia(e)?ua(e):Array.isArray(e)?e.map(e=>ha(e,t)||pa.easeOut):pa[e]}const fa={x:!1,y:!1};function ma(){return fa.x||fa.y}function va(e,t){const r=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function ya(e){return t=>{"touch"===t.pointerType||ma()||e(t)}}const ga=(e,t)=>!!t&&(e===t||ga(e,t.parentElement)),xa=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,ba=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ka=new WeakSet;function _a(e){return t=>{"Enter"===t.key&&e(t)}}function wa(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Ma(e){return xa(e)&&!ma()}function Ca(e,t,r={}){const[n,o,a]=va(e,r),i=e=>{const n=e.currentTarget;if(!Ma(e)||ka.has(n))return;ka.add(n);const a=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Ma(e)&&ka.has(n)&&(ka.delete(n),"function"==typeof a&&a(e,{success:t}))},s=e=>{i(e,r.useGlobalTarget||ga(n,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return n.forEach(e=>{!function(e){return ba.has(e.tagName)||-1!==e.tabIndex}(e)&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(r.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),e.addEventListener("focus",e=>((e,t)=>{const r=e.currentTarget;if(!r)return;const n=_a(()=>{if(ka.has(r))return;wa(r,"down");const e=_a(()=>{wa(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>wa(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,o),o)}),a}const Da=new Set(["width","height","top","left","right","bottom",...to]);let ja;function Oa(){ja=void 0}const Sa={now:()=>(void 0===ja&&Sa.set(mn.isProcessing||dn?mn.timestamp:performance.now()),ja),set:e=>{ja=e,queueMicrotask(Oa)}};function Pa(e,t){-1===e.indexOf(t)&&e.push(t)}function Ea(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class Ta{constructor(){this.subscriptions=[]}add(e){return Pa(this.subscriptions,e),()=>Ea(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let o=0;o<n;o++){const n=this.subscriptions[o];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Na(e,t){return t?e*(1e3/t):0}class za{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const r=Sa.now();this.updatedAt!==r&&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){this.current=e,this.updatedAt=Sa.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&Mn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Ta);const r=this.events[e].add(t);return"change"===e?()=>{r(),hn.read(()=>{this.events.change.getSize()||this.stop()})}:r}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,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}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 this.current}getPrevious(){return this.prev}getVelocity(){const e=Sa.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Na(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 Aa(e,t){return new za(e,t)}function Ra(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Aa(r))}function Fa(e,t){const r=e.getValue("willChange");if(function(e){return!(!Xn(e)||!e.add)}(r))return r.add(t)}function La(e){return e.props[Ln]}const Ba=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function Va(e,t,r,n){if(e===t&&r===n)return rn;const o=t=>function(e,t,r,n,o){let a,i,s=0;do{i=t+(r-t)/2,a=Ba(i,n,o)-e,a>0?r=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,r);return e=>0===e||1===e?e:Ba(o(e),t,n)}const Ia=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qa=e=>t=>1-e(1-t),Ha=Va(.33,1.53,.69,.99),$a=qa(Ha),Wa=Ia($a),Ua=e=>(e*=2)<1?.5*$a(e):.5*(2-Math.pow(2,-10*(e-1))),Ya=e=>1-Math.sin(Math.acos(e)),Za=qa(Ya),Ka=Ia(Ya),Ga=e=>/^0[^.\s]+$/u.test(e);function Xa(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Ga(e))}const Qa=e=>Math.round(1e5*e)/1e5,Ja=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ei=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ti=(e,t)=>r=>!!("string"==typeof r&&ei.test(r)&&r.startsWith(e)||t&&!function(e){return null==e}(r)&&Object.prototype.hasOwnProperty.call(r,t)),ri=(e,t,r)=>n=>{if("string"!=typeof n)return n;const[o,a,i,s]=n.match(Ja);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},ni={...uo,transform:e=>Math.round((e=>co(0,255,e))(e))},oi={test:ti("rgb","red"),parse:ri("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ni.transform(e)+", "+ni.transform(t)+", "+ni.transform(r)+", "+Qa(po.transform(n))+")"};const ai={test:ti("#"),parse:function(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}},transform:oi.transform},ii={test:ti("hsl","hue"),parse:ri("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+vo.transform(Qa(t))+", "+vo.transform(Qa(r))+", "+Qa(po.transform(n))+")"},si={test:e=>oi.test(e)||ai.test(e)||ii.test(e),parse:e=>oi.test(e)?oi.parse(e):ii.test(e)?ii.parse(e):ai.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?oi.transform(e):ii.transform(e)},li=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ci="number",di="color",ui=/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 pi(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(ui,e=>(si.test(e)?(n.color.push(a),o.push(di),r.push(si.parse(e))):e.startsWith("var(")?(n.var.push(a),o.push("var"),r.push(e)):(n.number.push(a),o.push(ci),r.push(parseFloat(e))),++a,"${}")).split("${}");return{values:r,split:i,indexes:n,types:o}}function hi(e){return pi(e).values}function fi(e){const{split:t,types:r}=pi(e),n=t.length;return e=>{let o="";for(let a=0;a<n;a++)if(o+=t[a],void 0!==e[a]){const t=r[a];o+=t===ci?Qa(e[a]):t===di?si.transform(e[a]):e[a]}return o}}const mi=e=>"number"==typeof e?0:e;const vi={test:function(e){var t,r;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Ja))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(li))||void 0===r?void 0:r.length)||0)>0},parse:hi,createTransformer:fi,getAnimatableNone:function(e){const t=hi(e);return fi(e)(t.map(mi))}},yi=new Set(["brightness","contrast","saturate","opacity"]);function gi(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(Ja)||[];if(!n)return e;const o=r.replace(n,"");let a=yi.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const xi=/\b([a-z-]*)\(.*?\)/gu,bi={...vi,getAnimatableNone:e=>{const t=e.match(xi);return t?t.map(gi).join(" "):e}},ki={...Mo,color:si,backgroundColor:si,outlineColor:si,fill:si,stroke:si,borderColor:si,borderTopColor:si,borderRightColor:si,borderBottomColor:si,borderLeftColor:si,filter:bi,WebkitFilter:bi},_i=e=>ki[e];function wi(e,t){let r=_i(e);return r!==bi&&(r=vi),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const Mi=new Set(["auto","none","0"]);const Ci=e=>e===uo||e===yo,Di=(e,t)=>parseFloat(e.split(", ")[t]),ji=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const o=n.match(/^matrix3d\((.+)\)$/u);if(o)return Di(o[1],t);{const t=n.match(/^matrix\((.+)\)$/u);return t?Di(t[1],e):0}},Oi=new Set(["x","y","z"]),Si=to.filter(e=>!Oi.has(e));const Pi={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),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:ji(4,13),y:ji(5,14)};Pi.translateX=Pi.x,Pi.translateY=Pi.y;const Ei=new Set;let Ti=!1,Ni=!1;function zi(){if(Ni){const e=Array.from(Ei).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{const t=function(e){const t=[];return Si.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=r.get(e);t&&t.forEach(([t,r])=>{var n;null===(n=e.getValue(t))||void 0===n||n.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Ni=!1,Ti=!1,Ei.forEach(e=>e.complete()),Ei.clear()}function Ai(){Ei.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ni=!0)})}class Ri{constructor(e,t,r,n,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ei.add(this),Ti||(Ti=!0,hn.read(Ai),hn.resolveKeyframes(zi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==n?void 0:n.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(r&&t){const n=r.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===o&&n.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ei.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ei.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Fi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Li=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bi(e,t,r=1){on(r<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[n,o]=function(e){const t=Li.exec(e);if(!t)return[,];const[,r,n,o]=t;return[`--${r??n}`,o]}(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const e=a.trim();return Fi(e)?parseFloat(e):e}return io(o)?Bi(o,t,r+1):o}const Vi=e=>t=>t.test(e),Ii=[uo,yo,vo,mo,xo,go,{test:e=>"auto"===e,parse:e=>e}],qi=e=>Ii.find(Vi(e));class Hi extends Ri{constructor(e,t,r,n,o){super(e,t,r,n,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&(n=n.trim(),io(n))){const o=Bi(n,t.current);void 0!==o&&(e[r]=o),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Da.has(r)||2!==e.length)return;const[n,o]=e,a=qi(n),i=qi(o);if(a!==i)if(Ci(a)&&Ci(i))for(let t=0;t<e.length;t++){const r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)Xa(e[t])&&r.push(t);r.length&&function(e,t,r){let n,o=0;for(;o<e.length&&!n;){const t=e[o];"string"==typeof t&&!Mi.has(t)&&pi(t).values.length&&(n=e[o]),o++}if(n&&r)for(const o of t)e[o]=wi(r,n)}(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pi[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){var e;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);const a=n.length-1,i=n[a];n[a]=Pi[r](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),!(null===(e=this.removedTransforms)||void 0===e)&&e.length&&this.removedTransforms.forEach(([e,r])=>{t.getValue(e).set(r)}),this.resolveNoneKeyframes()}}const $i=(e,t)=>"zIndex"!==t&&!("number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!vi.test(e)&&"0"!==e||e.startsWith("url(")));const Wi=e=>null!==e;function Ui(e,{repeat:t,repeatType:r="loop"},n){const o=e.filter(Wi),a=t&&"loop"!==r&&t%2==1?0:o.length-1;return a&&void 0!==n?n:o[a]}class Yi{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Sa.now(),this.options={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:o,repeatType:a,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&(Ai(),zi()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Sa.now(),this.hasAttemptedResolve=!0;const{name:r,type:n,velocity:o,delay:a,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!function(e,t,r,n){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=$i(o,t),s=$i(a,t);return nn(i===s,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||oa(r))&&n)}(e,r,n,o)){if(!a)return s&&s(Ui(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Zi=(e,t,r)=>e+(t-e)*r;function Ki(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Gi(e,t){return r=>r>0?t:e}const Xi=(e,t,r)=>{const n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},Qi=[ai,oi,ii];function Ji(e){const t=(e=>Qi.find(t=>t.test(e)))(e);if(nn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===ii&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let o=0,a=0,i=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;o=Ki(s,n,e+1/3),a=Ki(s,n,e),i=Ki(s,n,e-1/3)}else o=a=i=r;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:n}}(r)),r}const es=(e,t)=>{const r=Ji(e),n=Ji(t);if(!r||!n)return Gi(e,t);const o={...r};return e=>(o.red=Xi(r.red,n.red,e),o.green=Xi(r.green,n.green,e),o.blue=Xi(r.blue,n.blue,e),o.alpha=Zi(r.alpha,n.alpha,e),oi.transform(o))},ts=(e,t)=>r=>t(e(r)),rs=(...e)=>e.reduce(ts),ns=new Set(["none","hidden"]);function os(e,t){return r=>Zi(e,t,r)}function as(e){return"number"==typeof e?os:"string"==typeof e?io(e)?Gi:si.test(e)?es:ls:Array.isArray(e)?is:"object"==typeof e?si.test(e)?es:ss:Gi}function is(e,t){const r=[...e],n=r.length,o=e.map((e,r)=>as(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=o[t](e);return r}}function ss(e,t){const r={...e,...t},n={};for(const o in r)void 0!==e[o]&&void 0!==t[o]&&(n[o]=as(e[o])(e[o],t[o]));return e=>{for(const t in n)r[t]=n[t](e);return r}}const ls=(e,t)=>{const r=vi.createTransformer(t),n=pi(e),o=pi(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?ns.has(e)&&!o.values.length||ns.has(t)&&!n.values.length?function(e,t){return ns.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}(e,t):rs(is(function(e,t){var r;const n=[],o={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][o[i]],l=null!==(r=e.values[s])&&void 0!==r?r:0;n[a]=l,o[i]++}return n}(n,o),o.values),r):(nn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Gi(e,t))};function cs(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?Zi(e,t,r):as(e)(e,t)}function ds(e,t,r){const n=Math.max(t-5,0);return Na(r-e(n),t-n)}const us=100,ps=10,hs=1,fs=0,ms=800,vs=.3,ys=.3,gs={granular:.01,default:2},xs={granular:.005,default:.5},bs=.01,ks=10,_s=.05,ws=1,Ms=.001;function Cs({duration:e=ms,bounce:t=vs,velocity:r=fs,mass:n=hs}){let o,a;nn(e<=ln(ks),"Spring duration must be 10 seconds or less");let i=1-t;i=co(_s,ws,i),e=co(bs,ks,cn(e)),i<1?(o=t=>{const n=t*i,o=n*e,a=n-r,s=js(t,i),l=Math.exp(-o);return Ms-a/s*l},a=t=>{const n=t*i*e,a=n*r+r,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=js(Math.pow(t,2),i);return(-o(t)+Ms>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-r)*e+1)-Ms,a=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let r=1;r<Ds;r++)n-=e(n)/t(n);return n}(o,a,5/e);if(e=ln(e),isNaN(s))return{stiffness:us,damping:ps,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*i*Math.sqrt(n*t),duration:e}}}const Ds=12;function js(e,t){return e*Math.sqrt(1-t*t)}const Os=["duration","bounce"],Ss=["stiffness","damping","mass"];function Ps(e,t){return t.some(t=>void 0!==e[t])}function Es(e=ys,t=vs){const r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:o}=r;const a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:d,duration:u,velocity:p,isResolvedFromDuration:h}=function(e){let t={velocity:fs,stiffness:us,damping:ps,mass:hs,isResolvedFromDuration:!1,...e};if(!Ps(e,Ss)&&Ps(e,Os))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(1.2*r),o=n*n,a=2*co(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:hs,stiffness:o,damping:a}}else{const r=Cs(e);t={...t,...r,mass:hs},t.isResolvedFromDuration=!0}return t}({...r,velocity:-cn(r.velocity||0)}),f=p||0,m=c/(2*Math.sqrt(l*d)),v=i-a,y=cn(Math.sqrt(l/d)),g=Math.abs(v)<5;let x;if(n||(n=g?gs.granular:gs.default),o||(o=g?xs.granular:xs.default),m<1){const e=js(y,m);x=t=>{const r=Math.exp(-m*y*t);return i-r*((f+m*y*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}}else if(1===m)x=e=>i-Math.exp(-y*e)*(v+(f+y*v)*e);else{const e=y*Math.sqrt(m*m-1);x=t=>{const r=Math.exp(-m*y*t),n=Math.min(e*t,300);return i-r*((f+m*y*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}const b={calculatedDuration:h&&u||null,next:e=>{const t=x(e);if(h)s.done=e>=u;else{let r=0;m<1&&(r=0===e?ln(f):ds(x,e,t));const a=Math.abs(r)<=n,l=Math.abs(i-t)<=o;s.done=a&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(na(b),ra),t=ca(t=>b.next(e*t).value,e,30);return e+"ms "+t}};return b}function Ts({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],p={done:!1,value:u},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=r*t;const m=u+f,v=void 0===i?m:i(m);v!==m&&(f=v-u);const y=e=>-f*Math.exp(-e/n),g=e=>v+y(e),x=e=>{const t=y(e),r=g(e);p.done=Math.abs(t)<=c,p.value=p.done?v:r};let b,k;const _=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(p.value)&&(b=e,k=Es({keyframes:[p.value,h(p.value)],velocity:ds(g,e,p.value),damping:o,stiffness:a,restDelta:c,restSpeed:d}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return!k&&void 0===b&&(t=!0,x(e),_(e)),void 0!==b&&e>=b?k.next(e-b):(!t&&x(e),p)}}}const Ns=Va(.42,0,1,1),zs=Va(0,0,.58,1),As=Va(.42,0,.58,1),Rs={linear:rn,easeIn:Ns,easeInOut:As,easeOut:zs,circIn:Ya,circInOut:Ka,circOut:Za,backIn:$a,backInOut:Wa,backOut:Ha,anticipate:Ua},Fs=e=>{if(ia(e)){on(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,r,n,o]=e;return Va(t,r,n,o)}return"string"==typeof e?(on(void 0!==Rs[e],`Invalid easing type '${e}'`),Rs[e]):e};function Ls(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;if(on(a===t.length,"Both input and output ranges must be the same length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,r){const n=[],o=r||cs,a=e.length-1;for(let r=0;r<a;r++){let a=o(e[r],e[r+1]);if(t){const e=Array.isArray(t)?t[r]||rn:t;a=rs(e,a)}n.push(a)}return n}(t,n,o),l=s.length,c=r=>{if(i&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);const o=sn(e[n],e[n+1],r);return s[n](o)};return r?t=>c(co(e[0],e[a-1],t)):c}function Bs(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=sn(0,t,n);e.push(Zi(r,1,o))}}(t,e.length-1),t}function Vs(e,t){return e.map(()=>t||As).splice(0,e.length-1)}function Is({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(Fs):Fs(n),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:Bs(t),e),s=Ls(i,t,{ease:Array.isArray(o)?o:Vs(t,o)});return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const qs=e=>{const t=({timestamp:t})=>e(t);return{start:()=>hn.update(t,!0),stop:()=>fn(t),now:()=>mn.isProcessing?mn.timestamp:Sa.now()}},Hs={decay:Ts,inertia:Ts,tween:Is,keyframes:Is,spring:Es},$s=e=>e/100;class Ws extends Yi{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:r,element:n,keyframes:o}=this.options,a=(null==n?void 0:n.KeyframeResolver)||Ri;this.resolver=new a(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:o,velocity:a=0}=this.options,i=oa(t)?t:Hs[t]||Is;let s,l;i!==Is&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&on(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),s=rs($s,cs(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===c.calculatedDuration&&(c.calculatedDuration=na(c));const{calculatedDuration:d}=c,u=d+n;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:d,resolvedDuration:u,totalDuration:u*(r+1)-n}}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:r}=this;if(!r){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:n,generator:o,mirroredGenerator:a,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:d}=r;if(null===this.startTime)return o.next(0);const{delay:u,repeat:p,repeatType:h,repeatDelay:f,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 v=this.currentTime-u*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let g=this.currentTime,x=o;if(p){const e=Math.min(this.currentTime,c)/d;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,p+1),!!(t%2)&&("reverse"===h?(r=1-r,f&&(r-=f/d)):"mirror"===h&&(x=a)),g=co(0,1,r)*d}const b=y?{done:!1,value:s[0]}:x.next(g);i&&(b.value=i(b.value));let{done:k}=b;!y&&null!==l&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&k);return _&&void 0!==n&&(b.value=Ui(s,this.options,n)),m&&m(b.value),_&&this.finish(),b}get duration(){const{resolved:e}=this;return e?cn(e.calculatedDuration):0}get time(){return cn(this.currentTime)}set time(e){e=ln(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=cn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=qs,onPlay:t,startTime:r}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=r??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 Us=new Set(["opacity","clipPath","filter","transform"]);function Ys(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:r};l&&(c.offset=l);const d=ha(s,o);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:n,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"})}const Zs=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Ks={anticipate:Ua,backInOut:Wa,circInOut:Ka};class Gs extends Yi{constructor(e){super(e);const{name:t,motionValue:r,element:n,keyframes:o}=this.options;this.resolver=new Hi(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:r=300,times:n,ease:o,type:a,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&la()&&function(e){return e in Ks}(o)&&(o=Ks[o]),function(e){return oa(e.type)||"spring"===e.type||!da(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,d=function(e,t){const r=new Ws({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const o=[];let a=0;for(;!n.done&&a<2e4;)n=r.sample(a),o.push(n.value),a+=10;return{times:void 0,keyframes:o,duration:a-10,ease:"linear"}}(e,c);1===(e=d.keyframes).length&&(e[1]=e[0]),r=d.duration,n=d.times,o=d.ease,a="keyframes"}const c=Ys(i.owner.current,s,e,{...this.options,duration:r,times:n,ease:o});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(aa(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:r}=this.options;i.set(Ui(e,this.options,t)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:n,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return cn(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return cn(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.currentTime=ln(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:r}=t;r.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 rn;const{animation:r}=t;aa(r,e)}else this.pendingTimeline=e;return rn}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:r,duration:n,type:o,ease:a,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,d=new Ws({...c,keyframes:r,duration:n,type:o,ease:a,times:i,isGenerator:!0}),u=ln(this.time);e.setWithVelocity(d.sample(u-10).value,d.sample(u).value,10)}const{onStop:s}=this.options;s&&s(),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:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return Zs()&&r&&Us.has(r)&&!s&&!l&&!n&&"mirror"!==o&&0!==a&&"inertia"!==i}}const Xs={type:"spring",stiffness:500,damping:25,restSpeed:10},Qs={type:"keyframes",duration:.8},Js={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},el=(e,{keyframes:t})=>t.length>2?Qs:ro.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):Xs:Js;const tl=(e,t,r,n={},o,a)=>i=>{const s=ta(n,e)||{},l=s.delay||n.delay||0;let{elapsed:c=0}=n;c-=ln(l);let d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...d}){return!!Object.keys(d).length})(s)||(d={...d,...el(e,d)}),d.duration&&(d.duration=ln(d.duration)),d.repeatDelay&&(d.repeatDelay=ln(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(u=!0)),u&&!a&&void 0!==t.get()){const e=Ui(d.keyframes,s);if(void 0!==e)return hn.update(()=>{d.onUpdate(e),d.onComplete()}),new ea([])}return!a&&Gs.supports(d)?new Gs(d):new Ws(d)};function rl({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function nl(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var a;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(i=n);const c=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const n=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),o=l[t];if(void 0===o||d&&rl(d,t))continue;const s={delay:r,...ta(i||{},t)};let u=!1;if(window.MotionHandoffAnimation){const r=La(e);if(r){const e=window.MotionHandoffAnimation(r,t,hn);null!==e&&(s.startTime=e,u=!0)}}Fa(e,t),n.start(tl(t,n,o,e.shouldReduceMotion&&Da.has(t)?{type:!1}:s,e,u));const p=n.animation;p&&c.push(p)}return s&&Promise.all(c).then(()=>{hn.update(()=>{s&&function(e,t){const r=Xo(e,t);let{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(const t in a)Ra(e,t,Gn(a[t]))}(e,s)})}),c}function ol(e,t,r={}){var n;const o=Xo(e,t,"exit"===r.type?null===(n=e.presenceContext)||void 0===n?void 0:n.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(a=r.transitionOverride);const i=o?()=>Promise.all(nl(e,o,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,r=0,n=0,o=1,a){const i=[],s=(e.variantChildren.size-1)*n,l=1===o?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(al).forEach((e,n)=>{e.notify("AnimationStart",t),i.push(ol(e,t,{...a,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+n,i,s,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(r.delay)])}function al(e,t){return e.sortNodePosition(t)}const il=Sn.length;function sl(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&sl(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let r=0;r<il;r++){const n=Sn[r],o=e.props[n];(Dn(o)||!1===o)&&(t[n]=o)}return t}const ll=[...On].reverse(),cl=On.length;function dl(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>ol(e,t,r));n=Promise.all(o)}else if("string"==typeof t)n=ol(e,t,r);else{const o="function"==typeof t?Xo(e,t,r.custom):t;n=Promise.all(nl(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,t,r)))}function ul(e){let t=dl(e),r=fl(),n=!0;const o=t=>(r,n)=>{var o;const a=Xo(e,n,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...n}=a;r={...r,...n,...t}}return r};function a(a){const{props:i}=e,s=sl(e.parent)||{},l=[],c=new Set;let d={},u=1/0;for(let t=0;t<cl;t++){const p=ll[t],h=r[p],f=void 0!==i[p]?i[p]:s[p],m=Dn(f),v=p===a?h.isActive:null;!1===v&&(u=t);let y=f===s[p]&&f!==i[p]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...d},!h.isActive&&null===v||!f&&!h.prevProp||jn(f)||"boolean"==typeof f)continue;const g=pl(h.prevProp,f);let x=g||p===a&&h.isActive&&!y&&m||t>u&&m,b=!1;const k=Array.isArray(f)?f:[f];let _=k.reduce(o(p),{});!1===v&&(_={});const{prevResolvedValues:w={}}=h,M={...w,..._},C=t=>{x=!0,c.has(t)&&(b=!0,c.delete(t)),h.needsAnimating[t]=!0;const r=e.getValue(t);r&&(r.liveStyle=!1)};for(const e in M){const t=_[e],r=w[e];if(d.hasOwnProperty(e))continue;let n=!1;n=Kn(t)&&Kn(r)?!Go(t,r):t!==r,n?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):h.protectedKeys[e]=!0}h.prevProp=f,h.prevResolvedValues=_,h.isActive&&(d={...d,..._}),n&&e.blockInitialAnimation&&(x=!1),x&&(!y||!g||b)&&l.push(...k.map(e=>({animation:e,options:{type:p}})))}if(c.size){const t={};c.forEach(r=>{const n=e.getBaseTarget(r),o=e.getValue(r);o&&(o.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let p=!!l.length;return n&&(!1===i.initial||i.initial===i.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const i=a(t);for(const e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=fl(),n=!0}}}function pl(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Go(t,e)}function hl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fl(){return{animate:hl(!0),whileInView:hl(),whileHover:hl(),whileTap:hl(),whileDrag:hl(),whileFocus:hl(),exit:hl()}}class ml{constructor(e){this.isMounted=!1,this.node=e}update(){}}let vl=0;const yl={animation:{Feature:class extends ml{constructor(e){super(e),e.animationState||(e.animationState=ul(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();jn(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 ml{constructor(){super(...arguments),this.id=vl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function gl(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function xl(e){return{point:{x:e.pageX,y:e.pageY}}}function bl(e,t,r,n){return gl(e,t,(e=>t=>xa(t)&&e(t,xl(t)))(r),n)}const kl=(e,t)=>Math.abs(e-t);class _l{constructor(e,t,{transformPagePoint:r,contextWindow:n,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=Cl(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,r=function(e,t){const r=kl(e.x,t.x),n=kl(e.y,t.y);return Math.sqrt(r**2+n**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!r)return;const{point:n}=e,{timestamp:o}=mn;this.history.push({...n,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=wl(t,this.transformPagePoint),hn.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:r,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=Cl("pointercancel"===e.type?this.lastMoveEventInfo:wl(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,a),n&&n(e,a)},!xa(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;const a=wl(xl(e),this.transformPagePoint),{point:i}=a,{timestamp:s}=mn;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,Cl(a,this.history)),this.removeListeners=rs(bl(this.contextWindow,"pointermove",this.handlePointerMove),bl(this.contextWindow,"pointerup",this.handlePointerUp),bl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),fn(this.updatePoint)}}function wl(e,t){return t?{point:t(e.point)}:e}function Ml(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Cl({point:e},t){return{point:e,delta:Ml(e,jl(t)),offset:Ml(e,Dl(t)),velocity:Ol(t,.1)}}function Dl(e){return e[0]}function jl(e){return e[e.length-1]}function Ol(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const o=jl(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>ln(t)));)r--;if(!n)return{x:0,y:0};const a=cn(o.timestamp-n.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Sl(e){return e.max-e.min}function Pl(e,t,r,n=.5){e.origin=n,e.originPoint=Zi(t.min,t.max,e.origin),e.scale=Sl(r)/Sl(t),e.translate=Zi(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function El(e,t,r,n){Pl(e.x,t.x,r.x,n?n.originX:void 0),Pl(e.y,t.y,r.y,n?n.originY:void 0)}function Tl(e,t,r){e.min=r.min+t.min,e.max=e.min+Sl(t)}function Nl(e,t,r){e.min=t.min-r.min,e.max=e.min+Sl(t)}function zl(e,t,r){Nl(e.x,t.x,r.x),Nl(e.y,t.y,r.y)}function Al(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function Rl(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}const Fl=.35;function Ll(e,t,r){return{min:Bl(e,t),max:Bl(e,r)}}function Bl(e,t){return"number"==typeof e?e:e[t]||0}const Vl=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Il(e){return[e("x"),e("y")]}function ql({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function Hl(e){return void 0===e||1===e}function $l({scale:e,scaleX:t,scaleY:r}){return!Hl(e)||!Hl(t)||!Hl(r)}function Wl(e){return $l(e)||Ul(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ul(e){return Yl(e.x)||Yl(e.y)}function Yl(e){return e&&"0%"!==e}function Zl(e,t,r){return r+t*(e-r)}function Kl(e,t,r,n,o){return void 0!==o&&(e=Zl(e,o,n)),Zl(e,r,n)+t}function Gl(e,t=0,r=1,n,o){e.min=Kl(e.min,t,r,n,o),e.max=Kl(e.max,t,r,n,o)}function Xl(e,{x:t,y:r}){Gl(e.x,t.translate,t.scale,t.originPoint),Gl(e.y,r.translate,r.scale,r.originPoint)}const Ql=.999999999999,Jl=1.0000000000001;function ec(e,t){e.min=e.min+t,e.max=e.max+t}function tc(e,t,r,n,o=.5){Gl(e,t,r,Zi(e.min,e.max,o),n)}function rc(e,t){tc(e.x,t.x,t.scaleX,t.scale,t.originX),tc(e.y,t.y,t.scaleY,t.scale,t.originY)}function nc(e,t){return ql(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}const oc=({current:e})=>e?e.ownerDocument.defaultView:null,ac=new WeakMap;class ic{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new _l(e,{onSessionStart:e=>{const{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(xl(e).point)},onStart:(e,t)=>{const{drag:r,dragPropagation:n,onDragStart:o}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){return"x"===e||"y"===e?fa[e]?null:(fa[e]=!0,()=>{fa[e]=!1}):fa.x||fa.y?null:(fa.x=fa.y=!0,()=>{fa.x=fa.y=!1})}(r),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Il(e=>{let t=this.getAxisMotionValue(e).get()||0;if(vo.test(t)){const{projection:r}=this.visualElement;if(r&&r.layout){const n=r.layout.layoutBox[e];n&&(t=Sl(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&hn.postRender(()=>o(e,t)),Fa(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:r,dragDirectionLock:n,onDirectionLock:o,onDrag:a}=this.getProps();if(!r&&!this.openDragLock)return;const{offset:i}=t;if(n&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Il(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:n,contextWindow:oc(this.visualElement)})}stop(e,t){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:n}=t;this.startAnimation(n);const{onDragEnd:o}=this.getProps();o&&hn.postRender(()=>o(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:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){const{drag:n}=this.getProps();if(!r||!sc(e,n,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?Zi(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?Zi(r,e,n.max):Math.min(e,r)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=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&&An(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(e,{top:t,left:r,bottom:n,right:o}){return{x:Al(e.x,r,o),y:Al(e.y,t,n)}}(n.layoutBox,t),this.elastic=function(e=Fl){return!1===e?e=0:!0===e&&(e=Fl),{x:Ll(e,"left","right"),y:Ll(e,"top","bottom")}}(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Il(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!An(e))return!1;const r=e.current;on(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const o=function(e,t,r){const n=nc(e,r),{scroll:o}=t;return o&&(ec(n.x,o.offset.x),ec(n.y,o.offset.y)),n}(r,n.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Rl(e.x,t.x),y:Rl(e.y,t.y)}}(n.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}}(a));this.hasMutatedConstraints=!!e,e&&(a=ql(e))}return a}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:n,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=Il(i=>{if(!sc(i,t,this.currentDirection))return;let l=s&&s[i]||{};a&&(l={min:0,max:0});const c=n?200:1e6,d=n?40:1e7,u={type:"inertia",velocity:r?e[i]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,u)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return Fa(this.visualElement,e),r.start(tl(e,r,0,t,this.visualElement,!1))}stopAnimation(){Il(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Il(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()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Il(t=>{const{drag:r}=this.getProps();if(!sc(t,r,this.currentDirection))return;const{projection:n}=this.visualElement,o=this.getAxisMotionValue(t);if(n&&n.layout){const{min:r,max:a}=n.layout.layoutBox[t];o.set(e[t]-Zi(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!An(t)||!r||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};Il(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const r=t.get();n[e]=function(e,t){let r=.5;const n=Sl(e),o=Sl(t);return o>n?r=sn(t.min,t.max-n,e.min):n>o&&(r=sn(e.min,e.max-o,t.min)),co(0,1,r)}({min:r,max:r},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Il(t=>{if(!sc(t,e,null))return;const r=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];r.set(Zi(o,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;ac.set(this.visualElement,this);const e=bl(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();An(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),hn.read(t);const o=gl(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Il(t=>{const r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),n(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:o=!1,dragElastic:a=Fl,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function sc(e,t,r){return!(!0!==t&&t!==e||null!==r&&r!==e)}const lc=e=>(t,r)=>{e&&hn.postRender(()=>e(t,r))};const cc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function dc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uc={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!yo.test(e))return e;e=parseFloat(e)}return`${dc(e,t.target.x)}% ${dc(e,t.target.y)}%`}},pc={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,o=vi.parse(e);if(o.length>5)return n;const a=vi.createTransformer(e),i="number"!=typeof o[0]?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=Zi(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}};class hc extends r.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:o}=e;(function(e){Object.assign(Lo,e)})(mc),o&&(t.group&&t.group.add(o),r&&r.register&&n&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),cc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:n,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,n||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||hn.postRender(()=>{const e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Bn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function fc(e){const[n,o]=Gr(),a=r.useContext(qr);return t.jsx(hc,{...e,layoutGroup:a,switchLayoutGroup:r.useContext(Vn),isPresent:n,safeToRemove:o})}const mc={borderRadius:{...uc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uc,borderTopRightRadius:uc,borderBottomLeftRadius:uc,borderBottomRightRadius:uc,boxShadow:pc};const vc=(e,t)=>e.depth-t.depth;class yc{constructor(){this.children=[],this.isDirty=!1}add(e){Pa(this.children,e),this.isDirty=!0}remove(e){Ea(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(vc),this.isDirty=!1,this.children.forEach(e)}}const gc=["TopLeft","TopRight","BottomLeft","BottomRight"],xc=gc.length,bc=e=>"string"==typeof e?parseFloat(e):e,kc=e=>"number"==typeof e||yo.test(e);function _c(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const wc=Cc(0,.5,Za),Mc=Cc(.5,.95,rn);function Cc(e,t,r){return n=>n<e?0:n>t?1:r(sn(e,t,n))}function Dc(e,t){e.min=t.min,e.max=t.max}function jc(e,t){Dc(e.x,t.x),Dc(e.y,t.y)}function Oc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Sc(e,t,r,n,o){return e=Zl(e-=t,1/r,n),void 0!==o&&(e=Zl(e,1/o,n)),e}function Pc(e,t,[r,n,o],a,i){!function(e,t=0,r=1,n=.5,o,a=e,i=e){if(vo.test(t)&&(t=parseFloat(t),t=Zi(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=Zi(a.min,a.max,n);e===a&&(s-=t),e.min=Sc(e.min,t,r,s,o),e.max=Sc(e.max,t,r,s,o)}(e,t[r],t[n],t[o],t.scale,a,i)}const Ec=["x","scaleX","originX"],Tc=["y","scaleY","originY"];function Nc(e,t,r,n){Pc(e.x,t,Ec,r?r.x:void 0,n?n.x:void 0),Pc(e.y,t,Tc,r?r.y:void 0,n?n.y:void 0)}function zc(e){return 0===e.translate&&1===e.scale}function Ac(e){return zc(e.x)&&zc(e.y)}function Rc(e,t){return e.min===t.min&&e.max===t.max}function Fc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Lc(e,t){return Fc(e.x,t.x)&&Fc(e.y,t.y)}function Bc(e){return Sl(e.x)/Sl(e.y)}function Vc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ic{constructor(){this.members=[]}add(e){Pa(this.members,e),e.scheduleRender()}remove(e){if(Ea(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 r;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){r=t;break}}return!!r&&(this.promote(r),!0)}promote(e,t){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const qc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Hc=typeof window<"u"&&void 0!==window.MotionDebug,$c=["","X","Y","Z"],Wc={visibility:"hidden"};let Uc=0;function Yc(e,t,r,n){const{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function Zc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=La(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",hn,!(t||n))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&Zc(n)}function Kc({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(e={},r=(null==t?void 0:t())){this.id=Uc++,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,Hc&&(qc.totalNodes=qc.resolvedTargetDeltas=qc.recalculatedProjection=0),this.nodes.forEach(Qc),this.nodes.forEach(ad),this.nodes.forEach(id),this.nodes.forEach(Jc),Hc&&window.MotionDebug.record(qc)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new yc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ta),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,r=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=function(e){return e instanceof SVGElement&&"svg"!==e.tagName}(t),this.instance=t;const{layoutId:n,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),r&&(o||n)&&(this.isLayoutDirty=!0),e){let r;const n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){const r=Sa.now(),n=({timestamp:o})=>{const a=o-r;a>=t&&(fn(n),e(a-t))};return hn.read(n,!0),()=>fn(n)}(n,250),cc.hasAnimatedSinceResize&&(cc.hasAnimatedSinceResize=!1,this.nodes.forEach(od))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||pd,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Lc(this.targetLayout,n)||r,c=!t&&r;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={...ta(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||od(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}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,fn(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(sd),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&&Zc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(td);this.isUpdating||this.nodes.forEach(rd),this.isUpdating=!1,this.nodes.forEach(nd),this.nodes.forEach(Gc),this.nodes.forEach(Xc),this.clearAllSnapshots();const e=Sa.now();mn.delta=co(0,1e3/60,e-mn.timestamp),mn.timestamp=e,mn.isProcessing=!0,vn.update.process(mn),vn.preRender.process(mn),vn.render.process(mn),mn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ed),this.sharedNodes.forEach(ld)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,hn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){hn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!(this.instance&&(this.updateScroll(),this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty)))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!(!this.options.layoutScroll||!this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ac(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&(t||Wl(this.latestValues)||a)&&(o(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let r=this.removeElementScroll(t);return e&&(r=this.removeTransform(r)),function(e){md(e.x),md(e.y)}(r),{animationId:this.root.animationId,measuredBox:t,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const r=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(yd)){const{scroll:e}=this.root;e&&(ec(r.x,e.offset.x),ec(r.y,e.offset.y))}return r}removeElementScroll(e){var t;const r={x:{min:0,max:0},y:{min:0,max:0}};if(jc(r,e),null!==(t=this.scroll)&&void 0!==t&&t.wasRoot)return r;for(let t=0;t<this.path.length;t++){const n=this.path[t],{scroll:o,options:a}=n;n!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&jc(r,e),ec(r.x,o.offset.x),ec(r.y,o.offset.y))}return r}applyTransform(e,t=!1){const r={x:{min:0,max:0},y:{min:0,max:0}};jc(r,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&rc(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),Wl(n.latestValues)&&rc(r,n.latestValues)}return Wl(this.latestValues)&&rc(r,this.latestValues),r}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};jc(t,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];if(!r.instance||!Wl(r.latestValues))continue;$l(r.latestValues)&&r.updateSnapshot();const n=Vl();jc(n,r.measurePageBox()),Nc(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return Wl(this.latestValues)&&Nc(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==mn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const n=!!this.resumingFrom||this!==r;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||null!==(t=this.parent)&&void 0!==t&&t.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(this.layout&&(o||a)){if(this.resolvedRelativeTargetAt=mn.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},zl(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),jc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),function(e,t,r){Tl(e.x,t.x,r.x),Tl(e.y,t.y,r.y)}(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jc(this.target,this.layout.layoutBox),Xl(this.target,this.targetDelta)):jc(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},zl(this.relativeTargetOrigin,this.target,e.target),jc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Hc&&qc.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!$l(this.parent.latestValues)&&!Ul(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!(!(this.relativeTarget||this.targetDelta||this.options.layoutRoot)||!this.layout)}calcProjection(){var e;const t=this.getLead(),r=!!this.resumingFrom||this!==t;let n=!0;if((this.isProjectionDirty||!(null===(e=this.parent)||void 0===e)&&e.isProjectionDirty)&&(n=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===mn.timestamp&&(n=!1),n)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;jc(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;(function(e,t,r,n=!1){const o=r.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&rc(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Xl(e,i)),n&&Wl(a.latestValues)&&rc(e,a.latestValues))}t.x<Jl&&t.x>Ql&&(t.x=1),t.y<Jl&&t.y>Ql&&(t.y=1)})(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Oc(this.prevProjectionDelta.x,this.projectionDelta.x),Oc(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),El(this.projectionDelta,this.layoutCorrected,l,this.latestValues),(this.treeScale.x!==i||this.treeScale.y!==s||!Vc(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Hc&&qc.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={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const r=this.snapshot,n=r?r.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,d=!(!s||c||!0!==this.options.crossfade||this.path.some(ud));let u;this.animationProgress=0,this.mixTargetDelta=t=>{const r=t/1e3;cd(a.x,e.x,r),cd(a.y,e.y,r),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zl(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,r,n){dd(e.x,t.x,r.x,n),dd(e.y,t.y,r.y,n)}(this.relativeTarget,this.relativeTargetOrigin,i,r),u&&function(e,t){return Rc(e.x,t.x)&&Rc(e.y,t.y)}(this.relativeTarget,u)&&(this.isProjectionDirty=!1),u||(u={x:{min:0,max:0},y:{min:0,max:0}}),jc(u,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,r,n,o,a){o?(e.opacity=Zi(0,void 0!==r.opacity?r.opacity:1,wc(n)),e.opacityExit=Zi(void 0!==t.opacity?t.opacity:1,0,Mc(n))):a&&(e.opacity=Zi(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let o=0;o<xc;o++){const a=`border${gc[o]}Radius`;let i=_c(t,a),s=_c(r,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||kc(i)===kc(s)?(e[a]=Math.max(Zi(bc(i),bc(s),n),0),(vo.test(s)||vo.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||r.rotate)&&(e.rotate=Zi(t.rotate||0,r.rotate||0,n))}(o,n,this.latestValues,r,d,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=hn.update(()=>{cc.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){const n=Xn(e)?e:Aa(e);return n.start(tl("",n,t,r)),n.animation}(0,1e3,{...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:r,layout:n,latestValues:o}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&vd(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Sl(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;const n=Sl(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}jc(t,r),rc(t,o),El(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ic),this.sharedNodes.get(e).add(t);const r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.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:r}={}){const n=this.getStack();n&&n.promote(this,r),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:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;const n={};r.z&&Yc("z",e,n,this.animationValues);for(let t=0;t<$c.length;t++)Yc(`rotate${$c[t]}`,e,n,this.animationValues),Yc(`skew${$c[t]}`,e,n,this.animationValues);e.render();for(const t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}getProjectionStyles(e){var t,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Wc;const n={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=Qn(null==e?void 0:e.pointerEvents)||"",n.transform=o?o(this.latestValues,""):"none",n;const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Qn(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!Wl(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=a.animationValues||a.latestValues;this.applyTransformsToTarget(),n.transform=function(e,t,r){let n="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==r?void 0:r.z)||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),o&&(n+=`rotateX(${o}deg) `),a&&(n+=`rotateY(${a}deg) `),i&&(n+=`skewX(${i}deg) `),s&&(n+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==s||1!==l)&&(n+=`scale(${s}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(n.transform=o(i,n.transform));const{x:s,y:l}=this.projectionDelta;n.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,a.animationValues?n.opacity=a===this?null!==(r=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==r?r:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n.opacity=a===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in Lo){if(void 0===i[e])continue;const{correct:t,applyTo:r}=Lo[e],o="none"===n.transform?i[e]:t(i[e],a);if(r){const e=r.length;for(let t=0;t<e;t++)n[r[t]]=o}else n[e]=o}return this.options.layoutId&&(n.pointerEvents=a===this?Qn(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(td),this.root.sharedNodes.clear()}}}function Gc(e){e.updateLayout()}function Xc(e){var t;const r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:o}=e.options,a=r.source!==e.layout.source;"size"===o?Il(e=>{const n=a?r.measuredBox[e]:r.layoutBox[e],o=Sl(n);n.min=t[e].min,n.max=n.min+o}):vd(o,r.layoutBox,t)&&Il(n=>{const o=a?r.measuredBox[n]:r.layoutBox[n],i=Sl(t[n]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};El(i,t,r.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?El(s,e.applyTransform(n,!0),r.measuredBox):El(s,t,r.layoutBox);const l=!Ac(i);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:a}=n;if(o&&a){const i={x:{min:0,max:0},y:{min:0,max:0}};zl(i,r.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};zl(s,t,a.layoutBox),Lc(i,s)||(c=!0),n.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Qc(e){Hc&&qc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Jc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ed(e){e.clearSnapshot()}function td(e){e.clearMeasurements()}function rd(e){e.isLayoutDirty=!1}function nd(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function od(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ad(e){e.resolveTargetDelta()}function id(e){e.calcProjection()}function sd(e){e.resetSkewAndRotation()}function ld(e){e.removeLeadSnapshot()}function cd(e,t,r){e.translate=Zi(t.translate,0,r),e.scale=Zi(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function dd(e,t,r,n){e.min=Zi(t.min,r.min,n),e.max=Zi(t.max,r.max,n)}function ud(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const pd={duration:.45,ease:[.4,0,.1,1]},hd=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fd=hd("applewebkit/")&&!hd("chrome/")?Math.round:rn;function md(e){e.min=fd(e.min),e.max=fd(e.max)}function vd(e,t,r){return"position"===e||"preserve-aspect"===e&&!function(e,t,r){return Math.abs(e-t)<=r}(Bc(t),Bc(r),.2)}function yd(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const gd=Kc({attachResizeListener:(e,t)=>gl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xd={current:void 0},bd=Kc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xd.current){const e=new gd({});e.mount(window),e.setOptions({layoutScroll:!0}),xd.current=e}return xd.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),kd={pan:{Feature:class extends ml{constructor(){super(...arguments),this.removePointerDownListener=rn}onPointerDown(e){this.session=new _l(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:lc(e),onStart:lc(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&hn.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=bl(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 ml{constructor(e){super(e),this.removeGroupControls=rn,this.removeListeners=rn,this.controls=new ic(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rn}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:bd,MeasureLayout:fc}};function _d(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);const o=n["onHover"+r];o&&hn.postRender(()=>o(t,xl(t)))}function wd(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);const o=n["onTap"+("End"===r?"":r)];o&&hn.postRender(()=>o(t,xl(t)))}const Md=new WeakMap,Cd=new WeakMap,Dd=e=>{const t=Md.get(e.target);t&&t(e)},jd=e=>{e.forEach(Dd)};function Od(e,t,r){const n=function({root:e,...t}){const r=e||document;Cd.has(r)||Cd.set(r,{});const n=Cd.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(jd,{root:e,...t})),n[o]}(t);return Md.set(e,r),n.observe(e),()=>{Md.delete(e),n.unobserve(e)}}const Sd={some:0,all:1};const Pd={inView:{Feature:class extends ml{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:Sd[n]};return Od(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),a=t?r:n;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ml{mount(){const{current:e}=this.node;e&&(this.unmount=Ca(e,e=>(wd(this.node,e,"Start"),(e,{success:t})=>wd(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ml{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{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=rs(gl(this.node.current,"focus",()=>this.onFocus()),gl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ml{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){const[n,o,a]=va(e,r),i=ya(e=>{const{target:r}=e,n=t(e);if("function"!=typeof n||!r)return;const a=ya(e=>{n(e),r.removeEventListener("pointerleave",a)});r.addEventListener("pointerleave",a,o)});return n.forEach(e=>{e.addEventListener("pointerenter",i,o)}),a}(e,e=>(_d(this.node,e,"Start"),e=>_d(this.node,e,"End"))))}unmount(){}}}},Ed={layout:{ProjectionNode:bd,MeasureLayout:fc}},Td={current:null},Nd={current:!1};const zd=[...Ii,si,vi],Ad=new WeakMap;const Rd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Fd{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ri,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Sa.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,hn.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=a;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.blockInitialAnimation=!!o,this.isControllingVariants=Pn(t),this.isVariantNode=En(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==s[e]&&Xn(t)&&t.set(s[e],!1)}}mount(e){this.current=e,Ad.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)),Nd.current||function(){if(Nd.current=!0,Jr)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Td.current=e.matches;e.addListener(t),t()}else Td.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Td.current),"production"!==process.env.NODE_ENV&&Mn(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ad.delete(this.current),this.projection&&this.projection.unmount(),fn(this.notifyUpdate),fn(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 r=ro.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&hn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{n(),o(),a&&a(),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 xn){const t=xn[e];if(!t)continue;const{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(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):{x:{min:0,max:0},y:{min:0,max:0}}}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;t<Rd.length;t++){const r=Rd[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(const n in t){const o=t[n],a=r[n];if(Xn(o))e.addValue(n,o),"development"===process.env.NODE_ENV&&Mn("11.18.2"===o.version,`Attempting to mix Motion versions ${o.version} with 11.18.2 may not work as expected.`);else if(Xn(a))e.addValue(n,Aa(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){const t=e.getValue(n);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(n);e.addValue(n,Aa(void 0!==t?t:o,{owner:e}))}}for(const n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&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 r=this.values.get(e);return void 0===r&&void 0!==t&&(r=Aa(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){var r;let n=void 0===this.latestValues[e]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,e))&&void 0!==r?r:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(Fi(n)||Ga(n))?n=parseFloat(n):!(e=>zd.find(Vi(e)))(n)&&vi.test(t)&&(n=wi(e,t)),this.setBaseTarget(e,Xn(n)?n.get():n)),Xn(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props;let n;if("string"==typeof r||"object"==typeof r){const o=Zn(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(n=o[e])}if(r&&void 0!==n)return n;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Xn(o)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Ta),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Ld extends Fd{constructor(){super(...arguments),this.KeyframeResolver=Hi}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:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Xn(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Bd extends Ld{constructor(){super(...arguments),this.type="html",this.renderInstance=Ao}readValueFromInstance(e,t){if(ro.has(t)){const e=_i(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(oo(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return nc(e,t)}build(e,t,r){jo(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return Vo(e,t,r)}}class Vd extends Ld{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Vl}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ro.has(t)){const e=_i(t);return e&&e.default||0}return t=Ro.has(t)?t:Fn(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return Io(e,t,r)}build(e,t,r){Eo(e,t,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,r,n){Fo(e,t,0,n)}mount(e){this.isSVGTag=zo(e.tagName),super.mount(e)}}const Id=function(e,t){return function(r,{forwardMotionProps:n}={forwardMotionProps:!1}){return Hn({...Un(r)?Ho:$o,preloadedFeatures:e,useRender:Ko(n),createVisualElement:t,Component:r})}}({...yl,...Pd,...kd,...Ed},(e,t)=>Un(e)?new Vd(t):new Bd(t,{allowProjection:e!==r.Fragment})),qd=function(e){if(typeof Proxy>"u")return e;const t=new Map;return new Proxy((...t)=>("production"!==process.env.NODE_ENV&&Mn(!1,"motion() is deprecated. Use motion.create() instead."),e(...t)),{get:(r,n)=>"create"===n?e:(t.has(n)||t.set(n,e(n)),t.get(n))})}(Id),Hd=({is24HourFormat:e,isTimeFormatChanging:r,toggleTimeFormat:n})=>t.jsx(Ir,{variant:"outline",size:"sm",onClick:n,disabled:r,className:"flex items-center space-x-1 w-20 justify-center overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsxs(qd.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(wt,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?"24h":"12h"})]},e?"24h":"12h")})});function $d(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function Wd(e,r=[]){let n=[];const o=()=>{const t=n.map(e=>a.createContext(e));return function(r){const n=(null==r?void 0:r[e])||t;return a.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){const i=a.createContext(o),s=n.length;n=[...n,o];const l=r=>{var n;const{scope:o,children:l,...c}=r,d=(null==(n=null==o?void 0:o[e])?void 0:n[s])||i,u=a.useMemo(()=>c,Object.values(c));return t.jsx(d.Provider,{value:u,children:l})};return l.displayName=r+"Provider",[l,function(t,n){var l;const c=(null==(l=null==n?void 0:n[e])?void 0:l[s])||i,d=a.useContext(c);if(d)return d;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},Ud(o,...r)]}function Ud(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var Yd=null!=globalThis&&globalThis.document?a.useLayoutEffect:()=>{},Zd=a[" useInsertionEffect ".trim().toString()]||Yd;function Kd({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),o=a.useRef(r),i=a.useRef(t);return Zd(()=>{i.current=t},[t]),a.useEffect(()=>{var e;o.current!==r&&(null==(e=i.current)||e.call(i,r),o.current=r)},[r,o]),[r,n,i]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;e!==l&&console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=l},[l,n])}const d=a.useCallback(t=>{var r;if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&(null==(r=s.current)||r.call(s,n))}else i(t)},[l,e,i,s]);return[c,d]}var Gd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const n=Lt(`Primitive.${r}`),o=a.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:o})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function Xd(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}function Qd(e){const n=e+"CollectionProvider",[o,a]=Wd(n),[i,s]=o(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:o}=e,a=r.useRef(null),s=r.useRef(new Map).current;return t.jsx(i,{scope:n,itemMap:s,collectionRef:a,children:o})};l.displayName=n;const c=e+"CollectionSlot",d=Lt(c),u=r.forwardRef((e,r)=>{const{scope:n,children:o}=e,a=Ft(r,s(c,n).collectionRef);return t.jsx(d,{ref:a,children:o})});u.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",f=Lt(p),m=r.forwardRef((e,n)=>{const{scope:o,children:a,...i}=e,l=r.useRef(null),c=Ft(n,l),d=s(p,o);return r.useEffect(()=>(d.itemMap.set(l,{ref:l,...i}),()=>{d.itemMap.delete(l)})),t.jsx(f,{[h]:"",ref:c,children:a})});return m.displayName=p,[{Provider:l,Slot:u,ItemSlot:m},function(t){const n=s(e+"CollectionConsumer",t);return r.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},a]}var Jd=a.createContext(void 0);function eu(e){const t=a.useContext(Jd);return e||t||"ltr"}function tu(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}var ru,nu="dismissableLayer.update",ou="dismissableLayer.pointerDownOutside",au="dismissableLayer.focusOutside",iu=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),su=a.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,u=a.useContext(iu),[p,h]=a.useState(null),f=(null==p?void 0:p.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,m]=a.useState({}),v=Ft(r,e=>h(e)),y=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=tu(e),n=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){du(ou,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));!_||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=tu(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{e.target&&!n.current&&du(au,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const r=tu(e);a.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{b===u.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),a.useEffect(()=>{if(p)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(ru=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),cu(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=ru)}},[p,f,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),cu())},[p,u]),a.useEffect(()=>{const e=()=>m({});return document.addEventListener(nu,e),()=>document.removeEventListener(nu,e)},[]),t.jsx(Gd.div,{...d,ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:$d(e.onFocusCapture,M.onFocusCapture),onBlurCapture:$d(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:$d(e.onPointerDownCapture,w.onPointerDownCapture)})});su.displayName="DismissableLayer";var lu=a.forwardRef((e,r)=>{const n=a.useContext(iu),o=a.useRef(null),i=Ft(r,o);return a.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),t.jsx(Gd.div,{...e,ref:i})});function cu(){const e=new CustomEvent(nu);document.dispatchEvent(e)}function du(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Xd(o,a):o.dispatchEvent(a)}lu.displayName="DismissableLayerBranch";var uu=0;function pu(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hu()),document.body.insertAdjacentElement("beforeend",e[1]??hu()),uu++,()=>{1===uu&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),uu--}},[])}function hu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fu="focusScope.autoFocusOnMount",mu="focusScope.autoFocusOnUnmount",vu={bubbles:!1,cancelable:!0},yu=a.forwardRef((e,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,d]=a.useState(null),u=tu(i),p=tu(s),h=a.useRef(null),f=Ft(r,e=>d(e)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:ku(h.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ku(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ku(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,m.paused]),a.useEffect(()=>{if(c){_u.add(m);const e=document.activeElement;if(!c.contains(e)){const t=new CustomEvent(fu,vu);c.addEventListener(fu,u),c.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ku(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(gu(c)),{select:!0}),document.activeElement===e&&ku(c))}return()=>{c.removeEventListener(fu,u),setTimeout(()=>{const t=new CustomEvent(mu,vu);c.addEventListener(mu,p),c.dispatchEvent(t),t.defaultPrevented||ku(e??document.body,{select:!0}),c.removeEventListener(mu,p),_u.remove(m)},0)}}},[c,u,p,m]);const v=a.useCallback(e=>{if(!n&&!o||m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=gu(e),r=xu(t,e),n=xu(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&ku(a,{select:!0})):(e.preventDefault(),n&&ku(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,m.paused]);return t.jsx(Gd.div,{tabIndex:-1,...l,ref:f,onKeyDown:v})});function gu(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function xu(e,t){for(const r of e)if(!bu(r,{upTo:t}))return r}function bu(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ku(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}yu.displayName="FocusScope";var _u=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=wu(e,t),e.unshift(t)},remove(t){var r;e=wu(e,t),null==(r=e[0])||r.resume()}}}();function wu(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Mu=a[" useId ".trim().toString()]||(()=>{}),Cu=0;function Du(e){const[t,r]=a.useState(Mu());return Yd(()=>{r(e=>e??String(Cu++))},[e]),t?`radix-${t}`:""}const ju=["top","right","bottom","left"],Ou=Math.min,Su=Math.max,Pu=Math.round,Eu=Math.floor,Tu=e=>({x:e,y:e}),Nu={left:"right",right:"left",bottom:"top",top:"bottom"},zu={start:"end",end:"start"};function Au(e,t,r){return Su(e,Ou(t,r))}function Ru(e,t){return"function"==typeof e?e(t):e}function Fu(e){return e.split("-")[0]}function Lu(e){return e.split("-")[1]}function Bu(e){return"x"===e?"y":"x"}function Vu(e){return"y"===e?"height":"width"}const Iu=new Set(["top","bottom"]);function qu(e){return Iu.has(Fu(e))?"y":"x"}function Hu(e){return Bu(qu(e))}function $u(e){return e.replace(/start|end/g,e=>zu[e])}const Wu=["left","right"],Uu=["right","left"],Yu=["top","bottom"],Zu=["bottom","top"];function Ku(e,t,r,n){const o=Lu(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Uu:Wu:t?Wu:Uu;case"left":case"right":return t?Yu:Zu;default:return[]}}(Fu(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map($u)))),a}function Gu(e){return e.replace(/left|right|bottom|top/g,e=>Nu[e])}function Xu(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 Qu(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ju(e,t,r){let{reference:n,floating:o}=e;const a=qu(t),i=Hu(t),s=Vu(i),l=Fu(t),c="y"===a,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2;let h;switch(l){case"top":h={x:d,y:n.y-o.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:u};break;case"left":h={x:n.x-o.width,y:u};break;default:h={x:n.x,y:n.y}}switch(Lu(t)){case"start":h[i]-=p*(r&&c?-1:1);break;case"end":h[i]+=p*(r&&c?-1:1)}return h}async function ep(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:h=0}=Ru(t,e),f=Xu(h),m=s[p?"floating"===u?"reference":"floating":u],v=Qu(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y="floating"===u?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),x=await(null==a.isElement?void 0:a.isElement(g))&&await(null==a.getScale?void 0:a.getScale(g))||{x:1,y:1},b=Qu(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-b.top+f.top)/x.y,bottom:(b.bottom-v.bottom+f.bottom)/x.y,left:(v.left-b.left+f.left)/x.x,right:(b.right-v.right+f.right)/x.x}}function tp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rp(e){return ju.some(t=>e[t]>=0)}const np=new Set(["left","top"]);function op(){return typeof window<"u"}function ap(e){return lp(e)?(e.nodeName||"").toLowerCase():"#document"}function ip(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sp(e){var t;return null==(t=(lp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function lp(e){return!!op()&&(e instanceof Node||e instanceof ip(e).Node)}function cp(e){return!!op()&&(e instanceof Element||e instanceof ip(e).Element)}function dp(e){return!!op()&&(e instanceof HTMLElement||e instanceof ip(e).HTMLElement)}function up(e){return!(!op()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof ip(e).ShadowRoot)}const pp=new Set(["inline","contents"]);function hp(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Cp(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!pp.has(o)}const fp=new Set(["table","td","th"]);function mp(e){return fp.has(ap(e))}const vp=[":popover-open",":modal"];function yp(e){return vp.some(t=>{try{return e.matches(t)}catch{return!1}})}const gp=["transform","translate","scale","rotate","perspective"],xp=["transform","translate","scale","rotate","perspective","filter"],bp=["paint","layout","strict","content"];function kp(e){const t=_p(),r=cp(e)?Cp(e):e;return gp.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||xp.some(e=>(r.willChange||"").includes(e))||bp.some(e=>(r.contain||"").includes(e))}function _p(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const wp=new Set(["html","body","#document"]);function Mp(e){return wp.has(ap(e))}function Cp(e){return ip(e).getComputedStyle(e)}function Dp(e){return cp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jp(e){if("html"===ap(e))return e;const t=e.assignedSlot||e.parentNode||up(e)&&e.host||sp(e);return up(t)?t.host:t}function Op(e){const t=jp(e);return Mp(t)?e.ownerDocument?e.ownerDocument.body:e.body:dp(t)&&hp(t)?t:Op(t)}function Sp(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=Op(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=ip(o);if(a){const e=Pp(i);return t.concat(i,i.visualViewport||[],hp(o)?o:[],e&&r?Sp(e):[])}return t.concat(o,Sp(o,[],r))}function Pp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ep(e){const t=Cp(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=dp(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=Pu(r)!==a||Pu(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function Tp(e){return cp(e)?e:e.contextElement}function Np(e){const t=Tp(e);if(!dp(t))return Tu(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Ep(t);let i=(a?Pu(r.width):r.width)/n,s=(a?Pu(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const zp=Tu(0);function Ap(e){const t=ip(e);return _p()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zp}function Rp(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=Tp(e);let i=Tu(1);t&&(n?cp(n)&&(i=Np(n)):i=Np(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ip(e))&&t}(a,r,n)?Ap(a):Tu(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const e=ip(a),t=n&&cp(n)?ip(n):n;let r=e,o=Pp(r);for(;o&&n&&t!==r;){const e=Np(o),t=o.getBoundingClientRect(),n=Cp(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=a,c+=i,r=ip(o),o=Pp(r)}}return Qu({width:d,height:u,x:l,y:c})}function Fp(e,t){const r=Dp(e).scrollLeft;return t?t.left+r:Rp(sp(e)).left+r}function Lp(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:Fp(e,n)),y:n.top+t.scrollTop}}const Bp=new Set(["absolute","fixed"]);function Vp(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=ip(e),n=sp(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=_p();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=sp(e),r=Dp(e),n=e.ownerDocument.body,o=Su(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Su(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Fp(e);const s=-r.scrollTop;return"rtl"===Cp(n).direction&&(i+=Su(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(sp(e));else if(cp(t))n=function(e,t){const r=Rp(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=dp(e)?Np(e):Tu(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=Ap(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Qu(n)}function Ip(e,t){const r=jp(e);return!(r===t||!cp(r)||Mp(r))&&("fixed"===Cp(r).position||Ip(r,t))}function qp(e,t){const r=t.get(e);if(r)return r;let n=Sp(e,[],!1).filter(e=>cp(e)&&"body"!==ap(e)),o=null;const a="fixed"===Cp(e).position;let i=a?jp(e):e;for(;cp(i)&&!Mp(i);){const t=Cp(i),r=kp(i);!r&&"fixed"===t.position&&(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&Bp.has(o.position)||hp(i)&&!r&&Ip(e,i))?n=n.filter(e=>e!==i):o=t,i=jp(i)}return t.set(e,n),n}function Hp(e,t,r){const n=dp(t),o=sp(t),a="fixed"===r,i=Rp(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Tu(0);function c(){l.x=Fp(o)}if(n||!n&&!a)if(("body"!==ap(t)||hp(o))&&(s=Dp(t)),n){const e=Rp(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!n&&o&&c();const d=!o||n||a?Tu(0):Lp(o,s);return{x:i.left+s.scrollLeft-l.x-d.x,y:i.top+s.scrollTop-l.y-d.y,width:i.width,height:i.height}}function $p(e){return"static"===Cp(e).position}function Wp(e,t){if(!dp(e)||"fixed"===Cp(e).position)return null;if(t)return t(e);let r=e.offsetParent;return sp(e)===r&&(r=r.ownerDocument.body),r}function Up(e,t){const r=ip(e);if(yp(e))return r;if(!dp(e)){let t=jp(e);for(;t&&!Mp(t);){if(cp(t)&&!$p(t))return t;t=jp(t)}return r}let n=Wp(e,t);for(;n&&mp(n)&&$p(n);)n=Wp(n,t);return n&&Mp(n)&&$p(n)&&!kp(n)?r:n||function(e){let t=jp(e);for(;dp(t)&&!Mp(t);){if(kp(t))return t;if(yp(t))return null;t=jp(t)}return null}(e)||r}const Yp={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,i=sp(n),s=!!t&&yp(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=Tu(1);const d=Tu(0),u=dp(n);if((u||!u&&!a)&&(("body"!==ap(n)||hp(i))&&(l=Dp(n)),dp(n))){const e=Rp(n);c=Np(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const p=!i||u||a?Tu(0):Lp(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:r.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:sp,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?yp(t)?[]:qp(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((e,r)=>{const n=Vp(t,r,o);return e.top=Su(n.top,e.top),e.right=Ou(n.right,e.right),e.bottom=Ou(n.bottom,e.bottom),e.left=Su(n.left,e.left),e},Vp(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Up,getElementRects:async function(e){const t=this.getOffsetParent||Up,r=this.getDimensions,n=await r(e.floating);return{reference:Hp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Ep(e);return{width:t,height:r}},getScale:Np,isElement:cp,isRTL:function(e){return"rtl"===Cp(e).direction}};function Zp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kp(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Tp(e),d=o||a?[...c?Sp(c):[],...Sp(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const u=c&&s?function(e,t){let r,n=null;const o=sp(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-Eu(u)+"px "+-Eu(o.clientWidth-(d+p))+"px "+-Eu(o.clientHeight-(u+h))+"px "+-Eu(d)+"px",threshold:Su(0,Ou(1,l))||1};let m=!0;function v(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1===n&&!Zp(c,e.getBoundingClientRect())&&i(),m=!1}try{n=new IntersectionObserver(v,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,f)}n.observe(e)}(!0),a}(c,r):null;let p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let f,m=l?Rp(e):null;return l&&function t(){const n=Rp(e);m&&!Zp(m,n)&&r(),m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Gp=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=Fu(r),s=Lu(r),l="y"===qu(r),c=np.has(i)?-1:1,d=a&&l?-1:1,u=Ru(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Xp=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Ru(e,t),c={x:r,y:n},d=await ep(t,l),u=qu(Fu(o)),p=Bu(u);let h=c[p],f=c[u];if(a){const e="y"===p?"bottom":"right";h=Au(h+d["y"===p?"top":"left"],h,h-d[e])}if(i){const e="y"===u?"bottom":"right";f=Au(f+d["y"===u?"top":"left"],f,f-d[e])}const m=s.fn({...t,[p]:h,[u]:f});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[u]:i}}}}}},Qp=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...v}=Ru(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=Fu(o),g=qu(s),x=Fu(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),k=p||(x||!m?[Gu(s)]:function(e){const t=Gu(e);return[$u(e),t,$u(t)]}(s)),_="none"!==f;!p&&_&&k.push(...Ku(s,m,f,b));const w=[s,...k],M=await ep(t,v),C=[];let D=(null==(n=a.flip)?void 0:n.overflows)||[];if(d&&C.push(M[y]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=Lu(e),o=Hu(e),a=Vu(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Gu(i)),[i,Gu(i)]}(o,i,b);C.push(M[e[0]],M[e[1]])}if(D=[...D,{placement:o,overflows:C}],!C.every(e=>e<=0)){var j,O;const e=((null==(j=a.flip)?void 0:j.index)||0)+1,t=w[e];if(t&&("alignment"!==u||g===qu(t)||D.every(e=>e.overflows[0]>0&&qu(e.placement)===g)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(O=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!r)switch(h){case"bestFit":{var S;const e=null==(S=D.filter(e=>{if(_){const t=qu(e.placement);return t===g||"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:S[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Jp=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Ru(e,t),d=await ep(t,c),u=Fu(o),p=Lu(o),h="y"===qu(o),{width:f,height:m}=a.floating;let v,y;"top"===u||"bottom"===u?(v=u,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,v="end"===p?"top":"bottom");const g=m-d.top-d.bottom,x=f-d.left-d.right,b=Ou(m-d[v],g),k=Ou(f-d[y],x),_=!t.middlewareData.shift;let w=b,M=k;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(M=x),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(w=g),_&&!p){const e=Su(d.left,0),t=Su(d.right,0),r=Su(d.top,0),n=Su(d.bottom,0);h?M=f-2*(0!==e||0!==t?e+t:Su(d.left,d.right)):w=m-2*(0!==r||0!==n?r+n:Su(d.top,d.bottom))}await l({...t,availableWidth:M,availableHeight:w});const C=await i.getDimensions(s.floating);return f!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},eh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Ru(e,t);switch(n){case"referenceHidden":{const e=tp(await ep(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:rp(e)}}}case"escaped":{const e=tp(await ep(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:rp(e)}}}default:return{}}}}},th=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Ru(e,t)||{};if(null==c)return{};const u=Xu(d),p={x:r,y:n},h=Hu(o),f=Vu(h),m=await i.getDimensions(c),v="y"===h,y=v?"top":"left",g=v?"bottom":"right",x=v?"clientHeight":"clientWidth",b=a.reference[f]+a.reference[h]-p[h]-a.floating[f],k=p[h]-a.reference[h],_=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let w=_?_[x]:0;(!w||!await(null==i.isElement?void 0:i.isElement(_)))&&(w=s.floating[x]||a.floating[f]);const M=b/2-k/2,C=w/2-m[f]/2-1,D=Ou(u[y],C),j=Ou(u[g],C),O=D,S=w-m[f]-j,P=w/2-m[f]/2+M,E=Au(O,P,S),T=!l.arrow&&null!=Lu(o)&&P!==E&&a.reference[f]/2-(P<O?D:j)-m[f]/2<0,N=T?P<O?P-O:P-S:0;return{[h]:p[h]+N,data:{[h]:E,centerOffset:P-E-N,...T&&{alignmentOffset:N}},reset:T}}}),rh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Ru(e,t),d={x:r,y:n},u=qu(o),p=Bu(u);let h=d[p],f=d[u];const m=Ru(s,t),v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,r=a.reference[p]+a.reference[e]-v.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var y,g;const e="y"===p?"width":"height",t=np.has(Fu(o)),r=a.reference[u]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[u])||0)+(t?0:v.crossAxis),n=a.reference[u]+a.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[u])||0)-(t?v.crossAxis:0);f<r?f=r:f>n&&(f=n)}return{[p]:h,[u]:f}}}},nh=(e,t,r)=>{const n=new Map,o={platform:Yp,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Ju(c,n,l),p=n,h={},f=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:v,y:y,data:g,reset:x}=await m({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});d=v??d,u=y??u,h={...h,[a]:{...h[a],...g}},x&&f<=50&&(f++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:d,y:u}=Ju(c,p,l))),r=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var oh=typeof document<"u"?r.useLayoutEffect:function(){};function ah(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!ah(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||ah(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function ih(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sh(e,t){const r=ih(e);return Math.round(t*r)/r}function lh(e){const t=a.useRef(e);return oh(()=>{t.current=e}),t}const ch=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?th({element:r.current,padding:n}).fn(t):{}:r?th({element:r,padding:n}).fn(t):{}}}),dh=(e,t)=>({...Gp(e),options:[e,t]}),uh=(e,t)=>({...Xp(e),options:[e,t]}),ph=(e,t)=>({...rh(e),options:[e,t]}),hh=(e,t)=>({...Qp(e),options:[e,t]}),fh=(e,t)=>({...Jp(e),options:[e,t]}),mh=(e,t)=>({...eh(e),options:[e,t]}),vh=(e,t)=>({...ch(e),options:[e,t]});var yh=a.forwardRef((e,r)=>{const{children:n,width:o=10,height:a=5,...i}=e;return t.jsx(Gd.svg,{...i,ref:r,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});yh.displayName="Arrow";var gh=yh;function xh(e){const[t,r]=a.useState(void 0);return Yd(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var bh="Popper",[kh,_h]=Wd(bh),[wh,Mh]=kh(bh),Ch=e=>{const{__scopePopper:r,children:n}=e,[o,i]=a.useState(null);return t.jsx(wh,{scope:r,anchor:o,onAnchorChange:i,children:n})};Ch.displayName=bh;var Dh="PopperAnchor",jh=a.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:o,...i}=e,s=Mh(Dh,n),l=a.useRef(null),c=Ft(r,l);return a.useEffect(()=>{s.onAnchorChange((null==o?void 0:o.current)||l.current)}),o?null:t.jsx(Gd.div,{...i,ref:c})});jh.displayName=Dh;var Oh="PopperContent",[Sh,Ph]=kh(Oh),Eh=a.forwardRef((e,r)=>{var n,o,s,l,c,d;const{__scopePopper:u,side:p="bottom",sideOffset:h=0,align:f="center",alignOffset:m=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:x=0,sticky:b="partial",hideWhenDetached:k=!1,updatePositionStrategy:_="optimized",onPlaced:w,...M}=e,C=Mh(Oh,u),[D,j]=a.useState(null),O=Ft(r,e=>j(e)),[S,P]=a.useState(null),E=xh(S),T=(null==E?void 0:E.width)??0,N=(null==E?void 0:E.height)??0,z=p+("center"!==f?"-"+f:""),A="number"==typeof x?x:{top:0,right:0,bottom:0,left:0,...x},R=Array.isArray(g)?g:[g],F=R.length>0,L={padding:A,boundary:R.filter(Ah),altBoundary:F},{refs:B,floatingStyles:V,placement:I,isPositioned:q,middlewareData:H}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,h]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=a.useState(n);ah(f,n)||m(n);const[v,y]=a.useState(null),[g,x]=a.useState(null),b=a.useCallback(e=>{e!==M.current&&(M.current=e,y(e))},[]),k=a.useCallback(e=>{e!==C.current&&(C.current=e,x(e))},[]),_=s||v,w=l||g,M=a.useRef(null),C=a.useRef(null),D=a.useRef(p),j=null!=d,O=lh(d),S=lh(o),P=lh(u),E=a.useCallback(()=>{if(!M.current||!C.current)return;const e={placement:t,strategy:r,middleware:f};S.current&&(e.platform=S.current),nh(M.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};T.current&&!ah(D.current,t)&&(D.current=t,i.flushSync(()=>{h(t)}))})},[f,t,r,S,P]);oh(()=>{!1===u&&D.current.isPositioned&&(D.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const T=a.useRef(!1);oh(()=>(T.current=!0,()=>{T.current=!1}),[]),oh(()=>{if(_&&(M.current=_),w&&(C.current=w),_&&w){if(O.current)return O.current(_,w,E);E()}},[_,w,E,O,j]);const N=a.useMemo(()=>({reference:M,floating:C,setReference:b,setFloating:k}),[b,k]),z=a.useMemo(()=>({reference:_,floating:w}),[_,w]),A=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!z.floating)return e;const t=sh(z.floating,p.x),n=sh(z.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ih(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,z.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:E,refs:N,elements:z,floatingStyles:A}),[p,E,N,z,A])}({strategy:"fixed",placement:z,whileElementsMounted:(...e)=>Kp(...e,{animationFrame:"always"===_}),elements:{reference:C.anchor},middleware:[dh({mainAxis:h+N,alignmentAxis:m}),y&&uh({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?ph():void 0,...L}),y&&hh({...L}),fh({...L,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&vh({element:S,padding:v}),Rh({arrowWidth:T,arrowHeight:N}),k&&mh({strategy:"referenceHidden",...L})]}),[$,W]=Fh(I),U=tu(w);Yd(()=>{q&&(null==U||U())},[q,U]);const Y=null==(n=H.arrow)?void 0:n.x,Z=null==(o=H.arrow)?void 0:o.y,K=0!==(null==(s=H.arrow)?void 0:s.centerOffset),[G,X]=a.useState();return Yd(()=>{D&&X(window.getComputedStyle(D).zIndex)},[D]),t.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[null==(l=H.transformOrigin)?void 0:l.x,null==(c=H.transformOrigin)?void 0:c.y].join(" "),...(null==(d=H.hide)?void 0:d.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Sh,{scope:u,placedSide:$,onArrowChange:P,arrowX:Y,arrowY:Z,shouldHideArrow:K,children:t.jsx(Gd.div,{"data-side":$,"data-align":W,...M,ref:O,style:{...M.style,animation:q?void 0:"none"}})})})});Eh.displayName=Oh;var Th="PopperArrow",Nh={top:"bottom",right:"left",bottom:"top",left:"right"},zh=a.forwardRef(function(e,r){const{__scopePopper:n,...o}=e,a=Ph(Th,n),i=Nh[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(gh,{...o,ref:r,style:{...o.style,display:"block"}})})});function Ah(e){return null!==e}zh.displayName=Th;var Rh=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o;const{placement:a,rects:i,middlewareData:s}=t,l=0!==(null==(r=s.arrow)?void 0:r.centerOffset),c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,p]=Fh(a),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(n=s.arrow)?void 0:n.x)??0)+c/2,m=((null==(o=s.arrow)?void 0:o.y)??0)+d/2;let v="",y="";return"bottom"===u?(v=l?h:`${f}px`,y=-d+"px"):"top"===u?(v=l?h:`${f}px`,y=`${i.floating.height+d}px`):"right"===u?(v=-d+"px",y=l?h:`${m}px`):"left"===u&&(v=`${i.floating.width+d}px`,y=l?h:`${m}px`),{data:{x:v,y:y}}}});function Fh(e){const[t,r="center"]=e.split("-");return[t,r]}var Lh=Ch,Bh=jh,Vh=Eh,Ih=zh,qh=a.forwardRef((e,r)=>{var o;const{container:i,...s}=e,[l,c]=a.useState(!1);Yd(()=>c(!0),[]);const d=i||l&&(null==(o=null==globalThis?void 0:globalThis.document)?void 0:o.body);return d?n.createPortal(t.jsx(Gd.div,{...s,ref:r}),d):null});qh.displayName="Portal";var Hh=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const e=$h(n.current);i.current="mounted"===l?e:"none"},[l]),Yd(()=>{const t=n.current,r=o.current;if(r!==e){const n=i.current,a=$h(t);e?c("MOUNT"):"none"===a||"none"===(null==t?void 0:t.display)?c("UNMOUNT"):c(r&&n!==a?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Yd(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=$h(n.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(i.current=$h(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),i=Ft(n.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof r||n.isPresent?a.cloneElement(o,{ref:i}):null};function $h(e){return(null==e?void 0:e.animationName)||"none"}Hh.displayName="Presence";var Wh="rovingFocusGroup.onEntryFocus",Uh={bubbles:!1,cancelable:!0},Yh="RovingFocusGroup",[Zh,Kh,Gh]=Qd(Yh),[Xh,Qh]=Wd(Yh,[Gh]),[Jh,ef]=Xh(Yh),tf=a.forwardRef((e,r)=>t.jsx(Zh.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Zh.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(rf,{...e,ref:r})})}));tf.displayName=Yh;var rf=a.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...h}=e,f=a.useRef(null),m=Ft(r,f),v=eu(s),[y,g]=Kd({prop:l,defaultProp:c??null,onChange:d,caller:Yh}),[x,b]=a.useState(!1),k=tu(u),_=Kh(n),w=a.useRef(!1),[M,C]=a.useState(0);return a.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Wh,k),()=>e.removeEventListener(Wh,k)},[k]),t.jsx(Jh,{scope:n,orientation:o,dir:v,loop:i,currentTabStopId:y,onItemFocus:a.useCallback(e=>g(e),[g]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Gd.div,{tabIndex:x||0===M?-1:0,"data-orientation":o,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:$d(e.onMouseDown,()=>{w.current=!0}),onFocus:$d(e.onFocus,e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!x){const t=new CustomEvent(Wh,Uh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=_().filter(e=>e.focusable),t=e.find(e=>e.active),r=e.find(e=>e.id===y),n=[t,r,...e].filter(Boolean).map(e=>e.ref.current);sf(n,p)}}w.current=!1}),onBlur:$d(e.onBlur,()=>b(!1))})})}),nf="RovingFocusGroupItem",of=a.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=Du(),u=s||d,p=ef(nf,n),h=p.currentTabStopId===u,f=Kh(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return a.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),t.jsx(Zh.ItemSlot,{scope:n,id:u,focusable:o,active:i,children:t.jsx(Gd.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:r,onMouseDown:$d(e.onMouseDown,e=>{o?p.onItemFocus(u):e.preventDefault()}),onFocus:$d(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:$d(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return af[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>sf(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=y}):l})})});of.displayName=nf;var af={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sf(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var lf=tf,cf=of,df=new WeakMap,uf=new WeakMap,pf={},hf=0,ff=function(e){return e&&(e.host||ff(e.parentNode))},mf=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=ff(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);pf[r]||(pf[r]=new WeakMap);var a=pf[r],i=[],s=new Set,l=new Set(o),c=function(e){!e||s.has(e)||(s.add(e),c(e.parentNode))};o.forEach(c);var d=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))d(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(df.get(e)||0)+1,c=(a.get(e)||0)+1;df.set(e,l),a.set(e,c),i.push(e),1===l&&o&&uf.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),s.clear(),hf++,function(){i.forEach(function(e){var t=df.get(e)-1,o=a.get(e)-1;df.set(e,t),a.set(e,o),t||(uf.has(e)||e.removeAttribute(n),uf.delete(e)),o||e.removeAttribute(r)}),--hf||(df=new WeakMap,df=new WeakMap,uf=new WeakMap,pf={})}},vf=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),mf(n,o,r,"aria-hidden")):function(){return null}},yf=function(){return yf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yf.apply(this,arguments)};function gf(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function xf(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var bf="right-scroll-bar-position",kf="width-before-scroll-bar";function _f(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var wf=typeof window<"u"?a.useLayoutEffect:a.useEffect,Mf=new WeakMap;function Cf(e,t){var n=function(e,t){var n=r.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(null,function(t){return e.forEach(function(e){return _f(e,t)})});return wf(function(){var t=Mf.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||_f(e,null)}),o.forEach(function(e){r.has(e)||_f(e,a)})}Mf.set(n,e)},[e]),n}function Df(e){return e}function jf(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Df);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return o}(null);return t.options=yf({async:!0,ssr:!1},e),t}var Of=function(e){var t=e.sideCar,r=gf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,yf({},r))};function Sf(e,t){return e.useMedium(t),Of}Of.isSideCarExport=!0;var Pf=jf(),Ef=function(){},Tf=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:Ef,onWheelCapture:Ef,onTouchMoveCapture:Ef}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,x=void 0===g?"div":g,b=e.gapMode,k=gf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,w=Cf([r,t]),M=yf(yf({},k),o);return a.createElement(a.Fragment,null,u&&a.createElement(_,{sideCar:Pf,removeScrollBar:d,shards:p,noRelative:f,noIsolation:m,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:r,gapMode:b}),s?a.cloneElement(a.Children.only(l),yf(yf({},M),{ref:w})):a.createElement(x,yf({},M,{className:c,ref:w}),l))});Tf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tf.classNames={fullWidth:kf,zeroRight:bf};function Nf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var zf=function(){var e=0,t=null;return{add:function(r){0==e&&(t=Nf())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,r),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Af=function(){var e=function(){var e=zf();return function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}}();return function(t){var r=t.styles,n=t.dynamic;return e(r,n),null}},Rf={left:0,top:0,right:0,gap:0},Ff=function(e){return parseInt(e||"",10)||0},Lf=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return Rf;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Ff(r),Ff(n),Ff(o)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Bf=Af(),Vf="data-scroll-locked",If=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(Vf,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(bf," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(kf," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(bf," .").concat(bf," {\n right: 0 ").concat(n,";\n }\n \n .").concat(kf," .").concat(kf," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Vf,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},qf=function(){var e=parseInt(document.body.getAttribute(Vf)||"0",10);return isFinite(e)?e:0},Hf=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(Vf,(qf()+1).toString()),function(){var e=qf()-1;e<=0?document.body.removeAttribute(Vf):document.body.setAttribute(Vf,e.toString())}},[]);var i=a.useMemo(function(){return Lf(o)},[o]);return a.createElement(Bf,{styles:If(i,!t,o,r?"":"!important")})},$f=!1;if(typeof window<"u")try{var Wf=Object.defineProperty({},"passive",{get:function(){return $f=!0,!0}});window.addEventListener("test",Wf,Wf),window.removeEventListener("test",Wf,Wf)}catch{$f=!1}var Uf=!!$f&&{passive:!1},Yf=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Zf=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),Kf(e,n)){var o=Gf(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Kf=function(e,t){return"v"===e?function(e){return Yf(e,"overflowY")}(t):function(e){return Yf(e,"overflowX")}(t)},Gf=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Xf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qf=function(e){return[e.deltaX,e.deltaY]},Jf=function(e){return e&&"current"in e?e.current:e},em=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},tm=0,rm=[];function nm(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const om=Sf(Pf,function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(tm++)[0],i=a.useState(Af)[0],s=a.useRef(e);a.useEffect(function(){s.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=xf([e.lockRef.current],(e.shards||[]).map(Jf),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=Xf(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=Zf(u,d);if(!p)return!0;if(p?o=u:(o="v"===u?"h":"v",p=Zf(u,d)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,d=0,u=0;do{if(!i)break;var p=Gf(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&Kf(e,i)&&(d+=f,u+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(d)<1||!c&&Math.abs(u)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=a.useCallback(function(e){var r=e;if(rm.length&&rm[rm.length-1]===i){var n="deltaY"in r?Qf(r):Xf(r),o=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var a=(s.current.shards||[]).map(Jf).filter(Boolean).filter(function(e){return e.contains(r.target)});(a.length>0?l(r,a[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:nm(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=a.useCallback(function(e){r.current=Xf(e),n.current=void 0},[]),p=a.useCallback(function(t){d(t.type,Qf(t),t.target,l(t,e.lockRef.current))},[]),h=a.useCallback(function(t){d(t.type,Xf(t),t.target,l(t,e.lockRef.current))},[]);a.useEffect(function(){return rm.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Uf),document.addEventListener("touchmove",c,Uf),document.addEventListener("touchstart",u,Uf),function(){rm=rm.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,Uf),document.removeEventListener("touchmove",c,Uf),document.removeEventListener("touchstart",u,Uf)}},[]);var f=e.removeScrollBar,m=e.inert;return a.createElement(a.Fragment,null,m?a.createElement(i,{styles:em(o)}):null,f?a.createElement(Hf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var am=a.forwardRef(function(e,t){return a.createElement(Tf,yf({},e,{ref:t,sideCar:om}))});am.classNames=Tf.classNames;var im=["Enter"," "],sm=["ArrowUp","PageDown","End"],lm=["ArrowDown","PageUp","Home",...sm],cm={ltr:[...im,"ArrowRight"],rtl:[...im,"ArrowLeft"]},dm={ltr:["ArrowLeft"],rtl:["ArrowRight"]},um="Menu",[pm,hm,fm]=Qd(um),[mm,vm]=Wd(um,[fm,_h,Qh]),ym=_h(),gm=Qh(),[xm,bm]=mm(um),[km,_m]=mm(um),wm=e=>{const{__scopeMenu:r,open:n=!1,children:o,dir:i,onOpenChange:s,modal:l=!0}=e,c=ym(r),[d,u]=a.useState(null),p=a.useRef(!1),h=tu(s),f=eu(i);return a.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.jsx(Lh,{...c,children:t.jsx(xm,{scope:r,open:n,onOpenChange:h,content:d,onContentChange:u,children:t.jsx(km,{scope:r,onClose:a.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:o})})})};wm.displayName=um;var Mm=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=ym(n);return t.jsx(Bh,{...a,...o,ref:r})});Mm.displayName="MenuAnchor";var Cm="MenuPortal",[Dm,jm]=mm(Cm,{forceMount:void 0}),Om=e=>{const{__scopeMenu:r,forceMount:n,children:o,container:a}=e,i=bm(Cm,r);return t.jsx(Dm,{scope:r,forceMount:n,children:t.jsx(Hh,{present:n||i.open,children:t.jsx(qh,{asChild:!0,container:a,children:o})})})};Om.displayName=Cm;var Sm="MenuContent",[Pm,Em]=mm(Sm),Tm=a.forwardRef((e,r)=>{const n=jm(Sm,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=bm(Sm,e.__scopeMenu),s=_m(Sm,e.__scopeMenu);return t.jsx(pm.Provider,{scope:e.__scopeMenu,children:t.jsx(Hh,{present:o||i.open,children:t.jsx(pm.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(Nm,{...a,ref:r}):t.jsx(zm,{...a,ref:r})})})})}),Nm=a.forwardRef((e,r)=>{const n=bm(Sm,e.__scopeMenu),o=a.useRef(null),i=Ft(r,o);return a.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),t.jsx(Rm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$d(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zm=a.forwardRef((e,r)=>{const n=bm(Sm,e.__scopeMenu);return t.jsx(Rm,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Am=Lt("MenuContent.ScrollLock"),Rm=a.forwardRef((e,r)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:v,...y}=e,g=bm(Sm,n),x=_m(Sm,n),b=ym(n),k=gm(n),_=hm(n),[w,M]=a.useState(null),C=a.useRef(null),D=Ft(r,C,g.onContentChange),j=a.useRef(0),O=a.useRef(""),S=a.useRef(0),P=a.useRef(null),E=a.useRef("right"),T=a.useRef(0),N=v?am:a.Fragment,z=v?{as:Am,allowPinchZoom:!0}:void 0,A=e=>{var t,r;const n=O.current+e,o=_().filter(e=>!e.disabled),a=document.activeElement,i=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,s=o.map(e=>e.textValue),l=function(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}(s,n,i),c=null==(r=o.find(e=>e.textValue===l))?void 0:r.ref.current;(function e(t){O.current=t,window.clearTimeout(j.current),""!==t&&(j.current=window.setTimeout(()=>e(""),1e3))})(n),c&&setTimeout(()=>c.focus())};a.useEffect(()=>()=>window.clearTimeout(j.current),[]),pu();const R=a.useCallback(e=>{var t,r;return E.current===(null==(t=P.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>n!=u>n&&r<(d-l)*(n-c)/(u-c)+l&&(o=!o)}return o}(r,t)}(e,null==(r=P.current)?void 0:r.area)},[]);return t.jsx(Pm,{scope:n,searchRef:O,onItemEnter:a.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:a.useCallback(e=>{var t;R(e)||(null==(t=C.current)||t.focus(),M(null))},[R]),onTriggerLeave:a.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:S,onPointerGraceIntentChange:a.useCallback(e=>{P.current=e},[]),children:t.jsx(N,{...z,children:t.jsx(yu,{asChild:!0,trapped:i,onMountAutoFocus:$d(s,e=>{var t;e.preventDefault(),null==(t=C.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(su,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:t.jsx(lf,{asChild:!0,...k,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:w,onCurrentTabStopIdChange:M,onEntryFocus:$d(d,e=>{x.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Vh,{role:"menu","aria-orientation":"vertical","data-state":lv(g.open),"data-radix-menu-content":"",dir:x.dir,...b,...y,ref:D,style:{outline:"none",...y.style},onKeyDown:$d(y.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&A(e.key));const o=C.current;if(e.target!==o||!lm.includes(e.key))return;e.preventDefault();const a=_().filter(e=>!e.disabled).map(e=>e.ref.current);sm.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:$d(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),O.current="")}),onPointerMove:$d(e.onPointerMove,uv(e=>{const t=e.target,r=T.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>T.current?"right":"left";E.current=t,T.current=e.clientX}}))})})})})})})});Tm.displayName=Sm;var Fm=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Gd.div,{role:"group",...o,ref:r})});Fm.displayName="MenuGroup";var Lm=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Gd.div,{...o,ref:r})});Lm.displayName="MenuLabel";var Bm="MenuItem",Vm="menu.itemSelect",Im=a.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:o,...i}=e,s=a.useRef(null),l=_m(Bm,e.__scopeMenu),c=Em(Bm,e.__scopeMenu),d=Ft(r,s),u=a.useRef(!1);return t.jsx(qm,{...i,ref:d,disabled:n,onClick:$d(e.onClick,()=>{const e=s.current;if(!n&&e){const t=new CustomEvent(Vm,{bubbles:!0,cancelable:!0});e.addEventListener(Vm,e=>null==o?void 0:o(e),{once:!0}),Xd(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),u.current=!0},onPointerUp:$d(e.onPointerUp,e=>{var t;u.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:$d(e.onKeyDown,e=>{const t=""!==c.searchRef.current;n||t&&" "===e.key||im.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Im.displayName=Bm;var qm=a.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:o=!1,textValue:i,...s}=e,l=Em(Bm,n),c=gm(n),d=a.useRef(null),u=Ft(r,d),[p,h]=a.useState(!1),[f,m]=a.useState("");return a.useEffect(()=>{const e=d.current;e&&m((e.textContent??"").trim())},[s.children]),t.jsx(pm.ItemSlot,{scope:n,disabled:o,textValue:i??f,children:t.jsx(cf,{asChild:!0,...c,focusable:!o,children:t.jsx(Gd.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:u,onPointerMove:$d(e.onPointerMove,uv(e=>{o?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$d(e.onPointerLeave,uv(e=>l.onItemLeave(e))),onFocus:$d(e.onFocus,()=>h(!0)),onBlur:$d(e.onBlur,()=>h(!1))})})})}),Hm=a.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:o,...a}=e;return t.jsx(Xm,{scope:e.__scopeMenu,checked:n,children:t.jsx(Im,{role:"menuitemcheckbox","aria-checked":cv(n)?"mixed":n,...a,ref:r,"data-state":dv(n),onSelect:$d(a.onSelect,()=>null==o?void 0:o(!!cv(n)||!n),{checkForDefaultPrevented:!1})})})});Hm.displayName="MenuCheckboxItem";var $m="MenuRadioGroup",[Wm,Um]=mm($m,{value:void 0,onValueChange:()=>{}}),Ym=a.forwardRef((e,r)=>{const{value:n,onValueChange:o,...a}=e,i=tu(o);return t.jsx(Wm,{scope:e.__scopeMenu,value:n,onValueChange:i,children:t.jsx(Fm,{...a,ref:r})})});Ym.displayName=$m;var Zm="MenuRadioItem",Km=a.forwardRef((e,r)=>{const{value:n,...o}=e,a=Um(Zm,e.__scopeMenu),i=n===a.value;return t.jsx(Xm,{scope:e.__scopeMenu,checked:i,children:t.jsx(Im,{role:"menuitemradio","aria-checked":i,...o,ref:r,"data-state":dv(i),onSelect:$d(o.onSelect,()=>{var e;return null==(e=a.onValueChange)?void 0:e.call(a,n)},{checkForDefaultPrevented:!1})})})});Km.displayName=Zm;var Gm="MenuItemIndicator",[Xm,Qm]=mm(Gm,{checked:!1}),Jm=a.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:o,...a}=e,i=Qm(Gm,n);return t.jsx(Hh,{present:o||cv(i.checked)||!0===i.checked,children:t.jsx(Gd.span,{...a,ref:r,"data-state":dv(i.checked)})})});Jm.displayName=Gm;var ev=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Gd.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});ev.displayName="MenuSeparator";var tv=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=ym(n);return t.jsx(Ih,{...a,...o,ref:r})});tv.displayName="MenuArrow";var[rv,nv]=mm("MenuSub"),ov="MenuSubTrigger",av=a.forwardRef((e,r)=>{const n=bm(ov,e.__scopeMenu),o=_m(ov,e.__scopeMenu),i=nv(ov,e.__scopeMenu),s=Em(ov,e.__scopeMenu),l=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:e.__scopeMenu},p=a.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return a.useEffect(()=>p,[p]),a.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),t.jsx(Mm,{asChild:!0,...u,children:t.jsx(qm,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":lv(n.open),...e,ref:Rt(r,i.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$d(e.onPointerMove,uv(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:$d(e.onPointerLeave,uv(e=>{var t,r;p();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,a="right"===t,i=a?-5:5,l=o[a?"left":"right"],d=o[a?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:l,y:o.top},{x:d,y:o.top},{x:d,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:$d(e.onKeyDown,t=>{var r;const a=""!==s.searchRef.current;e.disabled||a&&" "===t.key||cm[o.dir].includes(t.key)&&(n.onOpenChange(!0),null==(r=n.content)||r.focus(),t.preventDefault())})})})});av.displayName=ov;var iv="MenuSubContent",sv=a.forwardRef((e,r)=>{const n=jm(Sm,e.__scopeMenu),{forceMount:o=n.forceMount,...i}=e,s=bm(Sm,e.__scopeMenu),l=_m(Sm,e.__scopeMenu),c=nv(iv,e.__scopeMenu),d=a.useRef(null),u=Ft(r,d);return t.jsx(pm.Provider,{scope:e.__scopeMenu,children:t.jsx(Hh,{present:o||s.open,children:t.jsx(pm.Slot,{scope:e.__scopeMenu,children:t.jsx(Rm,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;l.isUsingKeyboardRef.current&&(null==(t=d.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:$d(e.onFocusOutside,e=>{e.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:$d(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:$d(e.onKeyDown,e=>{var t;const r=e.currentTarget.contains(e.target),n=dm[l.dir].includes(e.key);r&&n&&(s.onOpenChange(!1),null==(t=c.trigger)||t.focus(),e.preventDefault())})})})})})});function lv(e){return e?"open":"closed"}function cv(e){return"indeterminate"===e}function dv(e){return cv(e)?"indeterminate":e?"checked":"unchecked"}function uv(e){return t=>"mouse"===t.pointerType?e(t):void 0}sv.displayName=iv;var pv=wm,hv=Mm,fv=Om,mv=Tm,vv=Fm,yv=Lm,gv=Im,xv=Hm,bv=Ym,kv=Km,_v=Jm,wv=ev,Mv=tv,Cv=av,Dv=sv,jv="DropdownMenu",[Ov,Sv]=Wd(jv,[vm]),Pv=vm(),[Ev,Tv]=Ov(jv),Nv=e=>{const{__scopeDropdownMenu:r,children:n,dir:o,open:i,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=Pv(r),u=a.useRef(null),[p,h]=Kd({prop:i,defaultProp:s??!1,onChange:l,caller:jv});return t.jsx(Ev,{scope:r,triggerId:Du(),triggerRef:u,contentId:Du(),open:p,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),modal:c,children:t.jsx(pv,{...d,open:p,onOpenChange:h,dir:o,modal:c,children:n})})};Nv.displayName=jv;var zv="DropdownMenuTrigger",Av=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=e,i=Tv(zv,n),s=Pv(n);return t.jsx(hv,{asChild:!0,...s,children:t.jsx(Gd.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:Rt(r,i.triggerRef),onPointerDown:$d(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:$d(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Av.displayName=zv;var Rv=e=>{const{__scopeDropdownMenu:r,...n}=e,o=Pv(r);return t.jsx(fv,{...o,...n})};Rv.displayName="DropdownMenuPortal";var Fv="DropdownMenuContent",Lv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,i=Tv(Fv,n),s=Pv(n),l=a.useRef(!1);return t.jsx(mv,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...o,ref:r,onCloseAutoFocus:$d(e.onCloseAutoFocus,e=>{var t;l.current||null==(t=i.triggerRef.current)||t.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:$d(e.onInteractOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!i.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Lv.displayName=Fv;var Bv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(vv,{...a,...o,ref:r})});Bv.displayName="DropdownMenuGroup";var Vv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(yv,{...a,...o,ref:r})});Vv.displayName="DropdownMenuLabel";var Iv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(gv,{...a,...o,ref:r})});Iv.displayName="DropdownMenuItem";var qv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(xv,{...a,...o,ref:r})});qv.displayName="DropdownMenuCheckboxItem";var Hv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(bv,{...a,...o,ref:r})});Hv.displayName="DropdownMenuRadioGroup";var $v=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(kv,{...a,...o,ref:r})});$v.displayName="DropdownMenuRadioItem";var Wv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(_v,{...a,...o,ref:r})});Wv.displayName="DropdownMenuItemIndicator";var Uv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(wv,{...a,...o,ref:r})});Uv.displayName="DropdownMenuSeparator";var Yv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(Mv,{...a,...o,ref:r})});Yv.displayName="DropdownMenuArrow";var Zv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(Cv,{...a,...o,ref:r})});Zv.displayName="DropdownMenuSubTrigger";var Kv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(Dv,{...a,...o,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Kv.displayName="DropdownMenuSubContent";var Gv=Rv,Xv=Lv,Qv=Vv,Jv=Iv,ey=qv,ty=$v,ry=Wv,ny=Uv,oy=Zv,ay=Kv;const iy=Nv,sy=Av,ly=a.forwardRef(({className:e,inset:r,children:n,...o},a)=>t.jsxs(oy,{ref:a,className:Br("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...o,children:[n,t.jsx(gt,{className:"ml-auto"})]}));ly.displayName=oy.displayName;const cy=a.forwardRef(({className:e,...r},n)=>t.jsx(ay,{ref:n,className:Br("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));cy.displayName=ay.displayName;const dy=a.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(Gv,{children:t.jsx(Xv,{ref:o,sideOffset:r,className:Br("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));dy.displayName=Xv.displayName;const uy=a.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(Jv,{ref:o,className:Br("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...n}));uy.displayName=Jv.displayName;const py=a.forwardRef(({className:e,children:r,checked:n,...o},a)=>t.jsxs(ey,{ref:a,className:Br("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(ry,{children:t.jsx(mt,{className:"h-4 w-4"})})}),r]}));py.displayName=ey.displayName;const hy=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(ty,{ref:o,className:Br("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(ry,{children:t.jsx(_t,{className:"h-2 w-2 fill-current"})})}),r]}));hy.displayName=ty.displayName;const fy=a.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(Qv,{ref:o,className:Br("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));fy.displayName=Qv.displayName;const my=a.forwardRef(({className:e,...r},n)=>t.jsx(ny,{ref:n,className:Br("-mx-1 my-1 h-px bg-muted",e),...r}));my.displayName=ny.displayName;const vy=({isFilterOpen:e,setIsFilterOpen:r,selectedColors:n,toggleColorSelection:o,currentConfig:a})=>t.jsxs(iy,{open:e,onOpenChange:r,children:[t.jsx(sy,{asChild:!0,children:t.jsx(Ir,{variant:"outline",size:"sm",className:"w-20 overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsxs(qd.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(Ct,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?a.localization.filtering:a.localization.filter})]},e?"open":"closed")})})}),t.jsxs(dy,{children:[t.jsx(fy,{children:a.localization.filterByColor}),t.jsx(my,{}),s.map(e=>t.jsx(py,{checked:n.includes(e.value),onCheckedChange:()=>o(e.value),onSelect:e=>{e.preventDefault()},children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value)),t.jsx(my,{}),t.jsx(Ir,{variant:"ghost",size:"sm",onClick:()=>r(!1),className:"w-full justify-center h-8 text-sm",children:a.localization.close})]})]}),yy=({handleTodayClick:e,isTodayDisabled:r,getTodayButtonText:n})=>t.jsx(Ir,{variant:"outline",size:"sm",onClick:e,disabled:r,className:"flex items-center space-x-1 w-28 h-10 justify-center overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsxs(qd.div,{className:"flex items-center space-x-1",initial:{opacity:0},animate:{opacity:[0,1.05,1]},transition:{duration:.2,times:[0,.8,1]},children:[t.jsx(ft,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{children:n()})]},n())})});var gy=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xy=a.forwardRef((e,r)=>t.jsx(Gd.span,{...e,ref:r,style:{...gy,...e.style}}));xy.displayName="VisuallyHidden";var by=xy,[ky,_y]=Wd("Tooltip",[_h]),wy=_h(),My="TooltipProvider",Cy=700,Dy="tooltip.open",[jy,Oy]=ky(My),Sy=e=>{const{__scopeTooltip:r,delayDuration:n=Cy,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:s}=e,l=a.useRef(!0),c=a.useRef(!1),d=a.useRef(0);return a.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),t.jsx(jy,{scope:r,isOpenDelayedRef:l,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:s})};Sy.displayName=My;var Py="Tooltip",[Ey,Ty]=ky(Py),Ny=e=>{const{__scopeTooltip:r,children:n,open:o,defaultOpen:i,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,d=Oy(Py,e.__scopeTooltip),u=wy(r),[p,h]=a.useState(null),f=Du(),m=a.useRef(0),v=l??d.disableHoverableContent,y=c??d.delayDuration,g=a.useRef(!1),[x,b]=Kd({prop:o,defaultProp:i??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(Dy))):d.onClose(),null==s||s(e)},caller:Py}),k=a.useMemo(()=>x?g.current?"delayed-open":"instant-open":"closed",[x]),_=a.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,b(!0)},[b]),w=a.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),M=a.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,b(!0),m.current=0},y)},[y,b]);return a.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),t.jsx(Lh,{...u,children:t.jsx(Ey,{scope:r,contentId:f,open:x,stateAttribute:k,trigger:p,onTriggerChange:h,onTriggerEnter:a.useCallback(()=>{d.isOpenDelayedRef.current?M():_()},[d.isOpenDelayedRef,M,_]),onTriggerLeave:a.useCallback(()=>{v?w():(window.clearTimeout(m.current),m.current=0)},[w,v]),onOpen:_,onClose:w,disableHoverableContent:v,children:n})})};Ny.displayName=Py;var zy="TooltipTrigger",Ay=a.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,i=Ty(zy,n),s=Oy(zy,n),l=wy(n),c=Ft(r,a.useRef(null),i.onTriggerChange),d=a.useRef(!1),u=a.useRef(!1),p=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Bh,{asChild:!0,...l,children:t.jsx(Gd.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...o,ref:c,onPointerMove:$d(e.onPointerMove,e=>{"touch"!==e.pointerType&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:$d(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:$d(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:$d(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:$d(e.onBlur,i.onClose),onClick:$d(e.onClick,i.onClose)})})});Ay.displayName=zy;var[Ry,Fy]=ky("TooltipPortal",{forceMount:void 0}),Ly="TooltipContent",By=a.forwardRef((e,r)=>{const n=Fy(Ly,e.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=e,s=Ty(Ly,e.__scopeTooltip);return t.jsx(Hh,{present:o||s.open,children:s.disableHoverableContent?t.jsx($y,{side:a,...i,ref:r}):t.jsx(Vy,{side:a,...i,ref:r})})}),Vy=a.forwardRef((e,r)=>{const n=Ty(Ly,e.__scopeTooltip),o=Oy(Ly,e.__scopeTooltip),i=a.useRef(null),s=Ft(r,i),[l,c]=a.useState(null),{trigger:d,onClose:u}=n,p=i.current,{onPointerInTransitChange:h}=o,f=a.useCallback(()=>{c(null),h(!1)},[h]),m=a.useCallback((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect()),a=function(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,o),i=function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect()),s=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...a,...i]);c(s),h(!0)},[h]);return a.useEffect(()=>()=>f(),[f]),a.useEffect(()=>{if(d&&p){const e=e=>m(e,p),t=e=>m(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,m,f]),a.useEffect(()=>{if(l){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==d?void 0:d.contains(t))||(null==p?void 0:p.contains(t)),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>n!=u>n&&r<(d-l)*(n-c)/(u-c)+l&&(o=!o)}return o}(r,l);n?f():o&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,f]),t.jsx($y,{...e,ref:s})}),[Iy,qy]=ky(Py,{isInside:!1}),Hy=It("TooltipContent"),$y=a.forwardRef((e,r)=>{const{__scopeTooltip:n,children:o,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=e,d=Ty(Ly,n),u=wy(n),{onClose:p}=d;return a.useEffect(()=>(document.addEventListener(Dy,p),()=>document.removeEventListener(Dy,p)),[p]),a.useEffect(()=>{if(d.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(d.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]),t.jsx(su,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Vh,{"data-state":d.stateAttribute,...u,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(Hy,{children:o}),t.jsx(Iy,{scope:n,isInside:!0,children:t.jsx(by,{id:d.contentId,role:"tooltip",children:i||o})})]})})});By.displayName=Ly;var Wy="TooltipArrow",Uy=a.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=wy(n);return qy(Wy,n).isInside?null:t.jsx(Ih,{...a,...o,ref:r})});Uy.displayName=Wy;var Yy=By;const Zy=Sy,Ky=Ny,Gy=Ay,Xy=a.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(Yy,{ref:o,sideOffset:r,className:Br("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Xy.displayName=Yy.displayName;const Qy=({isListView:e,setIsListView:r,currentConfig:n})=>t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{asChild:!0,children:t.jsx(Ir,{variant:"outline",size:"sm",onClick:()=>r(!e),className:"flex items-center space-x-1 w-10 h-10 justify-center overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsx(qd.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:e?t.jsx(ft,{className:"h-4 w-4"}):t.jsx(Ot,{className:"h-4 w-4"})},e?"list":"calendar")})})}),t.jsx(Xy,{children:t.jsx("p",{children:e?n.localization.displayCalendar:n.localization.displayList})})]})}),Jy=({currentView:e,setCurrentView:r,viewOptions:n,currentConfig:o})=>t.jsx("div",{className:"inline-flex items-center rounded-md border border-input bg-transparent p-1 w-full sm:w-[240px]",children:t.jsx(Zy,{children:n.map(n=>{const a=n.icon,i=e===n.value;return t.jsxs(Ky,{children:[t.jsx(Gy,{asChild:!0,children:t.jsx(qd.div,{className:"relative flex-grow",initial:!1,animate:{flex:i?2:1},transition:{duration:.2},children:t.jsx(Ir,{variant:i?"secondary":"ghost",size:"sm",className:Br("relative h-8 w-full overflow-hidden transition-colors",i?"bg-secondary text-secondary-foreground":"hover:bg-secondary/50 hover:text-secondary-foreground",!i&&"cursor-pointer"),onClick:()=>r(n.value),children:t.jsxs("div",{className:"flex items-center justify-center space-x-1 w-full",children:[t.jsx(a,{className:Br("h-4 w-4 flex-shrink-0",i?"text-primary":"text-muted-foreground")}),t.jsx(tn,{children:i&&t.jsx(qd.span,{className:"text-xs font-medium whitespace-nowrap overflow-hidden",initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.2},children:n.label})})]})})})}),t.jsx(Xy,{children:t.jsx("p",{children:`${o.localization.viewBy} ${n.label}`})})]},n.value)})})});function eg(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var tg=["color"],rg=r.forwardRef(function(e,t){var n=e.color,o=void 0===n?"currentColor":n,a=eg(e,tg);return r.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),r.createElement("path",{d:"M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),ng=["color"],og=r.forwardRef(function(e,t){var n=e.color,o=void 0===n?"currentColor":n,a=eg(e,ng);return r.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),r.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),ag=["color"],ig=r.forwardRef(function(e,t){var n=e.color,o=void 0===n?"currentColor":n,a=eg(e,ag);return r.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),r.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),sg=.999,lg=/[\\\/_+.#"@\[\(\{&]/,cg=/[\\\/_+.#"@\[\(\{&]/g,dg=/[\s-]/,ug=/[\s-]/g;function pg(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var l,c,d,u,p=n.charAt(a),h=r.indexOf(p,o),f=0;h>=0;)(l=pg(e,t,r,n,h+1,a+1,i))>f&&(h===o?l*=1:lg.test(e.charAt(h-1))?(l*=.8,(d=e.slice(o,h-1).match(cg))&&o>0&&(l*=Math.pow(sg,d.length))):dg.test(e.charAt(h-1))?(l*=.9,(u=e.slice(o,h-1).match(ug))&&o>0&&(l*=Math.pow(sg,u.length))):(l*=.17,o>0&&(l*=Math.pow(sg,h-o))),e.charAt(h)!==t.charAt(a)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(h-1)!==n.charAt(a))&&(.1*(c=pg(e,t,r,n,h+1,a+2,i))>l&&(l=.1*c)),l>f&&(f=l),h=r.indexOf(p,h+1);return i[s]=f,f}function hg(e){return e.toLowerCase().replace(ug," ")}function fg(e,t,r){return pg(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,hg(e),hg(t),0,0,{})}function mg(){return mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mg.apply(null,arguments)}function vg(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function yg(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}function gg(...e){return r.useCallback(yg(...e),e)}function xg(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}const bg=null!=globalThis&&globalThis.document?r.useLayoutEffect:()=>{},kg=a.useId||(()=>{});let _g=0;function wg(e){const[t,r]=a.useState(kg());return bg(()=>{r(e=>e??String(_g++))},[e]),e||(t?`radix-${t}`:"")}function Mg(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>{var r;return null===(r=t.current)||void 0===r?void 0:r.call(t,...e)},[])}function Cg({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=function({defaultProp:e,onChange:t}){const n=r.useState(e),[o]=n,a=r.useRef(o),i=Mg(t);return r.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:o,l=Mg(n),c=r.useCallback(t=>{if(i){const r="function"==typeof t?t(e):t;r!==e&&l(r)}else a(t)},[i,e,a,l]);return[s,c]}const Dg=r.forwardRef((e,t)=>{const{children:n,...o}=e,a=r.Children.toArray(n),i=a.find(Sg);if(i){const e=i.props.children,n=a.map(t=>t===i?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return r.createElement(jg,mg({},o,{ref:t}),r.isValidElement(e)?r.cloneElement(e,void 0,n):null)}return r.createElement(jg,mg({},o,{ref:t}),n)});Dg.displayName="Slot";const jg=r.forwardRef((e,t)=>{const{children:n,...o}=e;return r.isValidElement(n)?r.cloneElement(n,{...Pg(o,n.props),ref:t?yg(t,n.ref):n.ref}):r.Children.count(n)>1?r.Children.only(null):null});jg.displayName="SlotClone";const Og=({children:e})=>r.createElement(r.Fragment,null,e);function Sg(e){return r.isValidElement(e)&&e.type===Og}function Pg(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}const Eg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=r.forwardRef((e,n)=>{const{asChild:o,...a}=e,i=o?Dg:t;return r.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),r.createElement(i,mg({},a,{ref:n}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});const Tg="dismissableLayer.update",Ng="dismissableLayer.pointerDownOutside",zg="dismissableLayer.focusOutside";let Ag;const Rg=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fg=r.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,u=r.useContext(Rg),[p,h]=r.useState(null),f=null!==(n=null==p?void 0:p.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=r.useState({}),v=gg(t,e=>h(e)),y=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Mg(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let r=function(){Bg(Ng,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));!_||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Mg(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{e.target&&!o.current&&Bg(zg,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Mg(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[n,t])}(e=>{b===u.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),r.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Ag=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Lg(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=Ag)}},[p,f,o,u]),r.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Lg())},[p,u]),r.useEffect(()=>{const e=()=>m({});return document.addEventListener(Tg,e),()=>document.removeEventListener(Tg,e)},[]),r.createElement(Eg.div,mg({},d,{ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:vg(e.onFocusCapture,M.onFocusCapture),onBlurCapture:vg(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:vg(e.onPointerDownCapture,w.onPointerDownCapture)}))});function Lg(){const e=new CustomEvent(Tg);document.dispatchEvent(e)}function Bg(e,t,r,{discrete:o}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}const Vg="focusScope.autoFocusOnMount",Ig="focusScope.autoFocusOnUnmount",qg={bubbles:!1,cancelable:!0},Hg=r.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=e,[l,c]=r.useState(null),d=Mg(a),u=Mg(i),p=r.useRef(null),h=gg(t,e=>c(e)),f=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(o){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:Yg(p.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Yg(p.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Yg(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,l,f.paused]),r.useEffect(()=>{if(l){Zg.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(Vg,qg);l.addEventListener(Vg,d),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Yg(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}($g(l)),{select:!0}),document.activeElement===e&&Yg(l))}return()=>{l.removeEventListener(Vg,d),setTimeout(()=>{const t=new CustomEvent(Ig,qg);l.addEventListener(Ig,u),l.dispatchEvent(t),t.defaultPrevented||Yg(e??document.body,{select:!0}),l.removeEventListener(Ig,u),Zg.remove(f)},0)}}},[l,d,u,f]);const m=r.useCallback(e=>{if(!n&&!o||f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=$g(e),r=Wg(t,e),n=Wg(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&Yg(a,{select:!0})):(e.preventDefault(),n&&Yg(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,f.paused]);return r.createElement(Eg.div,mg({tabIndex:-1},s,{ref:h,onKeyDown:m}))});function $g(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wg(e,t){for(const r of e)if(!Ug(r,{upTo:t}))return r}function Ug(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Yg(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Zg=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=Kg(e,t),e.unshift(t)},remove(t){var r;e=Kg(e,t),null===(r=e[0])||void 0===r||r.resume()}}}();function Kg(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}const Gg=r.forwardRef((e,t)=>{var o;const{container:a=(null==globalThis||null===(o=globalThis.document)||void 0===o?void 0:o.body),...i}=e;return a?n.createPortal(r.createElement(Eg.div,mg({},i,{ref:t})),a):null});const Xg=e=>{const{present:t,children:o}=e,a=function(e){const[t,o]=r.useState(),a=r.useRef({}),i=r.useRef(e),s=r.useRef("none"),l=e?"mounted":"unmounted",[c,d]=function(e,t){return r.useReducer((e,r)=>t[e][r]??e,e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Qg(a.current);s.current="mounted"===c?e:"none"},[c]),bg(()=>{const t=a.current,r=i.current;if(r!==e){const n=s.current,o=Qg(t);e?d("MOUNT"):"none"===o||"none"===(null==t?void 0:t.display)?d("UNMOUNT"):d(r&&n!==o?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),bg(()=>{if(t){const e=e=>{const r=Qg(a.current).includes(e.animationName);e.target===t&&r&&n.flushSync(()=>d("ANIMATION_END"))},r=e=>{e.target===t&&(s.current=Qg(a.current))};return t.addEventListener("animationstart",r),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",r),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(e=>{e&&(a.current=getComputedStyle(e)),o(e)},[])}}(t),i="function"==typeof o?o({present:a.isPresent}):r.Children.only(o),s=gg(a.ref,i.ref);return"function"==typeof o||a.isPresent?r.cloneElement(i,{ref:s}):null};function Qg(e){return(null==e?void 0:e.animationName)||"none"}Xg.displayName="Presence";let Jg=0;function ex(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var tx=jf(),rx=function(){},nx=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:rx,onWheelCapture:rx,onTouchMoveCapture:rx}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,g=void 0===y?"div":y,x=gf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=h,k=Cf([r,t]),_=yf(yf({},x),o);return a.createElement(a.Fragment,null,u&&a.createElement(b,{sideCar:tx,removeScrollBar:d,shards:p,noIsolation:f,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r}),s?a.cloneElement(a.Children.only(l),yf(yf({},_),{ref:k})):a.createElement(g,yf({},_,{className:c,ref:k}),l))});nx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},nx.classNames={fullWidth:kf,zeroRight:bf};var ox=!1;if(typeof window<"u")try{var ax=Object.defineProperty({},"passive",{get:function(){return ox=!0,!0}});window.addEventListener("test",ax,ax),window.removeEventListener("test",ax,ax)}catch{ox=!1}var ix=!!ox&&{passive:!1},sx=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},lx=function(e,t){var r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),cx(e,r)){var n=dx(e,r);if(n[1]>n[2])return!0}r=r.parentNode}while(r&&r!==document.body);return!1},cx=function(e,t){return"v"===e?function(e){return sx(e,"overflowY")}(t):function(e){return sx(e,"overflowX")}(t)},dx=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},ux=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},px=function(e){return[e.deltaX,e.deltaY]},hx=function(e){return e&&"current"in e?e.current:e},fx=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},mx=0,vx=[];const yx=Sf(tx,function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(mx++)[0],i=a.useState(function(){return Af()})[0],s=a.useRef(e);a.useEffect(function(){s.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=xf([e.lockRef.current],(e.shards||[]).map(hx),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length)return!s.current.allowPinchZoom;var o,a=ux(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=lx(u,d);if(!p)return!0;if(p?o=u:(o="v"===u?"h":"v",p=lx(u,d)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,d=0,u=0;do{var p=dx(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&cx(e,i)&&(d+=f,u+=h),i=i.parentNode}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&0===d||!c&&0===u)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=a.useCallback(function(e){var r=e;if(vx.length&&vx[vx.length-1]===i){var n="deltaY"in r?px(r):ux(r),o=t.current.filter(function(e){return e.name===r.type&&e.target===r.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var a=(s.current.shards||[]).map(hx).filter(Boolean).filter(function(e){return e.contains(r.target)});(a.length>0?l(r,a[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=a.useCallback(function(e){r.current=ux(e),n.current=void 0},[]),p=a.useCallback(function(t){d(t.type,px(t),t.target,l(t,e.lockRef.current))},[]),h=a.useCallback(function(t){d(t.type,ux(t),t.target,l(t,e.lockRef.current))},[]);a.useEffect(function(){return vx.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ix),document.addEventListener("touchmove",c,ix),document.addEventListener("touchstart",u,ix),function(){vx=vx.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,ix),document.removeEventListener("touchmove",c,ix),document.removeEventListener("touchstart",u,ix)}},[]);var f=e.removeScrollBar,m=e.inert;return a.createElement(a.Fragment,null,m?a.createElement(i,{styles:fx(o)}):null,f?a.createElement(Hf,{gapMode:"margin"}):null)});var gx=a.forwardRef(function(e,t){return a.createElement(nx,yf({},e,{ref:t,sideCar:yx}))});gx.classNames=nx.classNames;const xx="Dialog",[bx,kx]=function(e,t=[]){let n=[];const o=()=>{const t=n.map(e=>r.createContext(e));return function(n){const o=(null==n?void 0:n[e])||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return o.scopeName=e,[function(t,o){const a=r.createContext(o),i=n.length;function s(t){const{scope:n,children:o,...s}=t,l=(null==n?void 0:n[e][i])||a,c=r.useMemo(()=>s,Object.values(s));return r.createElement(l.Provider,{value:c},o)}return n=[...n,o],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][i])||a,c=r.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},xg(o,...t)]}(xx),[_x,wx]=bx(xx),Mx="DialogPortal",[Cx,Dx]=bx(Mx,{forceMount:void 0}),jx="DialogOverlay",Ox=r.forwardRef((e,t)=>{const n=Dx(jx,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wx(jx,e.__scopeDialog);return i.modal?r.createElement(Xg,{present:o||i.open},r.createElement(Sx,mg({},a,{ref:t}))):null}),Sx=r.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=wx(jx,n);return r.createElement(gx,{as:Dg,allowPinchZoom:!0,shards:[a.contentRef]},r.createElement(Eg.div,mg({"data-state":Ax(a.open)},o,{ref:t,style:{pointerEvents:"auto",...o.style}})))}),Px="DialogContent",Ex=r.forwardRef((e,t)=>{const n=Dx(Px,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wx(Px,e.__scopeDialog);return r.createElement(Xg,{present:o||i.open},i.modal?r.createElement(Tx,mg({},a,{ref:t})):r.createElement(Nx,mg({},a,{ref:t})))}),Tx=r.forwardRef((e,t)=>{const n=wx(Px,e.__scopeDialog),o=r.useRef(null),a=gg(t,n.contentRef,o);return r.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),r.createElement(zx,mg({},e,{ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vg(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:vg(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:vg(e.onFocusOutside,e=>e.preventDefault())}))}),Nx=r.forwardRef((e,t)=>{const n=wx(Px,e.__scopeDialog),o=r.useRef(!1),a=r.useRef(!1);return r.createElement(zx,mg({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;(null===(r=e.onCloseAutoFocus)||void 0===r||r.call(e,t),t.defaultPrevented)||(o.current||null===(i=n.triggerRef.current)||void 0===i||i.focus(),t.preventDefault());o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null===(r=e.onInteractOutside)||void 0===r||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null===(i=n.triggerRef.current)||void 0===i?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}}))}),zx=r.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,l=wx(Px,n),c=gg(t,r.useRef(null));return r.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:ex()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:ex()),Jg++,()=>{1===Jg&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Jg--}},[]),r.createElement(r.Fragment,null,r.createElement(Hg,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i},r.createElement(Fg,mg({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ax(l.open)},s,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)});function Ax(e){return e?"open":"closed"}!function(e,t){const n=r.createContext(t);function o(e){const{children:t,...o}=e,a=r.useMemo(()=>o,Object.values(o));return r.createElement(n.Provider,{value:a},t)}o.displayName=e+"Provider"}("DialogTitleWarning",{contentName:Px,titleName:"DialogTitle",docsSlug:"dialog"});const Rx=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,l=r.useRef(null),c=r.useRef(null),[d=!1,u]=Cg({prop:o,defaultProp:a,onChange:i});return r.createElement(_x,{scope:t,triggerRef:l,contentRef:c,contentId:wg(),titleId:wg(),descriptionId:wg(),open:d,onOpenChange:u,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),modal:s},n)},Fx=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:a}=e,i=wx(Mx,t);return r.createElement(Cx,{scope:t,forceMount:n},r.Children.map(o,e=>r.createElement(Xg,{present:n||i.open},r.createElement(Gg,{asChild:!0,container:a},e))))},Lx=Ox,Bx=Ex;var Vx='[cmdk-group=""]',Ix='[cmdk-group-items=""]',qx='[cmdk-item=""]',Hx=`${qx}:not([aria-disabled="true"])`,$x="cmdk-item-select",Wx="data-value",Ux=(e,t,r)=>fg(e,t,r),Yx=a.createContext(void 0),Zx=()=>a.useContext(Yx),Kx=a.createContext(void 0),Gx=()=>a.useContext(Kx),Xx=a.createContext(void 0),Qx=a.forwardRef((e,t)=>{let r=pb(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=pb(()=>new Set),o=pb(()=>new Map),i=pb(()=>new Map),s=pb(()=>new Set),l=db(e),{label:c,children:d,value:u,onValueChange:p,filter:h,shouldFilter:f,loop:m,disablePointerSelection:v=!1,vimBindings:y=!0,...g}=e,x=a.useId(),b=a.useId(),k=a.useId(),_=a.useRef(null),w=vb();ub(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,M.emit()}},[u]),ub(()=>{w(6,P)},[]);let M=a.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)S(),j(),w(1,O);else if("value"===e&&(n||w(5,P),void 0!==(null==(o=l.current)?void 0:o.value))){let e=t??"";return void(null==(i=(a=l.current).onValueChange)||i.call(a,e))}M.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),C=a.useMemo(()=>({value:(e,t,n)=>{var o;t!==(null==(o=i.current.get(e))?void 0:o.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,D(t,n)),w(2,()=>{j(),M.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),w(3,()=>{S(),j(),r.current.value||O(),M.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=E();w(4,()=>{S(),(null==t?void 0:t.getAttribute("id"))===e&&O(),M.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{i.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:v,listId:x,inputId:k,labelId:b,listInnerRef:_}),[]);function D(e,t){var n,o;let a=null!=(o=null==(n=l.current)?void 0:n.filter)?o:Ux;return e?a(e,r.current.search,t):0}function j(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=_.current;T().sort((t,r)=>{var n,o;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(Ix);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ix} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Ix} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=_.current.querySelector(`${Vx}[${Wx}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)})}function O(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Wx);M.setState("value",t||void 0)}function S(){var e,t,a,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=D(null!=(t=null==(e=i.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(a=i.current.get(o))?void 0:a.keywords)?s:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function P(){var e,t,r;let n=E();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Vx))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function E(){var e;return null==(e=_.current)?void 0:e.querySelector(`${qx}[aria-selected="true"]`)}function T(){var e;return Array.from(null==(e=_.current)?void 0:e.querySelectorAll(Hx))}function N(e){let t=T()[e];t&&M.setState("value",t.getAttribute(Wx))}function z(e){var t;let r=E(),n=T(),o=n.findIndex(e=>e===r),a=n[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),a&&M.setState("value",a.getAttribute(Wx))}function A(e){let t,r=E(),n=null==r?void 0:r.closest(Vx);for(;n&&!t;)n=e>0?lb(n,Vx):cb(n,Vx),t=null==n?void 0:n.querySelector(Hx);t?M.setState("value",t.getAttribute(Wx)):z(e)}let R=()=>N(T().length-1),F=e=>{e.preventDefault(),e.metaKey?R():e.altKey?A(1):z(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?A(-1):z(-1)};return a.createElement(Eg.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=g.onKeyDown)||t.call(g,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":y&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),R();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=E();if(t){let e=new Event($x);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:gb},c),yb(e,e=>a.createElement(Kx.Provider,{value:M},a.createElement(Yx.Provider,{value:C},e))))}),Jx=a.forwardRef((e,t)=>{var r,n;let o=a.useId(),i=a.useRef(null),s=a.useContext(Xx),l=Zx(),c=db(e),d=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==s?void 0:s.forceMount;ub(()=>{if(!d)return l.item(o,null==s?void 0:s.id)},[d]);let u=mb(o,i,[e.value,e.children,i],e.keywords),p=Gx(),h=fb(e=>e.value&&e.value===u.current),f=fb(e=>!(!d&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function m(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,u.current)}function v(){p.setState("value",u.current,!0)}if(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener($x,m),()=>t.removeEventListener($x,m)},[f,e.onSelect,e.disabled]),!f)return null;let{disabled:y,value:g,onSelect:x,forceMount:b,keywords:k,..._}=e;return a.createElement(Eg.div,{ref:hb([i,t]),..._,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||l.disablePointerSelection?void 0:v,onClick:y?void 0:m},e.children)}),eb=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...i}=e,s=a.useId(),l=a.useRef(null),c=a.useRef(null),d=a.useId(),u=Zx(),p=fb(e=>!(!o&&!1!==u.filter())||(!e.search||e.filtered.groups.has(s)));ub(()=>u.group(s),[]),mb(s,l,[e.value,e.heading,c]);let h=a.useMemo(()=>({id:s,forceMount:o}),[o]);return a.createElement(Eg.div,{ref:hb([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),yb(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},a.createElement(Xx.Provider,{value:h},e))))}),tb=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=a.useRef(null),i=fb(e=>!e.search);return r||i?a.createElement(Eg.div,{ref:hb([o,t]),...n,"cmdk-separator":"",role:"separator"}):null}),rb=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,i=Gx(),s=fb(e=>e.search),l=fb(e=>e.value),c=Zx(),d=a.useMemo(()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${qx}[${Wx}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")},[]);return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Eg.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":d,id:c.inputId,type:"text",value:o?e.value:s,onChange:e=>{o||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),nb=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,i=a.useRef(null),s=a.useRef(null),l=Zx();return a.useEffect(()=>{if(s.current&&i.current){let e,t=s.current,r=i.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),a.createElement(Eg.div,{ref:hb([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},yb(e,e=>a.createElement("div",{ref:hb([s,l.listInnerRef]),"cmdk-list-sizer":""},e)))}),ob=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:i,container:s,...l}=e;return a.createElement(Rx,{open:r,onOpenChange:n},a.createElement(Fx,{container:s},a.createElement(Lx,{"cmdk-overlay":"",className:o}),a.createElement(Bx,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(Qx,{ref:t,...l}))))}),ab=a.forwardRef((e,t)=>fb(e=>0===e.filtered.count)?a.createElement(Eg.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ib=a.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...i}=e;return a.createElement(Eg.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},yb(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),sb=Object.assign(Qx,{List:nb,Item:Jx,Input:rb,Group:eb,Separator:tb,Dialog:ob,Empty:ab,Loading:ib});function lb(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function cb(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function db(e){let t=a.useRef(e);return ub(()=>{t.current=e}),t}var ub=typeof window>"u"?a.useEffect:a.useLayoutEffect;function pb(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function hb(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function fb(e){let t=Gx(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function mb(e,t,r,n=[]){let o=a.useRef(),i=Zx();return ub(()=>{var a;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map(e=>e.trim());i.value(e,s,l),null==(a=t.current)||a.setAttribute(Wx,s),o.current=s}),o}var vb=()=>{let[e,t]=a.useState(),r=pb(()=>new Map);return ub(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function yb({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var gb={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},xb="Dialog",[bb,kb]=Wd(xb),[_b,wb]=bb(xb),Mb=e=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=a.useRef(null),d=a.useRef(null),[u,p]=Kd({prop:o,defaultProp:i??!1,onChange:s,caller:xb});return t.jsx(_b,{scope:r,triggerRef:c,contentRef:d,contentId:Du(),titleId:Du(),descriptionId:Du(),open:u,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:n})};Mb.displayName=xb;var Cb="DialogTrigger",Db=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(Cb,n),i=Ft(r,a.triggerRef);return t.jsx(Gd.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ub(a.open),...o,ref:i,onClick:$d(e.onClick,a.onOpenToggle)})});Db.displayName=Cb;var jb="DialogPortal",[Ob,Sb]=bb(jb,{forceMount:void 0}),Pb=e=>{const{__scopeDialog:r,forceMount:n,children:o,container:i}=e,s=wb(jb,r);return t.jsx(Ob,{scope:r,forceMount:n,children:a.Children.map(o,e=>t.jsx(Hh,{present:n||s.open,children:t.jsx(qh,{asChild:!0,container:i,children:e})}))})};Pb.displayName=jb;var Eb="DialogOverlay",Tb=a.forwardRef((e,r)=>{const n=Sb(Eb,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wb(Eb,e.__scopeDialog);return i.modal?t.jsx(Hh,{present:o||i.open,children:t.jsx(zb,{...a,ref:r})}):null});Tb.displayName=Eb;var Nb=Lt("DialogOverlay.RemoveScroll"),zb=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(Eb,n);return t.jsx(am,{as:Nb,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(Gd.div,{"data-state":Ub(a.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),Ab="DialogContent",Rb=a.forwardRef((e,r)=>{const n=Sb(Ab,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wb(Ab,e.__scopeDialog);return t.jsx(Hh,{present:o||i.open,children:i.modal?t.jsx(Fb,{...a,ref:r}):t.jsx(Lb,{...a,ref:r})})});Rb.displayName=Ab;var Fb=a.forwardRef((e,r)=>{const n=wb(Ab,e.__scopeDialog),o=a.useRef(null),i=Ft(r,n.contentRef,o);return a.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),t.jsx(Bb,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$d(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:$d(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:$d(e.onFocusOutside,e=>e.preventDefault())})}),Lb=a.forwardRef((e,r)=>{const n=wb(Ab,e.__scopeDialog),o=a.useRef(!1),i=a.useRef(!1);return t.jsx(Bb,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,a;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(a=n.triggerRef.current)||a.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var r,a;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const s=t.target;(null==(a=n.triggerRef.current)?void 0:a.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Bb=a.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=wb(Ab,n),d=a.useRef(null),u=Ft(r,d);return pu(),t.jsxs(t.Fragment,{children:[t.jsx(yu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(su,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ub(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(Gb,{titleId:c.titleId}),t.jsx(Xb,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Vb="DialogTitle",Ib=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(Vb,n);return t.jsx(Gd.h2,{id:a.titleId,...o,ref:r})});Ib.displayName=Vb;var qb="DialogDescription",Hb=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(qb,n);return t.jsx(Gd.p,{id:a.descriptionId,...o,ref:r})});Hb.displayName=qb;var $b="DialogClose",Wb=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb($b,n);return t.jsx(Gd.button,{type:"button",...o,ref:r,onClick:$d(e.onClick,()=>a.onOpenChange(!1))})});function Ub(e){return e?"open":"closed"}Wb.displayName=$b;var Yb="DialogTitleWarning",[Zb,Kb]=function(e,r){const n=a.createContext(r),o=e=>{const{children:r,...o}=e,i=a.useMemo(()=>o,Object.values(o));return t.jsx(n.Provider,{value:i,children:r})};return o.displayName=e+"Provider",[o,function(t){const o=a.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(Yb,{contentName:Ab,titleName:Vb,docsSlug:"dialog"}),Gb=({titleId:e})=>{const t=Kb(Yb),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Xb=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kb("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{var n;const o=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Qb=Mb,Jb=Db,ek=Pb,tk=Tb,rk=Rb,nk=Ib,ok=Hb,ak=Wb;const ik=Qb,sk=Jb,lk=ek,ck=a.forwardRef(({className:e,...r},n)=>t.jsx(tk,{ref:n,className:Br("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));ck.displayName=tk.displayName;const dk=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(lk,{children:[t.jsx(ck,{}),t.jsxs(rk,{ref:o,className:Br("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,t.jsxs(ak,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(zt,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dk.displayName=rk.displayName;const uk=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});uk.displayName="DialogHeader";const pk=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});pk.displayName="DialogFooter";const hk=a.forwardRef(({className:e,...r},n)=>t.jsx(nk,{ref:n,className:Br("text-lg font-semibold leading-none tracking-tight",e),...r}));hk.displayName=nk.displayName;const fk=a.forwardRef(({className:e,...r},n)=>t.jsx(ok,{ref:n,className:Br("text-sm text-muted-foreground",e),...r}));fk.displayName=ok.displayName;const mk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb,{ref:n,className:Br("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));mk.displayName=sb.displayName;const vk=a.forwardRef(({className:e,...r},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(sb.Input,{ref:n,className:Br("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));vk.displayName=sb.Input.displayName;const yk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.List,{ref:n,className:Br("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));yk.displayName=sb.List.displayName;const gk=a.forwardRef((e,r)=>t.jsx(sb.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));gk.displayName=sb.Empty.displayName;const xk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.Group,{ref:n,className:Br("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));xk.displayName=sb.Group.displayName;const bk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.Separator,{ref:n,className:Br("-mx-1 h-px bg-border",e),...r}));bk.displayName=sb.Separator.displayName;const kk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.Item,{ref:n,className:Br("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...r}));kk.displayName=sb.Item.displayName;var _k="Popover",[wk,Mk]=Wd(_k,[_h]),Ck=_h(),[Dk,jk]=wk(_k),Ok=e=>{const{__scopePopover:r,children:n,open:o,defaultOpen:i,onOpenChange:s,modal:l=!1}=e,c=Ck(r),d=a.useRef(null),[u,p]=a.useState(!1),[h,f]=Kd({prop:o,defaultProp:i??!1,onChange:s,caller:_k});return t.jsx(Lh,{...c,children:t.jsx(Dk,{scope:r,contentId:Du(),triggerRef:d,open:h,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:l,children:n})})};Ok.displayName=_k;var Sk="PopoverAnchor",Pk=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,i=jk(Sk,n),s=Ck(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return a.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(Bh,{...s,...o,ref:r})});Pk.displayName=Sk;var Ek="PopoverTrigger",Tk=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=jk(Ek,n),i=Ck(n),s=Ft(r,a.triggerRef),l=t.jsx(Gd.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Uk(a.open),...o,ref:s,onClick:$d(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:t.jsx(Bh,{asChild:!0,...i,children:l})});Tk.displayName=Ek;var Nk="PopoverPortal",[zk,Ak]=wk(Nk,{forceMount:void 0}),Rk=e=>{const{__scopePopover:r,forceMount:n,children:o,container:a}=e,i=jk(Nk,r);return t.jsx(zk,{scope:r,forceMount:n,children:t.jsx(Hh,{present:n||i.open,children:t.jsx(qh,{asChild:!0,container:a,children:o})})})};Rk.displayName=Nk;var Fk="PopoverContent",Lk=a.forwardRef((e,r)=>{const n=Ak(Fk,e.__scopePopover),{forceMount:o=n.forceMount,...a}=e,i=jk(Fk,e.__scopePopover);return t.jsx(Hh,{present:o||i.open,children:i.modal?t.jsx(Vk,{...a,ref:r}):t.jsx(Ik,{...a,ref:r})})});Lk.displayName=Fk;var Bk=Lt("PopoverContent.RemoveScroll"),Vk=a.forwardRef((e,r)=>{const n=jk(Fk,e.__scopePopover),o=a.useRef(null),i=Ft(r,o),s=a.useRef(!1);return a.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),t.jsx(am,{as:Bk,allowPinchZoom:!0,children:t.jsx(qk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$d(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),s.current||null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:$d(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;s.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:$d(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ik=a.forwardRef((e,r)=>{const n=jk(Fk,e.__scopePopover),o=a.useRef(!1),i=a.useRef(!1);return t.jsx(qk,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,a;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(a=n.triggerRef.current)||a.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var r,a;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const s=t.target;(null==(a=n.triggerRef.current)?void 0:a.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),qk=a.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,h=jk(Fk,n),f=Ck(n);return pu(),t.jsx(yu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(su,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:t.jsx(Vh,{"data-state":Uk(h.open),role:"dialog",id:h.contentId,...f,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Hk="PopoverClose",$k=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=jk(Hk,n);return t.jsx(Gd.button,{type:"button",...o,ref:r,onClick:$d(e.onClick,()=>a.onOpenChange(!1))})});$k.displayName=Hk;var Wk=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Ck(n);return t.jsx(Ih,{...a,...o,ref:r})});function Uk(e){return e?"open":"closed"}Wk.displayName="PopoverArrow";var Yk=Rk,Zk=Lk;const Kk=Ok,Gk=Tk,Xk=a.forwardRef(({className:e,align:r="center",sideOffset:n=4,...o},a)=>t.jsx(Yk,{children:t.jsx(Zk,{ref:a,align:r,sideOffset:n,className:Br("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Xk.displayName=Zk.displayName;const Qk=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},Jk=({day:e,weekday:r,translations:n})=>{const o=(e=>["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(e))(r),a=n.dayNames[o];return t.jsxs("div",{className:"flex items-center w-full",children:[t.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground italic whitespace-nowrap mr-1 sm:mr-2 pl-4",children:a}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium truncate flex-grow text-center",children:[e,Qk(parseInt(e))]})]})};function e_({className:e,selectedDate:r,onDateChange:n,isAnimating:o,direction:i,translations:s}){const[l,c]=a.useState(!1),d=a.useMemo(()=>(e=>W({start:U(e),end:$(e)}).map(e=>({dayNumber:Te(e,"d"),weekday:Te(e,"EEE"),value:Te(e,"yyyy-MM-dd"),date:e})))(r),[r]),u=d.find(e=>Te(e.date,"yyyy-MM-dd")===Te(r,"yyyy-MM-dd"));return t.jsxs(Kk,{open:l,onOpenChange:c,children:[t.jsx(Gk,{asChild:!0,children:t.jsxs(Ir,{variant:"outline",role:"combobox","aria-expanded":l,"aria-label":s.selectDate,className:Br("w-[120px] sm:w-[159px] justify-between border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(tn,{mode:"wait",children:t.jsx(qd.div,{initial:!!o&&{y:"down"===i?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===i?-10:10,opacity:0},transition:{duration:.2},className:"w-full",children:u?t.jsx(Jk,{day:u.dayNumber,weekday:u.weekday,translations:s}):t.jsx("span",{className:"text-xs sm:text-sm",children:s.selectDate})},null==u?void 0:u.value)}),t.jsx(og,{className:"ml-1 sm:ml-2 h-4 w-4 sm:h-4 sm:w-4 shrink-0 opacity-50"})]})}),t.jsx(Xk,{className:"w-[120px] sm:w-[161px] p-0",children:t.jsxs(mk,{children:[t.jsx(vk,{placeholder:`${s.search} ${s.day.toLowerCase()}...`,className:"text-xs sm:text-sm"}),t.jsxs(yk,{className:"max-h-[300px] overflow-y-auto",children:[t.jsx(gk,{children:s.noEvents}),t.jsx(xk,{children:d.map(e=>t.jsxs(kk,{onSelect:()=>{n(e.date),c(!1)},className:"text-xs sm:text-sm",children:[t.jsx(Jk,{day:e.dayNumber,weekday:e.weekday,translations:s}),t.jsx(ig,{className:Br("ml-auto h-4 w-4 sm:h-4 sm:w-4",(null==u?void 0:u.value)===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function t_({className:e,selectedMonth:r,onMonthChange:n,onDateChange:o,isAnimating:i,direction:s,translations:l,currentDate:c}){const[d,u]=a.useState(!1),p=l.monthNames.map(e=>({label:e,value:e.toLowerCase().slice(0,3)}));return t.jsxs(Kk,{open:d,onOpenChange:u,children:[t.jsx(Gk,{asChild:!0,children:t.jsxs(Ir,{variant:"outline",role:"combobox","aria-expanded":d,"aria-label":l.selectDate,className:Br("w-[110px] sm:w-[151px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(rg,{className:"hidden sm:inline-block mr-2 h-4 w-4"}),t.jsx(tn,{mode:"wait",children:t.jsx(qd.p,{className:"text-xs sm:text-sm flex-grow text-center",initial:!!i&&{y:"down"===s?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===s?-10:10,opacity:0},transition:{duration:.2},children:r.label},r.value)}),t.jsx(og,{className:"hidden sm:inline-block ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(Xk,{className:"w-[110px] sm:w-[151px] p-0",children:t.jsxs(mk,{children:[t.jsx(vk,{placeholder:l.search,className:"text-xs sm:text-sm"}),t.jsxs(yk,{children:[t.jsx(gk,{className:"text-xs sm:text-sm",children:l.noEvents}),t.jsx(xk,{children:p.map(e=>t.jsxs(kk,{onSelect:()=>(e=>{const t=c.getDate(),r=c.getFullYear(),a=p.findIndex(t=>t.value===e.value),i=new Date(r,a,t);i.getDate()!==t&&i.setMonth(a+1,0),n(e),o&&o(i),u(!1)})(e),className:"text-xs sm:text-sm",children:[e.label,t.jsx(ig,{className:Br("ml-auto h-4 w-4 sm:h-4 sm:w-4",r.value===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}const r_=a.forwardRef(({className:e,type:r,...n},o)=>t.jsx("input",{type:r,className:Br("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...n}));function n_({className:e,currentYear:n,onYearChange:o,onDateChange:a,currentDate:i,isAnimating:s,direction:l}){const[c,d]=r.useState(!1),[u,p]=r.useState(n),[h,f]=r.useState(n.toString());r.useEffect(()=>{p(n),f(n.toString())},[n]);const m=e=>{if(e>=1900&&e<=3100){const t=i.getDate(),r=i.getMonth(),n=new Date(e,r,t);n.getMonth()!==r&&n.setDate(0),p(e),f(e.toString()),o(e),a&&a(n)}},v=e=>{m(u+e)};return t.jsxs(Kk,{open:c,onOpenChange:d,children:[t.jsx(Gk,{asChild:!0,children:t.jsx(Ir,{variant:"outline",role:"combobox","aria-expanded":c,"aria-label":"Select a year",className:Br("w-[70px] sm:w-[71px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:t.jsx(tn,{mode:"wait",children:t.jsx(qd.p,{className:"text-xs sm:text-sm",initial:!!s&&{y:"down"===l?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===l?-10:10,opacity:0},transition:{duration:.2},children:u},u)})})}),t.jsx(Xk,{className:"w-[90px] sm:w-[130px] p-2",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(1),children:t.jsx(xt,{className:"h-4 w-4 sm:h-4 sm:w-4"})}),t.jsx(r_,{type:"text",value:h,onChange:e=>{const t=e.target.value;f(t);const r=parseInt(t,10);!isNaN(r)&&r>=1900&&r<=2100&&m(r)},onBlur:()=>{h!==u.toString()&&f(u.toString())},className:"w-full text-center text-xs sm:text-sm h-8"}),t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(-1),children:t.jsx(vt,{className:"h-4 w-4 sm:h-4 sm:w-4"})})]})})]})}r_.displayName="Input";const o_=({currentDate:e,currentView:r,handlePrevious:n,handleNext:o,lastUpdated:a,animationDirection:i,months:s,handleDayChange:l,handleMonthChange:c,handleYearChange:d,currentConfig:u})=>t.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[t.jsx(Ir,{variant:"ghost",onClick:n,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(yt,{className:"h-4 w-4"})}),t.jsxs(tn,{mode:"sync",children:["day"===r&&t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(e_,{translations:u.localization,className:"font-semibold text-sm sm:text-lg",selectedDate:e,onDateChange:l,isAnimating:"day"===a,direction:i})},"day-switcher"),"year"!==r&&t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(t_,{className:"font-semibold text-sm sm:text-lg",selectedMonth:s[e.getMonth()],onMonthChange:c,onDateChange:l,isAnimating:"month"===a,direction:i,translations:u.localization,currentDate:e})},"month-switcher"),t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(n_,{className:"font-semibold text-sm sm:text-lg",currentYear:e.getFullYear(),onYearChange:d,onDateChange:l,currentDate:e,isAnimating:"year"===a,direction:i})},"year-switcher")]}),t.jsx(Ir,{variant:"ghost",onClick:o,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(gt,{className:"h-4 w-4"})})]});var a_=Array(12).fill(0),i_=({visible:e,className:t})=>r.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},r.createElement("div",{className:"sonner-spinner"},a_.map((e,t)=>r.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),s_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),c_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),d_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),p_=1,h_=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:p_++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let o,a=e instanceof Promise?e:e(),i=void 0!==n,s=a.then(async e=>{if(o=["resolve",e],r.isValidElement(e))i=!1,this.create({id:n,type:"default",message:e});else if(f_(e)&&!e.ok){i=!1;let r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:n,type:"error",message:r,description:o})}else if(void 0!==t.success){i=!1;let r="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"success",message:r,description:o})}}).catch(async e=>{if(o=["reject",e],void 0!==t.error){i=!1;let r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"error",message:r,description:o})}}).finally(()=>{var e;i&&(this.dismiss(n),n=void 0),null==(e=t.finally)||e.call(t)}),l=()=>new Promise((e,t)=>s.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||p_++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},f_=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,m_=(e,t)=>{let r=(null==t?void 0:t.id)||p_++;return h_.addToast({title:e,...t,id:r}),r},v_=Object.assign(m_,{success:h_.success,info:h_.info,warning:h_.warning,error:h_.error,custom:h_.custom,message:h_.message,promise:h_.promise,dismiss:h_.dismiss,loading:h_.loading},{getHistory:()=>h_.toasts,getToasts:()=>h_.getActiveToasts()});function y_(e){return void 0!==e.label}!function(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var g_=3,x_=14;function b_(...e){return e.filter(Boolean).join(" ")}var k_=e=>{var t,n,o,a,i,s,l,c,d,u,p;let{invert:h,toast:f,unstyled:m,interacting:v,setHeights:y,visibleToasts:g,heights:x,index:b,toasts:k,expanded:_,removeToast:w,defaultRichColors:M,closeButton:C,style:D,cancelButtonStyle:j,actionButtonStyle:O,className:S="",descriptionClassName:P="",duration:E,position:T,gap:N,loadingIcon:z,expandByDefault:A,classNames:R,icons:F,closeButtonAriaLabel:L="Close toast",pauseWhenPageIsHidden:B}=e,[V,I]=r.useState(null),[q,H]=r.useState(null),[$,W]=r.useState(!1),[U,Y]=r.useState(!1),[Z,K]=r.useState(!1),[G,X]=r.useState(!1),[Q,J]=r.useState(!1),[ee,te]=r.useState(0),[re,ne]=r.useState(0),oe=r.useRef(f.duration||E||4e3),ae=r.useRef(null),ie=r.useRef(null),se=0===b,le=b+1<=g,ce=f.type,de=!1!==f.dismissible,ue=f.className||"",pe=f.descriptionClassName||"",he=r.useMemo(()=>x.findIndex(e=>e.toastId===f.id)||0,[x,f.id]),fe=r.useMemo(()=>{var e;return null!=(e=f.closeButton)?e:C},[f.closeButton,C]),me=r.useMemo(()=>f.duration||E||4e3,[f.duration,E]),ve=r.useRef(0),ye=r.useRef(0),ge=r.useRef(0),xe=r.useRef(null),[be,ke]=T.split("-"),_e=r.useMemo(()=>x.reduce((e,t,r)=>r>=he?e:e+t.height,0),[x,he]),we=(()=>{let[e,t]=r.useState(document.hidden);return r.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),Me=f.invert||h,Ce="loading"===ce;ye.current=r.useMemo(()=>he*N+_e,[he,_e]),r.useEffect(()=>{oe.current=me},[me]),r.useEffect(()=>{W(!0)},[]),r.useEffect(()=>{let e=ie.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),y(e=>[{toastId:f.id,height:t,position:f.position},...e]),()=>y(e=>e.filter(e=>e.toastId!==f.id))}},[y,f.id]),r.useLayoutEffect(()=>{if(!$)return;let e=ie.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),y(e=>e.find(e=>e.toastId===f.id)?e.map(e=>e.toastId===f.id?{...e,height:r}:e):[{toastId:f.id,height:r,position:f.position},...e])},[$,f.title,f.description,y,f.id]);let De=r.useCallback(()=>{Y(!0),te(ye.current),y(e=>e.filter(e=>e.toastId!==f.id)),setTimeout(()=>{w(f)},200)},[f,w,y,ye]);return r.useEffect(()=>{if(f.promise&&"loading"===ce||f.duration===1/0||"loading"===f.type)return;let e;return _||v||B&&we?(()=>{if(ge.current<ve.current){let e=(new Date).getTime()-ve.current;oe.current=oe.current-e}ge.current=(new Date).getTime()})():oe.current!==1/0&&(ve.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=f.onAutoClose)||e.call(f,f),De()},oe.current)),()=>clearTimeout(e)},[_,v,f,ce,B,we,De]),r.useEffect(()=>{f.delete&&De()},[De,f.delete]),r.createElement("li",{tabIndex:0,ref:ie,className:b_(S,ue,null==R?void 0:R.toast,null==(t=null==f?void 0:f.classNames)?void 0:t.toast,null==R?void 0:R.default,null==R?void 0:R[ce],null==(n=null==f?void 0:f.classNames)?void 0:n[ce]),"data-sonner-toast":"","data-rich-colors":null!=(o=f.richColors)?o:M,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":$,"data-promise":!!f.promise,"data-swiped":Q,"data-removed":U,"data-visible":le,"data-y-position":be,"data-x-position":ke,"data-index":b,"data-front":se,"data-swiping":Z,"data-dismissible":de,"data-type":ce,"data-invert":Me,"data-swipe-out":G,"data-swipe-direction":q,"data-expanded":!!(_||A&&$),style:{"--index":b,"--toasts-before":b,"--z-index":k.length-b,"--offset":`${U?ee:ye.current}px`,"--initial-height":A?"auto":`${re}px`,...D,...f.style},onDragEnd:()=>{K(!1),I(null),xe.current=null},onPointerDown:e=>{Ce||!de||(ae.current=new Date,te(ye.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(K(!0),xe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(G||!de)return;xe.current=null;let o=Number((null==(e=ie.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=ie.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(r=ae.current)?void 0:r.getTime()),s="x"===V?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11)return te(ye.current),null==(n=f.onDismiss)||n.call(f,f),H("x"===V?o>0?"right":"left":a>0?"down":"up"),De(),X(!0),void J(!1);K(!1),I(null)},onPointerMove:t=>{var r,n,o,a;if(!xe.current||!de||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=t.clientY-xe.current.y,s=t.clientX-xe.current.x,l=null!=(n=e.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(T);!V&&(Math.abs(s)>1||Math.abs(i)>1)&&I(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===V?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(c.y=i):"x"===V&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&J(!0),null==(o=ie.current)||o.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(a=ie.current)||a.style.setProperty("--swipe-amount-y",`${c.y}px`)}},fe&&!f.jsx?r.createElement("button",{"aria-label":L,"data-disabled":Ce,"data-close-button":!0,onClick:Ce||!de?()=>{}:()=>{var e;De(),null==(e=f.onDismiss)||e.call(f,f)},className:b_(null==R?void 0:R.closeButton,null==(a=null==f?void 0:f.classNames)?void 0:a.closeButton)},null!=(i=null==F?void 0:F.close)?i:u_):null,f.jsx||r.isValidElement(f.title)?f.jsx?f.jsx:"function"==typeof f.title?f.title():f.title:r.createElement(r.Fragment,null,ce||f.icon||f.promise?r.createElement("div",{"data-icon":"",className:b_(null==R?void 0:R.icon,null==(s=null==f?void 0:f.classNames)?void 0:s.icon)},f.promise||"loading"===f.type&&!f.icon?f.icon||(null!=F&&F.loading?r.createElement("div",{className:b_(null==R?void 0:R.loader,null==(je=null==f?void 0:f.classNames)?void 0:je.loader,"sonner-loader"),"data-visible":"loading"===ce},F.loading):z?r.createElement("div",{className:b_(null==R?void 0:R.loader,null==(Oe=null==f?void 0:f.classNames)?void 0:Oe.loader,"sonner-loader"),"data-visible":"loading"===ce},z):r.createElement(i_,{className:b_(null==R?void 0:R.loader,null==(Se=null==f?void 0:f.classNames)?void 0:Se.loader),visible:"loading"===ce})):null,"loading"!==f.type?f.icon||(null==F?void 0:F[ce])||(e=>{switch(e){case"success":return s_;case"info":return c_;case"warning":return l_;case"error":return d_;default:return null}})(ce):null):null,r.createElement("div",{"data-content":"",className:b_(null==R?void 0:R.content,null==(l=null==f?void 0:f.classNames)?void 0:l.content)},r.createElement("div",{"data-title":"",className:b_(null==R?void 0:R.title,null==(c=null==f?void 0:f.classNames)?void 0:c.title)},"function"==typeof f.title?f.title():f.title),f.description?r.createElement("div",{"data-description":"",className:b_(P,pe,null==R?void 0:R.description,null==(d=null==f?void 0:f.classNames)?void 0:d.description)},"function"==typeof f.description?f.description():f.description):null),r.isValidElement(f.cancel)?f.cancel:f.cancel&&y_(f.cancel)?r.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:e=>{var t,r;y_(f.cancel)&&de&&(null==(r=(t=f.cancel).onClick)||r.call(t,e),De())},className:b_(null==R?void 0:R.cancelButton,null==(u=null==f?void 0:f.classNames)?void 0:u.cancelButton)},f.cancel.label):null,r.isValidElement(f.action)?f.action:f.action&&y_(f.action)?r.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||O,onClick:e=>{var t,r;y_(f.action)&&(null==(r=(t=f.action).onClick)||r.call(t,e),!e.defaultPrevented&&De())},className:b_(null==R?void 0:R.actionButton,null==(p=null==f?void 0:f.classNames)?void 0:p.actionButton)},f.action.label):null));var je,Oe,Se};function __(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function w_(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,o=n?"--mobile-offset":"--offset",a=n?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{r[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${o}-${t}`]=a:r[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),r}r.forwardRef(function(e,t){let{invert:o,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:l,className:c,offset:d,mobileOffset:u,theme:p="light",richColors:h,duration:f,style:m,visibleToasts:v=g_,toastOptions:y,dir:g=__(),gap:x=x_,loadingIcon:b,icons:k,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:w}=e,[M,C]=r.useState([]),D=r.useMemo(()=>Array.from(new Set([a].concat(M.filter(e=>e.position).map(e=>e.position)))),[M,a]),[j,O]=r.useState([]),[S,P]=r.useState(!1),[E,T]=r.useState(!1),[N,z]=r.useState("system"!==p?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=r.useRef(null),R=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=r.useRef(null),L=r.useRef(!1),B=r.useCallback(e=>{C(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||h_.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return r.useEffect(()=>h_.subscribe(e=>{e.dismiss?C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{n.flushSync(()=>{C(t=>{let r=t.findIndex(t=>t.id===e.id);return-1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),r.useEffect(()=>{if("system"!==p)return void z(p);if("system"===p&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{z(e?"dark":"light")})}catch{e.addListener(({matches:e})=>{try{z(e?"dark":"light")}catch(e){console.error(e)}})}},[p]),r.useEffect(()=>{M.length<=1&&P(!1)},[M]),r.useEffect(()=>{let e=e=>{var t,r;i.every(t=>e[t]||e.code===t)&&(P(!0),null==(t=A.current)||t.focus()),"Escape"===e.code&&(document.activeElement===A.current||null!=(r=A.current)&&r.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),r.useEffect(()=>{if(A.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,L.current=!1)}},[A.current]),r.createElement("section",{ref:t,"aria-label":`${_} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((t,n)=>{var a;let[i,p]=t.split("-");return M.length?r.createElement("ol",{key:t,dir:"auto"===g?__():g,tabIndex:-1,ref:A,className:c,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":i,"data-lifted":S&&M.length>1&&!s,"data-x-position":p,style:{"--front-toast-height":`${(null==(a=j[0])?void 0:a.height)||0}px`,"--width":"356px","--gap":`${x}px`,...m,...w_(d,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||L.current||(L.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{E||P(!1)},onDragEnd:()=>P(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||T(!0)},onPointerUp:()=>T(!1)},M.filter(e=>!e.position&&0===n||e.position===t).map((n,a)=>{var i,c;return r.createElement(k_,{key:n.id,icons:k,index:a,toast:n,defaultRichColors:h,duration:null!=(i=null==y?void 0:y.duration)?i:f,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:o,visibleToasts:v,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:l,interacting:E,position:t,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:B,toasts:M.filter(e=>e.position==n.position),heights:j.filter(e=>e.position==n.position),setHeights:O,expandByDefault:s,gap:x,loadingIcon:b,expanded:S,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});var M_=e=>"checkbox"===e.type,C_=e=>e instanceof Date,D_=e=>null==e;const j_=e=>"object"==typeof e;var O_=e=>!D_(e)&&!Array.isArray(e)&&j_(e)&&!C_(e),S_=e=>O_(e)&&e.target?M_(e.target)?e.target.checked:e.target.value:e,P_=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),E_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T_(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(E_&&(e instanceof Blob||n)||!r&&!O_(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return O_(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=T_(e[r]));else t=e}return t}var N_=e=>/^\w*$/.test(e),z_=e=>void 0===e,A_=e=>Array.isArray(e)?e.filter(Boolean):[],R_=e=>A_(e.replace(/["|']|\]/g,"").split(/\.|\[/)),F_=(e,t,r)=>{if(!t||!O_(e))return r;const n=(N_(t)?[t]:R_(t)).reduce((e,t)=>D_(e)?e:e[t],e);return z_(n)||n===e?z_(e[t])?r:e[t]:n},L_=e=>"boolean"==typeof e,B_=(e,t,r)=>{let n=-1;const o=N_(t)?[t]:R_(t),a=o.length,i=a-1;for(;++n<a;){const t=o[n];let a=r;if(n!==i){const r=e[t];a=O_(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const V_="blur",I_="focusout",q_="change",H_="onBlur",$_="onChange",W_="onSubmit",U_="onTouched",Y_="all",Z_="max",K_="min",G_="maxLength",X_="minLength",Q_="pattern",J_="required",ew="validate",tw=r.createContext(null);tw.displayName="HookFormContext";const rw=()=>r.useContext(tw);var nw=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Y_&&(t._proxyFormState[o]=!n||Y_),r&&(r[o]=!0),e[o]}});return o};const ow=typeof window<"u"?a.useLayoutEffect:a.useEffect;var aw=e=>"string"==typeof e,iw=(e,t,r,n,o)=>aw(e)?(n&&t.watch.add(e),F_(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),F_(r,e))):(n&&(t.watchAll=!0),r);function sw(e){const t=rw(),{name:n,disabled:o,control:a=t.control,shouldUnregister:i}=e,s=P_(a._names.array,n),l=function(e){const t=rw(),{control:n=t.control,name:o,defaultValue:a,disabled:i,exact:s}=e||{},l=r.useRef(a),[c,d]=r.useState(n._getWatch(o,l.current));return ow(()=>n._subscribe({name:o,formState:{values:!0},exact:s,callback:e=>!i&&d(iw(o,n._names,e.values||n._formValues,!1,l.current))}),[o,n,i,s]),r.useEffect(()=>n._removeUnmounted()),c}({control:a,name:n,defaultValue:F_(a._formValues,n,F_(a._defaultValues,n,e.defaultValue)),exact:!0}),c=function(e){const t=rw(),{control:n=t.control,disabled:o,name:a,exact:i}=e||{},[s,l]=r.useState(n._formState),c=r.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ow(()=>n._subscribe({name:a,formState:c.current,exact:i,callback:e=>{!o&&l({...n._formState,...e})}}),[a,o,i]),r.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),r.useMemo(()=>nw(s,n,c.current,!1),[s,n])}({control:a,name:n,exact:!0}),d=r.useRef(e),u=r.useRef(a.register(n,{...e.rules,value:l,...L_(e.disabled)?{disabled:e.disabled}:{}})),p=r.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!F_(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!F_(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!F_(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!F_(c.validatingFields,n)},error:{enumerable:!0,get:()=>F_(c.errors,n)}}),[c,n]),h=r.useCallback(e=>u.current.onChange({target:{value:S_(e),name:n},type:q_}),[n]),f=r.useCallback(()=>u.current.onBlur({target:{value:F_(a._formValues,n),name:n},type:V_}),[n,a._formValues]),m=r.useCallback(e=>{const t=F_(a._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[a._fields,n]),v=r.useMemo(()=>({name:n,value:l,...L_(o)||c.disabled?{disabled:c.disabled||o}:{},onChange:h,onBlur:f,ref:m}),[n,o,c.disabled,h,f,m,l]);return r.useEffect(()=>{const e=a._options.shouldUnregister||i;a.register(n,{...d.current.rules,...L_(d.current.disabled)?{disabled:d.current.disabled}:{}});const t=(e,t)=>{const r=F_(a._fields,e);r&&r._f&&(r._f.mount=t)};if(t(n,!0),e){const e=T_(F_(a._options.defaultValues,n));B_(a._defaultValues,n,e),z_(F_(a._formValues,n))&&B_(a._formValues,n,e)}return!s&&a.register(n),()=>{(s?e&&!a._state.action:e)?a.unregister(n):t(n,!1)}},[n,a,s,i]),r.useEffect(()=>{a._setDisabledField({disabled:o,name:n})},[o,n,a]),r.useMemo(()=>({field:v,formState:c,fieldState:p}),[v,c,p])}const lw=e=>e.render(sw(e));var cw=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},dw=e=>Array.isArray(e)?e:[e],uw=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},pw=e=>D_(e)||!j_(e);function hw(e,t,r=new WeakSet){if(pw(e)||pw(t))return e===t;if(C_(e)&&C_(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(C_(n)&&C_(e)||O_(n)&&O_(e)||Array.isArray(n)&&Array.isArray(e)?!hw(n,e,r):n!==e)return!1}}return!0}var fw=e=>O_(e)&&!Object.keys(e).length,mw=e=>"file"===e.type,vw=e=>"function"==typeof e,yw=e=>{if(!E_)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},gw=e=>"select-multiple"===e.type,xw=e=>"radio"===e.type,bw=e=>yw(e)&&e.isConnected;function kw(e,t){const r=Array.isArray(t)?t:N_(t)?[t]:R_(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=z_(e)?n++:e[t[n++]];return e}(e,r),o=r.length-1,a=r[o];return n&&delete n[a],0!==o&&(O_(n)&&fw(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!z_(e[t]))return!1;return!0}(n))&&kw(e,r.slice(0,-1)),e}var _w=e=>{for(const t in e)if(vw(e[t]))return!0;return!1};function ww(e,t={}){const r=Array.isArray(e);if(O_(e)||r)for(const r in e)Array.isArray(e[r])||O_(e[r])&&!_w(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ww(e[r],t[r])):D_(e[r])||(t[r]=!0);return t}function Mw(e,t,r){const n=Array.isArray(e);if(O_(e)||n)for(const n in e)Array.isArray(e[n])||O_(e[n])&&!_w(e[n])?z_(t)||pw(r[n])?r[n]=Array.isArray(e[n])?ww(e[n],[]):{...ww(e[n])}:Mw(e[n],D_(t)?{}:t[n],r[n]):r[n]=!hw(e[n],t[n]);return r}var Cw=(e,t)=>Mw(e,t,ww(t));const Dw={value:!1,isValid:!1},jw={value:!0,isValid:!0};var Ow=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!z_(e[0].attributes.value)?z_(e[0].value)||""===e[0].value?jw:{value:e[0].value,isValid:!0}:jw:Dw}return Dw},Sw=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>z_(e)?e:t?""===e?NaN:e&&+e:r&&aw(e)?new Date(e):n?n(e):e;const Pw={isValid:!1,value:null};var Ew=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Pw):Pw;function Tw(e){const t=e.ref;return mw(t)?t.files:xw(t)?Ew(e.refs).value:gw(t)?[...t.selectedOptions].map(({value:e})=>e):M_(t)?Ow(e.refs).value:Sw(z_(t.value)?e.ref.value:t.value,e)}var Nw=e=>e instanceof RegExp,zw=e=>z_(e)?e:Nw(e)?e.source:O_(e)?Nw(e.value)?e.value.source:e.value:e,Aw=e=>({isOnSubmit:!e||e===W_,isOnBlur:e===H_,isOnChange:e===$_,isOnAll:e===Y_,isOnTouch:e===U_});const Rw="AsyncFunction";var Fw=e=>!!e&&!!e.validate&&!!(vw(e.validate)&&e.validate.constructor.name===Rw||O_(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Rw)),Lw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Bw=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const r=F_(e,o);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Bw(a,t))break}else if(O_(a)&&Bw(a,t))break}}};function Vw(e,t,r){const n=F_(e,r);if(n||N_(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const n=o.join("."),a=F_(t,n),i=F_(e,n);if(a&&!Array.isArray(a)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};o.pop()}return{name:r}}var Iw=(e,t,r)=>{const n=dw(F_(e,r));return B_(n,"root",t[r]),B_(e,r,n),e},qw=e=>aw(e);function Hw(e,t,r="validate"){if(qw(e)||Array.isArray(e)&&e.every(qw)||L_(e)&&!e)return{type:r,message:qw(e)?e:"",ref:t}}var $w=e=>O_(e)&&!Nw(e)?e:{value:e,message:""},Ww=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:d,min:u,max:p,pattern:h,validate:f,name:m,valueAsNumber:v,mount:y}=e._f,g=F_(r,m);if(!y||t.has(m))return{};const x=s?s[0]:i,b=e=>{o&&x.reportValidity&&(x.setCustomValidity(L_(e)?"":e||""),x.reportValidity())},k={},_=xw(i),w=M_(i),M=_||w,C=(v||mw(i))&&z_(i.value)&&z_(g)||yw(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,D=cw.bind(null,m,n,k),j=(e,t,r,n=G_,o=X_)=>{const a=e?t:r;k[m]={type:e?n:o,message:a,ref:i,...D(e?n:o,a)}};if(a?!Array.isArray(g)||!g.length:l&&(!M&&(C||D_(g))||L_(g)&&!g||w&&!Ow(s).isValid||_&&!Ew(s).isValid)){const{value:e,message:t}=qw(l)?{value:!!l,message:l}:$w(l);if(e&&(k[m]={type:J_,message:t,ref:x,...D(J_,t)},!n))return b(t),k}if(!(C||D_(u)&&D_(p))){let e,t;const r=$w(p),o=$w(u);if(D_(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;aw(r.value)&&g&&(e=s?a(g)>a(r.value):l?g>r.value:n>new Date(r.value)),aw(o.value)&&g&&(t=s?a(g)<a(o.value):l?g<o.value:n<new Date(o.value))}else{const n=i.valueAsNumber||g&&+g;D_(r.value)||(e=n>r.value),D_(o.value)||(t=n<o.value)}if((e||t)&&(j(!!e,r.message,o.message,Z_,K_),!n))return b(k[m].message),k}if((c||d)&&!C&&(aw(g)||a&&Array.isArray(g))){const e=$w(c),t=$w(d),r=!D_(e.value)&&g.length>+e.value,o=!D_(t.value)&&g.length<+t.value;if((r||o)&&(j(r,e.message,t.message),!n))return b(k[m].message),k}if(h&&!C&&aw(g)){const{value:e,message:t}=$w(h);if(Nw(e)&&!g.match(e)&&(k[m]={type:Q_,message:t,ref:i,...D(Q_,t)},!n))return b(t),k}if(f)if(vw(f)){const e=Hw(await f(g,r),x);if(e&&(k[m]={...e,...D(ew,e.message)},!n))return b(e.message),k}else if(O_(f)){let e={};for(const t in f){if(!fw(e)&&!n)break;const o=Hw(await f[t](g,r),x,t);o&&(e={...o,...D(t,o.message)},b(o.message),n&&(k[m]=e))}if(!fw(e)&&(k[m]={ref:x,...e},!n))return k}return b(!0),k};const Uw={mode:W_,reValidateMode:$_,shouldFocusError:!0};function Yw(e={}){let t,r={...Uw,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:vw(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=(O_(r.defaultValues)||O_(r.values))&&T_(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:T_(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...d};const p={array:uw(),state:uw()},h=r.criteriaMode===Y_,f=async e=>{if(!r.disabled&&(d.isValid||u.isValid||e)){const e=r.resolver?fw((await x()).errors):await b(o,!0);e!==n.isValid&&p.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||u.isValidating||u.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?B_(n.validatingFields,e,t):kw(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!fw(n.validatingFields)}))},v=(e,t,r,n)=>{const l=F_(o,e);if(l){const o=F_(i,e,z_(r)?F_(a,e):r);z_(o)||n&&n.defaultChecked||t?B_(i,e,t?o:Tw(l._f)):w(e,o),s.mount&&f()}},y=(e,t,o,i,s)=>{let l=!1,c=!1;const h={name:e};if(!r.disabled){if(!o||i){(d.isDirty||u.isDirty)&&(c=n.isDirty,n.isDirty=h.isDirty=k(),l=c!==h.isDirty);const r=hw(F_(a,e),t);c=!!F_(n.dirtyFields,e),r?kw(n.dirtyFields,e):B_(n.dirtyFields,e,!0),h.dirtyFields=n.dirtyFields,l=l||(d.dirtyFields||u.dirtyFields)&&c!==!r}if(o){const t=F_(n.touchedFields,e);t||(B_(n.touchedFields,e,o),h.touchedFields=n.touchedFields,l=l||(d.touchedFields||u.touchedFields)&&t!==o)}l&&s&&p.state.next(h)}return l?h:{}},g=(e,o,a,i)=>{const s=F_(n.errors,e),l=(d.isValid||u.isValid)&&L_(o)&&n.isValid!==o;if(r.delayError&&a?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})(()=>((e,t)=>{B_(n.errors,e,t),p.state.next({errors:n.errors})})(e,a)),t(r.delayError)):(clearTimeout(c),t=null,a?B_(n.errors,e,a):kw(n.errors,e)),(a?!hw(s,a):s)||!fw(i)||l){const t={...i,...l&&L_(o)?{isValid:o}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},x=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const o={};for(const r of e){const e=F_(t,r);e&&B_(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},b=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),u=s._f&&Fw(s._f);u&&d.validatingFields&&m([a],!0);const p=await Ww(s,l.disabled,i,h,r.shouldUseNativeValidation&&!t,c);if(u&&d.validatingFields&&m([a]),p[e.name]&&(o.valid=!1,t))break;!t&&(F_(p,e.name)?c?Iw(n.errors,p,e.name):B_(n.errors,e.name,p[e.name]):kw(n.errors,e.name))}!fw(c)&&await b(c,t,o)}}return o.valid},k=(e,t)=>!r.disabled&&(e&&t&&B_(i,e,t),!hw(S(),a)),_=(e,t,r)=>iw(e,l,{...s.mount?i:z_(t)?a:aw(e)?{[e]:t}:t},r,t),w=(e,t,r={})=>{const n=F_(o,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&B_(i,e,Sw(t,r)),a=yw(r.ref)&&D_(t)?"":t,gw(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?M_(r.ref)?r.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):mw(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||p.state.next({name:e,values:T_(i)})))}(r.shouldDirty||r.shouldTouch)&&y(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&O(e)},M=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,s=F_(o,i);(l.array.has(e)||O_(a)||s&&!s._f)&&!C_(a)?M(i,a,r):w(i,a,r)}},C=(e,t,r={})=>{const c=F_(o,e),h=l.array.has(e),f=T_(t);B_(i,e,f),h?(p.array.next({name:e,values:T_(i)}),(d.isDirty||d.dirtyFields||u.isDirty||u.dirtyFields)&&r.shouldDirty&&p.state.next({name:e,dirtyFields:Cw(a,i),isDirty:k(e,f)})):!c||c._f||D_(f)?w(e,f,r):M(e,f,r),Lw(e,l)&&p.state.next({...n}),p.state.next({name:s.mount?e:void 0,values:T_(i)})},D=async e=>{s.mount=!0;const a=e.target;let c=a.name,v=!0;const k=F_(o,c),_=e=>{v=Number.isNaN(e)||C_(e)&&isNaN(e.getTime())||hw(e,F_(i,c,e))},w=Aw(r.mode),M=Aw(r.reValidateMode);if(k){let s,C;const D=a.type?Tw(k._f):S_(e),j=e.type===V_||e.type===I_,S=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(k._f)&&!r.resolver&&!F_(n.errors,c)&&!k._f.deps||((e,t,r,n,o)=>!o.isOnAll&&(!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:!(r?n.isOnChange:o.isOnChange)||e))(j,F_(n.touchedFields,c),n.isSubmitted,M,w),P=Lw(c,l,j);B_(i,c,D),j?(k._f.onBlur&&k._f.onBlur(e),t&&t(0)):k._f.onChange&&k._f.onChange(e);const E=y(c,D,j),T=!fw(E)||P;if(!j&&p.state.next({name:c,type:e.type,values:T_(i)}),S)return(d.isValid||u.isValid)&&("onBlur"===r.mode?j&&f():j||f()),T&&p.state.next({name:c,...P?{}:E});if(!j&&P&&p.state.next({...n}),r.resolver){const{errors:e}=await x([c]);if(_(D),v){const t=Vw(n.errors,o,c),r=Vw(e,o,t.name||c);s=r.error,c=r.name,C=fw(e)}}else m([c],!0),s=(await Ww(k,l.disabled,i,h,r.shouldUseNativeValidation))[c],m([c]),_(D),v&&(s?C=!1:(d.isValid||u.isValid)&&(C=await b(o,!0)));v&&(k._f.deps&&O(k._f.deps),g(c,C,s,E))}},j=(e,t)=>{if(F_(n.errors,t)&&e.focus)return e.focus(),1},O=async(e,t={})=>{let a,i;const s=dw(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(e)for(const r of e){const e=F_(t,r);e?B_(n.errors,r,e):kw(n.errors,r)}else n.errors=t;return t})(z_(e)?e:s);a=fw(t),i=e?!s.some(e=>F_(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=F_(o,e);return await b(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=a=await b(o);return p.state.next({...!aw(e)||(d.isValid||u.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&Bw(o,j,e?s:l.mount),i},S=e=>{const t={...s.mount?i:a};return z_(e)?t:aw(e)?F_(t,e):e.map(e=>F_(t,e))},P=(e,t)=>({invalid:!!F_((t||n).errors,e),isDirty:!!F_((t||n).dirtyFields,e),error:F_((t||n).errors,e),isValidating:!!F_(n.validatingFields,e),isTouched:!!F_((t||n).touchedFields,e)}),E=(e,t,r)=>{const a=(F_(o,e,{_f:{}})._f||{}).ref,i=F_(n.errors,e)||{},{ref:s,message:l,type:c,...d}=i;B_(n.errors,e,{...d,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},T=e=>p.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||dw(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,n)=>{r(e);const{name:o,...a}=e;return fw(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||Y_))})(t,e.formState||d,V,e.reRenderRoot)&&e.callback({values:{...i},...n,...t})}}).unsubscribe,N=(e,t={})=>{for(const s of e?dw(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(kw(o,s),kw(i,s)),!t.keepError&&kw(n.errors,s),!t.keepDirty&&kw(n.dirtyFields,s),!t.keepTouched&&kw(n.touchedFields,s),!t.keepIsValidating&&kw(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&kw(a,s);p.state.next({values:T_(i)}),p.state.next({...n,...t.keepDirty?{isDirty:k()}:{}}),!t.keepIsValid&&f()},z=({disabled:e,name:t})=>{(L_(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},A=(e,t={})=>{let n=F_(o,e);const i=L_(t.disabled)||L_(r.disabled);return B_(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?z({disabled:L_(t.disabled)?t.disabled:r.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:zw(t.min),max:zw(t.max),minLength:zw(t.minLength),maxLength:zw(t.maxLength),pattern:zw(t.pattern)}:{},name:e,onChange:D,onBlur:D,ref:i=>{if(i){A(e,t),n=F_(o,e);const r=z_(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>xw(e)||M_(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;B_(o,e,{_f:{...n._f,...s?{refs:[...l.filter(bw),r,...Array.isArray(F_(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),v(e,!1,void 0,r)}else n=F_(o,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!P_(l.array,e)||!s.action)&&l.unMount.add(e)}}},R=()=>r.shouldFocusError&&Bw(o,j,l.mount),F=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=T_(i);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();n.errors=e,c=T_(t)}else await b(o);if(l.disabled.size)for(const e of l.disabled)kw(c,e);if(kw(n.errors,"root"),fw(n.errors)){p.state.next({errors:{}});try{await e(c,a)}catch(e){s=e}}else t&&await t({...n.errors},a),R(),setTimeout(R);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:fw(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(e,t={})=>{const c=e?T_(e):a,u=T_(c),h=fw(e),f=h?a:u;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(Cw(a,i))]);for(const t of Array.from(e))F_(n.dirtyFields,t)?B_(f,t,F_(i,t)):C(t,F_(f,t))}else{if(E_&&z_(e))for(const e of l.mount){const t=F_(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(yw(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)C(e,F_(f,e));else o={}}i=r.shouldUnregister?t.keepDefaultValues?T_(a):{}:T_(f),p.array.next({values:{...f}}),p.state.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,p.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||hw(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Cw(a,i):n.dirtyFields:t.keepDefaultValues&&e?Cw(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},B=(e,t)=>L(vw(e)?e(i):e,t),V=e=>{n={...n,...e}},I={control:{register:A,unregister:N,getFieldState:P,handleSubmit:F,setError:E,_subscribe:T,_runSchema:x,_focusError:R,_getWatch:_,_getDirty:k,_setValid:f,_setFieldArray:(e,t=[],l,c,h=!0,f=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,f&&Array.isArray(F_(o,e))){const t=l(F_(o,e),c.argA,c.argB);h&&B_(o,e,t)}if(f&&Array.isArray(F_(n.errors,e))){const t=l(F_(n.errors,e),c.argA,c.argB);h&&B_(n.errors,e,t),((e,t)=>{!A_(F_(e,t)).length&&kw(e,t)})(n.errors,e)}if((d.touchedFields||u.touchedFields)&&f&&Array.isArray(F_(n.touchedFields,e))){const t=l(F_(n.touchedFields,e),c.argA,c.argB);h&&B_(n.touchedFields,e,t)}(d.dirtyFields||u.dirtyFields)&&(n.dirtyFields=Cw(a,i)),p.state.next({name:e,isDirty:k(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else B_(i,e,t)},_setDisabledField:z,_setErrors:e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>A_(F_(s.mount?i:a,e,r.shouldUnregister?F_(a,e,[]):[])),_reset:L,_resetDefaultValues:()=>vw(r.defaultValues)&&r.defaultValues().then(e=>{B(e,r.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=F_(o,e);t&&(t._f.refs?t._f.refs.every(e=>!bw(e)):!bw(t._f.ref))&&N(e)}l.unMount=new Set},_disableForm:e=>{L_(e)&&(p.state.next({disabled:e}),Bw(o,(t,r)=>{const n=F_(o,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:p,_proxyFormState:d,get _fields(){return o},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return a},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,u={...u,...e.formState},T({...e,formState:u})),trigger:O,register:A,handleSubmit:F,watch:(e,t)=>vw(e)?p.state.subscribe({next:r=>e(_(void 0,t),r)}):_(e,t,!0),setValue:C,getValues:S,reset:B,resetField:(e,t={})=>{F_(o,e)&&(z_(t.defaultValue)?C(e,T_(F_(a,e))):(C(e,t.defaultValue),B_(a,e,T_(t.defaultValue))),t.keepTouched||kw(n.touchedFields,e),t.keepDirty||(kw(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,T_(F_(a,e))):k()),t.keepError||(kw(n.errors,e),d.isValid&&f()),p.state.next({...n}))},clearErrors:e=>{e&&dw(e).forEach(e=>kw(n.errors,e)),p.state.next({errors:e?n.errors:{}})},unregister:N,setError:E,setFocus:(e,t={})=>{const r=F_(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&vw(e.select)&&e.select())}},getFieldState:P};return{...I,formControl:I}}const Zw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=F_(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Kw=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Zw(n.ref,r,e):n.refs&&n.refs.forEach(t=>Zw(t,r,e))}},Gw=(e,t)=>{t.shouldUseNativeValidation&&Kw(e,t);const r={};for(const n in e){const o=F_(t.fields,n),a=Object.assign(e[n]||{},{ref:o&&o.ref});if(Xw(t.names||Object.keys(e),n)){const e=Object.assign({},F_(r,n));B_(e,"root",a),B_(r,n,e)}else B_(r,n,a)}return r},Xw=(e,t)=>e.some(e=>e.startsWith(t+"."));var Qw=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=cw(i,t,r,o,c?[].concat(c,n.message):n.message)}e.shift()}return r},Jw=function(e,t,r){return void 0===r&&(r={}),function(n,o,a){try{return Promise.resolve(function(o,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&Kw({},a),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:Gw(Qw(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}},eM=function(){return eM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},eM.apply(this,arguments)};function tM(e,t,r){for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function rM(e){return"multiple"===e.mode}function nM(e){return"range"===e.mode}function oM(e){return"single"===e.mode}var aM={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var iM=Object.freeze({__proto__:null,formatCaption:function(e,t){return Te(e,"LLLL y",t)},formatDay:function(e,t){return Te(e,"d",t)},formatMonthCaption:function(e,t){return Te(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return Te(e,"cccccc",t)},formatYearCaption:function(e,t){return Te(e,"yyyy",t)}}),sM=Object.freeze({__proto__:null,labelDay:function(e,t,r){return Te(e,"do MMMM (EEEE)",r)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return Te(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var lM=r.createContext(void 0);function cM(e){var r,n,o=e.initialProps,a=function(){var e=aM,t=ae,r=new Date;return{captionLayout:"buttons",classNames:e,formatters:iM,labels:sM,locale:t,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:r,mode:"default"}}(),i=function(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,i=e.toDate;return n?a=U(n):t&&(a=new Date(t,0,1)),o?i=$(o):r&&(i=new Date(r,11,31)),{fromDate:a?E(a):void 0,toDate:i?E(i):void 0}}(o),s=i.fromDate,l=i.toDate,c=null!==(r=o.captionLayout)&&void 0!==r?r:a.captionLayout;"buttons"!==c&&(!s||!l)&&(c="buttons"),(oM(o)||rM(o)||nM(o))&&(n=o.onSelect);var d=eM(eM(eM({},a),o),{captionLayout:c,classNames:eM(eM({},a.classNames),o.classNames),components:eM({},o.components),formatters:eM(eM({},a.formatters),o.formatters),fromDate:s,labels:eM(eM({},a.labels),o.labels),mode:o.mode||a.mode,modifiers:eM(eM({},a.modifiers),o.modifiers),modifiersClassNames:eM(eM({},a.modifiersClassNames),o.modifiersClassNames),onSelect:n,styles:eM(eM({},a.styles),o.styles),toDate:l});return t.jsx(lM.Provider,{value:d,children:e.children})}function dM(){var e=r.useContext(lM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function uM(e){var r=dM(),n=r.locale,o=r.classNames,a=r.styles,i=r.formatters.formatCaption;return t.jsx("div",{className:o.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function pM(e){return t.jsx("svg",eM({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function hM(e){var r,n,o=e.onChange,a=e.value,i=e.children,s=e.caption,l=e.className,c=e.style,d=dM(),u=null!==(n=null===(r=d.components)||void 0===r?void 0:r.IconDropdown)&&void 0!==n?n:pM;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:a,onChange:o,children:i}),t.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[s,t.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function fM(e){var r,n=dM(),o=n.fromDate,a=n.toDate,i=n.styles,s=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,u=n.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!a)return t.jsx(t.Fragment,{});var p=[];if(Be(o,a))for(var h=U(o),f=o.getMonth();f<=a.getMonth();f++)p.push(Xe(h,f));else for(h=U(new Date),f=0;f<=11;f++)p.push(Xe(h,f));var m=null!==(r=null==d?void 0:d.Dropdown)&&void 0!==r?r:hM;return t.jsx(m,{name:"months","aria-label":u(),className:c.dropdown_month,style:i.dropdown_month,onChange:function(t){var r=Number(t.target.value),n=Xe(U(e.displayMonth),r);e.onChange(n)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:p.map(function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:s})},e.getMonth())})})}function mM(e){var r,n=e.displayMonth,o=dM(),a=o.fromDate,i=o.toDate,s=o.locale,l=o.styles,c=o.classNames,d=o.components,u=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,h=[];if(!a)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});for(var f=a.getFullYear(),m=i.getFullYear(),v=f;v<=m;v++)h.push(et(Z(new Date),v));var y=null!==(r=null==d?void 0:d.Dropdown)&&void 0!==r?r:hM;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=et(U(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:u(n,{locale:s}),children:h.map(function(e){return t.jsx("option",{value:e.getFullYear(),children:u(e,{locale:s})},e.getFullYear())})})}function vM(){var e=dM(),t=function(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,i=e.fromDate,s=e.numberOfMonths,l=void 0===s?1:s;return a&&V(a,o)<0&&(o=k(a,-1*(l-1))),i&&V(o,i)<0&&(o=i),U(o)}(e),n=function(e,t){var n=r.useState(e),o=n[0];return[void 0===t?o:t,n[1]]}(t,e.month),o=n[0],a=n[1];return[o,function(t){var r;if(!e.disableNavigation){var n=U(t);a(n),null===(r=e.onMonthChange)||void 0===r||r.call(e,n)}}]}var yM=r.createContext(void 0);function gM(e){var r=dM(),n=vM(),o=n[0],a=n[1],i=function(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=U(e),a=V(U(k(o,n)),o),i=[],s=0;s<a;s++){var l=k(o,s);i.push(l)}return r&&(i=i.reverse()),i}(o,r),s=function(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=n?a:1,s=U(e);if(!r)return k(s,i);if(!(V(r,e)<a))return k(s,i)}}(o,r),l=function(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=n?void 0===o?1:o:1,i=U(e);if(!r)return k(i,-a);if(!(V(i,r)<=0))return k(i,-a)}}(o,r),c=function(e){return i.some(function(t){return Le(e,t)})},d={currentMonth:o,displayMonths:i,goToMonth:a,goToDate:function(e,t){c(e)||(t&&Fe(e,t)?a(k(e,1+-1*r.numberOfMonths)):a(e))},previousMonth:l,nextMonth:s,isDateDisplayed:c};return t.jsx(yM.Provider,{value:d,children:e.children})}function xM(){var e=r.useContext(yM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function bM(e){var r,n=dM(),o=n.classNames,a=n.styles,i=n.components,s=xM().goToMonth,l=function(t){s(k(t,e.displayIndex?-e.displayIndex:0))},c=null!==(r=null==i?void 0:i.CaptionLabel)&&void 0!==r?r:uM,d=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:a.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:d}),t.jsx(fM,{onChange:l,displayMonth:e.displayMonth}),t.jsx(mM,{onChange:l,displayMonth:e.displayMonth})]})}function kM(e){return t.jsx("svg",eM({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function _M(e){return t.jsx("svg",eM({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var wM=r.forwardRef(function(e,r){var n=dM(),o=n.classNames,a=n.styles,i=[o.button_reset,o.button];e.className&&i.push(e.className);var s=i.join(" "),l=eM(eM({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),t.jsx("button",eM({},e,{ref:r,type:"button",className:s,style:l}))});function MM(e){var r,n,o=dM(),a=o.dir,i=o.locale,s=o.classNames,l=o.styles,c=o.labels,d=c.labelPrevious,u=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var h=d(e.previousMonth,{locale:i}),f=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=null!==(r=null==p?void 0:p.IconRight)&&void 0!==r?r:_M,g=null!==(n=null==p?void 0:p.IconLeft)&&void 0!==n?n:kM;return t.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(wM,{name:"previous-month","aria-label":h,className:f,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===a?t.jsx(y,{className:s.nav_icon,style:l.nav_icon}):t.jsx(g,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(wM,{name:"next-month","aria-label":m,className:v,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===a?t.jsx(g,{className:s.nav_icon,style:l.nav_icon}):t.jsx(y,{className:s.nav_icon,style:l.nav_icon})})]})}function CM(e){var r=dM().numberOfMonths,n=xM(),o=n.previousMonth,a=n.nextMonth,i=n.goToMonth,s=n.displayMonths,l=s.findIndex(function(t){return Le(e.displayMonth,t)}),c=0===l,d=l===s.length-1,u=r>1&&(c||!d),p=r>1&&(d||!c);return t.jsx(MM,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:p,nextMonth:a,previousMonth:o,onPreviousClick:function(){o&&i(o)},onNextClick:function(){a&&i(a)}})}function DM(e){var r,n,o=dM(),a=o.classNames,i=o.disableNavigation,s=o.styles,l=o.captionLayout,c=o.components,d=null!==(r=null==c?void 0:c.CaptionLabel)&&void 0!==r?r:uM;return n=i?t.jsx(d,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?t.jsx(bM,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?t.jsxs(t.Fragment,{children:[t.jsx(bM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(CM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):t.jsxs(t.Fragment,{children:[t.jsx(d,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(CM,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:a.caption,style:s.caption,children:n})}function jM(e){var r=dM(),n=r.footer,o=r.styles,a=r.classNames.tfoot;return n?t.jsx("tfoot",{className:a,style:o.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:n})})}):t.jsx(t.Fragment,{})}function OM(){var e=dM(),r=e.classNames,n=e.styles,o=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=function(e,t,r){for(var n=r?S(new Date):O(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=b(n,a);o.push(i)}return o}(a,i,s);return t.jsxs("tr",{style:n.head_row,className:r.head_row,children:[o&&t.jsx("td",{style:n.head_cell,className:r.head_cell}),d.map(function(e,o){return t.jsx("th",{scope:"col",className:r.head_cell,style:n.head_cell,"aria-label":c(e,{locale:a}),children:l(e,{locale:a})},o)})]})}function SM(){var e,r=dM(),n=r.classNames,o=r.styles,a=r.components,i=null!==(e=null==a?void 0:a.HeadRow)&&void 0!==e?e:OM;return t.jsx("thead",{style:o.head,className:n.head,children:t.jsx(i,{})})}function PM(e){var r=dM(),n=r.locale,o=r.formatters.formatDay;return t.jsx(t.Fragment,{children:o(e.date,{locale:n})})}var EM=r.createContext(void 0);function TM(e){if(!rM(e.initialProps)){return t.jsx(EM.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(NM,{initialProps:e.initialProps,children:e.children})}function NM(e){var r=e.initialProps,n=e.children,o=r.selected,a=r.min,i=r.max,s={disabled:[]};o&&s.disabled.push(function(e){var t=i&&o.length>i-1,r=o.some(function(t){return L(t,e)});return!(!t||r)});var l={selected:o,onDayClick:function(e,t,n){var s,l;if((null===(s=r.onDayClick)||void 0===s||s.call(r,e,t,n),!!(!t.selected||!a||(null==o?void 0:o.length)!==a))&&!!(t.selected||!i||(null==o?void 0:o.length)!==i)){var c=o?tM([],o):[];if(t.selected){var d=c.findIndex(function(t){return L(e,t)});c.splice(d,1)}else c.push(e);null===(l=r.onSelect)||void 0===l||l.call(r,c,e,t,n)}},modifiers:s};return t.jsx(EM.Provider,{value:l,children:n})}function zM(){var e=r.useContext(EM);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var AM,RM=r.createContext(void 0);function FM(e){if(!nM(e.initialProps)){return t.jsx(RM.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(LM,{initialProps:e.initialProps,children:e.children})}function LM(e){var r=e.initialProps,n=e.children,o=r.selected,a=o||{},i=a.from,s=a.to,l=r.min,c=r.max,d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],s?(d.range_end=[s],L(i,s)||(d.range_middle=[{after:i,before:s}])):d.range_end=[i]):s&&(d.range_start=[s],d.range_end=[s]),l&&(i&&!s&&d.disabled.push({after:Ie(i,l-1),before:b(i,l-1)}),i&&s&&d.disabled.push({after:i,before:b(i,l-1)}),!i&&s&&d.disabled.push({after:Ie(s,l-1),before:b(s,l-1)})),c){if(i&&!s&&(d.disabled.push({before:b(i,1-c)}),d.disabled.push({after:b(i,c-1)})),i&&s){var u=c-(N(s,i)+1);d.disabled.push({before:Ie(i,u)}),d.disabled.push({after:b(s,u)})}!i&&s&&(d.disabled.push({before:b(s,1-c)}),d.disabled.push({after:b(s,c-1)}))}return t.jsx(RM.Provider,{value:{selected:o,onDayClick:function(e,t,n){var a,i;null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,n);var s=function(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?L(o,e)&&L(n,e)?void 0:L(o,e)?{from:o,to:void 0}:L(n,e)?void 0:Re(n,e)?{from:e,to:o}:{from:n,to:e}:o?Re(e,o)?{from:o,to:e}:{from:e,to:o}:n?Fe(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}(e,o);null===(i=r.onSelect)||void 0===i||i.call(r,s,e,t,n)},modifiers:d},children:n})}function BM(){var e=r.useContext(RM);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function VM(e){return Array.isArray(e)?tM([],e):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(AM||(AM={}));var IM=AM.Selected,qM=AM.Disabled,HM=AM.Hidden,$M=AM.Today,WM=AM.RangeEnd,UM=AM.RangeMiddle,YM=AM.RangeStart,ZM=AM.Outside;var KM=r.createContext(void 0);function GM(e){var r=dM(),n=function(e,t,r){var n,o=((n={})[IM]=VM(e.selected),n[qM]=VM(e.disabled),n[HM]=VM(e.hidden),n[$M]=[e.today],n[WM]=[],n[UM]=[],n[YM]=[],n[ZM]=[],n);return e.fromDate&&o[qM].push({before:e.fromDate}),e.toDate&&o[qM].push({after:e.toDate}),rM(e)?o[qM]=o[qM].concat(t.modifiers[qM]):nM(e)&&(o[qM]=o[qM].concat(r.modifiers[qM]),o[YM]=r.modifiers[YM],o[UM]=r.modifiers[UM],o[WM]=r.modifiers[WM]),o}(r,zM(),BM()),o=function(e){var t={};return Object.entries(e).forEach(function(e){var r=e[0],n=e[1];t[r]=VM(n)}),t}(r.modifiers),a=eM(eM({},n),o);return t.jsx(KM.Provider,{value:a,children:e.children})}function XM(){var e=r.useContext(KM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function QM(e,t){return t.some(function(t){if("boolean"==typeof t)return t;if(function(e){return B(e)}(t))return L(e,t);if(function(e){return Array.isArray(e)&&e.every(B)}(t))return t.includes(e);if(function(e){return!(!e||"object"!=typeof e||!("from"in e))}(t))return function(e,t){var r,n=t.from,o=t.to;return n&&o?(N(o,n)<0&&(n=(r=[o,n])[0],o=r[1]),N(e,n)>=0&&N(o,e)>=0):o?L(o,e):!!n&&L(n,e)}(e,t);if(function(e){return!(!e||"object"!=typeof e||!("dayOfWeek"in e))}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return!!(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var r=N(t.before,e)>0,n=N(t.after,e)<0;return Re(t.before,t.after)?n&&r:r||n}return function(e){return!(!e||"object"!=typeof e||!("after"in e))}(t)?N(e,t.after)>0:function(e){return!(!e||"object"!=typeof e||!("before"in e))}(t)?N(t.before,e)>0:"function"==typeof t&&t(e)})}function JM(e,t,r){var n=Object.keys(t).reduce(function(r,n){var o=t[n];return QM(e,o)&&r.push(n),r},[]),o={};return n.forEach(function(e){return o[e]=!0}),r&&!Le(e,r)&&(o.outside=!0),o}function eC(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,i=t.retry,s=void 0===i?{count:0,lastFocused:e}:i,l=o.weekStartsOn,c=o.fromDate,d=o.toDate,u=o.locale,p={day:b,week:z,month:k,year:A,startOfWeek:function(e){return o.ISOWeek?S(e):O(e,{locale:u,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?G(e):K(e,{locale:u,weekStartsOn:l})}},h=p[r](e,"after"===n?1:-1);"before"===n&&c?h=R([c,h]):"after"===n&&d&&(h=F([d,h]));var f=!0;if(a){var m=JM(h,a);f=!m.disabled&&!m.hidden}return f?h:s.count>365?s.lastFocused:eC(h,{moveBy:r,direction:n,context:o,modifiers:a,retry:eM(eM({},s),{count:s.count+1})})}var tC=r.createContext(void 0);function rC(e){var n=xM(),o=XM(),a=r.useState(),i=a[0],s=a[1],l=r.useState(),c=l[0],d=l[1],u=function(e,t){for(var r,n,o=U(e[0]),a=$(e[e.length-1]),i=o;i<=a;){var s=JM(i,t);if(s.disabled||s.hidden)i=b(i,1);else{if(s.selected)return i;s.today&&!n&&(n=i),r||(r=i),i=b(i,1)}}return n||r}(n.displayMonths,o),p=i??(c&&n.isDateDisplayed(c))?c:u,h=function(e){s(e)},f=dM(),m=function(e,t){if(i){var r=eC(i,{moveBy:e,direction:t,context:f,modifiers:o});L(i,r)||(n.goToDate(r,i),h(r))}},v={focusedDay:i,focusTarget:p,blur:function(){d(i),s(void 0)},focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return t.jsx(tC.Provider,{value:v,children:e.children})}function nC(){var e=r.useContext(tC);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var oC=r.createContext(void 0);function aC(e){if(!oM(e.initialProps)){return t.jsx(oC.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(iC,{initialProps:e.initialProps,children:e.children})}function iC(e){var r=e.initialProps,n=e.children,o={selected:r.selected,onDayClick:function(e,t,n){var o,a,i;null===(o=r.onDayClick)||void 0===o||o.call(r,e,t,n),!t.selected||r.required?null===(i=r.onSelect)||void 0===i||i.call(r,e,e,t,n):null===(a=r.onSelect)||void 0===a||a.call(r,void 0,e,t,n)}};return t.jsx(oC.Provider,{value:o,children:n})}function sC(){var e=r.useContext(oC);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function lC(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(t){var n=e.modifiersClassNames[t];if(n)r.push(n);else if(function(e){return Object.values(AM).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&r.push(o)}}),r}function cC(e,n,o){var a,i,s,l=dM(),c=nC(),d=function(e,t){return JM(e,XM(),t)}(e,n),u=function(e,t){var r=dM(),n=sC(),o=zM(),a=BM(),i=nC(),s=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,d=i.focusWeekBefore,u=i.blur,p=i.focus,h=i.focusMonthBefore,f=i.focusMonthAfter,m=i.focusYearBefore,v=i.focusYearAfter,y=i.focusStartOfWeek,g=i.focusEndOfWeek,x={onClick:function(i){var s,l,c,d;oM(r)?null===(s=n.onDayClick)||void 0===s||s.call(n,e,t,i):rM(r)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,i):nM(r)?null===(c=a.onDayClick)||void 0===c||c.call(a,e,t,i):null===(d=r.onDayClick)||void 0===d||d.call(r,e,t,i)},onFocus:function(n){var o;p(e),null===(o=r.onDayFocus)||void 0===o||o.call(r,e,t,n)},onBlur:function(n){var o;u(),null===(o=r.onDayBlur)||void 0===o||o.call(r,e,t,n)},onKeyDown:function(n){var o;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?s():l();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?l():s();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),c();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),d();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?m():h();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():f();break;case"Home":n.preventDefault(),n.stopPropagation(),y();break;case"End":n.preventDefault(),n.stopPropagation(),g()}null===(o=r.onDayKeyDown)||void 0===o||o.call(r,e,t,n)},onKeyUp:function(n){var o;null===(o=r.onDayKeyUp)||void 0===o||o.call(r,e,t,n)},onMouseEnter:function(n){var o;null===(o=r.onDayMouseEnter)||void 0===o||o.call(r,e,t,n)},onMouseLeave:function(n){var o;null===(o=r.onDayMouseLeave)||void 0===o||o.call(r,e,t,n)},onPointerEnter:function(n){var o;null===(o=r.onDayPointerEnter)||void 0===o||o.call(r,e,t,n)},onPointerLeave:function(n){var o;null===(o=r.onDayPointerLeave)||void 0===o||o.call(r,e,t,n)},onTouchCancel:function(n){var o;null===(o=r.onDayTouchCancel)||void 0===o||o.call(r,e,t,n)},onTouchEnd:function(n){var o;null===(o=r.onDayTouchEnd)||void 0===o||o.call(r,e,t,n)},onTouchMove:function(n){var o;null===(o=r.onDayTouchMove)||void 0===o||o.call(r,e,t,n)},onTouchStart:function(n){var o;null===(o=r.onDayTouchStart)||void 0===o||o.call(r,e,t,n)}};return x}(e,d),p=function(){var e=dM(),t=sC(),r=zM(),n=BM();return oM(e)?t.selected:rM(e)?r.selected:nM(e)?n.selected:void 0}(),h=!(!l.onDayClick&&"default"===l.mode);r.useEffect(function(){var t;d.outside||c.focusedDay&&h&&L(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())},[c.focusedDay,e,o,h,d.outside]);var f=lC(l,d).join(" "),m=function(e,t){var r=eM({},e.styles.day);return Object.keys(t).forEach(function(t){var n;r=eM(eM({},r),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])}),r}(l,d),v=!!(d.outside&&!l.showOutsideDays||d.hidden),y=null!==(s=null===(i=l.components)||void 0===i?void 0:i.DayContent)&&void 0!==s?s:PM,g={style:m,className:f,children:t.jsx(y,{date:e,displayMonth:n,activeModifiers:d}),role:"gridcell"},x=c.focusTarget&&L(c.focusTarget,e)&&!d.outside,b=c.focusedDay&&L(c.focusedDay,e),k=eM(eM(eM({},g),((a={disabled:d.disabled,role:"gridcell"})["aria-selected"]=d.selected,a.tabIndex=b||x?0:-1,a)),u);return{isButton:h,isHidden:v,activeModifiers:d,selectedDays:p,buttonProps:k,divProps:g}}function dC(e){var n=r.useRef(null),o=cC(e.date,e.displayMonth,n);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(wM,eM({name:"day",ref:n},o.buttonProps)):t.jsx("div",eM({},o.divProps))}function uC(e){var r=e.number,n=e.dates,o=dM(),a=o.onWeekNumberClick,i=o.styles,s=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,d=(0,o.formatters.formatWeekNumber)(Number(r),{locale:l});if(!a)return t.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:d});var u=c(Number(r),{locale:l});return t.jsx(wM,{name:"week-number","aria-label":u,className:s.weeknumber,style:i.weeknumber,onClick:function(e){a(r,n,e)},children:d})}function pC(e){var r,n,o,a=dM(),i=a.styles,s=a.classNames,l=a.showWeekNumber,c=a.components,d=null!==(r=null==c?void 0:c.Day)&&void 0!==r?r:dC,u=null!==(n=null==c?void 0:c.WeekNumber)&&void 0!==n?n:uC;return l&&(o=t.jsx("td",{className:s.cell,style:i.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:s.row,style:i.row,children:[o,e.dates.map(function(r){return t.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:t.jsx(d,{displayMonth:e.displayMonth,date:r})},function(e){return Math.trunc(+g(e)/1e3)}(r))})]})}function hC(e,t,r){for(var n=null!=r&&r.ISOWeek?G(t):K(t,r),o=null!=r&&r.ISOWeek?S(e):O(e,r),a=N(n,o),i=[],s=0;s<=a;s++)i.push(b(o,s));var l=i.reduce(function(e,t){var n=null!=r&&r.ISOWeek?ie(t):le(t,r),o=e.find(function(e){return e.weekNumber===n});return o?(o.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)},[]);return l}function fC(e){var r,n,o,a=dM(),i=a.locale,s=a.classNames,l=a.styles,c=a.hideHead,d=a.fixedWeeks,u=a.components,p=a.weekStartsOn,h=a.firstWeekContainsDate,f=a.ISOWeek,m=function(e,t){var r=hC(U(e),$(e),t);if(null!=t&&t.useFixedWeeks){var n=Ae(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],i=z(a,6-n),s=hC(z(a,1),i,t);r.push.apply(r,s)}}return r}(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:f,locale:i,weekStartsOn:p,firstWeekContainsDate:h}),v=null!==(r=null==u?void 0:u.Head)&&void 0!==r?r:SM,y=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:pC,g=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:jM;return t.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(v,{}),t.jsx("tbody",{className:s.tbody,style:l.tbody,children:m.map(function(r){return t.jsx(y,{displayMonth:e.displayMonth,dates:r.dates,weekNumber:r.weekNumber},r.weekNumber)})}),t.jsx(g,{displayMonth:e.displayMonth})]})}var mC=typeof window<"u"&&window.document&&window.document.createElement?r.useLayoutEffect:r.useEffect,vC=!1,yC=0;function gC(){return"react-day-picker-".concat(++yC)}function xC(e){var n,o,a=dM(),i=a.dir,s=a.classNames,l=a.styles,c=a.components,d=xM().displayMonths,u=function(e){var t,n=e??(vC?gC():null),o=r.useState(n),a=o[0],i=o[1];return mC(function(){null===a&&i(gC())},[]),r.useEffect(function(){!1===vC&&(vC=!0)},[]),null!==(t=e??a)&&void 0!==t?t:void 0}(a.id?"".concat(a.id,"-").concat(e.displayIndex):void 0),p=a.id?"".concat(a.id,"-grid-").concat(e.displayIndex):void 0,h=[s.month],f=l.month,m=0===e.displayIndex,v=e.displayIndex===d.length-1,y=!m&&!v;"rtl"===i&&(v=(n=[m,v])[0],m=n[1]),m&&(h.push(s.caption_start),f=eM(eM({},f),l.caption_start)),v&&(h.push(s.caption_end),f=eM(eM({},f),l.caption_end)),y&&(h.push(s.caption_between),f=eM(eM({},f),l.caption_between));var g=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:DM;return t.jsxs("div",{className:h.join(" "),style:f,children:[t.jsx(g,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(fC,{id:p,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function bC(e){var r=dM(),n=r.classNames,o=r.styles;return t.jsx("div",{className:n.months,style:o.months,children:e.children})}function kC(e){var n,o,a=e.initialProps,i=dM(),s=nC(),l=xM(),c=r.useState(!1),d=c[0],u=c[1];r.useEffect(function(){i.initialFocus&&s.focusTarget&&(d||(s.focus(s.focusTarget),u(!0)))},[i.initialFocus,d,s.focus,s.focusTarget,s]);var p=[i.classNames.root,i.className];i.numberOfMonths>1&&p.push(i.classNames.multiple_months),i.showWeekNumber&&p.push(i.classNames.with_weeknumber);var h=eM(eM({},i.styles.root),i.style),f=Object.keys(a).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var r;return eM(eM({},e),((r={})[t]=a[t],r))},{}),m=null!==(o=null===(n=a.components)||void 0===n?void 0:n.Months)&&void 0!==o?o:bC;return t.jsx("div",eM({className:p.join(" "),style:h,dir:i.dir,id:i.id,nonce:a.nonce,title:a.title,lang:a.lang},f,{children:t.jsx(m,{children:l.displayMonths.map(function(e,r){return t.jsx(xC,{displayIndex:r,displayMonth:e},r)})})}))}function _C(e){var r=e.children,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["children"]);return t.jsx(cM,{initialProps:n,children:t.jsx(gM,{children:t.jsx(aC,{initialProps:n,children:t.jsx(TM,{initialProps:n,children:t.jsx(FM,{initialProps:n,children:t.jsx(GM,{children:t.jsx(rC,{children:r})})})})})})})}function wC(e){return t.jsx(_C,eM({},e,{children:t.jsx(kC,{initialProps:e})}))}function MC({className:e,classNames:r,showOutsideDays:n=!0,...o}){return t.jsx(wC,{showOutsideDays:n,className:Br("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Br(Vr({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Br(Vr({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},components:{IconLeft:({className:e,...r})=>t.jsx(yt,{className:Br("h-4 w-4",e),...r}),IconRight:({className:e,...r})=>t.jsx(gt,{className:Br("h-4 w-4",e),...r})},...o})}MC.displayName="Calendar";var CC="AlertDialog",[DC,jC]=Wd(CC,[kb]),OC=kb(),SC=e=>{const{__scopeAlertDialog:r,...n}=e,o=OC(r);return t.jsx(Qb,{...o,...n,modal:!0})};SC.displayName=CC;var PC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(Jb,{...a,...o,ref:r})});PC.displayName="AlertDialogTrigger";var EC=e=>{const{__scopeAlertDialog:r,...n}=e,o=OC(r);return t.jsx(ek,{...o,...n})};EC.displayName="AlertDialogPortal";var TC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(tk,{...a,...o,ref:r})});TC.displayName="AlertDialogOverlay";var NC="AlertDialogContent",[zC,AC]=DC(NC),RC=It("AlertDialogContent"),FC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:o,...i}=e,s=OC(n),l=a.useRef(null),c=Ft(r,l),d=a.useRef(null);return t.jsx(Zb,{contentName:NC,titleName:LC,docsSlug:"alert-dialog",children:t.jsx(zC,{scope:n,cancelRef:d,children:t.jsxs(rk,{role:"alertdialog",...s,...i,ref:c,onOpenAutoFocus:$d(i.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=d.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t.jsx(RC,{children:o}),t.jsx(WC,{contentRef:l})]})})})});FC.displayName=NC;var LC="AlertDialogTitle",BC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(nk,{...a,...o,ref:r})});BC.displayName=LC;var VC="AlertDialogDescription",IC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(ok,{...a,...o,ref:r})});IC.displayName=VC;var qC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(ak,{...a,...o,ref:r})});qC.displayName="AlertDialogAction";var HC="AlertDialogCancel",$C=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:a}=AC(HC,n),i=OC(n),s=Ft(r,a);return t.jsx(ak,{...i,...o,ref:s})});$C.displayName=HC;var WC=({contentRef:e})=>{const t=`\`${NC}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${NC}\` by passing a \`${VC}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${NC}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{var r;document.getElementById(null==(r=e.current)?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},UC=TC,YC=FC,ZC=qC,KC=$C,GC=BC,XC=IC;const QC=SC,JC=PC,eD=EC,tD=a.forwardRef(({className:e,...r},n)=>t.jsx(UC,{className:Br("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));tD.displayName=UC.displayName;const rD=a.forwardRef(({className:e,...r},n)=>t.jsxs(eD,{children:[t.jsx(tD,{}),t.jsx(YC,{ref:n,className:Br("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));rD.displayName=YC.displayName;const nD=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col space-y-2 text-center sm:text-left",e),...r});nD.displayName="AlertDialogHeader";const oD=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});oD.displayName="AlertDialogFooter";const aD=a.forwardRef(({className:e,...r},n)=>t.jsx(GC,{ref:n,className:Br("text-lg font-semibold",e),...r}));aD.displayName=GC.displayName;const iD=a.forwardRef(({className:e,...r},n)=>t.jsx(XC,{ref:n,className:Br("text-sm text-muted-foreground",e),...r}));iD.displayName=XC.displayName;const sD=a.forwardRef(({className:e,...r},n)=>t.jsx(ZC,{ref:n,className:Br(Vr(),e),...r}));sD.displayName=ZC.displayName;const lD=a.forwardRef(({className:e,...r},n)=>t.jsx(KC,{ref:n,className:Br(Vr({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));function cD(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}lD.displayName=KC.displayName;var dD="Radio",[uD,pD]=Wd(dD),[hD,fD]=uD(dD),mD=a.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:i=!1,required:s,disabled:l,value:c="on",onCheck:d,form:u,...p}=e,[h,f]=a.useState(null),m=Ft(r,e=>f(e)),v=a.useRef(!1),y=!h||(u||!!h.closest("form"));return t.jsxs(hD,{scope:n,checked:i,disabled:l,children:[t.jsx(Gd.button,{type:"button",role:"radio","aria-checked":i,"data-state":xD(i),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:m,onClick:$d(e.onClick,e=>{i||null==d||d(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t.jsx(gD,{control:h,bubbles:!v.current,name:o,value:c,checked:i,required:s,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});mD.displayName=dD;var vD="RadioIndicator",yD=a.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...a}=e,i=fD(vD,n);return t.jsx(Hh,{present:o||i.checked,children:t.jsx(Gd.span,{"data-state":xD(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})})});yD.displayName=vD;var gD=a.forwardRef(({__scopeRadio:e,control:r,checked:n,bubbles:o=!0,...i},s)=>{const l=a.useRef(null),c=Ft(l,s),d=cD(n),u=xh(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[d,n,o]),t.jsx(Gd.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function xD(e){return e?"checked":"unchecked"}gD.displayName="RadioBubbleInput";var bD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],kD="RadioGroup",[_D,wD]=Wd(kD,[Qh,pD]),MD=Qh(),CD=pD(),[DD,jD]=_D(kD),OD=a.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:p,...h}=e,f=MD(n),m=eu(d),[v,y]=Kd({prop:i,defaultProp:a??null,onChange:p,caller:kD});return t.jsx(DD,{scope:n,name:o,required:s,disabled:l,value:v,onValueChange:y,children:t.jsx(lf,{asChild:!0,...f,orientation:c,dir:m,loop:u,children:t.jsx(Gd.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...h,ref:r})})})});OD.displayName=kD;var SD="RadioGroupItem",PD=a.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...i}=e,s=jD(SD,n),l=s.disabled||o,c=MD(n),d=CD(n),u=a.useRef(null),p=Ft(r,u),h=s.value===i.value,f=a.useRef(!1);return a.useEffect(()=>{const e=e=>{bD.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t.jsx(cf,{asChild:!0,...c,focusable:!l,active:h,children:t.jsx(mD,{disabled:l,required:s.required,checked:h,...d,...i,name:s.name,ref:p,onCheck:()=>s.onValueChange(i.value),onKeyDown:$d(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:$d(i.onFocus,()=>{var e;f.current&&(null==(e=u.current)||e.click())})})})});PD.displayName=SD;var ED=a.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,a=CD(n);return t.jsx(yD,{...a,...o,ref:r})});ED.displayName="RadioGroupIndicator";var TD=OD,ND=PD,zD=ED;const AD=a.forwardRef(({className:e,...r},n)=>t.jsx(TD,{className:Br("grid gap-2",e),...r,ref:n}));AD.displayName=TD.displayName;const RD=a.forwardRef(({className:e,...r},n)=>t.jsx(ND,{ref:n,className:Br("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t.jsx(zD,{className:"flex items-center justify-center",children:t.jsx(_t,{className:"h-3.5 w-3.5 fill-primary"})})}));RD.displayName=ND.displayName;var FD=a.forwardRef((e,r)=>t.jsx(Gd.label,{...e,ref:r,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));FD.displayName="Label";var LD=FD;const BD=Yt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),VD=a.forwardRef(({className:e,...r},n)=>t.jsx(LD,{ref:n,className:Br(BD(),e),...r}));VD.displayName=LD.displayName;const ID=e=>{const{children:t,...n}=e;return r.createElement(tw.Provider,{value:n},t)},qD=a.createContext({}),HD=({...e})=>t.jsx(qD.Provider,{value:{name:e.name},children:t.jsx(lw,{...e})}),$D=()=>{const e=a.useContext(qD),t=a.useContext(WD),{getFieldState:r,formState:n}=rw(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},WD=a.createContext({}),UD=a.forwardRef(({className:e,...r},n)=>{const o=a.useId();return t.jsx(WD.Provider,{value:{id:o},children:t.jsx("div",{ref:n,className:Br("space-y-2",e),...r})})});UD.displayName="FormItem";const YD=a.forwardRef(({className:e,...r},n)=>{const{error:o,formItemId:a}=$D();return t.jsx(VD,{ref:n,className:Br(o&&"text-destructive",e),htmlFor:a,...r})});YD.displayName="FormLabel";const ZD=a.forwardRef(({...e},r)=>{const{error:n,formItemId:o,formDescriptionId:a,formMessageId:i}=$D();return t.jsx(Bt,{ref:r,id:o,"aria-describedby":n?`${a} ${i}`:`${a}`,"aria-invalid":!!n,...e})});ZD.displayName="FormControl";const KD=a.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:o}=$D();return t.jsx("p",{ref:n,id:o,className:Br("text-sm text-muted-foreground",e),...r})});KD.displayName="FormDescription";const GD=a.forwardRef(({className:e,children:r,...n},o)=>{const{error:a,formMessageId:i}=$D(),s=a?String(null==a?void 0:a.message):r;return s?t.jsx("p",{ref:o,id:i,className:Br("text-sm font-medium text-destructive",e),...n,children:s}):null});GD.displayName="FormMessage";const XD=a.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{className:Br("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));XD.displayName="Textarea";const QD=r.forwardRef(({value:e,onChange:r,...n},o)=>{const a=t=>{const[n,o]=e.split(":").map(Number);let a=n,i=o;"up"===t?(i+=15,i>=60&&(i=0,a=(a+1)%24)):(i-=15,i<0&&(i=45,a=(a-1+24)%24));const s=`${String(a).padStart(2,"0")}:${String(i).padStart(2,"0")}`;r(s)};return t.jsxs("div",{className:"relative",children:[t.jsx(r_,{type:"time",ref:o,value:e,onChange:e=>r(e.target.value),...n,className:"pr-8"}),t.jsxs("div",{className:"absolute right-1 top-1 bottom-1 flex flex-col justify-center",children:[t.jsx(Ir,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("up"),children:t.jsx(xt,{className:"h-3 w-3"})}),t.jsx(Ir,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("down"),children:t.jsx(vt,{className:"h-3 w-3"})})]})]})});function JD(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function ej(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&r.every(r=>{const n=e[r],o=t[r];return"function"==typeof n?`${n}`==`${o}`:JD(n)&&JD(o)?ej(n,o):n===o})}function tj(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function rj(e){return"number"==typeof e}function nj(e){return"string"==typeof e}function oj(e){return"boolean"==typeof e}function aj(e){return"[object Object]"===Object.prototype.toString.call(e)}function ij(e){return Math.abs(e)}function sj(e){return Math.sign(e)}function lj(e,t){return ij(e-t)}function cj(e){return fj(e).map(Number)}function dj(e){return e[uj(e)]}function uj(e){return Math.max(0,e.length-1)}function pj(e,t){return t===uj(e)}function hj(e,t=0){return Array.from(Array(e),(e,r)=>t+r)}function fj(e){return Object.keys(e)}function mj(e,t){return[e,t].reduce((e,t)=>(fj(t).forEach(r=>{const n=e[r],o=t[r],a=aj(n)&&aj(o);e[r]=a?mj(n,o):o}),e),{})}function vj(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function yj(){let e=[];const t={add:function(r,n,o,a={passive:!0}){let i;if("addEventListener"in r)r.addEventListener(n,o,a),i=()=>r.removeEventListener(n,o,a);else{const e=r;e.addListener(o),i=()=>e.removeListener(o)}return e.push(i),t},clear:function(){e=e.filter(e=>e())}};return t}function gj(e,t,r,n){const o=yj(),a=1e3/60;let i=null,s=0,l=0;function c(e){if(!l)return;i||(i=e,r(),r());const o=e-i;for(i=e,s+=o;s>=a;)r(),s-=a;n(s/a),l&&(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),i=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(i=null,s=0)})},destroy:function(){d(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:d,update:r,render:n}}function xj(e=0,t=0){const r=ij(e-t);function n(t){return t<e}function o(e){return e>t}function a(e){return n(e)||o(e)}return{length:r,max:t,min:e,constrain:function(r){return a(r)?n(r)?e:t:r},reachedAny:a,reachedMax:o,reachedMin:n,removeOffset:function(e){return r?e-r*Math.ceil((e-t)/r):e}}}function bj(e,t,r){const{constrain:n}=xj(0,e),o=e+1;let a=i(t);function i(e){return r?ij((o+e)%o):n(e)}function s(){return a}function l(){return bj(e,s(),r)}const c={get:s,set:function(e){return a=i(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function kj(e,t,r,n,o,a,i,s,l,c,d,u,p,h,f,m,v,y,g){const{cross:x,direction:b}=e,k=["INPUT","SELECT","TEXTAREA"],_={passive:!1},w=yj(),M=yj(),C=xj(50,225).constrain(h.measure(20)),D={mouse:300,touch:400},j={mouse:500,touch:600},O=f?43:25;let S=!1,P=0,E=0,T=!1,N=!1,z=!1,A=!1;function R(e){if(!vj(e,n)&&e.touches.length>=2)return F(e);const t=a.readPoint(e),r=a.readPoint(e,x),i=lj(t,P),l=lj(r,E);if(!(N||A||e.cancelable&&(N=i>l,N)))return F(e);const d=a.pointerMove(e);i>m&&(z=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(b(d)),e.preventDefault()}function F(e){const t=d.byDistance(0,!1).index!==u.get(),r=a.pointerUp(e)*(f?j:D)[A?"mouse":"touch"],n=function(e,t){const r=u.add(-1*sj(e)),n=d.byDistance(e,!f).distance;return f||ij(e)<C?n:v&&t?.5*n:d.byIndex(r.get(),0).distance}(b(r),t),o=function(e,t){if(0===e||0===t||ij(e)<=ij(t))return 0;const r=lj(ij(e),ij(t));return ij(r/e)}(r,n),i=O-10*o,s=y+o/50;N=!1,T=!1,M.clear(),c.useDuration(i).useFriction(s),l.distance(n,!f),A=!1,p.emit("pointerUp")}function L(e){z&&(e.stopPropagation(),e.preventDefault(),z=!1)}return{init:function(e){if(!g)return;function s(s){(oj(g)||g(e,s))&&function(e){const s=vj(e,n);A=s,z=f&&s&&!e.buttons&&S,S=lj(o.get(),i.get())>=2,(!s||0===e.button)&&(function(e){const t=e.nodeName||"";return k.includes(t)}(e.target)||(T=!0,a.pointerDown(e),c.useFriction(0).useDuration(0),o.set(i),function(){const e=A?r:t;M.add(e,"touchmove",R,_).add(e,"touchend",F).add(e,"mousemove",R,_).add(e,"mouseup",F)}(),P=a.readPoint(e),E=a.readPoint(e,x),p.emit("pointerDown")))}(s)}const l=t;w.add(l,"dragstart",e=>e.preventDefault(),_).add(l,"touchmove",()=>{},_).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",F).add(l,"contextmenu",F).add(l,"click",L,!0)},destroy:function(){w.clear(),M.clear()},pointerDown:function(){return T}}}function _j(e,t){let r,n;function o(e){return e.timeStamp}function a(r,n){const o="client"+("x"===(n||e.scroll)?"X":"Y");return(vj(r,t)?r:r.touches[0])[o]}return{pointerDown:function(e){return r=e,n=e,a(e)},pointerMove:function(e){const t=a(e)-a(n),i=o(e)-o(r)>170;return n=e,i&&(r=e),t},pointerUp:function(e){if(!r||!n)return 0;const t=a(n)-a(r),i=o(e)-o(r),s=o(e)-o(n)>170,l=t/i;return i&&!s&&ij(l)>.1?l:0},readPoint:a}}function wj(e,t,r,n,o,a,i){const s=[e].concat(n);let l,c,d=[],u=!1;function p(e){return o.measureSize(i.measure(e))}return{init:function(o){a&&(c=p(e),d=n.map(p),l=new ResizeObserver(r=>{(oj(a)||a(o,r))&&function(r){for(const a of r){if(u)return;const r=a.target===e,i=n.indexOf(a.target),s=r?c:d[i];if(ij(p(r?e:n[i])-s)>=.5){o.reInit(),t.emit("resize");break}}}(r)}),r.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){u=!0,l&&l.disconnect()}}}function Mj(e,t,r,n,o){const a=o.measure(10),i=o.measure(50),s=xj(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",d=ij(e[l]-t.get()),u=r.get()-t.get(),p=s.constrain(d/i);r.subtract(u*p),!o&&ij(u)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function Cj(e,t,r,n){const o=t.min+.1,a=t.max+.1,{reachedMin:i,reachedMax:s}=xj(o,a);return{loop:function(t){if(!function(e){return 1===e?s(r.get()):-1===e&&i(r.get())}(t))return;const o=e*(-1*t);n.forEach(e=>e.add(o))}}}function Dj(e,t,r,n,o){const{reachedAny:a,removeOffset:i,constrain:s}=n;function l(e){return e.concat().sort((e,t)=>ij(e)-ij(t))[0]}function c(t,n){const o=[t,t+r,t-r];if(!e)return t;if(!n)return l(o);const a=o.filter(e=>sj(e)===n);return a.length?l(a):dj(o)-r}return{byDistance:function(r,n){const l=o.get()+r,{index:d,distance:u}=function(r){const n=e?i(r):s(r),o=t.map((e,t)=>({diff:c(e-n,0),index:t})).sort((e,t)=>ij(e.diff)-ij(t.diff)),{index:a}=o[0];return{index:a,distance:n}}(l),p=!e&&a(l);return!n||p?{index:d,distance:r}:{index:d,distance:r+c(t[d]-u,0)}},byIndex:function(e,r){return{index:e,distance:c(t[e]-o.get(),r)}},shortcut:c}}function jj(e,t,r,n,o,a,i,s){const l={passive:!0,capture:!0};let c=0;function d(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(u){s&&(a.add(document,"keydown",d,!1),t.forEach((t,d)=>{a.add(t,"focus",t=>{(oj(s)||s(u,t))&&function(t){if((new Date).getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const a=r.findIndex(e=>e.includes(t));rj(a)&&(o.useDuration(0),n.index(a,0),i.emit("slideFocus"))}(d)},l)}))}}}function Oj(e){let t=e;function r(e){return rj(e)?e:e.get()}return{get:function(){return t},set:function(e){t=r(e)},add:function(e){t+=r(e)},subtract:function(e){t-=r(e)}}}function Sj(e,t){const r="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},n=t.style;let o=null,a=!1;return{clear:function(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(a)return;const i=function(e){return Math.round(100*e)/100}(e.direction(t));i!==o&&(n.transform=r(i),o=i)},toggleActive:function(e){a=!e}}}function Pj(e,t,r,n,o,a,i,s,l){const c=cj(o),d=cj(o).reverse(),u=function(){const e=i[0],t=h(d,e);return f(t,r,!1)}().concat(function(){const e=t-i[0]-1,n=h(c,e);return f(n,-r,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,r)=>p(e,t)>0?e.concat([r]):e,[])}function f(o,i,c){const d=function(e){return a.map((r,o)=>({start:r-n[o]+.5+e,end:r+t-.5+e}))}(i);return o.map(t=>{const n=c?0:-r,o=c?r:0,a=c?"end":"start",i=d[t][a];return{index:t,loopPoint:i,slideLocation:Oj(-1),translate:Sj(e,l[t]),target:()=>s.get()>i?n:o}})}return{canLoop:function(){return u.every(({index:e})=>{const r=c.filter(t=>t!==e);return p(r,t)<=.1})},clear:function(){u.forEach(e=>e.translate.clear())},loop:function(){u.forEach(e=>{const{target:t,translate:r,slideLocation:n}=e,o=t();o!==n.get()&&(r.to(o),n.set(o))})},loopPoints:u}}function Ej(e,t,r){let n,o=!1;return{init:function(a){r&&(n=new MutationObserver(e=>{o||(oj(r)||r(a,e))&&function(e){for(const r of e)if("childList"===r.type){a.reInit(),t.emit("slidesChanged");break}}(e)}),n.observe(e,{childList:!0}))},destroy:function(){n&&n.disconnect(),o=!0}}}function Tj(e,t,r,n){const o={};let a,i=null,s=null,l=!1;return{init:function(){a=new IntersectionObserver(e=>{l||(e.forEach(e=>{const r=t.indexOf(e.target);o[r]=e}),i=null,s=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(e=>a.observe(e))},destroy:function(){a&&a.disconnect(),l=!0},get:function(e=!0){if(e&&i)return i;if(!e&&s)return s;const t=function(e){return fj(o).reduce((t,r)=>{const n=parseInt(r),{isIntersecting:a}=o[n];return(e&&a||!e&&!a)&&t.push(n),t},[])}(e);return e&&(i=t),e||(s=t),t}}}function Nj(e,t,r,n,o,a,i,s,l){const{startEdge:c,endEdge:d,direction:u}=e,p=rj(r);return{groupSlides:function(e){return p?function(e,t){return cj(e).filter(e=>e%t===0).map(r=>e.slice(r,r+t))}(e,r):function(e){return e.length?cj(e).reduce((r,p,h)=>{const f=dj(r)||0,m=0===f,v=p===uj(e),y=o[c]-a[f][c],g=o[c]-a[p][d],x=!n&&m?u(i):0,b=ij(g-(!n&&v?u(s):0)-(y+x));return h&&b>t+l&&r.push(p),v&&r.push(e.length),r},[]).map((t,r,n)=>{const o=Math.max(n[r-1]||0);return e.slice(o,t)}):[]}(e)}}}function zj(e,t,r,n,o,a,i){const{align:s,axis:l,direction:c,startIndex:d,loop:u,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:m,slidesToScroll:v,skipSnaps:y,containScroll:g,watchResize:x,watchSlides:b,watchDrag:k,watchFocus:_}=a,w={measure:function(e){const{offsetTop:t,offsetLeft:r,offsetWidth:n,offsetHeight:o}=e;return{top:t,right:r+n,bottom:t+o,left:r,width:n,height:o}}},M=w.measure(t),C=r.map(w.measure),D=function(e,t){const r="rtl"===t,n="y"===e,o=!n&&r?-1:1;return{scroll:n?"y":"x",cross:n?"x":"y",startEdge:n?"top":r?"right":"left",endEdge:n?"bottom":r?"left":"right",measureSize:function(e){const{height:t,width:r}=e;return n?t:r},direction:function(e){return e*o}}}(l,c),j=D.measureSize(M),O=function(e){return{measure:function(t){return e*(t/100)}}}(j),S=function(e,t){const r={start:function(){return 0},center:function(e){return n(e)/2},end:n};function n(e){return t-e}return{measure:function(n,o){return nj(e)?r[e](n):e(t,n,o)}}}(s,j),P=!u&&!!g,E=u||!!g,{slideSizes:T,slideSizesWithGaps:N,startGap:z,endGap:A}=function(e,t,r,n,o,a){const{measureSize:i,startEdge:s,endEdge:l}=e,c=r[0]&&o,d=function(){if(!c)return 0;const e=r[0];return ij(t[s]-e[s])}(),u=function(){if(!c)return 0;const e=a.getComputedStyle(dj(n));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=r.map(i),h=r.map((e,t,r)=>{const n=!t,o=pj(r,t);return n?p[t]+d:o?p[t]+u:r[t+1][s]-e[s]}).map(ij);return{slideSizes:p,slideSizesWithGaps:h,startGap:d,endGap:u}}(D,M,C,r,E,o),R=Nj(D,j,v,u,M,C,z,A,2),{snaps:F,snapsAligned:L}=function(e,t,r,n,o){const{startEdge:a,endEdge:i}=e,{groupSlides:s}=o,l=s(n).map(e=>dj(e)[i]-e[0][a]).map(ij).map(t.measure),c=n.map(e=>r[a]-e[a]).map(e=>-ij(e)),d=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:d}}(D,S,M,C,R),B=-dj(F)+dj(N),{snapsContained:V,scrollContainLimit:I}=function(e,t,r,n,o){const a=xj(-t+e,0),i=r.map((e,t)=>{const{min:n,max:o}=a,i=a.constrain(e),s=!t,l=pj(r,t);return s?o:l||c(n,i)?n:c(o,i)?o:i}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=i[0],t=dj(i);return xj(i.lastIndexOf(e),i.indexOf(t)+1)}(),l=function(){if(t<=e+o)return[a.max];if("keepSnaps"===n)return i;const{min:r,max:l}=s;return i.slice(r,l)}();function c(e,t){return lj(e,t)<=1}return{snapsContained:l,scrollContainLimit:s}}(j,B,L,g,2),q=P?V:L,{limit:H}=function(e,t,r){const n=t[0];return{limit:xj(r?n-e:dj(t),n)}}(B,q,u),$=bj(uj(q),d,u),W=$.clone(),U=cj(r),Y=gj(n,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:r,options:{loop:n}})=>{n||r.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:r,offsetLocation:n,previousLocation:o,scrollLooper:a,slideLooper:i,dragHandler:s,animation:l,eventHandler:c,scrollBounds:d,options:{loop:u}},p)=>{const h=e.settled(),f=!d.shouldConstrain(),m=u?h:h&&f,v=m&&!s.pointerDown();v&&l.stop();const y=r.get()*p+o.get()*(1-p);n.set(y),u&&(a.loop(e.direction()),i.loop()),t.to(n.get()),v&&c.emit("settle"),m||c.emit("scroll")})(se,e)),Z=q[$.get()],K=Oj(Z),G=Oj(Z),X=Oj(Z),Q=Oj(Z),J=function(e,t,r,n,o,a){let i=0,s=0,l=o,c=a,d=e.get(),u=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return i},seek:function(){const t=n.get()-e.get();let o=0;return l?(r.set(e),i+=t/l,i*=c,d+=i,e.add(i),o=d-u):(i=0,r.set(n),e.set(n),o=t),s=sj(o),u=d,f},settled:function(){return ij(n.get()-t.get())<.001},useBaseFriction:function(){return h(a)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(K,X,G,Q,p,.68),ee=Dj(u,q,B,H,Q),te=function(e,t,r,n,o,a,i){function s(o){const s=o.distance,l=o.index!==t.get();a.add(s),s&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(r.set(t.get()),t.set(o.index),i.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,r){const n=t.clone().set(e);s(o.byIndex(n.get(),r))}}}(Y,$,W,J,ee,Q,i),re=function(e){const{max:t,length:r}=e;return{get:function(e){return r?(e-t)/-r:0}}}(H),ne=yj(),oe=Tj(t,r,i,m),{slideRegistry:ae}=function(e,t,r,n,o,a){const{groupSlides:i}=o,{min:s,max:l}=n,c=function(){const n=i(a),o=!e||"keepSnaps"===t;return 1===r.length?[a]:o?n:n.slice(s,l).map((e,t,r)=>{const n=!t,o=pj(r,t);return n?hj(dj(r[0])+1):o?hj(uj(a)-dj(r)[0]+1,dj(r)[0]):e})}();return{slideRegistry:c}}(P,g,q,I,R,U),ie=jj(e,r,ae,te,J,ne,i,_),se={ownerDocument:n,ownerWindow:o,eventHandler:i,containerRect:M,slideRects:C,animation:Y,axis:D,dragHandler:kj(D,e,n,o,Q,_j(D,o),K,Y,te,J,ee,$,i,O,h,f,y,.68,k),eventStore:ne,percentOfView:O,index:$,indexPrevious:W,limit:H,location:K,offsetLocation:X,previousLocation:G,options:a,resizeHandler:wj(t,i,o,r,D,x,w),scrollBody:J,scrollBounds:Mj(H,X,Q,J,O),scrollLooper:Cj(B,H,X,[K,X,G,Q]),scrollProgress:re,scrollSnapList:q.map(re.get),scrollSnaps:q,scrollTarget:ee,scrollTo:te,slideLooper:Pj(D,j,B,T,N,F,q,X,r),slideFocus:ie,slidesHandler:Ej(t,i,b),slidesInView:oe,slideIndexes:U,slideRegistry:ae,slidesToScroll:R,target:Q,translate:Sj(D,t)};return se}QD.displayName="TimeInput";const Aj={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Rj(e){function t(e,t){return mj(e,t||{})}return{mergeOptions:t,optionsAtMedia:function(r){const n=r.breakpoints||{},o=fj(n).filter(t=>e.matchMedia(t).matches).map(e=>n[e]).reduce((e,r)=>t(e,r),{});return t(r,o)},optionsMediaQueries:function(t){return t.map(e=>fj(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}}}function Fj(e,t,r){const n=e.ownerDocument,o=n.defaultView,a=Rj(o),i=function(e){let t=[];return{init:function(r,n){return t=n.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(r,e)),n.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}}}(a),s=yj(),l=function(){let e,t={};function r(e){return t[e]||[]}const n={init:function(t){e=t},emit:function(t){return r(t).forEach(r=>r(e,t)),n},off:function(e,o){return t[e]=r(e).filter(e=>e!==o),n},on:function(e,o){return t[e]=r(e).concat([o]),n},clear:function(){t={}}};return n}(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:u}=a,{on:p,off:h,emit:f}=l,m=D;let v,y,g,x,b=!1,k=c(Aj,Fj.globalOptions),_=c(k),w=[];function M(t){const r=zj(e,g,x,n,o,t,l);if(t.loop&&!r.slideLooper.canLoop()){return M(Object.assign({},t,{loop:!1}))}return r}function C(t,r){b||(k=c(k,t),_=d(k),w=r||w,function(){const{container:t,slides:r}=_;g=(nj(t)?e.querySelector(t):t)||e.children[0];const n=nj(r)?g.querySelectorAll(r):r;x=[].slice.call(n||g.children)}(),v=M(_),u([k,...w.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",D)),_.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(P),v.eventHandler.init(P),v.resizeHandler.init(P),v.slidesHandler.init(P),v.options.loop&&v.slideLooper.loop(),g.offsetParent&&x.length&&v.dragHandler.init(P),y=i.init(P,w)))}function D(e,t){const r=S();j(),C(c({startIndex:r},e),t),l.emit("reInit")}function j(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),i.destroy(),s.clear()}function O(e,t,r){!_.active||b||(v.scrollBody.useBaseFriction().useDuration(!0===t?0:_.duration),v.scrollTo.index(e,r||0))}function S(){return v.index.get()}const P={canScrollNext:function(){return v.index.add(1).get()!==S()},canScrollPrev:function(){return v.index.add(-1).get()!==S()},containerNode:function(){return g},internalEngine:function(){return v},destroy:function(){b||(b=!0,s.clear(),j(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return y},previousScrollSnap:function(){return v.indexPrevious.get()},reInit:m,rootNode:function(){return e},scrollNext:function(e){O(v.index.add(1).get(),e,-1)},scrollPrev:function(e){O(v.index.add(-1).get(),e,1)},scrollProgress:function(){return v.scrollProgress.get(v.offsetLocation.get())},scrollSnapList:function(){return v.scrollSnapList},scrollTo:O,selectedScrollSnap:S,slideNodes:function(){return x},slidesInView:function(){return v.slidesInView.get()},slidesNotInView:function(){return v.slidesInView.get(!1)}};return C(t,r),setTimeout(()=>l.emit("init"),0),P}function Lj(e={},t=[]){const n=r.useRef(e),o=r.useRef(t),[a,i]=r.useState(),[s,l]=r.useState(),c=r.useCallback(()=>{a&&a.reInit(n.current,o.current)},[a]);return r.useEffect(()=>{ej(n.current,e)||(n.current=e,c())},[e,c]),r.useEffect(()=>{(function(e,t){if(e.length!==t.length)return!1;const r=tj(e),n=tj(t);return r.every((e,t)=>ej(e,n[t]))})(o.current,t)||(o.current=t,c())},[t,c]),r.useEffect(()=>{if(typeof window<"u"&&window.document&&window.document.createElement&&s){Fj.globalOptions=Lj.globalOptions;const e=Fj(s,n.current,o.current);return i(e),()=>e.destroy()}i(void 0)},[s,i]),[l,a]}Fj.globalOptions=void 0,Lj.globalOptions=void 0;const Bj=a.createContext(null);function Vj(){const e=a.useContext(Bj);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const Ij=a.forwardRef(({orientation:e="horizontal",opts:r,setApi:n,plugins:o,className:i,children:s,...l},c)=>{const[d,u]=Lj({...r,axis:"horizontal"===e?"x":"y"},o),[p,h]=a.useState(!1),[f,m]=a.useState(!1),v=a.useCallback(e=>{e&&(h(e.canScrollPrev()),m(e.canScrollNext()))},[]),y=a.useCallback(()=>{null==u||u.scrollPrev()},[u]),g=a.useCallback(()=>{null==u||u.scrollNext()},[u]),x=a.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),y()):"ArrowRight"===e.key&&(e.preventDefault(),g())},[y,g]);return a.useEffect(()=>{!u||!n||n(u)},[u,n]),a.useEffect(()=>{if(u)return v(u),u.on("reInit",v),u.on("select",v),()=>{null==u||u.off("select",v)}},[u,v]),t.jsx(Bj.Provider,{value:{carouselRef:d,api:u,opts:r,orientation:e||("y"===(null==r?void 0:r.axis)?"vertical":"horizontal"),scrollPrev:y,scrollNext:g,canScrollPrev:p,canScrollNext:f},children:t.jsx("div",{ref:c,onKeyDownCapture:x,className:Br("relative",i),role:"region","aria-roledescription":"carousel",...l,children:s})})});Ij.displayName="Carousel";const qj=a.forwardRef(({className:e,...r},n)=>{const{carouselRef:o,orientation:a}=Vj();return t.jsx("div",{ref:o,className:"overflow-hidden",children:t.jsx("div",{ref:n,className:Br("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",e),...r})})});qj.displayName="CarouselContent";const Hj=a.forwardRef(({className:e,...r},n)=>{const{orientation:o}=Vj();return t.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:Br("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",e),...r})});Hj.displayName="CarouselItem";const $j=a.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollPrev:s,canScrollPrev:l}=Vj();return t.jsxs(Ir,{ref:a,variant:r,size:n,className:Br("absolute h-8 w-8 rounded-full","horizontal"===i?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(st,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Previous slide"})]})});$j.displayName="CarouselPrevious";const Wj=a.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollNext:s,canScrollNext:l}=Vj();return t.jsxs(Ir,{ref:a,variant:r,size:n,className:Br("absolute h-8 w-8 rounded-full","horizontal"===i?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(lt,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Next slide"})]})});Wj.displayName="CarouselNext";const Uj=({form:e,translations:r})=>{const n=[{label:r.timePresetAllDay,start:"00:00",end:"23:59"},{label:r.timePresetEarlyMorning,start:"06:00",end:"09:00"},{label:r.timePresetMorning,start:"09:00",end:"12:00"},{label:r.timePresetLunch,start:"12:00",end:"13:00"},{label:r.timePresetEarlyAfternoon,start:"13:00",end:"15:00"},{label:r.timePresetLateAfternoon,start:"15:00",end:"17:00"},{label:r.timePresetEvening,start:"17:00",end:"20:00"},{label:r.timePresetNight,start:"20:00",end:"23:00"}];return t.jsx("div",{className:"pt-2 pb-1",children:t.jsxs(Ij,{className:"w-full max-w-xs mx-auto sm:px-0",children:[t.jsx(qj,{className:"",children:n.map(r=>t.jsx(Hj,{className:"basis-1/3",children:t.jsx(qd.div,{whileHover:{scale:1},whileTap:{scale:.95},children:t.jsx(Ir,{type:"button",variant:"outline",size:"sm",onClick:()=>(t=>{e.setValue("startTime",t.start),e.setValue("endTime",t.end)})(r),className:Br("w-full text-xs h-5 mx-auto flex",e.watch("startTime")===r.start&&e.watch("endTime")===r.end?"bg-primary text-primary-foreground":""),children:t.jsx("span",{className:"text-[10px] sm:text-xs",children:r.label})})})},r.label))}),t.jsx($j,{className:"flex",type:"button"}),t.jsx(Wj,{className:"flex",type:"button"})]})})};var Yj="Switch",[Zj,Kj]=Wd(Yj),[Gj,Xj]=Zj(Yj),Qj=a.forwardRef((e,r)=>{const{__scopeSwitch:n,name:o,checked:i,defaultChecked:s,required:l,disabled:c,value:d="on",onCheckedChange:u,form:p,...h}=e,[f,m]=a.useState(null),v=Ft(r,e=>m(e)),y=a.useRef(!1),g=!f||(p||!!f.closest("form")),[x,b]=Kd({prop:i,defaultProp:s??!1,onChange:u,caller:Yj});return t.jsxs(Gj,{scope:n,checked:x,disabled:c,children:[t.jsx(Gd.button,{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":rO(x),"data-disabled":c?"":void 0,disabled:c,value:d,...h,ref:v,onClick:$d(e.onClick,e=>{b(e=>!e),g&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),g&&t.jsx(tO,{control:f,bubbles:!y.current,name:o,value:d,checked:x,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});Qj.displayName=Yj;var Jj="SwitchThumb",eO=a.forwardRef((e,r)=>{const{__scopeSwitch:n,...o}=e,a=Xj(Jj,n);return t.jsx(Gd.span,{"data-state":rO(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:r})});eO.displayName=Jj;var tO=a.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:o=!0,...i},s)=>{const l=a.useRef(null),c=Ft(l,s),d=cD(n),u=xh(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[d,n,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function rO(e){return e?"checked":"unchecked"}tO.displayName="SwitchBubbleInput";var nO=Qj,oO=eO;const aO=a.forwardRef(({className:e,...r},n)=>t.jsx(nO,{className:Br("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:t.jsx(oO,{className:Br("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));function iO(e,[t,r]){return Math.min(r,Math.max(t,e))}aO.displayName=nO.displayName;var sO=[" ","Enter","ArrowUp","ArrowDown"],lO=[" ","Enter"],cO="Select",[dO,uO,pO]=Qd(cO),[hO,fO]=Wd(cO,[pO,_h]),mO=_h(),[vO,yO]=hO(cO),[gO,xO]=hO(cO),bO=e=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:h,disabled:f,required:m,form:v}=e,y=mO(r),[g,x]=a.useState(null),[b,k]=a.useState(null),[_,w]=a.useState(!1),M=eu(u),[C,D]=Kd({prop:o,defaultProp:i??!1,onChange:s,caller:cO}),[j,O]=Kd({prop:l,defaultProp:c,onChange:d,caller:cO}),S=a.useRef(null),P=!g||(v||!!g.closest("form")),[E,T]=a.useState(new Set),N=Array.from(E).map(e=>e.props.value).join(";");return t.jsx(Lh,{...y,children:t.jsxs(vO,{required:m,scope:r,trigger:g,onTriggerChange:x,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:w,contentId:Du(),value:j,onValueChange:O,open:C,onOpenChange:D,dir:M,triggerPointerDownPosRef:S,disabled:f,children:[t.jsx(dO.Provider,{scope:r,children:t.jsx(gO,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{T(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),P?t.jsxs(lS,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:h,value:j,onChange:e=>O(e.target.value),disabled:f,form:v,children:[void 0===j?t.jsx("option",{value:""}):null,Array.from(E)]},N):null]})})};bO.displayName=cO;var kO="SelectTrigger",_O=a.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:o=!1,...i}=e,s=mO(n),l=yO(kO,n),c=l.disabled||o,d=Ft(r,l.onTriggerChange),u=uO(n),p=a.useRef("touch"),[h,f,m]=dS(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=uS(t,e,r);void 0!==n&&l.onValueChange(n.value)}),v=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Bh,{asChild:!0,...s,children:t.jsx(Gd.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":cS(l.value)?"":void 0,...i,ref:d,onClick:$d(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:$d(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:$d(i.onKeyDown,e=>{const t=""!==h.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&sO.includes(e.key)&&(v(),e.preventDefault())})})})});_O.displayName=kO;var wO="SelectValue",MO=a.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:s="",...l}=e,c=yO(wO,n),{onValueNodeHasChildrenChange:d}=c,u=void 0!==i,p=Ft(r,c.onValueNodeChange);return Yd(()=>{d(u)},[d,u]),t.jsx(Gd.span,{...l,ref:p,style:{pointerEvents:"none"},children:cS(c.value)?t.jsx(t.Fragment,{children:s}):i})});MO.displayName=wO;var CO=a.forwardRef((e,r)=>{const{__scopeSelect:n,children:o,...a}=e;return t.jsx(Gd.span,{"aria-hidden":!0,...a,ref:r,children:o||"▼"})});CO.displayName="SelectIcon";var DO=e=>t.jsx(qh,{asChild:!0,...e});DO.displayName="SelectPortal";var jO="SelectContent",OO=a.forwardRef((e,r)=>{const n=yO(jO,e.__scopeSelect),[o,s]=a.useState();if(Yd(()=>{s(new DocumentFragment)},[]),!n.open){const r=o;return r?i.createPortal(t.jsx(PO,{scope:e.__scopeSelect,children:t.jsx(dO.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),r):null}return t.jsx(NO,{...e,ref:r})});OO.displayName=jO;var SO=10,[PO,EO]=hO(jO),TO=Lt("SelectContent.RemoveScroll"),NO=a.forwardRef((e,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g,...x}=e,b=yO(jO,n),[k,_]=a.useState(null),[w,M]=a.useState(null),C=Ft(r,e=>_(e)),[D,j]=a.useState(null),[O,S]=a.useState(null),P=uO(n),[E,T]=a.useState(!1),N=a.useRef(!1);a.useEffect(()=>{if(k)return vf(k)},[k]),pu();const z=a.useCallback(e=>{const[t,...r]=P().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(const r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&w&&(w.scrollTop=0),r===n&&w&&(w.scrollTop=w.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[P,w]),A=a.useCallback(()=>z([D,k]),[z,D,k]);a.useEffect(()=>{E&&A()},[E,A]);const{onOpenChange:R,triggerPointerDownPosRef:F}=b;a.useEffect(()=>{if(k){let e={x:0,y:0};const t=t=>{var r,n;e={x:Math.abs(Math.round(t.pageX)-((null==(r=F.current)?void 0:r.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(n=F.current)?void 0:n.y)??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():k.contains(r.target)||R(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[k,R,F]),a.useEffect(()=>{const e=()=>R(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[R]);const[L,B]=dS(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=uS(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),V=a.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&(j(e),n&&(N.current=!0))},[b.value]),I=a.useCallback(()=>null==k?void 0:k.focus(),[k]),q=a.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&S(e)},[b.value]),H="popper"===o?AO:zO,$=H===AO?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g}:{};return t.jsx(PO,{scope:n,content:k,viewport:w,onViewportChange:M,itemRefCallback:V,selectedItem:D,onItemLeave:I,itemTextRefCallback:q,focusSelectedItem:A,selectedItemText:O,position:o,isPositioned:E,searchRef:L,children:t.jsx(am,{as:TO,allowPinchZoom:!0,children:t.jsx(yu,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:$d(i,e=>{var t;null==(t=b.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(su,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...x,...$,onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:$d(x.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});NO.displayName="SelectContentImpl";var zO=a.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:o,...i}=e,s=yO(jO,n),l=EO(jO,n),[c,d]=a.useState(null),[u,p]=a.useState(null),h=Ft(r,e=>p(e)),f=uO(n),m=a.useRef(!1),v=a.useRef(!0),{viewport:y,selectedItem:g,selectedItemText:x,focusSelectedItem:b}=l,k=a.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&y&&g&&x){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=s.valueNode.getBoundingClientRect(),n=x.getBoundingClientRect();if("rtl"!==s.dir){const o=n.left-t.left,a=r.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-SO,u=iO(a,[SO,Math.max(SO,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const o=t.right-n.right,a=window.innerWidth-r.right-o,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-SO,u=iO(a,[SO,Math.max(SO,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const a=f(),i=window.innerHeight-2*SO,l=y.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),b=p+h+l+parseInt(d.paddingBottom,10)+v,k=Math.min(5*g.offsetHeight,b),_=window.getComputedStyle(y),w=parseInt(_.paddingTop,10),M=parseInt(_.paddingBottom,10),C=e.top+e.height/2-SO,D=i-C,j=g.offsetHeight/2,O=p+h+(g.offsetTop+j),S=b-O;if(O<=C){const e=a.length>0&&g===a[a.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-y.offsetTop-y.offsetHeight,r=O+Math.max(D,j+(e?M:0)+t+v);c.style.height=r+"px"}else{const e=a.length>0&&g===a[0].ref.current;c.style.top="0px";const t=Math.max(C,p+y.offsetTop+(e?w:0)+j)+S;c.style.height=t+"px",y.scrollTop=O-C+y.offsetTop}c.style.margin=`${SO}px 0`,c.style.minHeight=k+"px",c.style.maxHeight=i+"px",null==o||o(),requestAnimationFrame(()=>m.current=!0)}},[f,s.trigger,s.valueNode,c,u,y,g,x,s.dir,o]);Yd(()=>k(),[k]);const[_,w]=a.useState();Yd(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]);const M=a.useCallback(e=>{e&&!0===v.current&&(k(),null==b||b(),v.current=!1)},[k,b]);return t.jsx(RO,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:M,children:t.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:t.jsx(Gd.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});zO.displayName="SelectItemAlignedPosition";var AO=a.forwardRef((e,r)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=SO,...i}=e,s=mO(n);return t.jsx(Vh,{...s,...i,ref:r,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});AO.displayName="SelectPopperPosition";var[RO,FO]=hO(jO,{}),LO="SelectViewport",BO=a.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:o,...i}=e,s=EO(LO,n),l=FO(LO,n),c=Ft(r,s.onViewportChange),d=a.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(dO.Slot,{scope:n,children:t.jsx(Gd.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:$d(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(null!=n&&n.current&&r){const e=Math.abs(d.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*SO,o=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(o,a);if(i<n){const o=i+e,a=Math.min(n,o),s=o-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});BO.displayName=LO;var VO="SelectGroup",[IO,qO]=hO(VO),HO=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=Du();return t.jsx(IO,{scope:n,id:a,children:t.jsx(Gd.div,{role:"group","aria-labelledby":a,...o,ref:r})})});HO.displayName=VO;var $O="SelectLabel",WO=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=qO($O,n);return t.jsx(Gd.div,{id:a.id,...o,ref:r})});WO.displayName=$O;var UO="SelectItem",[YO,ZO]=hO(UO),KO=a.forwardRef((e,r)=>{const{__scopeSelect:n,value:o,disabled:i=!1,textValue:s,...l}=e,c=yO(UO,n),d=EO(UO,n),u=c.value===o,[p,h]=a.useState(s??""),[f,m]=a.useState(!1),v=Ft(r,e=>{var t;return null==(t=d.itemRefCallback)?void 0:t.call(d,e,o,i)}),y=Du(),g=a.useRef("touch"),x=()=>{i||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(YO,{scope:n,value:o,disabled:i,textId:y,isSelected:u,onItemTextChange:a.useCallback(e=>{h(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:t.jsx(dO.ItemSlot,{scope:n,value:o,disabled:i,textValue:p,children:t.jsx(Gd.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:$d(l.onFocus,()=>m(!0)),onBlur:$d(l.onBlur,()=>m(!1)),onClick:$d(l.onClick,()=>{"mouse"!==g.current&&x()}),onPointerUp:$d(l.onPointerUp,()=>{"mouse"===g.current&&x()}),onPointerDown:$d(l.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:$d(l.onPointerMove,e=>{var t;g.current=e.pointerType,i?null==(t=d.onItemLeave)||t.call(d):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$d(l.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=d.onItemLeave)||t.call(d))}),onKeyDown:$d(l.onKeyDown,e=>{var t;""!==(null==(t=d.searchRef)?void 0:t.current)&&" "===e.key||(lO.includes(e.key)&&x()," "===e.key&&e.preventDefault())})})})})});KO.displayName=UO;var GO="SelectItemText",XO=a.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:s,...l}=e,c=yO(GO,n),d=EO(GO,n),u=ZO(GO,n),p=xO(GO,n),[h,f]=a.useState(null),m=Ft(r,e=>f(e),u.onItemTextChange,e=>{var t;return null==(t=d.itemTextRefCallback)?void 0:t.call(d,e,u.value,u.disabled)}),v=null==h?void 0:h.textContent,y=a.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=p;return Yd(()=>(g(y),()=>x(y)),[g,x,y]),t.jsxs(t.Fragment,{children:[t.jsx(Gd.span,{id:u.textId,...l,ref:m}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?i.createPortal(l.children,c.valueNode):null]})});XO.displayName=GO;var QO="SelectItemIndicator",JO=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return ZO(QO,n).isSelected?t.jsx(Gd.span,{"aria-hidden":!0,...o,ref:r}):null});JO.displayName=QO;var eS="SelectScrollUpButton",tS=a.forwardRef((e,r)=>{const n=EO(eS,e.__scopeSelect),o=FO(eS,e.__scopeSelect),[i,s]=a.useState(!1),l=Ft(r,o.onScrollButtonChange);return Yd(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?t.jsx(oS,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});tS.displayName=eS;var rS="SelectScrollDownButton",nS=a.forwardRef((e,r)=>{const n=EO(rS,e.__scopeSelect),o=FO(rS,e.__scopeSelect),[i,s]=a.useState(!1),l=Ft(r,o.onScrollButtonChange);return Yd(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;s(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?t.jsx(oS,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});nS.displayName=rS;var oS=a.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:o,...i}=e,s=EO("SelectScrollButton",n),l=a.useRef(null),c=uO(n),d=a.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),Yd(()=>{var e;const t=c().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[c]),t.jsx(Gd.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:$d(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:$d(i.onPointerMove,()=>{var e;null==(e=s.onItemLeave)||e.call(s),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:$d(i.onPointerLeave,()=>{d()})})}),aS=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return t.jsx(Gd.div,{"aria-hidden":!0,...o,ref:r})});aS.displayName="SelectSeparator";var iS="SelectArrow",sS=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=mO(n),i=yO(iS,n),s=EO(iS,n);return i.open&&"popper"===s.position?t.jsx(Ih,{...a,...o,ref:r}):null});sS.displayName=iS;var lS=a.forwardRef(({__scopeSelect:e,value:r,...n},o)=>{const i=a.useRef(null),s=Ft(o,i),l=cD(r);return a.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),t.jsx(Gd.select,{...n,style:{...gy,...n.style},ref:s,defaultValue:r})});function cS(e){return""===e||void 0===e}function dS(e){const t=tu(e),r=a.useRef(""),n=a.useRef(0),o=a.useCallback(e=>{const o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),i=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function uS(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}lS.displayName="SelectBubbleInput";var pS=_O,hS=CO,fS=DO,mS=OO,vS=BO,yS=WO,gS=KO,xS=XO,bS=JO,kS=tS,_S=nS,wS=aS;const MS=bO,CS=MO,DS=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(pS,{ref:o,className:Br("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,t.jsx(hS,{asChild:!0,children:t.jsx(vt,{className:"h-4 w-4 opacity-50"})})]}));DS.displayName=pS.displayName;const jS=a.forwardRef(({className:e,...r},n)=>t.jsx(kS,{ref:n,className:Br("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(xt,{className:"h-4 w-4"})}));jS.displayName=kS.displayName;const OS=a.forwardRef(({className:e,...r},n)=>t.jsx(_S,{ref:n,className:Br("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(vt,{className:"h-4 w-4"})}));OS.displayName=_S.displayName;const SS=a.forwardRef(({className:e,children:r,position:n="popper",...o},a)=>t.jsx(fS,{children:t.jsxs(mS,{ref:a,className:Br("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[t.jsx(jS,{}),t.jsx(vS,{className:Br("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(OS,{})]})}));SS.displayName=mS.displayName;const PS=a.forwardRef(({className:e,...r},n)=>t.jsx(yS,{ref:n,className:Br("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));PS.displayName=yS.displayName;const ES=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(gS,{ref:o,className:Br("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(bS,{children:t.jsx(mt,{className:"h-4 w-4"})})}),t.jsx(xS,{children:r})]}));ES.displayName=gS.displayName;const TS=a.forwardRef(({className:e,...r},n)=>t.jsx(wS,{ref:n,className:Br("-mx-1 my-1 h-px bg-muted",e),...r}));TS.displayName=wS.displayName;const NS=(e,t,r,n)=>{if(!n||!Ve(e,{start:t,end:r}))return!1;switch(n){case"daily":return!0;case"weekly":return ze(e)===ze(t);case"monthly":return e.getDate()===t.getDate();default:return!1}},zS=({field:e,form:n,translations:o})=>{const[a,i]=r.useState(0),[s,l]=r.useState(""),[c,d]=r.useState({}),u=n.getValues("startDate"),p=n.getValues("endDate"),h=n.getValues("isRepeatingInterval")||"daily",f=W({start:u,end:p}).filter(e=>{const t=h;return"daily"===t||("weekly"===t?e.getDay()===u.getDay():"monthly"===t&&e.getDate()===u.getDate())}),m=e.value||[],v=m.filter(e=>f.some(t=>L(e,t)));m.length!==v.length&&setTimeout(()=>{e.onChange(v)},0);const y=e=>e.length>=f.length;if("daily"===h)return t.jsx(MC,{mode:"multiple",selected:e.value||[],onSelect:t=>{t&&y(t)?v_.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):e.onChange(t||[])},fromDate:u,toDate:p,defaultMonth:u,className:"rounded-md border"});const g=f.reduce((e,t)=>{const r=Te(t,"yyyy-MM");return e[r]||(e[r]=[]),e[r].push(t),e},{}),x=Object.entries(g).sort(([e],[t])=>e.localeCompare(t));if(0===Object.keys(c).length&&x.length>0){const e={};x.forEach(([t],r)=>{e[t]=0===r}),d(e)}const b=""===s.trim()?x:x.filter(e=>{const t=e[1][0];return`${o.monthNames[t.getMonth()]} ${Te(t,"yyyy")}`.toLowerCase().includes(s.toLowerCase())}),k=Math.ceil(b.length/2),_=b.slice(2*a,2*(a+1));return t.jsxs("div",{className:"rounded-md p-1 w-[300px] overflow-y-auto",children:[t.jsx("div",{className:"text-center font-medium mb-2 text-sm",children:"weekly"===h?o.weeklyIntervalLabel.replace("{dayName}",o.fullDayNames[u.getDay()]).replace("{startDate}",`${Te(u,"dd")} ${o.monthNames[u.getMonth()].slice(0,3)}`).replace("{endDate}",`${Te(p,"dd")} ${o.monthNames[p.getMonth()].slice(0,3)} ${Te(p,"yyyy")}`):o.monthlyIntervalLabel.replace("{dayOfMonth}",Te(u,"do")).replace("{startDate}",o.monthNames[u.getMonth()].slice(0,3)).replace("{endDate}",`${o.monthNames[p.getMonth()].slice(0,3)} ${Te(p,"yyyy")}`)}),t.jsxs("div",{className:"flex gap-2 mb-2",children:[t.jsx("div",{className:"flex-grow",children:t.jsx(r_,{type:"text",placeholder:o.searchMonthPlaceholder,value:s,onChange:e=>{l(e.target.value),i(0)},className:"h-7 text-xs"})}),b.length>0&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.max(e-1,0))},disabled:0===a,children:"←"}),t.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[a+1,"/",Math.max(1,k)]}),t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.min(e+1,k-1))},disabled:a>=k-1,children:"→"})]})]}),0===f.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noMatchingDates}):0===b.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noSearchResults.replace("{query}",s)}):t.jsx("div",{children:_.map(([r,n])=>{const a=n[0],i=`${o.monthNames[a.getMonth()]} ${Te(a,"yyyy")}`,s=c[r],l=n.filter(e=>v.some(t=>L(t,e))).length;return t.jsxs("div",{className:"mb-2 border rounded-md overflow-hidden",children:[t.jsxs("div",{className:"py-1 px-2 bg-muted flex justify-between items-center cursor-pointer text-xs",onClick:()=>(e=>{d(t=>({...t,[e]:!t[e]}))})(r),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"mr-1 flex items-center justify-center w-4",children:s?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m6 9 6 6 6-6"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m9 18 6-6-6-6"})})}),t.jsx("span",{className:"font-medium",children:i}),t.jsx("span",{className:"ml-1 text-muted-foreground",children:o.ofExcluded.replace("{count}",l.toString()).replace("{total}",n.length.toString())})]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:t=>{t.stopPropagation(),(t=>{const r=v,n=t.filter(e=>!r.some(t=>L(t,e))),a=[...r,...n];y(a)?v_.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):e.onChange(a)})(n)},children:o.selectAll}),t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:t=>{t.stopPropagation(),(t=>{const r=v.filter(e=>!t.some(t=>L(t,e)));e.onChange(r)})(n)},disabled:0===l,children:o.clearAll})]})]}),s&&t.jsx("div",{className:"p-1 flex flex-wrap gap-1 bg-background",children:n.map(r=>{const n=v.some(e=>L(e,r));return t.jsx(Ir,{type:"button",variant:n?"default":"outline",className:"h-6 px-1 text-[10px]",onClick:()=>{const t=v;if(n)e.onChange(t.filter(e=>!L(e,r)));else{const n=[...t,r];if(y(n))return void v_.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range");e.onChange(n)}},children:Te(r,o.dateButtonFormat)},r.toISOString())})})]},r)})})]})},AS=({form:e,translations:n,showRepeatToggle:o})=>{const[a,i]=r.useState(!1);r.useState(()=>{const t=e.getValues("isRepeatingExcludedDates");t&&t.length>0&&i(!0)});return o?t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsxs(UD,{className:"flex flex-col rounded-lg border p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(YD,{className:"text-base flex items-center cursor-pointer",children:[t.jsx(ht,{className:"mr-2 h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"leading-tight",children:n.repeatingEventQuestion})]}),t.jsx(tn,{mode:"wait",children:e.watch("isRepeating")&&t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},children:t.jsx(KD,{className:"text-xs leading-normal max-w-[90%]",children:((e,t,r,o,a,i)=>{const s=e=>Te(e,"MMM d"),l=n.fullDayNames[e.getDay()],c="enUS"===n.language?Te(e,"do"):e.getDate().toString(),d=s(e),u=Be(e,t)?s(t):Te(t,"MMM d, yyyy"),p=`${r} - ${o}`;let h="";switch(a||"daily"){case"daily":h=n.repeatDailyDescription.replace("{timeRange}",p).replace("{startDate}",d).replace("{endDate}",u);break;case"weekly":h=n.repeatWeeklyDescription.replace("{dayName}",l).replace("{timeRange}",p).replace("{startDate}",d).replace("{endDate}",u);break;case"monthly":h=n.repeatMonthlyDescription.replace("{dayOfMonth}",c).replace("{timeRange}",p).replace("{startDate}",d).replace("{endDate}",u)}if(i&&i.length>0){const e=i.length;h+=` (${n.withExcludedDates.replace("{count}",e.toString()).replace("{s}",e>1?"s":"")})`}return h})(e.watch("startDate"),e.watch("endDate"),e.watch("startTime"),e.watch("endTime"),e.watch("isRepeatingInterval"),e.watch("isRepeatingExcludedDates"))})})})]}),t.jsx(HD,{control:e.control,name:"isRepeating",render:({field:r})=>t.jsx(ZD,{children:t.jsx(aO,{checked:r.value,onCheckedChange:t=>{r.onChange(t),t||(i(!1),e.setValue("isRepeatingExcludedDates",[]))},className:"flex-shrink-0"})})})]}),t.jsx(tn,{children:e.watch("isRepeating")&&t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},children:t.jsxs("div",{className:"space-y-4",children:[t.jsx(HD,{control:e.control,name:"isRepeatingInterval",render:({field:r})=>t.jsxs(MS,{onValueChange:t=>{t!==r.value&&(e.setValue("isRepeatingExcludedDates",[]),i(!1)),r.onChange(t)},value:r.value||"daily",children:[t.jsx(ZD,{children:t.jsx(DS,{className:"w-full",children:t.jsx(CS,{})})}),t.jsxs(SS,{children:[t.jsx(ES,{value:"daily",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(dt,{className:"mr-2 h-4 w-4"}),n.repeatDaily]})}),t.jsx(ES,{value:"weekly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(ht,{className:"mr-2 h-4 w-4"}),n.repeatWeekly]})}),t.jsx(ES,{value:"monthly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),n.repeatMonthly]})})]})]})}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(YD,{className:"flex items-center text-sm cursor-pointer",children:[t.jsx(bt,{className:"mr-2 h-3 w-3"}),n.excludedDates]}),t.jsx(KD,{className:"text-xs",children:n.excludedDatesDescription})]}),t.jsx(aO,{checked:a,onCheckedChange:t=>{i(t),t||e.setValue("isRepeatingExcludedDates",[])},className:"flex-shrink-0"})]}),t.jsx(tn,{children:a&&t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.05,ease:"easeInOut"},className:"mt-4",children:t.jsx(HD,{control:e.control,name:"isRepeatingExcludedDates",render:({field:r})=>t.jsx(UD,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(Kk,{children:[t.jsx(Gk,{asChild:!0,children:t.jsxs(Ir,{variant:"outline",className:"w-full justify-start text-left font-normal text-sm h-9",type:"button",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),n.selectDatesToExclude]})}),t.jsx(Xk,{className:"w-auto p-0 max-w-[320px]",align:"start",children:t.jsx(zS,{field:r,form:e,translations:n})})]}),t.jsx(tn,{children:"daily"===e.watch("isRepeatingInterval")&&t.jsxs(qd.div,{initial:{opacity:0,height:0,overflow:"hidden"},animate:{opacity:1,height:"auto",overflow:"visible"},exit:{opacity:0,height:0,overflow:"hidden"},transition:{duration:.015,ease:"easeInOut"},className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(KD,{className:"text-xs mb-0",children:n.skipDays}),t.jsx(Ir,{type:"button",variant:"destructive",size:"sm",className:"text-xs h-5 mr-3",disabled:!((e.watch("isRepeatingExcludedDates")||[]).length>0),onClick:()=>{e.setValue("isRepeatingExcludedDates",[])},children:n.clearAll})]}),t.jsx("div",{children:t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:n.dayNames.map((r,o)=>{const a=o,i=e.watch("isRepeatingExcludedDates")||[],s=W({start:e.getValues("startDate"),end:e.getValues("endDate")}).filter(e=>e.getDay()===a),l=s.length>0,c=l&&s.every(e=>i.some(t=>L(t,e)));return t.jsx(Ir,{type:"button",variant:c?"default":"outline",size:"sm",className:Br("w-8 h-8 p-0 text-center flex items-center justify-center",0===a||6===a?"font-medium":"",l?"":"opacity-50 cursor-not-allowed"),disabled:!l,onClick:()=>{if(!l)return;const t=e.getValues("startDate"),r=e.getValues("endDate"),o=W({start:t,end:r}),i=o.filter(e=>e.getDay()===a);let s=[...e.getValues("isRepeatingExcludedDates")||[]];if(c)s=s.filter(e=>!i.some(t=>L(t,e)));else{i.forEach(e=>{s.some(t=>L(t,e))||s.push(e)});const e="daily",a=o.filter(n=>NS(n,t,r,e));if(s.length>=a.length)return void v_.error(n.errorCannotExcludeAllDates)}e.setValue("isRepeatingExcludedDates",s)},children:r.charAt(0)},o)})})})]})}),r.value&&r.value.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:r.value.map((e,n)=>t.jsxs(qd.div,{className:"bg-secondary text-secondary-foreground rounded-md px-2 py-1 text-xs flex items-center",initial:{opacity:0,scale:.6,y:15,rotateX:-10},animate:{opacity:1,scale:1,y:0,rotateX:0},whileHover:{scale:1.05},transition:{type:"spring",stiffness:500,damping:30,delay:0},children:[Te(e,"MMM d, yyyy"),t.jsxs(Ir,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:()=>{const e=[...r.value||[]];e.splice(n,1),r.onChange(e)},children:[t.jsx("span",{className:"sr-only",children:"Remove"}),"×"]})]},e.toISOString()))}),t.jsx(GD,{})]})})})})})]})})})]})}):null},RS=({open:e,editType:r,onEditTypeChange:n,onConfirm:o,onClose:a,translations:i})=>t.jsx(QC,{open:e,children:t.jsxs(rD,{className:"max-w-[425px]",children:[t.jsxs(nD,{children:[t.jsxs(aD,{className:"flex items-center",children:[t.jsx(pt,{className:"mr-2 h-5 w-5 text-primary"}),i.editRecurringEventTitle]}),t.jsx(iD,{className:"text-left",children:i.editRecurringEventDescription}),t.jsx("div",{className:"h-2"}),t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(AD,{defaultValue:"all",value:r,onValueChange:e=>n(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:i.editThisOccurrence,description:i.editThisOccurrenceDescription},{value:"future",label:i.editThisAndFuture,description:i.editThisAndFutureDescription},{value:"all",label:i.editAllOccurrences,description:i.editAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(RD,{value:e.value,id:`edit-${e.value}`}),t.jsxs(VD,{htmlFor:`edit-${e.value}`,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(oD,{children:[t.jsx(lD,{onClick:a,children:i.cancel}),t.jsxs(sD,{onClick:o,className:"w-full sm:w-auto",children:[t.jsx(pt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),i.save]})]})]})});var FS,LS;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(FS||(FS={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(LS||(LS={}));const BS=FS.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),VS=e=>{switch(typeof e){case"undefined":return BS.undefined;case"string":return BS.string;case"number":return Number.isNaN(e)?BS.nan:BS.number;case"boolean":return BS.boolean;case"function":return BS.function;case"bigint":return BS.bigint;case"symbol":return BS.symbol;case"object":return Array.isArray(e)?BS.array:null===e?BS.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?BS.promise:typeof Map<"u"&&e instanceof Map?BS.map:typeof Set<"u"&&e instanceof Set?BS.set:typeof Date<"u"&&e instanceof Date?BS.date:BS.object;default:return BS.unknown}},IS=FS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class qS extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof qS))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,FS.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}qS.create=e=>new qS(e);const HS=(e,t)=>{let r;switch(e.code){case IS.invalid_type:r=e.received===BS.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case IS.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,FS.jsonStringifyReplacer)}`;break;case IS.unrecognized_keys:r=`Unrecognized key(s) in object: ${FS.joinValues(e.keys,", ")}`;break;case IS.invalid_union:r="Invalid input";break;case IS.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${FS.joinValues(e.options)}`;break;case IS.invalid_enum_value:r=`Invalid enum value. Expected ${FS.joinValues(e.options)}, received '${e.received}'`;break;case IS.invalid_arguments:r="Invalid function arguments";break;case IS.invalid_return_type:r="Invalid function return type";break;case IS.invalid_date:r="Invalid date";break;case IS.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:FS.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case IS.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case IS.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case IS.custom:r="Invalid input";break;case IS.invalid_intersection_types:r="Intersection results could not be merged";break;case IS.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case IS.not_finite:r="Number must be finite";break;default:r=t.defaultError,FS.assertNever(e)}return{message:r}};let $S=HS;function WS(e,t){const r=$S,n=(e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],i={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...o,path:a,message:s}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===HS?void 0:HS].filter(e=>!!e)});e.common.issues.push(n)}class US{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return YS;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return US.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status||"aborted"===o.status)return YS;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==t.value&&(typeof o.value<"u"||n.alwaysSet)&&(r[t.value]=o.value)}return{status:e.value,value:r}}}const YS=Object.freeze({status:"aborted"}),ZS=e=>({status:"dirty",value:e}),KS=e=>({status:"valid",value:e}),GS=e=>"aborted"===e.status,XS=e=>"dirty"===e.status,QS=e=>"valid"===e.status,JS=e=>typeof Promise<"u"&&e instanceof Promise;var eP;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(eP||(eP={}));class tP{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const rP=(e,t)=>{if(QS(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new qS(e.common.issues);return this._error=t,this._error}}};function nP(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(t,o)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??o.defaultError}:typeof o.data>"u"?{message:a??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:a??r??o.defaultError}},description:o}}class oP{get description(){return this._def.description}_getType(e){return VS(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:VS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new US,ctx:{common:e.parent.common,data:e.data,parsedType:VS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(JS(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(null==t?void 0:t.async)??!1,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:VS(e)},n=this._parseSync({data:e,path:r.path,parent:r});return rP(r,n)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:VS(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return QS(t)?{value:t.value}:{issues:n.common.issues}}catch(e){null!=(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>QS(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:VS(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(JS(n)?n:Promise.resolve(n));return rP(r,o)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const o=e(t),a=()=>n.addIssue({code:IS.custom,...r(t)});return typeof Promise<"u"&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new rE({schema:this,typeName:uE.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return nE.create(this,this._def)}nullable(){return oE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return IP.create(this)}promise(){return tE.create(this,this._def)}or(e){return $P.create([this,e],this._def)}and(e){return UP.create(this,e,this._def)}transform(e){return new rE({...nP(this._def),schema:this,typeName:uE.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new aE({...nP(this._def),innerType:this,defaultValue:t,typeName:uE.ZodDefault})}brand(){return new lE({typeName:uE.ZodBranded,type:this,...nP(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new iE({...nP(this._def),innerType:this,catchValue:t,typeName:uE.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return cE.create(this,e)}readonly(){return dE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const aP=/^c[^\s-]{8,}$/i,iP=/^[0-9a-z]+$/,sP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lP=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cP=/^[a-z0-9_-]{21}$/i,dP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let hP;const fP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",kP=new RegExp(`^${bP}$`);function _P(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function wP(e){return new RegExp(`^${_P(e)}$`)}function MP(e){let t=`${bP}T${_P(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function CP(e,t){return!(("v4"!==t&&t||!fP.test(e))&&("v6"!==t&&t||!vP.test(e)))}function DP(e,t){if(!dP.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!("object"!=typeof o||null===o||"typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&o.alg!==t)}catch{return!1}}function jP(e,t){return!(("v4"!==t&&t||!mP.test(e))&&("v6"!==t&&t||!yP.test(e)))}class OP extends oP{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==BS.string){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.string,received:t.parsedType}),YS}const t=new US;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?WS(r,{code:IS.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&WS(r,{code:IS.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)pP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"email",code:IS.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)hP||(hP=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),hP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"emoji",code:IS.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)lP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"uuid",code:IS.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)cP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"nanoid",code:IS.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)aP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"cuid",code:IS.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)iP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"cuid2",code:IS.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)sP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"ulid",code:IS.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),WS(r,{validation:"url",code:IS.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"regex",code:IS.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?MP(n).test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?kP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?wP(n).test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?uP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"duration",code:IS.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?CP(e.data,n.version)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"ip",code:IS.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?DP(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"jwt",code:IS.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?jP(e.data,n.version)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"cidr",code:IS.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?gP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"base64",code:IS.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?xP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"base64url",code:IS.invalid_string,message:n.message}),t.dirty()):FS.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:IS.invalid_string,...eP.errToObj(r)})}_addCheck(e){return new OP({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...eP.errToObj(e)})}url(e){return this._addCheck({kind:"url",...eP.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...eP.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...eP.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...eP.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...eP.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...eP.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...eP.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...eP.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...eP.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...eP.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...eP.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...eP.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:(null==e?void 0:e.offset)??!1,local:(null==e?void 0:e.local)??!1,...eP.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...eP.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...eP.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...eP.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...eP.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...eP.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...eP.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...eP.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...eP.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...eP.errToObj(t)})}nonempty(e){return this.min(1,eP.errToObj(e))}trim(){return new OP({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new OP({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new OP({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function SP(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}OP.create=e=>new OP({checks:[],typeName:uE.ZodString,coerce:(null==e?void 0:e.coerce)??!1,...nP(e)});class PP extends oP{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==BS.number){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.number,received:t.parsedType}),YS}let t;const r=new US;for(const n of this._def.checks)"int"===n.kind?FS.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==SP(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.not_finite,message:n.message}),r.dirty()):FS.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,eP.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eP.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eP.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eP.toString(t))}setLimit(e,t,r,n){return new PP({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eP.toString(n)}]})}_addCheck(e){return new PP({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:eP.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:eP.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:eP.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:eP.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:eP.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eP.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:eP.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:eP.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:eP.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&FS.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}PP.create=e=>new PP({checks:[],typeName:uE.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...nP(e)});class EP extends oP{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==BS.bigint)return this._getInvalidInput(e);let t;const r=new US;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):FS.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.bigint,received:t.parsedType}),YS}gte(e,t){return this.setLimit("min",e,!0,eP.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eP.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eP.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eP.toString(t))}setLimit(e,t,r,n){return new EP({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eP.toString(n)}]})}_addCheck(e){return new EP({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:eP.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:eP.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:eP.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:eP.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eP.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}EP.create=e=>new EP({checks:[],typeName:uE.ZodBigInt,coerce:(null==e?void 0:e.coerce)??!1,...nP(e)});class TP extends oP{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==BS.boolean){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.boolean,received:t.parsedType}),YS}return KS(e.data)}}TP.create=e=>new TP({typeName:uE.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...nP(e)});class NP extends oP{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==BS.date){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.date,received:t.parsedType}),YS}if(Number.isNaN(e.data.getTime())){return WS(this._getOrReturnCtx(e),{code:IS.invalid_date}),YS}const t=new US;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):FS.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new NP({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:eP.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:eP.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}NP.create=e=>new NP({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:uE.ZodDate,...nP(e)});class zP extends oP{_parse(e){if(this._getType(e)!==BS.symbol){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.symbol,received:t.parsedType}),YS}return KS(e.data)}}zP.create=e=>new zP({typeName:uE.ZodSymbol,...nP(e)});class AP extends oP{_parse(e){if(this._getType(e)!==BS.undefined){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.undefined,received:t.parsedType}),YS}return KS(e.data)}}AP.create=e=>new AP({typeName:uE.ZodUndefined,...nP(e)});class RP extends oP{_parse(e){if(this._getType(e)!==BS.null){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.null,received:t.parsedType}),YS}return KS(e.data)}}RP.create=e=>new RP({typeName:uE.ZodNull,...nP(e)});class FP extends oP{constructor(){super(...arguments),this._any=!0}_parse(e){return KS(e.data)}}FP.create=e=>new FP({typeName:uE.ZodAny,...nP(e)});class LP extends oP{constructor(){super(...arguments),this._unknown=!0}_parse(e){return KS(e.data)}}LP.create=e=>new LP({typeName:uE.ZodUnknown,...nP(e)});class BP extends oP{_parse(e){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.never,received:t.parsedType}),YS}}BP.create=e=>new BP({typeName:uE.ZodNever,...nP(e)});class VP extends oP{_parse(e){if(this._getType(e)!==BS.undefined){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.void,received:t.parsedType}),YS}return KS(e.data)}}VP.create=e=>new VP({typeName:uE.ZodVoid,...nP(e)});class IP extends oP{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==BS.array)return WS(t,{code:IS.invalid_type,expected:BS.array,received:t.parsedType}),YS;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(WS(t,{code:e?IS.too_big:IS.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(WS(t,{code:IS.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(WS(t,{code:IS.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new tP(t,e,t.path,r)))).then(e=>US.mergeArray(r,e));const o=[...t.data].map((e,r)=>n.type._parseSync(new tP(t,e,t.path,r)));return US.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new IP({...this._def,minLength:{value:e,message:eP.toString(t)}})}max(e,t){return new IP({...this._def,maxLength:{value:e,message:eP.toString(t)}})}length(e,t){return new IP({...this._def,exactLength:{value:e,message:eP.toString(t)}})}nonempty(e){return this.min(1,e)}}function qP(e){if(e instanceof HP){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=nE.create(qP(n))}return new HP({...e._def,shape:()=>t})}return e instanceof IP?new IP({...e._def,type:qP(e.element)}):e instanceof nE?nE.create(qP(e.unwrap())):e instanceof oE?oE.create(qP(e.unwrap())):e instanceof YP?YP.create(e.items.map(e=>qP(e))):e}IP.create=(e,t)=>new IP({type:e,minLength:null,maxLength:null,exactLength:null,typeName:uE.ZodArray,...nP(t)});class HP extends oP{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=FS.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==BS.object){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.object,received:t.parsedType}),YS}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof BP&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const i=[];for(const e of o){const t=n[e],o=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new tP(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof BP){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(WS(r,{code:IS.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new tP(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>US.mergeObjectSync(t,e)):US.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return eP.errToObj,new HP({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o;const a=(null==(o=(n=this._def).errorMap)?void 0:o.call(n,t,r).message)??r.defaultError;return"unrecognized_keys"===t.code?{message:eP.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new HP({...this._def,unknownKeys:"strip"})}passthrough(){return new HP({...this._def,unknownKeys:"passthrough"})}extend(e){return new HP({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new HP({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:uE.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new HP({...this._def,catchall:e})}pick(e){const t={};for(const r of FS.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new HP({...this._def,shape:()=>t})}omit(e){const t={};for(const r of FS.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new HP({...this._def,shape:()=>t})}deepPartial(){return qP(this)}partial(e){const t={};for(const r of FS.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new HP({...this._def,shape:()=>t})}required(e){const t={};for(const r of FS.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof nE;)e=e._def.innerType;t[r]=e}return new HP({...this._def,shape:()=>t})}keyof(){return QP(FS.objectKeys(this.shape))}}HP.create=(e,t)=>new HP({shape:()=>e,unknownKeys:"strip",catchall:BP.create(),typeName:uE.ZodObject,...nP(t)}),HP.strictCreate=(e,t)=>new HP({shape:()=>e,unknownKeys:"strict",catchall:BP.create(),typeName:uE.ZodObject,...nP(t)}),HP.lazycreate=(e,t)=>new HP({shape:e,unknownKeys:"strip",catchall:BP.create(),typeName:uE.ZodObject,...nP(t)});class $P extends oP{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new qS(e.ctx.common.issues));return WS(t,{code:IS.invalid_union,unionErrors:r}),YS});{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"===a.status&&!e&&(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map(e=>new qS(e));return WS(t,{code:IS.invalid_union,unionErrors:o}),YS}}get options(){return this._def.options}}function WP(e,t){const r=VS(e),n=VS(t);if(e===t)return{valid:!0,data:e};if(r===BS.object&&n===BS.object){const r=FS.objectKeys(t),n=FS.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(const r of n){const n=WP(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===BS.array&&n===BS.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=WP(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===BS.date&&n===BS.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}$P.create=(e,t)=>new $P({options:e,typeName:uE.ZodUnion,...nP(t)});class UP extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(GS(e)||GS(n))return YS;const o=WP(e.value,n.value);return o.valid?((XS(e)||XS(n))&&t.dirty(),{status:t.value,value:o.data}):(WS(r,{code:IS.invalid_intersection_types}),YS)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}UP.create=(e,t,r)=>new UP({left:e,right:t,typeName:uE.ZodIntersection,...nP(r)});class YP extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==BS.array)return WS(r,{code:IS.invalid_type,expected:BS.array,received:r.parsedType}),YS;if(r.data.length<this._def.items.length)return WS(r,{code:IS.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),YS;!this._def.rest&&r.data.length>this._def.items.length&&(WS(r,{code:IS.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new tP(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>US.mergeArray(t,e)):US.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new YP({...this._def,rest:e})}}YP.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new YP({items:e,typeName:uE.ZodTuple,rest:null,...nP(t)})};class ZP extends oP{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==BS.map)return WS(r,{code:IS.invalid_type,expected:BS.map,received:r.parsedType}),YS;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new tP(r,e,r.path,[a,"key"])),value:o._parse(new tP(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return YS;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return YS;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}ZP.create=(e,t,r)=>new ZP({valueType:t,keyType:e,typeName:uE.ZodMap,...nP(r)});class KP extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==BS.set)return WS(r,{code:IS.invalid_type,expected:BS.set,received:r.parsedType}),YS;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(WS(r,{code:IS.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(WS(r,{code:IS.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return YS;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>o._parse(new tP(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new KP({...this._def,minSize:{value:e,message:eP.toString(t)}})}max(e,t){return new KP({...this._def,maxSize:{value:e,message:eP.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}KP.create=(e,t)=>new KP({valueType:e,minSize:null,maxSize:null,typeName:uE.ZodSet,...nP(t)});class GP extends oP{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}GP.create=(e,t)=>new GP({getter:e,typeName:uE.ZodLazy,...nP(t)});class XP extends oP{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return WS(t,{received:t.data,code:IS.invalid_literal,expected:this._def.value}),YS}return{status:"valid",value:e.data}}get value(){return this._def.value}}function QP(e,t){return new JP({values:e,typeName:uE.ZodEnum,...nP(t)})}XP.create=(e,t)=>new XP({value:e,typeName:uE.ZodLiteral,...nP(t)});class JP extends oP{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return WS(t,{expected:FS.joinValues(r),received:t.parsedType,code:IS.invalid_type}),YS}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return WS(t,{received:t.data,code:IS.invalid_enum_value,options:r}),YS}return KS(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return JP.create(e,{...this._def,...t})}exclude(e,t=this._def){return JP.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}JP.create=QP;class eE extends oP{_parse(e){const t=FS.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==BS.string&&r.parsedType!==BS.number){const e=FS.objectValues(t);return WS(r,{expected:FS.joinValues(e),received:r.parsedType,code:IS.invalid_type}),YS}if(this._cache||(this._cache=new Set(FS.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=FS.objectValues(t);return WS(r,{received:r.data,code:IS.invalid_enum_value,options:e}),YS}return KS(e.data)}get enum(){return this._def.values}}eE.create=(e,t)=>new eE({values:e,typeName:uE.ZodNativeEnum,...nP(t)});class tE extends oP{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==BS.promise&&!1===t.common.async)return WS(t,{code:IS.invalid_type,expected:BS.promise,received:t.parsedType}),YS;const r=t.parsedType===BS.promise?t.data:Promise.resolve(t.data);return KS(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}tE.create=(e,t)=>new tE({type:e,typeName:uE.ZodPromise,...nP(t)});class rE extends oP{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===uE.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{WS(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return YS;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?YS:"dirty"===n.status||"dirty"===t.value?ZS(n.value):n});{if("aborted"===t.value)return YS;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?YS:"dirty"===n.status||"dirty"===t.value?ZS(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?YS:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?YS:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!QS(e))return YS;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>QS(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):YS)}FS.assertNever(n)}}rE.create=(e,t,r)=>new rE({schema:e,typeName:uE.ZodEffects,effect:t,...nP(r)}),rE.createWithPreprocess=(e,t,r)=>new rE({schema:t,effect:{type:"preprocess",transform:e},typeName:uE.ZodEffects,...nP(r)});class nE extends oP{_parse(e){return this._getType(e)===BS.undefined?KS(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nE.create=(e,t)=>new nE({innerType:e,typeName:uE.ZodOptional,...nP(t)});class oE extends oP{_parse(e){return this._getType(e)===BS.null?KS(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}oE.create=(e,t)=>new oE({innerType:e,typeName:uE.ZodNullable,...nP(t)});class aE extends oP{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===BS.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}aE.create=(e,t)=>new aE({innerType:e,typeName:uE.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...nP(t)});class iE extends oP{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return JS(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new qS(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new qS(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}iE.create=(e,t)=>new iE({innerType:e,typeName:uE.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...nP(t)});class sE extends oP{_parse(e){if(this._getType(e)!==BS.nan){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.nan,received:t.parsedType}),YS}return{status:"valid",value:e.data}}}sE.create=e=>new sE({typeName:uE.ZodNaN,...nP(e)});class lE extends oP{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class cE extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?YS:"dirty"===e.status?(t.dirty(),ZS(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?YS:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new cE({in:e,out:t,typeName:uE.ZodPipeline})}}class dE extends oP{_parse(e){const t=this._def.innerType._parse(e),r=e=>(QS(e)&&(e.value=Object.freeze(e.value)),e);return JS(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var uE;dE.create=(e,t)=>new dE({innerType:e,typeName:uE.ZodReadonly,...nP(t)}),function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(uE||(uE={}));const pE=OP.create,hE=TP.create,fE=NP.create;BP.create;const mE=IP.create,vE=HP.create;$P.create,UP.create,YP.create;const yE=JP.create;tE.create,nE.create,oE.create;const gE=yE(["daily","weekly","monthly"]),xE=e=>vE({id:pE().optional(),title:pE().min(1,e.validations.eventNameRequired),description:pE().optional(),startDate:fE(),endDate:fE(),startTime:pE().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),endTime:pE().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),color:pE().min(1,e.validations.colorRequired),isRepeating:hE(),isRepeatingInterval:gE.default("daily").optional(),isRepeatingExcludedDates:mE(fE()).optional()}).refine(e=>{const t=new Date(`${e.startDate.toDateString()} ${e.startTime}`),r=new Date(`${e.endDate.toDateString()} ${e.endTime}`);if(e.isRepeating){const t=new Date(`2000-01-01 ${e.startTime}`);return new Date(`2000-01-01 ${e.endTime}`)>=t}return r>t},{message:e.validations.endTimeBeforeStart,path:["endTime"]}),bE=({event:e,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,open:l,dateFromViewClick:c,translations:d})=>{const[u,p]=r.useState(!1),[h,f]=r.useState(!1),[m,v]=r.useState(!1),[y,g]=r.useState(!1),[x,b]=r.useState(!1),[k,_]=r.useState("single"),[w,M]=r.useState("all"),[C,D]=r.useState(!1),j=function(e={}){const t=r.useRef(void 0),n=r.useRef(void 0),[o,a]=r.useState({isDirty:!1,isValidating:!1,isLoading:vw(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:vw(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!vw(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...n}=Yw(e);t.current={...n,formState:o}}const i=t.current.control;return i._options=e,ow(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),r.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),r.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),r.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),r.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),r.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==o.isDirty&&i._subjects.state.next({isDirty:e})}},[i,o.isDirty]),r.useEffect(()=>{e.values&&!hw(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,a(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),r.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=nw(o,i),t.current}({resolver:Jw(xE(d)),defaultValues:{id:(null==e?void 0:e.id)||"",title:(null==e?void 0:e.title)||"",description:(null==e?void 0:e.description)||"",startDate:(null==e?void 0:e.startDate)||new Date,endDate:(null==e?void 0:e.endDate)||new Date,startTime:(null==e?void 0:e.startTime)||"09:00",endTime:(null==e?void 0:e.endTime)||"10:00",color:(null==e?void 0:e.color)||"blue",isRepeating:(null==e?void 0:e.isRepeating)||!1,isRepeatingInterval:(null==e?void 0:e.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==e?void 0:e.isRepeatingExcludedDates)||[]}});if(r.useEffect(()=>{const e=j.getValues("startDate"),t=j.getValues("endDate"),r=e.toDateString()===t.toDateString();f(!r)},[j,l]),r.useEffect(()=>{j.reset({title:(null==e?void 0:e.title)||"",description:(null==e?void 0:e.description)||"",startDate:(null==e?void 0:e.startDate)||new Date,endDate:(null==e?void 0:e.endDate)||new Date,startTime:(null==e?void 0:e.startTime)||"09:00",endTime:(null==e?void 0:e.endTime)||"10:00",color:(null==e?void 0:e.color)||"blue",isRepeating:(null==e?void 0:e.isRepeating)||!1,isRepeatingInterval:(null==e?void 0:e.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==e?void 0:e.isRepeatingExcludedDates)||[]})},[j,l,e]),r.useEffect(()=>{const e=j.watch((e,{name:t})=>{if("startDate"===t||"endDate"===t){const t=e.startDate,r=e.endDate;t>r&&j.setValue("endDate",t);const n=t.toDateString()===r.toDateString();f(!n),n&&j.setValue("isRepeating",!1)}});return()=>e.unsubscribe()},[j]),!d)return console.error("Translations are required for PopupContent"),null;const O=async t=>{var r;p(!0);try{if(null==e||!e.id){const e={startDate:t.startDate,endDate:t.endDate,title:t.title,startTime:t.startTime,endTime:t.endTime,description:t.description,color:t.color,isRepeating:t.isRepeating,isRepeatingInterval:t.isRepeatingInterval||"daily",isRepeatingExcludedDates:t.isRepeatingExcludedDates||[]};return void await Promise.resolve(n(e))}if(!0!==e.isRepeating){console.log("Updating non-repeating event");const r={...e,startDate:t.startDate,endDate:t.endDate,title:t.title,startTime:t.startTime,endTime:t.endTime,description:t.description,color:t.color,isRepeating:t.isRepeating,isRepeatingInterval:t.isRepeatingInterval||"daily",isRepeatingExcludedDates:t.isRepeatingExcludedDates||[]};return void(o&&await Promise.resolve(o(r)))}const a=c||e.startDate||new Date;switch(w){case"single":{const r=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=(e.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),s=r.toDateString();if(!i.some(e=>e.toDateString()===s)){const t={...e,isRepeatingExcludedDates:[...i,r]};o&&await Promise.resolve(o(t))}const l={title:t.title,description:t.description,startDate:r,endDate:r,startTime:t.startTime,endTime:t.endTime,color:t.color,isRepeating:!1,isRepeatingInterval:"daily",isRepeatingExcludedDates:[]};await Promise.resolve(n(l));break}case"future":if(a.toDateString()===(null==(r=e.startDate)?void 0:r.toDateString())){const r={...e,...t};o&&await Promise.resolve(o(r))}else{const r=new Date(a);r.setDate(r.getDate()-1);const i={...e,endDate:r};o&&await Promise.resolve(o(i));const s={title:t.title,description:t.description,startDate:a,endDate:t.endDate,startTime:t.startTime,endTime:t.endTime,color:t.color,isRepeating:!0,isRepeatingInterval:t.isRepeatingInterval||"daily",isRepeatingExcludedDates:t.isRepeatingExcludedDates||[]};await Promise.resolve(n(s))}break;case"all":{const r={...e,...t};o&&await Promise.resolve(o(r));break}}}catch(e){console.error("Error saving event:",e),v_.error("Error saving event")}finally{p(!1),null==i||i()}};return t.jsxs(dk,{className:"sm:max-w-[425px] w-full max-h-[90vh] overflow-y-auto",children:[t.jsxs(uk,{children:[t.jsxs(hk,{className:"text-lg sm:text-xl flex items-center",children:[t.jsx(pt,{className:"mr-2 h-5 w-5"}),null!=e&&e.id?d.editEvent:d.addEvent]}),t.jsx(fk,{className:"text-sm sm:text-base",children:null!=e&&e.id?d.editEventDescription:d.createEventDescription})]}),t.jsxs(ID,{...j,children:[t.jsx(RS,{open:C,onClose:()=>D(!1),editType:w,onEditTypeChange:e=>M(e),onConfirm:()=>{D(!1),j.handleSubmit(O)()},translations:d}),t.jsxs("form",{onSubmit:t=>{var r,n,o,a;if(t.preventDefault(),null!=e&&e.id&&!0===e.isRepeating){const t=j.getValues(),i=(null==(r=t.startDate)?void 0:r.getTime())!==(null==(n=e.startDate)?void 0:n.getTime()),s=(null==(o=t.endDate)?void 0:o.getTime())!==(null==(a=e.endDate)?void 0:a.getTime()),l=t.isRepeating!==e.isRepeating,c=t.isRepeatingInterval!==(e.isRepeatingInterval||"daily"),d=t.isRepeatingExcludedDates||[],u=e.isRepeatingExcludedDates||[],p=JSON.stringify(d),h=JSON.stringify(u);if(!(i||s||l||c||p!==h||C||t.title===e.title&&t.description===e.description&&t.color===e.color&&t.startTime===e.startTime&&t.endTime===e.endTime))return void D(!0)}j.handleSubmit(O)(t)},className:"space-y-4",children:[t.jsx(HD,{control:j.control,name:"title",render:({field:r})=>t.jsxs(UD,{children:[t.jsx(YD,{children:d.eventTitle}),t.jsx(ZD,{children:t.jsx(r_,{placeholder:d.eventTitle,...r,autoFocus:!e})}),t.jsx(GD,{})]})}),t.jsx(HD,{control:j.control,name:"description",render:({field:e})=>t.jsxs(UD,{children:[t.jsx(YD,{children:d.eventDescription}),t.jsx(ZD,{children:t.jsx(XD,{placeholder:d.eventDescription,...e})}),t.jsx(GD,{})]})}),t.jsx(Uj,{form:j,translations:d}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(HD,{control:j.control,name:"startDate",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventDate}),t.jsxs(Kk,{open:m,onOpenChange:v,children:[t.jsx(Gk,{asChild:!0,children:t.jsx(ZD,{children:t.jsxs(Ir,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),e.value?Te(e.value,"PPP"):t.jsx("span",{children:d.pickADate})]})})}),t.jsx(Xk,{className:"w-auto p-0",children:t.jsx(MC,{mode:"single",selected:e.value,onSelect:t=>{e.onChange(t),v(!1)},defaultMonth:e.value||new Date})})]}),t.jsx(GD,{})]})}),t.jsx(HD,{control:j.control,name:"startTime",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventStartTime}),t.jsx(ZD,{children:t.jsx(QD,{value:e.value,onChange:e.onChange})}),t.jsx(GD,{})]})})]}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(HD,{control:j.control,name:"endDate",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventEndDate}),t.jsxs(Kk,{open:y,onOpenChange:g,children:[t.jsx(Gk,{asChild:!0,children:t.jsx(ZD,{children:t.jsxs(Ir,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),e.value?Te(e.value,"PPP"):t.jsx("span",{children:d.pickADate})]})})}),t.jsx(Xk,{className:"w-auto p-0",children:t.jsx(MC,{mode:"single",selected:e.value,onSelect:t=>{if(!t)return;const r=j.getValues("startDate"),n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate());o>n?(e.onChange(t),g(!1)):o<n?v_.error(d.errorEndDateBeforeStart):(e.onChange(t),g(!1))},fromDate:j.getValues("startDate"),defaultMonth:e.value||new Date})})]}),t.jsx(GD,{})]})}),t.jsx(HD,{control:j.control,name:"endTime",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventEndTime}),t.jsx(ZD,{children:t.jsx(QD,{value:e.value,onChange:e.onChange})}),t.jsx(GD,{})]})})]}),t.jsx(tn,{children:t.jsx(AS,{form:j,translations:d,showRepeatToggle:h})}),t.jsx(HD,{control:j.control,name:"color",render:({field:e})=>t.jsxs(UD,{children:[t.jsx(YD,{children:d.eventColor}),t.jsxs(MS,{onValueChange:e.onChange,defaultValue:e.value,children:[t.jsx(ZD,{children:t.jsx(DS,{children:t.jsx(CS,{placeholder:d.selectAColor})})}),t.jsx(SS,{children:s.map(e=>t.jsx(ES,{value:e.value,children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value))})]}),t.jsx(GD,{})]})}),t.jsxs(pk,{className:"flex flex-col space-y-3 sm:space-y-0 sm:flex-row sm:justify-between items-center w-full",children:[(null==e?void 0:e.id)&&t.jsx("div",{className:"w-full sm:w-auto",children:t.jsxs(QC,{children:[t.jsx(JC,{asChild:!0,children:t.jsx(Ir,{disabled:x,type:"button",variant:"destructive",size:"sm",className:"w-full gap-1 h-10 sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 text-xs sm:text-sm",children:x?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{className:"h-4 w-4 animate-spin"}),d.deleting]}):t.jsxs(t.Fragment,{children:[t.jsx(Nt,{className:"h-4 w-4"}),d.delete]})})}),t.jsxs(rD,{className:"max-w-[425px]",children:[t.jsxs(nD,{children:[t.jsxs(aD,{className:"flex items-center",children:[t.jsx(bt,{className:"mr-2 h-5 w-5 text-red-500"}),null!=e&&e.isRepeating?d.repeatEventDeleteTitle:d.confirmDelete]}),t.jsx(iD,{className:"text-left",children:null!=e&&e.isRepeating?d.repeatEventDeleteDescription:d.confirmDeleteDescription}),t.jsx("div",{className:"h-2"}),(null==e?void 0:e.isRepeating)&&t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(AD,{defaultValue:"single",onValueChange:e=>_(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:d.deleteThisOccurrence,description:d.deleteThisOccurrenceDescription},{value:"future",label:d.deleteThisAndFuture,description:d.deleteThisAndFutureDescription},{value:"all",label:d.deleteAllOccurrences,description:d.deleteAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(RD,{value:e.value,id:e.value}),t.jsxs(VD,{htmlFor:e.value,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(oD,{children:[t.jsx(lD,{children:d.cancel}),t.jsxs(sD,{onClick:async()=>{var t;if(null==e||!e.id)throw Error("Missing Event Id");b(!0);try{const r=c||e.startDate||new Date;if(!e.isRepeating||"all"===k)return void(a&&await Promise.resolve(a(e.id)));if("single"===k){const t=new Date(r.getFullYear(),r.getMonth(),r.getDate()),n=(e.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),a=t.toDateString(),i=n.some(e=>e.toDateString()===a)?n:[...n,t],s={...e,id:e.id,isRepeatingExcludedDates:i};o&&await Promise.resolve(o(s))}else if("future"===k)if(r.toDateString()===(null==(t=e.startDate)?void 0:t.toDateString()))a&&await Promise.resolve(a(e.id));else{const t=new Date(r);t.setDate(t.getDate()-1);const n={...e,id:e.id,endDate:t};o&&await Promise.resolve(o(n))}}finally{b(!1),null==i||i()}},className:"w-full sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 sm:text-sm dark:text-white",children:[t.jsx(Nt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),d.delete]})]})]})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 w-full",children:[t.jsx(Ir,{type:"button",variant:"outline",onClick:i,className:"w-full sm:w-1/2 text-xs sm:text-sm",children:d.cancel}),t.jsx(Ir,{type:"submit",className:"w-full sm:w-1/2 text-xs sm:text-sm",disabled:u,children:u?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{className:"h-4 w-4 animate-spin"}),d.saving]}):d.save})]})]})]})]})]})},kE=({translations:e,children:r,isDisabled:n=!1})=>r?t.jsx(sk,{asChild:!0,disabled:n,children:r}):t.jsx(sk,{asChild:!0,children:t.jsxs(Ir,{variant:"default",size:"sm",className:"w-full gap-0 sm:w-auto text-xs sm:text-sm",disabled:n,children:[t.jsx(pt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),e.addEvent]})}),_E=({event:e,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,onOpenChange:s,dateFromViewClick:l,children:c,isDisabled:d=!1,translations:u})=>{const[p,h]=r.useState(!1),f=e=>{d||(h(e),null==s||s(e),e||null==i||i())};return t.jsxs(ik,{open:p,onOpenChange:f,children:[t.jsx(kE,{translations:u,isDisabled:d,children:c}),t.jsx(bE,{event:e,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:()=>f(!1),dateFromViewClick:l,open:p,translations:u})]})},wE=({currentDate:e,currentView:n,handlePrevious:o,handleNext:a,handleTodayClick:i,toggleTimeFormat:s,setCurrentView:l,isTimeFormatChanging:c,use24HourFormat:d,lastUpdated:u,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y,onEventAdd:g,onEventDelete:x,isListView:b,setIsListView:k,selectedColors:_,setSelectedColors:w})=>{const[M,C]=r.useState(!1);(({handleNext:e,handlePrevious:t})=>{const[n,o]=r.useState(0),[a,i]=r.useState(!1);r.useEffect(()=>{const r=r=>{if("ArrowLeft"===r.key||"ArrowRight"===r.key){r.preventDefault();const s=Date.now();!a&&s-n>200&&(i(!0),o(s),"ArrowLeft"===r.key?t():e())}},s=e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&i(!1)};return window.addEventListener("keydown",r),window.addEventListener("keyup",s),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",s)}},[e,t,a,n])})({handleNext:a,handlePrevious:o});const D=[{value:"day",label:y.localization.day,icon:St},{value:"week",label:y.localization.week,icon:Mt},{value:"month",label:y.localization.month,icon:Dt},{value:"year",label:y.localization.year,icon:jt}];return t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center mb-4 space-y-4 sm:space-y-0",children:[t.jsx(o_,{currentDate:e,currentView:n,handlePrevious:o,handleNext:a,lastUpdated:u,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 w-full sm:w-auto",children:[t.jsx(Hd,{is24HourFormat:d,isTimeFormatChanging:c,toggleTimeFormat:s}),t.jsx(vy,{isFilterOpen:M,setIsFilterOpen:C,selectedColors:_,toggleColorSelection:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},currentConfig:y}),t.jsx(yy,{handleTodayClick:i,isTodayDisabled:(()=>{const t=new Date;switch(n){case"day":return L(e,t);case"week":return L(O(e,{weekStartsOn:d?1:0}),O(t,{weekStartsOn:d?1:0}));case"month":return Le(e,t);case"year":return e.getFullYear()===t.getFullYear();default:return!1}})(),getTodayButtonText:()=>{switch(n){case"day":default:return y.localization.today;case"week":return y.localization.thisWeek;case"month":return y.localization.thisMonth;case"year":return y.localization.thisYear}}}),t.jsx(Qy,{isListView:b,setIsListView:k,currentConfig:y}),t.jsx(Jy,{currentView:n,setCurrentView:l,viewOptions:D,currentConfig:y}),t.jsx(_E,{translations:y.localization,event:(()=>{switch(n){case"day":default:return{startDate:e,endDate:e};case"week":return{startDate:O(e,{weekStartsOn:d?1:0}),endDate:K(e,{weekStartsOn:d?1:0})}}})(),onAddEvent:g,onDeleteEvent:x})]})]})},ME=({currentView:e,currentDate:t,onDateRangeChange:n,is24HourFormat:o})=>{const a=r.useRef(t),i=r.useRef(e),s=r.useCallback(()=>{let r,n;switch(e){case"day":default:r=E(t),n=H(t);break;case"week":r=O(t,{weekStartsOn:o?1:0}),n=K(t,{weekStartsOn:o?1:0});break;case"month":r=U(t),n=$(t);break;case"year":r=Z(t),n=Y(t)}return{startDate:r,endDate:n}},[e,t,o]),l=r.useCallback(()=>{if(e!==i.current)return!0;const r=a.current;switch(e){case"day":return!L(t,r);case"week":return!function(e,t,r){return+O(e,r)==+O(t,r)}(t,r,{weekStartsOn:o?1:0});case"month":return!Le(t,r);case"year":return!Be(t,r);default:return!0}},[e,t,o]);r.useEffect(()=>{(async()=>{if(n&&l()){const{startDate:r,endDate:o}=s();await n(r,o),a.current=t,i.current=e}})()},[e,t,n,s,l])},CE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));CE.displayName="Card";const DE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("flex flex-col space-y-1.5 p-6",e),...r}));DE.displayName="CardHeader";const jE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("text-2xl font-semibold leading-none tracking-tight",e),...r}));jE.displayName="CardTitle";const OE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("text-sm text-muted-foreground",e),...r}));OE.displayName="CardDescription";const SE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("p-6 pt-0",e),...r}));SE.displayName="CardContent";const PE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("flex items-center p-6 pt-0",e),...r}));PE.displayName="CardFooter";var EE="ScrollArea",[TE,NE]=Wd(EE),[zE,AE]=TE(EE),RE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:i,scrollHideDelay:s=600,...l}=e,[c,d]=a.useState(null),[u,p]=a.useState(null),[h,f]=a.useState(null),[m,v]=a.useState(null),[y,g]=a.useState(null),[x,b]=a.useState(0),[k,_]=a.useState(0),[w,M]=a.useState(!1),[C,D]=a.useState(!1),j=Ft(r,e=>d(e)),O=eu(i);return t.jsx(zE,{scope:n,type:o,dir:O,scrollHideDelay:s,scrollArea:c,viewport:u,onViewportChange:p,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:w,onScrollbarXEnabledChange:M,scrollbarY:y,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:D,onCornerWidthChange:b,onCornerHeightChange:_,children:t.jsx(Gd.div,{dir:O,...l,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});RE.displayName=EE;var FE="ScrollAreaViewport",LE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,children:o,nonce:i,...s}=e,l=AE(FE,n),c=Ft(r,a.useRef(null),l.onViewportChange);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),t.jsx(Gd.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:t.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});LE.displayName=FE;var BE="ScrollAreaScrollbar",VE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=AE(BE,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=i,c="horizontal"===e.orientation;return a.useEffect(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===i.type?t.jsx(IE,{...o,ref:r,forceMount:n}):"scroll"===i.type?t.jsx(qE,{...o,ref:r,forceMount:n}):"auto"===i.type?t.jsx(HE,{...o,ref:r,forceMount:n}):"always"===i.type?t.jsx($E,{...o,ref:r}):null});VE.displayName=BE;var IE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=AE(BE,e.__scopeScrollArea),[s,l]=a.useState(!1);return a.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),t.jsx(Hh,{present:n||s,children:t.jsx(HE,{"data-state":s?"visible":"hidden",...o,ref:r})})}),qE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=AE(BE,e.__scopeScrollArea),s="horizontal"===e.orientation,l=cT(()=>d("SCROLL_END"),100),[c,d]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,i.scrollHideDelay,d]),a.useEffect(()=>{const e=i.viewport,t=s?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(d("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,s,d,l]),t.jsx(Hh,{present:n||"hidden"!==c,children:t.jsx($E,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:$d(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:$d(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),HE=a.forwardRef((e,r)=>{const n=AE(BE,e.__scopeScrollArea),{forceMount:o,...i}=e,[s,l]=a.useState(!1),c="horizontal"===e.orientation,d=cT(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return dT(n.viewport,d),dT(n.content,d),t.jsx(Hh,{present:o||s,children:t.jsx($E,{"data-state":s?"visible":"hidden",...i,ref:r})})}),$E=a.forwardRef((e,r)=>{const{orientation:n="vertical",...o}=e,i=AE(BE,e.__scopeScrollArea),s=a.useRef(null),l=a.useRef(0),[c,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=nT(c.viewport,c.content),p={...o,sizes:c,onSizesChange:d,hasThumb:u>0&&u<1,onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,r,n="ltr"){const o=oT(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return iT([l,c],u)(e)}(e,l.current,c,t)}return"horizontal"===n?t.jsx(WE,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=aT(i.viewport.scrollLeft,c,i.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=h(e,i.dir))}}):"vertical"===n?t.jsx(UE,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=aT(i.viewport.scrollTop,c);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=h(e))}}):null}),WE=a.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...i}=e,s=AE(BE,e.__scopeScrollArea),[l,c]=a.useState(),d=a.useRef(null),u=Ft(r,d,s.onScrollbarXChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),t.jsx(KE,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":oT(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(s.viewport){const n=s.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),sT(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:rT(l.paddingLeft),paddingEnd:rT(l.paddingRight)}})}})}),UE=a.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...i}=e,s=AE(BE,e.__scopeScrollArea),[l,c]=a.useState(),d=a.useRef(null),u=Ft(r,d,s.onScrollbarYChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),t.jsx(KE,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":oT(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(s.viewport){const n=s.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),sT(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:rT(l.paddingTop),paddingEnd:rT(l.paddingBottom)}})}})}),[YE,ZE]=TE(BE),KE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:i,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:h,...f}=e,m=AE(BE,n),[v,y]=a.useState(null),g=Ft(r,e=>y(e)),x=a.useRef(null),b=a.useRef(""),k=m.viewport,_=o.content-o.viewport,w=tu(p),M=tu(d),C=cT(h,10);function D(e){if(x.current){const t=e.clientX-x.current.left,r=e.clientY-x.current.top;u({x:t,y:r})}}return a.useEffect(()=>{const e=e=>{const t=e.target;(null==v?void 0:v.contains(t))&&w(e,_)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[k,v,_,w]),a.useEffect(M,[o,M]),dT(v,C),dT(m.content,C),t.jsx(YE,{scope:n,scrollbar:v,hasThumb:i,onThumbChange:tu(s),onThumbPointerUp:tu(l),onThumbPositionChange:M,onThumbPointerDown:tu(c),children:t.jsx(Gd.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:$d(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),x.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),D(e))}),onPointerMove:$d(e.onPointerMove,D),onPointerUp:$d(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),GE="ScrollAreaThumb",XE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=ZE(GE,e.__scopeScrollArea);return t.jsx(Hh,{present:n||a.hasThumb,children:t.jsx(QE,{ref:r,...o})})}),QE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,style:o,...i}=e,s=AE(GE,n),l=ZE(GE,n),{onThumbPositionChange:c}=l,d=Ft(r,e=>l.onThumbChange(e)),u=a.useRef(void 0),p=cT(()=>{u.current&&(u.current(),u.current=void 0)},100);return a.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(p(),!u.current){const t=lT(e,c);u.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,p,c]),t.jsx(Gd.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:$d(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:$d(e.onPointerUp,l.onThumbPointerUp)})});XE.displayName=GE;var JE="ScrollAreaCorner",eT=a.forwardRef((e,r)=>{const n=AE(JE,e.__scopeScrollArea),o=!(!n.scrollbarX||!n.scrollbarY);return"scroll"!==n.type&&o?t.jsx(tT,{...e,ref:r}):null});eT.displayName=JE;var tT=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,...o}=e,i=AE(JE,n),[s,l]=a.useState(0),[c,d]=a.useState(0),u=!(!s||!c);return dT(i.scrollbarX,()=>{var e;const t=(null==(e=i.scrollbarX)?void 0:e.offsetHeight)||0;i.onCornerHeightChange(t),d(t)}),dT(i.scrollbarY,()=>{var e;const t=(null==(e=i.scrollbarY)?void 0:e.offsetWidth)||0;i.onCornerWidthChange(t),l(t)}),u?t.jsx(Gd.div,{...o,ref:r,style:{width:s,height:c,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}}):null});function rT(e){return e?parseInt(e,10):0}function nT(e,t){const r=e/t;return isNaN(r)?0:r}function oT(e){const t=nT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function aT(e,t,r="ltr"){const n=oT(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=iO(e,"ltr"===r?[0,i]:[-1*i,0]);return iT([0,i],[0,s])(l)}function iT(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function sT(e,t){return e>0&&e<t}var lT=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function cT(e,t){const r=tu(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function dT(e,t){const r=tu(t);Yd(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var uT=RE,pT=LE,hT=eT;const fT=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(uT,{ref:o,className:Br("relative overflow-hidden",e),...n,children:[t.jsx(pT,{className:"h-full w-full rounded-[inherit]",children:r}),t.jsx(mT,{}),t.jsx(hT,{})]}));fT.displayName=uT.displayName;const mT=a.forwardRef(({className:e,orientation:r="vertical",...n},o)=>t.jsx(VE,{ref:o,orientation:r,className:Br("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:t.jsx(XE,{className:"relative flex-1 rounded-full bg-border"})}));mT.displayName=VE.displayName;const vT=(e,t)=>{const[r,n]=e.split(":").map(Number),o=Qe(Je(new Date,n),r);return t?Te(o,"HH:mm"):Te(o,"h:mm").toLowerCase()+Te(o,"a").toLowerCase()},yT=(e,t,r)=>r?Te(Qe(e,t),"HH:mm"):Te(Qe(e,t),"h a").toLowerCase(),gT=e=>{const t=s.find(t=>t.value===e);return t?t.class:s[0].class},xT=({className:e,style:r})=>t.jsx(qd.div,{className:Br("bg-gray-50 dark:bg-transparent rounded-md overflow-hidden relative",e),style:r,initial:{opacity:.4},animate:{opacity:[.4,.5,.4]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-gray-200 dark:via-muted-foreground to-transparent skeleton-shimmer"})}),bT=({filteredEvents:e,currentDate:r,hoverLineRef:n,hoverTimeRef:o,setClickedTime:a,currentConfig:i,isAddEventPopupOpen:s,onEventAdd:l,onEventUpdate:c,onEventDelete:d,is24HourFormat:u,clickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isLoading:m,setIsAddEventPopupOpen:v,onDateRangeChange:y})=>{var g,x;const b=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,r)))&&NS(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Ve(r,{start:E(e.startDate),end:H(e.endDate)}):L(e.startDate,r)),k=Array.from({length:24},(e,t)=>t),_=(e,t)=>{if(e.isRepeating){const r=`${vT(e.startTime,u)} - ${vT(e.endTime,u)}`,n=Te(e.startDate,"MMM d"),o=Te(e.endDate||e.startDate,"MMM d"),a=Te(t,"EEEE"),s=Te(t,"do");switch(e.isRepeatingInterval||"daily"){case"daily":default:return i.localization.repeatDailyDescription.replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"weekly":return i.localization.repeatWeeklyDescription.replace("{dayName}",a).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"monthly":return i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",s).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o)}}else if(e.endDate&&!L(e.startDate,e.endDate)){const r=Math.floor(I(H(e.endDate),E(e.startDate)))+1,n=Math.floor(I(E(t),E(e.startDate)))+1;return i.localization.dayXofY.replace("{x}",n.toString()).replace("{y}",r.toString())}return null},w=b.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!L(t.startDate,t.endDate);return t.isRepeating?n?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):o?L(t.startDate,r)?e.multiDayEvents.push({...t,isStart:!0}):L(t.endDate,r)?e.multiDayEvents.push({...t,isEnd:!0}):e.multiDayEvents.push({...t,isMiddle:!0}):n?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),M=[...w.repeatingFullDayEvents,...w.multiDayEvents,...w.fullDayEvents],D=w.regularEvents,{sortedEvents:j,eventPositions:O,maxColumn:S}=(e=>{const t=e.sort((e,t)=>{const n=qe(`${Te(r,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(r,"yyyy-MM-dd")}T${t.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,t)=>{const n=qe(`${Te(r,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(r,"yyyy-MM-dd")}T${e.endTime}`),a=qe(`${Te(r,"yyyy-MM-dd")}T${t.startTime}`);return n<qe(`${Te(r,"yyyy-MM-dd")}T${t.endTime}`)&&a<o};return t.forEach((e,r)=>{let i=0,s=!1;for(let o=0;o<r;o++)a(e,t[o])&&(i=Math.max(i,n[t[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(t.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:t,eventPositions:n,maxColumn:1}):(t.forEach(e=>{if(n[e.id].column<o){let r=1;for(;r+n[e.id].column<=o&&!t.some(t=>n[t.id].column===n[e.id].column+r&&a(e,t));)r++;n[e.id].span=r}}),{sortedEvents:t,eventPositions:n,maxColumn:o+1})})(D),P=({event:e,currentDate:r})=>t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})(),"min-h-[44px]"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs font-medium",children:[vT(e.startTime,u)," - ",vT(e.endTime,u)]})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),T=({event:e,currentDate:r})=>t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]",e.isStart&&["border-l-4","border-l-black/70 dark:border-l-white/50"],e.isEnd&&["border-r-4","border-r-black/70 dark:border-r-white/50"],e.isMiddle&&"border-x-0"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:e.isStart?`${i.localization.starts}: ${vT(e.startTime,u)}`:e.isEnd?`${i.localization.ends}: ${vT(e.endTime,u)}`:i.localization.allDay})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),N=({event:e})=>t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]","border-l-4 border-r-4","border-black/70 dark:border-white/50"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:i.localization.allDay})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),z=({event:e,currentDate:r,index:n})=>e.isRepeating?t.jsx(P,{event:e,currentDate:r,index:n}):e.endDate&&!L(e.startDate,e.endDate)?t.jsx(T,{event:e,currentDate:r,index:n}):t.jsx(N,{event:e,index:n});return t.jsxs(CE,{className:"pb-4 pl-4 pr-4",children:[t.jsxs("div",{className:"sticky top-0 bg-background z-20 pt-4 pb-1",children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:`${i.localization.monthNames[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}),M.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsxs("h3",{className:"text-sm font-semibold mb-2",children:[i.localization.fullDayEvents," (",M.length,")"]}),M.map((e,n)=>t.jsx(qd.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*n},className:"space-y-2 mb-1",children:t.jsx(z,{event:e,currentDate:r,index:n},e.id)},e.id))]})]}),t.jsx(fT,{className:"px-4 h-[570px]",children:t.jsxs("div",{className:"relative mt-2 mb-2",children:[t.jsx("div",{className:"absolute left-0 w-16 z-10 bg-background",children:t.jsx(_E,{translations:i.localization,onAddEvent:l,event:{startDate:r,endDate:r,startTime:p||Te(new Date,"HH:mm"),endTime:p?C(qe(`2000-01-01T${p}`),1).toTimeString().slice(0,5):Te(C(new Date,1),"HH:mm")},children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top;let a,i,s;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);a=Math.floor(e/60),i=e%60,s=e/60*64}else a=Math.floor(r/64),i=Math.floor(r%64/64*60),s=r;const l=`${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`;n.current&&(n.current.style.top=`${s}px`,n.current.style.display="block"),o.current&&(o.current.textContent=l)},onMouseLeave:()=>{n.current&&(n.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),i=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;a(i)},children:k.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-right text-sm text-muted-foreground",children:yT(r,e,u)},`hour-${e}`))})})}),t.jsxs("div",{className:"ml-16 relative",onDoubleClick:e=>{if(s||!i.dayView.enableDoubleClickToAddEvent)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientY-t.top,o=Math.floor(n/(16/15)),a=Math.floor(o/60),c=o%60,d=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,u=`${(a+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;l({title:"",startDate:r,endDate:r,startTime:d,endTime:u,color:"blue",isRepeating:!1})},children:[k.map(e=>t.jsx("div",{className:"h-16 border-t border-border"},e)),!(null!=(g=i.dayView)&&g.hideHoverLine)&&t.jsx("div",{ref:n,className:"absolute left-0 right-0 h-px bg-primary z-40 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:o,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),L(r,new Date)&&!(null!=(x=i.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 z-30 pointer-events-none",style:{top:`${f}px`},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Te(new Date,"HH:mm")})}),m&&y&&Array.from({length:10}).map((e,r)=>t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),j.map((e,n)=>{const o=qe(`${Te(r,"yyyy-MM-dd")}T${e.startTime}`),a=qe(`${Te(r,"yyyy-MM-dd")}T${e.endTime}`),s=60*o.getHours()+o.getMinutes(),p=60*a.getHours()+a.getMinutes()-s,{column:h,span:f}=O[e.id],m=f/S*100,y=h/S*100,g=_(e,r);return t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,onOpenChange:v,dateFromViewClick:r,translations:i.localization,children:t.jsxs(qd.div,{className:Br(gT(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return"";switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})()),style:{top:s*(16/15)+"px",height:`${Math.max(p*(16/15),24)}px`,left:`${y}%`,width:`${m}%`,zIndex:n+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*n},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||i.localization.untitledEvent}),t.jsxs("div",{className:"text-xs",children:[vT(e.startTime,u)," - ",vT(e.endTime,u)]}),e.description&&t.jsx("div",{className:"text-xs font-semibold truncate",children:e.description}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${e.id}-${e.startTime}`)})]})]})})]})},kT=({events:e,date:n,addEvent:o,updateEvent:a,getEventColor:i,onDelete:s,children:l,onOpenChange:c,preSelectedColor:d,is24HourFormat:u,translations:p})=>{const[h,f]=r.useState(null),[m,v]=r.useState(!1),y=e=>{h&&(a(e),f(null))},g=e=>{const t=e.endDate&&!L(e.startDate,e.endDate),r=L(e.startDate,n),o=e.endDate&&L(e.endDate,n),a=t&&!r&&!o,s=e.isRepeating?Br("border-2 dark:border border-dashed border-opacity-50",r&&"border-l-solid border-l-2 border-l-black/90 dark:border-l-white/50",o&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",a&&"border-x-0"):Br(r&&"border-l-4 border-l-black/70 dark:border-l-white/50",o&&"border-r-4 border-r-black/70 dark:border-r-white/50",a&&"border-x-0");return Br(i(e.color),"p-2 rounded cursor-pointer hover:opacity-80 transition-opacity w-full text-left","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",s)},x=e=>{const t=L(e.startDate,n),r=e.endDate&&L(e.endDate,n);return!t||e.endDate&&!L(e.startDate,e.endDate)?t?`Starts ${vT(e.startTime,u)}`:r?e.isRepeating?`Ends today (${vT(e.startTime,u)} - ${vT(e.endTime,u)})`:`Ends ${vT(e.endTime,u)}`:e.isRepeating?`${vT(e.startTime,u)} - ${vT(e.endTime,u)}`:"All day":`${vT(e.startTime,u)} - ${vT(e.endTime,u)}`};return t.jsxs(ik,{open:m,onOpenChange:v,children:[t.jsx(sk,{asChild:!0,children:l}),t.jsxs(dk,{className:"sm:max-w-[425px]",children:[t.jsx(uk,{children:t.jsx(hk,{children:Te(n,"MMMM d, yyyy")})}),t.jsx(fT,{className:"h-[300px] mt-4",children:t.jsx("div",{className:"space-y-2 pr-4 flex flex-col items-center pl-6",children:e.sort((e,t)=>new Date(`${Te(n,"yyyy-MM-dd")}T${e.startTime}`).getTime()-new Date(`${Te(n,"yyyy-MM-dd")}T${t.startTime}`).getTime()).map(e=>t.jsx(_E,{event:e,onAddEvent:o,onUpdateEvent:y,onDeleteEvent:s,onOpenChange:c,dateFromViewClick:n,translations:p,children:t.jsxs("div",{className:g(e),onClick:()=>(e=>{f(e),v(!0)})(e),children:[e.title&&t.jsx("div",{className:"font-semibold truncate",children:e.title}),t.jsx("div",{className:"text-xs",children:x(e)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id))})}),t.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[t.jsx(_E,{translations:p,event:{startDate:n,endDate:n,color:d},onAddEvent:o,dateFromViewClick:n,children:t.jsxs(Ir,{variant:"outline",className:"flex-grow mr-2",children:[t.jsx(kt,{className:"mr-2 h-4 w-4"}),p.addEvent]})}),t.jsx(Ir,{variant:"outline",onClick:()=>{f(null),v(!1)},children:"Close"})]})]})]})},_T=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:l,isLoading:c,hoverLineRef:d,hoverTimeRef:u,clickedTime:p,setClickedTime:h,currentTimeLineRef:f,currentTimeTop:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:g})=>{var x,b;const k=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>{const r=s.findIndex(t=>t.value===e),n=s.findIndex(e=>e.value===t);return r-n}),_=e.filter(e=>{const t=E(e.startDate),n=E(r);return e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,n)))&&NS(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Ve(n,{start:t,end:H(e.endDate)}):L(t,n)}),w=Array.from({length:24},(e,t)=>({hour:t,label:yT(r,t,o)})),M=e=>{if(!e.isRepeating)return Br(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}},D=e=>{if(!e.isRepeating)return Br(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}};return t.jsx(CE,{className:"",children:t.jsxs(fT,{className:"h-[600px]",children:[t.jsxs("div",{className:"flex pl-2 pr-2",children:[t.jsxs("div",{className:"sticky left-0 z-30 w-16 bg-background border-r border-border h-full",children:[t.jsx("div",{className:"sticky top-0 z-[200] bg-background h-12 border-b border-border"}),t.jsx("div",{className:"sticky top-12 z-[200] bg-background h-[3.1rem] flex items-center justify-end pr-4 text-sm text-muted-foreground border-b border-border",children:n.localization.allDay}),t.jsx(_E,{onAddEvent:a,onDeleteEvent:l,event:{startDate:r,endDate:r,startTime:p||Te(new Date,"HH:mm"),endTime:Te(C(p?qe(`2000-01-01T${p}`):new Date,1),"HH:mm"),color:null!=k&&k.length?k[0]:void 0},translations:n.localization,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=r+96;let o,a,i;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);o=Math.floor(e/60),a=e%60,i=e/60*64+96}else o=Math.floor(r/64),a=Math.floor(r%64/64*60),i=n;o=Math.max(0,Math.min(23,o)),a=Math.max(0,Math.min(59,a));const s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;d.current&&(d.current.style.top=`${i}px`,d.current.style.display="block"),u.current&&(u.current.textContent=s)},onMouseLeave:()=>{d.current&&(d.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),a=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;h(a)},children:w.map(({hour:e,label:r})=>t.jsx("div",{className:"h-16 flex items-center justify-end pr-4 text-sm text-muted-foreground cursor-pointer",children:t.jsx("span",{className:"mt-[-46px]",children:r})},e))})})]}),t.jsx("div",{className:"flex-1 relative",children:t.jsxs("div",{className:"grid pb-4",style:{gridTemplateColumns:`repeat(${k.length}, 1fr)`},children:[!(null!=(x=n.dayView)&&x.hideHoverLine)&&t.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{zIndex:150},children:t.jsx("div",{ref:d,className:"absolute left-0 right-0 h-px bg-primary",style:{display:"none"},children:t.jsx("span",{ref:u,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})})}),L(r,new Date)&&!(null!=(b=n.dayView)&&b.hideTimeline)&&t.jsx("div",{ref:f,className:"absolute left-0 right-0 h-px bg-red-500 pointer-events-none",style:{top:`${m}px`,zIndex:30},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Te(new Date,"HH:mm")})}),k.map(e=>{const d=s.find(t=>t.value===e),u=_.filter(t=>t.color===e),{allDayEvents:p,regularEvents:h}=(e=>e.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!L(t.startDate,t.endDate);return n?o?L(t.startDate,r)?e.allDayEvents.push({...t,isStart:!0}):L(t.endDate,r)?e.allDayEvents.push({...t,isEnd:!0}):e.allDayEvents.push({...t,isMiddle:!0}):e.allDayEvents.push(t):e.regularEvents.push(t),e},{allDayEvents:[],regularEvents:[]}))(u),{events:f,totalColumns:m}=(e=>{const t=e.map(e=>{const t="00:00"===e.startTime&&"23:59"===e.endTime,n=t?0:60*parseInt(e.startTime.split(":")[0])+parseInt(e.startTime.split(":")[1]),o=t?1440:60*parseInt(e.endTime.split(":")[0])+parseInt(e.endTime.split(":")[1]),a=e.endDate&&!L(e.startDate,e.endDate),i=a&&L(e.startDate,r),s=a&&L(e.endDate,r);return{...e,isAllDay:t,startMinutes:n,endMinutes:o,column:0,width:1,isStart:i,isEnd:s,isMiddle:a&&!i&&!s}}).sort((e,t)=>e.isAllDay&&!t.isAllDay?-1:!e.isAllDay&&t.isAllDay?1:e.startMinutes-t.startMinutes),n=[];return t.forEach(e=>{let r=0;for(;;){if(!t.some(t=>t.column===r&&e!==t&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes))){e.column=r,n[r]=(n[r]||0)+1;break}r++}}),t.forEach(e=>{let r=1,o=e.column+1;for(;o<n.length&&!t.some(t=>t.column===o&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes));)r++,o++;e.width=r}),{events:t,totalColumns:Math.max(...n.map((e,t)=>t+1),1)}})(h),x=(e,t)=>{const r="00:00"===e.startTime&&"23:59"===e.endTime;if(e.isRepeating&&!r){const r=E(e.startDate),o=E(e.endDate||e.startDate);let a,i;switch(e.isRepeatingInterval||"daily"){case"weekly":a=Math.floor(I(o,r)/7)+1,i=Math.floor(I(t,r)/7)+1;break;case"monthly":a=12*(o.getFullYear()-r.getFullYear())+o.getMonth()-r.getMonth()+1,i=12*(t.getFullYear()-r.getFullYear())+t.getMonth()-r.getMonth()+1;break;default:a=I(o,r)+1,i=I(t,r)+1}return n.localization.repeatXofY.replace("{x}",i.toString()).replace("{y}",a.toString())}};return t.jsxs("div",{className:"relative border-r border-border flex-1",children:[t.jsx("div",{className:"sticky top-0 z-50 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:Br("w-3 h-3 rounded-full flex-shrink-0 hidden sm:block text-center",null==d?void 0:d.class)}),t.jsx("div",{className:"max-w-[150px] sm:max-w-[200px]",children:t.jsxs("span",{className:"relative font-medium text-sm sm:text-base group",children:[t.jsxs("span",{className:"block truncate",children:[null==d?void 0:d.label,u.length>0&&` (${u.length})`]}),t.jsx("span",{className:Br("absolute bottom-0 left-0 w-full h-[2px] sm:hidden",null==d?void 0:d.class)})]})})]})}),t.jsx("div",{className:"sticky top-12 z-50 bg-background min-h-[50px] border-b border-border",children:p.length<=1?p.map(e=>t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(_E,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:l,dateFromViewClick:r,translations:n.localization,children:t.jsx(qd.div,{className:Br(gT(e.color),"rounded px-2 py-1 mb-0.5 last:mb-0 cursor-pointer","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors",M(e)),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs("div",{className:"max-w-28 md:max-w-48",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs font-medium truncate",children:e.isStart?`${n.localization.starts}: ${vT(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${vT(e.endTime,o)}`:null})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),x(e,r)&&t.jsx("div",{className:"text-xs italic",children:x(e,r)})]})})},e.id)})):t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(kT,{events:p,date:r,addEvent:a,updateEvent:i,is24HourFormat:o,getEventColor:gT,onDelete:l,translations:n.localization,preSelectedColor:e,children:t.jsxs(qd.div,{className:Br(gT(p[0].color),"rounded px-2 py-1 cursor-pointer group","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors","border border-dashed border-opacity-50"),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("span",{className:"text-xs font-medium",children:[p.length," ",n.localization.allDay]})}),t.jsxs("div",{className:"text-xs mt-0.5 truncate max-w-24 sm:max-w-44",children:[p.slice(0,3).map(e=>e.title||n.localization.untitledEvent).join(", "),p.length>3&&`, +${p.length-3} more`]})]})})})}),t.jsxs("div",{className:"relative",onDoubleClick:t=>((e,t)=>{if(v||!n.dayView.enableDoubleClickToAddEvent)return;const o=e.currentTarget.getBoundingClientRect(),i=e.clientY-o.top,s=Math.floor(i/(16/15)),l=Math.floor(s/60),c=s%60,d=`${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,u=`${(l+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;a({title:"",startDate:r,endDate:r,startTime:d,endTime:u,color:t,isRepeating:!1})})(t,e),children:[w.map(({hour:e})=>t.jsx("div",{className:"h-16 border-b border-border"},e)),c&&g&&Array.from({length:10}).map((e,r)=>t.jsx(xT,{className:"absolute left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),t.jsx("div",{className:"absolute inset-0",children:f.map((e,s)=>{const c=e.column*(100/m),d=e.width*(100/m);return t.jsx(_E,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:l,onOpenChange:y,dateFromViewClick:r,translations:n.localization,children:t.jsxs(qd.div,{className:Br(gT(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",D(e)),style:{top:e.startMinutes*(16/15)+"px",height:`${Math.max((e.endMinutes-e.startMinutes)*(16/15),24)}px`,left:`${c}%`,width:`${d}%`},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*s},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs",children:e.isStart?`${n.localization.starts}: ${vT(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${vT(e.endTime,o)}`:`${vT(e.startTime,o)} - ${vT(e.endTime,o)}`}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),(e.isRepeating||e.isStart||e.isEnd||e.isMiddle)&&t.jsx("div",{className:"text-xs italic",children:x(e,r)})]})},e.id)})})]})]},e)})]})})]}),t.jsx(mT,{orientation:"horizontal"})]})})},wT=({filteredEvents:e,currentDate:r,currentConfig:n,isLoading:o,is24HourFormat:a,clickedTime:i,currentTimeTop:s,hoverLineRef:l,hoverTimeRef:c,currentTimeLineRef:d,setClickedTime:u,onEventAdd:p,onEventUpdate:h,onEventDelete:f,onDateRangeChange:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y})=>{var g;const x={filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:a,onEventAdd:p,onEventUpdate:h,onEventDelete:f,hoverLineRef:l,hoverTimeRef:c,clickedTime:i,setClickedTime:u,currentTimeLineRef:d,currentTimeTop:s,isLoading:o,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:m};return t.jsx(t.Fragment,{children:"resource"===(null==(g=n.dayView)?void 0:g.viewType)?t.jsx(_T,{...x}):t.jsx(bT,{...x})})},MT=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:d,setCurrentView:u,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b,k;const _=O(r,{weekStartsOn:n?1:0}),w=K(r,{weekStartsOn:n?1:0}),M=W({start:_,end:w}),D=Array.from({length:24},(e,t)=>t),j=le(_,{weekStartsOn:n?1:0}),S=(e,t)=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=E(e.startDate),n=H(e.endDate||e.startDate);return Ve(t,{start:r,end:n})},P=e.filter(e=>e.isRepeating?M.some(t=>NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily")):Ve(e.startDate,{start:_,end:w})||e.endDate&&Ve(e.endDate,{start:_,end:w})),T=(e=>e.reduce((e,t)=>{const r="00:00"===t.startTime&&"23:59"===t.endTime,n=t.endDate&&!L(t.startDate,t.endDate);return t.isRepeating?r?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):n?e.multiDayEvents.push(t):r?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(P),N=[...T.repeatingFullDayEvents,...T.multiDayEvents,...T.fullDayEvents],z=({event:e,day:r})=>{var n,o,a;const i=e.endDate&&!L(e.startDate,e.endDate),s=L(e.startDate,r),l=e.endDate&&L(e.endDate,r),d=i&&!s&&!l;return t.jsx(_E,{event:e,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,dateFromViewClick:r,translations:c.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[24px] text-xs",(()=>{if(!e.isRepeating)return Br(s&&"border-l-4 border-l-black/70 dark:border-l-white/50",l&&"border-r-4 border-r-black/70 dark:border-r-white/50",d&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return Br("border border-dashed border-opacity-50",s&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",l&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",d&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),e.description&&t.jsx("div",{className:"truncate",children:e.description}),e.isRepeating&&t.jsx("div",{className:"text-[10px] opacity-75",children:"daily"===e.isRepeatingInterval?null==(n=c.localization)?void 0:n.repeatDaily:"weekly"===e.isRepeatingInterval?null==(o=c.localization)?void 0:o.repeatWeekly:null==(a=c.localization)?void 0:a.repeatMonthly})]})},e.id)};return t.jsxs(CE,{className:"p-4",children:[N.length>0&&t.jsxs("div",{className:"mb-4 relative z-20",children:[t.jsx("div",{className:"grid grid-cols-8 gap-0",children:M.map(e=>t.jsx("div",{className:"text-center text-xs font-semibold"},e.toString()))}),t.jsxs("div",{className:"grid grid-cols-8 gap-0 relative",children:[t.jsx("div",{className:"absolute left-0 top-0 bottom-2 w-[12.5%] flex items-center justify-center z-10",children:t.jsxs("div",{className:"text-xs truncate font-semibold whitespace-nowrap",children:[c.localization.fullDayEvents," (",N.length,")"]})}),N.map((e,r)=>t.jsxs(qd.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*r},className:"col-span-8 grid grid-cols-8 gap-0 mb-1",children:[t.jsx("div",{className:"w-[12.5%]"}),M.map(r=>t.jsx("div",{className:"min-h-[24px] px-1",children:Ve(r,{start:e.startDate,end:e.endDate||e.startDate})&&t.jsx(z,{event:e,day:r})},`${e.id}-${r.toString()}`))]},e.id))]})]}),t.jsx(fT,{className:"h-[600px]",children:t.jsxs("div",{className:"relative mb-2",children:[t.jsxs("div",{className:"grid grid-cols-8 gap-0",children:[t.jsx(_E,{event:{startDate:_,endDate:w,startTime:s||Te(new Date,"HH:mm"),endTime:Te(C(s?qe(`2000-01-01T${s}`):new Date,1),"HH:mm"),isRepeating:!0},onAddEvent:f,dateFromViewClick:_,translations:c.localization,children:t.jsxs("div",{className:"sticky top-0 left-0 z-30 bg-background",onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r);let i,s,l;if(e.ctrlKey){const e=15*Math.round(n/64*60/15);i=Math.floor(e/60),s=e%60,l=e/60*64}else i=Math.floor(n/64),s=Math.floor(n%64/64*60),l=n;const c=`${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;o.current&&(o.current.style.top=`${l+48}px`,o.current.style.display="block"),a.current&&(a.current.textContent=c)},onMouseLeave:()=>{o.current&&(o.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r),o=Math.floor(n/64),a=Math.floor(n%64/64*60),s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;i(s)},children:[t.jsx("div",{className:"sticky top-0 left-0 bg-background h-12 border-b border-r border-border flex items-center justify-center",children:t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground bg-background",children:["Week ",j]})}),D.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-center text-sm text-muted-foreground border-r border-border",children:yT(r,e,n)},e))]})}),t.jsx("div",{className:"col-span-7 relative z-20",children:t.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[M.map((e,r)=>{const o=T.regularEvents.filter(t=>S(t,e)),{sortedEvents:a,eventPositions:i,maxColumn:s}=((e,t)=>{const r=e.filter(e=>S(e,t)).sort((e,r)=>{const n=qe(`${Te(t,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(t,"yyyy-MM-dd")}T${r.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,r)=>{const n=qe(`${Te(t,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(t,"yyyy-MM-dd")}T${e.endTime}`),a=qe(`${Te(t,"yyyy-MM-dd")}T${r.startTime}`);return n<qe(`${Te(t,"yyyy-MM-dd")}T${r.endTime}`)&&a<o};return r.forEach((e,t)=>{let i=0,s=!1;for(let o=0;o<t;o++)a(e,r[o])&&(i=Math.max(i,n[r[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(r.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:r,eventPositions:n,maxColumn:1}):(r.forEach(e=>{if(n[e.id].column<o){let t=1;for(;t+n[e.id].column<=o&&!r.some(r=>n[r.id].column===n[e.id].column+t&&a(e,r));)t++;n[e.id].span=t}}),{sortedEvents:r,eventPositions:n,maxColumn:o+1})})(o,e);return t.jsxs("div",{className:"relative",onDoubleClick:()=>(e=>{l||c.weekView.enableDoubleClickToShiftViewToDaily&&(d(e),u("day"))})(e),children:[t.jsx("div",{className:"sticky top-0 z-30 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:c.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:"text-sm "+(L(e,new Date)?"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto":""),children:Te(e,"d")})]})}),t.jsxs("div",{className:"relative h-[calc(100%-3rem)]",children:[D.map((e,r)=>t.jsx("div",{className:Br("h-16",0!==r&&"border-t border-border",r===D.length-1&&"border-b border-border")},e)),a.map((r,o)=>{const{top:a,height:l}=((e,t)=>{const r=qe(`${Te(e.startDate,"yyyy-MM-dd")}T${e.startTime}`),n=qe(`${Te(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),o=E(t),a=H(t);let i,s;e.isRepeating?(i=Je(Qe(t,r.getHours()),r.getMinutes()),s=Je(Qe(t,n.getHours()),n.getMinutes())):(i=R([r,o]),s=F([n,a]));const l=i.getHours()+i.getMinutes()/60;return{top:64*l,height:64*(s.getHours()+s.getMinutes()/60-l)}})(r,e),{column:d,span:u}=i[r.id],v=u/s*100,y=d/s*100,g=((e,t)=>{var r,n,o,a,i,s;if(!e.isRepeating){if(e.endDate&&!L(e.startDate,e.endDate)){const r=Math.floor(I(H(e.endDate),E(e.startDate)))+1;return`Day ${Math.floor(I(E(t),E(e.startDate)))+1} of ${r}`}return null}switch(e.isRepeatingInterval||"daily"){case"daily":{const a=Math.floor(I(qe(`${Te(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),qe(`${Te(e.startDate,"yyyy-MM-dd")}T${e.startTime}`)))+1,i=W({start:E(e.startDate),end:E(e.endDate||e.startDate)}),s=a-((null==(r=e.isRepeatingExcludedDates)?void 0:r.filter(e=>i.some(t=>L(t,e))).length)||0),l=W({start:E(e.startDate),end:E(t)}),d=(null==(n=e.isRepeatingExcludedDates)?void 0:n.filter(e=>l.some(t=>L(t,e))).length)||0,u=Math.floor(I(E(t),E(e.startDate)))+1-d;return`${null==(o=c.localization)?void 0:o.repeatDaily} ${u} of ${s}`}case"weekly":{const e=ze(t),r=null==(a=c.localization)?void 0:a.dayNames[e];return`${null==(i=c.localization)?void 0:i.repeatWeekly} ${r}`}case"monthly":return`${null==(s=c.localization)?void 0:s.repeatMonthly} ${Te(t,"do")}`;default:return null}})(r,e),x=L(r.startDate,e),b=r.endDate&&L(r.endDate,e);return t.jsx(_E,{event:r,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,onOpenChange:m,dateFromViewClick:e,translations:c.localization,children:t.jsxs(qd.div,{className:Br(gT(r.color),"absolute px-1 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40",r.isRepeating&&"border border-dashed border-opacity-50",x&&"border-l-1 border-l-black/70 dark:border-l-white/30",b&&"border-r-1 border-r-black/70 dark:border-r-white/30"),style:{top:`${a}px`,height:`${Math.max(l,24)}px`,left:`${y}%`,width:`${v}%`,zIndex:o+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*o},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:r.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs",children:[vT(r.startTime,n)," - ",vT(r.endTime,n)]}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${r.id}-${e.toISOString()}`)}),v&&x&&Array.from({length:10}).map((e,r)=>t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r))]}),r<M.length-1&&t.jsx("div",{className:"absolute top-12 right-0 w-px h-[calc(100%-3rem)] bg-border"})]},e.toString())}),t.jsx("div",{className:"absolute top-0 right-0 w-px h-full bg-border"})]})})]}),!(null!=(b=c.weekView)&&b.hideHoverLine)&&t.jsx("div",{ref:o,className:"absolute left-[12.5%] right-0 h-px bg-primary z-50 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:a,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),M.some(e=>L(e,new Date))&&!(null!=(k=c.weekView)&&k.hideTimeline)&&t.jsxs("div",{ref:y,className:"absolute left-[12.5%] right-0 h-px bg-red-500 z-40 pointer-events-none",style:{top:`${g+48}px`},children:[t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Te(new Date,"HH:mm")}),M.map((e,r)=>L(e,new Date)&&t.jsx("div",{className:"absolute h-4 w-[1px] bg-red-500 transform -translate-y-1/2 opacity-75",style:{left:100/7*r+"%",boxShadow:"0 0 4px rgba(239, 68, 68, 0.5)"}},e.toString()))]})]})})]})},CT=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:l,isLoading:c,setCurrentDate:d,setCurrentView:u,isAddEventPopupOpen:p,setIsAddEventPopupOpen:h,onDateRangeChange:f})=>{var m;const v=O(r,{weekStartsOn:o?1:0}),y=W({start:v,end:K(r,{weekStartsOn:o?1:0})}),g=le(v,{weekStartsOn:o?1:0}),x=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>{const r=s.findIndex(t=>t.value===e),n=s.findIndex(e=>e.value===t);return r-n}),b=(e,t)=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Ve(t,{start:E(e.startDate),end:H(e.endDate)}):L(e.startDate,t),k=e=>{p||n.weekView.enableDoubleClickToShiftViewToDaily&&(d(e),u("day"))},_=(null==(m=n.weekView)?void 0:m.resourceDisplayMode)||"row",w=(e,r,s)=>{const c=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,r),d=((e,t)=>{if(!e.isRepeating)return Br("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return Br("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,c),u=e.isRepeating||"single"===c||"start"===c&&!e.isRepeating||"end"===c&&!e.isRepeating;return t.jsx(_E,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:l,onOpenChange:h,dateFromViewClick:r,translations:n.localization,children:t.jsxs(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1*s},className:Br(gT(e.color),"mb-1 last:mb-0 px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-50 dark:hover:bg-opacity-60","flex items-center justify-between gap-1",d),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1 text-xs",children:e.title||n.localization.untitledEvent}),u&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==c?vT(e.startTime,o):`ends ${vT(e.endTime,o)}`})]})},e.id)},M=(e,r,s)=>e.length<=3?t.jsx(_E,{event:{startDate:r,endDate:r,color:s},onAddEvent:e=>a({...e}),onOpenChange:h,translations:n.localization,children:t.jsxs(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"group",children:[t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 md:hidden",children:"+"}),t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 hidden md:block opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:["+ ",n.localization.addEvent]})]})}):t.jsx(kT,{events:e,addEvent:a,updateEvent:i,onDelete:l,date:r,is24HourFormat:o,getEventColor:gT,preSelectedColor:s,translations:n.localization,children:t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",e.length-3," ",n.localization.more]})})});return t.jsx(CE,{className:"h-full flex flex-col overflow-hidden",children:t.jsxs(fT,{className:"flex-1 h-[calc(100vh-200px)]",children:[t.jsx("div",{className:"min-w-[768px] relative",children:t.jsx("div",{className:"relative",children:"row"===_?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid grid-cols-8 gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),y.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",onDoubleClick:()=>k(e),children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:n.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:Br("text-sm",L(e,new Date)&&"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto"),children:Te(e,"d")})]})},e.toString()))]}),x.map(r=>{const n=s.find(e=>e.value===r);return t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex items-center justify-center h-[125px]",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:Br("w-4 h-4 md:w-5 md:h-5 rounded-full flex-shrink-0",null==n?void 0:n.class)}),t.jsx("span",{className:"text-xs md:text-sm font-medium truncate max-w-[60px]",children:null==n?void 0:n.label})]})}),y.map(n=>{const o=e.filter(e=>e.color===r&&b(e,n));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>k(n),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>w(e,n,t))}),t.jsx("div",{className:"mt-auto",children:M(o,n,r)})]}),c&&f&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r}-${n.toString()}`)})]},r)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid gap-0",style:{gridTemplateColumns:`90px repeat(${x.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),x.map(e=>{const r=s.find(t=>t.value===e);return t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.jsx("div",{className:Br("w-4 h-4 rounded-full",null==r?void 0:r.class)}),t.jsx("div",{className:"text-xs font-medium mt-1 truncate max-w-[90px] text-center",children:null==r?void 0:r.label})]})},e)})]}),y.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${x.length}, minmax(120px, 1fr))`},children:[t.jsxs("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex flex-col items-center justify-center h-[125px]",onDoubleClick:()=>k(r),children:[t.jsx("div",{className:"font-semibold text-sm",children:n.localization.dayNames[r.getDay()].slice(0,3)}),t.jsx("div",{className:Br("text-base w-7 h-7 flex items-center justify-center",L(r,new Date)&&"bg-primary text-primary-foreground rounded-full"),children:Te(r,"d")})]}),x.map(n=>{const o=e.filter(e=>e.color===n&&b(e,r));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>k(r),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>w(e,r,t))}),t.jsx("div",{className:"mt-auto",children:M(o,r,n)})]}),c&&f&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.toString()}-${n}`)})]},r.toString()))]})})}),t.jsx(mT,{orientation:"horizontal"})]})})},DT=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:d,setCurrentView:u,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b;const k={filteredEvents:e,currentDate:r,currentConfig:c,is24HourFormat:n,onEventAdd:f,onEventUpdate:p,onEventDelete:h,isLoading:v,isAddEventPopupOpen:l,setIsAddEventPopupOpen:m,setCurrentDate:d,setCurrentView:u,onDateRangeChange:x};return t.jsx(t.Fragment,{children:"resource"===(null==(b=c.weekView)?void 0:b.viewType)?t.jsx(CT,{...k}):t.jsx(MT,{...k,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,currentTimeLineRef:y,currentTimeTop:g})})},jT=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:d,onEventAdd:u,isLoading:p,onDateRangeChange:h})=>{var f;const m=U(r),v=$(r),y=null==(f=n.monthView)?void 0:f.showOnlyCurrentMonth,g=ze(m),x=new Date,b=n.localization.dayNames;let k,_;if(y)k=W({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=o?1:0;k=W({start:O(m,{weekStartsOn:e}),end:K(v,{weekStartsOn:e})}),_=o?[...b.slice(1),b[0]]:b}return t.jsx(CE,{className:"p-2 sm:p-4",children:t.jsx(fT,{children:t.jsxs("div",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:[_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm",children:e},e)),k.map(f=>{const m=Le(f,r);if(y&&!m)return t.jsx("div",{},f.toString());const v=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,f)))&&NS(f,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):L(e.startDate,f)||e.endDate&&Ve(f,{start:e.startDate,end:e.endDate})),g=((e,t)=>e.reduce((e,r)=>{const n="00:00"===r.startTime&&"23:59"===r.endTime,o=r.endDate&&!L(r.startDate,r.endDate);if(r.isRepeating){if(r.isRepeatingExcludedDates&&r.isRepeatingExcludedDates.some(e=>L(e,t)))return e;if(NS(t,r.startDate,r.endDate||r.startDate,r.isRepeatingInterval||"daily")){let o;o="weekly"===r.isRepeatingInterval||"monthly"===r.isRepeatingInterval||L(r.startDate,t)?"start":r.endDate&&L(r.endDate,t)?"end":"middle",n?e.repeatingFullDayEvents.push({...r,position:o}):e.regularEvents.push({...r,position:o})}}else if(o){let n;L(r.startDate,t)?n="start":L(r.endDate,t)?n="end":Ve(t,{start:r.startDate,end:r.endDate})&&(n="middle"),n&&e.multiDayEvents.push({...r,position:n})}else n?e.fullDayEvents.push(r):e.regularEvents.push(r);return e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(v,f),b=[...g.repeatingFullDayEvents,...g.multiDayEvents,...g.fullDayEvents],k=g.regularEvents,_=L(f,x);let w=[],M=0;return b.length>0?(w.push(b[0]),M=b.length-1+k.length):k.length>0&&(w.push(k[0]),M=k.length-1),M>0?w=w.slice(0,1):k.length>1&&w.length<2&&w.push(k[1]),t.jsxs("div",{className:Br("p-1 sm:p-2 h-[80px] sm:h-[130px] border rounded relative group flex flex-col",!m&&!y&&"bg-muted/50"),onDoubleClick:()=>(e=>{i||n.monthView.enableDoubleClickToShiftViewToWeekly&&(s(e),l("week"))})(f),children:[t.jsx("div",{className:Br("font-semibold mb-1 w-5 h-5 sm:w-6 sm:h-6 flex items-center justify-center text-xs sm:text-sm",_&&"bg-primary text-primary-foreground rounded-full"),children:Te(f,"d")}),t.jsxs("div",{className:"flex-grow overflow-hidden",children:[p&&h&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),w.map((e,r)=>((e,r,i)=>{const s="position"in e,l=s&&"start"===e.position,p=s&&"end"===e.position,h=s&&"middle"===e.position;return t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*r},children:t.jsx(_E,{event:e,onAddEvent:u,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:i,onOpenChange:a,translations:n.localization,children:t.jsxs("div",{className:Br(gT(e.color),"p-1 text-[8px] h-10 sm:text-xs rounded mb-1 cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return Br(l&&"border-l-4 border-l-black/70 dark:border-l-white/50",p&&"border-r-4 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");switch(e.isRepeatingInterval){case"daily":return Br("border border-dashed border-opacity-50",l&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",p&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),!s&&t.jsxs("div",{className:"hidden sm:block truncate",children:[vT(e.startTime,o)," - ",vT(e.endTime,o)]}),s&&!e.isRepeating&&t.jsx("div",{className:"hidden sm:block truncate",children:e.description&&t.jsx("div",{className:"truncate",children:e.description})}),e.isRepeating&&t.jsxs("div",{className:"hidden sm:block truncate",children:[vT(e.startTime,o)," - ",vT(e.endTime,o)]})]})})},`${e.id}-${r}`)})(e,r,f)),0===v.length&&t.jsx(_E,{translations:n.localization,onOpenChange:a,onAddEvent:u,event:{startDate:f,endDate:f},onDeleteEvent:d,children:t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-1/2 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground transition-opacity truncate px-0.5 sm:px-2 sm:opacity-0 sm:group-hover:opacity-100",children:t.jsx("span",{className:"hidden sm:inline ml-1",children:n.localization.addEvent})})})]}),M>0&&t.jsx(kT,{translations:n.localization,events:v,date:f,addEvent:u,updateEvent:c,onDelete:d,is24HourFormat:o,getEventColor:gT,onOpenChange:a,children:t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 truncate px-0.5 sm:px-2 h-5 sm:h-8",children:[t.jsxs("span",{children:["+",M]}),t.jsxs("span",{className:"hidden sm:inline",children:[" ",n.localization.more]})]})})}),1===v.length&&t.jsx(_E,{translations:n.localization,onOpenChange:a,onAddEvent:u,event:{startDate:f},onDeleteEvent:d,children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity truncate px-0.5 sm:px-2 ",children:[t.jsx("span",{className:"font-bold",children:"+"}),t.jsx("span",{className:"hidden sm:inline",children:n.localization.addEvent})]})})]},f.toString())})]})})})},OT=({filteredEvents:e,onEventUpdate:r,onEventDelete:n,onEventAdd:o,isLoading:a,currentDate:i,currentConfig:s,is24HourFormat:l,isAddEventPopupOpen:c,setCurrentDate:d,setCurrentView:u,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{var f;const m=U(i),v=$(i),y=null==(f=s.monthView)?void 0:f.showOnlyCurrentMonth,g=ze(m),x=new Date,b=s.localization.dayNames;let k,_;if(y)k=W({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=l?1:0,t=O(m,{weekStartsOn:e}),r=K(v,{weekStartsOn:e});k=W({start:t,end:r}),_=l?[...b.slice(1),b[0]]:b}const w=Math.ceil(k.length/7);return t.jsx(CE,{className:"p-2 sm:p-4",children:t.jsx(fT,{children:t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"grid grid-cols-7 border-b",children:_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm p-2",children:e},e))}),Array.from({length:w}).map((f,m)=>{const v=k.slice(7*m,7*(m+1));return t.jsx("div",{className:"grid grid-cols-7",children:v.map((f,m)=>{const v=L(f,x),g=Le(f,i),b=(t=>e.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=E(e.startDate),n=H(e.endDate||e.startDate);return Ve(t,{start:r,end:n})}).sort((e,t)=>new Date(e.startDate).getTime()+(e.startTime?36e5*parseFloat(e.startTime.replace(":",".")):0)-(new Date(t.startDate).getTime()+(t.startTime?36e5*parseFloat(t.startTime.replace(":",".")):0))))(f);return y&&!g?t.jsx("div",{},f.toString()):t.jsxs("div",{className:Br("group min-h-[145px] border-b border-r p-1 relative","transition-colors duration-200",!g&&"bg-muted/50",0===m&&"border-l"),onDoubleClick:()=>(e=>{c||s.monthView.enableDoubleClickToShiftViewToWeekly&&(d(e),u("week"))})(f),children:[a&&h&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:Br("font-semibold w-6 h-6 flex items-center justify-center text-xs sm:text-sm rounded-full",v&&"bg-primary text-primary-foreground"),children:Te(f,"d")}),t.jsx(_E,{translations:s.localization,onOpenChange:p,onAddEvent:o,event:{startDate:f,endDate:f},dateFromViewClick:f,onDeleteEvent:n,children:t.jsx(Ir,{variant:"ghost",size:"sm",className:"h-6 text-xs text-muted-foreground px-2 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:t.jsx("span",{className:"ml-1 hidden sm:inline",children:s.localization.addEvent})})})]}),t.jsxs("div",{className:"space-y-1 mt-1 overflow-y-auto",children:[b.slice(0,b.length>4?3:4).map((e,a)=>{const i=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,f),c=((e,t)=>{if(!e.isRepeating)return Br("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return Br("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,i),d=e.isRepeating||"single"===i||"start"===i&&!e.isRepeating||"end"===i&&!e.isRepeating;return t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*a},children:t.jsx(_E,{translations:s.localization,onAddEvent:o,onUpdateEvent:r,event:e,dateFromViewClick:f,onDeleteEvent:n,onOpenChange:p,children:t.jsxs("div",{className:Br(gT(e.color),"text-xs p-1 min-h-[24px] rounded cursor-pointer","hover:opacity-80 transition-opacity","flex items-center justify-between gap-1",c),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:e.title}),d&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==i?vT(e.startTime,l):`ends ${vT(e.endTime,l)}`})]})})},`${e.id}-${a}`)}),b.length>4&&t.jsx(kT,{translations:s.localization,events:b,date:f,addEvent:o,updateEvent:r,onDelete:n,is24HourFormat:l,getEventColor:gT,onOpenChange:p,children:t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",b.length-3," ",s.localization.more]})})})]})]},f.toString())})},m)})]})})})},ST=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:d,onEventAdd:u,isLoading:p,onDateRangeChange:h})=>{var f;return t.jsx(t.Fragment,{children:"detailed"===(null==(f=n.monthView)?void 0:f.viewType)?t.jsx(OT,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:u,onEventUpdate:c,onEventDelete:d,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h}):t.jsx(jT,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:u,onEventUpdate:c,onEventDelete:d,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h})})},PT=({currentConfig:e,currentDate:r,filteredEvents:n,isAddEventPopupOpen:o,setCurrentDate:a,setCurrentView:i,is24HourFormat:s,isLoading:l,onEventAdd:c,onEventUpdate:d,onEventDelete:u,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{const f=function(e){const t=g(e.start),r=g(e.end);let n=+t>+r;const o=n?+t:+r,a=n?r:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=o;)i.push(g(a)),a.setMonth(a.getMonth()+1);return n?i.reverse():i}({start:Z(r),end:Y(r)}),m=s?1:0,v=s?e.localization.dayNames.slice(1).concat(e.localization.dayNames[0]):e.localization.dayNames;return t.jsx(CE,{className:"p-4",children:t.jsx(fT,{children:t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[l&&h&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),f.map(r=>{const l=U(r),h=W({start:l,end:$(r)}),f=(ze(l)-m+7)%7;return t.jsxs("div",{className:"border rounded p-2",onDoubleClick:()=>(t=>{o||e.yearView.enableDoubleClickToShiftViewToMonthly&&(a(t),i("month"))})(r),children:[t.jsx("h3",{className:"text-lg font-semibold mb-2 text-center",children:e.localization.monthNames[r.getMonth()]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[v.map((e,n)=>t.jsxs("div",{className:"text-center text-xs text-muted-foreground",children:[t.jsx("span",{className:"hidden sm:inline",children:e}),t.jsx("span",{className:"sm:hidden",children:e.charAt(0)})]},`${r.toString()}-${e}-${n}`)),Array.from({length:f}).map((e,r)=>t.jsx("div",{className:"h-6 w-6"},`empty-start-${r}`)),h.map(r=>{const o=(e=>n.filter(t=>{if(t.isRepeating)return(!t.isRepeatingExcludedDates||!t.isRepeatingExcludedDates.some(t=>L(t,e)))&&NS(e,t.startDate,t.endDate||t.startDate,t.isRepeatingInterval||"daily");const r=E(t.startDate),n=H(t.endDate||t.startDate);return Ve(e,{start:r,end:n})}).map(e=>gT(e.color)))(r),a=L(r,new Date),i=n.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,r)))&&NS(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const t=E(e.startDate),n=H(e.endDate||e.startDate);return Ve(r,{start:t,end:n})});return t.jsx(kT,{events:i,addEvent:c,updateEvent:d,onDelete:u,onOpenChange:p,date:r,is24HourFormat:s,getEventColor:gT,translations:e.localization,children:t.jsx("div",{className:Br("h-6 w-6 flex items-center justify-center text-xs cursor-pointer","text-foreground"),children:t.jsxs("div",{className:Br("h-5 w-5 flex items-center justify-center rounded-full relative","transition-all duration-200 ease-in-out",a&&"bg-accent text-accent-foreground",o.length>0?"hover:scale-150 hover:z-10":"hover:bg-gray-200 dark:hover:bg-gray-700"),children:[o.length>0?t.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",children:o.map((e,n)=>t.jsx("div",{className:`absolute inset-0 ${e}`,style:{backgroundColor:e.split(" ")[1],clipPath:`polygon(${n*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 100%, ${n*(100/o.length)}% 100%)`}},`${r.toString()}-${n}`))}):t.jsx("div",{className:"absolute inset-0 rounded-full transition-opacity opacity-0 hover:opacity-100 bg-gray-200 dark:bg-gray-700"}),t.jsx("time",{dateTime:Te(r,"yyyy-MM-dd"),className:"relative z-10",children:Te(r,"d")})]})})},r.toString())})]})]},r.toString())})]})})})},ET=({filteredEvents:e,currentView:r,currentDate:n,listSearchTerm:o,setListSearchTerm:a,currentConfig:i,onEventUpdate:s,onEventDelete:l,onEventAdd:c,is24HourFormat:d,isLoading:u})=>{let p,h;switch(r){case"day":default:p=E(n),h=H(n);break;case"week":p=O(n),h=K(n);break;case"month":p=U(n),h=$(n);break;case"year":p=Z(n),h=Y(n)}const f=e.filter(e=>{if(e.isRepeating){const t=()=>W({start:p,end:h}).some(t=>(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"));return"day"===r?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,n)))&&NS(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):t()}if("day"===r){const t=E(e.startDate),r=H(e.endDate||e.startDate);return Ve(n,{start:t,end:r})}return Ve(e.startDate,{start:p,end:h})||e.endDate&&Ve(e.endDate,{start:p,end:h})}).filter(e=>e.title.toLowerCase().includes(o.toLowerCase())||e.description&&e.description.toLowerCase().includes(o.toLowerCase())).sort((e,t)=>function(e,t){const r=g(e),n=g(t),o=r.getTime()-n.getTime();return o<0?-1:o>0?1:o}(e.startDate,t.startDate));return t.jsxs(CE,{className:"p-4",children:[t.jsx(qd.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},className:"mb-4",children:t.jsxs("div",{className:"relative",children:[t.jsx(tn,{initial:!1,mode:"wait",children:o?t.jsx(qd.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.6rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(Ir,{variant:"ghost",size:"icon",className:"h-5 w-5 p-0",onClick:()=>a(""),children:t.jsx(zt,{className:"h-4 w-4 text-muted-foreground"})})},"clearButton"):t.jsx(qd.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.75rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(Tt,{className:"h-4 w-4 text-muted-foreground"})},"searchIcon")}),t.jsx(r_,{type:"text",placeholder:i.localization.searchEvents,value:o,onChange:e=>a(e.target.value),className:"pl-10 pr-4 py-2 w-full"})]})}),t.jsxs(fT,{className:"h-[600px]",children:[t.jsx(tn,{initial:!0,children:f.map(e=>{const{dateInfo:r,isMultiDay:o,isOutOfRange:a,isRepeating:u}=(e=>{const t=E(e.startDate),r=H(e.endDate||e.startDate),n=!L(t,r),o=t<p||r>h,a=e.isRepeating;let s="";if(a&&(e.isRepeatingInterval,1)){const t=`${vT(e.startTime,d)} - ${vT(e.endTime,d)}`,r=Te(e.startDate,"MMM d"),n=Te(e.endDate||e.startDate,"MMM d, yyyy"),o=Te(e.startDate,"EEEE"),a=Te(e.startDate,"do");switch(e.isRepeatingInterval||"daily"){case"daily":s=i.localization.repeatDailyDescription.replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"weekly":s=i.localization.repeatWeeklyDescription.replace("{dayName}",o).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"monthly":s=i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",a).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n)}}else s=`${Te(t,"MMM d")}`,n&&(s+=` - ${Te(r,"MMM d")}`);return{dateInfo:s,isMultiDay:n,isOutOfRange:o,isRepeating:a}})(e);return t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsx(_E,{event:e,onAddEvent:c,onUpdateEvent:s,onDeleteEvent:l,dateFromViewClick:n,translations:i.localization,children:t.jsxs("div",{className:Br("p-2 rounded-lg cursor-pointer mb-2",gT(e.color),"hover:opacity-80 transition-opacity",e.isRepeating&&"border border-dashed border-opacity-50"),children:[t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"font-semibold",children:r}),t.jsxs("div",{className:"flex items-center space-x-2",children:[u&&t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{children:t.jsx(Et,{className:"h-4 w-4"})}),t.jsx(Xy,{children:t.jsx("p",{children:i.localization.repeatingEvent})})]})}),o&&!u&&t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{children:t.jsx(ft,{className:"h-4 w-4"})}),t.jsx(Xy,{children:t.jsx("p",{children:i.localization.multiDayEvent})})]})}),a&&t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{children:t.jsx(ct,{className:"h-4 w-4"})}),t.jsx(Xy,{children:t.jsx("p",{children:i.localization.extendsOutOfRange})})]})}),t.jsxs("span",{children:[vT(e.startTime,d)," - ",vT(e.endTime,d)]})]})]}),t.jsx("h3",{className:"text-lg font-bold mt-2",children:e.title||"Untitled Event"}),e.description&&t.jsx("p",{className:"mt-1 text-sm",children:e.description})]})})},e.id)})}),!u&&0===f.length&&t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-8",children:o?i.localization.noEvents:`${i.localization.noEvents} ${i.localization[r]}`})]})]})},TT=({currentView:e,isListView:n,animationDirection:o,currentDate:a,filteredEvents:i,listSearchTerm:s,setListSearchTerm:l,currentConfig:c,onEventUpdate:d,onEventDelete:u,isLoading:p,onEventAdd:h,is24HourFormat:f,setCurrentDate:m,setCurrentView:v,onDateRangeChange:y})=>{const[g,x]=r.useState(!1),[b,k]=r.useState(null),_=r.useRef(null),w=r.useRef(null),M=r.useRef(null),C=(()=>{const[e,t]=r.useState(0);return r.useEffect(()=>{const e=()=>{const e=new Date,r=(60*e.getHours()+e.getMinutes())*(16/15);t(r)};e();const r=setInterval(e,6e4);return()=>clearInterval(r)},[]),e})();ME({currentView:e,currentDate:a,onDateRangeChange:y,is24HourFormat:f});const D={filteredEvents:i,currentDate:a,currentConfig:c,onEventUpdate:d,onEventDelete:u,onEventAdd:h,is24HourFormat:f,isLoading:p},j={isAddEventPopupOpen:g,setIsAddEventPopupOpen:x,onDateRangeChange:y},O={hoverLineRef:_,hoverTimeRef:w},S={clickedTime:b,setClickedTime:k},P={currentTimeLineRef:M,currentTimeTop:C},E={setCurrentDate:m,setCurrentView:v};return t.jsx(tn,{mode:"wait",children:t.jsx(qd.div,{initial:{opacity:0,y:"up"===o?-20:"down"===o?20:0},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:"up"===o?20:"down"===o?-20:0},transition:{duration:.1},className:"h-full",children:n?t.jsx(ET,{...D,currentView:e,listSearchTerm:s,setListSearchTerm:l}):t.jsxs(t.Fragment,{children:["day"===e&&t.jsx(wT,{...D,...j,...O,...S,...P}),"week"===e&&t.jsx(DT,{...D,...j,...O,...S,...P,...E}),"month"===e&&t.jsx(ST,{...D,...j,...E}),"year"===e&&t.jsx(PT,{...D,...j,...E})]})},`${e}-${a.toISOString()}`)})},NT={language:"enUS",today:"Today",thisWeek:"This Week",thisMonth:"This Month",thisYear:"This Year",dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],viewBy:"View by",day:"Day",week:"Week",month:"Month",year:"Year",list:"List",addEvent:"Add Event",editEvent:"Edit Event",deleteEvent:"Delete Event",eventTitle:"Event Title",eventDescription:"Description",eventColor:"Event Color",eventDate:"Date",eventStartTime:"Start Time",eventEndTime:"End Time",eventEndDate:"End Date",eventIsRepeating:"Repeating Event",eventAdded:"Event added",eventUpdated:"Event updated",eventDeleted:"Event deleted",eventRestored:"Event restored",eventUpdateUndone:"Event update undone",failedToAddEvent:"Failed to add event",failedToUpdateEvent:"Failed to update event",failedToDeleteEvent:"Failed to delete event",failedToFetchEvents:"Failed to fetch events",errorCannotExcludeAllDates:"Cannot exclude all dates in the range",save:"Save",saving:"Saving",cancel:"Cancel",delete:"Delete",deleting:"Deleting",undo:"Undo",tryAgain:"Try again",close:"Close",search:"Search",searchEvents:"Search events...",noEvents:"No events",allDay:"All Day",fullDayEvents:"Full-Day Events",loadingEvents:"Loading events...",filterByColor:"Filter by Color",filter:"Filter",filtering:"Filtering",more:"more",use24HourFormat:"Use 24-hour format",repeatingEvent:"Repeating event",multiDayEvent:"Multi-day event",extendsOutOfRange:"Extends beyond current view",displayCalendar:"Display Calendar",displayList:"Display List",dayXofY:"Day {x} of {y}",repeatXofY:"#{x} of {y}",starts:"Starts",ends:"Ends",untitledEvent:"Untitled Event",repeatDaily:"Daily",repeatWeekly:"Weekly",repeatMonthly:"Monthly",repeatingEventQuestion:"Repeating Event?",repeatDailyDescription:"Repeats daily at {timeRange} from {startDate} to {endDate}",repeatWeeklyDescription:"Repeats every {dayName} at {timeRange} from {startDate} to {endDate}",repeatMonthlyDescription:"Repeats on the {dayOfMonth} of each month at {timeRange} from {startDate} to {endDate}",withExcludedDates:"with {count} excluded date{s}",excludedDates:"Excluded Dates?",excludedDatesDescription:"Select dates to exclude from the recurring pattern",skipDays:"Skip Days:",clearAll:"Clear All",selectDatesToExclude:"Select dates to exclude",selectAll:"Select All",noMatchingDates:"No dates match this repeat pattern",noSearchResults:'No matches found for "{query}"',searchMonthPlaceholder:"Search month...",ofExcluded:"{count} of {total} excluded",pageCount:"{current}/{total}",weeklyIntervalLabel:"{dayName}s ({startDate} - {endDate})",monthlyIntervalLabel:"{dayOfMonth} of each month ({startDate} - {endDate})",dateButtonFormat:"MMM d",editEventDescription:"Edit your event details.",createEventDescription:"Create a new event in your calendar.",timePresetAllDay:"All Day",timePresetEarlyMorning:"Early Morning",timePresetMorning:"Morning",timePresetLunch:"Lunch",timePresetEarlyAfternoon:"Early Afternoon",timePresetLateAfternoon:"Late Afternoon",timePresetEvening:"Evening",timePresetNight:"Night",selectDate:"Pick a date",selectColor:"Select a color",confirmDelete:"Are you sure?",confirmDeleteDescription:"Do you want to delete this event?",repeatEventDeleteTitle:"Delete Repeating Event",repeatEventDeleteDescription:"This is a repeating event. What would you like to delete?",deleteThisOccurrence:"Delete only this occurrence",deleteThisAndFuture:"Delete this and all future occurrences",deleteAllOccurrences:"Delete all occurrences",deleteThisOccurrenceDescription:"Only this specific date will be removed",deleteThisAndFutureDescription:"This and all future dates will be removed",deleteAllOccurrencesDescription:"The entire repeating event will be removed",editRecurringEventTitle:"Edit Recurring Event",editRecurringEventDescription:"This is a recurring event. Would you like to edit all occurrences, just this one, or this and future occurrences?",editThisOccurrence:"Edit this occurrence only",editThisOccurrenceDescription:"Make changes only to this specific event occurrence",editThisAndFuture:"Edit this and future occurrences",editThisAndFutureDescription:"Make changes to this and all future occurrences",editAllOccurrences:"Edit all occurrences",editAllOccurrencesDescription:"Make changes to all occurrences of this event",from:"from",to:"to",pickADate:"Pick a date",errorEndDateBeforeStart:"End date cannot be before start date",selectAColor:"Select a color",validations:{eventNameRequired:"Event name is required",invalidTimeFormat:"Invalid time format",colorRequired:"Color is required",endTimeBeforeStart:"End time can't be before start time"}},zT={defaultView:"month",use24HourFormatByDefault:!0,dayView:{enableDoubleClickToAddEvent:!1,viewType:"regular"},weekView:{enableDoubleClickToShiftViewToDaily:!1,viewType:"regular"},monthView:{enableDoubleClickToShiftViewToWeekly:!1,viewType:"basic"},yearView:{enableDoubleClickToShiftViewToMonthly:!1},localization:{...NT}},AT=({config:e,events:n,isLoading:o=!1,onEventAdd:a,onEventUpdate:i,onEventDelete:l,onDateRangeChange:c})=>{const d={...zT,...e},u=tt({config:{defaultView:d.defaultView||"month",use24HourFormatByDefault:d.use24HourFormatByDefault||!1},translations:d.localization}),[p,h]=r.useState(!1),[f,m]=r.useState(""),[v,g]=r.useState(s.map(e=>e.value)),x=n.filter(e=>v.includes(e.color)),b=(()=>{const[e,t]=r.useState(!1);return r.useEffect(()=>{t("ontouchstart"in window||navigator.maxTouchPoints>0)},[]),e})(),k=y({onSwipedLeft:()=>u.handleNext(),onSwipedRight:()=>u.handlePrevious(),preventScrollOnSwipe:!1,trackMouse:!1,delta:{left:100,right:100},swipeDuration:150,touchEventOptions:{passive:!0},trackTouch:!0}),_={...u,currentConfig:d,onEventAdd:a,onEventDelete:l,isListView:p};return t.jsxs("div",{...b?k:{},children:[t.jsx(wE,{..._,setIsListView:h,selectedColors:v,setSelectedColors:g}),t.jsx(TT,{..._,is24HourFormat:u.use24HourFormat,filteredEvents:x,listSearchTerm:f,setListSearchTerm:m,onEventUpdate:i,isLoading:o,onDateRangeChange:c})]})};function RT({config:e={},initialEvents:t=[],onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i}){var s,l;const[c,d]=r.useState(t),[u,p]=r.useState(!1),h=r.useRef(null),f=r.useRef(null),m=(null==(s=e.calendarConfig)?void 0:s.localization)||NT,v=async(t,r)=>{var o;let a;try{a=n?await n(t):{...t,id:Date.now().toString()+Math.random().toString(36).substring(2,7)},d(e=>[...e,a]),f.current=a,r?v_.success(m.eventRestored):v_.success(m.eventAdded,{action:{label:m.undo,onClick:()=>g(a.id,!0)}})}catch(n){console.error("Error adding event:",n),v_.error(m.failedToAddEvent,!1!==(null==(o=e.events)?void 0:o.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>v(t,r)}}:void 0)}},y=async(t,r)=>{var n;try{o&&await o(t),d(e=>e.map(e=>e.id===t.id?t:e)),r?v_.success(m.eventRestored):v_.success(m.eventUpdated,{action:{label:m.undo,onClick:()=>y(c.find(e=>e.id===t.id),!0)}})}catch(o){console.error("Error updating event:",o),v_.error(m.failedToUpdateEvent,!1!==(null==(n=e.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>y(t,r)}}:void 0)}},g=async(t,r)=>{var n;if(!t)return;const o=r?f.current:c.find(e=>e.id===t);if(o)try{a&&await a(t),d(e=>e.filter(e=>e.id!==t)),r?v_.success(m.eventDeleted):v_.success(m.eventDeleted,{action:{label:m.undo,onClick:()=>v(o,!0)}})}catch(o){console.error("Error deleting event:",o),v_.error(m.failedToDeleteEvent,!1!==(null==(n=e.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>g(t,r)}}:void 0)}else console.error(`Event with id ${t} not found`)},x=function(e,t,n){const o=r.useRef(),a=r.useRef(null),i=r.useCallback(()=>{var e;o.current&&(clearTimeout(o.current),o.current=void 0,null==(e=null==n?void 0:n.onCancel)||e.call(n),a.current&&(a.current(),a.current=null))},[n]);return r.useEffect(()=>()=>i(),[i]),r.useCallback((...r)=>{var s;return t?(i(),null==(s=null==n?void 0:n.onDebounce)||s.call(n),new Promise(n=>{a.current=n,o.current=setTimeout(async()=>{await e(...r),a.current=null,n()},t)})):e(...r)},[e,t,n,i])}(async(t,r)=>{var n;if(!i)return;h.current&&h.current.abort();const o=new AbortController;h.current=o;try{p(!0);const e=await i(t,r,o.signal);h.current===o&&d(t=>[...t,...e])}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)return;console.error("Error fetching events:",o),v_.error(m.failedToFetchEvents,!1!==(null==(n=e.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>x(t,r)}}:void 0)}finally{h.current===o&&(p(!1),h.current=null)}},null==(l=e.events)?void 0:l.debounceTimeOnViewOrDateChange,{onDebounce:()=>{}});return{events:c,isLoading:u,addEvent:v,updateEvent:y,deleteEvent:g,onViewOrDateChange:x}}const FT=[{id:"1",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),7),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),7),title:"All-Day Project Sprint",startTime:"00:00",endTime:"23:59",color:"red",isRepeating:!1},{id:"2",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),title:"International Client Call",startTime:"03:00",endTime:"04:00",color:"green",isRepeating:!1},{id:"3",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),title:"Team Standup",startTime:"05:30",endTime:"06:30",color:"blue",isRepeating:!1},{id:"4",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),12),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),12),title:"Product Development Workshop",startTime:"01:00",endTime:"05:00",color:"purple",isRepeating:!1},{id:"5",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),title:"Investor Presentation",startTime:"06:30",endTime:"08:00",color:"yellow",isRepeating:!1},{id:"6",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),title:"Team Breakfast",startTime:"08:00",endTime:"09:00",color:"green",isRepeating:!1},{id:"7",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),17),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),17),title:"Team Breakfast",startTime:"07:00",endTime:"08:30",color:"blue",isRepeating:!1},{id:"8",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Asia Market Review",startTime:"01:00",endTime:"03:00",color:"green",isRepeating:!1},{id:"9",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Product Roadmap Review",startTime:"04:30",endTime:"06:00",color:"purple",isRepeating:!1},{id:"10",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Team Building Breakfast",startTime:"07:00",endTime:"09:00",color:"yellow",isRepeating:!1},{id:"11",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Early Strategy Meeting",startTime:"02:00",endTime:"04:00",color:"purple",isRepeating:!1},{id:"12",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),title:"Early Bird Workout",startTime:"00:00",endTime:"01:30",color:"blue",isRepeating:!0},{id:"13",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),title:"Meditation Session",startTime:"02:00",endTime:"03:30",color:"blue",isRepeating:!1},{id:"14",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),title:"Code Review",startTime:"04:00",endTime:"05:30",color:"green",isRepeating:!1},{id:"15",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),title:"Breakfast Break",startTime:"06:30",endTime:"07:30",color:"yellow",isRepeating:!1},{id:"16",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Conference Call",startTime:"01:00",endTime:"03:00",color:"green",isRepeating:!1},{id:"17",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Code Review",startTime:"04:30",endTime:"06:00",color:"purple",isRepeating:!1},{id:"18",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Team Building",startTime:"07:00",endTime:"09:00",color:"yellow",isRepeating:!1},{id:"19",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),title:"Product Launch",startTime:"10:00",endTime:"12:00",color:"red",isRepeating:!1},{id:"20",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),title:"Press Conference",startTime:"13:00",endTime:"14:30",color:"blue",isRepeating:!1},{id:"21",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),25),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),25),title:"Training Session",startTime:"14:00",endTime:"17:00",color:"purple",isRepeating:!1},{id:"22",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),title:"Board Meeting",startTime:"15:00",endTime:"17:00",color:"blue",isRepeating:!1},{id:"23",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),title:"Strategy Planning",startTime:"09:00",endTime:"11:30",color:"green",isRepeating:!1},{id:"24",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),title:"Budget Review",startTime:"13:00",endTime:"14:30",color:"red",isRepeating:!1},{id:"25",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),title:"Meeting A",startTime:"10:00",endTime:"11:30",color:"blue",isRepeating:!1},{id:"26",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),title:"Meeting B",startTime:"10:00",endTime:"12:00",color:"green",isRepeating:!1},{id:"27",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),title:"Meeting C",startTime:"10:00",endTime:"13:00",color:"yellow",isRepeating:!1},{id:"28",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),title:"Workshop A",startTime:"14:00",endTime:"16:00",color:"purple",isRepeating:!1},{id:"29",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),title:"Workshop B",startTime:"14:30",endTime:"16:30",color:"red",isRepeating:!1},{id:"30",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),title:"Workshop C",startTime:"15:00",endTime:"17:00",color:"green",isRepeating:!1},{id:"31",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Seminar A",startTime:"09:00",endTime:"12:00",color:"blue",isRepeating:!1},{id:"32",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Seminar B",startTime:"10:00",endTime:"13:00",color:"yellow",isRepeating:!1},{id:"33",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Seminar C",startTime:"11:00",endTime:"14:00",color:"purple",isRepeating:!1},{id:"34",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),title:"Conference A",startTime:"13:00",endTime:"15:00",color:"green",isRepeating:!1},{id:"35",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),title:"Conference B",startTime:"13:00",endTime:"16:00",color:"blue",isRepeating:!1},{id:"36",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),title:"Conference C",startTime:"13:00",endTime:"17:00",color:"red",isRepeating:!1},{id:"37",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),title:"Ads Campaign Nr2",description:"AdSense + FB, Target Audience: SMB2-Delta3",startTime:"00:00",endTime:"01:30",color:"yellow",isRepeating:!1}],LT={defaultView:"month",use24HourFormatByDefault:!0,dayView:{enableDoubleClickToAddEvent:!1,viewType:"regular"},weekView:{enableDoubleClickToShiftViewToDaily:!1,viewType:"regular"},monthView:{enableDoubleClickToShiftViewToWeekly:!1,viewType:"detailed",showOnlyCurrentMonth:!0},yearView:{enableDoubleClickToShiftViewToMonthly:!1}},BT={events:{allowUserRetryAfterFailure:!0}};e.EVENT_COLOR_OPTIONS=s,e.EventCalendar=AT,e.MyEventCalendar=()=>{const{events:e,isLoading:r,addEvent:n,updateEvent:o,deleteEvent:a,onViewOrDateChange:i}=RT({config:BT,initialEvents:FT,onEventAdd:async e=>(await new Promise(e=>setTimeout(e,0)),{...e,id:Date.now().toString()}),onEventUpdate:async e=>(await new Promise(e=>setTimeout(e,0)),e),onEventDelete:async e=>{await new Promise(e=>setTimeout(e,0)),console.log(`Event deleted: ${e}`)},onDateRangeChange:async(e,t,r)=>(await new Promise(e=>setTimeout(e,0)),console.log(`Fetching events between ${e.toISOString()} and ${t.toISOString()}`),[])});return t.jsx(AT,{config:LT,events:e,isLoading:r,onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i})},e.da={language:"da",today:"I dag",thisWeek:"Denne uge",thisMonth:"Denne måned",thisYear:"Dette år",dayNames:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],fullDayNames:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],monthNames:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],viewBy:"Vis efter",day:"Dag",week:"Uge",month:"Måned",year:"År",list:"Liste",addEvent:"Ny begivenhed",editEvent:"Rediger begivenhed",deleteEvent:"Slet begivenhed",eventTitle:"Begivenhedstitel",eventDescription:"Beskrivelse",eventColor:"Farve",eventDate:"Dato",eventStartTime:"Starttidspunkt",eventEndTime:"Sluttidspunkt",eventEndDate:"Slutdato",eventIsRepeating:"Gentaget begivenhed",eventAdded:"Begivenhed tilføjet",eventUpdated:"Begivenhed opdateret",eventDeleted:"Begivenhed slettet",eventRestored:"Begivenhed gendannet",eventUpdateUndone:"Begivenhedsopdatering fortrudt",failedToAddEvent:"Kunne ikke tilføje begivenhed",failedToUpdateEvent:"Kunne ikke opdatere begivenhed",failedToDeleteEvent:"Kunne ikke slette begivenhed",failedToFetchEvents:"Kunne ikke hente begivenheder",errorCannotExcludeAllDates:"Kan ikke udelukke alle datoer i området",save:"Gem",saving:"Gemmer",cancel:"Annuller",delete:"Slet",deleting:"Sletter",undo:"Fortryd",tryAgain:"Prøv igen",close:"Luk",search:"Søg",searchEvents:"Søg i begivenheder...",noEvents:"Ingen begivenheder",allDay:"Hele dagen",fullDayEvents:"Heldagsbegivenheder",loadingEvents:"Indlæser begivenheder...",filterByColor:"Filtrer efter farve",filter:"Filter",filtering:"Filtrerer",more:"mere",use24HourFormat:"Brug 24-timers format",repeatingEvent:"Gentaget begivenhed",multiDayEvent:"Flerdagesbegivenhed",extendsOutOfRange:"Strækker sig ud over den aktuelle visning",displayCalendar:"Vis kalender",displayList:"Vis liste",dayXofY:"Dag {x} af {y}",repeatXofY:"#{x} af {y}",starts:"Starter",ends:"Slutter",untitledEvent:"Unavngiven begivenhed",repeatDaily:"Dagligt",repeatWeekly:"Ugentligt",repeatMonthly:"Månedligt",repeatingEventQuestion:"Gentages begivenhed?",repeatDailyDescription:"Gentages dagligt kl. {timeRange} fra {startDate} til {endDate}",repeatWeeklyDescription:"Gentages hver {dayName} kl. {timeRange} fra {startDate} til {endDate}",repeatMonthlyDescription:"Gentages den {dayOfMonth}. hver måned kl. {timeRange} fra {startDate} til {endDate}",withExcludedDates:"med {count} udelukket dato{s}",excludedDates:"Udelukkede datoer?",excludedDatesDescription:"Vælg datoer, der skal udelukkes fra det tilbagevendende mønster",skipDays:"Spring dage over:",clearAll:"Ryd alle",selectDatesToExclude:"Vælg datoer, der skal udelukkes",selectAll:"Vælg alle",noMatchingDates:"Ingen datoer matcher dette gentagelsesmønster",noSearchResults:'Ingen resultater fundet for "{query}"',searchMonthPlaceholder:"Søg måned...",ofExcluded:"{count} af {total} udelukket",pageCount:"{current}/{total}",weeklyIntervalLabel:"Hver {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Den {dayOfMonth}. hver måned ({startDate} - {endDate})",dateButtonFormat:"d. MMM",editEventDescription:"Rediger dine begivenhedsdetaljer.",createEventDescription:"Opret en ny begivenhed i din kalender.",timePresetAllDay:"Hele dagen",timePresetEarlyMorning:"Tidlig morgen",timePresetMorning:"Morgen",timePresetLunch:"Frokost",timePresetEarlyAfternoon:"Tidlig eftermiddag",timePresetLateAfternoon:"Sen eftermiddag",timePresetEvening:"Aften",timePresetNight:"Nat",selectDate:"Vælg en dato",selectColor:"Vælg en farve",confirmDelete:"Er du sikker?",confirmDeleteDescription:"Vil du slette denne begivenhed?",repeatEventDeleteTitle:"Slet gentaget begivenhed",repeatEventDeleteDescription:"Dette er en gentaget begivenhed. Hvad vil du slette?",deleteThisOccurrence:"Slet kun denne forekomst",deleteThisAndFuture:"Slet denne og alle fremtidige forekomster",deleteAllOccurrences:"Slet alle forekomster",deleteThisOccurrenceDescription:"Kun denne specifikke dato vil blive fjernet",deleteThisAndFutureDescription:"Denne og alle fremtidige datoer vil blive fjernet",deleteAllOccurrencesDescription:"Hele den gentagne begivenhed vil blive fjernet",editRecurringEventTitle:"Rediger gentaget begivenhed",editRecurringEventDescription:"Dette er en gentaget begivenhed. Vil du redigere alle forekomster, kun denne eller denne og fremtidige forekomster?",editThisOccurrence:"Rediger kun denne forekomst",editThisOccurrenceDescription:"Foretag kun ændringer på denne specifikke begivenhedsforekomst",editThisAndFuture:"Rediger denne og fremtidige forekomster",editThisAndFutureDescription:"Foretag ændringer på denne og alle fremtidige forekomster",editAllOccurrences:"Rediger alle forekomster",editAllOccurrencesDescription:"Foretag ændringer på alle forekomster af denne begivenhed",from:"fra",to:"til",pickADate:"Vælg en dato",errorEndDateBeforeStart:"Slutdato kan ikke være før startdato",selectAColor:"Vælg en farve",validations:{eventNameRequired:"Begivenhedsnavn er påkrævet",invalidTimeFormat:"Ugyldigt tidsformat",colorRequired:"Farve er påkrævet",endTimeBeforeStart:"Sluttidspunkt kan ikke være før starttidspunkt"}},e.doesDateMatchRepeatPattern=NS,e.enUS=NT,e.es={language:"es",today:"Hoy",thisWeek:"Esta Semana",thisMonth:"Este Mes",thisYear:"Este Año",dayNames:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],fullDayNames:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],viewBy:"Ver por",day:"Día",week:"Semana",month:"Mes",year:"Año",list:"Lista",addEvent:"+ Evento",editEvent:"Editar Evento",deleteEvent:"Eliminar Evento",eventTitle:"Título del Evento",eventDescription:"Descripción",eventColor:"Color del Evento",eventDate:"Fecha",eventStartTime:"Hora de Inicio",eventEndTime:"Hora de Fin",eventEndDate:"Fecha de Fin",eventIsRepeating:"Evento Recurrente",eventAdded:"Evento agregado",eventUpdated:"Evento actualizado",eventDeleted:"Evento eliminado",eventRestored:"Evento restaurado",eventUpdateUndone:"Cambios en el evento deshechos",failedToAddEvent:"Error al agregar el evento",failedToUpdateEvent:"Error al actualizar el evento",failedToDeleteEvent:"Error al eliminar el evento",failedToFetchEvents:"Error al cargar los eventos",errorCannotExcludeAllDates:"No se pueden excluir todas las fechas en el rango",save:"Guardar",saving:"Guardando",cancel:"Cancelar",delete:"Eliminar",deleting:"Eliminando",undo:"Deshacer",tryAgain:"Intentar de nuevo",close:"Cerrar",search:"Buscar",searchEvents:"Buscar eventos...",noEvents:"No hay eventos",allDay:"Todo el día",fullDayEvents:"Eventos de todo el día",loadingEvents:"Cargando eventos...",filterByColor:"Filtrar por color",filter:"Filtrar",filtering:"Filtrando",more:"más",use24HourFormat:"Usar formato 24 horas",repeatingEvent:"Evento recurrente",multiDayEvent:"Evento de varios días",extendsOutOfRange:"Se extiende más allá de la vista actual",displayCalendar:"Mostrar Calendario",displayList:"Mostrar Lista",dayXofY:"Día {x} de {y}",repeatXofY:"#{x} de {y}",starts:"Comienza",ends:"Termina",untitledEvent:"Evento sin título",repeatDaily:"Diariamente",repeatWeekly:"Semanalmente",repeatMonthly:"Mensualmente",repeatingEventQuestion:"¿Evento repetitivo?",repeatDailyDescription:"Se repite diariamente a las {timeRange} desde el {startDate} hasta el {endDate}",repeatWeeklyDescription:"Se repite cada {dayName} a las {timeRange} desde el {startDate} hasta el {endDate}",repeatMonthlyDescription:"Se repite el {dayOfMonth} de cada mes a las {timeRange} desde el {startDate} hasta el {endDate}",withExcludedDates:"con {count} fecha{s} excluida{s}",excludedDates:"Fechas excluidas?",excludedDatesDescription:"Seleccione fechas para excluir del patrón recurrente",skipDays:"Omitir días:",clearAll:"Borrar todo",selectDatesToExclude:"Seleccionar fechas para excluir",selectAll:"Seleccionar Todo",noMatchingDates:"Ninguna fecha coincide con este patrón de repetición",noSearchResults:'No se encontraron resultados para "{query}"',searchMonthPlaceholder:"Buscar mes...",ofExcluded:"{count} de {total} excluidas",pageCount:"{current}/{total}",weeklyIntervalLabel:"Cada {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"El {dayOfMonth} de cada mes ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Edita los detalles de tu evento.",createEventDescription:"Crea un nuevo evento en tu calendario.",timePresetAllDay:"Todo el día",timePresetEarlyMorning:"Temprano en la mañana",timePresetMorning:"Mañana",timePresetLunch:"Almuerzo",timePresetEarlyAfternoon:"Temprano en la tarde",timePresetLateAfternoon:"Final de la tarde",timePresetEvening:"Noche",timePresetNight:"Madrugada",selectDate:"Seleccionar fecha",selectColor:"Seleccionar color",confirmDelete:"¿Estás seguro?",confirmDeleteDescription:"¿Deseas eliminar este evento?",repeatEventDeleteTitle:"Eliminar Evento Recurrente",repeatEventDeleteDescription:"Este es un evento recurrente. ¿Qué deseas eliminar?",deleteThisOccurrence:"Eliminar solo esta ocurrencia",deleteThisAndFuture:"Eliminar esta y todas las ocurrencias futuras",deleteAllOccurrences:"Eliminar todas las ocurrencias",deleteThisOccurrenceDescription:"Solo se eliminará esta fecha específica",deleteThisAndFutureDescription:"Se eliminarán esta y todas las fechas futuras",deleteAllOccurrencesDescription:"Se eliminará todo el evento recurrente",editRecurringEventTitle:"Editar Evento Recurrente",editRecurringEventDescription:"Este es un evento recurrente. ¿Te gustaría editar todas las ocurrencias, solo esta, o esta y las futuras ocurrencias?",editThisOccurrence:"Editar solo esta ocurrencia",editThisOccurrenceDescription:"Hacer cambios solo a esta ocurrencia específica del evento",editThisAndFuture:"Editar esta y las ocurrencias futuras",editThisAndFutureDescription:"Hacer cambios a esta y todas las ocurrencias futuras",editAllOccurrences:"Editar todas las ocurrencias",editAllOccurrencesDescription:"Hacer cambios a todas las ocurrencias de este evento",from:"desde",to:"hasta",pickADate:"Seleccionar fecha",errorEndDateBeforeStart:"La fecha de fin no puede ser anterior a la fecha de inicio",selectAColor:"Seleccionar color",validations:{eventNameRequired:"El título del evento es obligatorio",invalidTimeFormat:"Formato de hora inválido",colorRequired:"El color es obligatorio",endTimeBeforeStart:"La hora de fin no puede ser anterior a la hora de inicio"}},e.filterEventsByColors=(e,t)=>e.filter(e=>t.includes(e.color)),e.formatEventTime=vT,e.fr={language:"fr",today:"Aujourd'hui",thisWeek:"Cette semaine",thisMonth:"Ce mois",thisYear:"Cette année",dayNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],fullDayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],viewBy:"Afficher par",day:"Jour",week:"Semaine",month:"Mois",year:"Année",list:"Liste",addEvent:"+ Événement",editEvent:"Modifier l'événement",deleteEvent:"Supprimer l'événement",eventTitle:"Titre de l'événement",eventDescription:"Description",eventColor:"Couleur",eventDate:"Date",eventStartTime:"Heure de début",eventEndTime:"Heure de fin",eventEndDate:"Date de fin",eventIsRepeating:"Événement récurrent",eventAdded:"Événement ajouté",eventUpdated:"Événement mis à jour",eventDeleted:"Événement supprimé",eventRestored:"Événement restauré",eventUpdateUndone:"Modification annulée",failedToAddEvent:"Échec de l'ajout",failedToUpdateEvent:"Échec de la mise à jour",failedToDeleteEvent:"Échec de la suppression",failedToFetchEvents:"Échec du chargement des événements",errorCannotExcludeAllDates:"Impossible d'exclure toutes les dates de la plage",save:"Enregistrer",saving:"Enregistrement",cancel:"Annuler",delete:"Supprimer",deleting:"Suppression",undo:"Annuler",tryAgain:"Réessayer",close:"Fermer",search:"Rechercher",searchEvents:"Rechercher des événements...",noEvents:"Aucun événement",allDay:"Toute la journée",fullDayEvents:"Événements journée complète",loadingEvents:"Chargement des événements...",filterByColor:"Filtrer par couleur",filter:"Filtrer",filtering:"Filtrage",more:"plus",use24HourFormat:"Format 24 heures",repeatingEvent:"Événement récurrent",multiDayEvent:"Événement sur plusieurs jours",extendsOutOfRange:"S'étend au-delà de la vue actuelle",displayCalendar:"Afficher le calendrier",displayList:"Afficher la liste",dayXofY:"Jour {x} sur {y}",repeatXofY:"#{x} sur {y}",starts:"Début",ends:"Fin",untitledEvent:"Événement sans titre",repeatDaily:"Quotidien",repeatWeekly:"Hebdomadaire",repeatMonthly:"Mensuel",repeatingEventQuestion:"Événement répétitif ?",repeatDailyDescription:"Se répète quotidiennement à {timeRange} du {startDate} au {endDate}",repeatWeeklyDescription:"Se répète chaque {dayName} à {timeRange} du {startDate} au {endDate}",repeatMonthlyDescription:"Se répète le {dayOfMonth} de chaque mois à {timeRange} du {startDate} au {endDate}",withExcludedDates:"avec {count} date{s} exclue{s}",excludedDates:"Dates exclues?",excludedDatesDescription:"Sélectionnez les dates à exclure du modèle récurrent",skipDays:"Jours à sauter :",clearAll:"Tout effacer",selectDatesToExclude:"Sélectionner des dates à exclure",selectAll:"Tout sélectionner",noMatchingDates:"Aucune date ne correspond à ce modèle de répétition",noSearchResults:'Aucun résultat trouvé pour "{query}"',searchMonthPlaceholder:"Rechercher un mois...",ofExcluded:"{count} sur {total} exclues",pageCount:"{current}/{total}",weeklyIntervalLabel:"Chaque {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Le {dayOfMonth} de chaque mois ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Modifiez les détails de votre événement.",createEventDescription:"Créez un nouvel événement dans votre calendrier.",timePresetAllDay:"Toute la journée",timePresetEarlyMorning:"Tôt le matin",timePresetMorning:"Matin",timePresetLunch:"Déjeuner",timePresetEarlyAfternoon:"Début d'après-midi",timePresetLateAfternoon:"Fin d'après-midi",timePresetEvening:"Soirée",timePresetNight:"Nuit",selectDate:"Choisir une date",selectColor:"Sélectionner une couleur",confirmDelete:"Êtes-vous sûr ?",confirmDeleteDescription:"Voulez-vous supprimer cet événement ?",repeatEventDeleteTitle:"Supprimer un événement récurrent",repeatEventDeleteDescription:"Il s'agit d'un événement récurrent. Que souhaitez-vous supprimer ?",deleteThisOccurrence:"Supprimer uniquement cette occurrence",deleteThisAndFuture:"Supprimer celle-ci et toutes les occurrences futures",deleteAllOccurrences:"Supprimer toutes les occurrences",deleteThisOccurrenceDescription:"Seule cette date spécifique sera supprimée",deleteThisAndFutureDescription:"Cette date et toutes les dates futures seront supprimées",deleteAllOccurrencesDescription:"L'événement récurrent entier sera supprimé",editRecurringEventTitle:"Modifier un événement récurrent",editRecurringEventDescription:"Il s'agit d'un événement récurrent. Souhaitez-vous modifier toutes les occurrences, uniquement celle-ci, ou celle-ci et les occurrences futures ?",editThisOccurrence:"Modifier uniquement cette occurrence",editThisOccurrenceDescription:"Apporter des modifications uniquement à cette occurrence spécifique",editThisAndFuture:"Modifier celle-ci et les occurrences futures",editThisAndFutureDescription:"Apporter des modifications à cette occurrence et à toutes les occurrences futures",editAllOccurrences:"Modifier toutes les occurrences",editAllOccurrencesDescription:"Apporter des modifications à toutes les occurrences de cet événement",from:"de",to:"à",pickADate:"Choisir une date",errorEndDateBeforeStart:"La date de fin ne peut pas être antérieure à la date de début",selectAColor:"Sélectionner une couleur",validations:{eventNameRequired:"Le titre de l'événement est requis",invalidTimeFormat:"Format d'heure invalide",colorRequired:"La couleur est requise",endTimeBeforeStart:"L'heure de fin ne peut pas être antérieure à l'heure de début"}},e.getEventColor=gT,e.l33t={language:"l33t",today:"T0d4y",thisWeek:"D1s W33k",thisMonth:"D1s M0nth",thisYear:"D1s Y34r",dayNames:["5un","M0n","Tu3","W3d","Thu","Fr1","54t"],fullDayNames:["5und4y","M0nd4y","Tu35d4y","W3dn35d4y","Thur5d4y","Fr1d4y","54turd4y"],monthNames:["J4nu4ry","F3bru4ry","M4rch","4pr1l","M4y","Jun3","Ju1y","4ugu5t","53pt3mb3r","0ct0b3r","N0v3mb3r","D3c3mb3r"],viewBy:"V13w By",day:"D4y",week:"W33k",month:"M0nth",year:"Y34r",list:"L15t",addEvent:"4dd 3v3nt",editEvent:"3d1t 3v3nt",deleteEvent:"D3l3t3 3v3nt",eventTitle:"3v3nt T1tl3",eventDescription:"D35cr1pt10n",eventColor:"3v3nt C0l0r",eventDate:"D4t3",eventStartTime:"5t4rt T1m3",eventEndTime:"3nd T1m3",eventEndDate:"3nd D4t3",eventIsRepeating:"R3p34t1ng 3v3nt",eventAdded:"3v3nt 4dd3d",eventUpdated:"3v3nt upd4t3d",eventDeleted:"3v3nt pwn3d",eventRestored:"3v3nt r35t0r3d",eventUpdateUndone:"3v3nt upd4t3 und0n3",failedToAddEvent:"F41l3d 2 4dd 3v3nt",failedToUpdateEvent:"F41l3d 2 upd4t3 3v3nt",failedToDeleteEvent:"F41l3d 2 pwn 3v3nt",failedToFetchEvents:"F41l3d 2 f3tch 3v3nt5",errorCannotExcludeAllDates:"C4nn0t 3xclud3 4ll d4t3z 1n r4ng3",save:"54v3",saving:"S4v1ng",cancel:"C4nc3l",delete:"Pwn",deleting:"D3l3t1ng",undo:"Und0",tryAgain:"Try 4g41n",close:"Cl053",search:"534rch",searchEvents:"534rch 3v3nt5...",noEvents:"N0 3v3nt5",allDay:"4ll D4y",fullDayEvents:"Full-D4y 3v3nt5",loadingEvents:"L04d1ng 3v3nt5...",filterByColor:"F1lt3r by C0l0r",filter:"F1lt3r",filtering:"F1lt3r1ng",more:"m0r3",use24HourFormat:"U53 24-h0ur f0rm4t",repeatingEvent:"R3p34t1ng 3v3nt",multiDayEvent:"Mult1-d4y 3v3nt",extendsOutOfRange:"3xt3nd5 b3y0nd v13w",displayCalendar:"5h0w C4l3nd4r",displayList:"5h0w L15t",dayXofY:"D4y {x} 0f {y}",repeatXofY:"#{x} 0f {y}",starts:"5t4rt5",ends:"3nd5",untitledEvent:"Unt1tl3d 3v3nt",repeatDaily:"D41ly",repeatWeekly:"W33kly",repeatMonthly:"M0n7hly",repeatingEventQuestion:"R3p34t1ng 3v3n7?",repeatDailyDescription:"R3p34tz d41ly 47 {timeRange} fr0m {startDate} 70 {endDate}",repeatWeeklyDescription:"R3p34tz 3v3ry {dayName} 47 {timeRange} fr0m {startDate} 70 {endDate}",repeatMonthlyDescription:"R3p34tz 0n 7h3 {dayOfMonth} 0f 34ch m0n7h 47 {timeRange} fr0m {startDate} 70 {endDate}",withExcludedDates:"w17h {count} 3xclud3d d4t3{s}",excludedDates:"3xclud3d D473z?",excludedDatesDescription:"53l3c7 d473z 2 3xclud3 fr0m r3curr1ng p4773rn",skipDays:"5k1p D4yz:",clearAll:"Cl34r 4ll",selectDatesToExclude:"53l3c7 d473z 2 3xclud3",selectAll:"53l3c7 4ll",noMatchingDates:"N0 d473z m47ch d15 r3p347 p4773rn",noSearchResults:'N0 m47ch3z f0und 4 "{query}"',searchMonthPlaceholder:"534rch m0n7h...",ofExcluded:"{count} 0f {total} 3xclud3d",pageCount:"{current}/{total}",weeklyIntervalLabel:"{dayName}z ({startDate} - {endDate})",monthlyIntervalLabel:"{dayOfMonth} 0f 34ch m0n7h ({startDate} - {endDate})",dateButtonFormat:"MMM d",editEventDescription:"3d1t ur 3v3nt d3t41l5",createEventDescription:"Cr34t3 4 n3w 3v3nt",timePresetAllDay:"4ll D4y",timePresetEarlyMorning:"34rly M0rn1ng",timePresetMorning:"M0rn1ng",timePresetLunch:"Lunch T1m3",timePresetEarlyAfternoon:"34rly 4ft3rn00n",timePresetLateAfternoon:"L4t3 4ft3rn00n",timePresetEvening:"3v3n1ng",timePresetNight:"N1ght",selectDate:"P1ck 4 d4t3",selectColor:"53l3ct 4 c0l0r",confirmDelete:"U 5ur3?",confirmDeleteDescription:"U w4nt 2 pwn d15 3v3nt?",repeatEventDeleteTitle:"D3l3t3 R3p34t1ng 3v3nt",repeatEventDeleteDescription:"D15 15 4 r3p34t1ng 3v3nt. Wh4t U w4nt 2 pwn?",deleteThisOccurrence:"Pwn 0nly d15 0ccurr3nc3",deleteThisAndFuture:"Pwn d15 & 4ll futur3 0ccurr3nc3z",deleteAllOccurrences:"Pwn 4ll 0ccurr3nc3z",deleteThisOccurrenceDescription:"0nly d15 5p3c1f1c d4t3 w1ll b3 r3m0v3d",deleteThisAndFutureDescription:"D15 & 4ll futur3 d4t3z w1ll b3 pwn3d",deleteAllOccurrencesDescription:"D4 3nt1r3 r3p34t1ng 3v3nt w1ll b3 pwn3d",editRecurringEventTitle:"3d1t R3p34t1ng 3v3nt",editRecurringEventDescription:"D15 15 4 r3curr1ng 3v3nt. W0uld U l1k3 2 3d1t 4ll 0ccurr3nc3z, ju5t d15 1, 0r d15 & futur3 0n3z?",editThisOccurrence:"3d1t d15 0ccurr3nc3 0nly",editThisOccurrenceDescription:"M4k3 ch4ng3z 0nly 2 d15 5p3c1f1c 3v3nt 0ccurr3nc3",editThisAndFuture:"3d1t d15 & futur3 0ccurr3nc3z",editThisAndFutureDescription:"M4k3 ch4ng3z 2 d15 & 4ll futur3 0ccurr3nc3z",editAllOccurrences:"3d1t 4ll 0ccurr3nc3z",editAllOccurrencesDescription:"M4k3 ch4ng3z 2 4ll 0ccurr3nc3z 0f d15 3v3nt",from:"fr0m",to:"2",pickADate:"P1ck 4 d4t3",errorEndDateBeforeStart:"3nd d4t3 c4nt b3 b4 5t4rt d4t3",selectAColor:"53l3ct 4 c0l0r",validations:{eventNameRequired:"3v3nt n4m3 r3qu1r3d",invalidTimeFormat:"1nv4l1d t1m3 f0rm4t",colorRequired:"c0l0r r3qu1r3d",endTimeBeforeStart:"3nd t1m3 c4nt b3 b4 5t4rt t1m3"}},e.nbNO={language:"nb",today:"I dag",thisWeek:"Denne uken",thisMonth:"Denne måneden",thisYear:"Dette året",dayNames:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],fullDayNames:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],monthNames:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],viewBy:"Vis etter",day:"Dag",week:"Uke",month:"Måned",year:"År",list:"Liste",addEvent:"Ny hendelse",editEvent:"Rediger hendelse",deleteEvent:"Slett hendelse",eventTitle:"Hendelsestittel",eventDescription:"Beskrivelse",eventColor:"Farge",eventDate:"Dato",eventStartTime:"Starttid",eventEndTime:"Sluttid",eventEndDate:"Sluttdato",eventIsRepeating:"Gjentakende hendelse",eventAdded:"Hendelse lagt til",eventUpdated:"Hendelse oppdatert",eventDeleted:"Hendelse slettet",eventRestored:"Hendelse gjenopprettet",eventUpdateUndone:"Hendelsesoppdatering angret",failedToAddEvent:"Kunne ikke legge til hendelse",failedToUpdateEvent:"Kunne ikke oppdatere hendelse",failedToDeleteEvent:"Kunne ikke slette hendelse",failedToFetchEvents:"Kunne ikke hente hendelser",errorCannotExcludeAllDates:"Kan ikke utelukke alle datoer i området",save:"Lagre",saving:"Lagrer",cancel:"Avbryt",delete:"Slett",deleting:"Sletter",undo:"Angre",tryAgain:"Prøv igjen",close:"Lukk",search:"Søk",searchEvents:"Søk i hendelser...",noEvents:"Ingen hendelser",allDay:"Hele dagen",fullDayEvents:"Heldagshendelser",loadingEvents:"Laster hendelser...",filterByColor:"Filtrer etter farge",filter:"Filter",filtering:"Filtrerer",more:"mer",use24HourFormat:"Bruk 24-timers format",repeatingEvent:"Gjentakende hendelse",multiDayEvent:"Flerdagshendelse",extendsOutOfRange:"Strekker seg utover gjeldende visning",displayCalendar:"Vis kalender",displayList:"Vis liste",dayXofY:"Dag {x} av {y}",repeatXofY:"#{x} av {y}",starts:"Starter",ends:"Slutter",untitledEvent:"Hendelse uten tittel",repeatDaily:"Daglig",repeatWeekly:"Ukentlig",repeatMonthly:"Månedlig",repeatingEventQuestion:"Gjentagende hendelse?",repeatDailyDescription:"Gjentas daglig kl. {timeRange} fra {startDate} til {endDate}",repeatWeeklyDescription:"Gjentas hver {dayName} kl. {timeRange} fra {startDate} til {endDate}",repeatMonthlyDescription:"Gjentas den {dayOfMonth}. hver måned kl. {timeRange} fra {startDate} til {endDate}",withExcludedDates:"med {count} utelukket dato{s}",excludedDates:"Utelukkede datoer?",excludedDatesDescription:"Velg datoer for å utelukke fra det gjentakende mønsteret",skipDays:"Hopp over dager:",clearAll:"Fjern alle",selectDatesToExclude:"Velg datoer å utelukke",selectAll:"Velg alle",noMatchingDates:"Ingen datoer samsvarer med dette gjentakelsesmønsteret",noSearchResults:'Ingen resultater funnet for "{query}"',searchMonthPlaceholder:"Søk måned...",ofExcluded:"{count} av {total} utelukket",pageCount:"{current}/{total}",weeklyIntervalLabel:"Hver {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Den {dayOfMonth}. hver måned ({startDate} - {endDate})",dateButtonFormat:"d. MMM",editEventDescription:"Rediger hendelsesdetaljene dine.",createEventDescription:"Opprett en ny hendelse i kalenderen din.",timePresetAllDay:"Hele dagen",timePresetEarlyMorning:"Tidlig morgen",timePresetMorning:"Morgen",timePresetLunch:"Lunsj",timePresetEarlyAfternoon:"Tidlig ettermiddag",timePresetLateAfternoon:"Sen ettermiddag",timePresetEvening:"Kveld",timePresetNight:"Natt",selectDate:"Velg en dato",selectColor:"Velg en farge",confirmDelete:"Er du sikker?",confirmDeleteDescription:"Vil du slette denne hendelsen?",repeatEventDeleteTitle:"Slett gjentakende hendelse",repeatEventDeleteDescription:"Dette er en gjentakende hendelse. Hva ønsker du å slette?",deleteThisOccurrence:"Slett kun denne forekomsten",deleteThisAndFuture:"Slett denne og alle fremtidige forekomster",deleteAllOccurrences:"Slett alle forekomster",deleteThisOccurrenceDescription:"Kun denne spesifikke datoen vil bli fjernet",deleteThisAndFutureDescription:"Denne og alle fremtidige datoer vil bli fjernet",deleteAllOccurrencesDescription:"Hele den gjentakende hendelsen vil bli fjernet",editRecurringEventTitle:"Rediger gjentakende hendelse",editRecurringEventDescription:"Dette er en gjentakende hendelse. Ønsker du å redigere alle forekomster, bare denne, eller denne og fremtidige forekomster?",editThisOccurrence:"Rediger kun denne forekomsten",editThisOccurrenceDescription:"Gjør endringer kun for denne spesifikke hendelsesforekomsten",editThisAndFuture:"Rediger denne og fremtidige forekomster",editThisAndFutureDescription:"Gjør endringer for denne og alle fremtidige forekomster",editAllOccurrences:"Rediger alle forekomster",editAllOccurrencesDescription:"Gjør endringer for alle forekomster av denne hendelsen",from:"fra",to:"til",pickADate:"Velg en dato",errorEndDateBeforeStart:"Sluttdato kan ikke være før startdato",selectAColor:"Velg en farge",validations:{eventNameRequired:"Hendelsestittel er påkrevd",invalidTimeFormat:"Ugyldig tidsformat",colorRequired:"Farge er påkrevd",endTimeBeforeStart:"Sluttid kan ikke være før starttid"}},e.ptBR={language:"pt",today:"Hoje",thisWeek:"Esta Semana",thisMonth:"Este Mês",thisYear:"Este Ano",dayNames:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],fullDayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],viewBy:"Visualizar por",day:"Dia",week:"Semana",month:"Mês",year:"Ano",list:"Lista",addEvent:"+ Evento",editEvent:"Editar Evento",deleteEvent:"Excluir Evento",eventTitle:"Título do Evento",eventDescription:"Descrição",eventColor:"Cor do Evento",eventDate:"Data",eventStartTime:"Hora de Início",eventEndTime:"Hora de Término",eventEndDate:"Data de Término",eventIsRepeating:"Evento Recorrente",eventAdded:"Evento adicionado",eventUpdated:"Evento atualizado",eventDeleted:"Evento excluído",eventRestored:"Evento restaurado",eventUpdateUndone:"Atualização do evento desfeita",failedToAddEvent:"Falha ao adicionar evento",failedToUpdateEvent:"Falha ao atualizar evento",failedToDeleteEvent:"Falha ao excluir evento",failedToFetchEvents:"Falha ao carregar eventos",errorCannotExcludeAllDates:"Não é possível excluir todas as datas no intervalo",save:"Salvar",saving:"Salvando",cancel:"Cancelar",delete:"Excluir",deleting:"Excluindo",undo:"Desfazer",tryAgain:"Tentar novamente",close:"Fechar",search:"Buscar",searchEvents:"Buscar eventos...",noEvents:"Sem eventos",allDay:"Dia Inteiro",fullDayEvents:"Eventos de Dia Inteiro",loadingEvents:"Carregando eventos...",filterByColor:"Filtrar por Cor",filter:"Filtrar",filtering:"Filtrando",more:"mais",use24HourFormat:"Usar formato 24 horas",repeatingEvent:"Evento recorrente",multiDayEvent:"Evento de vários dias",extendsOutOfRange:"Estende-se além da visualização atual",displayCalendar:"Exibir Calendário",displayList:"Exibir Lista",dayXofY:"Dia {x} de {y}",repeatXofY:"#{x} de {y}",starts:"Início",ends:"Término",untitledEvent:"Evento sem título",repeatDaily:"Diariamente",repeatWeekly:"Semanalmente",repeatMonthly:"Mensalmente",repeatingEventQuestion:"Evento recorrente?",repeatDailyDescription:"Repete diariamente às {timeRange} de {startDate} até {endDate}",repeatWeeklyDescription:"Repete toda(o) {dayName} às {timeRange} de {startDate} até {endDate}",repeatMonthlyDescription:"Repete todo dia {dayOfMonth} do mês às {timeRange} de {startDate} até {endDate}",withExcludedDates:"com {count} data{s} excluída{s}",excludedDates:"Datas excluídas?",excludedDatesDescription:"Selecione datas para excluir do padrão recorrente",skipDays:"Pular Dias:",clearAll:"Limpar tudo",selectDatesToExclude:"Selecionar datas para excluir",selectAll:"Selecionar Tudo",noMatchingDates:"Nenhuma data corresponde a este padrão de repetição",noSearchResults:'Nenhum resultado encontrado para "{query}"',searchMonthPlaceholder:"Pesquisar mês...",ofExcluded:"{count} de {total} excluídas",pageCount:"{current}/{total}",weeklyIntervalLabel:"Toda(o) {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Dia {dayOfMonth} de cada mês ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Edite os detalhes do seu evento.",createEventDescription:"Crie um novo evento no seu calendário.",timePresetAllDay:"Dia Inteiro",timePresetEarlyMorning:"Início da Manhã",timePresetMorning:"Manhã",timePresetLunch:"Almoço",timePresetEarlyAfternoon:"Início da Tarde",timePresetLateAfternoon:"Fim da Tarde",timePresetEvening:"Noite",timePresetNight:"Madrugada",selectDate:"Escolha uma data",selectColor:"Selecione uma cor",confirmDelete:"Tem certeza?",confirmDeleteDescription:"Deseja excluir este evento?",repeatEventDeleteTitle:"Excluir Evento Recorrente",repeatEventDeleteDescription:"Este é um evento recorrente. O que você deseja excluir?",deleteThisOccurrence:"Excluir apenas esta ocorrência",deleteThisAndFuture:"Excluir esta e todas as ocorrências futuras",deleteAllOccurrences:"Excluir todas as ocorrências",deleteThisOccurrenceDescription:"Apenas esta data específica será removida",deleteThisAndFutureDescription:"Esta e todas as datas futuras serão removidas",deleteAllOccurrencesDescription:"Todo o evento recorrente será removido",editRecurringEventTitle:"Editar Evento Recorrente",editRecurringEventDescription:"Este é um evento recorrente. Deseja editar todas as ocorrências, apenas esta, ou esta e as ocorrências futuras?",editThisOccurrence:"Editar apenas esta ocorrência",editThisOccurrenceDescription:"Fazer alterações apenas nesta ocorrência específica do evento",editThisAndFuture:"Editar esta e as ocorrências futuras",editThisAndFutureDescription:"Fazer alterações nesta e em todas as ocorrências futuras",editAllOccurrences:"Editar todas as ocorrências",editAllOccurrencesDescription:"Fazer alterações em todas as ocorrências deste evento",from:"de",to:"até",pickADate:"Escolha uma data",errorEndDateBeforeStart:"A data de término não pode ser anterior à data de início",selectAColor:"Selecione uma cor",validations:{eventNameRequired:"Nome do evento é obrigatório",invalidTimeFormat:"Formato de hora inválido",colorRequired:"Cor é obrigatória",endTimeBeforeStart:"O horário de término não pode ser anterior ao horário de início"}},e.svSE={language:"svSE",today:"Idag",thisWeek:"Denna vecka",thisMonth:"Denna månad",thisYear:"Detta år",dayNames:["Sön","Mån","Tis","Ons","Tors","Fre","Lör"],fullDayNames:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"],monthNames:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],viewBy:"Visa efter",day:"Dag",week:"Vecka",month:"Månad",year:"År",list:"Lista",addEvent:"Ny händelse",editEvent:"Redigera händelse",deleteEvent:"Ta bort händelse",eventTitle:"Händelsetitel",eventDescription:"Beskrivning",eventColor:"Händelsefärg",eventDate:"Startar",eventStartTime:"Klockan",eventEndTime:"Klockan",eventEndDate:"Slutar",eventIsRepeating:"Återkommande händelse",eventAdded:"Händelse tillagd",eventUpdated:"Händelse uppdaterad",eventDeleted:"Händelse borttagen",eventRestored:"Händelse återställd",eventUpdateUndone:"Händelseuppdatering ångrad",failedToAddEvent:"Kunde inte lägga till händelse",failedToUpdateEvent:"Kunde inte uppdatera händelse",failedToDeleteEvent:"Kunde inte ta bort händelse",failedToFetchEvents:"Kunde inte hämta händelser",errorCannotExcludeAllDates:"Kan inte undanta alla datum i intervallen",save:"Spara",saving:"Sparar",cancel:"Avbryt",delete:"Ta bort",deleting:"Raderar",undo:"Ångra",tryAgain:"Försök igen",close:"Stäng",search:"Sök",searchEvents:"Sök händelser...",noEvents:"Inga händelser",allDay:"Heldag",fullDayEvents:"Heldagshändelser",loadingEvents:"Laddar händelser...",filterByColor:"Filtrera efter färg",filter:"Filtrera",filtering:"Filtrerar",more:"mer",use24HourFormat:"Använd 24-timmarsformat",repeatingEvent:"Återkommande händelse",multiDayEvent:"Flerdagshändelse",extendsOutOfRange:"Sträcker sig utanför aktuell vy",displayCalendar:"Visa kalender",displayList:"Visa lista",dayXofY:"Dag {x} av {y}",repeatXofY:"#{x} av {y}",starts:"Börjar",ends:"Slutar",untitledEvent:"Namnlös händelse",repeatDaily:"Dagligen",repeatWeekly:"Veckovis",repeatMonthly:"Månadsvis",repeatingEventQuestion:"Återkommande händelse?",repeatDailyDescription:"Upprepas dagligen kl. {timeRange} från {startDate} till {endDate}",repeatWeeklyDescription:"Upprepas varje {dayName} kl. {timeRange} från {startDate} till {endDate}",repeatMonthlyDescription:"Upprepas den {dayOfMonth}:e varje månad kl. {timeRange} från {startDate} till {endDate}",withExcludedDates:"med {count} undantagna datum",excludedDates:"Undantagna datum?",excludedDatesDescription:"Välj datum att undanta från det återkommande mönstret",skipDays:"Hoppa över dagar:",clearAll:"Rensa alla",selectDatesToExclude:"Välj datum att undanta",selectAll:"Välj alla",noMatchingDates:"Inga datum matchar detta upprepningsmönster",noSearchResults:'Inga resultat hittades för "{query}"',searchMonthPlaceholder:"Sök månad...",ofExcluded:"{count} av {total} undantagna",pageCount:"{current}/{total}",weeklyIntervalLabel:"Varje {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Den {dayOfMonth}:e varje månad ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Redigera dina händelsedetaljer.",createEventDescription:"Skapa en ny händelse i din kalender.",timePresetAllDay:"Heldag",timePresetEarlyMorning:"Tidig morgon",timePresetMorning:"Morgon",timePresetLunch:"Lunch",timePresetEarlyAfternoon:"Tidig eftermiddag",timePresetLateAfternoon:"Sen eftermiddag",timePresetEvening:"Kväll",timePresetNight:"Natt",selectDate:"Välj ett datum",selectColor:"Välj en färg",confirmDelete:"Är du säker?",confirmDeleteDescription:"Vill du ta bort den här händelsen?",repeatEventDeleteTitle:"Ta bort återkommande händelse",repeatEventDeleteDescription:"Detta är en återkommande händelse. Vad vill du ta bort?",deleteThisOccurrence:"Ta bort endast denna förekomst",deleteThisAndFuture:"Ta bort denna och alla framtida förekomster",deleteAllOccurrences:"Ta bort alla förekomster",deleteThisOccurrenceDescription:"Endast detta specifika datum kommer att tas bort",deleteThisAndFutureDescription:"Detta och alla framtida datum kommer att tas bort",deleteAllOccurrencesDescription:"Hela den återkommande händelsen kommer att tas bort",editRecurringEventTitle:"Redigera återkommande händelse",editRecurringEventDescription:"Detta är en återkommande händelse. Vill du redigera alla förekomster, bara denna, eller denna och framtida förekomster?",editThisOccurrence:"Redigera endast denna förekomst",editThisOccurrenceDescription:"Gör ändringar endast för denna specifika händelseförekomst",editThisAndFuture:"Redigera denna och framtida förekomster",editThisAndFutureDescription:"Gör ändringar för denna och alla framtida förekomster",editAllOccurrences:"Redigera alla förekomster",editAllOccurrencesDescription:"Gör ändringar för alla förekomster av denna händelse",from:"från",to:"till",pickADate:"Välj ett datum",errorEndDateBeforeStart:"Slutdatum kan inte vara före startdatum",selectAColor:"Välj en färg",validations:{eventNameRequired:"Händelsetitel krävs",invalidTimeFormat:"Ogiltigt tidsformat",colorRequired:"Färg krävs",endTimeBeforeStart:"Sluttid kan inte vara före starttid"}},e.useEventCalendar=RT}(dnt);var pnt=function(e){var t=e.configurationItemInfo,r=f(e,["configurationItemInfo"]),n=dnt.useEventCalendar({initialEvents:r.events,onEventAdd:function(e){return m(void 0,void 0,void 0,function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventCreate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,h(h({},e),{id:Date.now().toString()})]}})})},onEventUpdate:function(e){return m(void 0,void 0,void 0,function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventUpdate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,e]}})})},onEventDelete:r.onEventDelete,onDateRangeChange:r.onDateRangeChange}),o=n.events,a=n.isLoading,i=n.addEvent,s=n.updateEvent,l=n.deleteEvent,c=n.onViewOrDateChange;return je(rp,h({sx:r.css},t,{className:"fec-wrapper"},{children:je(dnt.EventCalendar,{events:o,isLoading:a,config:r.config,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})}))},hnt={exports:{}};const fnt={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};hnt.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(fnt,t)?fnt[t]:void 0},hnt.exports.currencySymbolMap=fnt;var mnt=function(t){var r,n,o=t.required,a=void 0!==o&&o,i=t.requiredErrorText,s=void 0===i?"This field is required":i,l=t.validationErrorText,c=void 0===l?"Invalid numeric value":l,d=t.isDisplayOnly,u=void 0!==d&&d,p=t.backgroundColor,f=t.textAlign,m=void 0===f?"left":f,v=t.textColor,y=void 0===v?"inherit":v,g=t.fontSize,x=void 0===g?"16px":g,b=t.fontFamily,k=void 0===b?"inherit":b,_=t.fontWeight,w=void 0===_?"normal":_,M=t.borderColor,C=t.marginLeft,D=void 0===C?"0":C,j=t.marginTop,O=void 0===j?"0":j,S=t.marginRight,P=void 0===S?"0":S,E=t.marginBottom,T=void 0===E?"0":E,N=t.paddingLeft,z=void 0===N?"0":N,A=t.paddingTop,R=void 0===A?"0":A,F=t.paddingRight,L=void 0===F?"0":F,B=t.paddingBottom,V=void 0===B?"0":B,I=t.width,q=t.height,H=t.minHeight,$=t.maxHeight,W=t.minWidth,U=t.maxWidth,Y=t.text,Z=t.placeholderText,K=t.configurationItemInfo,G=t.name,X=t.numericPrecision,Q=void 0===X?"1":X,J=t.currency,ee=t.placement,te=void 0===ee?"left":ee,re=t.sourceDataModelField,ne=HS(),oe=null==ne?void 0:ne.control,ae=Hnt().localStateObject,ie=Ynt().stateConfig,se=ae||ie,le=e.useState(""),ce=le[0],de=le[1],ue=!!oe&&!!G,pe=re?null===(r=null==se?void 0:se[re])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==pe&&(ue?ne.setValue(G,pe):de(String(null!=pe?pe:"")))},[pe,ue,ne,G]);var he=Number.isFinite(+Q)&&+Q>0?+Q:1,fe=J?null!==(n=hnt.exports(J.toUpperCase()))&&void 0!==n?n:J.toUpperCase():"",me={required:!!a&&s,pattern:{value:/^-?\d+(?:\.\d+)?$/,message:c}},ve=h(h(h(h(h(h(h({backgroundColor:p,color:y,fontSize:x,fontFamily:k,fontWeight:w},I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),H&&{minHeight:H}),$&&{maxHeight:$}),{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:M},"&:hover fieldset":{borderColor:M},"&.Mui-focused fieldset":{borderColor:M},"&.Mui-disabled fieldset":{borderColor:M}},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V}}),ye={color:y,"&.Mui-focused":{color:y}},ge={marginLeft:D,marginTop:O,marginRight:P,marginBottom:T,display:"inline-flex",flexDirection:"column"},xe=fe?je("span",h({style:{color:y,fontWeight:w}},{children:fe})):null;if(u){var be=ue?ne.watch(G):pe,ke=null!=be?be:"-";return Oe(rp,h({sx:h(h(h(h(h(h(h({},ge),I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),H&&{minHeight:H}),$&&{maxHeight:$})},K,{children:[Y&&je(Nf,h({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,marginLeft:0}},{children:Y})),je(gc,h({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,backgroundColor:p,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V,border:"1px solid ".concat(M||"#ccc"),borderRadius:"4px",minWidth:"100px"}},{children:"left"===te?"".concat(fe).concat(ke):"".concat(ke).concat(fe)}))]}))}var _e=function(e,t){return je(Lb,h({type:"number",label:Y,required:a,placeholder:Z,variant:"outlined",sx:ge,inputProps:{step:he},slotProps:{input:{sx:ve,style:{textAlign:m}},inputLabel:{sx:ye}},InputProps:{startAdornment:"left"===te&&xe?je(em,h({position:"start"},{children:xe})):void 0,endAdornment:"right"===te&&xe?je(em,h({position:"end"},{children:xe})):void 0},error:!!t,helperText:t||null},e,K))};return ue?je(GS,{name:G,rules:me,control:oe,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return _e(r,null===(t=n.error)||void 0===t?void 0:t.message)}}):_e({value:ce,onChange:function(e){return de(e.target.value)}})},vnt=e.forwardRef(function(e,t){var r=e.inputRef,n=f(e,["inputRef"]);return je(zk,h({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:p_,guide:!0,placeholderChar:" "}))}),ynt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=f(e,["masked","errorMsg","inputSx","labelSx"]);return je(Lb,h({},a,{variant:"outlined",error:!!r,helperText:r||null,type:"text",slotProps:{input:h({sx:n},t?{inputComponent:vnt}:{}),inputLabel:{sx:o}}}))},gnt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Email is required":s,c=t.validationErrorText,d=void 0===c?"Invalid email address":c,u=t.text,p=t.placeholderText,f=t.masked,m=void 0!==f&&f,v=t.multiLine,y=void 0!==v&&v,g=t.backgroundColor,x=t.borderColor,b=t.color,k=void 0===b?"inherit":b,_=t.fontSize,w=void 0===_?"16px":_,M=t.fontFamily,C=void 0===M?"inherit":M,D=t.fontWeight,j=void 0===D?"normal":D,O=t.textAlign,S=void 0===O?"left":O,P=t.marginLeft,E=void 0===P?"0":P,T=t.marginTop,N=void 0===T?"0":T,z=t.marginRight,A=void 0===z?"0":z,R=t.marginBottom,F=void 0===R?"0":R,L=t.paddingLeft,B=void 0===L?"0":L,V=t.paddingTop,I=void 0===V?"0":V,q=t.paddingRight,H=void 0===q?"0":q,$=t.paddingBottom,W=void 0===$?"0":$,U=t.width,Y=t.height,Z=t.minHeight,K=t.maxHeight,G=t.minWidth,X=t.maxWidth,Q=t.name,J=t.sourceDataModelField,ee=t.configurationItemInfo,te=HS(),re=null==te?void 0:te.control,ne=!(!re||!Q),oe=Hnt().localStateObject,ae=Ynt().stateConfig,ie=oe||ae,se=J?null===(r=null==ie?void 0:ie[J])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==se&&ne&&te.setValue(Q,se)},[se]);var le=e.useState("");le[0],le[1];var ce={required:!!i&&l,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:d}};if(o){var de=(ne?te.watch(Q)||"":se)||p||"-";return Oe("div",h({style:h(h(h({display:"inline-flex",flexDirection:"column",marginLeft:E,marginTop:N,marginRight:A,marginBottom:F},U&&{width:U}),Y&&{height:Y}),{minHeight:Z,maxHeight:K,minWidth:G,maxWidth:X})},ee,{children:[u&&je(Nf,h({sx:{fontSize:w,fontFamily:C,fontWeight:j,color:k,marginLeft:0,marginBottom:"4px"}},{children:u})),je(gc,h({sx:{fontSize:w,fontFamily:C,fontWeight:j,color:k,paddingLeft:B,paddingTop:I,paddingRight:H,paddingBottom:W,backgroundColor:g,border:"1px solid ".concat(x||"#ccc"),borderRadius:"4px",minWidth:"120px",textAlign:S}},{children:de}))]}))}var ue=h(h(h(h(h(h(h({backgroundColor:g,color:k,fontSize:w,fontFamily:C,fontWeight:j},U&&{width:U}),Y&&{height:Y}),G&&{minWidth:G}),X&&{maxWidth:X}),Z&&{minHeight:Z}),K&&{maxHeight:K}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-input":{textAlign:S,paddingLeft:B,paddingTop:I,paddingRight:H,paddingBottom:W}}),pe={color:k,"&.Mui-focused":{color:k}},he=y?3:1;if(ne)return je("div",h({style:{marginLeft:E,marginTop:N,marginRight:A,marginBottom:F}},{children:je(GS,{name:Q,rules:ce,control:re,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return je(ynt,h({masked:m,required:i,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:ue,labelSx:pe,label:u,placeholder:p,multiline:y,minRows:he,value:r.value||"",onChange:r.onChange},ee||{}))}})}));var fe=e.useState(""),me=fe[0],ve=fe[1];return je("div",h({style:{marginLeft:E,marginTop:N,marginRight:A,marginBottom:F}},{children:je(ynt,h({masked:m,required:i,errorMsg:void 0,inputSx:ue,labelSx:pe,label:u,placeholder:p,multiline:y,minRows:he,value:me,onChange:function(e){return ve(e.target.value)}},ee||{}))}))},xnt=function(e){return{justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}},bnt=function(t){var r,n=t.popover,o=void 0===n||n,a=t.items,i=t.marginTop,s=void 0===i?"0":i,l=t.marginRight,c=void 0===l?"0":l,d=t.marginBottom,u=void 0===d?"0":d,p=t.marginLeft,f=void 0===p?"0":p,m=t.paddingTop,v=void 0===m?"0":m,y=t.paddingRight,g=void 0===y?"0":y,x=t.paddingBottom,b=void 0===x?"0":x,k=t.paddingLeft,_=void 0===k?"0":k,w=t.cornerRadius,M=void 0===w?"4px":w,C=t.backgroundColor,D=void 0===C?"#fff":C,j=t.width,O=void 0===j?"100%":j,S=t.height,P=void 0===S?"auto":S,E=t.borderColor,T=void 0===E?"#ccc":E,N=t.borderWeight,z=void 0===N?"1px":N,A=t.buttonText,R=void 0===A?"Open Menu":A,F=t.buttonVariant,L=void 0===F?"contained":F,B=t.buttonTextColor,V=t.buttonFontSize,I=t.buttonFontWeight,q=t.buttonFontFamily,H=t.buttonDisabled,$=void 0!==H&&H,W=t.buttonGap,U=void 0===W?0:W,Y=t.buttonStartIcon,Z=t.buttonEndIcon,K=t.buttonCornerRadius,G=void 0===K?"0":K,X=t.buttonMarginTop,Q=void 0===X?"0":X,J=t.buttonMarginRight,ee=void 0===J?"0":J,te=t.buttonMarginBottom,re=void 0===te?"0":te,ne=t.buttonMarginLeft,oe=void 0===ne?"0":ne,ae=t.buttonPaddingTop,ie=void 0===ae?"0":ae,se=t.buttonPaddingRight,le=void 0===se?"0":se,ce=t.buttonPaddingBottom,de=void 0===ce?"0":ce,ue=t.buttonPaddingLeft,pe=void 0===ue?"0":ue,he=t.buttonIconOnly,fe=t.buttonElevation,me=t.buttonFillColor,ye=t.buttonFillColorDisabled,ge=t.buttonFillColorHover,xe=t.buttonFillColorPressed,be=t.buttonBorderColor,ke=t.buttonBorderColorDisabled,_e=t.buttonBorderColorHover,we=t.buttonBorderColorPressed,Me=t.buttonTextColorDisabled,Ce=t.buttonTextColorHover,De=t.buttonTextColorPressed,Se=t.buttonColor,Pe=void 0===Se?"#1976d2":Se,Ee=t.anchorOriginVertical,Te=void 0===Ee?"bottom":Ee,Ne=t.anchorOriginHorizontal,ze=void 0===Ne?"left":Ne,Ae=t.transformOriginVertical,Re=void 0===Ae?"top":Ae,Fe=t.transformOriginHorizontal,Le=void 0===Fe?"left":Fe,Be=t.elevation,Ve=void 0===Be?3:Be,Ie=t.moleculeId,qe=t.configurationItemInfo,He=ve(),$e=Hnt(),We=$e.isConfigurationMode,Ue=$e.selectedConfigurationItemId,Ye=$e.onConfigurationItemClicked,Ze=$e.onInternalNavigation,Ke=e.useState(null),Ge=Ke[0],Xe=Ke[1],Qe=e.useState(!1),Je=Qe[0],et=Qe[1],tt=Boolean(We&&(Ue===Ie||a.some(function(e){return e.id===Ue}))),rt=function(){return et(!1)},nt=h({marginTop:s,marginRight:c,marginBottom:u,marginLeft:f,paddingTop:v,paddingRight:g,paddingBottom:b,paddingLeft:_},o?{display:"inline-block",zIndex:null===(r=null==He?void 0:He.zIndex)||void 0===r?void 0:r.drawer}:{width:O,height:P,backgroundColor:D,display:"block",overflow:"hidden",border:"".concat(z," solid ").concat(T),borderRadius:M});return o?Oe(rp,{children:[je(R2e,{ref:Xe,text:R,variant:L,moleculeId:Ie,textColor:B,fontSize:V,fontWeight:I,fontFamily:q,disabled:$,gap:U,startIcon:Y,endIcon:Z,onClick:function(){return et(!0)},marginTop:Q,marginRight:ee,marginBottom:re,marginLeft:oe,paddingTop:ie,paddingRight:le,paddingBottom:de,paddingLeft:pe,borderRadius:G,iconOnly:he,elevation:fe,fillColor:me||Pe,fillColorDisabled:ye,fillColorHover:ge,fillColorPressed:xe,borderColor:be,borderColorDisabled:ke,borderColorHover:_e,borderColorPressed:we,textColorDisabled:Me,textColorHover:Ce,textColorPressed:De,configurationItemInfo:qe}),je(iv,h({open:We?tt:Je,variant:"menu",anchorEl:Ge,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:rt,anchorOrigin:{vertical:Te,horizontal:ze},transformOrigin:{vertical:Re,horizontal:Le},elevation:Ve,slotProps:{paper:{sx:{backgroundColor:D}}},sx:nt},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:t4e({theme:He,selected:t})}:{};return Oe(uv,h({sx:xnt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&($tt(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):Htt(null===(r=e.link)||void 0===r?void 0:r.externalLink)),rt()},disabled:e.disabled},a,{children:[e.startIcon&&je(E2e,{iconName:e.startIcon,color:e.textColor}),je(gc,h({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"}},{children:e.text})),e.endIcon&&je(E2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))]}):je(dl,h({id:Ie,sx:nt,elevation:Ve},qe,{children:je(ym,h({disablePadding:!0},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:t4e({theme:He,selected:t})}:{};return Oe(wm,h({disabled:e.disabled,sx:xnt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&($tt(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):Htt(null===(r=e.link)||void 0===r?void 0:r.externalLink))}},a,{children:[e.startIcon&&je(E2e,{iconName:e.startIcon,color:e.textColor}),je(Fm,{primary:je(gc,h({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"}},{children:e.text}))}),e.endIcon&&je(E2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))}))};var knt=function(e){var t=e.errorMsg,r=e.stepValue,n=e.minValue,o=e.allowNegative,a=e.inputSx,i=e.labelSx,s=f(e,["errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx"]);return je(Lb,h({},s,{variant:"outlined",type:"number",error:!!t,helperText:t||null,inputProps:{step:r,min:o?void 0:n},slotProps:{input:{sx:a},inputLabel:{sx:i}}}))},_nt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"This field is required":s,c=t.validationErrorText,d=void 0===c?"Invalid numeric value":c,u=t.text,p=t.placeholderText,f=t.backgroundColor,m=t.borderColor,v=t.textColor,y=void 0===v?"#000":v,g=t.fontSize,x=t.fontFamily,b=t.fontWeight,k=t.allowNegative,_=void 0!==k&&k,w=t.numericPrecision,M=void 0===w?"1":w,C=t.name,D=t.sourceDataModelField,j=t.marginLeft,O=void 0===j?"0":j,S=t.marginTop,P=void 0===S?"0":S,E=t.marginRight,T=void 0===E?"0":E,N=t.marginBottom,z=void 0===N?"0":N,A=t.paddingLeft,R=void 0===A?"0":A,F=t.paddingTop,L=void 0===F?"0":F,B=t.paddingRight,V=void 0===B?"0":B,I=t.paddingBottom,q=void 0===I?"0":I,H=t.width,$=t.height,W=t.configurationItemInfo;t._textAlign;var U=t.minHeight,Y=t.maxHeight,Z=t.minWidth,K=t.maxWidth,G=HS(),X=null==G?void 0:G.control,Q=!(!X||!C),J=Hnt().localStateObject,ee=Ynt().stateConfig,te=J||ee,re=D?null===(r=null==te?void 0:te[D])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==re&&Q&&G.setValue(C,re)},[re]);var ne=e.useState(""),oe=ne[0],ae=ne[1],ie=parseFloat(M),se=_?void 0:0,le={required:!!i&&l,pattern:{value:_?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:d}};if(_||(le.min={value:0,message:"Value cannot be less than zero"}),o){var ce="",de=(ce=Q?G.watch(C)||"":re)?function(e,t,r){if(!e)return"";var n=parseFloat(e);if(Number.isNaN(n))return e;if(!r&&n<0)return"0";if(t){var o=(t.split(".")[1]||"").length;if(o>0)return n.toFixed(o)}return e}(ce,M,_):p||"-";return Oe("div",h({style:h(h(h(h(h(h({display:"inline-flex",flexDirection:"column",marginLeft:O,marginTop:P,marginRight:T,marginBottom:z},H&&{width:H}),$&&{height:$}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y})},W,{children:[u&&je(Nf,h({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,marginBottom:"4px"}},{children:u})),je(gc,h({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,paddingLeft:R,paddingTop:L,paddingRight:V,paddingBottom:q,backgroundColor:f,border:"1px solid ".concat(m||"#ccc"),borderRadius:"4px",minWidth:"60px"}},{children:de}))]}))}var ue=h(h(h(h(h(h(h({backgroundColor:f,color:y,fontSize:g,fontFamily:x,fontWeight:b},H&&{width:H}),$&&{height:$}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"}}),pe={color:y,"&.Mui-focused":{color:y}};return je(yf,h({required:i,sx:{marginLeft:O,marginTop:P,marginRight:T,marginBottom:z,width:"fit-content"}},W,Q?{children:je(GS,{name:C,rules:le,control:X,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return je(knt,{errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,label:u,placeholder:p,stepValue:ie,minValue:se,allowNegative:_,inputSx:ue,labelSx:pe,value:r.value||"",onChange:function(e){return r.onChange(e.target.value)}})}})}:{children:je(knt,{errorMsg:void 0,label:u,placeholder:p,stepValue:ie,minValue:se,allowNegative:_,inputSx:ue,labelSx:pe,value:oe,onChange:function(e){return ae(e.target.value)}})}))},wnt=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],Mnt=e.forwardRef(function(e,t){var r=e.inputRef,n=f(e,["inputRef"]);return je(zk,h({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:wnt,guide:!0,placeholderChar:" "}))});var Cnt,Dnt,jnt,Ont,Snt,Pnt,Ent,Tnt,Nnt,znt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=f(e,["masked","errorMsg","inputSx","labelSx"]);return je(Lb,h({},a,{variant:"outlined",error:!!r,helperText:r||null,slotProps:{input:h({sx:n},t?{inputComponent:Mnt}:{}),inputLabel:{sx:o}}}))},Ant=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Phone is required":s,c=t.validationErrorText,d=void 0===c?"Invalid phone number":c,u=t.text,p=t.placeholderText,f=t.masked,m=void 0===f||f;t.multiLine;var v=t.backgroundColor,y=t.borderColor,g=t.textColor,x=void 0===g?"#000":g,b=t.fontSize,k=t.fontFamily,_=t.fontWeight;t.textAlign;var w=t.marginLeft,M=void 0===w?"0":w,C=t.marginTop,D=void 0===C?"0":C,j=t.marginRight,O=void 0===j?"0":j,S=t.marginBottom,P=void 0===S?"0":S,E=t.paddingLeft,T=void 0===E?"0":E,N=t.paddingTop,z=void 0===N?"0":N,A=t.paddingRight,R=void 0===A?"0":A,F=t.paddingBottom,L=void 0===F?"0":F,B=t.width,V=t.height,I=t.minHeight,q=t.maxHeight,H=t.minWidth,$=t.maxWidth,W=t.name,U=t.sourceDataModelField,Y=t.configurationItemInfo,Z=HS(),K=null==Z?void 0:Z.control,G=!(!K||!W),X=Hnt().localStateObject,Q=Ynt().stateConfig,J=X||Q,ee=U?null===(r=null==J?void 0:J[U])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==ee&&G&&Z.setValue(W,ee)},[ee]);var te=e.useState(""),re=te[0],ne=te[1],oe={required:!!i&&l,pattern:{value:/^\d{10}$/,message:d}};if(o){var ae="";ae=G?Z.watch(W)||"":ee;var ie=m?function(e){var t=(null!=e?e:"").replace(/\D+/g,"");if(!t)return"";var r="",n=0;return g_.forEach(function(e){"string"==typeof e?r+=e:n<t.length?(r+=t[n],n+=1):r+="_"}),r}(ae):ae,se=ie||p||"-";return Oe("div",h({style:h(h(h(h(h(h({display:"inline-flex",flexDirection:"column",marginLeft:M,marginTop:D,marginRight:O,marginBottom:P},B&&{width:B}),V&&{height:V}),H&&{minWidth:H}),$&&{maxWidth:$}),I&&{minHeight:I}),q&&{maxHeight:q})},Y,{children:[u&&je(Nf,h({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,marginLeft:0,marginBottom:"4px"}},{children:u})),je(gc,h({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,paddingLeft:T,paddingTop:z,paddingRight:R,paddingBottom:L,backgroundColor:v,border:"1px solid ".concat(y||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:se}))]}))}var le=h(h(h(h(h(h(h({backgroundColor:v,color:x,fontSize:b,fontFamily:k,fontWeight:_},B&&{width:B}),V&&{height:V}),H&&{minWidth:H}),$&&{maxWidth:$}),I&&{minHeight:I}),q&&{maxHeight:q}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"}}),ce={color:x,"&.Mui-focused":{color:x}},de={marginLeft:M,marginTop:D,marginRight:O,marginBottom:P,width:"fit-content"};return je(yf,h({required:i,sx:de},Y,G?{children:je(GS,{name:W,rules:oe,control:K,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return je(znt,{masked:m,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:le,labelSx:ce,label:u,placeholder:p,value:r.value||"",onChange:function(e){var t,n,o=(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:"").toString().replace(/\D+/g,"");r.onChange(o)}})}})}:{children:je(znt,{masked:m,errorMsg:void 0,inputSx:le,labelSx:ce,label:u,placeholder:p,value:re,onChange:function(e){var t,r,n=(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:"").toString();ne(n.replace(/\D+/g,""))}})}))},Rnt=function(t){var r=t.items,n=t.onTabChange,o=t.activeTabKey,a=t.isMobile,i=void 0!==a&&a,s=t.marginTop,l=t.marginRight,c=t.marginBottom,d=t.marginLeft,u=t.paddingTop,p=t.paddingRight,f=t.paddingBottom,m=t.paddingLeft,v=t.buttonPaddingTop,y=t.buttonPaddingRight,g=t.buttonPaddingBottom,x=t.buttonPaddingLeft,b=t.width,k=t.height,_=t.backgroundColor,w=t.borderRadius,M=t.elevation,C=void 0===M?1:M,D=t.gap,j=t.indicatorVisible,O=void 0===j||j,S=t.indicatorColor,P=t.lineWidth,E=void 0===P?"2px":P,T=t.orientation,N=void 0===T?"horizontal":T,z=t.activeTextColor,A=void 0===z?"#1976d2":z,R=t.inactiveTextColor,F=void 0===R?"#000":R,L=t.fontSize,B=t.fontWeight,V=t.fontFamily,I=t.wrapText,q=t.textAlign,H=t.iconName,$=t.iconColor,W=t.iconSize,U=t.iconPlacement,Y=void 0===U?"left":U,Z=t.hoverTextColor,K=t.itemBorder,G=t.itemBorderRadius,X=t.itemBackgroundColor,Q=t.itemSelectedBackgroundColor,J=t.itemHoverBackgroundColor,ee=t.selectedItemElevation,te=void 0===ee?0:ee,re=t.itemDisableRipple,ne=t.configurationItemInfo,oe=ve(),ae=Hnt(),ie=ae.isConfigurationMode,se=ae.onConfigurationItemClicked,le=ae.selectedConfigurationItemId,ce=e.useState(null),de=ce[0],ue=ce[1],pe=function(){return ue(null)},he={marginTop:s,marginRight:l,marginBottom:c,marginLeft:d,paddingTop:u,paddingRight:p,paddingBottom:f,paddingLeft:m,width:b,height:k,backgroundColor:_,borderRadius:w,display:"flex",overflow:"visible !important"},fe=function(e){var t=e?A:F,r=e&&Q||X;return{color:t,fontSize:L,fontWeight:B,fontFamily:V,textAlign:q,whiteSpace:I?"normal":"nowrap",border:K,borderRadius:G,backgroundColor:r,boxShadow:e?oe.shadows[te]:void 0,paddingTop:v,paddingRight:y,paddingBottom:g,paddingLeft:x,"&:hover":{color:Z||t,backgroundColor:J||r}}},me=function(e){null==n||n({newTabKey:e.tabKey,link:e.link})},ye=function(e){if(!ie)return{};var t=e.id===le,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:function(e){e.stopPropagation(),null==se||se(r,!1)},onDoubleClick:function(e){e.stopPropagation(),null==se||se(r,!0)},"data-organism-id":e.id,css:t4e({theme:oe,selected:t})}};if(i)return Oe(dl,h({elevation:C,style:he},ne,{children:[je(Ql,h({onClick:function(e){return ue(e.currentTarget)}},{children:je(E2e,{size:W,color:$,iconName:H})})),je(iv,h({anchorEl:de,open:Boolean(de),onClose:pe},{children:r.map(function(e){var t=e.tabKey===o,r=fe(t);return Oe(uv,h({onClick:function(){me(e),pe()},sx:h(h({},r),{display:"flex",alignItems:"center"})},ye(e),{children:[e.iconName&&je(E2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F,mr:1}}),je(rp,h({component:"span"},{children:e.label}))]}),e.id)})}))]}));var ge=r.findIndex(function(e){return e.tabKey===o});return je(dl,h({elevation:C,style:he},ne,{children:je(ob,h({value:ge<0?0:ge,onChange:function(e,t){return ie?null:me(r[t])},orientation:N,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:D}},TabIndicatorProps:{style:O?{height:E,borderRadius:w,backgroundColor:S||A}:{display:"none"}}},{children:r.map(function(e){var t=e.tabKey===o,r=h(h({},fe(t)),{"&.Mui-selected":{color:t?A:F}});return je(zx,h({label:e.label,disableRipple:re,sx:h(h({},r),{textTransform:"none"}),onClick:function(){return me(e)},iconPosition:"right"===Y?"end":"start",icon:e.iconName?je(E2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F}}):void 0},ye(e)),e.id)})}))}))},Fnt=function(t){var r,n,o,a=t.id,i=t.type,s=t.name,l=t.form,c=t.config;t.formData;var d=t.isMobile,u=t.children,p=t.tabsProps,y=t.properties,g=t.organismLibraryMoleculeId,x=ve(),b=d||$b("xs"),k=Hnt(),_=k.formId,w=k.isPreview,M=void 0!==w&&w,C=k.validations,D=k.submitHandler,j=k.isConfigurationMode,O=k.onConfigurationItemClicked,S=k.selectedConfigurationItemId,P=k.currentStyleProperties,E=k.currentContentProperties,T=k.onInternalNavigation,N=Hnt().localStateObject,z=Ynt().stateConfig,A=N||z,R=(null===(r=null==c?void 0:c.props)||void 0===r?void 0:r.dataCaptureName)||(null===(n=null==y?void 0:y.dataCapture)||void 0===n?void 0:n.dataCaptureName)||a,F=null===(o=null==y?void 0:y.dataCapture)||void 0===o?void 0:o.sourceDataModelFieldId,L=S===a,B=qnt(),V=B.setActivePopUpById,I=B.setDrawerVisible,q=B.onCloseModal,H=B.onCloseDrawer,$=function(e){var t=e.stateListenerId,r=Hnt().localStateObject,n=Ynt().stateConfig,o=r||n,a=!0,i=!1;if(!t)return{isStateDisabled:i,isStateVisible:a};var s=(null==o?void 0:o[t])||{},l=s||{},c=l.visible,d=void 0===c||c,u=l.disabled,p=void 0!==u&&u;return t in o&&(a=Boolean(d),i=Boolean(p)),{isStateDisabled:i,isStateVisible:a,stateValue:s}}({stateListenerId:a}),W=$.isStateDisabled,U=$.isStateVisible,Y=e.useMemo(function(){return{entityType:i,entity:"molecule",entityName:s,entityId:a,organismLibraryMoleculeId:g}},[i,s,a,g]),Z=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!1)},[O,Y]),K=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!0)},[O,Y]),G=j?{onClick:Z,onDoubleClick:K,"data-configuration-id":a,css:t4e({theme:x,selected:L})}:{},X=j||W;if(!U)return null;return function(){var e,t,r,n,o,s,d,g,x;switch(i){case"simple_text":var k=int(O={text:null==y?void 0:y.text},E,N=["text"],L).text,w=snt(null==c?void 0:c.props,P,L);return je(Rtt,h({},w,{text:(null==k?void 0:k.text)||"",htmlElementId:a,configurationsItemInfo:G}));case"text":var O={text:null==y?void 0:y.text},N=Object.keys(O);k=int(O,E,N,L).text,w=snt(null==c?void 0:c.props,P,L);return je(Att,h({},k,w,{htmlElementId:a,configurationItemInfo:G}));case"consent":var z=int(y,E,[],L);w=snt(null==c?void 0:c.props,P,L)||{};return je(a4e,h({},w,{htmlElementId:a,properties:z,configurationItemInfo:G}));case"signup_password_fields":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText,placeholderText:null==y?void 0:y.placeholderText,subPlaceholderText:null==y?void 0:y.subPlaceholderText,validationText:null==y?void 0:y.validationText},N=Object.keys(O);var B=int(O,E,N,L),$=snt(null==c?void 0:c.props,P,L),U=$.state,Y=$.gap,Z=f($,["state","gap"]);return je(art,{gap:Y,inputProps:Z,validations:C||[],htmlElementId:a,validationState:U,overridesProperties:B,configurationItemInfo:G});case"stepper":var K=snt(null==c?void 0:c.props,P,L),Q=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=f(r,["properties","config"]),i={title:null==n?void 0:n.title,subText:null==n?void 0:n.subText},s=Object.keys(i),l=int(i,E,s,t),c=l.title,d=l.subText,u=snt(null==o?void 0:o.props,P,t);return h(h(h({},a),u),{title:(null==c?void 0:c.text)||"",subText:(null==d?void 0:d.text)||""})});return je(Rrt,h({},K,{items:Q||[],isMobile:b,moleculeId:a,configurationItemInfo:G}));case"checklist":var J=snt(null==c?void 0:c.props,P,L)||{},ee=null==u?void 0:u.map(function(e){var t,r,n,o,a,i=S===e.id,s=e||{},l=s.properties,c=s.config,d=f(s,["properties","config"]);switch(e.type){case"checklist_item":var u={label:null==l?void 0:l.label,objectState:null==l?void 0:l.objectState},p=Object.keys(u),m=int(u,E,p,i),v=snt(null==c?void 0:c.props,P,i)||{},y=(null===(t=m.label)||void 0===t?void 0:t.text)||"",g=!!(null===(r=m.objectState)||void 0===r?void 0:r.pmiObjectId);return h(h(h({},d),v),{type:"checklist_item",label:y,textColor:v.textColor||"#000",fontSize:v.fontSize||"14px",fontFamily:v.fontFamily||"inherit",fontWeight:v.fontWeight||"normal",textAlign:v.textAlign||"left",isSystemDriven:g,disabled:g,interacted:(null===(n=null==A?void 0:A[e.id])||void 0===n?void 0:n.interacted)||"unchecked"});case"divider_item":v=snt(null==c?void 0:c.props,P,i)||{};return h(h(h({},d),v),{type:"divider_item"});case"text_item":u={text:null==l?void 0:l.text},p=Object.keys(u),m=int(u,E,p,i),v=snt(null==c?void 0:c.props,P,i)||{};var x=(null===(o=m.text)||void 0===o?void 0:o.text)||"";return h(h(h({},d),v),{type:"text_item",text:x});case"rich_text_item":u={text:null==l?void 0:l.text},p=Object.keys(u),m=int(u,E,p,i),v=snt(null==c?void 0:c.props,P,i)||{},x=(null===(a=m.text)||void 0===a?void 0:a.text)||lot;return h(h(h({},d),v),{type:"rich_text_item",text:x});default:return h(h({},d),{type:e.type})}});return je(n4e,h({},J,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"accordion":var te=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=f(r,["properties","config"]),i={text:null==n?void 0:n.text,subText:null==n?void 0:n.subText,bodyText:null==n?void 0:n.bodyText},s=Object.keys(i),l=int(i,E,s,t),c=l.text,d=l.subText,u=l.bodyText,p=snt(null==o?void 0:o.props,P,t);return h(h(h({},a),p),{text:(null==c?void 0:c.text)||"",subText:(null==d?void 0:d.text)||"",bodyText:(null==u?void 0:u.text)||""})});return je(lnt,h({},te,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"menu":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var re=int(O,E,N,L),ne=re.text,oe=re.disabled,ae=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t,r=S===e.id,n=e||{},o=n.properties,a=n.config,i=f(n,["properties","config"]),s={disabled:o&&"disabled"in o?o.disabled:void 0,text:o&&"text"in o?o.text:void 0,link:o&&"link"in o?o.link:void 0},l=Object.keys(s),c=int(s,E,l,r),d=c.text,u=c.disabled,p=c.link,m=snt(null==a?void 0:a.props,P,r);return h(h(h({},i),m),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null==u?void 0:u.value)||(null==m?void 0:m.disabled)||!1,text:(null==d?void 0:d.text)||"Menu Item",link:p})});return je(bnt,h({},ae,{items:ee||[],moleculeId:a,buttonText:(null==ne?void 0:ne.text)||"Open Menu",configurationItemInfo:G,buttonDisabled:(null==A?void 0:A[a])?null===(e=null==A?void 0:A[a])||void 0===e?void 0:e.disabled:(null==oe?void 0:oe.value)||(null==ae?void 0:ae.disabled)||!1}));case"tabs":w=snt(null==c?void 0:c.props,P,L);var ie=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a={label:null==n?void 0:n.label,link:null==n?void 0:n.link},i=Object.keys(a),s=int(a,E,i,t),l=s.label,c=s.link,d=snt(null==o?void 0:o.props,P,t);return h(h({},d),{id:e.id,tabKey:$tt(c)?qtt(Ftt,null==c?void 0:c.internalLink):void 0,label:(null==l?void 0:l.text)||"",link:c})}),se=null==p?void 0:p.tabs.map(function(e){var t=e.text,r=f(e,["text"]);return h(h({},r),{label:t||""})}),le=Boolean(null==w?void 0:w.isTabsSystemDerived),ce=le?se:ie,de=(null==p?void 0:p.activeTabKey)||(null===(t=null==ce?void 0:ce[0])||void 0===t?void 0:t.tabKey)||"";return je(Rnt,h({},w,{items:ce||[],isMobile:b,moleculeId:a,activeTabKey:de,configurationItemInfo:G,onTabChange:j?void 0:function(e){var t,r=e.newTabKey,n=e.link;le?null===(t=null==p?void 0:p.onTabChange)||void 0===t||t.call(p,r):$tt(n)?null==T||T((null==n?void 0:n.internalLink)||""):Htt(null==n?void 0:n.externalLink)}}));case"divider":w=snt(null==c?void 0:c.props,P,L);return je(Ttt,h({moleculeId:a,configurationItemInfo:G},w));case"link":O={text:null==y?void 0:y.text,link:null==y?void 0:y.link},N=Object.keys(O);var ue=int(O,E,N,L),pe=(k=ue.text,ue.link);w=snt(null==c?void 0:c.props,P,L);return je(trt,h({moleculeId:a},w,{type:null==pe?void 0:pe.type,src:X?void 0:Utt(pe,M)||"",text:(null==k?void 0:k.text)||"",disabled:(null==w?void 0:w.disabled)||W,configurationItemInfo:G}));case"video":O={video:null==y?void 0:y.video,coverImage:null==y?void 0:y.coverImage},N=Object.keys(O);var he=int(O,E,N,L),fe=he.video,me=he.coverImage;w=snt(null==c?void 0:c.props,P,L);return je(Brt,h({},w,{moleculeId:a,poster:null===(r=null==me?void 0:me.imageFile)||void 0===r?void 0:r.url,src:null!==(s=null!==(n=null==fe?void 0:fe.videoSource)&&void 0!==n?n:null===(o=null==fe?void 0:fe.videoFile)||void 0===o?void 0:o.url)&&void 0!==s?s:"",configurationItemInfo:G}));case"badge":w=snt(null==c?void 0:c.props,P,L);return je(N2e,h({},w,{configurationItemInfo:G}));case"alert":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText},N=Object.keys(O);var ve=int(O,E,N,L),ye=(k=ve.text,ve.subText);w=snt(null==c?void 0:c.props,P,L);return je(T2e,h({text:(null==k?void 0:k.text)||"",subText:(null==ye?void 0:ye.text)||""},w,{configurationItemInfo:G}));case"chip":O={text:null==y?void 0:y.text},N=Object.keys(O),k=int(O,E,N,L).text,w=snt(null==c?void 0:c.props,P,L);return je(o4e,h({text:(null==k?void 0:k.text)||""},w,{configurationItemInfo:G}));case"email_display_field":case"email_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var ge=int(O,E,N,L),xe=(k=ge.text,ge.placeholderText),be=ge.required,ke=ge.requiredErrorText,_e=ge.validationErrorText;w=snt(null==c?void 0:c.props,P,L);return je(gnt,h({name:R,text:(null==k?void 0:k.text)||"",placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,required:null==be?void 0:be.value,isDisplayOnly:"email_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text},w,{configurationItemInfo:G}));case"phone_number_display_field":case"phone_number_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var we=int(O,E,N,L);k=we.text,xe=we.placeholderText,be=we.required,ke=we.requiredErrorText,_e=we.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Ant,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,isDisplayOnly:"phone_number_display_field"===i},w,{configurationItemInfo:G}));case"numeric_display_field":case"numeric_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Me=int(O,E,N,L);k=Me.text,xe=Me.placeholderText,be=Me.required,ke=Me.requiredErrorText,_e=Me.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(_nt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"numeric_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"currency_display_field":case"currency_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ce=int(O,E,N,L);k=Ce.text,xe=Ce.placeholderText,be=Ce.required,ke=Ce.requiredErrorText,_e=Ce.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(mnt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"currency_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"basic_text_display_field":case"basic_text_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Oe=int(O,E,N,L);k=Oe.text,xe=Oe.placeholderText,be=Oe.required,ke=Oe.requiredErrorText,_e=Oe.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(A2e,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"basic_text_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"rating_display_field":case"rating":O={text:null==y?void 0:y.text,dataCapture:null==y?void 0:y.dataCapture,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Se=int(O,E,N,L);k=Se.text,be=Se.required,ke=Se.requiredErrorText,_e=Se.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(wrt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"rating_display_field"===i},w,{configurationItemInfo:G}));case"switch_display_field":case"switch":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Pe=int(O,E,N,L);k=Pe.text,be=Pe.required,ke=Pe.requiredErrorText,_e=Pe.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Lrt,h({name:R,moleculeId:a,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"switch_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"slider_display_field":case"slider":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ee=int(O,E,N,L);k=Ee.text,be=Ee.required,ke=Ee.requiredErrorText,_e=Ee.validationErrorText,xe=Ee.placeholderText,w=snt(null==c?void 0:c.props,P,L);return je(Art,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"slider_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:null==xe?void 0:xe.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"date_display_field":case"date_picker":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Te=int(O,E,N,L);k=Te.text,be=Te.required,xe=Te.placeholderText,ke=Te.requiredErrorText,_e=Te.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(f4e,h({dateAdapter:ant},{children:je(Ett,h({moleculeId:a,name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,placeholderText:(null==xe?void 0:xe.text)||"",isDisplayOnly:"date_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}))}));case"select_display_field":case"select":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ne=int(O,E,N,L);k=Ne.text,be=Ne.required,xe=Ne.placeholderText,ke=Ne.requiredErrorText,_e=Ne.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Crt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"select_display_field"===i,placeholderText:(null==xe?void 0:xe.text)||"",requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"image":O={image:null==y?void 0:y.image,link:null==y?void 0:y.link},N=Object.keys(O);var ze=int(O,E,N,L),Ae=ze.image,Re=ze.link,Fe=(w=snt(null==c?void 0:c.props,P,L),(null==Ae?void 0:Ae.imageSource)||(null===(d=null==Ae?void 0:Ae.imageFile)||void 0===d?void 0:d.url)||"");return je(Ntt,h({},w,{src:Fe,onClick:function(){return $tt(Re)?null==T?void 0:T((null==Re?void 0:Re.internalLink)||""):Htt(null==Re?void 0:Re.externalLink)},moleculeId:a,configurationItemInfo:G}));case"button":O={text:null==y?void 0:y.text,action:null==y?void 0:y.action},N=Object.keys(O);var Le=int(O,E,N,L),Be=(k=Le.text,Le.action),Ve=(w=snt(null==c?void 0:c.props,P,L),(null==Be?void 0:Be.action)||{}),Ie=Ve.link,qe=Ve.popup,He=Ve.download,$e=Ve.submit,We={link:function(){return $tt(Ie)?T(null==Ie?void 0:Ie.internalLink):Htt(null==Ie?void 0:Ie.externalLink)},popup:function(){(null==qe?void 0:qe.id)&&V(null==qe?void 0:qe.id)},drawer:function(){I(!0)},download:function(){return He?function(e,t){return void 0===e&&(e=""),void 0===t&&(t="Downloaded file"),m(void 0,void 0,void 0,function(){var r,n,o,a;return v(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,i.sent().blob()];case 2:return r=i.sent(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=t,o.click(),URL.revokeObjectURL(n),[3,4];case 3:return a=i.sent(),sit({message:"Failed to download the file: ".concat(a),type:"error"}),[3,4];case 4:return[2]}})})}(He.url,He.name):sit({message:"File not found to download",type:"warning"})},submit:null==l?void 0:l.handleSubmit(function(e){return m(void 0,void 0,void 0,function(){var t,r,n,o;return v(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),_?[4,null==D?void 0:D({formId:_,data:e})]:[3,2];case 1:a.sent(),(t=null===(n=null==$e?void 0:$e.onSuccess)||void 0===n?void 0:n.link)&&($tt(t)?null==T||T(t.internalLink||""):Htt(t.externalLink)),l.reset(),a.label=2;case 2:return[3,4];case 3:return a.sent(),(r=null===(o=null==$e?void 0:$e.onError)||void 0===o?void 0:o.link)&&($tt(r)?null==T||T(r.internalLink||""):Htt(r.externalLink)),[3,4];case 4:return[2]}})})}),reset:function(){return null==l?void 0:l.reset()},destroy:function(){null==l||l.reset(),null==q||q(),null==H||H()}};return je(R2e,h({moleculeId:a,text:(null==k?void 0:k.text)||""},w,{disabled:(null==w?void 0:w.disabled)||W,onClick:null==We?void 0:We[(null===(g=null==Be?void 0:Be.action)||void 0===g?void 0:g.type)||"link"],configurationItemInfo:G}));case"avatar":w=snt(null==c?void 0:c.props,P,L);return je(cnt,h({},w,{sourceDataModelField:F,configurationItemInfo:G}));case"calendar":O={events:null==y?void 0:y.events,config:null==y?void 0:y.config},N=Object.keys(O);var Ue=int(O,E,N,L),Ye=Ue.events,Ze=Ue.config;w=snt(null==c?void 0:c.props,P,L);return je(pnt,h({},w,{events:Ye||[],config:Ze||{},configurationItemInfo:G}));case"drawer":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var Ke=int(O,E,N,L),Ge=Ke.text,Xe=Ke.disabled,Qe=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t,r,n,o,a,i,s,l,c,d=S===e.id,u=e||{},p=u.properties,m=u.config,v=f(u,["properties","config"]),y={},g=[];switch(e.type){case"menu_item":var x=p;y={disabled:null==x?void 0:x.disabled,text:null==x?void 0:x.text,link:null==x?void 0:x.link},g=Object.keys(y);break;case"text_item":var b=p;y={text:null==b?void 0:b.text},g=Object.keys(y);break;case"rich_text_item":var k=p;y={text:null==k?void 0:k.text},g=Object.keys(y);break;case"image_item":var _=p;y={image:null==_?void 0:_.image,alt:null==_?void 0:_.alt,link:null==_?void 0:_.link},g=Object.keys(y);break;default:y={},g=[]}var w=int(y,E,g,d),M=snt(null==m?void 0:m.props,P,d),C=h(h({},v),M);switch(e.type){case"menu_item":return h(h({},C),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null===(r=null==w?void 0:w.disabled)||void 0===r?void 0:r.value)||(null==M?void 0:M.disabled)||!1,text:(null===(n=null==w?void 0:w.text)||void 0===n?void 0:n.text)||"Menu Item",link:null==w?void 0:w.link});case"text_item":return h(h({},C),{text:(null===(o=null==w?void 0:w.text)||void 0===o?void 0:o.text)||""});case"rich_text_item":return h(h({},C),{text:(null===(a=null==w?void 0:w.text)||void 0===a?void 0:a.text)||lot});case"image_item":var D=(null===(i=null==w?void 0:w.image)||void 0===i?void 0:i.imageSource)||(null===(l=null===(s=null==w?void 0:w.image)||void 0===s?void 0:s.imageFile)||void 0===l?void 0:l.url)||"";return h(h({},C),{src:D,alt:(null===(c=null==w?void 0:w.alt)||void 0===c?void 0:c.text)||"Drawer image",link:null==w?void 0:w.link});default:return C}});return je(ert,h({},Qe,{items:ee||[],moleculeId:a,buttonText:(null==Ge?void 0:Ge.text)||(null==Qe?void 0:Qe.buttonText),buttonDisabled:(null==A?void 0:A[a])?null===(x=null==A?void 0:A[a])||void 0===x?void 0:x.disabled:(null==Xe?void 0:Xe.value)||(null==Qe?void 0:Qe.disabled)||!1,configurationItemInfo:G}));case"speed_dial":var Je=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=f(r,["properties","config"]),i={link:null==n?void 0:n.link,text:null==n?void 0:n.text},s=Object.keys(i),l=int(i,E,s,t),c=snt(null==o?void 0:o.props,P,t);return h(h({},a),{config:{props:h(h(h({},null==o?void 0:o.props),c),{tooltipText:(null==c?void 0:c.tooltipText)||""})},properties:{link:(null==l?void 0:l.link)||(null==n?void 0:n.link),text:(null==l?void 0:l.text)||(null==n?void 0:n.text)}})});return je(Grt,h({},Je,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"checkbox":case"checkbox_display":O={label:null==y?void 0:y.label,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var et=int(O,E,N,L),tt=et.label;be=et.required,ke=et.requiredErrorText,_e=et.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Urt,h({name:R,moleculeId:a,label:(null==tt?void 0:tt.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"checkbox_display"===i},w,{configurationItemInfo:G}));case"binary_radio_buttons":case"binary_radio_buttons_display":O={confirmText:null==y?void 0:y.confirmText,rejectText:null==y?void 0:y.rejectText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var rt=int(O,E,N,L),nt=rt.confirmText,ot=rt.rejectText;be=rt.required,ke=rt.requiredErrorText,_e=rt.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Wrt,h({name:R,moleculeId:a,confirmText:(null==nt?void 0:nt.text)||"Yes",rejectText:(null==ot?void 0:ot.text)||"No",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"binary_radio_buttons_display"===i},w,{configurationItemInfo:G}));default:return je(De,{children:"There is no such type of molecule yet."})}}()},Lnt=function(t){var r=t.item,n=t.activeChildrenIds,o=e.useState(),a=o[0],i=o[1],s=e.useMemo(function(){return n.map(function(e){var t=r.items.find(function(t){return t.id===e});return t?function(e){var t,r,n,o=(null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.formStepProps)||{};return h(h({},e),{config:h(h({},e.config),{props:h(h({},null===(n=e.config)||void 0===n?void 0:n.props),{formStepProps:h(h({},o),{order:0})})})})}(t):void 0}).filter(Boolean)},[n,r]);return e.useEffect(function(){i(function(){return h(h({},r),{items:s})})},[r]),a},Bnt=function(t){var r=t.config,n=t.tabsProps,o=t.id,a=t.type,i=t.items,s=t.metadata,l=t.formData,c=t.setFormData,d=t.isMobile,u=t.properties,p=t.isConfigurationMode,f=void 0!==p&&p,m=e.useState(),v=m[0],y=m[1];if(!i||!i.length)return null;var g=d||$b("xs");return je(Wnt,h({userInitials:"UN",logOutHandler:function(){return console.log("log out")},goToAccountInfo:function(){return console.log("account info page")}},{children:je(cS,h({organismMetadata:s,organismId:o,initItems:i,organismBodyId:o,submitHandler:function(e){return new Promise(function(t){setTimeout(function(){t(alert(JSON.stringify(e,null,2)))},600)})},formId:o,isConfigurationMode:f,onConfigurationItemHandler:function(e){y(null==e?void 0:e.entityId)},selectedConfigurationItemId:v},{children:je(Int,{item:{id:o,type:a,items:i,config:r,metadata:s,properties:u,instance:"container"},formData:l,tabsProps:n,isMobile:g,setFormData:c})}))}),"".concat(o,".").concat(g?"mobile":"desktop"))},Vnt=function(e){var t=e.formData,r=e.setFormData,n=e.isMobile,o=f(e,["formData","setFormData","isMobile"]),a=Lnt(o);return a?je(Bnt,h({},a,{isMobile:n,formData:t,setFormData:r})):null},Int=e.memo(function(t){var r,n=t.item,o=t.tabsProps,a=t.formData,i=t.setFormData,s=t.isMobile,l=t.parentId,c=HS(),d=Ynt().stateConfig,u=Hnt(),p=u.organismMetadata,f=u.localStateObject||d;if("molecule"===n.instance)return je(RP,h({additionalInfo:"molecule: ".concat(n.id)},{children:je(Fnt,h({},n,{form:c,isMobile:s,formData:a,parentId:l,tabsProps:o,setFormData:i,metadata:h(h({},n.metadata),{stateListenerId:(null==p?void 0:p.stateListenerId)||n.id})}))}));if(!n.items||!n.items.length)return null;var m="form"===n.type&&(null===(r=n.config.props)||void 0===r?void 0:r.activeChildrenIds)||[];if(m.length)return je(RP,h({additionalInfo:"form: ".concat(n.id)},{children:je(Vnt,{item:n,activeChildrenIds:m,formData:a,setFormData:i,isMobile:s})}));var v=e.useMemo(function(){var e;return null===(e=n.items)||void 0===e?void 0:e.filter(function(e){var t,r,n,o,a,i=null===(n=null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.visible)||void 0===n||n,s=null===(a=null===(o=null==f?void 0:f[e.id])||void 0===o?void 0:o.visible)||void 0===a||a;return i&&s})},[n.items,f]);return je(RP,h({additionalInfo:"container: ".concat(n.id)},{children:je(Jrt,h({},n,{isMobile:s,config:n.config?h(h({},n.config),{props:n.config.props||{},wide:n.config.wide||{},compact:n.config.compact||{}}):{props:{},wide:{},compact:{}}},{children:null==v?void 0:v.map(function(e){return je(Int,{item:e,parentId:e.id,formData:a,setFormData:i,isMobile:s,tabsProps:o},e.id)})}))}))}),qnt=function(){return e.useContext(iS)},Hnt=function(){return e.useContext(sS)},$nt=e.createContext({userInitials:"",logOutHandler:function(){return null},goToAccountInfo:function(){return null},username:""}),Wnt=function(t){var r=t.children,n=t.goToAccountInfo,o=t.userInitials,a=t.logOutHandler,i=t.username,s=e.useMemo(function(){return{logOutHandler:a,goToAccountInfo:n,userInitials:o,username:i}},[a,n,o,i]);return je($nt.Provider,h({value:s},{children:r}))},Unt=e.createContext({stateConfig:{},stateHandler:function(){return null},authenticated:!1}),Ynt=function(){return e.useContext(Unt)},Znt=function(){return e.useContext(ZN)},Knt={pickList:{get:function(e){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2,{data:[]}]})})}},calendar:{createEvent:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2]})})},updateEvent:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2]})})},deleteEvent:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2]})})},getEvents:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2,[]]})})}}},Gnt=e.createContext(Knt),Xnt=function(){var t=e.useContext(Gnt);if(!t)throw new Error("useApi must be used within ApiProvider");return t},Qnt=function(e,t){var r=e.replace(/\D+/g,"");if(!r)return"";var n="",o=0;return t.reduce(function(e,t){return"string"==typeof t?n+=t:o<r.length&&(n+=r[o],o+=1),e},""),n},Jnt=function(e,t){try{var r=new Date(e);if(Number.isNaN(r.getTime()))return e;var n=void 0,o=void 0,a=void 0;switch("string"==typeof e&&(e.endsWith("Z")||e.includes("+")||e.includes("T"))?(n=String(r.getUTCMonth()+1).padStart(2,"0"),o=String(r.getUTCDate()).padStart(2,"0"),a=r.getUTCFullYear()):(n=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0"),a=r.getFullYear()),t){case"DD/MM/YYYY":return"".concat(o,"/").concat(n,"/").concat(a);case"MM/YYYY":return"".concat(n,"/").concat(a);case"YYYY/MM/DD":return"".concat(a,"/").concat(n,"/").concat(o);default:return"".concat(n,"/").concat(o,"/").concat(a)}}catch(t){return e}},eot=function(e){var t,r,n=e.variable,o=e.stateObject,a=e.leaf,i=(null==n?void 0:n.dataModelField)||{},s=i.defaultValue,l=i.dataModelFieldId,c=i.pmiObjectName,d=i.dataFieldName,u=i.dataType,p=i.format,h="[".concat(c," - ").concat(d,"]");if(!o||!l)return a&&(a.text=h),je("span",{children:h});try{r=null===(t=null==o?void 0:o[l])||void 0===t?void 0:t.value}catch(e){r=null}var f=null!=o&&(r||s)||h;if(a&&(a.text=f),!r&&0!==r)return je("span",{children:s||h});var m=String(r);if("date"===u){var v="MM/DD/YYYY";switch(p){case"day_month_year_date":v="DD/MM/YYYY";break;case"month_day_year_date":default:v="MM/DD/YYYY";break;case"year_month_day_date":v="YYYY/MM/DD";break;case"month_year_date":v="MM/YYYY"}m=Jnt(m,v)}else if(p)switch(p){case"phone_number":m=Qnt(m,g_);break;case"us_zip_code":case"zip_code":m=Qnt(m,h_);break;case"day_month_year_date":m=Jnt(m,"DD/MM/YYYY");break;case"month_day_year_date":m=Jnt(m,"MM/DD/YYYY");break;case"year_month_day_date":m=Jnt(m,"YYYY/MM/DD");break;case"month_year_date":m=Jnt(m,"MM/YYYY");break;case"numeric":var y=Number(r);m=Number.isNaN(y)?String(r):String(y);break;case"integer":var g=Number(r);m=Number.isNaN(g)?String(r):String(Math.floor(g));break;case"email":case"text":case"string":case"any":default:m=String(r);break;case"password":m="*".repeat(String(r).length)}return je("span",{children:m})},tot=qe.span(Dnt||(Dnt=g(["\n ","\n"],["\n ","\n"])),function(e){var t=e.$color,r=e.$backgroundColor,n=e.$fontSize,o=e.$fontFamily,a=e.$letterSpacing,i=e.$lineHeight;return Ee(Cnt||(Cnt=g(["\n ","\n ","\n ","\n ","\n ","\n ","\n "],["\n ","\n ","\n ","\n ","\n ","\n ","\n "])),t&&"color: ".concat(t," !important;"),r&&"background-color: ".concat(r," !important;"),n&&"font-size: ".concat(n," !important;"),o&&"\n font-family: ".concat(o," !important;\n \n /* More aggressive font-family overrides */\n &, & *, & span, & a, & [contenteditable] {\n font-family: ").concat(o," !important;\n }\n "),a&&"letter-spacing: ".concat(a," !important;"),i&&"line-height: ".concat(i," !important;"))}),rot=function(e){var t,r,n,o=e.leaf,a=e.children,i=e.attributes,s=aS(),l=s.showAnnotations,c=s.annotationsList,d=s.isMLRReview,u=Hnt(),p=u.isPreview,f=u.localStateObject,m=Ynt().stateConfig,v=f||m;if(o.tag){var y=c.tags.findIndex(function(e){var t,r=e.id;return(null===(t=o.tag)||void 0===t?void 0:t.id)===r})+1;d&&l&&y&&(a=Oe(zg,h({component:"span",display:"inline-flex",direction:"row",alignItems:"center",gap:.5,id:not},((t={})["data-".concat(aot)]=null===(n=o.tag)||void 0===n?void 0:n.id,t),{children:[je("span",h({style:{backgroundColor:"#FFF0D0B5"}},{children:a})),je(Ck,{index:c.tags.findIndex(function(e){var t,r,n=e.id,a=e.label;return(null===(t=o.tag)||void 0===t?void 0:t.id)===n||(null===(r=o.tag)||void 0===r?void 0:r.label)===a})+1,type:"message"})]})))}if(o.bold&&(a=je("span",h({style:{fontWeight:"bold"}},{children:a}))),o.strikethrough&&(a=je("s",{children:a})),o.italic&&(a=je("span",h({style:{fontStyle:"italic"}},{children:a}))),o.underline&&(a=je("u",{children:a})),(o.color||o.bgColor||o.fontSize||o.fontFamily||o.letterSpacing||o.lineHeight)&&(a=je(tot,h({$color:o.color,$backgroundColor:o.bgColor,$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight},{children:a}))),o.variable&&(a=je(tot,h({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color},{children:je(eot,h({variable:o.variable,stateObject:v,leaf:o},{children:a}))}))),o.communicationLink){var g=o.communicationLink,x=g.type,b=g.url,k="internalLink"===x,_=k?Wtt(b,p):b,w=c.links.findIndex(function(e){return b===e.url&&o.text===e.text})+1;a=je(De,{children:d&&l&&w?Oe(zg,h({component:"span",display:"inline-flex",alignItems:"center",gap:.2,marginBottom:.2,id:oot},(r={},r["data-".concat(iot)]=b,r["data-".concat(sot)]=o.text,r),{children:[je(tot,h({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Ze.colors.blue},{children:je("a",h({},i,{href:_,target:k?"_self":"_blank"},{children:a}))})),je(Ck,{index:w,type:"link"})]})):je(tot,h({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Ze.colors.blue},{children:je("a",h({},i,{href:_,target:k?"_self":"_blank"},{children:a}))}))})}return je("span",h({},i,{children:a}))},not="matrix-message",oot="communication-link",aot="matrix-message-id",iot="communication-link-url",sot="communication-link-text",lot=[{type:"paragraph",children:[{text:""}]}],cot=function(t){var r=t.value;t.numberOfLines;var n=e.useMemo(function(){return QO((()=>{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:t=>{for(var r of SM.pathRefs(e))BM.transform(r,t);for(var n of SM.pointRefs(e))HM.transform(n,t);for(var o of SM.rangeRefs(e))YM.transform(o,t);var a,i,s=Bw.get(e)||[],l=Vw.get(e)||new Set,c=e=>{if(e){var t=e.join(",");i.has(t)||(i.add(t),a.push(e))}};if(LM.operationCanTransformPath(t))for(var d of(a=[],i=new Set,s))c(LM.transform(d,t));else a=s,i=l;var u=e.getDirtyPaths(t);for(var p of u)c(p);Bw.set(e,a),Vw.set(e,i),xC.transform(e,t),e.operations.push(t),SM.normalize(e),"set_selection"===t.type&&(e.marks=null),Iw.get(e)||(Iw.set(e,!0),Promise.resolve().then(()=>{Iw.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,r)=>{var{selection:n,markableVoid:o}=e;if(n){var a=(t,r)=>{if(!tC.isText(t))return!1;var[n,o]=SM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},i=UM.isExpanded(n),s=!1;if(!i){var[l,c]=SM.node(e,n);if(l&&a(l,c)){var[d]=SM.parent(e,c);s=d&&e.markableVoid(d)}}if(i||s)xC.setNodes(e,{[t]:r},{match:a,split:!0,voids:!0});else{var u=Yw(Yw({},SM.marks(e)||{}),{},{[t]:r});e.marks=u,Iw.get(e)||e.onChange()}}},deleteBackward:t=>{var{selection:r}=e;r&&UM.isCollapsed(r)&&xC.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:r}=e;r&&UM.isCollapsed(r)&&xC.delete(e,{unit:t})},deleteFragment:t=>{var{selection:r}=e;r&&UM.isExpanded(r)&&xC.delete(e,{reverse:"backward"===t})},getFragment:()=>{var{selection:t}=e;return t?zM.fragment(e,t):[]},insertBreak:()=>{xC.splitNodes(e,{always:!0})},insertSoftBreak:()=>{xC.splitNodes(e,{always:!0})},insertFragment:t=>{xC.insertFragment(e,t)},insertNode:t=>{xC.insertNodes(e,t)},insertText:t=>{var{selection:r,marks:n}=e;if(r){if(n){var o=Yw({text:t},n);xC.insertNodes(e,o)}else xC.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[r,n]=t;if(!tC.isText(r))if(wM.isElement(r)&&0===r.children.length)xC.insertNodes(e,{text:""},{at:n.concat(0),voids:!0});else for(var o=!SM.isEditor(r)&&wM.isElement(r)&&(e.isInline(r)||0===r.children.length||tC.isText(r.children[0])||e.isInline(r.children[0])),a=0,i=0;i<r.children.length;i++,a++){var s=zM.get(e,n);if(!tC.isText(s)){var l=r.children[i],c=s.children[a-1],d=i===r.children.length-1;(tC.isText(l)||wM.isElement(l)&&e.isInline(l))!==o?(xC.removeNodes(e,{at:n.concat(a),voids:!0}),a--):wM.isElement(l)?e.isInline(l)&&(null!=c&&tC.isText(c)?d&&(xC.insertNodes(e,{text:""},{at:n.concat(a+1),voids:!0}),a++):(xC.insertNodes(e,{text:""},{at:n.concat(a),voids:!0}),a++)):null!=c&&tC.isText(c)&&(tC.equals(l,c,{loose:!0})?(xC.mergeNodes(e,{at:n.concat(a),voids:!0}),a--):""===c.text?(xC.removeNodes(e,{at:n.concat(a-1),voids:!0}),a--):""===l.text&&(xC.removeNodes(e,{at:n.concat(a),voids:!0}),a--))}}},removeMark:t=>{var{selection:r}=e;if(r){var n=(t,r)=>{if(!tC.isText(t))return!1;var[n,o]=SM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},o=UM.isExpanded(r),a=!1;if(!o){var[i,s]=SM.node(e,r);if(i&&n(i,s)){var[l]=SM.parent(e,s);a=l&&e.markableVoid(l)}}if(o||a)xC.unsetNodes(e,t,{match:n,split:!0,voids:!0});else{var c=Yw({},SM.marks(e)||{});delete c[t],e.marks=c,Iw.get(e)||e.onChange()}}},getDirtyPaths:e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return LM.levels(t);case"insert_node":var{node:r,path:n}=e,o=LM.levels(n),a=tC.isText(r)?[]:Array.from(zM.nodes(r),e=>{var[,t]=e;return n.concat(t)});return[...o,...a];case"merge_node":var{path:i}=e;return[...LM.ancestors(i),LM.previous(i)];case"move_node":var{path:s,newPath:l}=e;if(LM.equals(s,l))return[];var c=[],d=[];for(var u of LM.ancestors(s)){var p=LM.transform(u,e);c.push(p)}for(var h of LM.ancestors(l)){var f=LM.transform(h,e);d.push(f)}var m=d[d.length-1],v=l[l.length-1],y=m.concat(v);return[...c,...d,y];case"remove_node":var{path:g}=e;return[...LM.ancestors(g)];case"split_node":var{path:x}=e;return[...LM.levels(x),LM.next(x)];default:return[]}}};return e})())},[]),o=lot;if(null==r||"string"!=typeof r)o=lot;else{var a=r.replace(/\\/g,"");try{o=JSON.parse(r)}catch(e){console.error(e,"Value was parsed incorrectly. Trying to parse it...");try{o=JSON.parse(a)}catch(e){console.error(e,"Most probably that it's not possible to parse this value")}}}return je($O,h({editor:n,value:o},{children:je(TO,{readOnly:!0,renderLeaf:function(e){return je(rot,h({},e))},placeholder:o===lot?"No content available":"",renderElement:function(e){return je(eS,h({},e))}})}),JSON.stringify(o))},dot=qe.div(jnt||(jnt=g(["\n ",";\n\n ",";\n"],["\n ",";\n\n ",";\n"])),function(e){var t=e.theme.colors,r=e.hasError,n=e.disabled,o=e.isOpen,a=e.isEditMode;return"\n .select-wrapper {\n text-align: left;\n border: ".concat(a?"1px solid ".concat(t.gray3):"none",";\n position: relative;\n border-radius: ").concat(sizes.S,"px;\n &:hover,\n &:active,\n &:focus {\n border-color: ").concat(t.gray2,";\n }\n\n .select-input {\n padding: ").concat(a?"10px ".concat(sizes.S,"px 10px ").concat(sizes.M,"px"):"0",";\n display: flex;\n user-select: none;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n cursor: ").concat(a?"pointer":"default",";\n\n .icon-container {\n max-height: 33px;\n transform: rotate(0deg);\n transition: transform 0.2s ease-in-out;\n ").concat(o&&"transform: rotate(180deg);","\n }\n }\n\n ").concat(n&&"\n border-color: ".concat(t.gray4," !important;\n cursor: not-allowed;\n .select-input {\n background-color: ").concat(t.gray4,";\n pointer-events: none;\n .selected-text-value {\n color: ").concat(t.gray3,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.gray3,";\n }\n }\n }\n "),"\n \n ").concat(r&&"\n border-color: ".concat(t.red," !important;\n .select-input {\n .selected-text-value {\n color: ").concat(t.red,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.red,";\n }\n }\n }\n "),"\n ")},function(e){return e.$styles}),uot=qe.div(Ont||(Ont=g(["\n ",";\n"],["\n ",";\n"])),function(e){var t=e.theme,r=t.colors,n=t.sizes;return"\n position: absolute;\n width: 100%;\n border-radius: ".concat(n.S,"px;\n padding: ").concat(n.L,"px ").concat(n.M,"px;\n box-shadow: 0 0 ").concat(n.XL,"px 0 #0000001a;\n overflow: auto;\n max-height: 150px;\n z-index: 10;\n transform: translateY(").concat(n.S,"px);\n background-color: ").concat(r.white,";\n ")}),pot=qe.div(Snt||(Snt=g(["\n width: 100%;\n cursor: pointer;\n ",";\n"],["\n width: 100%;\n cursor: pointer;\n ",";\n"])),function(e){var t=e.theme,r=t.sizes,n=t.colors,o=t.fonts,a=e.$selected;return"\n border-radius: ".concat(r.S,"px;\n &:hover {\n background-color: ").concat(n.gray5,";\n }\n padding: ").concat(r.S,"px ").concat(r.M,"px;\n ").concat(o.M,";\n color: ").concat(n.gray2,";\n ").concat(a&&"\n background-color: ".concat(n.gray4," !important;\n color: ").concat(n.black,";\n "),";\n ")}),hot=function(e,t){void 0===t&&(t=!1);var r=e||{},n=r.horizontalPadding,o=void 0===n?0:n,a=r.verticalPadding,i=void 0===a?0:a,s=r.selectedTextColor,l=r.selectedTextFontSize,c=r.placeholderTextColor,d=r.placeholderTextFontSize,u=r.styles,p=r.wrapperStyles;return Ee(Ent||(Ent=g(["\n ",";\n "],["\n ",";\n "])),function(e){var r=e.theme.colors;return Ee(Pnt||(Pnt=g(["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "],["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "])),i||o?"padding: ".concat(i,"px ").concat(o,"px;"):"",t?"\n ".concat(s?"color: ".concat(r[s]||s,";"):"",";\n ").concat(l?"font-size: ".concat(l,"px;"):"",";\n "):"\n ".concat(c?"color: ".concat(r[c]||c,";"):"",";\n ").concat(d?"font-size: ".concat(d,"px;"):"",";\n "),u,p)})},fot=Te(Tnt||(Tnt=g(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"],["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),mot=qe.div(Nnt||(Nnt=g(["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"],["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"])),function(e){var t=e.theme,r=e.color,n=void 0===r?"secondary":r;return t.colors[n]},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},fot);function vot(e,t){if(null==e)return{};var r,n,o=xs(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function yot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function got(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yot(Object(r),!0).forEach(function(t){F9e(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yot(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function xot(e,t){this.v=e,this.k=t}function bot(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bot=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){bot(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},bot(e,t,r,n)}function kot(){
9547
+ */function At(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Rt(...e){return t=>{let r=!1;const n=e.map(e=>{const n=At(e,t);return!r&&"function"==typeof n&&(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():At(e[t],null)}}}}function Ft(...e){return a.useCallback(Rt(...e),e)}function Lt(e){const r=function(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(o.ref=t?Rt(t,e):e),a.cloneElement(r,o)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=a.forwardRef((e,n)=>{const{children:o,...i}=e,s=a.Children.toArray(o),l=s.find(qt);if(l){const e=l.props.children,o=s.map(t=>t===l?a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null:t);return t.jsx(r,{...i,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,o):null})}return t.jsx(r,{...i,ref:n,children:o})});return n.displayName=`${e}.Slot`,n}var Bt=Lt("Slot");var Vt=Symbol("radix.slottable");function It(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=Vt,r}function qt(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Vt}function Ht(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Ht(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function $t(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ht(e))&&(n&&(n+=" "),n+=t);return n}const Wt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Ut=$t,Yt=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Ut(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=Wt(t)||Wt(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return Ut(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},Zt=e=>{const t=Qt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),Kt(r,t)||Xt(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},Kt=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?Kt(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(r=t.validators.find(({validator:e})=>e(i)))?void 0:r.classGroupId},Gt=/^\[(.+)\]$/,Xt=e=>{if(Gt.test(e)){const t=Gt.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Qt=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return rr(Object.entries(e.classGroups),r).forEach(([e,r])=>{Jt(r,n,e,t)}),n},Jt=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:er(t,e)).classGroupId=r)}if("function"==typeof e)return tr(e)?void Jt(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{Jt(o,er(t,e),r,n)})})},er=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},tr=e=>e.isThemeGetter,rr=(e,t)=>t?e.map(([e,r])=>{const n=r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e);return[e,n]}):e,nr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},or=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{const r=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===s){if(d===o&&(n||e.slice(c,c+a)===t)){r.push(e.slice(l,c)),l=c+a;continue}if("/"===d){i=c;continue}}"["===d?s++:"]"===d&&s--}const c=0===r.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:r,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i},ar=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},ir=/\s+/;function sr(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=lr(e))&&(n&&(n+=" "),n+=t);return n}const lr=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=lr(e[n]))&&(r&&(r+=" "),r+=t);return r};const cr=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},dr=/^\[(?:([a-z-]+):)?(.+)\]$/i,ur=/^\d+\/\d+$/,pr=new Set(["px","full","screen"]),hr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fr=/\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$/,mr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gr=e=>br(e)||pr.has(e)||ur.test(e),xr=e=>Nr(e,"length",zr),br=e=>!!e&&!Number.isNaN(Number(e)),kr=e=>Nr(e,"number",br),_r=e=>!!e&&Number.isInteger(Number(e)),wr=e=>e.endsWith("%")&&br(e.slice(0,-1)),Mr=e=>dr.test(e),Cr=e=>hr.test(e),Dr=new Set(["length","size","percentage"]),jr=e=>Nr(e,Dr,Ar),Or=e=>Nr(e,"position",Ar),Sr=new Set(["image","url"]),Pr=e=>Nr(e,Sr,Fr),Er=e=>Nr(e,"",Rr),Tr=()=>!0,Nr=(e,t,r)=>{const n=dr.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},zr=e=>fr.test(e)&&!mr.test(e),Ar=()=>!1,Rr=e=>vr.test(e),Fr=e=>yr.test(e),Lr=function(e,...t){let r,n,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:nr(e.cacheSize),parseClassName:or(e),...Zt(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(ir);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=r(t);let p=!!u,h=n(p?d.substring(0,u):d);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=n(d),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=ar(l).join(":"),m=c?f+"!":f,v=m+h;if(a.includes(v))continue;a.push(v);const y=o(h,p);for(let e=0;e<y.length;++e){const t=y[e];a.push(m+t)}s=t+(s.length>0?" "+s:s)}return s})(e,r);return o(e,a),a}return function(){return a(sr.apply(null,arguments))}}(()=>{const e=cr("colors"),t=cr("spacing"),r=cr("blur"),n=cr("brightness"),o=cr("borderColor"),a=cr("borderRadius"),i=cr("borderSpacing"),s=cr("borderWidth"),l=cr("contrast"),c=cr("grayscale"),d=cr("hueRotate"),u=cr("invert"),p=cr("gap"),h=cr("gradientColorStops"),f=cr("gradientColorStopPositions"),m=cr("inset"),v=cr("margin"),y=cr("opacity"),g=cr("padding"),x=cr("saturate"),b=cr("scale"),k=cr("sepia"),_=cr("skew"),w=cr("space"),M=cr("translate"),C=()=>["auto",Mr,t],D=()=>[Mr,t],j=()=>["",gr,xr],O=()=>["auto",br,Mr],S=()=>["","0",Mr],P=()=>[br,Mr];return{cacheSize:500,separator:":",theme:{colors:[Tr],spacing:[gr,xr],blur:["none","",Cr,Mr],brightness:P(),borderColor:[e],borderRadius:["none","","full",Cr,Mr],borderSpacing:D(),borderWidth:j(),contrast:P(),grayscale:S(),hueRotate:P(),invert:S(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[wr,xr],inset:C(),margin:C(),opacity:P(),padding:D(),saturate:P(),scale:P(),sepia:S(),skew:P(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Mr]}],container:["container"],columns:[{columns:[Cr]}],"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",Mr]}],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",_r,Mr]}],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",Mr]}],grow:[{grow:S()}],shrink:[{shrink:S()}],order:[{order:["first","last","none",_r,Mr]}],"grid-cols":[{"grid-cols":[Tr]}],"col-start-end":[{col:["auto",{span:["full",_r,Mr]},Mr]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[Tr]}],"row-start-end":[{row:["auto",{span:[_r,Mr]},Mr]}],"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",Mr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Mr]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"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:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Mr,t]}],"min-w":[{"min-w":[Mr,t,"min","max","fit"]}],"max-w":[{"max-w":[Mr,t,"none","full","min","max","fit","prose",{screen:[Cr]},Cr]}],h:[{h:[Mr,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Mr,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Mr,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Mr,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Cr,xr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",kr]}],"font-family":[{font:[Tr]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Mr]}],"line-clamp":[{"line-clamp":["none",br,kr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gr,Mr]}],"list-image":[{"list-image":["none",Mr]}],"list-style-type":[{list:["none","disc","decimal",Mr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"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",gr,xr]}],"underline-offset":[{"underline-offset":["auto",gr,Mr]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Mr]}],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",Mr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",Or]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Pr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"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-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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":[gr,Mr]}],"outline-w":[{outline:[gr,xr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[gr,xr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Cr,Er]}],"shadow-color":[{shadow:[Tr]}],opacity:[{opacity:[y]}],"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:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Cr,Mr]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Mr]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Mr]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Mr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[_r,Mr]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Mr]}],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",Mr]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Mr]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gr,xr,kr]}],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-s","border-color-e","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"]}}});function Br(...e){return Lr($t(e))}const Vr=Yt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ir=a.forwardRef(({className:e,variant:r,size:n,asChild:o=!1,...a},i)=>{const s=o?Bt:"button";return t.jsx(s,{className:Br(Vr({variant:r,size:n,className:e})),ref:i,...a})});Ir.displayName="Button";const qr=r.createContext({});function Hr(e){const t=r.useRef(null);return null===t.current&&(t.current=e()),t.current}const $r=r.createContext(null),Wr=r.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Ur extends a.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 Yr({children:e,isPresent:n}){const o=r.useId(),i=r.useRef(null),s=r.useRef({width:0,height:0,top:0,left:0}),{nonce:l}=r.useContext(Wr);return r.useInsertionEffect(()=>{const{width:e,height:t,top:r,left:a}=s.current;if(n||!i.current||!e||!t)return;i.current.dataset.motionPopId=o;const c=document.createElement("style");return l&&(c.nonce=l),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n top: ${r}px !important;\n left: ${a}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),t.jsx(Ur,{isPresent:n,childRef:i,sizeRef:s,children:a.cloneElement(e,{ref:i})})}const Zr=({children:e,initial:n,isPresent:o,onExitComplete:i,custom:s,presenceAffectsLayout:l,mode:c})=>{const d=Hr(Kr),u=r.useId(),p=r.useCallback(e=>{d.set(e,!0);for(const e of d.values())if(!e)return;i&&i()},[d,i]),h=r.useMemo(()=>({id:u,initial:n,isPresent:o,custom:s,onExitComplete:p,register:e=>(d.set(e,!1),()=>d.delete(e))}),l?[Math.random(),p]:[o,p]);return r.useMemo(()=>{d.forEach((e,t)=>d.set(t,!1))},[o]),a.useEffect(()=>{!o&&!d.size&&i&&i()},[o]),"popLayout"===c&&(e=t.jsx(Yr,{isPresent:o,children:e})),t.jsx($r.Provider,{value:h,children:e})};function Kr(){return new Map}function Gr(e=!0){const t=r.useContext($r);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:a}=t,i=r.useId();r.useEffect(()=>{e&&a(i)},[e]);const s=r.useCallback(()=>e&&o&&o(i),[i,o,e]);return!n&&o?[!1,s]:[!0]}const Xr=e=>e.key||"";function Qr(e){const t=[];return r.Children.forEach(e,e=>{r.isValidElement(e)&&t.push(e)}),t}const Jr=typeof window<"u",en=Jr?r.useLayoutEffect:r.useEffect,tn=({children:e,custom:n,initial:o=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,d]=Gr(l),u=r.useMemo(()=>Qr(e),[e]),p=l&&!c?[]:u.map(Xr),h=r.useRef(!0),f=r.useRef(u),m=Hr(()=>new Map),[v,y]=r.useState(u),[g,x]=r.useState(u);en(()=>{h.current=!1,f.current=u;for(let e=0;e<g.length;e++){const t=Xr(g[e]);p.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}},[g,p.length,p.join("-")]);const b=[];if(u!==v){let e=[...u];for(let t=0;t<g.length;t++){const r=g[t],n=Xr(r);p.includes(n)||(e.splice(t,0,r),b.push(r))}return"wait"===s&&b.length&&(e=b),x(Qr(e)),void y(u)}"production"!==process.env.NODE_ENV&&"wait"===s&&g.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:k}=r.useContext(qr);return t.jsx(t.Fragment,{children:g.map(e=>{const r=Xr(e),v=!(l&&!c)&&(u===g||p.includes(r));return t.jsx(Zr,{isPresent:v,initial:!(h.current&&!o)&&void 0,custom:v?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:v?void 0:()=>{if(!m.has(r))return;m.set(r,!0);let e=!0;m.forEach(t=>{t||(e=!1)}),e&&(null==k||k(),x(f.current),l&&(null==d||d()),a&&a())},children:e},r)})})},rn=e=>e;let nn=rn,on=rn;function an(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(nn=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},on=(e,t)=>{if(!e)throw new Error(t)});const sn=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},ln=e=>1e3*e,cn=e=>e/1e3,dn=!1;const un=["read","resolveKeyframes","update","preRender","render","postRender"];function pn(e,t){let r=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=un.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&n?t:r;return o&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),a.delete(e)},process:e=>{i=e,n?o=!0:(n=!0,[t,r]=[r,t],t.forEach(s),t.clear(),n=!1,o&&(o=!1,l.process(e)))}};return l}(a),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=i,h=()=>{const a=performance.now();r=!1,o.delta=n?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),d.process(o),u.process(o),p.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))};return{schedule:un.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(r||(r=!0,n=!0,o.isProcessing||e(h)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<un.length;t++)i[un[t]].cancel(e)},state:o,steps:i}}const{schedule:hn,cancel:fn,state:mn,steps:vn}=pn(typeof requestAnimationFrame<"u"?requestAnimationFrame:rn,!0),yn=r.createContext({strict:!1}),gn={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"]},xn={};for(const e in gn)xn[e]={isEnabled:t=>gn[e].some(e=>!!t[e])};const bn=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 kn(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bn.has(e)}let _n=e=>!kn(e);try{!function(e){e&&(_n=t=>t.startsWith("on")?!kn(t):e(t))}(unt.default)}catch{}const wn=new Set;function Mn(e,t,r){e||wn.has(t)||(console.warn(t),wn.add(t))}const Cn=r.createContext({});function Dn(e){return"string"==typeof e||Array.isArray(e)}function jn(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const On=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...On];function Pn(e){return jn(e.animate)||Sn.some(t=>Dn(e[t]))}function En(e){return!(!Pn(e)&&!e.variants)}function Tn(e){const{initial:t,animate:n}=function(e,t){if(Pn(e)){const{initial:t,animate:r}=e;return{initial:!1===t||Dn(t)?t:void 0,animate:Dn(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,r.useContext(Cn));return r.useMemo(()=>({initial:t,animate:n}),[Nn(t),Nn(n)])}function Nn(e){return Array.isArray(e)?e.join(" "):e}const zn=Symbol.for("motionComponentSymbol");function An(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Rn(e,t,n){return r.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):An(n)&&(n.current=r))},[t])}const Fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ln="data-"+Fn("framerAppearId"),{schedule:Bn}=pn(queueMicrotask,!1),Vn=r.createContext({});function In(e,t,n,o,a){var i,s;const{visualElement:l}=r.useContext(Cn),c=r.useContext(yn),d=r.useContext($r),u=r.useContext(Wr).reducedMotion,p=r.useRef(null);o=o||c.renderer,!p.current&&o&&(p.current=o(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:u}));const h=p.current,f=r.useContext(Vn);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,r,n){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:qn(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&An(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}(p.current,n,a,f);const m=r.useRef(!1);r.useInsertionEffect(()=>{h&&m.current&&h.update(n,d)});const v=n[Ln],y=r.useRef(!!v&&!(null!==(i=window.MotionHandoffIsComplete)&&void 0!==i&&i.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return en(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Bn.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),r.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),y.current=!1))}),h}function qn(e){if(e)return!1!==e.options.allowProjection?e.projection:qn(e.parent)}function Hn({preloadedFeatures:e,createVisualElement:n,useRender:o,useVisualState:a,Component:i}){var s,l;function c(s,l){let c;const d={...r.useContext(Wr),...s,layoutId:$n(s)},{isStatic:u}=d,p=Tn(s),h=a(s,u);if(!u&&Jr){!function(e,t){const n=r.useContext(yn).strict;if("production"!==process.env.NODE_ENV&&t&&n){const t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?nn(!1,t):on(!1,t)}}(d,e);const t=function(e){const{drag:t,layout:r}=xn;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:null!=t&&t.isEnabled(e)||null!=r&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(d);c=t.MeasureLayout,p.visualElement=In(i,h,d,n,t.ProjectionNode)}return t.jsxs(Cn.Provider,{value:p,children:[c&&p.visualElement?t.jsx(c,{visualElement:p.visualElement,...d}):null,o(i,s,Rn(h,p.visualElement,l),h,u,p.visualElement)]})}e&&function(e){for(const t in e)xn[t]={...xn[t],...e[t]}}(e),c.displayName=`motion.${"string"==typeof i?i:`create(${null!==(l=null!==(s=i.displayName)&&void 0!==s?s:i.name)&&void 0!==l?l:""})`}`;const d=r.forwardRef(c);return d[zn]=i,d}function $n({layoutId:e}){const t=r.useContext(qr).id;return t&&void 0!==e?t+"-"+e:e}const Wn=["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 Un(e){return"string"==typeof e&&!e.includes("-")&&!!(Wn.indexOf(e)>-1||/[A-Z]/u.test(e))}function Yn(e){const t=[{},{}];return null==e||e.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function Zn(e,t,r,n){if("function"==typeof t){const[o,a]=Yn(n);t=t(void 0!==r?r:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=Yn(n);t=t(void 0!==r?r:e.custom,o,a)}return t}const Kn=e=>Array.isArray(e),Gn=e=>Kn(e)?e[e.length-1]||0:e,Xn=e=>!(!e||!e.getVelocity);function Qn(e){const t=Xn(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Jn=e=>(t,n)=>{const o=r.useContext(Cn),a=r.useContext($r),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},n,o,a){const i={latestValues:eo(n,o,a,e),renderState:t()};return r&&(i.onMount=e=>r({props:n,current:e,...i}),i.onUpdate=e=>r(e)),i}(e,t,o,a);return n?i():Hr(i)};function eo(e,t,r,n){const o={},a=n(e,{});for(const e in a)o[e]=Qn(a[e]);let{initial:i,animate:s}=e;const l=Pn(e),c=En(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let d=!!r&&!1===r.initial;d=d||!1===i;const u=d?s:i;if(u&&"boolean"!=typeof u&&!jn(u)){const t=Array.isArray(u)?u:[u];for(let r=0;r<t.length;r++){const n=Zn(e,t[r]);if(n){const{transitionEnd:e,transition:t,...r}=n;for(const e in r){let t=r[e];if(Array.isArray(t)){t=t[d?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const to=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ro=new Set(to),no=e=>t=>"string"==typeof t&&t.startsWith(e),oo=no("--"),ao=no("var(--"),io=e=>!!ao(e)&&so.test(e.split("/*")[0].trim()),so=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,lo=(e,t)=>t&&"number"==typeof e?t.transform(e):e,co=(e,t,r)=>r>t?t:r<e?e:r,uo={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},po={...uo,transform:e=>co(0,1,e)},ho={...uo,default:1},fo=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),mo=fo("deg"),vo=fo("%"),yo=fo("px"),go=fo("vh"),xo=fo("vw"),bo={...vo,parse:e=>vo.parse(e)/100,transform:e=>vo.transform(100*e)},ko={borderWidth:yo,borderTopWidth:yo,borderRightWidth:yo,borderBottomWidth:yo,borderLeftWidth:yo,borderRadius:yo,radius:yo,borderTopLeftRadius:yo,borderTopRightRadius:yo,borderBottomRightRadius:yo,borderBottomLeftRadius:yo,width:yo,maxWidth:yo,height:yo,maxHeight:yo,top:yo,right:yo,bottom:yo,left:yo,padding:yo,paddingTop:yo,paddingRight:yo,paddingBottom:yo,paddingLeft:yo,margin:yo,marginTop:yo,marginRight:yo,marginBottom:yo,marginLeft:yo,backgroundPositionX:yo,backgroundPositionY:yo},_o={rotate:mo,rotateX:mo,rotateY:mo,rotateZ:mo,scale:ho,scaleX:ho,scaleY:ho,scaleZ:ho,skew:mo,skewX:mo,skewY:mo,distance:yo,translateX:yo,translateY:yo,translateZ:yo,x:yo,y:yo,z:yo,perspective:yo,transformPerspective:yo,opacity:po,originX:bo,originY:bo,originZ:yo},wo={...uo,transform:Math.round},Mo={...ko,..._o,zIndex:wo,size:yo,fillOpacity:po,strokeOpacity:po,numOctaves:wo},Co={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Do=to.length;function jo(e,t,r){const{style:n,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const r=t[e];if(ro.has(e))i=!0;else if(oo(e))o[e]=r;else{const t=lo(r,Mo[e]);e.startsWith("origin")?(s=!0,a[e]=t):n[e]=t}}if(t.transform||(i||r?n.transform=function(e,t,r){let n="",o=!0;for(let a=0;a<Do;a++){const i=to[a],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||r){const e=lo(s,Mo[i]);l||(o=!1,n+=`${Co[i]||i}(${e}) `),r&&(t[i]=e)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:r=0}=a;n.transformOrigin=`${e} ${t} ${r}`}}const Oo={offset:"stroke-dashoffset",array:"stroke-dasharray"},So={offset:"strokeDashoffset",array:"strokeDasharray"};function Po(e,t,r){return"string"==typeof e?e:yo.transform(t+r*e)}function Eo(e,{attrX:t,attrY:r,attrScale:n,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},d,u){if(jo(e,c,u),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:f}=e;p.transform&&(f&&(h.transform=p.transform),delete p.transform),f&&(void 0!==o||void 0!==a||h.transform)&&(h.transformOrigin=function(e,t,r){return`${Po(t,e.x,e.width)} ${Po(r,e.y,e.height)}`}(f,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(p.x=t),void 0!==r&&(p.y=r),void 0!==n&&(p.scale=n),void 0!==i&&function(e,t,r=1,n=0,o=!0){e.pathLength=1;const a=o?Oo:So;e[a.offset]=yo.transform(-n);const i=yo.transform(t),s=yo.transform(r);e[a.array]=`${i} ${s}`}(p,i,s,l,!1)}const To=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),No=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),zo=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ao(e,{style:t,vars:r},n,o){Object.assign(e.style,t,o&&o.getProjectionStyles(n));for(const t in r)e.style.setProperty(t,r[t])}const Ro=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 Fo(e,t,r,n){Ao(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(Ro.has(r)?r:Fn(r),t.attrs[r])}const Lo={};function Bo(e,{layout:t,layoutId:r}){return ro.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!Lo[e]||"opacity"===e)}function Vo(e,t,r){var n;const{style:o}=e,a={};for(const i in o)(Xn(o[i])||t.style&&Xn(t.style[i])||Bo(i,e)||void 0!==(null===(n=null==r?void 0:r.getValue(i))||void 0===n?void 0:n.liveStyle))&&(a[i]=o[i]);return a}function Io(e,t,r){const n=Vo(e,t,r);for(const r in e)if(Xn(e[r])||Xn(t[r])){n[-1!==to.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}const qo=["x","y","width","height","cx","cy","r"],Ho={useVisualState:Jn({scrapeMotionValuesFromProps:Io,createRenderState:No,onUpdate:({props:e,prevProps:t,current:r,renderState:n,latestValues:o})=>{if(!r)return;let a=!!e.drag;if(!a)for(const e in o)if(ro.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let r=0;r<qo.length;r++){const n=qo[r];e[n]!==t[n]&&(i=!0)}i&&hn.read(()=>{(function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}})(r,n),hn.render(()=>{Eo(n,o,zo(r.tagName),e.transformTemplate),Fo(r,n)})})}})},$o={useVisualState:Jn({scrapeMotionValuesFromProps:Vo,createRenderState:To})};function Wo(e,t,r){for(const n in t)!Xn(t[n])&&!Bo(n,r)&&(e[n]=t[n])}function Uo(e,t){const n={};return Wo(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return r.useMemo(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return jo(r,t,e),Object.assign({},r.vars,r.style)},[t])}(e,t)),n}function Yo(e,t){const r={},n=Uo(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}function Zo(e,t,n,o){const a=r.useMemo(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Eo(r,t,zo(o),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const t={};Wo(t,e.style,e),a.style={...t,...a.style}}return a}function Ko(e=!1){return(t,n,o,{latestValues:a},i)=>{const s=(Un(t)?Zo:Yo)(n,a,i,t),l=function(e,t,r){const n={};for(const o in e)"values"===o&&"object"==typeof e.values||(_n(o)||!0===r&&kn(o)||!t&&!kn(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}(n,"string"==typeof t,e),c=t!==r.Fragment?{...l,...s,ref:o}:{},{children:d}=n,u=r.useMemo(()=>Xn(d)?d.get():d,[d]);return r.createElement(t,{...c,children:u})}}function Go(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Xo(e,t,r){const n=e.getProps();return Zn(n,t,void 0!==r?r:n.custom,e)}const Qo=an(()=>void 0!==window.ScrollTimeline);class Jo{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=t}attachTimeline(e,t){const r=this.animations.map(r=>Qo()&&r.attachTimeline?r.attachTimeline(e):"function"==typeof t?t(r):void 0);return()=>{r.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;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ea extends Jo{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function ta(e,t){return e?e[t]||e.default||e:void 0}const ra=2e4;function na(e){let t=0;let r=e.next(t);for(;!r.done&&t<ra;)t+=50,r=e.next(t);return t>=ra?1/0:t}function oa(e){return"function"==typeof e}function aa(e,t){e.timeline=t,e.onfinish=null}const ia=e=>Array.isArray(e)&&"number"==typeof e[0],sa={linearEasing:void 0};const la=function(e,t){const r=an(e);return()=>{var e;return null!==(e=sa[t])&&void 0!==e?e:r()}}(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ca=(e,t,r=10)=>{let n="";const o=Math.max(Math.round(t/r),2);for(let t=0;t<o;t++)n+=e(sn(0,o-1,t))+", ";return`linear(${n.substring(0,n.length-2)})`};function da(e){return!!("function"==typeof e&&la()||!e||"string"==typeof e&&(e in pa||la())||ia(e)||Array.isArray(e)&&e.every(da))}const ua=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,pa={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ua([0,.65,.55,1]),circOut:ua([.55,0,1,.45]),backIn:ua([.31,.01,.66,-.59]),backOut:ua([.33,1.53,.69,.99])};function ha(e,t){if(e)return"function"==typeof e&&la()?ca(e,t):ia(e)?ua(e):Array.isArray(e)?e.map(e=>ha(e,t)||pa.easeOut):pa[e]}const fa={x:!1,y:!1};function ma(){return fa.x||fa.y}function va(e,t){const r=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function ya(e){return t=>{"touch"===t.pointerType||ma()||e(t)}}const ga=(e,t)=>!!t&&(e===t||ga(e,t.parentElement)),xa=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,ba=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ka=new WeakSet;function _a(e){return t=>{"Enter"===t.key&&e(t)}}function wa(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Ma(e){return xa(e)&&!ma()}function Ca(e,t,r={}){const[n,o,a]=va(e,r),i=e=>{const n=e.currentTarget;if(!Ma(e)||ka.has(n))return;ka.add(n);const a=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Ma(e)&&ka.has(n)&&(ka.delete(n),"function"==typeof a&&a(e,{success:t}))},s=e=>{i(e,r.useGlobalTarget||ga(n,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return n.forEach(e=>{!function(e){return ba.has(e.tagName)||-1!==e.tabIndex}(e)&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(r.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),e.addEventListener("focus",e=>((e,t)=>{const r=e.currentTarget;if(!r)return;const n=_a(()=>{if(ka.has(r))return;wa(r,"down");const e=_a(()=>{wa(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>wa(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,o),o)}),a}const Da=new Set(["width","height","top","left","right","bottom",...to]);let ja;function Oa(){ja=void 0}const Sa={now:()=>(void 0===ja&&Sa.set(mn.isProcessing||dn?mn.timestamp:performance.now()),ja),set:e=>{ja=e,queueMicrotask(Oa)}};function Pa(e,t){-1===e.indexOf(t)&&e.push(t)}function Ea(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class Ta{constructor(){this.subscriptions=[]}add(e){return Pa(this.subscriptions,e),()=>Ea(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let o=0;o<n;o++){const n=this.subscriptions[o];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Na(e,t){return t?e*(1e3/t):0}class za{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const r=Sa.now();this.updatedAt!==r&&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){this.current=e,this.updatedAt=Sa.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&Mn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Ta);const r=this.events[e].add(t);return"change"===e?()=>{r(),hn.read(()=>{this.events.change.getSize()||this.stop()})}:r}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,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}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 this.current}getPrevious(){return this.prev}getVelocity(){const e=Sa.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Na(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 Aa(e,t){return new za(e,t)}function Ra(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Aa(r))}function Fa(e,t){const r=e.getValue("willChange");if(function(e){return!(!Xn(e)||!e.add)}(r))return r.add(t)}function La(e){return e.props[Ln]}const Ba=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function Va(e,t,r,n){if(e===t&&r===n)return rn;const o=t=>function(e,t,r,n,o){let a,i,s=0;do{i=t+(r-t)/2,a=Ba(i,n,o)-e,a>0?r=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,r);return e=>0===e||1===e?e:Ba(o(e),t,n)}const Ia=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qa=e=>t=>1-e(1-t),Ha=Va(.33,1.53,.69,.99),$a=qa(Ha),Wa=Ia($a),Ua=e=>(e*=2)<1?.5*$a(e):.5*(2-Math.pow(2,-10*(e-1))),Ya=e=>1-Math.sin(Math.acos(e)),Za=qa(Ya),Ka=Ia(Ya),Ga=e=>/^0[^.\s]+$/u.test(e);function Xa(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||Ga(e))}const Qa=e=>Math.round(1e5*e)/1e5,Ja=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ei=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ti=(e,t)=>r=>!!("string"==typeof r&&ei.test(r)&&r.startsWith(e)||t&&!function(e){return null==e}(r)&&Object.prototype.hasOwnProperty.call(r,t)),ri=(e,t,r)=>n=>{if("string"!=typeof n)return n;const[o,a,i,s]=n.match(Ja);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},ni={...uo,transform:e=>Math.round((e=>co(0,255,e))(e))},oi={test:ti("rgb","red"),parse:ri("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ni.transform(e)+", "+ni.transform(t)+", "+ni.transform(r)+", "+Qa(po.transform(n))+")"};const ai={test:ti("#"),parse:function(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}},transform:oi.transform},ii={test:ti("hsl","hue"),parse:ri("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+vo.transform(Qa(t))+", "+vo.transform(Qa(r))+", "+Qa(po.transform(n))+")"},si={test:e=>oi.test(e)||ai.test(e)||ii.test(e),parse:e=>oi.test(e)?oi.parse(e):ii.test(e)?ii.parse(e):ai.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?oi.transform(e):ii.transform(e)},li=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const ci="number",di="color",ui=/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 pi(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(ui,e=>(si.test(e)?(n.color.push(a),o.push(di),r.push(si.parse(e))):e.startsWith("var(")?(n.var.push(a),o.push("var"),r.push(e)):(n.number.push(a),o.push(ci),r.push(parseFloat(e))),++a,"${}")).split("${}");return{values:r,split:i,indexes:n,types:o}}function hi(e){return pi(e).values}function fi(e){const{split:t,types:r}=pi(e),n=t.length;return e=>{let o="";for(let a=0;a<n;a++)if(o+=t[a],void 0!==e[a]){const t=r[a];o+=t===ci?Qa(e[a]):t===di?si.transform(e[a]):e[a]}return o}}const mi=e=>"number"==typeof e?0:e;const vi={test:function(e){var t,r;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Ja))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(li))||void 0===r?void 0:r.length)||0)>0},parse:hi,createTransformer:fi,getAnimatableNone:function(e){const t=hi(e);return fi(e)(t.map(mi))}},yi=new Set(["brightness","contrast","saturate","opacity"]);function gi(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(Ja)||[];if(!n)return e;const o=r.replace(n,"");let a=yi.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const xi=/\b([a-z-]*)\(.*?\)/gu,bi={...vi,getAnimatableNone:e=>{const t=e.match(xi);return t?t.map(gi).join(" "):e}},ki={...Mo,color:si,backgroundColor:si,outlineColor:si,fill:si,stroke:si,borderColor:si,borderTopColor:si,borderRightColor:si,borderBottomColor:si,borderLeftColor:si,filter:bi,WebkitFilter:bi},_i=e=>ki[e];function wi(e,t){let r=_i(e);return r!==bi&&(r=vi),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const Mi=new Set(["auto","none","0"]);const Ci=e=>e===uo||e===yo,Di=(e,t)=>parseFloat(e.split(", ")[t]),ji=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const o=n.match(/^matrix3d\((.+)\)$/u);if(o)return Di(o[1],t);{const t=n.match(/^matrix\((.+)\)$/u);return t?Di(t[1],e):0}},Oi=new Set(["x","y","z"]),Si=to.filter(e=>!Oi.has(e));const Pi={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),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:ji(4,13),y:ji(5,14)};Pi.translateX=Pi.x,Pi.translateY=Pi.y;const Ei=new Set;let Ti=!1,Ni=!1;function zi(){if(Ni){const e=Array.from(Ei).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{const t=function(e){const t=[];return Si.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=r.get(e);t&&t.forEach(([t,r])=>{var n;null===(n=e.getValue(t))||void 0===n||n.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Ni=!1,Ti=!1,Ei.forEach(e=>e.complete()),Ei.clear()}function Ai(){Ei.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ni=!0)})}class Ri{constructor(e,t,r,n,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ei.add(this),Ti||(Ti=!0,hn.read(Ai),hn.resolveKeyframes(zi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==n?void 0:n.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(r&&t){const n=r.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===o&&n.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ei.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ei.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Fi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Li=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bi(e,t,r=1){on(r<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[n,o]=function(e){const t=Li.exec(e);if(!t)return[,];const[,r,n,o]=t;return[`--${r??n}`,o]}(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const e=a.trim();return Fi(e)?parseFloat(e):e}return io(o)?Bi(o,t,r+1):o}const Vi=e=>t=>t.test(e),Ii=[uo,yo,vo,mo,xo,go,{test:e=>"auto"===e,parse:e=>e}],qi=e=>Ii.find(Vi(e));class Hi extends Ri{constructor(e,t,r,n,o){super(e,t,r,n,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&(n=n.trim(),io(n))){const o=Bi(n,t.current);void 0!==o&&(e[r]=o),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Da.has(r)||2!==e.length)return;const[n,o]=e,a=qi(n),i=qi(o);if(a!==i)if(Ci(a)&&Ci(i))for(let t=0;t<e.length;t++){const r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)Xa(e[t])&&r.push(t);r.length&&function(e,t,r){let n,o=0;for(;o<e.length&&!n;){const t=e[o];"string"==typeof t&&!Mi.has(t)&&pi(t).values.length&&(n=e[o]),o++}if(n&&r)for(const o of t)e[o]=wi(r,n)}(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pi[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){var e;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);const a=n.length-1,i=n[a];n[a]=Pi[r](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),!(null===(e=this.removedTransforms)||void 0===e)&&e.length&&this.removedTransforms.forEach(([e,r])=>{t.getValue(e).set(r)}),this.resolveNoneKeyframes()}}const $i=(e,t)=>"zIndex"!==t&&!("number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!vi.test(e)&&"0"!==e||e.startsWith("url(")));const Wi=e=>null!==e;function Ui(e,{repeat:t,repeatType:r="loop"},n){const o=e.filter(Wi),a=t&&"loop"!==r&&t%2==1?0:o.length-1;return a&&void 0!==n?n:o[a]}class Yi{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Sa.now(),this.options={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:o,repeatType:a,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&(Ai(),zi()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Sa.now(),this.hasAttemptedResolve=!0;const{name:r,type:n,velocity:o,delay:a,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!function(e,t,r,n){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=$i(o,t),s=$i(a,t);return nn(i===s,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||oa(r))&&n)}(e,r,n,o)){if(!a)return s&&s(Ui(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Zi=(e,t,r)=>e+(t-e)*r;function Ki(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Gi(e,t){return r=>r>0?t:e}const Xi=(e,t,r)=>{const n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},Qi=[ai,oi,ii];function Ji(e){const t=(e=>Qi.find(t=>t.test(e)))(e);if(nn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===ii&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let o=0,a=0,i=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;o=Ki(s,n,e+1/3),a=Ki(s,n,e),i=Ki(s,n,e-1/3)}else o=a=i=r;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:n}}(r)),r}const es=(e,t)=>{const r=Ji(e),n=Ji(t);if(!r||!n)return Gi(e,t);const o={...r};return e=>(o.red=Xi(r.red,n.red,e),o.green=Xi(r.green,n.green,e),o.blue=Xi(r.blue,n.blue,e),o.alpha=Zi(r.alpha,n.alpha,e),oi.transform(o))},ts=(e,t)=>r=>t(e(r)),rs=(...e)=>e.reduce(ts),ns=new Set(["none","hidden"]);function os(e,t){return r=>Zi(e,t,r)}function as(e){return"number"==typeof e?os:"string"==typeof e?io(e)?Gi:si.test(e)?es:ls:Array.isArray(e)?is:"object"==typeof e?si.test(e)?es:ss:Gi}function is(e,t){const r=[...e],n=r.length,o=e.map((e,r)=>as(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=o[t](e);return r}}function ss(e,t){const r={...e,...t},n={};for(const o in r)void 0!==e[o]&&void 0!==t[o]&&(n[o]=as(e[o])(e[o],t[o]));return e=>{for(const t in n)r[t]=n[t](e);return r}}const ls=(e,t)=>{const r=vi.createTransformer(t),n=pi(e),o=pi(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?ns.has(e)&&!o.values.length||ns.has(t)&&!n.values.length?function(e,t){return ns.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}(e,t):rs(is(function(e,t){var r;const n=[],o={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][o[i]],l=null!==(r=e.values[s])&&void 0!==r?r:0;n[a]=l,o[i]++}return n}(n,o),o.values),r):(nn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Gi(e,t))};function cs(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?Zi(e,t,r):as(e)(e,t)}function ds(e,t,r){const n=Math.max(t-5,0);return Na(r-e(n),t-n)}const us=100,ps=10,hs=1,fs=0,ms=800,vs=.3,ys=.3,gs={granular:.01,default:2},xs={granular:.005,default:.5},bs=.01,ks=10,_s=.05,ws=1,Ms=.001;function Cs({duration:e=ms,bounce:t=vs,velocity:r=fs,mass:n=hs}){let o,a;nn(e<=ln(ks),"Spring duration must be 10 seconds or less");let i=1-t;i=co(_s,ws,i),e=co(bs,ks,cn(e)),i<1?(o=t=>{const n=t*i,o=n*e,a=n-r,s=js(t,i),l=Math.exp(-o);return Ms-a/s*l},a=t=>{const n=t*i*e,a=n*r+r,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=js(Math.pow(t,2),i);return(-o(t)+Ms>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-r)*e+1)-Ms,a=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let r=1;r<Ds;r++)n-=e(n)/t(n);return n}(o,a,5/e);if(e=ln(e),isNaN(s))return{stiffness:us,damping:ps,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*i*Math.sqrt(n*t),duration:e}}}const Ds=12;function js(e,t){return e*Math.sqrt(1-t*t)}const Os=["duration","bounce"],Ss=["stiffness","damping","mass"];function Ps(e,t){return t.some(t=>void 0!==e[t])}function Es(e=ys,t=vs){const r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:o}=r;const a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:d,duration:u,velocity:p,isResolvedFromDuration:h}=function(e){let t={velocity:fs,stiffness:us,damping:ps,mass:hs,isResolvedFromDuration:!1,...e};if(!Ps(e,Ss)&&Ps(e,Os))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(1.2*r),o=n*n,a=2*co(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:hs,stiffness:o,damping:a}}else{const r=Cs(e);t={...t,...r,mass:hs},t.isResolvedFromDuration=!0}return t}({...r,velocity:-cn(r.velocity||0)}),f=p||0,m=c/(2*Math.sqrt(l*d)),v=i-a,y=cn(Math.sqrt(l/d)),g=Math.abs(v)<5;let x;if(n||(n=g?gs.granular:gs.default),o||(o=g?xs.granular:xs.default),m<1){const e=js(y,m);x=t=>{const r=Math.exp(-m*y*t);return i-r*((f+m*y*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}}else if(1===m)x=e=>i-Math.exp(-y*e)*(v+(f+y*v)*e);else{const e=y*Math.sqrt(m*m-1);x=t=>{const r=Math.exp(-m*y*t),n=Math.min(e*t,300);return i-r*((f+m*y*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}const b={calculatedDuration:h&&u||null,next:e=>{const t=x(e);if(h)s.done=e>=u;else{let r=0;m<1&&(r=0===e?ln(f):ds(x,e,t));const a=Math.abs(r)<=n,l=Math.abs(i-t)<=o;s.done=a&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(na(b),ra),t=ca(t=>b.next(e*t).value,e,30);return e+"ms "+t}};return b}function Ts({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],p={done:!1,value:u},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=r*t;const m=u+f,v=void 0===i?m:i(m);v!==m&&(f=v-u);const y=e=>-f*Math.exp(-e/n),g=e=>v+y(e),x=e=>{const t=y(e),r=g(e);p.done=Math.abs(t)<=c,p.value=p.done?v:r};let b,k;const _=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(p.value)&&(b=e,k=Es({keyframes:[p.value,h(p.value)],velocity:ds(g,e,p.value),damping:o,stiffness:a,restDelta:c,restSpeed:d}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return!k&&void 0===b&&(t=!0,x(e),_(e)),void 0!==b&&e>=b?k.next(e-b):(!t&&x(e),p)}}}const Ns=Va(.42,0,1,1),zs=Va(0,0,.58,1),As=Va(.42,0,.58,1),Rs={linear:rn,easeIn:Ns,easeInOut:As,easeOut:zs,circIn:Ya,circInOut:Ka,circOut:Za,backIn:$a,backInOut:Wa,backOut:Ha,anticipate:Ua},Fs=e=>{if(ia(e)){on(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,r,n,o]=e;return Va(t,r,n,o)}return"string"==typeof e?(on(void 0!==Rs[e],`Invalid easing type '${e}'`),Rs[e]):e};function Ls(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;if(on(a===t.length,"Both input and output ranges must be the same length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,r){const n=[],o=r||cs,a=e.length-1;for(let r=0;r<a;r++){let a=o(e[r],e[r+1]);if(t){const e=Array.isArray(t)?t[r]||rn:t;a=rs(e,a)}n.push(a)}return n}(t,n,o),l=s.length,c=r=>{if(i&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);const o=sn(e[n],e[n+1],r);return s[n](o)};return r?t=>c(co(e[0],e[a-1],t)):c}function Bs(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=sn(0,t,n);e.push(Zi(r,1,o))}}(t,e.length-1),t}function Vs(e,t){return e.map(()=>t||As).splice(0,e.length-1)}function Is({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(Fs):Fs(n),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:Bs(t),e),s=Ls(i,t,{ease:Array.isArray(o)?o:Vs(t,o)});return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const qs=e=>{const t=({timestamp:t})=>e(t);return{start:()=>hn.update(t,!0),stop:()=>fn(t),now:()=>mn.isProcessing?mn.timestamp:Sa.now()}},Hs={decay:Ts,inertia:Ts,tween:Is,keyframes:Is,spring:Es},$s=e=>e/100;class Ws extends Yi{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:r,element:n,keyframes:o}=this.options,a=(null==n?void 0:n.KeyframeResolver)||Ri;this.resolver=new a(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:o,velocity:a=0}=this.options,i=oa(t)?t:Hs[t]||Is;let s,l;i!==Is&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&on(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),s=rs($s,cs(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===c.calculatedDuration&&(c.calculatedDuration=na(c));const{calculatedDuration:d}=c,u=d+n;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:d,resolvedDuration:u,totalDuration:u*(r+1)-n}}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:r}=this;if(!r){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:n,generator:o,mirroredGenerator:a,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:d}=r;if(null===this.startTime)return o.next(0);const{delay:u,repeat:p,repeatType:h,repeatDelay:f,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 v=this.currentTime-u*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let g=this.currentTime,x=o;if(p){const e=Math.min(this.currentTime,c)/d;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,p+1),!!(t%2)&&("reverse"===h?(r=1-r,f&&(r-=f/d)):"mirror"===h&&(x=a)),g=co(0,1,r)*d}const b=y?{done:!1,value:s[0]}:x.next(g);i&&(b.value=i(b.value));let{done:k}=b;!y&&null!==l&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&k);return _&&void 0!==n&&(b.value=Ui(s,this.options,n)),m&&m(b.value),_&&this.finish(),b}get duration(){const{resolved:e}=this;return e?cn(e.calculatedDuration):0}get time(){return cn(this.currentTime)}set time(e){e=ln(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=cn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=qs,onPlay:t,startTime:r}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=r??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 Us=new Set(["opacity","clipPath","filter","transform"]);function Ys(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:r};l&&(c.offset=l);const d=ha(s,o);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:n,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"})}const Zs=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Ks={anticipate:Ua,backInOut:Wa,circInOut:Ka};class Gs extends Yi{constructor(e){super(e);const{name:t,motionValue:r,element:n,keyframes:o}=this.options;this.resolver=new Hi(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:r=300,times:n,ease:o,type:a,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&la()&&function(e){return e in Ks}(o)&&(o=Ks[o]),function(e){return oa(e.type)||"spring"===e.type||!da(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,d=function(e,t){const r=new Ws({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const o=[];let a=0;for(;!n.done&&a<2e4;)n=r.sample(a),o.push(n.value),a+=10;return{times:void 0,keyframes:o,duration:a-10,ease:"linear"}}(e,c);1===(e=d.keyframes).length&&(e[1]=e[0]),r=d.duration,n=d.times,o=d.ease,a="keyframes"}const c=Ys(i.owner.current,s,e,{...this.options,duration:r,times:n,ease:o});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(aa(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:r}=this.options;i.set(Ui(e,this.options,t)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:n,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return cn(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return cn(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.currentTime=ln(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:r}=t;r.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 rn;const{animation:r}=t;aa(r,e)}else this.pendingTimeline=e;return rn}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:r,duration:n,type:o,ease:a,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,d=new Ws({...c,keyframes:r,duration:n,type:o,ease:a,times:i,isGenerator:!0}),u=ln(this.time);e.setWithVelocity(d.sample(u-10).value,d.sample(u).value,10)}const{onStop:s}=this.options;s&&s(),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:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return Zs()&&r&&Us.has(r)&&!s&&!l&&!n&&"mirror"!==o&&0!==a&&"inertia"!==i}}const Xs={type:"spring",stiffness:500,damping:25,restSpeed:10},Qs={type:"keyframes",duration:.8},Js={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},el=(e,{keyframes:t})=>t.length>2?Qs:ro.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):Xs:Js;const tl=(e,t,r,n={},o,a)=>i=>{const s=ta(n,e)||{},l=s.delay||n.delay||0;let{elapsed:c=0}=n;c-=ln(l);let d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...d}){return!!Object.keys(d).length})(s)||(d={...d,...el(e,d)}),d.duration&&(d.duration=ln(d.duration)),d.repeatDelay&&(d.repeatDelay=ln(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(u=!0)),u&&!a&&void 0!==t.get()){const e=Ui(d.keyframes,s);if(void 0!==e)return hn.update(()=>{d.onUpdate(e),d.onComplete()}),new ea([])}return!a&&Gs.supports(d)?new Gs(d):new Ws(d)};function rl({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function nl(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var a;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(i=n);const c=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const n=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),o=l[t];if(void 0===o||d&&rl(d,t))continue;const s={delay:r,...ta(i||{},t)};let u=!1;if(window.MotionHandoffAnimation){const r=La(e);if(r){const e=window.MotionHandoffAnimation(r,t,hn);null!==e&&(s.startTime=e,u=!0)}}Fa(e,t),n.start(tl(t,n,o,e.shouldReduceMotion&&Da.has(t)?{type:!1}:s,e,u));const p=n.animation;p&&c.push(p)}return s&&Promise.all(c).then(()=>{hn.update(()=>{s&&function(e,t){const r=Xo(e,t);let{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(const t in a)Ra(e,t,Gn(a[t]))}(e,s)})}),c}function ol(e,t,r={}){var n;const o=Xo(e,t,"exit"===r.type?null===(n=e.presenceContext)||void 0===n?void 0:n.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(a=r.transitionOverride);const i=o?()=>Promise.all(nl(e,o,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,r=0,n=0,o=1,a){const i=[],s=(e.variantChildren.size-1)*n,l=1===o?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(al).forEach((e,n)=>{e.notify("AnimationStart",t),i.push(ol(e,t,{...a,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+n,i,s,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(r.delay)])}function al(e,t){return e.sortNodePosition(t)}const il=Sn.length;function sl(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&sl(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let r=0;r<il;r++){const n=Sn[r],o=e.props[n];(Dn(o)||!1===o)&&(t[n]=o)}return t}const ll=[...On].reverse(),cl=On.length;function dl(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>ol(e,t,r));n=Promise.all(o)}else if("string"==typeof t)n=ol(e,t,r);else{const o="function"==typeof t?Xo(e,t,r.custom):t;n=Promise.all(nl(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,t,r)))}function ul(e){let t=dl(e),r=fl(),n=!0;const o=t=>(r,n)=>{var o;const a=Xo(e,n,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...n}=a;r={...r,...n,...t}}return r};function a(a){const{props:i}=e,s=sl(e.parent)||{},l=[],c=new Set;let d={},u=1/0;for(let t=0;t<cl;t++){const p=ll[t],h=r[p],f=void 0!==i[p]?i[p]:s[p],m=Dn(f),v=p===a?h.isActive:null;!1===v&&(u=t);let y=f===s[p]&&f!==i[p]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...d},!h.isActive&&null===v||!f&&!h.prevProp||jn(f)||"boolean"==typeof f)continue;const g=pl(h.prevProp,f);let x=g||p===a&&h.isActive&&!y&&m||t>u&&m,b=!1;const k=Array.isArray(f)?f:[f];let _=k.reduce(o(p),{});!1===v&&(_={});const{prevResolvedValues:w={}}=h,M={...w,..._},C=t=>{x=!0,c.has(t)&&(b=!0,c.delete(t)),h.needsAnimating[t]=!0;const r=e.getValue(t);r&&(r.liveStyle=!1)};for(const e in M){const t=_[e],r=w[e];if(d.hasOwnProperty(e))continue;let n=!1;n=Kn(t)&&Kn(r)?!Go(t,r):t!==r,n?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):h.protectedKeys[e]=!0}h.prevProp=f,h.prevResolvedValues=_,h.isActive&&(d={...d,..._}),n&&e.blockInitialAnimation&&(x=!1),x&&(!y||!g||b)&&l.push(...k.map(e=>({animation:e,options:{type:p}})))}if(c.size){const t={};c.forEach(r=>{const n=e.getBaseTarget(r),o=e.getValue(r);o&&(o.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let p=!!l.length;return n&&(!1===i.initial||i.initial===i.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const i=a(t);for(const e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=fl(),n=!0}}}function pl(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Go(t,e)}function hl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fl(){return{animate:hl(!0),whileInView:hl(),whileHover:hl(),whileTap:hl(),whileDrag:hl(),whileFocus:hl(),exit:hl()}}class ml{constructor(e){this.isMounted=!1,this.node=e}update(){}}let vl=0;const yl={animation:{Feature:class extends ml{constructor(e){super(e),e.animationState||(e.animationState=ul(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();jn(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 ml{constructor(){super(...arguments),this.id=vl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function gl(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function xl(e){return{point:{x:e.pageX,y:e.pageY}}}function bl(e,t,r,n){return gl(e,t,(e=>t=>xa(t)&&e(t,xl(t)))(r),n)}const kl=(e,t)=>Math.abs(e-t);class _l{constructor(e,t,{transformPagePoint:r,contextWindow:n,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=Cl(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,r=function(e,t){const r=kl(e.x,t.x),n=kl(e.y,t.y);return Math.sqrt(r**2+n**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!r)return;const{point:n}=e,{timestamp:o}=mn;this.history.push({...n,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=wl(t,this.transformPagePoint),hn.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:r,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=Cl("pointercancel"===e.type?this.lastMoveEventInfo:wl(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,a),n&&n(e,a)},!xa(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;const a=wl(xl(e),this.transformPagePoint),{point:i}=a,{timestamp:s}=mn;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,Cl(a,this.history)),this.removeListeners=rs(bl(this.contextWindow,"pointermove",this.handlePointerMove),bl(this.contextWindow,"pointerup",this.handlePointerUp),bl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),fn(this.updatePoint)}}function wl(e,t){return t?{point:t(e.point)}:e}function Ml(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Cl({point:e},t){return{point:e,delta:Ml(e,jl(t)),offset:Ml(e,Dl(t)),velocity:Ol(t,.1)}}function Dl(e){return e[0]}function jl(e){return e[e.length-1]}function Ol(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const o=jl(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>ln(t)));)r--;if(!n)return{x:0,y:0};const a=cn(o.timestamp-n.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Sl(e){return e.max-e.min}function Pl(e,t,r,n=.5){e.origin=n,e.originPoint=Zi(t.min,t.max,e.origin),e.scale=Sl(r)/Sl(t),e.translate=Zi(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function El(e,t,r,n){Pl(e.x,t.x,r.x,n?n.originX:void 0),Pl(e.y,t.y,r.y,n?n.originY:void 0)}function Tl(e,t,r){e.min=r.min+t.min,e.max=e.min+Sl(t)}function Nl(e,t,r){e.min=t.min-r.min,e.max=e.min+Sl(t)}function zl(e,t,r){Nl(e.x,t.x,r.x),Nl(e.y,t.y,r.y)}function Al(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function Rl(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}const Fl=.35;function Ll(e,t,r){return{min:Bl(e,t),max:Bl(e,r)}}function Bl(e,t){return"number"==typeof e?e:e[t]||0}const Vl=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Il(e){return[e("x"),e("y")]}function ql({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function Hl(e){return void 0===e||1===e}function $l({scale:e,scaleX:t,scaleY:r}){return!Hl(e)||!Hl(t)||!Hl(r)}function Wl(e){return $l(e)||Ul(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ul(e){return Yl(e.x)||Yl(e.y)}function Yl(e){return e&&"0%"!==e}function Zl(e,t,r){return r+t*(e-r)}function Kl(e,t,r,n,o){return void 0!==o&&(e=Zl(e,o,n)),Zl(e,r,n)+t}function Gl(e,t=0,r=1,n,o){e.min=Kl(e.min,t,r,n,o),e.max=Kl(e.max,t,r,n,o)}function Xl(e,{x:t,y:r}){Gl(e.x,t.translate,t.scale,t.originPoint),Gl(e.y,r.translate,r.scale,r.originPoint)}const Ql=.999999999999,Jl=1.0000000000001;function ec(e,t){e.min=e.min+t,e.max=e.max+t}function tc(e,t,r,n,o=.5){Gl(e,t,r,Zi(e.min,e.max,o),n)}function rc(e,t){tc(e.x,t.x,t.scaleX,t.scale,t.originX),tc(e.y,t.y,t.scaleY,t.scale,t.originY)}function nc(e,t){return ql(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}const oc=({current:e})=>e?e.ownerDocument.defaultView:null,ac=new WeakMap;class ic{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new _l(e,{onSessionStart:e=>{const{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(xl(e).point)},onStart:(e,t)=>{const{drag:r,dragPropagation:n,onDragStart:o}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){return"x"===e||"y"===e?fa[e]?null:(fa[e]=!0,()=>{fa[e]=!1}):fa.x||fa.y?null:(fa.x=fa.y=!0,()=>{fa.x=fa.y=!1})}(r),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Il(e=>{let t=this.getAxisMotionValue(e).get()||0;if(vo.test(t)){const{projection:r}=this.visualElement;if(r&&r.layout){const n=r.layout.layoutBox[e];n&&(t=Sl(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&hn.postRender(()=>o(e,t)),Fa(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:r,dragDirectionLock:n,onDirectionLock:o,onDrag:a}=this.getProps();if(!r&&!this.openDragLock)return;const{offset:i}=t;if(n&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Il(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:n,contextWindow:oc(this.visualElement)})}stop(e,t){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:n}=t;this.startAnimation(n);const{onDragEnd:o}=this.getProps();o&&hn.postRender(()=>o(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:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){const{drag:n}=this.getProps();if(!r||!sc(e,n,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?Zi(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?Zi(r,e,n.max):Math.min(e,r)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=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&&An(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(e,{top:t,left:r,bottom:n,right:o}){return{x:Al(e.x,r,o),y:Al(e.y,t,n)}}(n.layoutBox,t),this.elastic=function(e=Fl){return!1===e?e=0:!0===e&&(e=Fl),{x:Ll(e,"left","right"),y:Ll(e,"top","bottom")}}(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Il(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!An(e))return!1;const r=e.current;on(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const o=function(e,t,r){const n=nc(e,r),{scroll:o}=t;return o&&(ec(n.x,o.offset.x),ec(n.y,o.offset.y)),n}(r,n.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:Rl(e.x,t.x),y:Rl(e.y,t.y)}}(n.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}}(a));this.hasMutatedConstraints=!!e,e&&(a=ql(e))}return a}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:n,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=Il(i=>{if(!sc(i,t,this.currentDirection))return;let l=s&&s[i]||{};a&&(l={min:0,max:0});const c=n?200:1e6,d=n?40:1e7,u={type:"inertia",velocity:r?e[i]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,u)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return Fa(this.visualElement,e),r.start(tl(e,r,0,t,this.visualElement,!1))}stopAnimation(){Il(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Il(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()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Il(t=>{const{drag:r}=this.getProps();if(!sc(t,r,this.currentDirection))return;const{projection:n}=this.visualElement,o=this.getAxisMotionValue(t);if(n&&n.layout){const{min:r,max:a}=n.layout.layoutBox[t];o.set(e[t]-Zi(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!An(t)||!r||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};Il(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const r=t.get();n[e]=function(e,t){let r=.5;const n=Sl(e),o=Sl(t);return o>n?r=sn(t.min,t.max-n,e.min):n>o&&(r=sn(e.min,e.max-o,t.min)),co(0,1,r)}({min:r,max:r},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Il(t=>{if(!sc(t,e,null))return;const r=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];r.set(Zi(o,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;ac.set(this.visualElement,this);const e=bl(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();An(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),hn.read(t);const o=gl(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Il(t=>{const r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),n(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:o=!1,dragElastic:a=Fl,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function sc(e,t,r){return!(!0!==t&&t!==e||null!==r&&r!==e)}const lc=e=>(t,r)=>{e&&hn.postRender(()=>e(t,r))};const cc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function dc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uc={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!yo.test(e))return e;e=parseFloat(e)}return`${dc(e,t.target.x)}% ${dc(e,t.target.y)}%`}},pc={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,o=vi.parse(e);if(o.length>5)return n;const a=vi.createTransformer(e),i="number"!=typeof o[0]?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=Zi(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}};class hc extends r.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:o}=e;(function(e){Object.assign(Lo,e)})(mc),o&&(t.group&&t.group.add(o),r&&r.register&&n&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),cc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:n,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,n||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||hn.postRender(()=>{const e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Bn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function fc(e){const[n,o]=Gr(),a=r.useContext(qr);return t.jsx(hc,{...e,layoutGroup:a,switchLayoutGroup:r.useContext(Vn),isPresent:n,safeToRemove:o})}const mc={borderRadius:{...uc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uc,borderTopRightRadius:uc,borderBottomLeftRadius:uc,borderBottomRightRadius:uc,boxShadow:pc};const vc=(e,t)=>e.depth-t.depth;class yc{constructor(){this.children=[],this.isDirty=!1}add(e){Pa(this.children,e),this.isDirty=!0}remove(e){Ea(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(vc),this.isDirty=!1,this.children.forEach(e)}}const gc=["TopLeft","TopRight","BottomLeft","BottomRight"],xc=gc.length,bc=e=>"string"==typeof e?parseFloat(e):e,kc=e=>"number"==typeof e||yo.test(e);function _c(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const wc=Cc(0,.5,Za),Mc=Cc(.5,.95,rn);function Cc(e,t,r){return n=>n<e?0:n>t?1:r(sn(e,t,n))}function Dc(e,t){e.min=t.min,e.max=t.max}function jc(e,t){Dc(e.x,t.x),Dc(e.y,t.y)}function Oc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Sc(e,t,r,n,o){return e=Zl(e-=t,1/r,n),void 0!==o&&(e=Zl(e,1/o,n)),e}function Pc(e,t,[r,n,o],a,i){!function(e,t=0,r=1,n=.5,o,a=e,i=e){if(vo.test(t)&&(t=parseFloat(t),t=Zi(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=Zi(a.min,a.max,n);e===a&&(s-=t),e.min=Sc(e.min,t,r,s,o),e.max=Sc(e.max,t,r,s,o)}(e,t[r],t[n],t[o],t.scale,a,i)}const Ec=["x","scaleX","originX"],Tc=["y","scaleY","originY"];function Nc(e,t,r,n){Pc(e.x,t,Ec,r?r.x:void 0,n?n.x:void 0),Pc(e.y,t,Tc,r?r.y:void 0,n?n.y:void 0)}function zc(e){return 0===e.translate&&1===e.scale}function Ac(e){return zc(e.x)&&zc(e.y)}function Rc(e,t){return e.min===t.min&&e.max===t.max}function Fc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Lc(e,t){return Fc(e.x,t.x)&&Fc(e.y,t.y)}function Bc(e){return Sl(e.x)/Sl(e.y)}function Vc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ic{constructor(){this.members=[]}add(e){Pa(this.members,e),e.scheduleRender()}remove(e){if(Ea(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 r;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){r=t;break}}return!!r&&(this.promote(r),!0)}promote(e,t){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const qc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Hc=typeof window<"u"&&void 0!==window.MotionDebug,$c=["","X","Y","Z"],Wc={visibility:"hidden"};let Uc=0;function Yc(e,t,r,n){const{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function Zc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=La(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",hn,!(t||n))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&Zc(n)}function Kc({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(e={},r=(null==t?void 0:t())){this.id=Uc++,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,Hc&&(qc.totalNodes=qc.resolvedTargetDeltas=qc.recalculatedProjection=0),this.nodes.forEach(Qc),this.nodes.forEach(ad),this.nodes.forEach(id),this.nodes.forEach(Jc),Hc&&window.MotionDebug.record(qc)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new yc)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ta),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,r=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=function(e){return e instanceof SVGElement&&"svg"!==e.tagName}(t),this.instance=t;const{layoutId:n,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),r&&(o||n)&&(this.isLayoutDirty=!0),e){let r;const n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){const r=Sa.now(),n=({timestamp:o})=>{const a=o-r;a>=t&&(fn(n),e(a-t))};return hn.read(n,!0),()=>fn(n)}(n,250),cc.hasAnimatedSinceResize&&(cc.hasAnimatedSinceResize=!1,this.nodes.forEach(od))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||pd,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Lc(this.targetLayout,n)||r,c=!t&&r;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={...ta(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||od(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}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,fn(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(sd),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&&Zc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(td);this.isUpdating||this.nodes.forEach(rd),this.isUpdating=!1,this.nodes.forEach(nd),this.nodes.forEach(Gc),this.nodes.forEach(Xc),this.clearAllSnapshots();const e=Sa.now();mn.delta=co(0,1e3/60,e-mn.timestamp),mn.timestamp=e,mn.isProcessing=!0,vn.update.process(mn),vn.preRender.process(mn),vn.render.process(mn),mn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ed),this.sharedNodes.forEach(ld)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,hn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){hn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!(this.instance&&(this.updateScroll(),this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty)))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!(!this.options.layoutScroll||!this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ac(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&(t||Wl(this.latestValues)||a)&&(o(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let r=this.removeElementScroll(t);return e&&(r=this.removeTransform(r)),function(e){md(e.x),md(e.y)}(r),{animationId:this.root.animationId,measuredBox:t,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const r=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(yd)){const{scroll:e}=this.root;e&&(ec(r.x,e.offset.x),ec(r.y,e.offset.y))}return r}removeElementScroll(e){var t;const r={x:{min:0,max:0},y:{min:0,max:0}};if(jc(r,e),null!==(t=this.scroll)&&void 0!==t&&t.wasRoot)return r;for(let t=0;t<this.path.length;t++){const n=this.path[t],{scroll:o,options:a}=n;n!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&jc(r,e),ec(r.x,o.offset.x),ec(r.y,o.offset.y))}return r}applyTransform(e,t=!1){const r={x:{min:0,max:0},y:{min:0,max:0}};jc(r,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&rc(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),Wl(n.latestValues)&&rc(r,n.latestValues)}return Wl(this.latestValues)&&rc(r,this.latestValues),r}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};jc(t,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];if(!r.instance||!Wl(r.latestValues))continue;$l(r.latestValues)&&r.updateSnapshot();const n=Vl();jc(n,r.measurePageBox()),Nc(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return Wl(this.latestValues)&&Nc(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==mn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const n=!!this.resumingFrom||this!==r;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||null!==(t=this.parent)&&void 0!==t&&t.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(this.layout&&(o||a)){if(this.resolvedRelativeTargetAt=mn.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},zl(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),jc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),function(e,t,r){Tl(e.x,t.x,r.x),Tl(e.y,t.y,r.y)}(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jc(this.target,this.layout.layoutBox),Xl(this.target,this.targetDelta)):jc(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},zl(this.relativeTargetOrigin,this.target,e.target),jc(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Hc&&qc.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!$l(this.parent.latestValues)&&!Ul(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!(!(this.relativeTarget||this.targetDelta||this.options.layoutRoot)||!this.layout)}calcProjection(){var e;const t=this.getLead(),r=!!this.resumingFrom||this!==t;let n=!0;if((this.isProjectionDirty||!(null===(e=this.parent)||void 0===e)&&e.isProjectionDirty)&&(n=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===mn.timestamp&&(n=!1),n)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;jc(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;(function(e,t,r,n=!1){const o=r.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&rc(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Xl(e,i)),n&&Wl(a.latestValues)&&rc(e,a.latestValues))}t.x<Jl&&t.x>Ql&&(t.x=1),t.y<Jl&&t.y>Ql&&(t.y=1)})(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Oc(this.prevProjectionDelta.x,this.projectionDelta.x),Oc(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),El(this.projectionDelta,this.layoutCorrected,l,this.latestValues),(this.treeScale.x!==i||this.treeScale.y!==s||!Vc(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Hc&&qc.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={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const r=this.snapshot,n=r?r.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,d=!(!s||c||!0!==this.options.crossfade||this.path.some(ud));let u;this.animationProgress=0,this.mixTargetDelta=t=>{const r=t/1e3;cd(a.x,e.x,r),cd(a.y,e.y,r),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zl(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,r,n){dd(e.x,t.x,r.x,n),dd(e.y,t.y,r.y,n)}(this.relativeTarget,this.relativeTargetOrigin,i,r),u&&function(e,t){return Rc(e.x,t.x)&&Rc(e.y,t.y)}(this.relativeTarget,u)&&(this.isProjectionDirty=!1),u||(u={x:{min:0,max:0},y:{min:0,max:0}}),jc(u,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,r,n,o,a){o?(e.opacity=Zi(0,void 0!==r.opacity?r.opacity:1,wc(n)),e.opacityExit=Zi(void 0!==t.opacity?t.opacity:1,0,Mc(n))):a&&(e.opacity=Zi(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let o=0;o<xc;o++){const a=`border${gc[o]}Radius`;let i=_c(t,a),s=_c(r,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||kc(i)===kc(s)?(e[a]=Math.max(Zi(bc(i),bc(s),n),0),(vo.test(s)||vo.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||r.rotate)&&(e.rotate=Zi(t.rotate||0,r.rotate||0,n))}(o,n,this.latestValues,r,d,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=hn.update(()=>{cc.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){const n=Xn(e)?e:Aa(e);return n.start(tl("",n,t,r)),n.animation}(0,1e3,{...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:r,layout:n,latestValues:o}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&vd(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Sl(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;const n=Sl(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}jc(t,r),rc(t,o),El(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ic),this.sharedNodes.get(e).add(t);const r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.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:r}={}){const n=this.getStack();n&&n.promote(this,r),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:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;const n={};r.z&&Yc("z",e,n,this.animationValues);for(let t=0;t<$c.length;t++)Yc(`rotate${$c[t]}`,e,n,this.animationValues),Yc(`skew${$c[t]}`,e,n,this.animationValues);e.render();for(const t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}getProjectionStyles(e){var t,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Wc;const n={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=Qn(null==e?void 0:e.pointerEvents)||"",n.transform=o?o(this.latestValues,""):"none",n;const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Qn(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!Wl(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=a.animationValues||a.latestValues;this.applyTransformsToTarget(),n.transform=function(e,t,r){let n="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==r?void 0:r.z)||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),o&&(n+=`rotateX(${o}deg) `),a&&(n+=`rotateY(${a}deg) `),i&&(n+=`skewX(${i}deg) `),s&&(n+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==s||1!==l)&&(n+=`scale(${s}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(n.transform=o(i,n.transform));const{x:s,y:l}=this.projectionDelta;n.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,a.animationValues?n.opacity=a===this?null!==(r=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==r?r:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n.opacity=a===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in Lo){if(void 0===i[e])continue;const{correct:t,applyTo:r}=Lo[e],o="none"===n.transform?i[e]:t(i[e],a);if(r){const e=r.length;for(let t=0;t<e;t++)n[r[t]]=o}else n[e]=o}return this.options.layoutId&&(n.pointerEvents=a===this?Qn(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(td),this.root.sharedNodes.clear()}}}function Gc(e){e.updateLayout()}function Xc(e){var t;const r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:o}=e.options,a=r.source!==e.layout.source;"size"===o?Il(e=>{const n=a?r.measuredBox[e]:r.layoutBox[e],o=Sl(n);n.min=t[e].min,n.max=n.min+o}):vd(o,r.layoutBox,t)&&Il(n=>{const o=a?r.measuredBox[n]:r.layoutBox[n],i=Sl(t[n]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};El(i,t,r.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?El(s,e.applyTransform(n,!0),r.measuredBox):El(s,t,r.layoutBox);const l=!Ac(i);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:a}=n;if(o&&a){const i={x:{min:0,max:0},y:{min:0,max:0}};zl(i,r.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};zl(s,t,a.layoutBox),Lc(i,s)||(c=!0),n.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Qc(e){Hc&&qc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Jc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ed(e){e.clearSnapshot()}function td(e){e.clearMeasurements()}function rd(e){e.isLayoutDirty=!1}function nd(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function od(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ad(e){e.resolveTargetDelta()}function id(e){e.calcProjection()}function sd(e){e.resetSkewAndRotation()}function ld(e){e.removeLeadSnapshot()}function cd(e,t,r){e.translate=Zi(t.translate,0,r),e.scale=Zi(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function dd(e,t,r,n){e.min=Zi(t.min,r.min,n),e.max=Zi(t.max,r.max,n)}function ud(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const pd={duration:.45,ease:[.4,0,.1,1]},hd=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fd=hd("applewebkit/")&&!hd("chrome/")?Math.round:rn;function md(e){e.min=fd(e.min),e.max=fd(e.max)}function vd(e,t,r){return"position"===e||"preserve-aspect"===e&&!function(e,t,r){return Math.abs(e-t)<=r}(Bc(t),Bc(r),.2)}function yd(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const gd=Kc({attachResizeListener:(e,t)=>gl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xd={current:void 0},bd=Kc({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xd.current){const e=new gd({});e.mount(window),e.setOptions({layoutScroll:!0}),xd.current=e}return xd.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),kd={pan:{Feature:class extends ml{constructor(){super(...arguments),this.removePointerDownListener=rn}onPointerDown(e){this.session=new _l(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:lc(e),onStart:lc(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&hn.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=bl(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 ml{constructor(e){super(e),this.removeGroupControls=rn,this.removeListeners=rn,this.controls=new ic(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rn}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:bd,MeasureLayout:fc}};function _d(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);const o=n["onHover"+r];o&&hn.postRender(()=>o(t,xl(t)))}function wd(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);const o=n["onTap"+("End"===r?"":r)];o&&hn.postRender(()=>o(t,xl(t)))}const Md=new WeakMap,Cd=new WeakMap,Dd=e=>{const t=Md.get(e.target);t&&t(e)},jd=e=>{e.forEach(Dd)};function Od(e,t,r){const n=function({root:e,...t}){const r=e||document;Cd.has(r)||Cd.set(r,{});const n=Cd.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(jd,{root:e,...t})),n[o]}(t);return Md.set(e,r),n.observe(e),()=>{Md.delete(e),n.unobserve(e)}}const Sd={some:0,all:1};const Pd={inView:{Feature:class extends ml{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:Sd[n]};return Od(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),a=t?r:n;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ml{mount(){const{current:e}=this.node;e&&(this.unmount=Ca(e,e=>(wd(this.node,e,"Start"),(e,{success:t})=>wd(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ml{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{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=rs(gl(this.node.current,"focus",()=>this.onFocus()),gl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ml{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){const[n,o,a]=va(e,r),i=ya(e=>{const{target:r}=e,n=t(e);if("function"!=typeof n||!r)return;const a=ya(e=>{n(e),r.removeEventListener("pointerleave",a)});r.addEventListener("pointerleave",a,o)});return n.forEach(e=>{e.addEventListener("pointerenter",i,o)}),a}(e,e=>(_d(this.node,e,"Start"),e=>_d(this.node,e,"End"))))}unmount(){}}}},Ed={layout:{ProjectionNode:bd,MeasureLayout:fc}},Td={current:null},Nd={current:!1};const zd=[...Ii,si,vi],Ad=new WeakMap;const Rd=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Fd{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ri,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Sa.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,hn.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=a;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.blockInitialAnimation=!!o,this.isControllingVariants=Pn(t),this.isVariantNode=En(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==s[e]&&Xn(t)&&t.set(s[e],!1)}}mount(e){this.current=e,Ad.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)),Nd.current||function(){if(Nd.current=!0,Jr)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Td.current=e.matches;e.addListener(t),t()}else Td.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Td.current),"production"!==process.env.NODE_ENV&&Mn(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ad.delete(this.current),this.projection&&this.projection.unmount(),fn(this.notifyUpdate),fn(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 r=ro.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&hn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{n(),o(),a&&a(),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 xn){const t=xn[e];if(!t)continue;const{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(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):{x:{min:0,max:0},y:{min:0,max:0}}}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;t<Rd.length;t++){const r=Rd[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(const n in t){const o=t[n],a=r[n];if(Xn(o))e.addValue(n,o),"development"===process.env.NODE_ENV&&Mn("11.18.2"===o.version,`Attempting to mix Motion versions ${o.version} with 11.18.2 may not work as expected.`);else if(Xn(a))e.addValue(n,Aa(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){const t=e.getValue(n);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(n);e.addValue(n,Aa(void 0!==t?t:o,{owner:e}))}}for(const n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&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 r=this.values.get(e);return void 0===r&&void 0!==t&&(r=Aa(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){var r;let n=void 0===this.latestValues[e]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,e))&&void 0!==r?r:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(Fi(n)||Ga(n))?n=parseFloat(n):!(e=>zd.find(Vi(e)))(n)&&vi.test(t)&&(n=wi(e,t)),this.setBaseTarget(e,Xn(n)?n.get():n)),Xn(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props;let n;if("string"==typeof r||"object"==typeof r){const o=Zn(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(n=o[e])}if(r&&void 0!==n)return n;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Xn(o)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Ta),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Ld extends Fd{constructor(){super(...arguments),this.KeyframeResolver=Hi}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:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Xn(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Bd extends Ld{constructor(){super(...arguments),this.type="html",this.renderInstance=Ao}readValueFromInstance(e,t){if(ro.has(t)){const e=_i(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(oo(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return nc(e,t)}build(e,t,r){jo(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return Vo(e,t,r)}}class Vd extends Ld{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Vl}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ro.has(t)){const e=_i(t);return e&&e.default||0}return t=Ro.has(t)?t:Fn(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return Io(e,t,r)}build(e,t,r){Eo(e,t,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,r,n){Fo(e,t,0,n)}mount(e){this.isSVGTag=zo(e.tagName),super.mount(e)}}const Id=function(e,t){return function(r,{forwardMotionProps:n}={forwardMotionProps:!1}){return Hn({...Un(r)?Ho:$o,preloadedFeatures:e,useRender:Ko(n),createVisualElement:t,Component:r})}}({...yl,...Pd,...kd,...Ed},(e,t)=>Un(e)?new Vd(t):new Bd(t,{allowProjection:e!==r.Fragment})),qd=function(e){if(typeof Proxy>"u")return e;const t=new Map;return new Proxy((...t)=>("production"!==process.env.NODE_ENV&&Mn(!1,"motion() is deprecated. Use motion.create() instead."),e(...t)),{get:(r,n)=>"create"===n?e:(t.has(n)||t.set(n,e(n)),t.get(n))})}(Id),Hd=({is24HourFormat:e,isTimeFormatChanging:r,toggleTimeFormat:n})=>t.jsx(Ir,{variant:"outline",size:"sm",onClick:n,disabled:r,className:"flex items-center space-x-1 w-20 justify-center overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsxs(qd.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(wt,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?"24h":"12h"})]},e?"24h":"12h")})});function $d(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function Wd(e,r=[]){let n=[];const o=()=>{const t=n.map(e=>a.createContext(e));return function(r){const n=(null==r?void 0:r[e])||t;return a.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){const i=a.createContext(o),s=n.length;n=[...n,o];const l=r=>{var n;const{scope:o,children:l,...c}=r,d=(null==(n=null==o?void 0:o[e])?void 0:n[s])||i,u=a.useMemo(()=>c,Object.values(c));return t.jsx(d.Provider,{value:u,children:l})};return l.displayName=r+"Provider",[l,function(t,n){var l;const c=(null==(l=null==n?void 0:n[e])?void 0:l[s])||i,d=a.useContext(c);if(d)return d;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},Ud(o,...r)]}function Ud(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var Yd=null!=globalThis&&globalThis.document?a.useLayoutEffect:()=>{},Zd=a[" useInsertionEffect ".trim().toString()]||Yd;function Kd({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),o=a.useRef(r),i=a.useRef(t);return Zd(()=>{i.current=t},[t]),a.useEffect(()=>{var e;o.current!==r&&(null==(e=i.current)||e.call(i,r),o.current=r)},[r,o]),[r,n,i]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;e!==l&&console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=l},[l,n])}const d=a.useCallback(t=>{var r;if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&(null==(r=s.current)||r.call(s,n))}else i(t)},[l,e,i,s]);return[c,d]}var Gd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const n=Lt(`Primitive.${r}`),o=a.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:o})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function Xd(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}function Qd(e){const n=e+"CollectionProvider",[o,a]=Wd(n),[i,s]=o(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:o}=e,a=r.useRef(null),s=r.useRef(new Map).current;return t.jsx(i,{scope:n,itemMap:s,collectionRef:a,children:o})};l.displayName=n;const c=e+"CollectionSlot",d=Lt(c),u=r.forwardRef((e,r)=>{const{scope:n,children:o}=e,a=Ft(r,s(c,n).collectionRef);return t.jsx(d,{ref:a,children:o})});u.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",f=Lt(p),m=r.forwardRef((e,n)=>{const{scope:o,children:a,...i}=e,l=r.useRef(null),c=Ft(n,l),d=s(p,o);return r.useEffect(()=>(d.itemMap.set(l,{ref:l,...i}),()=>{d.itemMap.delete(l)})),t.jsx(f,{[h]:"",ref:c,children:a})});return m.displayName=p,[{Provider:l,Slot:u,ItemSlot:m},function(t){const n=s(e+"CollectionConsumer",t);return r.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])},a]}var Jd=a.createContext(void 0);function eu(e){const t=a.useContext(Jd);return e||t||"ltr"}function tu(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}var ru,nu="dismissableLayer.update",ou="dismissableLayer.pointerDownOutside",au="dismissableLayer.focusOutside",iu=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),su=a.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,u=a.useContext(iu),[p,h]=a.useState(null),f=(null==p?void 0:p.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,m]=a.useState({}),v=Ft(r,e=>h(e)),y=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=tu(e),n=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){du(ou,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));!_||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=tu(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{e.target&&!n.current&&du(au,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const r=tu(e);a.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{b===u.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),a.useEffect(()=>{if(p)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(ru=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),cu(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=ru)}},[p,f,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),cu())},[p,u]),a.useEffect(()=>{const e=()=>m({});return document.addEventListener(nu,e),()=>document.removeEventListener(nu,e)},[]),t.jsx(Gd.div,{...d,ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:$d(e.onFocusCapture,M.onFocusCapture),onBlurCapture:$d(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:$d(e.onPointerDownCapture,w.onPointerDownCapture)})});su.displayName="DismissableLayer";var lu=a.forwardRef((e,r)=>{const n=a.useContext(iu),o=a.useRef(null),i=Ft(r,o);return a.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),t.jsx(Gd.div,{...e,ref:i})});function cu(){const e=new CustomEvent(nu);document.dispatchEvent(e)}function du(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Xd(o,a):o.dispatchEvent(a)}lu.displayName="DismissableLayerBranch";var uu=0;function pu(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hu()),document.body.insertAdjacentElement("beforeend",e[1]??hu()),uu++,()=>{1===uu&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),uu--}},[])}function hu(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fu="focusScope.autoFocusOnMount",mu="focusScope.autoFocusOnUnmount",vu={bubbles:!1,cancelable:!0},yu=a.forwardRef((e,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,d]=a.useState(null),u=tu(i),p=tu(s),h=a.useRef(null),f=Ft(r,e=>d(e)),m=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:ku(h.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ku(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ku(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,m.paused]),a.useEffect(()=>{if(c){_u.add(m);const e=document.activeElement;if(!c.contains(e)){const t=new CustomEvent(fu,vu);c.addEventListener(fu,u),c.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ku(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(gu(c)),{select:!0}),document.activeElement===e&&ku(c))}return()=>{c.removeEventListener(fu,u),setTimeout(()=>{const t=new CustomEvent(mu,vu);c.addEventListener(mu,p),c.dispatchEvent(t),t.defaultPrevented||ku(e??document.body,{select:!0}),c.removeEventListener(mu,p),_u.remove(m)},0)}}},[c,u,p,m]);const v=a.useCallback(e=>{if(!n&&!o||m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=gu(e),r=xu(t,e),n=xu(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&ku(a,{select:!0})):(e.preventDefault(),n&&ku(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,m.paused]);return t.jsx(Gd.div,{tabIndex:-1,...l,ref:f,onKeyDown:v})});function gu(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function xu(e,t){for(const r of e)if(!bu(r,{upTo:t}))return r}function bu(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ku(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}yu.displayName="FocusScope";var _u=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=wu(e,t),e.unshift(t)},remove(t){var r;e=wu(e,t),null==(r=e[0])||r.resume()}}}();function wu(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Mu=a[" useId ".trim().toString()]||(()=>{}),Cu=0;function Du(e){const[t,r]=a.useState(Mu());return Yd(()=>{r(e=>e??String(Cu++))},[e]),t?`radix-${t}`:""}const ju=["top","right","bottom","left"],Ou=Math.min,Su=Math.max,Pu=Math.round,Eu=Math.floor,Tu=e=>({x:e,y:e}),Nu={left:"right",right:"left",bottom:"top",top:"bottom"},zu={start:"end",end:"start"};function Au(e,t,r){return Su(e,Ou(t,r))}function Ru(e,t){return"function"==typeof e?e(t):e}function Fu(e){return e.split("-")[0]}function Lu(e){return e.split("-")[1]}function Bu(e){return"x"===e?"y":"x"}function Vu(e){return"y"===e?"height":"width"}const Iu=new Set(["top","bottom"]);function qu(e){return Iu.has(Fu(e))?"y":"x"}function Hu(e){return Bu(qu(e))}function $u(e){return e.replace(/start|end/g,e=>zu[e])}const Wu=["left","right"],Uu=["right","left"],Yu=["top","bottom"],Zu=["bottom","top"];function Ku(e,t,r,n){const o=Lu(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Uu:Wu:t?Wu:Uu;case"left":case"right":return t?Yu:Zu;default:return[]}}(Fu(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map($u)))),a}function Gu(e){return e.replace(/left|right|bottom|top/g,e=>Nu[e])}function Xu(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 Qu(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ju(e,t,r){let{reference:n,floating:o}=e;const a=qu(t),i=Hu(t),s=Vu(i),l=Fu(t),c="y"===a,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2;let h;switch(l){case"top":h={x:d,y:n.y-o.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:u};break;case"left":h={x:n.x-o.width,y:u};break;default:h={x:n.x,y:n.y}}switch(Lu(t)){case"start":h[i]-=p*(r&&c?-1:1);break;case"end":h[i]+=p*(r&&c?-1:1)}return h}async function ep(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:h=0}=Ru(t,e),f=Xu(h),m=s[p?"floating"===u?"reference":"floating":u],v=Qu(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y="floating"===u?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),x=await(null==a.isElement?void 0:a.isElement(g))&&await(null==a.getScale?void 0:a.getScale(g))||{x:1,y:1},b=Qu(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-b.top+f.top)/x.y,bottom:(b.bottom-v.bottom+f.bottom)/x.y,left:(v.left-b.left+f.left)/x.x,right:(b.right-v.right+f.right)/x.x}}function tp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rp(e){return ju.some(t=>e[t]>=0)}const np=new Set(["left","top"]);function op(){return typeof window<"u"}function ap(e){return lp(e)?(e.nodeName||"").toLowerCase():"#document"}function ip(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sp(e){var t;return null==(t=(lp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function lp(e){return!!op()&&(e instanceof Node||e instanceof ip(e).Node)}function cp(e){return!!op()&&(e instanceof Element||e instanceof ip(e).Element)}function dp(e){return!!op()&&(e instanceof HTMLElement||e instanceof ip(e).HTMLElement)}function up(e){return!(!op()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof ip(e).ShadowRoot)}const pp=new Set(["inline","contents"]);function hp(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=Cp(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!pp.has(o)}const fp=new Set(["table","td","th"]);function mp(e){return fp.has(ap(e))}const vp=[":popover-open",":modal"];function yp(e){return vp.some(t=>{try{return e.matches(t)}catch{return!1}})}const gp=["transform","translate","scale","rotate","perspective"],xp=["transform","translate","scale","rotate","perspective","filter"],bp=["paint","layout","strict","content"];function kp(e){const t=_p(),r=cp(e)?Cp(e):e;return gp.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||xp.some(e=>(r.willChange||"").includes(e))||bp.some(e=>(r.contain||"").includes(e))}function _p(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const wp=new Set(["html","body","#document"]);function Mp(e){return wp.has(ap(e))}function Cp(e){return ip(e).getComputedStyle(e)}function Dp(e){return cp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jp(e){if("html"===ap(e))return e;const t=e.assignedSlot||e.parentNode||up(e)&&e.host||sp(e);return up(t)?t.host:t}function Op(e){const t=jp(e);return Mp(t)?e.ownerDocument?e.ownerDocument.body:e.body:dp(t)&&hp(t)?t:Op(t)}function Sp(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=Op(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=ip(o);if(a){const e=Pp(i);return t.concat(i,i.visualViewport||[],hp(o)?o:[],e&&r?Sp(e):[])}return t.concat(o,Sp(o,[],r))}function Pp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ep(e){const t=Cp(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=dp(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=Pu(r)!==a||Pu(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function Tp(e){return cp(e)?e:e.contextElement}function Np(e){const t=Tp(e);if(!dp(t))return Tu(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Ep(t);let i=(a?Pu(r.width):r.width)/n,s=(a?Pu(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const zp=Tu(0);function Ap(e){const t=ip(e);return _p()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zp}function Rp(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=Tp(e);let i=Tu(1);t&&(n?cp(n)&&(i=Np(n)):i=Np(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ip(e))&&t}(a,r,n)?Ap(a):Tu(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const e=ip(a),t=n&&cp(n)?ip(n):n;let r=e,o=Pp(r);for(;o&&n&&t!==r;){const e=Np(o),t=o.getBoundingClientRect(),n=Cp(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=a,c+=i,r=ip(o),o=Pp(r)}}return Qu({width:d,height:u,x:l,y:c})}function Fp(e,t){const r=Dp(e).scrollLeft;return t?t.left+r:Rp(sp(e)).left+r}function Lp(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:Fp(e,n)),y:n.top+t.scrollTop}}const Bp=new Set(["absolute","fixed"]);function Vp(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=ip(e),n=sp(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=_p();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=sp(e),r=Dp(e),n=e.ownerDocument.body,o=Su(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Su(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Fp(e);const s=-r.scrollTop;return"rtl"===Cp(n).direction&&(i+=Su(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(sp(e));else if(cp(t))n=function(e,t){const r=Rp(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=dp(e)?Np(e):Tu(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=Ap(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Qu(n)}function Ip(e,t){const r=jp(e);return!(r===t||!cp(r)||Mp(r))&&("fixed"===Cp(r).position||Ip(r,t))}function qp(e,t){const r=t.get(e);if(r)return r;let n=Sp(e,[],!1).filter(e=>cp(e)&&"body"!==ap(e)),o=null;const a="fixed"===Cp(e).position;let i=a?jp(e):e;for(;cp(i)&&!Mp(i);){const t=Cp(i),r=kp(i);!r&&"fixed"===t.position&&(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&Bp.has(o.position)||hp(i)&&!r&&Ip(e,i))?n=n.filter(e=>e!==i):o=t,i=jp(i)}return t.set(e,n),n}function Hp(e,t,r){const n=dp(t),o=sp(t),a="fixed"===r,i=Rp(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Tu(0);function c(){l.x=Fp(o)}if(n||!n&&!a)if(("body"!==ap(t)||hp(o))&&(s=Dp(t)),n){const e=Rp(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!n&&o&&c();const d=!o||n||a?Tu(0):Lp(o,s);return{x:i.left+s.scrollLeft-l.x-d.x,y:i.top+s.scrollTop-l.y-d.y,width:i.width,height:i.height}}function $p(e){return"static"===Cp(e).position}function Wp(e,t){if(!dp(e)||"fixed"===Cp(e).position)return null;if(t)return t(e);let r=e.offsetParent;return sp(e)===r&&(r=r.ownerDocument.body),r}function Up(e,t){const r=ip(e);if(yp(e))return r;if(!dp(e)){let t=jp(e);for(;t&&!Mp(t);){if(cp(t)&&!$p(t))return t;t=jp(t)}return r}let n=Wp(e,t);for(;n&&mp(n)&&$p(n);)n=Wp(n,t);return n&&Mp(n)&&$p(n)&&!kp(n)?r:n||function(e){let t=jp(e);for(;dp(t)&&!Mp(t);){if(kp(t))return t;if(yp(t))return null;t=jp(t)}return null}(e)||r}const Yp={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,i=sp(n),s=!!t&&yp(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=Tu(1);const d=Tu(0),u=dp(n);if((u||!u&&!a)&&(("body"!==ap(n)||hp(i))&&(l=Dp(n)),dp(n))){const e=Rp(n);c=Np(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const p=!i||u||a?Tu(0):Lp(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:r.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:sp,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?yp(t)?[]:qp(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((e,r)=>{const n=Vp(t,r,o);return e.top=Su(n.top,e.top),e.right=Ou(n.right,e.right),e.bottom=Ou(n.bottom,e.bottom),e.left=Su(n.left,e.left),e},Vp(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Up,getElementRects:async function(e){const t=this.getOffsetParent||Up,r=this.getDimensions,n=await r(e.floating);return{reference:Hp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Ep(e);return{width:t,height:r}},getScale:Np,isElement:cp,isRTL:function(e){return"rtl"===Cp(e).direction}};function Zp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kp(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=Tp(e),d=o||a?[...c?Sp(c):[],...Sp(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const u=c&&s?function(e,t){let r,n=null;const o=sp(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-Eu(u)+"px "+-Eu(o.clientWidth-(d+p))+"px "+-Eu(o.clientHeight-(u+h))+"px "+-Eu(d)+"px",threshold:Su(0,Ou(1,l))||1};let m=!0;function v(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1===n&&!Zp(c,e.getBoundingClientRect())&&i(),m=!1}try{n=new IntersectionObserver(v,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,f)}n.observe(e)}(!0),a}(c,r):null;let p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let f,m=l?Rp(e):null;return l&&function t(){const n=Rp(e);m&&!Zp(m,n)&&r(),m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Gp=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=Fu(r),s=Lu(r),l="y"===qu(r),c=np.has(i)?-1:1,d=a&&l?-1:1,u=Ru(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Xp=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=Ru(e,t),c={x:r,y:n},d=await ep(t,l),u=qu(Fu(o)),p=Bu(u);let h=c[p],f=c[u];if(a){const e="y"===p?"bottom":"right";h=Au(h+d["y"===p?"top":"left"],h,h-d[e])}if(i){const e="y"===u?"bottom":"right";f=Au(f+d["y"===u?"top":"left"],f,f-d[e])}const m=s.fn({...t,[p]:h,[u]:f});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[u]:i}}}}}},Qp=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...v}=Ru(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=Fu(o),g=qu(s),x=Fu(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),k=p||(x||!m?[Gu(s)]:function(e){const t=Gu(e);return[$u(e),t,$u(t)]}(s)),_="none"!==f;!p&&_&&k.push(...Ku(s,m,f,b));const w=[s,...k],M=await ep(t,v),C=[];let D=(null==(n=a.flip)?void 0:n.overflows)||[];if(d&&C.push(M[y]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=Lu(e),o=Hu(e),a=Vu(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Gu(i)),[i,Gu(i)]}(o,i,b);C.push(M[e[0]],M[e[1]])}if(D=[...D,{placement:o,overflows:C}],!C.every(e=>e<=0)){var j,O;const e=((null==(j=a.flip)?void 0:j.index)||0)+1,t=w[e];if(t&&("alignment"!==u||g===qu(t)||D.every(e=>e.overflows[0]>0&&qu(e.placement)===g)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(O=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!r)switch(h){case"bestFit":{var S;const e=null==(S=D.filter(e=>{if(_){const t=qu(e.placement);return t===g||"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:S[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Jp=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Ru(e,t),d=await ep(t,c),u=Fu(o),p=Lu(o),h="y"===qu(o),{width:f,height:m}=a.floating;let v,y;"top"===u||"bottom"===u?(v=u,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,v="end"===p?"top":"bottom");const g=m-d.top-d.bottom,x=f-d.left-d.right,b=Ou(m-d[v],g),k=Ou(f-d[y],x),_=!t.middlewareData.shift;let w=b,M=k;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(M=x),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(w=g),_&&!p){const e=Su(d.left,0),t=Su(d.right,0),r=Su(d.top,0),n=Su(d.bottom,0);h?M=f-2*(0!==e||0!==t?e+t:Su(d.left,d.right)):w=m-2*(0!==r||0!==n?r+n:Su(d.top,d.bottom))}await l({...t,availableWidth:M,availableHeight:w});const C=await i.getDimensions(s.floating);return f!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},eh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Ru(e,t);switch(n){case"referenceHidden":{const e=tp(await ep(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:rp(e)}}}case"escaped":{const e=tp(await ep(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:rp(e)}}}default:return{}}}}},th=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Ru(e,t)||{};if(null==c)return{};const u=Xu(d),p={x:r,y:n},h=Hu(o),f=Vu(h),m=await i.getDimensions(c),v="y"===h,y=v?"top":"left",g=v?"bottom":"right",x=v?"clientHeight":"clientWidth",b=a.reference[f]+a.reference[h]-p[h]-a.floating[f],k=p[h]-a.reference[h],_=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let w=_?_[x]:0;(!w||!await(null==i.isElement?void 0:i.isElement(_)))&&(w=s.floating[x]||a.floating[f]);const M=b/2-k/2,C=w/2-m[f]/2-1,D=Ou(u[y],C),j=Ou(u[g],C),O=D,S=w-m[f]-j,P=w/2-m[f]/2+M,E=Au(O,P,S),T=!l.arrow&&null!=Lu(o)&&P!==E&&a.reference[f]/2-(P<O?D:j)-m[f]/2<0,N=T?P<O?P-O:P-S:0;return{[h]:p[h]+N,data:{[h]:E,centerOffset:P-E-N,...T&&{alignmentOffset:N}},reset:T}}}),rh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Ru(e,t),d={x:r,y:n},u=qu(o),p=Bu(u);let h=d[p],f=d[u];const m=Ru(s,t),v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,r=a.reference[p]+a.reference[e]-v.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var y,g;const e="y"===p?"width":"height",t=np.has(Fu(o)),r=a.reference[u]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[u])||0)+(t?0:v.crossAxis),n=a.reference[u]+a.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[u])||0)-(t?v.crossAxis:0);f<r?f=r:f>n&&(f=n)}return{[p]:h,[u]:f}}}},nh=(e,t,r)=>{const n=new Map,o={platform:Yp,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Ju(c,n,l),p=n,h={},f=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:v,y:y,data:g,reset:x}=await m({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});d=v??d,u=y??u,h={...h,[a]:{...h[a],...g}},x&&f<=50&&(f++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:d,y:u}=Ju(c,p,l))),r=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var oh=typeof document<"u"?r.useLayoutEffect:function(){};function ah(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!ah(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||ah(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function ih(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sh(e,t){const r=ih(e);return Math.round(t*r)/r}function lh(e){const t=a.useRef(e);return oh(()=>{t.current=e}),t}const ch=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?th({element:r.current,padding:n}).fn(t):{}:r?th({element:r,padding:n}).fn(t):{}}}),dh=(e,t)=>({...Gp(e),options:[e,t]}),uh=(e,t)=>({...Xp(e),options:[e,t]}),ph=(e,t)=>({...rh(e),options:[e,t]}),hh=(e,t)=>({...Qp(e),options:[e,t]}),fh=(e,t)=>({...Jp(e),options:[e,t]}),mh=(e,t)=>({...eh(e),options:[e,t]}),vh=(e,t)=>({...ch(e),options:[e,t]});var yh=a.forwardRef((e,r)=>{const{children:n,width:o=10,height:a=5,...i}=e;return t.jsx(Gd.svg,{...i,ref:r,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});yh.displayName="Arrow";var gh=yh;function xh(e){const[t,r]=a.useState(void 0);return Yd(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var bh="Popper",[kh,_h]=Wd(bh),[wh,Mh]=kh(bh),Ch=e=>{const{__scopePopper:r,children:n}=e,[o,i]=a.useState(null);return t.jsx(wh,{scope:r,anchor:o,onAnchorChange:i,children:n})};Ch.displayName=bh;var Dh="PopperAnchor",jh=a.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:o,...i}=e,s=Mh(Dh,n),l=a.useRef(null),c=Ft(r,l);return a.useEffect(()=>{s.onAnchorChange((null==o?void 0:o.current)||l.current)}),o?null:t.jsx(Gd.div,{...i,ref:c})});jh.displayName=Dh;var Oh="PopperContent",[Sh,Ph]=kh(Oh),Eh=a.forwardRef((e,r)=>{var n,o,s,l,c,d;const{__scopePopper:u,side:p="bottom",sideOffset:h=0,align:f="center",alignOffset:m=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:x=0,sticky:b="partial",hideWhenDetached:k=!1,updatePositionStrategy:_="optimized",onPlaced:w,...M}=e,C=Mh(Oh,u),[D,j]=a.useState(null),O=Ft(r,e=>j(e)),[S,P]=a.useState(null),E=xh(S),T=(null==E?void 0:E.width)??0,N=(null==E?void 0:E.height)??0,z=p+("center"!==f?"-"+f:""),A="number"==typeof x?x:{top:0,right:0,bottom:0,left:0,...x},R=Array.isArray(g)?g:[g],F=R.length>0,L={padding:A,boundary:R.filter(Ah),altBoundary:F},{refs:B,floatingStyles:V,placement:I,isPositioned:q,middlewareData:H}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,h]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=a.useState(n);ah(f,n)||m(n);const[v,y]=a.useState(null),[g,x]=a.useState(null),b=a.useCallback(e=>{e!==M.current&&(M.current=e,y(e))},[]),k=a.useCallback(e=>{e!==C.current&&(C.current=e,x(e))},[]),_=s||v,w=l||g,M=a.useRef(null),C=a.useRef(null),D=a.useRef(p),j=null!=d,O=lh(d),S=lh(o),P=lh(u),E=a.useCallback(()=>{if(!M.current||!C.current)return;const e={placement:t,strategy:r,middleware:f};S.current&&(e.platform=S.current),nh(M.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};T.current&&!ah(D.current,t)&&(D.current=t,i.flushSync(()=>{h(t)}))})},[f,t,r,S,P]);oh(()=>{!1===u&&D.current.isPositioned&&(D.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const T=a.useRef(!1);oh(()=>(T.current=!0,()=>{T.current=!1}),[]),oh(()=>{if(_&&(M.current=_),w&&(C.current=w),_&&w){if(O.current)return O.current(_,w,E);E()}},[_,w,E,O,j]);const N=a.useMemo(()=>({reference:M,floating:C,setReference:b,setFloating:k}),[b,k]),z=a.useMemo(()=>({reference:_,floating:w}),[_,w]),A=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!z.floating)return e;const t=sh(z.floating,p.x),n=sh(z.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...ih(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,c,z.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:E,refs:N,elements:z,floatingStyles:A}),[p,E,N,z,A])}({strategy:"fixed",placement:z,whileElementsMounted:(...e)=>Kp(...e,{animationFrame:"always"===_}),elements:{reference:C.anchor},middleware:[dh({mainAxis:h+N,alignmentAxis:m}),y&&uh({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?ph():void 0,...L}),y&&hh({...L}),fh({...L,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&vh({element:S,padding:v}),Rh({arrowWidth:T,arrowHeight:N}),k&&mh({strategy:"referenceHidden",...L})]}),[$,W]=Fh(I),U=tu(w);Yd(()=>{q&&(null==U||U())},[q,U]);const Y=null==(n=H.arrow)?void 0:n.x,Z=null==(o=H.arrow)?void 0:o.y,K=0!==(null==(s=H.arrow)?void 0:s.centerOffset),[G,X]=a.useState();return Yd(()=>{D&&X(window.getComputedStyle(D).zIndex)},[D]),t.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[null==(l=H.transformOrigin)?void 0:l.x,null==(c=H.transformOrigin)?void 0:c.y].join(" "),...(null==(d=H.hide)?void 0:d.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Sh,{scope:u,placedSide:$,onArrowChange:P,arrowX:Y,arrowY:Z,shouldHideArrow:K,children:t.jsx(Gd.div,{"data-side":$,"data-align":W,...M,ref:O,style:{...M.style,animation:q?void 0:"none"}})})})});Eh.displayName=Oh;var Th="PopperArrow",Nh={top:"bottom",right:"left",bottom:"top",left:"right"},zh=a.forwardRef(function(e,r){const{__scopePopper:n,...o}=e,a=Ph(Th,n),i=Nh[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(gh,{...o,ref:r,style:{...o.style,display:"block"}})})});function Ah(e){return null!==e}zh.displayName=Th;var Rh=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o;const{placement:a,rects:i,middlewareData:s}=t,l=0!==(null==(r=s.arrow)?void 0:r.centerOffset),c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,p]=Fh(a),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(n=s.arrow)?void 0:n.x)??0)+c/2,m=((null==(o=s.arrow)?void 0:o.y)??0)+d/2;let v="",y="";return"bottom"===u?(v=l?h:`${f}px`,y=-d+"px"):"top"===u?(v=l?h:`${f}px`,y=`${i.floating.height+d}px`):"right"===u?(v=-d+"px",y=l?h:`${m}px`):"left"===u&&(v=`${i.floating.width+d}px`,y=l?h:`${m}px`),{data:{x:v,y:y}}}});function Fh(e){const[t,r="center"]=e.split("-");return[t,r]}var Lh=Ch,Bh=jh,Vh=Eh,Ih=zh,qh=a.forwardRef((e,r)=>{var o;const{container:i,...s}=e,[l,c]=a.useState(!1);Yd(()=>c(!0),[]);const d=i||l&&(null==(o=null==globalThis?void 0:globalThis.document)?void 0:o.body);return d?n.createPortal(t.jsx(Gd.div,{...s,ref:r}),d):null});qh.displayName="Portal";var Hh=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const e=$h(n.current);i.current="mounted"===l?e:"none"},[l]),Yd(()=>{const t=n.current,r=o.current;if(r!==e){const n=i.current,a=$h(t);e?c("MOUNT"):"none"===a||"none"===(null==t?void 0:t.display)?c("UNMOUNT"):c(r&&n!==a?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Yd(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=$h(n.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(i.current=$h(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),i=Ft(n.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof r||n.isPresent?a.cloneElement(o,{ref:i}):null};function $h(e){return(null==e?void 0:e.animationName)||"none"}Hh.displayName="Presence";var Wh="rovingFocusGroup.onEntryFocus",Uh={bubbles:!1,cancelable:!0},Yh="RovingFocusGroup",[Zh,Kh,Gh]=Qd(Yh),[Xh,Qh]=Wd(Yh,[Gh]),[Jh,ef]=Xh(Yh),tf=a.forwardRef((e,r)=>t.jsx(Zh.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Zh.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(rf,{...e,ref:r})})}));tf.displayName=Yh;var rf=a.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...h}=e,f=a.useRef(null),m=Ft(r,f),v=eu(s),[y,g]=Kd({prop:l,defaultProp:c??null,onChange:d,caller:Yh}),[x,b]=a.useState(!1),k=tu(u),_=Kh(n),w=a.useRef(!1),[M,C]=a.useState(0);return a.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(Wh,k),()=>e.removeEventListener(Wh,k)},[k]),t.jsx(Jh,{scope:n,orientation:o,dir:v,loop:i,currentTabStopId:y,onItemFocus:a.useCallback(e=>g(e),[g]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Gd.div,{tabIndex:x||0===M?-1:0,"data-orientation":o,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:$d(e.onMouseDown,()=>{w.current=!0}),onFocus:$d(e.onFocus,e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!x){const t=new CustomEvent(Wh,Uh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=_().filter(e=>e.focusable),t=e.find(e=>e.active),r=e.find(e=>e.id===y),n=[t,r,...e].filter(Boolean).map(e=>e.ref.current);sf(n,p)}}w.current=!1}),onBlur:$d(e.onBlur,()=>b(!1))})})}),nf="RovingFocusGroupItem",of=a.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=Du(),u=s||d,p=ef(nf,n),h=p.currentTabStopId===u,f=Kh(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return a.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),t.jsx(Zh.ItemSlot,{scope:n,id:u,focusable:o,active:i,children:t.jsx(Gd.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:r,onMouseDown:$d(e.onMouseDown,e=>{o?p.onItemFocus(u):e.preventDefault()}),onFocus:$d(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:$d(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return af[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>sf(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=y}):l})})});of.displayName=nf;var af={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sf(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var lf=tf,cf=of,df=new WeakMap,uf=new WeakMap,pf={},hf=0,ff=function(e){return e&&(e.host||ff(e.parentNode))},mf=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=ff(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);pf[r]||(pf[r]=new WeakMap);var a=pf[r],i=[],s=new Set,l=new Set(o),c=function(e){!e||s.has(e)||(s.add(e),c(e.parentNode))};o.forEach(c);var d=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))d(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(df.get(e)||0)+1,c=(a.get(e)||0)+1;df.set(e,l),a.set(e,c),i.push(e),1===l&&o&&uf.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),s.clear(),hf++,function(){i.forEach(function(e){var t=df.get(e)-1,o=a.get(e)-1;df.set(e,t),a.set(e,o),t||(uf.has(e)||e.removeAttribute(n),uf.delete(e)),o||e.removeAttribute(r)}),--hf||(df=new WeakMap,df=new WeakMap,uf=new WeakMap,pf={})}},vf=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),mf(n,o,r,"aria-hidden")):function(){return null}},yf=function(){return yf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yf.apply(this,arguments)};function gf(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function xf(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var bf="right-scroll-bar-position",kf="width-before-scroll-bar";function _f(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var wf=typeof window<"u"?a.useLayoutEffect:a.useEffect,Mf=new WeakMap;function Cf(e,t){var n=function(e,t){var n=r.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(null,function(t){return e.forEach(function(e){return _f(e,t)})});return wf(function(){var t=Mf.get(n);if(t){var r=new Set(t),o=new Set(e),a=n.current;r.forEach(function(e){o.has(e)||_f(e,null)}),o.forEach(function(e){r.has(e)||_f(e,a)})}Mf.set(n,e)},[e]),n}function Df(e){return e}function jf(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Df);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return o}(null);return t.options=yf({async:!0,ssr:!1},e),t}var Of=function(e){var t=e.sideCar,r=gf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,yf({},r))};function Sf(e,t){return e.useMedium(t),Of}Of.isSideCarExport=!0;var Pf=jf(),Ef=function(){},Tf=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:Ef,onWheelCapture:Ef,onTouchMoveCapture:Ef}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,x=void 0===g?"div":g,b=e.gapMode,k=gf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,w=Cf([r,t]),M=yf(yf({},k),o);return a.createElement(a.Fragment,null,u&&a.createElement(_,{sideCar:Pf,removeScrollBar:d,shards:p,noRelative:f,noIsolation:m,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:r,gapMode:b}),s?a.cloneElement(a.Children.only(l),yf(yf({},M),{ref:w})):a.createElement(x,yf({},M,{className:c,ref:w}),l))});Tf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tf.classNames={fullWidth:kf,zeroRight:bf};function Nf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var zf=function(){var e=0,t=null;return{add:function(r){0==e&&(t=Nf())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,r),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Af=function(){var e=function(){var e=zf();return function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}}();return function(t){var r=t.styles,n=t.dynamic;return e(r,n),null}},Rf={left:0,top:0,right:0,gap:0},Ff=function(e){return parseInt(e||"",10)||0},Lf=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return Rf;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Ff(r),Ff(n),Ff(o)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Bf=Af(),Vf="data-scroll-locked",If=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(Vf,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(bf," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(kf," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(bf," .").concat(bf," {\n right: 0 ").concat(n,";\n }\n \n .").concat(kf," .").concat(kf," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Vf,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},qf=function(){var e=parseInt(document.body.getAttribute(Vf)||"0",10);return isFinite(e)?e:0},Hf=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(Vf,(qf()+1).toString()),function(){var e=qf()-1;e<=0?document.body.removeAttribute(Vf):document.body.setAttribute(Vf,e.toString())}},[]);var i=a.useMemo(function(){return Lf(o)},[o]);return a.createElement(Bf,{styles:If(i,!t,o,r?"":"!important")})},$f=!1;if(typeof window<"u")try{var Wf=Object.defineProperty({},"passive",{get:function(){return $f=!0,!0}});window.addEventListener("test",Wf,Wf),window.removeEventListener("test",Wf,Wf)}catch{$f=!1}var Uf=!!$f&&{passive:!1},Yf=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Zf=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),Kf(e,n)){var o=Gf(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Kf=function(e,t){return"v"===e?function(e){return Yf(e,"overflowY")}(t):function(e){return Yf(e,"overflowX")}(t)},Gf=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Xf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qf=function(e){return[e.deltaX,e.deltaY]},Jf=function(e){return e&&"current"in e?e.current:e},em=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},tm=0,rm=[];function nm(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const om=Sf(Pf,function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(tm++)[0],i=a.useState(Af)[0],s=a.useRef(e);a.useEffect(function(){s.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=xf([e.lockRef.current],(e.shards||[]).map(Jf),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=Xf(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=Zf(u,d);if(!p)return!0;if(p?o=u:(o="v"===u?"h":"v",p=Zf(u,d)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,d=0,u=0;do{if(!i)break;var p=Gf(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&Kf(e,i)&&(d+=f,u+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(d)<1||!c&&Math.abs(u)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=a.useCallback(function(e){var r=e;if(rm.length&&rm[rm.length-1]===i){var n="deltaY"in r?Qf(r):Xf(r),o=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var a=(s.current.shards||[]).map(Jf).filter(Boolean).filter(function(e){return e.contains(r.target)});(a.length>0?l(r,a[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:nm(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=a.useCallback(function(e){r.current=Xf(e),n.current=void 0},[]),p=a.useCallback(function(t){d(t.type,Qf(t),t.target,l(t,e.lockRef.current))},[]),h=a.useCallback(function(t){d(t.type,Xf(t),t.target,l(t,e.lockRef.current))},[]);a.useEffect(function(){return rm.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Uf),document.addEventListener("touchmove",c,Uf),document.addEventListener("touchstart",u,Uf),function(){rm=rm.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,Uf),document.removeEventListener("touchmove",c,Uf),document.removeEventListener("touchstart",u,Uf)}},[]);var f=e.removeScrollBar,m=e.inert;return a.createElement(a.Fragment,null,m?a.createElement(i,{styles:em(o)}):null,f?a.createElement(Hf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var am=a.forwardRef(function(e,t){return a.createElement(Tf,yf({},e,{ref:t,sideCar:om}))});am.classNames=Tf.classNames;var im=["Enter"," "],sm=["ArrowUp","PageDown","End"],lm=["ArrowDown","PageUp","Home",...sm],cm={ltr:[...im,"ArrowRight"],rtl:[...im,"ArrowLeft"]},dm={ltr:["ArrowLeft"],rtl:["ArrowRight"]},um="Menu",[pm,hm,fm]=Qd(um),[mm,vm]=Wd(um,[fm,_h,Qh]),ym=_h(),gm=Qh(),[xm,bm]=mm(um),[km,_m]=mm(um),wm=e=>{const{__scopeMenu:r,open:n=!1,children:o,dir:i,onOpenChange:s,modal:l=!0}=e,c=ym(r),[d,u]=a.useState(null),p=a.useRef(!1),h=tu(s),f=eu(i);return a.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.jsx(Lh,{...c,children:t.jsx(xm,{scope:r,open:n,onOpenChange:h,content:d,onContentChange:u,children:t.jsx(km,{scope:r,onClose:a.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:o})})})};wm.displayName=um;var Mm=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=ym(n);return t.jsx(Bh,{...a,...o,ref:r})});Mm.displayName="MenuAnchor";var Cm="MenuPortal",[Dm,jm]=mm(Cm,{forceMount:void 0}),Om=e=>{const{__scopeMenu:r,forceMount:n,children:o,container:a}=e,i=bm(Cm,r);return t.jsx(Dm,{scope:r,forceMount:n,children:t.jsx(Hh,{present:n||i.open,children:t.jsx(qh,{asChild:!0,container:a,children:o})})})};Om.displayName=Cm;var Sm="MenuContent",[Pm,Em]=mm(Sm),Tm=a.forwardRef((e,r)=>{const n=jm(Sm,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=bm(Sm,e.__scopeMenu),s=_m(Sm,e.__scopeMenu);return t.jsx(pm.Provider,{scope:e.__scopeMenu,children:t.jsx(Hh,{present:o||i.open,children:t.jsx(pm.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(Nm,{...a,ref:r}):t.jsx(zm,{...a,ref:r})})})})}),Nm=a.forwardRef((e,r)=>{const n=bm(Sm,e.__scopeMenu),o=a.useRef(null),i=Ft(r,o);return a.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),t.jsx(Rm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$d(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zm=a.forwardRef((e,r)=>{const n=bm(Sm,e.__scopeMenu);return t.jsx(Rm,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Am=Lt("MenuContent.ScrollLock"),Rm=a.forwardRef((e,r)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:v,...y}=e,g=bm(Sm,n),x=_m(Sm,n),b=ym(n),k=gm(n),_=hm(n),[w,M]=a.useState(null),C=a.useRef(null),D=Ft(r,C,g.onContentChange),j=a.useRef(0),O=a.useRef(""),S=a.useRef(0),P=a.useRef(null),E=a.useRef("right"),T=a.useRef(0),N=v?am:a.Fragment,z=v?{as:Am,allowPinchZoom:!0}:void 0,A=e=>{var t,r;const n=O.current+e,o=_().filter(e=>!e.disabled),a=document.activeElement,i=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,s=o.map(e=>e.textValue),l=function(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}(s,n,i),c=null==(r=o.find(e=>e.textValue===l))?void 0:r.ref.current;(function e(t){O.current=t,window.clearTimeout(j.current),""!==t&&(j.current=window.setTimeout(()=>e(""),1e3))})(n),c&&setTimeout(()=>c.focus())};a.useEffect(()=>()=>window.clearTimeout(j.current),[]),pu();const R=a.useCallback(e=>{var t,r;return E.current===(null==(t=P.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>n!=u>n&&r<(d-l)*(n-c)/(u-c)+l&&(o=!o)}return o}(r,t)}(e,null==(r=P.current)?void 0:r.area)},[]);return t.jsx(Pm,{scope:n,searchRef:O,onItemEnter:a.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:a.useCallback(e=>{var t;R(e)||(null==(t=C.current)||t.focus(),M(null))},[R]),onTriggerLeave:a.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:S,onPointerGraceIntentChange:a.useCallback(e=>{P.current=e},[]),children:t.jsx(N,{...z,children:t.jsx(yu,{asChild:!0,trapped:i,onMountAutoFocus:$d(s,e=>{var t;e.preventDefault(),null==(t=C.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(su,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:t.jsx(lf,{asChild:!0,...k,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:w,onCurrentTabStopIdChange:M,onEntryFocus:$d(d,e=>{x.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Vh,{role:"menu","aria-orientation":"vertical","data-state":lv(g.open),"data-radix-menu-content":"",dir:x.dir,...b,...y,ref:D,style:{outline:"none",...y.style},onKeyDown:$d(y.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&A(e.key));const o=C.current;if(e.target!==o||!lm.includes(e.key))return;e.preventDefault();const a=_().filter(e=>!e.disabled).map(e=>e.ref.current);sm.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:$d(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),O.current="")}),onPointerMove:$d(e.onPointerMove,uv(e=>{const t=e.target,r=T.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>T.current?"right":"left";E.current=t,T.current=e.clientX}}))})})})})})})});Tm.displayName=Sm;var Fm=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Gd.div,{role:"group",...o,ref:r})});Fm.displayName="MenuGroup";var Lm=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Gd.div,{...o,ref:r})});Lm.displayName="MenuLabel";var Bm="MenuItem",Vm="menu.itemSelect",Im=a.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:o,...i}=e,s=a.useRef(null),l=_m(Bm,e.__scopeMenu),c=Em(Bm,e.__scopeMenu),d=Ft(r,s),u=a.useRef(!1);return t.jsx(qm,{...i,ref:d,disabled:n,onClick:$d(e.onClick,()=>{const e=s.current;if(!n&&e){const t=new CustomEvent(Vm,{bubbles:!0,cancelable:!0});e.addEventListener(Vm,e=>null==o?void 0:o(e),{once:!0}),Xd(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),u.current=!0},onPointerUp:$d(e.onPointerUp,e=>{var t;u.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:$d(e.onKeyDown,e=>{const t=""!==c.searchRef.current;n||t&&" "===e.key||im.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Im.displayName=Bm;var qm=a.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:o=!1,textValue:i,...s}=e,l=Em(Bm,n),c=gm(n),d=a.useRef(null),u=Ft(r,d),[p,h]=a.useState(!1),[f,m]=a.useState("");return a.useEffect(()=>{const e=d.current;e&&m((e.textContent??"").trim())},[s.children]),t.jsx(pm.ItemSlot,{scope:n,disabled:o,textValue:i??f,children:t.jsx(cf,{asChild:!0,...c,focusable:!o,children:t.jsx(Gd.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:u,onPointerMove:$d(e.onPointerMove,uv(e=>{o?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$d(e.onPointerLeave,uv(e=>l.onItemLeave(e))),onFocus:$d(e.onFocus,()=>h(!0)),onBlur:$d(e.onBlur,()=>h(!1))})})})}),Hm=a.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:o,...a}=e;return t.jsx(Xm,{scope:e.__scopeMenu,checked:n,children:t.jsx(Im,{role:"menuitemcheckbox","aria-checked":cv(n)?"mixed":n,...a,ref:r,"data-state":dv(n),onSelect:$d(a.onSelect,()=>null==o?void 0:o(!!cv(n)||!n),{checkForDefaultPrevented:!1})})})});Hm.displayName="MenuCheckboxItem";var $m="MenuRadioGroup",[Wm,Um]=mm($m,{value:void 0,onValueChange:()=>{}}),Ym=a.forwardRef((e,r)=>{const{value:n,onValueChange:o,...a}=e,i=tu(o);return t.jsx(Wm,{scope:e.__scopeMenu,value:n,onValueChange:i,children:t.jsx(Fm,{...a,ref:r})})});Ym.displayName=$m;var Zm="MenuRadioItem",Km=a.forwardRef((e,r)=>{const{value:n,...o}=e,a=Um(Zm,e.__scopeMenu),i=n===a.value;return t.jsx(Xm,{scope:e.__scopeMenu,checked:i,children:t.jsx(Im,{role:"menuitemradio","aria-checked":i,...o,ref:r,"data-state":dv(i),onSelect:$d(o.onSelect,()=>{var e;return null==(e=a.onValueChange)?void 0:e.call(a,n)},{checkForDefaultPrevented:!1})})})});Km.displayName=Zm;var Gm="MenuItemIndicator",[Xm,Qm]=mm(Gm,{checked:!1}),Jm=a.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:o,...a}=e,i=Qm(Gm,n);return t.jsx(Hh,{present:o||cv(i.checked)||!0===i.checked,children:t.jsx(Gd.span,{...a,ref:r,"data-state":dv(i.checked)})})});Jm.displayName=Gm;var ev=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Gd.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});ev.displayName="MenuSeparator";var tv=a.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=ym(n);return t.jsx(Ih,{...a,...o,ref:r})});tv.displayName="MenuArrow";var[rv,nv]=mm("MenuSub"),ov="MenuSubTrigger",av=a.forwardRef((e,r)=>{const n=bm(ov,e.__scopeMenu),o=_m(ov,e.__scopeMenu),i=nv(ov,e.__scopeMenu),s=Em(ov,e.__scopeMenu),l=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:e.__scopeMenu},p=a.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return a.useEffect(()=>p,[p]),a.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),t.jsx(Mm,{asChild:!0,...u,children:t.jsx(qm,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":lv(n.open),...e,ref:Rt(r,i.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$d(e.onPointerMove,uv(t=>{s.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:$d(e.onPointerLeave,uv(e=>{var t,r;p();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,a="right"===t,i=a?-5:5,l=o[a?"left":"right"],d=o[a?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:l,y:o.top},{x:d,y:o.top},{x:d,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:$d(e.onKeyDown,t=>{var r;const a=""!==s.searchRef.current;e.disabled||a&&" "===t.key||cm[o.dir].includes(t.key)&&(n.onOpenChange(!0),null==(r=n.content)||r.focus(),t.preventDefault())})})})});av.displayName=ov;var iv="MenuSubContent",sv=a.forwardRef((e,r)=>{const n=jm(Sm,e.__scopeMenu),{forceMount:o=n.forceMount,...i}=e,s=bm(Sm,e.__scopeMenu),l=_m(Sm,e.__scopeMenu),c=nv(iv,e.__scopeMenu),d=a.useRef(null),u=Ft(r,d);return t.jsx(pm.Provider,{scope:e.__scopeMenu,children:t.jsx(Hh,{present:o||s.open,children:t.jsx(pm.Slot,{scope:e.__scopeMenu,children:t.jsx(Rm,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;l.isUsingKeyboardRef.current&&(null==(t=d.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:$d(e.onFocusOutside,e=>{e.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:$d(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:$d(e.onKeyDown,e=>{var t;const r=e.currentTarget.contains(e.target),n=dm[l.dir].includes(e.key);r&&n&&(s.onOpenChange(!1),null==(t=c.trigger)||t.focus(),e.preventDefault())})})})})})});function lv(e){return e?"open":"closed"}function cv(e){return"indeterminate"===e}function dv(e){return cv(e)?"indeterminate":e?"checked":"unchecked"}function uv(e){return t=>"mouse"===t.pointerType?e(t):void 0}sv.displayName=iv;var pv=wm,hv=Mm,fv=Om,mv=Tm,vv=Fm,yv=Lm,gv=Im,xv=Hm,bv=Ym,kv=Km,_v=Jm,wv=ev,Mv=tv,Cv=av,Dv=sv,jv="DropdownMenu",[Ov,Sv]=Wd(jv,[vm]),Pv=vm(),[Ev,Tv]=Ov(jv),Nv=e=>{const{__scopeDropdownMenu:r,children:n,dir:o,open:i,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=Pv(r),u=a.useRef(null),[p,h]=Kd({prop:i,defaultProp:s??!1,onChange:l,caller:jv});return t.jsx(Ev,{scope:r,triggerId:Du(),triggerRef:u,contentId:Du(),open:p,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),modal:c,children:t.jsx(pv,{...d,open:p,onOpenChange:h,dir:o,modal:c,children:n})})};Nv.displayName=jv;var zv="DropdownMenuTrigger",Av=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=e,i=Tv(zv,n),s=Pv(n);return t.jsx(hv,{asChild:!0,...s,children:t.jsx(Gd.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:Rt(r,i.triggerRef),onPointerDown:$d(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:$d(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});Av.displayName=zv;var Rv=e=>{const{__scopeDropdownMenu:r,...n}=e,o=Pv(r);return t.jsx(fv,{...o,...n})};Rv.displayName="DropdownMenuPortal";var Fv="DropdownMenuContent",Lv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,i=Tv(Fv,n),s=Pv(n),l=a.useRef(!1);return t.jsx(mv,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...o,ref:r,onCloseAutoFocus:$d(e.onCloseAutoFocus,e=>{var t;l.current||null==(t=i.triggerRef.current)||t.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:$d(e.onInteractOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!i.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Lv.displayName=Fv;var Bv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(vv,{...a,...o,ref:r})});Bv.displayName="DropdownMenuGroup";var Vv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(yv,{...a,...o,ref:r})});Vv.displayName="DropdownMenuLabel";var Iv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(gv,{...a,...o,ref:r})});Iv.displayName="DropdownMenuItem";var qv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(xv,{...a,...o,ref:r})});qv.displayName="DropdownMenuCheckboxItem";var Hv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(bv,{...a,...o,ref:r})});Hv.displayName="DropdownMenuRadioGroup";var $v=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(kv,{...a,...o,ref:r})});$v.displayName="DropdownMenuRadioItem";var Wv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(_v,{...a,...o,ref:r})});Wv.displayName="DropdownMenuItemIndicator";var Uv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(wv,{...a,...o,ref:r})});Uv.displayName="DropdownMenuSeparator";var Yv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(Mv,{...a,...o,ref:r})});Yv.displayName="DropdownMenuArrow";var Zv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(Cv,{...a,...o,ref:r})});Zv.displayName="DropdownMenuSubTrigger";var Kv=a.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=Pv(n);return t.jsx(Dv,{...a,...o,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Kv.displayName="DropdownMenuSubContent";var Gv=Rv,Xv=Lv,Qv=Vv,Jv=Iv,ey=qv,ty=$v,ry=Wv,ny=Uv,oy=Zv,ay=Kv;const iy=Nv,sy=Av,ly=a.forwardRef(({className:e,inset:r,children:n,...o},a)=>t.jsxs(oy,{ref:a,className:Br("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...o,children:[n,t.jsx(gt,{className:"ml-auto"})]}));ly.displayName=oy.displayName;const cy=a.forwardRef(({className:e,...r},n)=>t.jsx(ay,{ref:n,className:Br("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));cy.displayName=ay.displayName;const dy=a.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(Gv,{children:t.jsx(Xv,{ref:o,sideOffset:r,className:Br("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));dy.displayName=Xv.displayName;const uy=a.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(Jv,{ref:o,className:Br("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...n}));uy.displayName=Jv.displayName;const py=a.forwardRef(({className:e,children:r,checked:n,...o},a)=>t.jsxs(ey,{ref:a,className:Br("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(ry,{children:t.jsx(mt,{className:"h-4 w-4"})})}),r]}));py.displayName=ey.displayName;const hy=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(ty,{ref:o,className:Br("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(ry,{children:t.jsx(_t,{className:"h-2 w-2 fill-current"})})}),r]}));hy.displayName=ty.displayName;const fy=a.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(Qv,{ref:o,className:Br("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));fy.displayName=Qv.displayName;const my=a.forwardRef(({className:e,...r},n)=>t.jsx(ny,{ref:n,className:Br("-mx-1 my-1 h-px bg-muted",e),...r}));my.displayName=ny.displayName;const vy=({isFilterOpen:e,setIsFilterOpen:r,selectedColors:n,toggleColorSelection:o,currentConfig:a})=>t.jsxs(iy,{open:e,onOpenChange:r,children:[t.jsx(sy,{asChild:!0,children:t.jsx(Ir,{variant:"outline",size:"sm",className:"w-20 overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsxs(qd.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(Ct,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?a.localization.filtering:a.localization.filter})]},e?"open":"closed")})})}),t.jsxs(dy,{children:[t.jsx(fy,{children:a.localization.filterByColor}),t.jsx(my,{}),s.map(e=>t.jsx(py,{checked:n.includes(e.value),onCheckedChange:()=>o(e.value),onSelect:e=>{e.preventDefault()},children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value)),t.jsx(my,{}),t.jsx(Ir,{variant:"ghost",size:"sm",onClick:()=>r(!1),className:"w-full justify-center h-8 text-sm",children:a.localization.close})]})]}),yy=({handleTodayClick:e,isTodayDisabled:r,getTodayButtonText:n})=>t.jsx(Ir,{variant:"outline",size:"sm",onClick:e,disabled:r,className:"flex items-center space-x-1 w-28 h-10 justify-center overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsxs(qd.div,{className:"flex items-center space-x-1",initial:{opacity:0},animate:{opacity:[0,1.05,1]},transition:{duration:.2,times:[0,.8,1]},children:[t.jsx(ft,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{children:n()})]},n())})});var gy=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xy=a.forwardRef((e,r)=>t.jsx(Gd.span,{...e,ref:r,style:{...gy,...e.style}}));xy.displayName="VisuallyHidden";var by=xy,[ky,_y]=Wd("Tooltip",[_h]),wy=_h(),My="TooltipProvider",Cy=700,Dy="tooltip.open",[jy,Oy]=ky(My),Sy=e=>{const{__scopeTooltip:r,delayDuration:n=Cy,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:s}=e,l=a.useRef(!0),c=a.useRef(!1),d=a.useRef(0);return a.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),t.jsx(jy,{scope:r,isOpenDelayedRef:l,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:s})};Sy.displayName=My;var Py="Tooltip",[Ey,Ty]=ky(Py),Ny=e=>{const{__scopeTooltip:r,children:n,open:o,defaultOpen:i,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,d=Oy(Py,e.__scopeTooltip),u=wy(r),[p,h]=a.useState(null),f=Du(),m=a.useRef(0),v=l??d.disableHoverableContent,y=c??d.delayDuration,g=a.useRef(!1),[x,b]=Kd({prop:o,defaultProp:i??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(Dy))):d.onClose(),null==s||s(e)},caller:Py}),k=a.useMemo(()=>x?g.current?"delayed-open":"instant-open":"closed",[x]),_=a.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,b(!0)},[b]),w=a.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),M=a.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,b(!0),m.current=0},y)},[y,b]);return a.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),t.jsx(Lh,{...u,children:t.jsx(Ey,{scope:r,contentId:f,open:x,stateAttribute:k,trigger:p,onTriggerChange:h,onTriggerEnter:a.useCallback(()=>{d.isOpenDelayedRef.current?M():_()},[d.isOpenDelayedRef,M,_]),onTriggerLeave:a.useCallback(()=>{v?w():(window.clearTimeout(m.current),m.current=0)},[w,v]),onOpen:_,onClose:w,disableHoverableContent:v,children:n})})};Ny.displayName=Py;var zy="TooltipTrigger",Ay=a.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,i=Ty(zy,n),s=Oy(zy,n),l=wy(n),c=Ft(r,a.useRef(null),i.onTriggerChange),d=a.useRef(!1),u=a.useRef(!1),p=a.useCallback(()=>d.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Bh,{asChild:!0,...l,children:t.jsx(Gd.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...o,ref:c,onPointerMove:$d(e.onPointerMove,e=>{"touch"!==e.pointerType&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:$d(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:$d(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:$d(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:$d(e.onBlur,i.onClose),onClick:$d(e.onClick,i.onClose)})})});Ay.displayName=zy;var[Ry,Fy]=ky("TooltipPortal",{forceMount:void 0}),Ly="TooltipContent",By=a.forwardRef((e,r)=>{const n=Fy(Ly,e.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=e,s=Ty(Ly,e.__scopeTooltip);return t.jsx(Hh,{present:o||s.open,children:s.disableHoverableContent?t.jsx($y,{side:a,...i,ref:r}):t.jsx(Vy,{side:a,...i,ref:r})})}),Vy=a.forwardRef((e,r)=>{const n=Ty(Ly,e.__scopeTooltip),o=Oy(Ly,e.__scopeTooltip),i=a.useRef(null),s=Ft(r,i),[l,c]=a.useState(null),{trigger:d,onClose:u}=n,p=i.current,{onPointerInTransitChange:h}=o,f=a.useCallback(()=>{c(null),h(!1)},[h]),m=a.useCallback((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect()),a=function(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,o),i=function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect()),s=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...a,...i]);c(s),h(!0)},[h]);return a.useEffect(()=>()=>f(),[f]),a.useEffect(()=>{if(d&&p){const e=e=>m(e,p),t=e=>m(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,m,f]),a.useEffect(()=>{if(l){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==d?void 0:d.contains(t))||(null==p?void 0:p.contains(t)),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>n!=u>n&&r<(d-l)*(n-c)/(u-c)+l&&(o=!o)}return o}(r,l);n?f():o&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,f]),t.jsx($y,{...e,ref:s})}),[Iy,qy]=ky(Py,{isInside:!1}),Hy=It("TooltipContent"),$y=a.forwardRef((e,r)=>{const{__scopeTooltip:n,children:o,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=e,d=Ty(Ly,n),u=wy(n),{onClose:p}=d;return a.useEffect(()=>(document.addEventListener(Dy,p),()=>document.removeEventListener(Dy,p)),[p]),a.useEffect(()=>{if(d.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(d.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]),t.jsx(su,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Vh,{"data-state":d.stateAttribute,...u,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(Hy,{children:o}),t.jsx(Iy,{scope:n,isInside:!0,children:t.jsx(by,{id:d.contentId,role:"tooltip",children:i||o})})]})})});By.displayName=Ly;var Wy="TooltipArrow",Uy=a.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=wy(n);return qy(Wy,n).isInside?null:t.jsx(Ih,{...a,...o,ref:r})});Uy.displayName=Wy;var Yy=By;const Zy=Sy,Ky=Ny,Gy=Ay,Xy=a.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(Yy,{ref:o,sideOffset:r,className:Br("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Xy.displayName=Yy.displayName;const Qy=({isListView:e,setIsListView:r,currentConfig:n})=>t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{asChild:!0,children:t.jsx(Ir,{variant:"outline",size:"sm",onClick:()=>r(!e),className:"flex items-center space-x-1 w-10 h-10 justify-center overflow-hidden",children:t.jsx(tn,{mode:"wait",children:t.jsx(qd.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:e?t.jsx(ft,{className:"h-4 w-4"}):t.jsx(Ot,{className:"h-4 w-4"})},e?"list":"calendar")})})}),t.jsx(Xy,{children:t.jsx("p",{children:e?n.localization.displayCalendar:n.localization.displayList})})]})}),Jy=({currentView:e,setCurrentView:r,viewOptions:n,currentConfig:o})=>t.jsx("div",{className:"inline-flex items-center rounded-md border border-input bg-transparent p-1 w-full sm:w-[240px]",children:t.jsx(Zy,{children:n.map(n=>{const a=n.icon,i=e===n.value;return t.jsxs(Ky,{children:[t.jsx(Gy,{asChild:!0,children:t.jsx(qd.div,{className:"relative flex-grow",initial:!1,animate:{flex:i?2:1},transition:{duration:.2},children:t.jsx(Ir,{variant:i?"secondary":"ghost",size:"sm",className:Br("relative h-8 w-full overflow-hidden transition-colors",i?"bg-secondary text-secondary-foreground":"hover:bg-secondary/50 hover:text-secondary-foreground",!i&&"cursor-pointer"),onClick:()=>r(n.value),children:t.jsxs("div",{className:"flex items-center justify-center space-x-1 w-full",children:[t.jsx(a,{className:Br("h-4 w-4 flex-shrink-0",i?"text-primary":"text-muted-foreground")}),t.jsx(tn,{children:i&&t.jsx(qd.span,{className:"text-xs font-medium whitespace-nowrap overflow-hidden",initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.2},children:n.label})})]})})})}),t.jsx(Xy,{children:t.jsx("p",{children:`${o.localization.viewBy} ${n.label}`})})]},n.value)})})});function eg(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var tg=["color"],rg=r.forwardRef(function(e,t){var n=e.color,o=void 0===n?"currentColor":n,a=eg(e,tg);return r.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),r.createElement("path",{d:"M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),ng=["color"],og=r.forwardRef(function(e,t){var n=e.color,o=void 0===n?"currentColor":n,a=eg(e,ng);return r.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),r.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),ag=["color"],ig=r.forwardRef(function(e,t){var n=e.color,o=void 0===n?"currentColor":n,a=eg(e,ag);return r.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),r.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),sg=.999,lg=/[\\\/_+.#"@\[\(\{&]/,cg=/[\\\/_+.#"@\[\(\{&]/g,dg=/[\s-]/,ug=/[\s-]/g;function pg(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var l,c,d,u,p=n.charAt(a),h=r.indexOf(p,o),f=0;h>=0;)(l=pg(e,t,r,n,h+1,a+1,i))>f&&(h===o?l*=1:lg.test(e.charAt(h-1))?(l*=.8,(d=e.slice(o,h-1).match(cg))&&o>0&&(l*=Math.pow(sg,d.length))):dg.test(e.charAt(h-1))?(l*=.9,(u=e.slice(o,h-1).match(ug))&&o>0&&(l*=Math.pow(sg,u.length))):(l*=.17,o>0&&(l*=Math.pow(sg,h-o))),e.charAt(h)!==t.charAt(a)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(h-1)!==n.charAt(a))&&(.1*(c=pg(e,t,r,n,h+1,a+2,i))>l&&(l=.1*c)),l>f&&(f=l),h=r.indexOf(p,h+1);return i[s]=f,f}function hg(e){return e.toLowerCase().replace(ug," ")}function fg(e,t,r){return pg(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,hg(e),hg(t),0,0,{})}function mg(){return mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mg.apply(null,arguments)}function vg(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function yg(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}function gg(...e){return r.useCallback(yg(...e),e)}function xg(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}const bg=null!=globalThis&&globalThis.document?r.useLayoutEffect:()=>{},kg=a.useId||(()=>{});let _g=0;function wg(e){const[t,r]=a.useState(kg());return bg(()=>{r(e=>e??String(_g++))},[e]),e||(t?`radix-${t}`:"")}function Mg(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>{var r;return null===(r=t.current)||void 0===r?void 0:r.call(t,...e)},[])}function Cg({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=function({defaultProp:e,onChange:t}){const n=r.useState(e),[o]=n,a=r.useRef(o),i=Mg(t);return r.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:o,l=Mg(n),c=r.useCallback(t=>{if(i){const r="function"==typeof t?t(e):t;r!==e&&l(r)}else a(t)},[i,e,a,l]);return[s,c]}const Dg=r.forwardRef((e,t)=>{const{children:n,...o}=e,a=r.Children.toArray(n),i=a.find(Sg);if(i){const e=i.props.children,n=a.map(t=>t===i?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return r.createElement(jg,mg({},o,{ref:t}),r.isValidElement(e)?r.cloneElement(e,void 0,n):null)}return r.createElement(jg,mg({},o,{ref:t}),n)});Dg.displayName="Slot";const jg=r.forwardRef((e,t)=>{const{children:n,...o}=e;return r.isValidElement(n)?r.cloneElement(n,{...Pg(o,n.props),ref:t?yg(t,n.ref):n.ref}):r.Children.count(n)>1?r.Children.only(null):null});jg.displayName="SlotClone";const Og=({children:e})=>r.createElement(r.Fragment,null,e);function Sg(e){return r.isValidElement(e)&&e.type===Og}function Pg(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}const Eg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=r.forwardRef((e,n)=>{const{asChild:o,...a}=e,i=o?Dg:t;return r.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),r.createElement(i,mg({},a,{ref:n}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});const Tg="dismissableLayer.update",Ng="dismissableLayer.pointerDownOutside",zg="dismissableLayer.focusOutside";let Ag;const Rg=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fg=r.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...d}=e,u=r.useContext(Rg),[p,h]=r.useState(null),f=null!==(n=null==p?void 0:p.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=r.useState({}),v=gg(t,e=>h(e)),y=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Mg(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let r=function(){Bg(Ng,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));!_||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Mg(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{e.target&&!o.current&&Bg(zg,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=Mg(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[n,t])}(e=>{b===u.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),r.useEffect(()=>{if(p)return o&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Ag=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Lg(),()=>{o&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=Ag)}},[p,f,o,u]),r.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Lg())},[p,u]),r.useEffect(()=>{const e=()=>m({});return document.addEventListener(Tg,e),()=>document.removeEventListener(Tg,e)},[]),r.createElement(Eg.div,mg({},d,{ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:vg(e.onFocusCapture,M.onFocusCapture),onBlurCapture:vg(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:vg(e.onPointerDownCapture,w.onPointerDownCapture)}))});function Lg(){const e=new CustomEvent(Tg);document.dispatchEvent(e)}function Bg(e,t,r,{discrete:o}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?function(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}const Vg="focusScope.autoFocusOnMount",Ig="focusScope.autoFocusOnUnmount",qg={bubbles:!1,cancelable:!0},Hg=r.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=e,[l,c]=r.useState(null),d=Mg(a),u=Mg(i),p=r.useRef(null),h=gg(t,e=>c(e)),f=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(o){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:Yg(p.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Yg(p.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Yg(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,l,f.paused]),r.useEffect(()=>{if(l){Zg.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(Vg,qg);l.addEventListener(Vg,d),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Yg(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}($g(l)),{select:!0}),document.activeElement===e&&Yg(l))}return()=>{l.removeEventListener(Vg,d),setTimeout(()=>{const t=new CustomEvent(Ig,qg);l.addEventListener(Ig,u),l.dispatchEvent(t),t.defaultPrevented||Yg(e??document.body,{select:!0}),l.removeEventListener(Ig,u),Zg.remove(f)},0)}}},[l,d,u,f]);const m=r.useCallback(e=>{if(!n&&!o||f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=$g(e),r=Wg(t,e),n=Wg(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&Yg(a,{select:!0})):(e.preventDefault(),n&&Yg(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,f.paused]);return r.createElement(Eg.div,mg({tabIndex:-1},s,{ref:h,onKeyDown:m}))});function $g(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wg(e,t){for(const r of e)if(!Ug(r,{upTo:t}))return r}function Ug(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Yg(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const Zg=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=Kg(e,t),e.unshift(t)},remove(t){var r;e=Kg(e,t),null===(r=e[0])||void 0===r||r.resume()}}}();function Kg(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}const Gg=r.forwardRef((e,t)=>{var o;const{container:a=(null==globalThis||null===(o=globalThis.document)||void 0===o?void 0:o.body),...i}=e;return a?n.createPortal(r.createElement(Eg.div,mg({},i,{ref:t})),a):null});const Xg=e=>{const{present:t,children:o}=e,a=function(e){const[t,o]=r.useState(),a=r.useRef({}),i=r.useRef(e),s=r.useRef("none"),l=e?"mounted":"unmounted",[c,d]=function(e,t){return r.useReducer((e,r)=>t[e][r]??e,e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=Qg(a.current);s.current="mounted"===c?e:"none"},[c]),bg(()=>{const t=a.current,r=i.current;if(r!==e){const n=s.current,o=Qg(t);e?d("MOUNT"):"none"===o||"none"===(null==t?void 0:t.display)?d("UNMOUNT"):d(r&&n!==o?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),bg(()=>{if(t){const e=e=>{const r=Qg(a.current).includes(e.animationName);e.target===t&&r&&n.flushSync(()=>d("ANIMATION_END"))},r=e=>{e.target===t&&(s.current=Qg(a.current))};return t.addEventListener("animationstart",r),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",r),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(e=>{e&&(a.current=getComputedStyle(e)),o(e)},[])}}(t),i="function"==typeof o?o({present:a.isPresent}):r.Children.only(o),s=gg(a.ref,i.ref);return"function"==typeof o||a.isPresent?r.cloneElement(i,{ref:s}):null};function Qg(e){return(null==e?void 0:e.animationName)||"none"}Xg.displayName="Presence";let Jg=0;function ex(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var tx=jf(),rx=function(){},nx=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:rx,onWheelCapture:rx,onTouchMoveCapture:rx}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,g=void 0===y?"div":y,x=gf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=h,k=Cf([r,t]),_=yf(yf({},x),o);return a.createElement(a.Fragment,null,u&&a.createElement(b,{sideCar:tx,removeScrollBar:d,shards:p,noIsolation:f,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r}),s?a.cloneElement(a.Children.only(l),yf(yf({},_),{ref:k})):a.createElement(g,yf({},_,{className:c,ref:k}),l))});nx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},nx.classNames={fullWidth:kf,zeroRight:bf};var ox=!1;if(typeof window<"u")try{var ax=Object.defineProperty({},"passive",{get:function(){return ox=!0,!0}});window.addEventListener("test",ax,ax),window.removeEventListener("test",ax,ax)}catch{ox=!1}var ix=!!ox&&{passive:!1},sx=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},lx=function(e,t){var r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),cx(e,r)){var n=dx(e,r);if(n[1]>n[2])return!0}r=r.parentNode}while(r&&r!==document.body);return!1},cx=function(e,t){return"v"===e?function(e){return sx(e,"overflowY")}(t):function(e){return sx(e,"overflowX")}(t)},dx=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},ux=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},px=function(e){return[e.deltaX,e.deltaY]},hx=function(e){return e&&"current"in e?e.current:e},fx=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},mx=0,vx=[];const yx=Sf(tx,function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(mx++)[0],i=a.useState(function(){return Af()})[0],s=a.useRef(e);a.useEffect(function(){s.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=xf([e.lockRef.current],(e.shards||[]).map(hx),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length)return!s.current.allowPinchZoom;var o,a=ux(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],d=e.target,u=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=lx(u,d);if(!p)return!0;if(p?o=u:(o="v"===u?"h":"v",p=lx(u,d)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,d=0,u=0;do{var p=dx(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&cx(e,i)&&(d+=f,u+=h),i=i.parentNode}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&0===d||!c&&0===u)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=a.useCallback(function(e){var r=e;if(vx.length&&vx[vx.length-1]===i){var n="deltaY"in r?px(r):ux(r),o=t.current.filter(function(e){return e.name===r.type&&e.target===r.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var a=(s.current.shards||[]).map(hx).filter(Boolean).filter(function(e){return e.contains(r.target)});(a.length>0?l(r,a[0]):!s.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=a.useCallback(function(e){r.current=ux(e),n.current=void 0},[]),p=a.useCallback(function(t){d(t.type,px(t),t.target,l(t,e.lockRef.current))},[]),h=a.useCallback(function(t){d(t.type,ux(t),t.target,l(t,e.lockRef.current))},[]);a.useEffect(function(){return vx.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ix),document.addEventListener("touchmove",c,ix),document.addEventListener("touchstart",u,ix),function(){vx=vx.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,ix),document.removeEventListener("touchmove",c,ix),document.removeEventListener("touchstart",u,ix)}},[]);var f=e.removeScrollBar,m=e.inert;return a.createElement(a.Fragment,null,m?a.createElement(i,{styles:fx(o)}):null,f?a.createElement(Hf,{gapMode:"margin"}):null)});var gx=a.forwardRef(function(e,t){return a.createElement(nx,yf({},e,{ref:t,sideCar:yx}))});gx.classNames=nx.classNames;const xx="Dialog",[bx,kx]=function(e,t=[]){let n=[];const o=()=>{const t=n.map(e=>r.createContext(e));return function(n){const o=(null==n?void 0:n[e])||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return o.scopeName=e,[function(t,o){const a=r.createContext(o),i=n.length;function s(t){const{scope:n,children:o,...s}=t,l=(null==n?void 0:n[e][i])||a,c=r.useMemo(()=>s,Object.values(s));return r.createElement(l.Provider,{value:c},o)}return n=[...n,o],s.displayName=t+"Provider",[s,function(n,s){const l=(null==s?void 0:s[e][i])||a,c=r.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},xg(o,...t)]}(xx),[_x,wx]=bx(xx),Mx="DialogPortal",[Cx,Dx]=bx(Mx,{forceMount:void 0}),jx="DialogOverlay",Ox=r.forwardRef((e,t)=>{const n=Dx(jx,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wx(jx,e.__scopeDialog);return i.modal?r.createElement(Xg,{present:o||i.open},r.createElement(Sx,mg({},a,{ref:t}))):null}),Sx=r.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=wx(jx,n);return r.createElement(gx,{as:Dg,allowPinchZoom:!0,shards:[a.contentRef]},r.createElement(Eg.div,mg({"data-state":Ax(a.open)},o,{ref:t,style:{pointerEvents:"auto",...o.style}})))}),Px="DialogContent",Ex=r.forwardRef((e,t)=>{const n=Dx(Px,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wx(Px,e.__scopeDialog);return r.createElement(Xg,{present:o||i.open},i.modal?r.createElement(Tx,mg({},a,{ref:t})):r.createElement(Nx,mg({},a,{ref:t})))}),Tx=r.forwardRef((e,t)=>{const n=wx(Px,e.__scopeDialog),o=r.useRef(null),a=gg(t,n.contentRef,o);return r.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),r.createElement(zx,mg({},e,{ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:vg(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:vg(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:vg(e.onFocusOutside,e=>e.preventDefault())}))}),Nx=r.forwardRef((e,t)=>{const n=wx(Px,e.__scopeDialog),o=r.useRef(!1),a=r.useRef(!1);return r.createElement(zx,mg({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;(null===(r=e.onCloseAutoFocus)||void 0===r||r.call(e,t),t.defaultPrevented)||(o.current||null===(i=n.triggerRef.current)||void 0===i||i.focus(),t.preventDefault());o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null===(r=e.onInteractOutside)||void 0===r||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null===(i=n.triggerRef.current)||void 0===i?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}}))}),zx=r.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=e,l=wx(Px,n),c=gg(t,r.useRef(null));return r.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:ex()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:ex()),Jg++,()=>{1===Jg&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Jg--}},[]),r.createElement(r.Fragment,null,r.createElement(Hg,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i},r.createElement(Fg,mg({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Ax(l.open)},s,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)});function Ax(e){return e?"open":"closed"}!function(e,t){const n=r.createContext(t);function o(e){const{children:t,...o}=e,a=r.useMemo(()=>o,Object.values(o));return r.createElement(n.Provider,{value:a},t)}o.displayName=e+"Provider"}("DialogTitleWarning",{contentName:Px,titleName:"DialogTitle",docsSlug:"dialog"});const Rx=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,l=r.useRef(null),c=r.useRef(null),[d=!1,u]=Cg({prop:o,defaultProp:a,onChange:i});return r.createElement(_x,{scope:t,triggerRef:l,contentRef:c,contentId:wg(),titleId:wg(),descriptionId:wg(),open:d,onOpenChange:u,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),modal:s},n)},Fx=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:a}=e,i=wx(Mx,t);return r.createElement(Cx,{scope:t,forceMount:n},r.Children.map(o,e=>r.createElement(Xg,{present:n||i.open},r.createElement(Gg,{asChild:!0,container:a},e))))},Lx=Ox,Bx=Ex;var Vx='[cmdk-group=""]',Ix='[cmdk-group-items=""]',qx='[cmdk-item=""]',Hx=`${qx}:not([aria-disabled="true"])`,$x="cmdk-item-select",Wx="data-value",Ux=(e,t,r)=>fg(e,t,r),Yx=a.createContext(void 0),Zx=()=>a.useContext(Yx),Kx=a.createContext(void 0),Gx=()=>a.useContext(Kx),Xx=a.createContext(void 0),Qx=a.forwardRef((e,t)=>{let r=pb(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=pb(()=>new Set),o=pb(()=>new Map),i=pb(()=>new Map),s=pb(()=>new Set),l=db(e),{label:c,children:d,value:u,onValueChange:p,filter:h,shouldFilter:f,loop:m,disablePointerSelection:v=!1,vimBindings:y=!0,...g}=e,x=a.useId(),b=a.useId(),k=a.useId(),_=a.useRef(null),w=vb();ub(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,M.emit()}},[u]),ub(()=>{w(6,P)},[]);let M=a.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)S(),j(),w(1,O);else if("value"===e&&(n||w(5,P),void 0!==(null==(o=l.current)?void 0:o.value))){let e=t??"";return void(null==(i=(a=l.current).onValueChange)||i.call(a,e))}M.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),C=a.useMemo(()=>({value:(e,t,n)=>{var o;t!==(null==(o=i.current.get(e))?void 0:o.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,D(t,n)),w(2,()=>{j(),M.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),w(3,()=>{S(),j(),r.current.value||O(),M.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=E();w(4,()=>{S(),(null==t?void 0:t.getAttribute("id"))===e&&O(),M.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{i.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:v,listId:x,inputId:k,labelId:b,listInnerRef:_}),[]);function D(e,t){var n,o;let a=null!=(o=null==(n=l.current)?void 0:n.filter)?o:Ux;return e?a(e,r.current.search,t):0}function j(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=_.current;T().sort((t,r)=>{var n,o;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(Ix);t?t.appendChild(e.parentElement===t?e:e.closest(`${Ix} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Ix} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=_.current.querySelector(`${Vx}[${Wx}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)})}function O(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Wx);M.setState("value",t||void 0)}function S(){var e,t,a,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=D(null!=(t=null==(e=i.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(a=i.current.get(o))?void 0:a.keywords)?s:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function P(){var e,t,r;let n=E();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Vx))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function E(){var e;return null==(e=_.current)?void 0:e.querySelector(`${qx}[aria-selected="true"]`)}function T(){var e;return Array.from(null==(e=_.current)?void 0:e.querySelectorAll(Hx))}function N(e){let t=T()[e];t&&M.setState("value",t.getAttribute(Wx))}function z(e){var t;let r=E(),n=T(),o=n.findIndex(e=>e===r),a=n[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),a&&M.setState("value",a.getAttribute(Wx))}function A(e){let t,r=E(),n=null==r?void 0:r.closest(Vx);for(;n&&!t;)n=e>0?lb(n,Vx):cb(n,Vx),t=null==n?void 0:n.querySelector(Hx);t?M.setState("value",t.getAttribute(Wx)):z(e)}let R=()=>N(T().length-1),F=e=>{e.preventDefault(),e.metaKey?R():e.altKey?A(1):z(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?A(-1):z(-1)};return a.createElement(Eg.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=g.onKeyDown)||t.call(g,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":y&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),R();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=E();if(t){let e=new Event($x);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:gb},c),yb(e,e=>a.createElement(Kx.Provider,{value:M},a.createElement(Yx.Provider,{value:C},e))))}),Jx=a.forwardRef((e,t)=>{var r,n;let o=a.useId(),i=a.useRef(null),s=a.useContext(Xx),l=Zx(),c=db(e),d=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==s?void 0:s.forceMount;ub(()=>{if(!d)return l.item(o,null==s?void 0:s.id)},[d]);let u=mb(o,i,[e.value,e.children,i],e.keywords),p=Gx(),h=fb(e=>e.value&&e.value===u.current),f=fb(e=>!(!d&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function m(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,u.current)}function v(){p.setState("value",u.current,!0)}if(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener($x,m),()=>t.removeEventListener($x,m)},[f,e.onSelect,e.disabled]),!f)return null;let{disabled:y,value:g,onSelect:x,forceMount:b,keywords:k,..._}=e;return a.createElement(Eg.div,{ref:hb([i,t]),..._,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||l.disablePointerSelection?void 0:v,onClick:y?void 0:m},e.children)}),eb=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...i}=e,s=a.useId(),l=a.useRef(null),c=a.useRef(null),d=a.useId(),u=Zx(),p=fb(e=>!(!o&&!1!==u.filter())||(!e.search||e.filtered.groups.has(s)));ub(()=>u.group(s),[]),mb(s,l,[e.value,e.heading,c]);let h=a.useMemo(()=>({id:s,forceMount:o}),[o]);return a.createElement(Eg.div,{ref:hb([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),yb(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},a.createElement(Xx.Provider,{value:h},e))))}),tb=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=a.useRef(null),i=fb(e=>!e.search);return r||i?a.createElement(Eg.div,{ref:hb([o,t]),...n,"cmdk-separator":"",role:"separator"}):null}),rb=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,i=Gx(),s=fb(e=>e.search),l=fb(e=>e.value),c=Zx(),d=a.useMemo(()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${qx}[${Wx}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")},[]);return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Eg.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":d,id:c.inputId,type:"text",value:o?e.value:s,onChange:e=>{o||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),nb=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,i=a.useRef(null),s=a.useRef(null),l=Zx();return a.useEffect(()=>{if(s.current&&i.current){let e,t=s.current,r=i.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),a.createElement(Eg.div,{ref:hb([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},yb(e,e=>a.createElement("div",{ref:hb([s,l.listInnerRef]),"cmdk-list-sizer":""},e)))}),ob=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:i,container:s,...l}=e;return a.createElement(Rx,{open:r,onOpenChange:n},a.createElement(Fx,{container:s},a.createElement(Lx,{"cmdk-overlay":"",className:o}),a.createElement(Bx,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(Qx,{ref:t,...l}))))}),ab=a.forwardRef((e,t)=>fb(e=>0===e.filtered.count)?a.createElement(Eg.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ib=a.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...i}=e;return a.createElement(Eg.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},yb(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),sb=Object.assign(Qx,{List:nb,Item:Jx,Input:rb,Group:eb,Separator:tb,Dialog:ob,Empty:ab,Loading:ib});function lb(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function cb(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function db(e){let t=a.useRef(e);return ub(()=>{t.current=e}),t}var ub=typeof window>"u"?a.useEffect:a.useLayoutEffect;function pb(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function hb(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function fb(e){let t=Gx(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function mb(e,t,r,n=[]){let o=a.useRef(),i=Zx();return ub(()=>{var a;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map(e=>e.trim());i.value(e,s,l),null==(a=t.current)||a.setAttribute(Wx,s),o.current=s}),o}var vb=()=>{let[e,t]=a.useState(),r=pb(()=>new Map);return ub(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function yb({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var gb={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},xb="Dialog",[bb,kb]=Wd(xb),[_b,wb]=bb(xb),Mb=e=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=a.useRef(null),d=a.useRef(null),[u,p]=Kd({prop:o,defaultProp:i??!1,onChange:s,caller:xb});return t.jsx(_b,{scope:r,triggerRef:c,contentRef:d,contentId:Du(),titleId:Du(),descriptionId:Du(),open:u,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:l,children:n})};Mb.displayName=xb;var Cb="DialogTrigger",Db=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(Cb,n),i=Ft(r,a.triggerRef);return t.jsx(Gd.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ub(a.open),...o,ref:i,onClick:$d(e.onClick,a.onOpenToggle)})});Db.displayName=Cb;var jb="DialogPortal",[Ob,Sb]=bb(jb,{forceMount:void 0}),Pb=e=>{const{__scopeDialog:r,forceMount:n,children:o,container:i}=e,s=wb(jb,r);return t.jsx(Ob,{scope:r,forceMount:n,children:a.Children.map(o,e=>t.jsx(Hh,{present:n||s.open,children:t.jsx(qh,{asChild:!0,container:i,children:e})}))})};Pb.displayName=jb;var Eb="DialogOverlay",Tb=a.forwardRef((e,r)=>{const n=Sb(Eb,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wb(Eb,e.__scopeDialog);return i.modal?t.jsx(Hh,{present:o||i.open,children:t.jsx(zb,{...a,ref:r})}):null});Tb.displayName=Eb;var Nb=Lt("DialogOverlay.RemoveScroll"),zb=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(Eb,n);return t.jsx(am,{as:Nb,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(Gd.div,{"data-state":Ub(a.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),Ab="DialogContent",Rb=a.forwardRef((e,r)=>{const n=Sb(Ab,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=wb(Ab,e.__scopeDialog);return t.jsx(Hh,{present:o||i.open,children:i.modal?t.jsx(Fb,{...a,ref:r}):t.jsx(Lb,{...a,ref:r})})});Rb.displayName=Ab;var Fb=a.forwardRef((e,r)=>{const n=wb(Ab,e.__scopeDialog),o=a.useRef(null),i=Ft(r,n.contentRef,o);return a.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),t.jsx(Bb,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$d(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:$d(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:$d(e.onFocusOutside,e=>e.preventDefault())})}),Lb=a.forwardRef((e,r)=>{const n=wb(Ab,e.__scopeDialog),o=a.useRef(!1),i=a.useRef(!1);return t.jsx(Bb,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,a;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(a=n.triggerRef.current)||a.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var r,a;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const s=t.target;(null==(a=n.triggerRef.current)?void 0:a.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Bb=a.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=wb(Ab,n),d=a.useRef(null),u=Ft(r,d);return pu(),t.jsxs(t.Fragment,{children:[t.jsx(yu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(su,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ub(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(Gb,{titleId:c.titleId}),t.jsx(Xb,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Vb="DialogTitle",Ib=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(Vb,n);return t.jsx(Gd.h2,{id:a.titleId,...o,ref:r})});Ib.displayName=Vb;var qb="DialogDescription",Hb=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb(qb,n);return t.jsx(Gd.p,{id:a.descriptionId,...o,ref:r})});Hb.displayName=qb;var $b="DialogClose",Wb=a.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=wb($b,n);return t.jsx(Gd.button,{type:"button",...o,ref:r,onClick:$d(e.onClick,()=>a.onOpenChange(!1))})});function Ub(e){return e?"open":"closed"}Wb.displayName=$b;var Yb="DialogTitleWarning",[Zb,Kb]=function(e,r){const n=a.createContext(r),o=e=>{const{children:r,...o}=e,i=a.useMemo(()=>o,Object.values(o));return t.jsx(n.Provider,{value:i,children:r})};return o.displayName=e+"Provider",[o,function(t){const o=a.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(Yb,{contentName:Ab,titleName:Vb,docsSlug:"dialog"}),Gb=({titleId:e})=>{const t=Kb(Yb),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Xb=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kb("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{var n;const o=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Qb=Mb,Jb=Db,ek=Pb,tk=Tb,rk=Rb,nk=Ib,ok=Hb,ak=Wb;const ik=Qb,sk=Jb,lk=ek,ck=a.forwardRef(({className:e,...r},n)=>t.jsx(tk,{ref:n,className:Br("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));ck.displayName=tk.displayName;const dk=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(lk,{children:[t.jsx(ck,{}),t.jsxs(rk,{ref:o,className:Br("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,t.jsxs(ak,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(zt,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dk.displayName=rk.displayName;const uk=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});uk.displayName="DialogHeader";const pk=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});pk.displayName="DialogFooter";const hk=a.forwardRef(({className:e,...r},n)=>t.jsx(nk,{ref:n,className:Br("text-lg font-semibold leading-none tracking-tight",e),...r}));hk.displayName=nk.displayName;const fk=a.forwardRef(({className:e,...r},n)=>t.jsx(ok,{ref:n,className:Br("text-sm text-muted-foreground",e),...r}));fk.displayName=ok.displayName;const mk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb,{ref:n,className:Br("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));mk.displayName=sb.displayName;const vk=a.forwardRef(({className:e,...r},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(sb.Input,{ref:n,className:Br("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));vk.displayName=sb.Input.displayName;const yk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.List,{ref:n,className:Br("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));yk.displayName=sb.List.displayName;const gk=a.forwardRef((e,r)=>t.jsx(sb.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));gk.displayName=sb.Empty.displayName;const xk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.Group,{ref:n,className:Br("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));xk.displayName=sb.Group.displayName;const bk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.Separator,{ref:n,className:Br("-mx-1 h-px bg-border",e),...r}));bk.displayName=sb.Separator.displayName;const kk=a.forwardRef(({className:e,...r},n)=>t.jsx(sb.Item,{ref:n,className:Br("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...r}));kk.displayName=sb.Item.displayName;var _k="Popover",[wk,Mk]=Wd(_k,[_h]),Ck=_h(),[Dk,jk]=wk(_k),Ok=e=>{const{__scopePopover:r,children:n,open:o,defaultOpen:i,onOpenChange:s,modal:l=!1}=e,c=Ck(r),d=a.useRef(null),[u,p]=a.useState(!1),[h,f]=Kd({prop:o,defaultProp:i??!1,onChange:s,caller:_k});return t.jsx(Lh,{...c,children:t.jsx(Dk,{scope:r,contentId:Du(),triggerRef:d,open:h,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:l,children:n})})};Ok.displayName=_k;var Sk="PopoverAnchor",Pk=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,i=jk(Sk,n),s=Ck(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=i;return a.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(Bh,{...s,...o,ref:r})});Pk.displayName=Sk;var Ek="PopoverTrigger",Tk=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=jk(Ek,n),i=Ck(n),s=Ft(r,a.triggerRef),l=t.jsx(Gd.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Uk(a.open),...o,ref:s,onClick:$d(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:t.jsx(Bh,{asChild:!0,...i,children:l})});Tk.displayName=Ek;var Nk="PopoverPortal",[zk,Ak]=wk(Nk,{forceMount:void 0}),Rk=e=>{const{__scopePopover:r,forceMount:n,children:o,container:a}=e,i=jk(Nk,r);return t.jsx(zk,{scope:r,forceMount:n,children:t.jsx(Hh,{present:n||i.open,children:t.jsx(qh,{asChild:!0,container:a,children:o})})})};Rk.displayName=Nk;var Fk="PopoverContent",Lk=a.forwardRef((e,r)=>{const n=Ak(Fk,e.__scopePopover),{forceMount:o=n.forceMount,...a}=e,i=jk(Fk,e.__scopePopover);return t.jsx(Hh,{present:o||i.open,children:i.modal?t.jsx(Vk,{...a,ref:r}):t.jsx(Ik,{...a,ref:r})})});Lk.displayName=Fk;var Bk=Lt("PopoverContent.RemoveScroll"),Vk=a.forwardRef((e,r)=>{const n=jk(Fk,e.__scopePopover),o=a.useRef(null),i=Ft(r,o),s=a.useRef(!1);return a.useEffect(()=>{const e=o.current;if(e)return vf(e)},[]),t.jsx(am,{as:Bk,allowPinchZoom:!0,children:t.jsx(qk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$d(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),s.current||null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:$d(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;s.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:$d(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ik=a.forwardRef((e,r)=>{const n=jk(Fk,e.__scopePopover),o=a.useRef(!1),i=a.useRef(!1);return t.jsx(qk,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,a;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(a=n.triggerRef.current)||a.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var r,a;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const s=t.target;(null==(a=n.triggerRef.current)?void 0:a.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),qk=a.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,h=jk(Fk,n),f=Ck(n);return pu(),t.jsx(yu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(su,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:t.jsx(Vh,{"data-state":Uk(h.open),role:"dialog",id:h.contentId,...f,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Hk="PopoverClose",$k=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=jk(Hk,n);return t.jsx(Gd.button,{type:"button",...o,ref:r,onClick:$d(e.onClick,()=>a.onOpenChange(!1))})});$k.displayName=Hk;var Wk=a.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Ck(n);return t.jsx(Ih,{...a,...o,ref:r})});function Uk(e){return e?"open":"closed"}Wk.displayName="PopoverArrow";var Yk=Rk,Zk=Lk;const Kk=Ok,Gk=Tk,Xk=a.forwardRef(({className:e,align:r="center",sideOffset:n=4,...o},a)=>t.jsx(Yk,{children:t.jsx(Zk,{ref:a,align:r,sideOffset:n,className:Br("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Xk.displayName=Zk.displayName;const Qk=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},Jk=({day:e,weekday:r,translations:n})=>{const o=(e=>["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(e))(r),a=n.dayNames[o];return t.jsxs("div",{className:"flex items-center w-full",children:[t.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground italic whitespace-nowrap mr-1 sm:mr-2 pl-4",children:a}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium truncate flex-grow text-center",children:[e,Qk(parseInt(e))]})]})};function e_({className:e,selectedDate:r,onDateChange:n,isAnimating:o,direction:i,translations:s}){const[l,c]=a.useState(!1),d=a.useMemo(()=>(e=>W({start:U(e),end:$(e)}).map(e=>({dayNumber:Te(e,"d"),weekday:Te(e,"EEE"),value:Te(e,"yyyy-MM-dd"),date:e})))(r),[r]),u=d.find(e=>Te(e.date,"yyyy-MM-dd")===Te(r,"yyyy-MM-dd"));return t.jsxs(Kk,{open:l,onOpenChange:c,children:[t.jsx(Gk,{asChild:!0,children:t.jsxs(Ir,{variant:"outline",role:"combobox","aria-expanded":l,"aria-label":s.selectDate,className:Br("w-[120px] sm:w-[159px] justify-between border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(tn,{mode:"wait",children:t.jsx(qd.div,{initial:!!o&&{y:"down"===i?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===i?-10:10,opacity:0},transition:{duration:.2},className:"w-full",children:u?t.jsx(Jk,{day:u.dayNumber,weekday:u.weekday,translations:s}):t.jsx("span",{className:"text-xs sm:text-sm",children:s.selectDate})},null==u?void 0:u.value)}),t.jsx(og,{className:"ml-1 sm:ml-2 h-4 w-4 sm:h-4 sm:w-4 shrink-0 opacity-50"})]})}),t.jsx(Xk,{className:"w-[120px] sm:w-[161px] p-0",children:t.jsxs(mk,{children:[t.jsx(vk,{placeholder:`${s.search} ${s.day.toLowerCase()}...`,className:"text-xs sm:text-sm"}),t.jsxs(yk,{className:"max-h-[300px] overflow-y-auto",children:[t.jsx(gk,{children:s.noEvents}),t.jsx(xk,{children:d.map(e=>t.jsxs(kk,{onSelect:()=>{n(e.date),c(!1)},className:"text-xs sm:text-sm",children:[t.jsx(Jk,{day:e.dayNumber,weekday:e.weekday,translations:s}),t.jsx(ig,{className:Br("ml-auto h-4 w-4 sm:h-4 sm:w-4",(null==u?void 0:u.value)===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function t_({className:e,selectedMonth:r,onMonthChange:n,onDateChange:o,isAnimating:i,direction:s,translations:l,currentDate:c}){const[d,u]=a.useState(!1),p=l.monthNames.map(e=>({label:e,value:e.toLowerCase().slice(0,3)}));return t.jsxs(Kk,{open:d,onOpenChange:u,children:[t.jsx(Gk,{asChild:!0,children:t.jsxs(Ir,{variant:"outline",role:"combobox","aria-expanded":d,"aria-label":l.selectDate,className:Br("w-[110px] sm:w-[151px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(rg,{className:"hidden sm:inline-block mr-2 h-4 w-4"}),t.jsx(tn,{mode:"wait",children:t.jsx(qd.p,{className:"text-xs sm:text-sm flex-grow text-center",initial:!!i&&{y:"down"===s?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===s?-10:10,opacity:0},transition:{duration:.2},children:r.label},r.value)}),t.jsx(og,{className:"hidden sm:inline-block ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(Xk,{className:"w-[110px] sm:w-[151px] p-0",children:t.jsxs(mk,{children:[t.jsx(vk,{placeholder:l.search,className:"text-xs sm:text-sm"}),t.jsxs(yk,{children:[t.jsx(gk,{className:"text-xs sm:text-sm",children:l.noEvents}),t.jsx(xk,{children:p.map(e=>t.jsxs(kk,{onSelect:()=>(e=>{const t=c.getDate(),r=c.getFullYear(),a=p.findIndex(t=>t.value===e.value),i=new Date(r,a,t);i.getDate()!==t&&i.setMonth(a+1,0),n(e),o&&o(i),u(!1)})(e),className:"text-xs sm:text-sm",children:[e.label,t.jsx(ig,{className:Br("ml-auto h-4 w-4 sm:h-4 sm:w-4",r.value===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}const r_=a.forwardRef(({className:e,type:r,...n},o)=>t.jsx("input",{type:r,className:Br("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...n}));function n_({className:e,currentYear:n,onYearChange:o,onDateChange:a,currentDate:i,isAnimating:s,direction:l}){const[c,d]=r.useState(!1),[u,p]=r.useState(n),[h,f]=r.useState(n.toString());r.useEffect(()=>{p(n),f(n.toString())},[n]);const m=e=>{if(e>=1900&&e<=3100){const t=i.getDate(),r=i.getMonth(),n=new Date(e,r,t);n.getMonth()!==r&&n.setDate(0),p(e),f(e.toString()),o(e),a&&a(n)}},v=e=>{m(u+e)};return t.jsxs(Kk,{open:c,onOpenChange:d,children:[t.jsx(Gk,{asChild:!0,children:t.jsx(Ir,{variant:"outline",role:"combobox","aria-expanded":c,"aria-label":"Select a year",className:Br("w-[70px] sm:w-[71px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:t.jsx(tn,{mode:"wait",children:t.jsx(qd.p,{className:"text-xs sm:text-sm",initial:!!s&&{y:"down"===l?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===l?-10:10,opacity:0},transition:{duration:.2},children:u},u)})})}),t.jsx(Xk,{className:"w-[90px] sm:w-[130px] p-2",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(1),children:t.jsx(xt,{className:"h-4 w-4 sm:h-4 sm:w-4"})}),t.jsx(r_,{type:"text",value:h,onChange:e=>{const t=e.target.value;f(t);const r=parseInt(t,10);!isNaN(r)&&r>=1900&&r<=2100&&m(r)},onBlur:()=>{h!==u.toString()&&f(u.toString())},className:"w-full text-center text-xs sm:text-sm h-8"}),t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(-1),children:t.jsx(vt,{className:"h-4 w-4 sm:h-4 sm:w-4"})})]})})]})}r_.displayName="Input";const o_=({currentDate:e,currentView:r,handlePrevious:n,handleNext:o,lastUpdated:a,animationDirection:i,months:s,handleDayChange:l,handleMonthChange:c,handleYearChange:d,currentConfig:u})=>t.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[t.jsx(Ir,{variant:"ghost",onClick:n,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(yt,{className:"h-4 w-4"})}),t.jsxs(tn,{mode:"sync",children:["day"===r&&t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(e_,{translations:u.localization,className:"font-semibold text-sm sm:text-lg",selectedDate:e,onDateChange:l,isAnimating:"day"===a,direction:i})},"day-switcher"),"year"!==r&&t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(t_,{className:"font-semibold text-sm sm:text-lg",selectedMonth:s[e.getMonth()],onMonthChange:c,onDateChange:l,isAnimating:"month"===a,direction:i,translations:u.localization,currentDate:e})},"month-switcher"),t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(n_,{className:"font-semibold text-sm sm:text-lg",currentYear:e.getFullYear(),onYearChange:d,onDateChange:l,currentDate:e,isAnimating:"year"===a,direction:i})},"year-switcher")]}),t.jsx(Ir,{variant:"ghost",onClick:o,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(gt,{className:"h-4 w-4"})})]});var a_=Array(12).fill(0),i_=({visible:e,className:t})=>r.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},r.createElement("div",{className:"sonner-spinner"},a_.map((e,t)=>r.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),s_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),c_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),d_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u_=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),p_=1,h_=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:p_++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let o,a=e instanceof Promise?e:e(),i=void 0!==n,s=a.then(async e=>{if(o=["resolve",e],r.isValidElement(e))i=!1,this.create({id:n,type:"default",message:e});else if(f_(e)&&!e.ok){i=!1;let r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:n,type:"error",message:r,description:o})}else if(void 0!==t.success){i=!1;let r="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"success",message:r,description:o})}}).catch(async e=>{if(o=["reject",e],void 0!==t.error){i=!1;let r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"error",message:r,description:o})}}).finally(()=>{var e;i&&(this.dismiss(n),n=void 0),null==(e=t.finally)||e.call(t)}),l=()=>new Promise((e,t)=>s.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||p_++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},f_=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,m_=(e,t)=>{let r=(null==t?void 0:t.id)||p_++;return h_.addToast({title:e,...t,id:r}),r},v_=Object.assign(m_,{success:h_.success,info:h_.info,warning:h_.warning,error:h_.error,custom:h_.custom,message:h_.message,promise:h_.promise,dismiss:h_.dismiss,loading:h_.loading},{getHistory:()=>h_.toasts,getToasts:()=>h_.getActiveToasts()});function y_(e){return void 0!==e.label}!function(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var g_=3,x_=14;function b_(...e){return e.filter(Boolean).join(" ")}var k_=e=>{var t,n,o,a,i,s,l,c,d,u,p;let{invert:h,toast:f,unstyled:m,interacting:v,setHeights:y,visibleToasts:g,heights:x,index:b,toasts:k,expanded:_,removeToast:w,defaultRichColors:M,closeButton:C,style:D,cancelButtonStyle:j,actionButtonStyle:O,className:S="",descriptionClassName:P="",duration:E,position:T,gap:N,loadingIcon:z,expandByDefault:A,classNames:R,icons:F,closeButtonAriaLabel:L="Close toast",pauseWhenPageIsHidden:B}=e,[V,I]=r.useState(null),[q,H]=r.useState(null),[$,W]=r.useState(!1),[U,Y]=r.useState(!1),[Z,K]=r.useState(!1),[G,X]=r.useState(!1),[Q,J]=r.useState(!1),[ee,te]=r.useState(0),[re,ne]=r.useState(0),oe=r.useRef(f.duration||E||4e3),ae=r.useRef(null),ie=r.useRef(null),se=0===b,le=b+1<=g,ce=f.type,de=!1!==f.dismissible,ue=f.className||"",pe=f.descriptionClassName||"",he=r.useMemo(()=>x.findIndex(e=>e.toastId===f.id)||0,[x,f.id]),fe=r.useMemo(()=>{var e;return null!=(e=f.closeButton)?e:C},[f.closeButton,C]),me=r.useMemo(()=>f.duration||E||4e3,[f.duration,E]),ve=r.useRef(0),ye=r.useRef(0),ge=r.useRef(0),xe=r.useRef(null),[be,ke]=T.split("-"),_e=r.useMemo(()=>x.reduce((e,t,r)=>r>=he?e:e+t.height,0),[x,he]),we=(()=>{let[e,t]=r.useState(document.hidden);return r.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),Me=f.invert||h,Ce="loading"===ce;ye.current=r.useMemo(()=>he*N+_e,[he,_e]),r.useEffect(()=>{oe.current=me},[me]),r.useEffect(()=>{W(!0)},[]),r.useEffect(()=>{let e=ie.current;if(e){let t=e.getBoundingClientRect().height;return ne(t),y(e=>[{toastId:f.id,height:t,position:f.position},...e]),()=>y(e=>e.filter(e=>e.toastId!==f.id))}},[y,f.id]),r.useLayoutEffect(()=>{if(!$)return;let e=ie.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,ne(r),y(e=>e.find(e=>e.toastId===f.id)?e.map(e=>e.toastId===f.id?{...e,height:r}:e):[{toastId:f.id,height:r,position:f.position},...e])},[$,f.title,f.description,y,f.id]);let De=r.useCallback(()=>{Y(!0),te(ye.current),y(e=>e.filter(e=>e.toastId!==f.id)),setTimeout(()=>{w(f)},200)},[f,w,y,ye]);return r.useEffect(()=>{if(f.promise&&"loading"===ce||f.duration===1/0||"loading"===f.type)return;let e;return _||v||B&&we?(()=>{if(ge.current<ve.current){let e=(new Date).getTime()-ve.current;oe.current=oe.current-e}ge.current=(new Date).getTime()})():oe.current!==1/0&&(ve.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=f.onAutoClose)||e.call(f,f),De()},oe.current)),()=>clearTimeout(e)},[_,v,f,ce,B,we,De]),r.useEffect(()=>{f.delete&&De()},[De,f.delete]),r.createElement("li",{tabIndex:0,ref:ie,className:b_(S,ue,null==R?void 0:R.toast,null==(t=null==f?void 0:f.classNames)?void 0:t.toast,null==R?void 0:R.default,null==R?void 0:R[ce],null==(n=null==f?void 0:f.classNames)?void 0:n[ce]),"data-sonner-toast":"","data-rich-colors":null!=(o=f.richColors)?o:M,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":$,"data-promise":!!f.promise,"data-swiped":Q,"data-removed":U,"data-visible":le,"data-y-position":be,"data-x-position":ke,"data-index":b,"data-front":se,"data-swiping":Z,"data-dismissible":de,"data-type":ce,"data-invert":Me,"data-swipe-out":G,"data-swipe-direction":q,"data-expanded":!!(_||A&&$),style:{"--index":b,"--toasts-before":b,"--z-index":k.length-b,"--offset":`${U?ee:ye.current}px`,"--initial-height":A?"auto":`${re}px`,...D,...f.style},onDragEnd:()=>{K(!1),I(null),xe.current=null},onPointerDown:e=>{Ce||!de||(ae.current=new Date,te(ye.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(K(!0),xe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(G||!de)return;xe.current=null;let o=Number((null==(e=ie.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=ie.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(r=ae.current)?void 0:r.getTime()),s="x"===V?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11)return te(ye.current),null==(n=f.onDismiss)||n.call(f,f),H("x"===V?o>0?"right":"left":a>0?"down":"up"),De(),X(!0),void J(!1);K(!1),I(null)},onPointerMove:t=>{var r,n,o,a;if(!xe.current||!de||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=t.clientY-xe.current.y,s=t.clientX-xe.current.x,l=null!=(n=e.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(T);!V&&(Math.abs(s)>1||Math.abs(i)>1)&&I(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===V?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(c.y=i):"x"===V&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&J(!0),null==(o=ie.current)||o.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(a=ie.current)||a.style.setProperty("--swipe-amount-y",`${c.y}px`)}},fe&&!f.jsx?r.createElement("button",{"aria-label":L,"data-disabled":Ce,"data-close-button":!0,onClick:Ce||!de?()=>{}:()=>{var e;De(),null==(e=f.onDismiss)||e.call(f,f)},className:b_(null==R?void 0:R.closeButton,null==(a=null==f?void 0:f.classNames)?void 0:a.closeButton)},null!=(i=null==F?void 0:F.close)?i:u_):null,f.jsx||r.isValidElement(f.title)?f.jsx?f.jsx:"function"==typeof f.title?f.title():f.title:r.createElement(r.Fragment,null,ce||f.icon||f.promise?r.createElement("div",{"data-icon":"",className:b_(null==R?void 0:R.icon,null==(s=null==f?void 0:f.classNames)?void 0:s.icon)},f.promise||"loading"===f.type&&!f.icon?f.icon||(null!=F&&F.loading?r.createElement("div",{className:b_(null==R?void 0:R.loader,null==(je=null==f?void 0:f.classNames)?void 0:je.loader,"sonner-loader"),"data-visible":"loading"===ce},F.loading):z?r.createElement("div",{className:b_(null==R?void 0:R.loader,null==(Oe=null==f?void 0:f.classNames)?void 0:Oe.loader,"sonner-loader"),"data-visible":"loading"===ce},z):r.createElement(i_,{className:b_(null==R?void 0:R.loader,null==(Se=null==f?void 0:f.classNames)?void 0:Se.loader),visible:"loading"===ce})):null,"loading"!==f.type?f.icon||(null==F?void 0:F[ce])||(e=>{switch(e){case"success":return s_;case"info":return c_;case"warning":return l_;case"error":return d_;default:return null}})(ce):null):null,r.createElement("div",{"data-content":"",className:b_(null==R?void 0:R.content,null==(l=null==f?void 0:f.classNames)?void 0:l.content)},r.createElement("div",{"data-title":"",className:b_(null==R?void 0:R.title,null==(c=null==f?void 0:f.classNames)?void 0:c.title)},"function"==typeof f.title?f.title():f.title),f.description?r.createElement("div",{"data-description":"",className:b_(P,pe,null==R?void 0:R.description,null==(d=null==f?void 0:f.classNames)?void 0:d.description)},"function"==typeof f.description?f.description():f.description):null),r.isValidElement(f.cancel)?f.cancel:f.cancel&&y_(f.cancel)?r.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:e=>{var t,r;y_(f.cancel)&&de&&(null==(r=(t=f.cancel).onClick)||r.call(t,e),De())},className:b_(null==R?void 0:R.cancelButton,null==(u=null==f?void 0:f.classNames)?void 0:u.cancelButton)},f.cancel.label):null,r.isValidElement(f.action)?f.action:f.action&&y_(f.action)?r.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||O,onClick:e=>{var t,r;y_(f.action)&&(null==(r=(t=f.action).onClick)||r.call(t,e),!e.defaultPrevented&&De())},className:b_(null==R?void 0:R.actionButton,null==(p=null==f?void 0:f.classNames)?void 0:p.actionButton)},f.action.label):null));var je,Oe,Se};function __(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function w_(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,o=n?"--mobile-offset":"--offset",a=n?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{r[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${o}-${t}`]=a:r[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),r}r.forwardRef(function(e,t){let{invert:o,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:l,className:c,offset:d,mobileOffset:u,theme:p="light",richColors:h,duration:f,style:m,visibleToasts:v=g_,toastOptions:y,dir:g=__(),gap:x=x_,loadingIcon:b,icons:k,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:w}=e,[M,C]=r.useState([]),D=r.useMemo(()=>Array.from(new Set([a].concat(M.filter(e=>e.position).map(e=>e.position)))),[M,a]),[j,O]=r.useState([]),[S,P]=r.useState(!1),[E,T]=r.useState(!1),[N,z]=r.useState("system"!==p?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=r.useRef(null),R=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=r.useRef(null),L=r.useRef(!1),B=r.useCallback(e=>{C(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||h_.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return r.useEffect(()=>h_.subscribe(e=>{e.dismiss?C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{n.flushSync(()=>{C(t=>{let r=t.findIndex(t=>t.id===e.id);return-1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),r.useEffect(()=>{if("system"!==p)return void z(p);if("system"===p&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{z(e?"dark":"light")})}catch{e.addListener(({matches:e})=>{try{z(e?"dark":"light")}catch(e){console.error(e)}})}},[p]),r.useEffect(()=>{M.length<=1&&P(!1)},[M]),r.useEffect(()=>{let e=e=>{var t,r;i.every(t=>e[t]||e.code===t)&&(P(!0),null==(t=A.current)||t.focus()),"Escape"===e.code&&(document.activeElement===A.current||null!=(r=A.current)&&r.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),r.useEffect(()=>{if(A.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,L.current=!1)}},[A.current]),r.createElement("section",{ref:t,"aria-label":`${_} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((t,n)=>{var a;let[i,p]=t.split("-");return M.length?r.createElement("ol",{key:t,dir:"auto"===g?__():g,tabIndex:-1,ref:A,className:c,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":i,"data-lifted":S&&M.length>1&&!s,"data-x-position":p,style:{"--front-toast-height":`${(null==(a=j[0])?void 0:a.height)||0}px`,"--width":"356px","--gap":`${x}px`,...m,...w_(d,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||L.current||(L.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{E||P(!1)},onDragEnd:()=>P(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||T(!0)},onPointerUp:()=>T(!1)},M.filter(e=>!e.position&&0===n||e.position===t).map((n,a)=>{var i,c;return r.createElement(k_,{key:n.id,icons:k,index:a,toast:n,defaultRichColors:h,duration:null!=(i=null==y?void 0:y.duration)?i:f,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:o,visibleToasts:v,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:l,interacting:E,position:t,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:B,toasts:M.filter(e=>e.position==n.position),heights:j.filter(e=>e.position==n.position),setHeights:O,expandByDefault:s,gap:x,loadingIcon:b,expanded:S,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});var M_=e=>"checkbox"===e.type,C_=e=>e instanceof Date,D_=e=>null==e;const j_=e=>"object"==typeof e;var O_=e=>!D_(e)&&!Array.isArray(e)&&j_(e)&&!C_(e),S_=e=>O_(e)&&e.target?M_(e.target)?e.target.checked:e.target.value:e,P_=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),E_=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function T_(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(E_&&(e instanceof Blob||n)||!r&&!O_(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return O_(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=T_(e[r]));else t=e}return t}var N_=e=>/^\w*$/.test(e),z_=e=>void 0===e,A_=e=>Array.isArray(e)?e.filter(Boolean):[],R_=e=>A_(e.replace(/["|']|\]/g,"").split(/\.|\[/)),F_=(e,t,r)=>{if(!t||!O_(e))return r;const n=(N_(t)?[t]:R_(t)).reduce((e,t)=>D_(e)?e:e[t],e);return z_(n)||n===e?z_(e[t])?r:e[t]:n},L_=e=>"boolean"==typeof e,B_=(e,t,r)=>{let n=-1;const o=N_(t)?[t]:R_(t),a=o.length,i=a-1;for(;++n<a;){const t=o[n];let a=r;if(n!==i){const r=e[t];a=O_(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const V_="blur",I_="focusout",q_="change",H_="onBlur",$_="onChange",W_="onSubmit",U_="onTouched",Y_="all",Z_="max",K_="min",G_="maxLength",X_="minLength",Q_="pattern",J_="required",ew="validate",tw=r.createContext(null);tw.displayName="HookFormContext";const rw=()=>r.useContext(tw);var nw=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Y_&&(t._proxyFormState[o]=!n||Y_),r&&(r[o]=!0),e[o]}});return o};const ow=typeof window<"u"?a.useLayoutEffect:a.useEffect;var aw=e=>"string"==typeof e,iw=(e,t,r,n,o)=>aw(e)?(n&&t.watch.add(e),F_(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),F_(r,e))):(n&&(t.watchAll=!0),r);function sw(e){const t=rw(),{name:n,disabled:o,control:a=t.control,shouldUnregister:i}=e,s=P_(a._names.array,n),l=function(e){const t=rw(),{control:n=t.control,name:o,defaultValue:a,disabled:i,exact:s}=e||{},l=r.useRef(a),[c,d]=r.useState(n._getWatch(o,l.current));return ow(()=>n._subscribe({name:o,formState:{values:!0},exact:s,callback:e=>!i&&d(iw(o,n._names,e.values||n._formValues,!1,l.current))}),[o,n,i,s]),r.useEffect(()=>n._removeUnmounted()),c}({control:a,name:n,defaultValue:F_(a._formValues,n,F_(a._defaultValues,n,e.defaultValue)),exact:!0}),c=function(e){const t=rw(),{control:n=t.control,disabled:o,name:a,exact:i}=e||{},[s,l]=r.useState(n._formState),c=r.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ow(()=>n._subscribe({name:a,formState:c.current,exact:i,callback:e=>{!o&&l({...n._formState,...e})}}),[a,o,i]),r.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),r.useMemo(()=>nw(s,n,c.current,!1),[s,n])}({control:a,name:n,exact:!0}),d=r.useRef(e),u=r.useRef(a.register(n,{...e.rules,value:l,...L_(e.disabled)?{disabled:e.disabled}:{}})),p=r.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!F_(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!F_(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!F_(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!F_(c.validatingFields,n)},error:{enumerable:!0,get:()=>F_(c.errors,n)}}),[c,n]),h=r.useCallback(e=>u.current.onChange({target:{value:S_(e),name:n},type:q_}),[n]),f=r.useCallback(()=>u.current.onBlur({target:{value:F_(a._formValues,n),name:n},type:V_}),[n,a._formValues]),m=r.useCallback(e=>{const t=F_(a._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[a._fields,n]),v=r.useMemo(()=>({name:n,value:l,...L_(o)||c.disabled?{disabled:c.disabled||o}:{},onChange:h,onBlur:f,ref:m}),[n,o,c.disabled,h,f,m,l]);return r.useEffect(()=>{const e=a._options.shouldUnregister||i;a.register(n,{...d.current.rules,...L_(d.current.disabled)?{disabled:d.current.disabled}:{}});const t=(e,t)=>{const r=F_(a._fields,e);r&&r._f&&(r._f.mount=t)};if(t(n,!0),e){const e=T_(F_(a._options.defaultValues,n));B_(a._defaultValues,n,e),z_(F_(a._formValues,n))&&B_(a._formValues,n,e)}return!s&&a.register(n),()=>{(s?e&&!a._state.action:e)?a.unregister(n):t(n,!1)}},[n,a,s,i]),r.useEffect(()=>{a._setDisabledField({disabled:o,name:n})},[o,n,a]),r.useMemo(()=>({field:v,formState:c,fieldState:p}),[v,c,p])}const lw=e=>e.render(sw(e));var cw=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},dw=e=>Array.isArray(e)?e:[e],uw=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},pw=e=>D_(e)||!j_(e);function hw(e,t,r=new WeakSet){if(pw(e)||pw(t))return e===t;if(C_(e)&&C_(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(C_(n)&&C_(e)||O_(n)&&O_(e)||Array.isArray(n)&&Array.isArray(e)?!hw(n,e,r):n!==e)return!1}}return!0}var fw=e=>O_(e)&&!Object.keys(e).length,mw=e=>"file"===e.type,vw=e=>"function"==typeof e,yw=e=>{if(!E_)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},gw=e=>"select-multiple"===e.type,xw=e=>"radio"===e.type,bw=e=>yw(e)&&e.isConnected;function kw(e,t){const r=Array.isArray(t)?t:N_(t)?[t]:R_(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=z_(e)?n++:e[t[n++]];return e}(e,r),o=r.length-1,a=r[o];return n&&delete n[a],0!==o&&(O_(n)&&fw(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!z_(e[t]))return!1;return!0}(n))&&kw(e,r.slice(0,-1)),e}var _w=e=>{for(const t in e)if(vw(e[t]))return!0;return!1};function ww(e,t={}){const r=Array.isArray(e);if(O_(e)||r)for(const r in e)Array.isArray(e[r])||O_(e[r])&&!_w(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ww(e[r],t[r])):D_(e[r])||(t[r]=!0);return t}function Mw(e,t,r){const n=Array.isArray(e);if(O_(e)||n)for(const n in e)Array.isArray(e[n])||O_(e[n])&&!_w(e[n])?z_(t)||pw(r[n])?r[n]=Array.isArray(e[n])?ww(e[n],[]):{...ww(e[n])}:Mw(e[n],D_(t)?{}:t[n],r[n]):r[n]=!hw(e[n],t[n]);return r}var Cw=(e,t)=>Mw(e,t,ww(t));const Dw={value:!1,isValid:!1},jw={value:!0,isValid:!0};var Ow=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!z_(e[0].attributes.value)?z_(e[0].value)||""===e[0].value?jw:{value:e[0].value,isValid:!0}:jw:Dw}return Dw},Sw=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>z_(e)?e:t?""===e?NaN:e&&+e:r&&aw(e)?new Date(e):n?n(e):e;const Pw={isValid:!1,value:null};var Ew=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Pw):Pw;function Tw(e){const t=e.ref;return mw(t)?t.files:xw(t)?Ew(e.refs).value:gw(t)?[...t.selectedOptions].map(({value:e})=>e):M_(t)?Ow(e.refs).value:Sw(z_(t.value)?e.ref.value:t.value,e)}var Nw=e=>e instanceof RegExp,zw=e=>z_(e)?e:Nw(e)?e.source:O_(e)?Nw(e.value)?e.value.source:e.value:e,Aw=e=>({isOnSubmit:!e||e===W_,isOnBlur:e===H_,isOnChange:e===$_,isOnAll:e===Y_,isOnTouch:e===U_});const Rw="AsyncFunction";var Fw=e=>!!e&&!!e.validate&&!!(vw(e.validate)&&e.validate.constructor.name===Rw||O_(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Rw)),Lw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Bw=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const r=F_(e,o);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Bw(a,t))break}else if(O_(a)&&Bw(a,t))break}}};function Vw(e,t,r){const n=F_(e,r);if(n||N_(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const n=o.join("."),a=F_(t,n),i=F_(e,n);if(a&&!Array.isArray(a)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};o.pop()}return{name:r}}var Iw=(e,t,r)=>{const n=dw(F_(e,r));return B_(n,"root",t[r]),B_(e,r,n),e},qw=e=>aw(e);function Hw(e,t,r="validate"){if(qw(e)||Array.isArray(e)&&e.every(qw)||L_(e)&&!e)return{type:r,message:qw(e)?e:"",ref:t}}var $w=e=>O_(e)&&!Nw(e)?e:{value:e,message:""},Ww=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:d,min:u,max:p,pattern:h,validate:f,name:m,valueAsNumber:v,mount:y}=e._f,g=F_(r,m);if(!y||t.has(m))return{};const x=s?s[0]:i,b=e=>{o&&x.reportValidity&&(x.setCustomValidity(L_(e)?"":e||""),x.reportValidity())},k={},_=xw(i),w=M_(i),M=_||w,C=(v||mw(i))&&z_(i.value)&&z_(g)||yw(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,D=cw.bind(null,m,n,k),j=(e,t,r,n=G_,o=X_)=>{const a=e?t:r;k[m]={type:e?n:o,message:a,ref:i,...D(e?n:o,a)}};if(a?!Array.isArray(g)||!g.length:l&&(!M&&(C||D_(g))||L_(g)&&!g||w&&!Ow(s).isValid||_&&!Ew(s).isValid)){const{value:e,message:t}=qw(l)?{value:!!l,message:l}:$w(l);if(e&&(k[m]={type:J_,message:t,ref:x,...D(J_,t)},!n))return b(t),k}if(!(C||D_(u)&&D_(p))){let e,t;const r=$w(p),o=$w(u);if(D_(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;aw(r.value)&&g&&(e=s?a(g)>a(r.value):l?g>r.value:n>new Date(r.value)),aw(o.value)&&g&&(t=s?a(g)<a(o.value):l?g<o.value:n<new Date(o.value))}else{const n=i.valueAsNumber||g&&+g;D_(r.value)||(e=n>r.value),D_(o.value)||(t=n<o.value)}if((e||t)&&(j(!!e,r.message,o.message,Z_,K_),!n))return b(k[m].message),k}if((c||d)&&!C&&(aw(g)||a&&Array.isArray(g))){const e=$w(c),t=$w(d),r=!D_(e.value)&&g.length>+e.value,o=!D_(t.value)&&g.length<+t.value;if((r||o)&&(j(r,e.message,t.message),!n))return b(k[m].message),k}if(h&&!C&&aw(g)){const{value:e,message:t}=$w(h);if(Nw(e)&&!g.match(e)&&(k[m]={type:Q_,message:t,ref:i,...D(Q_,t)},!n))return b(t),k}if(f)if(vw(f)){const e=Hw(await f(g,r),x);if(e&&(k[m]={...e,...D(ew,e.message)},!n))return b(e.message),k}else if(O_(f)){let e={};for(const t in f){if(!fw(e)&&!n)break;const o=Hw(await f[t](g,r),x,t);o&&(e={...o,...D(t,o.message)},b(o.message),n&&(k[m]=e))}if(!fw(e)&&(k[m]={ref:x,...e},!n))return k}return b(!0),k};const Uw={mode:W_,reValidateMode:$_,shouldFocusError:!0};function Yw(e={}){let t,r={...Uw,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:vw(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=(O_(r.defaultValues)||O_(r.values))&&T_(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:T_(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...d};const p={array:uw(),state:uw()},h=r.criteriaMode===Y_,f=async e=>{if(!r.disabled&&(d.isValid||u.isValid||e)){const e=r.resolver?fw((await x()).errors):await b(o,!0);e!==n.isValid&&p.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||u.isValidating||u.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?B_(n.validatingFields,e,t):kw(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!fw(n.validatingFields)}))},v=(e,t,r,n)=>{const l=F_(o,e);if(l){const o=F_(i,e,z_(r)?F_(a,e):r);z_(o)||n&&n.defaultChecked||t?B_(i,e,t?o:Tw(l._f)):w(e,o),s.mount&&f()}},y=(e,t,o,i,s)=>{let l=!1,c=!1;const h={name:e};if(!r.disabled){if(!o||i){(d.isDirty||u.isDirty)&&(c=n.isDirty,n.isDirty=h.isDirty=k(),l=c!==h.isDirty);const r=hw(F_(a,e),t);c=!!F_(n.dirtyFields,e),r?kw(n.dirtyFields,e):B_(n.dirtyFields,e,!0),h.dirtyFields=n.dirtyFields,l=l||(d.dirtyFields||u.dirtyFields)&&c!==!r}if(o){const t=F_(n.touchedFields,e);t||(B_(n.touchedFields,e,o),h.touchedFields=n.touchedFields,l=l||(d.touchedFields||u.touchedFields)&&t!==o)}l&&s&&p.state.next(h)}return l?h:{}},g=(e,o,a,i)=>{const s=F_(n.errors,e),l=(d.isValid||u.isValid)&&L_(o)&&n.isValid!==o;if(r.delayError&&a?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})(()=>((e,t)=>{B_(n.errors,e,t),p.state.next({errors:n.errors})})(e,a)),t(r.delayError)):(clearTimeout(c),t=null,a?B_(n.errors,e,a):kw(n.errors,e)),(a?!hw(s,a):s)||!fw(i)||l){const t={...i,...l&&L_(o)?{isValid:o}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},x=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const o={};for(const r of e){const e=F_(t,r);e&&B_(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},b=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),u=s._f&&Fw(s._f);u&&d.validatingFields&&m([a],!0);const p=await Ww(s,l.disabled,i,h,r.shouldUseNativeValidation&&!t,c);if(u&&d.validatingFields&&m([a]),p[e.name]&&(o.valid=!1,t))break;!t&&(F_(p,e.name)?c?Iw(n.errors,p,e.name):B_(n.errors,e.name,p[e.name]):kw(n.errors,e.name))}!fw(c)&&await b(c,t,o)}}return o.valid},k=(e,t)=>!r.disabled&&(e&&t&&B_(i,e,t),!hw(S(),a)),_=(e,t,r)=>iw(e,l,{...s.mount?i:z_(t)?a:aw(e)?{[e]:t}:t},r,t),w=(e,t,r={})=>{const n=F_(o,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&B_(i,e,Sw(t,r)),a=yw(r.ref)&&D_(t)?"":t,gw(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?M_(r.ref)?r.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):mw(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||p.state.next({name:e,values:T_(i)})))}(r.shouldDirty||r.shouldTouch)&&y(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&O(e)},M=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,s=F_(o,i);(l.array.has(e)||O_(a)||s&&!s._f)&&!C_(a)?M(i,a,r):w(i,a,r)}},C=(e,t,r={})=>{const c=F_(o,e),h=l.array.has(e),f=T_(t);B_(i,e,f),h?(p.array.next({name:e,values:T_(i)}),(d.isDirty||d.dirtyFields||u.isDirty||u.dirtyFields)&&r.shouldDirty&&p.state.next({name:e,dirtyFields:Cw(a,i),isDirty:k(e,f)})):!c||c._f||D_(f)?w(e,f,r):M(e,f,r),Lw(e,l)&&p.state.next({...n}),p.state.next({name:s.mount?e:void 0,values:T_(i)})},D=async e=>{s.mount=!0;const a=e.target;let c=a.name,v=!0;const k=F_(o,c),_=e=>{v=Number.isNaN(e)||C_(e)&&isNaN(e.getTime())||hw(e,F_(i,c,e))},w=Aw(r.mode),M=Aw(r.reValidateMode);if(k){let s,C;const D=a.type?Tw(k._f):S_(e),j=e.type===V_||e.type===I_,S=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(k._f)&&!r.resolver&&!F_(n.errors,c)&&!k._f.deps||((e,t,r,n,o)=>!o.isOnAll&&(!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:!(r?n.isOnChange:o.isOnChange)||e))(j,F_(n.touchedFields,c),n.isSubmitted,M,w),P=Lw(c,l,j);B_(i,c,D),j?(k._f.onBlur&&k._f.onBlur(e),t&&t(0)):k._f.onChange&&k._f.onChange(e);const E=y(c,D,j),T=!fw(E)||P;if(!j&&p.state.next({name:c,type:e.type,values:T_(i)}),S)return(d.isValid||u.isValid)&&("onBlur"===r.mode?j&&f():j||f()),T&&p.state.next({name:c,...P?{}:E});if(!j&&P&&p.state.next({...n}),r.resolver){const{errors:e}=await x([c]);if(_(D),v){const t=Vw(n.errors,o,c),r=Vw(e,o,t.name||c);s=r.error,c=r.name,C=fw(e)}}else m([c],!0),s=(await Ww(k,l.disabled,i,h,r.shouldUseNativeValidation))[c],m([c]),_(D),v&&(s?C=!1:(d.isValid||u.isValid)&&(C=await b(o,!0)));v&&(k._f.deps&&O(k._f.deps),g(c,C,s,E))}},j=(e,t)=>{if(F_(n.errors,t)&&e.focus)return e.focus(),1},O=async(e,t={})=>{let a,i;const s=dw(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(e)for(const r of e){const e=F_(t,r);e?B_(n.errors,r,e):kw(n.errors,r)}else n.errors=t;return t})(z_(e)?e:s);a=fw(t),i=e?!s.some(e=>F_(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=F_(o,e);return await b(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=a=await b(o);return p.state.next({...!aw(e)||(d.isValid||u.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&Bw(o,j,e?s:l.mount),i},S=e=>{const t={...s.mount?i:a};return z_(e)?t:aw(e)?F_(t,e):e.map(e=>F_(t,e))},P=(e,t)=>({invalid:!!F_((t||n).errors,e),isDirty:!!F_((t||n).dirtyFields,e),error:F_((t||n).errors,e),isValidating:!!F_(n.validatingFields,e),isTouched:!!F_((t||n).touchedFields,e)}),E=(e,t,r)=>{const a=(F_(o,e,{_f:{}})._f||{}).ref,i=F_(n.errors,e)||{},{ref:s,message:l,type:c,...d}=i;B_(n.errors,e,{...d,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},T=e=>p.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||dw(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,n)=>{r(e);const{name:o,...a}=e;return fw(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||Y_))})(t,e.formState||d,V,e.reRenderRoot)&&e.callback({values:{...i},...n,...t})}}).unsubscribe,N=(e,t={})=>{for(const s of e?dw(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(kw(o,s),kw(i,s)),!t.keepError&&kw(n.errors,s),!t.keepDirty&&kw(n.dirtyFields,s),!t.keepTouched&&kw(n.touchedFields,s),!t.keepIsValidating&&kw(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&kw(a,s);p.state.next({values:T_(i)}),p.state.next({...n,...t.keepDirty?{isDirty:k()}:{}}),!t.keepIsValid&&f()},z=({disabled:e,name:t})=>{(L_(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},A=(e,t={})=>{let n=F_(o,e);const i=L_(t.disabled)||L_(r.disabled);return B_(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?z({disabled:L_(t.disabled)?t.disabled:r.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:zw(t.min),max:zw(t.max),minLength:zw(t.minLength),maxLength:zw(t.maxLength),pattern:zw(t.pattern)}:{},name:e,onChange:D,onBlur:D,ref:i=>{if(i){A(e,t),n=F_(o,e);const r=z_(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>xw(e)||M_(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;B_(o,e,{_f:{...n._f,...s?{refs:[...l.filter(bw),r,...Array.isArray(F_(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),v(e,!1,void 0,r)}else n=F_(o,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!P_(l.array,e)||!s.action)&&l.unMount.add(e)}}},R=()=>r.shouldFocusError&&Bw(o,j,l.mount),F=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=T_(i);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();n.errors=e,c=T_(t)}else await b(o);if(l.disabled.size)for(const e of l.disabled)kw(c,e);if(kw(n.errors,"root"),fw(n.errors)){p.state.next({errors:{}});try{await e(c,a)}catch(e){s=e}}else t&&await t({...n.errors},a),R(),setTimeout(R);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:fw(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(e,t={})=>{const c=e?T_(e):a,u=T_(c),h=fw(e),f=h?a:u;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(Cw(a,i))]);for(const t of Array.from(e))F_(n.dirtyFields,t)?B_(f,t,F_(i,t)):C(t,F_(f,t))}else{if(E_&&z_(e))for(const e of l.mount){const t=F_(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(yw(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)C(e,F_(f,e));else o={}}i=r.shouldUnregister?t.keepDefaultValues?T_(a):{}:T_(f),p.array.next({values:{...f}}),p.state.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,p.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||hw(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Cw(a,i):n.dirtyFields:t.keepDefaultValues&&e?Cw(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},B=(e,t)=>L(vw(e)?e(i):e,t),V=e=>{n={...n,...e}},I={control:{register:A,unregister:N,getFieldState:P,handleSubmit:F,setError:E,_subscribe:T,_runSchema:x,_focusError:R,_getWatch:_,_getDirty:k,_setValid:f,_setFieldArray:(e,t=[],l,c,h=!0,f=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,f&&Array.isArray(F_(o,e))){const t=l(F_(o,e),c.argA,c.argB);h&&B_(o,e,t)}if(f&&Array.isArray(F_(n.errors,e))){const t=l(F_(n.errors,e),c.argA,c.argB);h&&B_(n.errors,e,t),((e,t)=>{!A_(F_(e,t)).length&&kw(e,t)})(n.errors,e)}if((d.touchedFields||u.touchedFields)&&f&&Array.isArray(F_(n.touchedFields,e))){const t=l(F_(n.touchedFields,e),c.argA,c.argB);h&&B_(n.touchedFields,e,t)}(d.dirtyFields||u.dirtyFields)&&(n.dirtyFields=Cw(a,i)),p.state.next({name:e,isDirty:k(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else B_(i,e,t)},_setDisabledField:z,_setErrors:e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>A_(F_(s.mount?i:a,e,r.shouldUnregister?F_(a,e,[]):[])),_reset:L,_resetDefaultValues:()=>vw(r.defaultValues)&&r.defaultValues().then(e=>{B(e,r.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=F_(o,e);t&&(t._f.refs?t._f.refs.every(e=>!bw(e)):!bw(t._f.ref))&&N(e)}l.unMount=new Set},_disableForm:e=>{L_(e)&&(p.state.next({disabled:e}),Bw(o,(t,r)=>{const n=F_(o,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:p,_proxyFormState:d,get _fields(){return o},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return a},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,u={...u,...e.formState},T({...e,formState:u})),trigger:O,register:A,handleSubmit:F,watch:(e,t)=>vw(e)?p.state.subscribe({next:r=>e(_(void 0,t),r)}):_(e,t,!0),setValue:C,getValues:S,reset:B,resetField:(e,t={})=>{F_(o,e)&&(z_(t.defaultValue)?C(e,T_(F_(a,e))):(C(e,t.defaultValue),B_(a,e,T_(t.defaultValue))),t.keepTouched||kw(n.touchedFields,e),t.keepDirty||(kw(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,T_(F_(a,e))):k()),t.keepError||(kw(n.errors,e),d.isValid&&f()),p.state.next({...n}))},clearErrors:e=>{e&&dw(e).forEach(e=>kw(n.errors,e)),p.state.next({errors:e?n.errors:{}})},unregister:N,setError:E,setFocus:(e,t={})=>{const r=F_(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&vw(e.select)&&e.select())}},getFieldState:P};return{...I,formControl:I}}const Zw=(e,t,r)=>{if(e&&"reportValidity"in e){const n=F_(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Kw=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Zw(n.ref,r,e):n.refs&&n.refs.forEach(t=>Zw(t,r,e))}},Gw=(e,t)=>{t.shouldUseNativeValidation&&Kw(e,t);const r={};for(const n in e){const o=F_(t.fields,n),a=Object.assign(e[n]||{},{ref:o&&o.ref});if(Xw(t.names||Object.keys(e),n)){const e=Object.assign({},F_(r,n));B_(e,"root",a),B_(r,n,e)}else B_(r,n,a)}return r},Xw=(e,t)=>e.some(e=>e.startsWith(t+"."));var Qw=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=cw(i,t,r,o,c?[].concat(c,n.message):n.message)}e.shift()}return r},Jw=function(e,t,r){return void 0===r&&(r={}),function(n,o,a){try{return Promise.resolve(function(o,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&Kw({},a),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:Gw(Qw(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}},eM=function(){return eM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},eM.apply(this,arguments)};function tM(e,t,r){for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function rM(e){return"multiple"===e.mode}function nM(e){return"range"===e.mode}function oM(e){return"single"===e.mode}var aM={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var iM=Object.freeze({__proto__:null,formatCaption:function(e,t){return Te(e,"LLLL y",t)},formatDay:function(e,t){return Te(e,"d",t)},formatMonthCaption:function(e,t){return Te(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return Te(e,"cccccc",t)},formatYearCaption:function(e,t){return Te(e,"yyyy",t)}}),sM=Object.freeze({__proto__:null,labelDay:function(e,t,r){return Te(e,"do MMMM (EEEE)",r)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return Te(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var lM=r.createContext(void 0);function cM(e){var r,n,o=e.initialProps,a=function(){var e=aM,t=ae,r=new Date;return{captionLayout:"buttons",classNames:e,formatters:iM,labels:sM,locale:t,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:r,mode:"default"}}(),i=function(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,i=e.toDate;return n?a=U(n):t&&(a=new Date(t,0,1)),o?i=$(o):r&&(i=new Date(r,11,31)),{fromDate:a?E(a):void 0,toDate:i?E(i):void 0}}(o),s=i.fromDate,l=i.toDate,c=null!==(r=o.captionLayout)&&void 0!==r?r:a.captionLayout;"buttons"!==c&&(!s||!l)&&(c="buttons"),(oM(o)||rM(o)||nM(o))&&(n=o.onSelect);var d=eM(eM(eM({},a),o),{captionLayout:c,classNames:eM(eM({},a.classNames),o.classNames),components:eM({},o.components),formatters:eM(eM({},a.formatters),o.formatters),fromDate:s,labels:eM(eM({},a.labels),o.labels),mode:o.mode||a.mode,modifiers:eM(eM({},a.modifiers),o.modifiers),modifiersClassNames:eM(eM({},a.modifiersClassNames),o.modifiersClassNames),onSelect:n,styles:eM(eM({},a.styles),o.styles),toDate:l});return t.jsx(lM.Provider,{value:d,children:e.children})}function dM(){var e=r.useContext(lM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function uM(e){var r=dM(),n=r.locale,o=r.classNames,a=r.styles,i=r.formatters.formatCaption;return t.jsx("div",{className:o.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function pM(e){return t.jsx("svg",eM({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function hM(e){var r,n,o=e.onChange,a=e.value,i=e.children,s=e.caption,l=e.className,c=e.style,d=dM(),u=null!==(n=null===(r=d.components)||void 0===r?void 0:r.IconDropdown)&&void 0!==n?n:pM;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:a,onChange:o,children:i}),t.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[s,t.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function fM(e){var r,n=dM(),o=n.fromDate,a=n.toDate,i=n.styles,s=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,u=n.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!a)return t.jsx(t.Fragment,{});var p=[];if(Be(o,a))for(var h=U(o),f=o.getMonth();f<=a.getMonth();f++)p.push(Xe(h,f));else for(h=U(new Date),f=0;f<=11;f++)p.push(Xe(h,f));var m=null!==(r=null==d?void 0:d.Dropdown)&&void 0!==r?r:hM;return t.jsx(m,{name:"months","aria-label":u(),className:c.dropdown_month,style:i.dropdown_month,onChange:function(t){var r=Number(t.target.value),n=Xe(U(e.displayMonth),r);e.onChange(n)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:p.map(function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:s})},e.getMonth())})})}function mM(e){var r,n=e.displayMonth,o=dM(),a=o.fromDate,i=o.toDate,s=o.locale,l=o.styles,c=o.classNames,d=o.components,u=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,h=[];if(!a)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});for(var f=a.getFullYear(),m=i.getFullYear(),v=f;v<=m;v++)h.push(et(Z(new Date),v));var y=null!==(r=null==d?void 0:d.Dropdown)&&void 0!==r?r:hM;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=et(U(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:u(n,{locale:s}),children:h.map(function(e){return t.jsx("option",{value:e.getFullYear(),children:u(e,{locale:s})},e.getFullYear())})})}function vM(){var e=dM(),t=function(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,i=e.fromDate,s=e.numberOfMonths,l=void 0===s?1:s;return a&&V(a,o)<0&&(o=k(a,-1*(l-1))),i&&V(o,i)<0&&(o=i),U(o)}(e),n=function(e,t){var n=r.useState(e),o=n[0];return[void 0===t?o:t,n[1]]}(t,e.month),o=n[0],a=n[1];return[o,function(t){var r;if(!e.disableNavigation){var n=U(t);a(n),null===(r=e.onMonthChange)||void 0===r||r.call(e,n)}}]}var yM=r.createContext(void 0);function gM(e){var r=dM(),n=vM(),o=n[0],a=n[1],i=function(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=U(e),a=V(U(k(o,n)),o),i=[],s=0;s<a;s++){var l=k(o,s);i.push(l)}return r&&(i=i.reverse()),i}(o,r),s=function(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=n?a:1,s=U(e);if(!r)return k(s,i);if(!(V(r,e)<a))return k(s,i)}}(o,r),l=function(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=n?void 0===o?1:o:1,i=U(e);if(!r)return k(i,-a);if(!(V(i,r)<=0))return k(i,-a)}}(o,r),c=function(e){return i.some(function(t){return Le(e,t)})},d={currentMonth:o,displayMonths:i,goToMonth:a,goToDate:function(e,t){c(e)||(t&&Fe(e,t)?a(k(e,1+-1*r.numberOfMonths)):a(e))},previousMonth:l,nextMonth:s,isDateDisplayed:c};return t.jsx(yM.Provider,{value:d,children:e.children})}function xM(){var e=r.useContext(yM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function bM(e){var r,n=dM(),o=n.classNames,a=n.styles,i=n.components,s=xM().goToMonth,l=function(t){s(k(t,e.displayIndex?-e.displayIndex:0))},c=null!==(r=null==i?void 0:i.CaptionLabel)&&void 0!==r?r:uM,d=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:a.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:d}),t.jsx(fM,{onChange:l,displayMonth:e.displayMonth}),t.jsx(mM,{onChange:l,displayMonth:e.displayMonth})]})}function kM(e){return t.jsx("svg",eM({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function _M(e){return t.jsx("svg",eM({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var wM=r.forwardRef(function(e,r){var n=dM(),o=n.classNames,a=n.styles,i=[o.button_reset,o.button];e.className&&i.push(e.className);var s=i.join(" "),l=eM(eM({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),t.jsx("button",eM({},e,{ref:r,type:"button",className:s,style:l}))});function MM(e){var r,n,o=dM(),a=o.dir,i=o.locale,s=o.classNames,l=o.styles,c=o.labels,d=c.labelPrevious,u=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var h=d(e.previousMonth,{locale:i}),f=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=null!==(r=null==p?void 0:p.IconRight)&&void 0!==r?r:_M,g=null!==(n=null==p?void 0:p.IconLeft)&&void 0!==n?n:kM;return t.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(wM,{name:"previous-month","aria-label":h,className:f,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===a?t.jsx(y,{className:s.nav_icon,style:l.nav_icon}):t.jsx(g,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(wM,{name:"next-month","aria-label":m,className:v,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===a?t.jsx(g,{className:s.nav_icon,style:l.nav_icon}):t.jsx(y,{className:s.nav_icon,style:l.nav_icon})})]})}function CM(e){var r=dM().numberOfMonths,n=xM(),o=n.previousMonth,a=n.nextMonth,i=n.goToMonth,s=n.displayMonths,l=s.findIndex(function(t){return Le(e.displayMonth,t)}),c=0===l,d=l===s.length-1,u=r>1&&(c||!d),p=r>1&&(d||!c);return t.jsx(MM,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:p,nextMonth:a,previousMonth:o,onPreviousClick:function(){o&&i(o)},onNextClick:function(){a&&i(a)}})}function DM(e){var r,n,o=dM(),a=o.classNames,i=o.disableNavigation,s=o.styles,l=o.captionLayout,c=o.components,d=null!==(r=null==c?void 0:c.CaptionLabel)&&void 0!==r?r:uM;return n=i?t.jsx(d,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?t.jsx(bM,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?t.jsxs(t.Fragment,{children:[t.jsx(bM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(CM,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):t.jsxs(t.Fragment,{children:[t.jsx(d,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(CM,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:a.caption,style:s.caption,children:n})}function jM(e){var r=dM(),n=r.footer,o=r.styles,a=r.classNames.tfoot;return n?t.jsx("tfoot",{className:a,style:o.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:n})})}):t.jsx(t.Fragment,{})}function OM(){var e=dM(),r=e.classNames,n=e.styles,o=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=function(e,t,r){for(var n=r?S(new Date):O(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=b(n,a);o.push(i)}return o}(a,i,s);return t.jsxs("tr",{style:n.head_row,className:r.head_row,children:[o&&t.jsx("td",{style:n.head_cell,className:r.head_cell}),d.map(function(e,o){return t.jsx("th",{scope:"col",className:r.head_cell,style:n.head_cell,"aria-label":c(e,{locale:a}),children:l(e,{locale:a})},o)})]})}function SM(){var e,r=dM(),n=r.classNames,o=r.styles,a=r.components,i=null!==(e=null==a?void 0:a.HeadRow)&&void 0!==e?e:OM;return t.jsx("thead",{style:o.head,className:n.head,children:t.jsx(i,{})})}function PM(e){var r=dM(),n=r.locale,o=r.formatters.formatDay;return t.jsx(t.Fragment,{children:o(e.date,{locale:n})})}var EM=r.createContext(void 0);function TM(e){if(!rM(e.initialProps)){return t.jsx(EM.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(NM,{initialProps:e.initialProps,children:e.children})}function NM(e){var r=e.initialProps,n=e.children,o=r.selected,a=r.min,i=r.max,s={disabled:[]};o&&s.disabled.push(function(e){var t=i&&o.length>i-1,r=o.some(function(t){return L(t,e)});return!(!t||r)});var l={selected:o,onDayClick:function(e,t,n){var s,l;if((null===(s=r.onDayClick)||void 0===s||s.call(r,e,t,n),!!(!t.selected||!a||(null==o?void 0:o.length)!==a))&&!!(t.selected||!i||(null==o?void 0:o.length)!==i)){var c=o?tM([],o):[];if(t.selected){var d=c.findIndex(function(t){return L(e,t)});c.splice(d,1)}else c.push(e);null===(l=r.onSelect)||void 0===l||l.call(r,c,e,t,n)}},modifiers:s};return t.jsx(EM.Provider,{value:l,children:n})}function zM(){var e=r.useContext(EM);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var AM,RM=r.createContext(void 0);function FM(e){if(!nM(e.initialProps)){return t.jsx(RM.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(LM,{initialProps:e.initialProps,children:e.children})}function LM(e){var r=e.initialProps,n=e.children,o=r.selected,a=o||{},i=a.from,s=a.to,l=r.min,c=r.max,d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],s?(d.range_end=[s],L(i,s)||(d.range_middle=[{after:i,before:s}])):d.range_end=[i]):s&&(d.range_start=[s],d.range_end=[s]),l&&(i&&!s&&d.disabled.push({after:Ie(i,l-1),before:b(i,l-1)}),i&&s&&d.disabled.push({after:i,before:b(i,l-1)}),!i&&s&&d.disabled.push({after:Ie(s,l-1),before:b(s,l-1)})),c){if(i&&!s&&(d.disabled.push({before:b(i,1-c)}),d.disabled.push({after:b(i,c-1)})),i&&s){var u=c-(N(s,i)+1);d.disabled.push({before:Ie(i,u)}),d.disabled.push({after:b(s,u)})}!i&&s&&(d.disabled.push({before:b(s,1-c)}),d.disabled.push({after:b(s,c-1)}))}return t.jsx(RM.Provider,{value:{selected:o,onDayClick:function(e,t,n){var a,i;null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,n);var s=function(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?L(o,e)&&L(n,e)?void 0:L(o,e)?{from:o,to:void 0}:L(n,e)?void 0:Re(n,e)?{from:e,to:o}:{from:n,to:e}:o?Re(e,o)?{from:o,to:e}:{from:e,to:o}:n?Fe(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}(e,o);null===(i=r.onSelect)||void 0===i||i.call(r,s,e,t,n)},modifiers:d},children:n})}function BM(){var e=r.useContext(RM);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function VM(e){return Array.isArray(e)?tM([],e):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(AM||(AM={}));var IM=AM.Selected,qM=AM.Disabled,HM=AM.Hidden,$M=AM.Today,WM=AM.RangeEnd,UM=AM.RangeMiddle,YM=AM.RangeStart,ZM=AM.Outside;var KM=r.createContext(void 0);function GM(e){var r=dM(),n=function(e,t,r){var n,o=((n={})[IM]=VM(e.selected),n[qM]=VM(e.disabled),n[HM]=VM(e.hidden),n[$M]=[e.today],n[WM]=[],n[UM]=[],n[YM]=[],n[ZM]=[],n);return e.fromDate&&o[qM].push({before:e.fromDate}),e.toDate&&o[qM].push({after:e.toDate}),rM(e)?o[qM]=o[qM].concat(t.modifiers[qM]):nM(e)&&(o[qM]=o[qM].concat(r.modifiers[qM]),o[YM]=r.modifiers[YM],o[UM]=r.modifiers[UM],o[WM]=r.modifiers[WM]),o}(r,zM(),BM()),o=function(e){var t={};return Object.entries(e).forEach(function(e){var r=e[0],n=e[1];t[r]=VM(n)}),t}(r.modifiers),a=eM(eM({},n),o);return t.jsx(KM.Provider,{value:a,children:e.children})}function XM(){var e=r.useContext(KM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function QM(e,t){return t.some(function(t){if("boolean"==typeof t)return t;if(function(e){return B(e)}(t))return L(e,t);if(function(e){return Array.isArray(e)&&e.every(B)}(t))return t.includes(e);if(function(e){return!(!e||"object"!=typeof e||!("from"in e))}(t))return function(e,t){var r,n=t.from,o=t.to;return n&&o?(N(o,n)<0&&(n=(r=[o,n])[0],o=r[1]),N(e,n)>=0&&N(o,e)>=0):o?L(o,e):!!n&&L(n,e)}(e,t);if(function(e){return!(!e||"object"!=typeof e||!("dayOfWeek"in e))}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return!!(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var r=N(t.before,e)>0,n=N(t.after,e)<0;return Re(t.before,t.after)?n&&r:r||n}return function(e){return!(!e||"object"!=typeof e||!("after"in e))}(t)?N(e,t.after)>0:function(e){return!(!e||"object"!=typeof e||!("before"in e))}(t)?N(t.before,e)>0:"function"==typeof t&&t(e)})}function JM(e,t,r){var n=Object.keys(t).reduce(function(r,n){var o=t[n];return QM(e,o)&&r.push(n),r},[]),o={};return n.forEach(function(e){return o[e]=!0}),r&&!Le(e,r)&&(o.outside=!0),o}function eC(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,i=t.retry,s=void 0===i?{count:0,lastFocused:e}:i,l=o.weekStartsOn,c=o.fromDate,d=o.toDate,u=o.locale,p={day:b,week:z,month:k,year:A,startOfWeek:function(e){return o.ISOWeek?S(e):O(e,{locale:u,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?G(e):K(e,{locale:u,weekStartsOn:l})}},h=p[r](e,"after"===n?1:-1);"before"===n&&c?h=R([c,h]):"after"===n&&d&&(h=F([d,h]));var f=!0;if(a){var m=JM(h,a);f=!m.disabled&&!m.hidden}return f?h:s.count>365?s.lastFocused:eC(h,{moveBy:r,direction:n,context:o,modifiers:a,retry:eM(eM({},s),{count:s.count+1})})}var tC=r.createContext(void 0);function rC(e){var n=xM(),o=XM(),a=r.useState(),i=a[0],s=a[1],l=r.useState(),c=l[0],d=l[1],u=function(e,t){for(var r,n,o=U(e[0]),a=$(e[e.length-1]),i=o;i<=a;){var s=JM(i,t);if(s.disabled||s.hidden)i=b(i,1);else{if(s.selected)return i;s.today&&!n&&(n=i),r||(r=i),i=b(i,1)}}return n||r}(n.displayMonths,o),p=i??(c&&n.isDateDisplayed(c))?c:u,h=function(e){s(e)},f=dM(),m=function(e,t){if(i){var r=eC(i,{moveBy:e,direction:t,context:f,modifiers:o});L(i,r)||(n.goToDate(r,i),h(r))}},v={focusedDay:i,focusTarget:p,blur:function(){d(i),s(void 0)},focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return t.jsx(tC.Provider,{value:v,children:e.children})}function nC(){var e=r.useContext(tC);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var oC=r.createContext(void 0);function aC(e){if(!oM(e.initialProps)){return t.jsx(oC.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(iC,{initialProps:e.initialProps,children:e.children})}function iC(e){var r=e.initialProps,n=e.children,o={selected:r.selected,onDayClick:function(e,t,n){var o,a,i;null===(o=r.onDayClick)||void 0===o||o.call(r,e,t,n),!t.selected||r.required?null===(i=r.onSelect)||void 0===i||i.call(r,e,e,t,n):null===(a=r.onSelect)||void 0===a||a.call(r,void 0,e,t,n)}};return t.jsx(oC.Provider,{value:o,children:n})}function sC(){var e=r.useContext(oC);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function lC(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(t){var n=e.modifiersClassNames[t];if(n)r.push(n);else if(function(e){return Object.values(AM).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&r.push(o)}}),r}function cC(e,n,o){var a,i,s,l=dM(),c=nC(),d=function(e,t){return JM(e,XM(),t)}(e,n),u=function(e,t){var r=dM(),n=sC(),o=zM(),a=BM(),i=nC(),s=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,d=i.focusWeekBefore,u=i.blur,p=i.focus,h=i.focusMonthBefore,f=i.focusMonthAfter,m=i.focusYearBefore,v=i.focusYearAfter,y=i.focusStartOfWeek,g=i.focusEndOfWeek,x={onClick:function(i){var s,l,c,d;oM(r)?null===(s=n.onDayClick)||void 0===s||s.call(n,e,t,i):rM(r)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,i):nM(r)?null===(c=a.onDayClick)||void 0===c||c.call(a,e,t,i):null===(d=r.onDayClick)||void 0===d||d.call(r,e,t,i)},onFocus:function(n){var o;p(e),null===(o=r.onDayFocus)||void 0===o||o.call(r,e,t,n)},onBlur:function(n){var o;u(),null===(o=r.onDayBlur)||void 0===o||o.call(r,e,t,n)},onKeyDown:function(n){var o;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?s():l();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?l():s();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),c();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),d();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?m():h();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():f();break;case"Home":n.preventDefault(),n.stopPropagation(),y();break;case"End":n.preventDefault(),n.stopPropagation(),g()}null===(o=r.onDayKeyDown)||void 0===o||o.call(r,e,t,n)},onKeyUp:function(n){var o;null===(o=r.onDayKeyUp)||void 0===o||o.call(r,e,t,n)},onMouseEnter:function(n){var o;null===(o=r.onDayMouseEnter)||void 0===o||o.call(r,e,t,n)},onMouseLeave:function(n){var o;null===(o=r.onDayMouseLeave)||void 0===o||o.call(r,e,t,n)},onPointerEnter:function(n){var o;null===(o=r.onDayPointerEnter)||void 0===o||o.call(r,e,t,n)},onPointerLeave:function(n){var o;null===(o=r.onDayPointerLeave)||void 0===o||o.call(r,e,t,n)},onTouchCancel:function(n){var o;null===(o=r.onDayTouchCancel)||void 0===o||o.call(r,e,t,n)},onTouchEnd:function(n){var o;null===(o=r.onDayTouchEnd)||void 0===o||o.call(r,e,t,n)},onTouchMove:function(n){var o;null===(o=r.onDayTouchMove)||void 0===o||o.call(r,e,t,n)},onTouchStart:function(n){var o;null===(o=r.onDayTouchStart)||void 0===o||o.call(r,e,t,n)}};return x}(e,d),p=function(){var e=dM(),t=sC(),r=zM(),n=BM();return oM(e)?t.selected:rM(e)?r.selected:nM(e)?n.selected:void 0}(),h=!(!l.onDayClick&&"default"===l.mode);r.useEffect(function(){var t;d.outside||c.focusedDay&&h&&L(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())},[c.focusedDay,e,o,h,d.outside]);var f=lC(l,d).join(" "),m=function(e,t){var r=eM({},e.styles.day);return Object.keys(t).forEach(function(t){var n;r=eM(eM({},r),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])}),r}(l,d),v=!!(d.outside&&!l.showOutsideDays||d.hidden),y=null!==(s=null===(i=l.components)||void 0===i?void 0:i.DayContent)&&void 0!==s?s:PM,g={style:m,className:f,children:t.jsx(y,{date:e,displayMonth:n,activeModifiers:d}),role:"gridcell"},x=c.focusTarget&&L(c.focusTarget,e)&&!d.outside,b=c.focusedDay&&L(c.focusedDay,e),k=eM(eM(eM({},g),((a={disabled:d.disabled,role:"gridcell"})["aria-selected"]=d.selected,a.tabIndex=b||x?0:-1,a)),u);return{isButton:h,isHidden:v,activeModifiers:d,selectedDays:p,buttonProps:k,divProps:g}}function dC(e){var n=r.useRef(null),o=cC(e.date,e.displayMonth,n);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(wM,eM({name:"day",ref:n},o.buttonProps)):t.jsx("div",eM({},o.divProps))}function uC(e){var r=e.number,n=e.dates,o=dM(),a=o.onWeekNumberClick,i=o.styles,s=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,d=(0,o.formatters.formatWeekNumber)(Number(r),{locale:l});if(!a)return t.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:d});var u=c(Number(r),{locale:l});return t.jsx(wM,{name:"week-number","aria-label":u,className:s.weeknumber,style:i.weeknumber,onClick:function(e){a(r,n,e)},children:d})}function pC(e){var r,n,o,a=dM(),i=a.styles,s=a.classNames,l=a.showWeekNumber,c=a.components,d=null!==(r=null==c?void 0:c.Day)&&void 0!==r?r:dC,u=null!==(n=null==c?void 0:c.WeekNumber)&&void 0!==n?n:uC;return l&&(o=t.jsx("td",{className:s.cell,style:i.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:s.row,style:i.row,children:[o,e.dates.map(function(r){return t.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:t.jsx(d,{displayMonth:e.displayMonth,date:r})},function(e){return Math.trunc(+g(e)/1e3)}(r))})]})}function hC(e,t,r){for(var n=null!=r&&r.ISOWeek?G(t):K(t,r),o=null!=r&&r.ISOWeek?S(e):O(e,r),a=N(n,o),i=[],s=0;s<=a;s++)i.push(b(o,s));var l=i.reduce(function(e,t){var n=null!=r&&r.ISOWeek?ie(t):le(t,r),o=e.find(function(e){return e.weekNumber===n});return o?(o.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)},[]);return l}function fC(e){var r,n,o,a=dM(),i=a.locale,s=a.classNames,l=a.styles,c=a.hideHead,d=a.fixedWeeks,u=a.components,p=a.weekStartsOn,h=a.firstWeekContainsDate,f=a.ISOWeek,m=function(e,t){var r=hC(U(e),$(e),t);if(null!=t&&t.useFixedWeeks){var n=Ae(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],i=z(a,6-n),s=hC(z(a,1),i,t);r.push.apply(r,s)}}return r}(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:f,locale:i,weekStartsOn:p,firstWeekContainsDate:h}),v=null!==(r=null==u?void 0:u.Head)&&void 0!==r?r:SM,y=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:pC,g=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:jM;return t.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(v,{}),t.jsx("tbody",{className:s.tbody,style:l.tbody,children:m.map(function(r){return t.jsx(y,{displayMonth:e.displayMonth,dates:r.dates,weekNumber:r.weekNumber},r.weekNumber)})}),t.jsx(g,{displayMonth:e.displayMonth})]})}var mC=typeof window<"u"&&window.document&&window.document.createElement?r.useLayoutEffect:r.useEffect,vC=!1,yC=0;function gC(){return"react-day-picker-".concat(++yC)}function xC(e){var n,o,a=dM(),i=a.dir,s=a.classNames,l=a.styles,c=a.components,d=xM().displayMonths,u=function(e){var t,n=e??(vC?gC():null),o=r.useState(n),a=o[0],i=o[1];return mC(function(){null===a&&i(gC())},[]),r.useEffect(function(){!1===vC&&(vC=!0)},[]),null!==(t=e??a)&&void 0!==t?t:void 0}(a.id?"".concat(a.id,"-").concat(e.displayIndex):void 0),p=a.id?"".concat(a.id,"-grid-").concat(e.displayIndex):void 0,h=[s.month],f=l.month,m=0===e.displayIndex,v=e.displayIndex===d.length-1,y=!m&&!v;"rtl"===i&&(v=(n=[m,v])[0],m=n[1]),m&&(h.push(s.caption_start),f=eM(eM({},f),l.caption_start)),v&&(h.push(s.caption_end),f=eM(eM({},f),l.caption_end)),y&&(h.push(s.caption_between),f=eM(eM({},f),l.caption_between));var g=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:DM;return t.jsxs("div",{className:h.join(" "),style:f,children:[t.jsx(g,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(fC,{id:p,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function bC(e){var r=dM(),n=r.classNames,o=r.styles;return t.jsx("div",{className:n.months,style:o.months,children:e.children})}function kC(e){var n,o,a=e.initialProps,i=dM(),s=nC(),l=xM(),c=r.useState(!1),d=c[0],u=c[1];r.useEffect(function(){i.initialFocus&&s.focusTarget&&(d||(s.focus(s.focusTarget),u(!0)))},[i.initialFocus,d,s.focus,s.focusTarget,s]);var p=[i.classNames.root,i.className];i.numberOfMonths>1&&p.push(i.classNames.multiple_months),i.showWeekNumber&&p.push(i.classNames.with_weeknumber);var h=eM(eM({},i.styles.root),i.style),f=Object.keys(a).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var r;return eM(eM({},e),((r={})[t]=a[t],r))},{}),m=null!==(o=null===(n=a.components)||void 0===n?void 0:n.Months)&&void 0!==o?o:bC;return t.jsx("div",eM({className:p.join(" "),style:h,dir:i.dir,id:i.id,nonce:a.nonce,title:a.title,lang:a.lang},f,{children:t.jsx(m,{children:l.displayMonths.map(function(e,r){return t.jsx(xC,{displayIndex:r,displayMonth:e},r)})})}))}function _C(e){var r=e.children,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["children"]);return t.jsx(cM,{initialProps:n,children:t.jsx(gM,{children:t.jsx(aC,{initialProps:n,children:t.jsx(TM,{initialProps:n,children:t.jsx(FM,{initialProps:n,children:t.jsx(GM,{children:t.jsx(rC,{children:r})})})})})})})}function wC(e){return t.jsx(_C,eM({},e,{children:t.jsx(kC,{initialProps:e})}))}function MC({className:e,classNames:r,showOutsideDays:n=!0,...o}){return t.jsx(wC,{showOutsideDays:n,className:Br("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Br(Vr({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Br(Vr({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},components:{IconLeft:({className:e,...r})=>t.jsx(yt,{className:Br("h-4 w-4",e),...r}),IconRight:({className:e,...r})=>t.jsx(gt,{className:Br("h-4 w-4",e),...r})},...o})}MC.displayName="Calendar";var CC="AlertDialog",[DC,jC]=Wd(CC,[kb]),OC=kb(),SC=e=>{const{__scopeAlertDialog:r,...n}=e,o=OC(r);return t.jsx(Qb,{...o,...n,modal:!0})};SC.displayName=CC;var PC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(Jb,{...a,...o,ref:r})});PC.displayName="AlertDialogTrigger";var EC=e=>{const{__scopeAlertDialog:r,...n}=e,o=OC(r);return t.jsx(ek,{...o,...n})};EC.displayName="AlertDialogPortal";var TC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(tk,{...a,...o,ref:r})});TC.displayName="AlertDialogOverlay";var NC="AlertDialogContent",[zC,AC]=DC(NC),RC=It("AlertDialogContent"),FC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:o,...i}=e,s=OC(n),l=a.useRef(null),c=Ft(r,l),d=a.useRef(null);return t.jsx(Zb,{contentName:NC,titleName:LC,docsSlug:"alert-dialog",children:t.jsx(zC,{scope:n,cancelRef:d,children:t.jsxs(rk,{role:"alertdialog",...s,...i,ref:c,onOpenAutoFocus:$d(i.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=d.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t.jsx(RC,{children:o}),t.jsx(WC,{contentRef:l})]})})})});FC.displayName=NC;var LC="AlertDialogTitle",BC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(nk,{...a,...o,ref:r})});BC.displayName=LC;var VC="AlertDialogDescription",IC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(ok,{...a,...o,ref:r})});IC.displayName=VC;var qC=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=OC(n);return t.jsx(ak,{...a,...o,ref:r})});qC.displayName="AlertDialogAction";var HC="AlertDialogCancel",$C=a.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:a}=AC(HC,n),i=OC(n),s=Ft(r,a);return t.jsx(ak,{...i,...o,ref:s})});$C.displayName=HC;var WC=({contentRef:e})=>{const t=`\`${NC}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${NC}\` by passing a \`${VC}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${NC}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{var r;document.getElementById(null==(r=e.current)?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},UC=TC,YC=FC,ZC=qC,KC=$C,GC=BC,XC=IC;const QC=SC,JC=PC,eD=EC,tD=a.forwardRef(({className:e,...r},n)=>t.jsx(UC,{className:Br("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));tD.displayName=UC.displayName;const rD=a.forwardRef(({className:e,...r},n)=>t.jsxs(eD,{children:[t.jsx(tD,{}),t.jsx(YC,{ref:n,className:Br("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));rD.displayName=YC.displayName;const nD=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col space-y-2 text-center sm:text-left",e),...r});nD.displayName="AlertDialogHeader";const oD=({className:e,...r})=>t.jsx("div",{className:Br("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});oD.displayName="AlertDialogFooter";const aD=a.forwardRef(({className:e,...r},n)=>t.jsx(GC,{ref:n,className:Br("text-lg font-semibold",e),...r}));aD.displayName=GC.displayName;const iD=a.forwardRef(({className:e,...r},n)=>t.jsx(XC,{ref:n,className:Br("text-sm text-muted-foreground",e),...r}));iD.displayName=XC.displayName;const sD=a.forwardRef(({className:e,...r},n)=>t.jsx(ZC,{ref:n,className:Br(Vr(),e),...r}));sD.displayName=ZC.displayName;const lD=a.forwardRef(({className:e,...r},n)=>t.jsx(KC,{ref:n,className:Br(Vr({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));function cD(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}lD.displayName=KC.displayName;var dD="Radio",[uD,pD]=Wd(dD),[hD,fD]=uD(dD),mD=a.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:i=!1,required:s,disabled:l,value:c="on",onCheck:d,form:u,...p}=e,[h,f]=a.useState(null),m=Ft(r,e=>f(e)),v=a.useRef(!1),y=!h||(u||!!h.closest("form"));return t.jsxs(hD,{scope:n,checked:i,disabled:l,children:[t.jsx(Gd.button,{type:"button",role:"radio","aria-checked":i,"data-state":xD(i),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:m,onClick:$d(e.onClick,e=>{i||null==d||d(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t.jsx(gD,{control:h,bubbles:!v.current,name:o,value:c,checked:i,required:s,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});mD.displayName=dD;var vD="RadioIndicator",yD=a.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...a}=e,i=fD(vD,n);return t.jsx(Hh,{present:o||i.checked,children:t.jsx(Gd.span,{"data-state":xD(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})})});yD.displayName=vD;var gD=a.forwardRef(({__scopeRadio:e,control:r,checked:n,bubbles:o=!0,...i},s)=>{const l=a.useRef(null),c=Ft(l,s),d=cD(n),u=xh(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[d,n,o]),t.jsx(Gd.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function xD(e){return e?"checked":"unchecked"}gD.displayName="RadioBubbleInput";var bD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],kD="RadioGroup",[_D,wD]=Wd(kD,[Qh,pD]),MD=Qh(),CD=pD(),[DD,jD]=_D(kD),OD=a.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:p,...h}=e,f=MD(n),m=eu(d),[v,y]=Kd({prop:i,defaultProp:a??null,onChange:p,caller:kD});return t.jsx(DD,{scope:n,name:o,required:s,disabled:l,value:v,onValueChange:y,children:t.jsx(lf,{asChild:!0,...f,orientation:c,dir:m,loop:u,children:t.jsx(Gd.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...h,ref:r})})})});OD.displayName=kD;var SD="RadioGroupItem",PD=a.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...i}=e,s=jD(SD,n),l=s.disabled||o,c=MD(n),d=CD(n),u=a.useRef(null),p=Ft(r,u),h=s.value===i.value,f=a.useRef(!1);return a.useEffect(()=>{const e=e=>{bD.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t.jsx(cf,{asChild:!0,...c,focusable:!l,active:h,children:t.jsx(mD,{disabled:l,required:s.required,checked:h,...d,...i,name:s.name,ref:p,onCheck:()=>s.onValueChange(i.value),onKeyDown:$d(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:$d(i.onFocus,()=>{var e;f.current&&(null==(e=u.current)||e.click())})})})});PD.displayName=SD;var ED=a.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,a=CD(n);return t.jsx(yD,{...a,...o,ref:r})});ED.displayName="RadioGroupIndicator";var TD=OD,ND=PD,zD=ED;const AD=a.forwardRef(({className:e,...r},n)=>t.jsx(TD,{className:Br("grid gap-2",e),...r,ref:n}));AD.displayName=TD.displayName;const RD=a.forwardRef(({className:e,...r},n)=>t.jsx(ND,{ref:n,className:Br("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t.jsx(zD,{className:"flex items-center justify-center",children:t.jsx(_t,{className:"h-3.5 w-3.5 fill-primary"})})}));RD.displayName=ND.displayName;var FD=a.forwardRef((e,r)=>t.jsx(Gd.label,{...e,ref:r,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));FD.displayName="Label";var LD=FD;const BD=Yt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),VD=a.forwardRef(({className:e,...r},n)=>t.jsx(LD,{ref:n,className:Br(BD(),e),...r}));VD.displayName=LD.displayName;const ID=e=>{const{children:t,...n}=e;return r.createElement(tw.Provider,{value:n},t)},qD=a.createContext({}),HD=({...e})=>t.jsx(qD.Provider,{value:{name:e.name},children:t.jsx(lw,{...e})}),$D=()=>{const e=a.useContext(qD),t=a.useContext(WD),{getFieldState:r,formState:n}=rw(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},WD=a.createContext({}),UD=a.forwardRef(({className:e,...r},n)=>{const o=a.useId();return t.jsx(WD.Provider,{value:{id:o},children:t.jsx("div",{ref:n,className:Br("space-y-2",e),...r})})});UD.displayName="FormItem";const YD=a.forwardRef(({className:e,...r},n)=>{const{error:o,formItemId:a}=$D();return t.jsx(VD,{ref:n,className:Br(o&&"text-destructive",e),htmlFor:a,...r})});YD.displayName="FormLabel";const ZD=a.forwardRef(({...e},r)=>{const{error:n,formItemId:o,formDescriptionId:a,formMessageId:i}=$D();return t.jsx(Bt,{ref:r,id:o,"aria-describedby":n?`${a} ${i}`:`${a}`,"aria-invalid":!!n,...e})});ZD.displayName="FormControl";const KD=a.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:o}=$D();return t.jsx("p",{ref:n,id:o,className:Br("text-sm text-muted-foreground",e),...r})});KD.displayName="FormDescription";const GD=a.forwardRef(({className:e,children:r,...n},o)=>{const{error:a,formMessageId:i}=$D(),s=a?String(null==a?void 0:a.message):r;return s?t.jsx("p",{ref:o,id:i,className:Br("text-sm font-medium text-destructive",e),...n,children:s}):null});GD.displayName="FormMessage";const XD=a.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{className:Br("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));XD.displayName="Textarea";const QD=r.forwardRef(({value:e,onChange:r,...n},o)=>{const a=t=>{const[n,o]=e.split(":").map(Number);let a=n,i=o;"up"===t?(i+=15,i>=60&&(i=0,a=(a+1)%24)):(i-=15,i<0&&(i=45,a=(a-1+24)%24));const s=`${String(a).padStart(2,"0")}:${String(i).padStart(2,"0")}`;r(s)};return t.jsxs("div",{className:"relative",children:[t.jsx(r_,{type:"time",ref:o,value:e,onChange:e=>r(e.target.value),...n,className:"pr-8"}),t.jsxs("div",{className:"absolute right-1 top-1 bottom-1 flex flex-col justify-center",children:[t.jsx(Ir,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("up"),children:t.jsx(xt,{className:"h-3 w-3"})}),t.jsx(Ir,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("down"),children:t.jsx(vt,{className:"h-3 w-3"})})]})]})});function JD(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function ej(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&r.every(r=>{const n=e[r],o=t[r];return"function"==typeof n?`${n}`==`${o}`:JD(n)&&JD(o)?ej(n,o):n===o})}function tj(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function rj(e){return"number"==typeof e}function nj(e){return"string"==typeof e}function oj(e){return"boolean"==typeof e}function aj(e){return"[object Object]"===Object.prototype.toString.call(e)}function ij(e){return Math.abs(e)}function sj(e){return Math.sign(e)}function lj(e,t){return ij(e-t)}function cj(e){return fj(e).map(Number)}function dj(e){return e[uj(e)]}function uj(e){return Math.max(0,e.length-1)}function pj(e,t){return t===uj(e)}function hj(e,t=0){return Array.from(Array(e),(e,r)=>t+r)}function fj(e){return Object.keys(e)}function mj(e,t){return[e,t].reduce((e,t)=>(fj(t).forEach(r=>{const n=e[r],o=t[r],a=aj(n)&&aj(o);e[r]=a?mj(n,o):o}),e),{})}function vj(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function yj(){let e=[];const t={add:function(r,n,o,a={passive:!0}){let i;if("addEventListener"in r)r.addEventListener(n,o,a),i=()=>r.removeEventListener(n,o,a);else{const e=r;e.addListener(o),i=()=>e.removeListener(o)}return e.push(i),t},clear:function(){e=e.filter(e=>e())}};return t}function gj(e,t,r,n){const o=yj(),a=1e3/60;let i=null,s=0,l=0;function c(e){if(!l)return;i||(i=e,r(),r());const o=e-i;for(i=e,s+=o;s>=a;)r(),s-=a;n(s/a),l&&(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),i=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(i=null,s=0)})},destroy:function(){d(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:d,update:r,render:n}}function xj(e=0,t=0){const r=ij(e-t);function n(t){return t<e}function o(e){return e>t}function a(e){return n(e)||o(e)}return{length:r,max:t,min:e,constrain:function(r){return a(r)?n(r)?e:t:r},reachedAny:a,reachedMax:o,reachedMin:n,removeOffset:function(e){return r?e-r*Math.ceil((e-t)/r):e}}}function bj(e,t,r){const{constrain:n}=xj(0,e),o=e+1;let a=i(t);function i(e){return r?ij((o+e)%o):n(e)}function s(){return a}function l(){return bj(e,s(),r)}const c={get:s,set:function(e){return a=i(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function kj(e,t,r,n,o,a,i,s,l,c,d,u,p,h,f,m,v,y,g){const{cross:x,direction:b}=e,k=["INPUT","SELECT","TEXTAREA"],_={passive:!1},w=yj(),M=yj(),C=xj(50,225).constrain(h.measure(20)),D={mouse:300,touch:400},j={mouse:500,touch:600},O=f?43:25;let S=!1,P=0,E=0,T=!1,N=!1,z=!1,A=!1;function R(e){if(!vj(e,n)&&e.touches.length>=2)return F(e);const t=a.readPoint(e),r=a.readPoint(e,x),i=lj(t,P),l=lj(r,E);if(!(N||A||e.cancelable&&(N=i>l,N)))return F(e);const d=a.pointerMove(e);i>m&&(z=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(b(d)),e.preventDefault()}function F(e){const t=d.byDistance(0,!1).index!==u.get(),r=a.pointerUp(e)*(f?j:D)[A?"mouse":"touch"],n=function(e,t){const r=u.add(-1*sj(e)),n=d.byDistance(e,!f).distance;return f||ij(e)<C?n:v&&t?.5*n:d.byIndex(r.get(),0).distance}(b(r),t),o=function(e,t){if(0===e||0===t||ij(e)<=ij(t))return 0;const r=lj(ij(e),ij(t));return ij(r/e)}(r,n),i=O-10*o,s=y+o/50;N=!1,T=!1,M.clear(),c.useDuration(i).useFriction(s),l.distance(n,!f),A=!1,p.emit("pointerUp")}function L(e){z&&(e.stopPropagation(),e.preventDefault(),z=!1)}return{init:function(e){if(!g)return;function s(s){(oj(g)||g(e,s))&&function(e){const s=vj(e,n);A=s,z=f&&s&&!e.buttons&&S,S=lj(o.get(),i.get())>=2,(!s||0===e.button)&&(function(e){const t=e.nodeName||"";return k.includes(t)}(e.target)||(T=!0,a.pointerDown(e),c.useFriction(0).useDuration(0),o.set(i),function(){const e=A?r:t;M.add(e,"touchmove",R,_).add(e,"touchend",F).add(e,"mousemove",R,_).add(e,"mouseup",F)}(),P=a.readPoint(e),E=a.readPoint(e,x),p.emit("pointerDown")))}(s)}const l=t;w.add(l,"dragstart",e=>e.preventDefault(),_).add(l,"touchmove",()=>{},_).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",F).add(l,"contextmenu",F).add(l,"click",L,!0)},destroy:function(){w.clear(),M.clear()},pointerDown:function(){return T}}}function _j(e,t){let r,n;function o(e){return e.timeStamp}function a(r,n){const o="client"+("x"===(n||e.scroll)?"X":"Y");return(vj(r,t)?r:r.touches[0])[o]}return{pointerDown:function(e){return r=e,n=e,a(e)},pointerMove:function(e){const t=a(e)-a(n),i=o(e)-o(r)>170;return n=e,i&&(r=e),t},pointerUp:function(e){if(!r||!n)return 0;const t=a(n)-a(r),i=o(e)-o(r),s=o(e)-o(n)>170,l=t/i;return i&&!s&&ij(l)>.1?l:0},readPoint:a}}function wj(e,t,r,n,o,a,i){const s=[e].concat(n);let l,c,d=[],u=!1;function p(e){return o.measureSize(i.measure(e))}return{init:function(o){a&&(c=p(e),d=n.map(p),l=new ResizeObserver(r=>{(oj(a)||a(o,r))&&function(r){for(const a of r){if(u)return;const r=a.target===e,i=n.indexOf(a.target),s=r?c:d[i];if(ij(p(r?e:n[i])-s)>=.5){o.reInit(),t.emit("resize");break}}}(r)}),r.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){u=!0,l&&l.disconnect()}}}function Mj(e,t,r,n,o){const a=o.measure(10),i=o.measure(50),s=xj(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",d=ij(e[l]-t.get()),u=r.get()-t.get(),p=s.constrain(d/i);r.subtract(u*p),!o&&ij(u)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function Cj(e,t,r,n){const o=t.min+.1,a=t.max+.1,{reachedMin:i,reachedMax:s}=xj(o,a);return{loop:function(t){if(!function(e){return 1===e?s(r.get()):-1===e&&i(r.get())}(t))return;const o=e*(-1*t);n.forEach(e=>e.add(o))}}}function Dj(e,t,r,n,o){const{reachedAny:a,removeOffset:i,constrain:s}=n;function l(e){return e.concat().sort((e,t)=>ij(e)-ij(t))[0]}function c(t,n){const o=[t,t+r,t-r];if(!e)return t;if(!n)return l(o);const a=o.filter(e=>sj(e)===n);return a.length?l(a):dj(o)-r}return{byDistance:function(r,n){const l=o.get()+r,{index:d,distance:u}=function(r){const n=e?i(r):s(r),o=t.map((e,t)=>({diff:c(e-n,0),index:t})).sort((e,t)=>ij(e.diff)-ij(t.diff)),{index:a}=o[0];return{index:a,distance:n}}(l),p=!e&&a(l);return!n||p?{index:d,distance:r}:{index:d,distance:r+c(t[d]-u,0)}},byIndex:function(e,r){return{index:e,distance:c(t[e]-o.get(),r)}},shortcut:c}}function jj(e,t,r,n,o,a,i,s){const l={passive:!0,capture:!0};let c=0;function d(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(u){s&&(a.add(document,"keydown",d,!1),t.forEach((t,d)=>{a.add(t,"focus",t=>{(oj(s)||s(u,t))&&function(t){if((new Date).getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const a=r.findIndex(e=>e.includes(t));rj(a)&&(o.useDuration(0),n.index(a,0),i.emit("slideFocus"))}(d)},l)}))}}}function Oj(e){let t=e;function r(e){return rj(e)?e:e.get()}return{get:function(){return t},set:function(e){t=r(e)},add:function(e){t+=r(e)},subtract:function(e){t-=r(e)}}}function Sj(e,t){const r="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},n=t.style;let o=null,a=!1;return{clear:function(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(a)return;const i=function(e){return Math.round(100*e)/100}(e.direction(t));i!==o&&(n.transform=r(i),o=i)},toggleActive:function(e){a=!e}}}function Pj(e,t,r,n,o,a,i,s,l){const c=cj(o),d=cj(o).reverse(),u=function(){const e=i[0],t=h(d,e);return f(t,r,!1)}().concat(function(){const e=t-i[0]-1,n=h(c,e);return f(n,-r,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,r)=>p(e,t)>0?e.concat([r]):e,[])}function f(o,i,c){const d=function(e){return a.map((r,o)=>({start:r-n[o]+.5+e,end:r+t-.5+e}))}(i);return o.map(t=>{const n=c?0:-r,o=c?r:0,a=c?"end":"start",i=d[t][a];return{index:t,loopPoint:i,slideLocation:Oj(-1),translate:Sj(e,l[t]),target:()=>s.get()>i?n:o}})}return{canLoop:function(){return u.every(({index:e})=>{const r=c.filter(t=>t!==e);return p(r,t)<=.1})},clear:function(){u.forEach(e=>e.translate.clear())},loop:function(){u.forEach(e=>{const{target:t,translate:r,slideLocation:n}=e,o=t();o!==n.get()&&(r.to(o),n.set(o))})},loopPoints:u}}function Ej(e,t,r){let n,o=!1;return{init:function(a){r&&(n=new MutationObserver(e=>{o||(oj(r)||r(a,e))&&function(e){for(const r of e)if("childList"===r.type){a.reInit(),t.emit("slidesChanged");break}}(e)}),n.observe(e,{childList:!0}))},destroy:function(){n&&n.disconnect(),o=!0}}}function Tj(e,t,r,n){const o={};let a,i=null,s=null,l=!1;return{init:function(){a=new IntersectionObserver(e=>{l||(e.forEach(e=>{const r=t.indexOf(e.target);o[r]=e}),i=null,s=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(e=>a.observe(e))},destroy:function(){a&&a.disconnect(),l=!0},get:function(e=!0){if(e&&i)return i;if(!e&&s)return s;const t=function(e){return fj(o).reduce((t,r)=>{const n=parseInt(r),{isIntersecting:a}=o[n];return(e&&a||!e&&!a)&&t.push(n),t},[])}(e);return e&&(i=t),e||(s=t),t}}}function Nj(e,t,r,n,o,a,i,s,l){const{startEdge:c,endEdge:d,direction:u}=e,p=rj(r);return{groupSlides:function(e){return p?function(e,t){return cj(e).filter(e=>e%t===0).map(r=>e.slice(r,r+t))}(e,r):function(e){return e.length?cj(e).reduce((r,p,h)=>{const f=dj(r)||0,m=0===f,v=p===uj(e),y=o[c]-a[f][c],g=o[c]-a[p][d],x=!n&&m?u(i):0,b=ij(g-(!n&&v?u(s):0)-(y+x));return h&&b>t+l&&r.push(p),v&&r.push(e.length),r},[]).map((t,r,n)=>{const o=Math.max(n[r-1]||0);return e.slice(o,t)}):[]}(e)}}}function zj(e,t,r,n,o,a,i){const{align:s,axis:l,direction:c,startIndex:d,loop:u,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:m,slidesToScroll:v,skipSnaps:y,containScroll:g,watchResize:x,watchSlides:b,watchDrag:k,watchFocus:_}=a,w={measure:function(e){const{offsetTop:t,offsetLeft:r,offsetWidth:n,offsetHeight:o}=e;return{top:t,right:r+n,bottom:t+o,left:r,width:n,height:o}}},M=w.measure(t),C=r.map(w.measure),D=function(e,t){const r="rtl"===t,n="y"===e,o=!n&&r?-1:1;return{scroll:n?"y":"x",cross:n?"x":"y",startEdge:n?"top":r?"right":"left",endEdge:n?"bottom":r?"left":"right",measureSize:function(e){const{height:t,width:r}=e;return n?t:r},direction:function(e){return e*o}}}(l,c),j=D.measureSize(M),O=function(e){return{measure:function(t){return e*(t/100)}}}(j),S=function(e,t){const r={start:function(){return 0},center:function(e){return n(e)/2},end:n};function n(e){return t-e}return{measure:function(n,o){return nj(e)?r[e](n):e(t,n,o)}}}(s,j),P=!u&&!!g,E=u||!!g,{slideSizes:T,slideSizesWithGaps:N,startGap:z,endGap:A}=function(e,t,r,n,o,a){const{measureSize:i,startEdge:s,endEdge:l}=e,c=r[0]&&o,d=function(){if(!c)return 0;const e=r[0];return ij(t[s]-e[s])}(),u=function(){if(!c)return 0;const e=a.getComputedStyle(dj(n));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=r.map(i),h=r.map((e,t,r)=>{const n=!t,o=pj(r,t);return n?p[t]+d:o?p[t]+u:r[t+1][s]-e[s]}).map(ij);return{slideSizes:p,slideSizesWithGaps:h,startGap:d,endGap:u}}(D,M,C,r,E,o),R=Nj(D,j,v,u,M,C,z,A,2),{snaps:F,snapsAligned:L}=function(e,t,r,n,o){const{startEdge:a,endEdge:i}=e,{groupSlides:s}=o,l=s(n).map(e=>dj(e)[i]-e[0][a]).map(ij).map(t.measure),c=n.map(e=>r[a]-e[a]).map(e=>-ij(e)),d=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:d}}(D,S,M,C,R),B=-dj(F)+dj(N),{snapsContained:V,scrollContainLimit:I}=function(e,t,r,n,o){const a=xj(-t+e,0),i=r.map((e,t)=>{const{min:n,max:o}=a,i=a.constrain(e),s=!t,l=pj(r,t);return s?o:l||c(n,i)?n:c(o,i)?o:i}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=i[0],t=dj(i);return xj(i.lastIndexOf(e),i.indexOf(t)+1)}(),l=function(){if(t<=e+o)return[a.max];if("keepSnaps"===n)return i;const{min:r,max:l}=s;return i.slice(r,l)}();function c(e,t){return lj(e,t)<=1}return{snapsContained:l,scrollContainLimit:s}}(j,B,L,g,2),q=P?V:L,{limit:H}=function(e,t,r){const n=t[0];return{limit:xj(r?n-e:dj(t),n)}}(B,q,u),$=bj(uj(q),d,u),W=$.clone(),U=cj(r),Y=gj(n,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:r,options:{loop:n}})=>{n||r.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:r,offsetLocation:n,previousLocation:o,scrollLooper:a,slideLooper:i,dragHandler:s,animation:l,eventHandler:c,scrollBounds:d,options:{loop:u}},p)=>{const h=e.settled(),f=!d.shouldConstrain(),m=u?h:h&&f,v=m&&!s.pointerDown();v&&l.stop();const y=r.get()*p+o.get()*(1-p);n.set(y),u&&(a.loop(e.direction()),i.loop()),t.to(n.get()),v&&c.emit("settle"),m||c.emit("scroll")})(se,e)),Z=q[$.get()],K=Oj(Z),G=Oj(Z),X=Oj(Z),Q=Oj(Z),J=function(e,t,r,n,o,a){let i=0,s=0,l=o,c=a,d=e.get(),u=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return i},seek:function(){const t=n.get()-e.get();let o=0;return l?(r.set(e),i+=t/l,i*=c,d+=i,e.add(i),o=d-u):(i=0,r.set(n),e.set(n),o=t),s=sj(o),u=d,f},settled:function(){return ij(n.get()-t.get())<.001},useBaseFriction:function(){return h(a)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(K,X,G,Q,p,.68),ee=Dj(u,q,B,H,Q),te=function(e,t,r,n,o,a,i){function s(o){const s=o.distance,l=o.index!==t.get();a.add(s),s&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(r.set(t.get()),t.set(o.index),i.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,r){const n=t.clone().set(e);s(o.byIndex(n.get(),r))}}}(Y,$,W,J,ee,Q,i),re=function(e){const{max:t,length:r}=e;return{get:function(e){return r?(e-t)/-r:0}}}(H),ne=yj(),oe=Tj(t,r,i,m),{slideRegistry:ae}=function(e,t,r,n,o,a){const{groupSlides:i}=o,{min:s,max:l}=n,c=function(){const n=i(a),o=!e||"keepSnaps"===t;return 1===r.length?[a]:o?n:n.slice(s,l).map((e,t,r)=>{const n=!t,o=pj(r,t);return n?hj(dj(r[0])+1):o?hj(uj(a)-dj(r)[0]+1,dj(r)[0]):e})}();return{slideRegistry:c}}(P,g,q,I,R,U),ie=jj(e,r,ae,te,J,ne,i,_),se={ownerDocument:n,ownerWindow:o,eventHandler:i,containerRect:M,slideRects:C,animation:Y,axis:D,dragHandler:kj(D,e,n,o,Q,_j(D,o),K,Y,te,J,ee,$,i,O,h,f,y,.68,k),eventStore:ne,percentOfView:O,index:$,indexPrevious:W,limit:H,location:K,offsetLocation:X,previousLocation:G,options:a,resizeHandler:wj(t,i,o,r,D,x,w),scrollBody:J,scrollBounds:Mj(H,X,Q,J,O),scrollLooper:Cj(B,H,X,[K,X,G,Q]),scrollProgress:re,scrollSnapList:q.map(re.get),scrollSnaps:q,scrollTarget:ee,scrollTo:te,slideLooper:Pj(D,j,B,T,N,F,q,X,r),slideFocus:ie,slidesHandler:Ej(t,i,b),slidesInView:oe,slideIndexes:U,slideRegistry:ae,slidesToScroll:R,target:Q,translate:Sj(D,t)};return se}QD.displayName="TimeInput";const Aj={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Rj(e){function t(e,t){return mj(e,t||{})}return{mergeOptions:t,optionsAtMedia:function(r){const n=r.breakpoints||{},o=fj(n).filter(t=>e.matchMedia(t).matches).map(e=>n[e]).reduce((e,r)=>t(e,r),{});return t(r,o)},optionsMediaQueries:function(t){return t.map(e=>fj(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}}}function Fj(e,t,r){const n=e.ownerDocument,o=n.defaultView,a=Rj(o),i=function(e){let t=[];return{init:function(r,n){return t=n.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(r,e)),n.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}}}(a),s=yj(),l=function(){let e,t={};function r(e){return t[e]||[]}const n={init:function(t){e=t},emit:function(t){return r(t).forEach(r=>r(e,t)),n},off:function(e,o){return t[e]=r(e).filter(e=>e!==o),n},on:function(e,o){return t[e]=r(e).concat([o]),n},clear:function(){t={}}};return n}(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:u}=a,{on:p,off:h,emit:f}=l,m=D;let v,y,g,x,b=!1,k=c(Aj,Fj.globalOptions),_=c(k),w=[];function M(t){const r=zj(e,g,x,n,o,t,l);if(t.loop&&!r.slideLooper.canLoop()){return M(Object.assign({},t,{loop:!1}))}return r}function C(t,r){b||(k=c(k,t),_=d(k),w=r||w,function(){const{container:t,slides:r}=_;g=(nj(t)?e.querySelector(t):t)||e.children[0];const n=nj(r)?g.querySelectorAll(r):r;x=[].slice.call(n||g.children)}(),v=M(_),u([k,...w.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",D)),_.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(P),v.eventHandler.init(P),v.resizeHandler.init(P),v.slidesHandler.init(P),v.options.loop&&v.slideLooper.loop(),g.offsetParent&&x.length&&v.dragHandler.init(P),y=i.init(P,w)))}function D(e,t){const r=S();j(),C(c({startIndex:r},e),t),l.emit("reInit")}function j(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),i.destroy(),s.clear()}function O(e,t,r){!_.active||b||(v.scrollBody.useBaseFriction().useDuration(!0===t?0:_.duration),v.scrollTo.index(e,r||0))}function S(){return v.index.get()}const P={canScrollNext:function(){return v.index.add(1).get()!==S()},canScrollPrev:function(){return v.index.add(-1).get()!==S()},containerNode:function(){return g},internalEngine:function(){return v},destroy:function(){b||(b=!0,s.clear(),j(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return y},previousScrollSnap:function(){return v.indexPrevious.get()},reInit:m,rootNode:function(){return e},scrollNext:function(e){O(v.index.add(1).get(),e,-1)},scrollPrev:function(e){O(v.index.add(-1).get(),e,1)},scrollProgress:function(){return v.scrollProgress.get(v.offsetLocation.get())},scrollSnapList:function(){return v.scrollSnapList},scrollTo:O,selectedScrollSnap:S,slideNodes:function(){return x},slidesInView:function(){return v.slidesInView.get()},slidesNotInView:function(){return v.slidesInView.get(!1)}};return C(t,r),setTimeout(()=>l.emit("init"),0),P}function Lj(e={},t=[]){const n=r.useRef(e),o=r.useRef(t),[a,i]=r.useState(),[s,l]=r.useState(),c=r.useCallback(()=>{a&&a.reInit(n.current,o.current)},[a]);return r.useEffect(()=>{ej(n.current,e)||(n.current=e,c())},[e,c]),r.useEffect(()=>{(function(e,t){if(e.length!==t.length)return!1;const r=tj(e),n=tj(t);return r.every((e,t)=>ej(e,n[t]))})(o.current,t)||(o.current=t,c())},[t,c]),r.useEffect(()=>{if(typeof window<"u"&&window.document&&window.document.createElement&&s){Fj.globalOptions=Lj.globalOptions;const e=Fj(s,n.current,o.current);return i(e),()=>e.destroy()}i(void 0)},[s,i]),[l,a]}Fj.globalOptions=void 0,Lj.globalOptions=void 0;const Bj=a.createContext(null);function Vj(){const e=a.useContext(Bj);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const Ij=a.forwardRef(({orientation:e="horizontal",opts:r,setApi:n,plugins:o,className:i,children:s,...l},c)=>{const[d,u]=Lj({...r,axis:"horizontal"===e?"x":"y"},o),[p,h]=a.useState(!1),[f,m]=a.useState(!1),v=a.useCallback(e=>{e&&(h(e.canScrollPrev()),m(e.canScrollNext()))},[]),y=a.useCallback(()=>{null==u||u.scrollPrev()},[u]),g=a.useCallback(()=>{null==u||u.scrollNext()},[u]),x=a.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),y()):"ArrowRight"===e.key&&(e.preventDefault(),g())},[y,g]);return a.useEffect(()=>{!u||!n||n(u)},[u,n]),a.useEffect(()=>{if(u)return v(u),u.on("reInit",v),u.on("select",v),()=>{null==u||u.off("select",v)}},[u,v]),t.jsx(Bj.Provider,{value:{carouselRef:d,api:u,opts:r,orientation:e||("y"===(null==r?void 0:r.axis)?"vertical":"horizontal"),scrollPrev:y,scrollNext:g,canScrollPrev:p,canScrollNext:f},children:t.jsx("div",{ref:c,onKeyDownCapture:x,className:Br("relative",i),role:"region","aria-roledescription":"carousel",...l,children:s})})});Ij.displayName="Carousel";const qj=a.forwardRef(({className:e,...r},n)=>{const{carouselRef:o,orientation:a}=Vj();return t.jsx("div",{ref:o,className:"overflow-hidden",children:t.jsx("div",{ref:n,className:Br("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",e),...r})})});qj.displayName="CarouselContent";const Hj=a.forwardRef(({className:e,...r},n)=>{const{orientation:o}=Vj();return t.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:Br("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",e),...r})});Hj.displayName="CarouselItem";const $j=a.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollPrev:s,canScrollPrev:l}=Vj();return t.jsxs(Ir,{ref:a,variant:r,size:n,className:Br("absolute h-8 w-8 rounded-full","horizontal"===i?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(st,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Previous slide"})]})});$j.displayName="CarouselPrevious";const Wj=a.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollNext:s,canScrollNext:l}=Vj();return t.jsxs(Ir,{ref:a,variant:r,size:n,className:Br("absolute h-8 w-8 rounded-full","horizontal"===i?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(lt,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Next slide"})]})});Wj.displayName="CarouselNext";const Uj=({form:e,translations:r})=>{const n=[{label:r.timePresetAllDay,start:"00:00",end:"23:59"},{label:r.timePresetEarlyMorning,start:"06:00",end:"09:00"},{label:r.timePresetMorning,start:"09:00",end:"12:00"},{label:r.timePresetLunch,start:"12:00",end:"13:00"},{label:r.timePresetEarlyAfternoon,start:"13:00",end:"15:00"},{label:r.timePresetLateAfternoon,start:"15:00",end:"17:00"},{label:r.timePresetEvening,start:"17:00",end:"20:00"},{label:r.timePresetNight,start:"20:00",end:"23:00"}];return t.jsx("div",{className:"pt-2 pb-1",children:t.jsxs(Ij,{className:"w-full max-w-xs mx-auto sm:px-0",children:[t.jsx(qj,{className:"",children:n.map(r=>t.jsx(Hj,{className:"basis-1/3",children:t.jsx(qd.div,{whileHover:{scale:1},whileTap:{scale:.95},children:t.jsx(Ir,{type:"button",variant:"outline",size:"sm",onClick:()=>(t=>{e.setValue("startTime",t.start),e.setValue("endTime",t.end)})(r),className:Br("w-full text-xs h-5 mx-auto flex",e.watch("startTime")===r.start&&e.watch("endTime")===r.end?"bg-primary text-primary-foreground":""),children:t.jsx("span",{className:"text-[10px] sm:text-xs",children:r.label})})})},r.label))}),t.jsx($j,{className:"flex",type:"button"}),t.jsx(Wj,{className:"flex",type:"button"})]})})};var Yj="Switch",[Zj,Kj]=Wd(Yj),[Gj,Xj]=Zj(Yj),Qj=a.forwardRef((e,r)=>{const{__scopeSwitch:n,name:o,checked:i,defaultChecked:s,required:l,disabled:c,value:d="on",onCheckedChange:u,form:p,...h}=e,[f,m]=a.useState(null),v=Ft(r,e=>m(e)),y=a.useRef(!1),g=!f||(p||!!f.closest("form")),[x,b]=Kd({prop:i,defaultProp:s??!1,onChange:u,caller:Yj});return t.jsxs(Gj,{scope:n,checked:x,disabled:c,children:[t.jsx(Gd.button,{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":rO(x),"data-disabled":c?"":void 0,disabled:c,value:d,...h,ref:v,onClick:$d(e.onClick,e=>{b(e=>!e),g&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),g&&t.jsx(tO,{control:f,bubbles:!y.current,name:o,value:d,checked:x,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});Qj.displayName=Yj;var Jj="SwitchThumb",eO=a.forwardRef((e,r)=>{const{__scopeSwitch:n,...o}=e,a=Xj(Jj,n);return t.jsx(Gd.span,{"data-state":rO(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:r})});eO.displayName=Jj;var tO=a.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:o=!0,...i},s)=>{const l=a.useRef(null),c=Ft(l,s),d=cD(n),u=xh(r);return a.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[d,n,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:c,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function rO(e){return e?"checked":"unchecked"}tO.displayName="SwitchBubbleInput";var nO=Qj,oO=eO;const aO=a.forwardRef(({className:e,...r},n)=>t.jsx(nO,{className:Br("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:t.jsx(oO,{className:Br("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));function iO(e,[t,r]){return Math.min(r,Math.max(t,e))}aO.displayName=nO.displayName;var sO=[" ","Enter","ArrowUp","ArrowDown"],lO=[" ","Enter"],cO="Select",[dO,uO,pO]=Qd(cO),[hO,fO]=Wd(cO,[pO,_h]),mO=_h(),[vO,yO]=hO(cO),[gO,xO]=hO(cO),bO=e=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:h,disabled:f,required:m,form:v}=e,y=mO(r),[g,x]=a.useState(null),[b,k]=a.useState(null),[_,w]=a.useState(!1),M=eu(u),[C,D]=Kd({prop:o,defaultProp:i??!1,onChange:s,caller:cO}),[j,O]=Kd({prop:l,defaultProp:c,onChange:d,caller:cO}),S=a.useRef(null),P=!g||(v||!!g.closest("form")),[E,T]=a.useState(new Set),N=Array.from(E).map(e=>e.props.value).join(";");return t.jsx(Lh,{...y,children:t.jsxs(vO,{required:m,scope:r,trigger:g,onTriggerChange:x,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:w,contentId:Du(),value:j,onValueChange:O,open:C,onOpenChange:D,dir:M,triggerPointerDownPosRef:S,disabled:f,children:[t.jsx(dO.Provider,{scope:r,children:t.jsx(gO,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{T(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),P?t.jsxs(lS,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:h,value:j,onChange:e=>O(e.target.value),disabled:f,form:v,children:[void 0===j?t.jsx("option",{value:""}):null,Array.from(E)]},N):null]})})};bO.displayName=cO;var kO="SelectTrigger",_O=a.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:o=!1,...i}=e,s=mO(n),l=yO(kO,n),c=l.disabled||o,d=Ft(r,l.onTriggerChange),u=uO(n),p=a.useRef("touch"),[h,f,m]=dS(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=uS(t,e,r);void 0!==n&&l.onValueChange(n.value)}),v=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Bh,{asChild:!0,...s,children:t.jsx(Gd.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":cS(l.value)?"":void 0,...i,ref:d,onClick:$d(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:$d(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:$d(i.onKeyDown,e=>{const t=""!==h.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&sO.includes(e.key)&&(v(),e.preventDefault())})})})});_O.displayName=kO;var wO="SelectValue",MO=a.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:s="",...l}=e,c=yO(wO,n),{onValueNodeHasChildrenChange:d}=c,u=void 0!==i,p=Ft(r,c.onValueNodeChange);return Yd(()=>{d(u)},[d,u]),t.jsx(Gd.span,{...l,ref:p,style:{pointerEvents:"none"},children:cS(c.value)?t.jsx(t.Fragment,{children:s}):i})});MO.displayName=wO;var CO=a.forwardRef((e,r)=>{const{__scopeSelect:n,children:o,...a}=e;return t.jsx(Gd.span,{"aria-hidden":!0,...a,ref:r,children:o||"▼"})});CO.displayName="SelectIcon";var DO=e=>t.jsx(qh,{asChild:!0,...e});DO.displayName="SelectPortal";var jO="SelectContent",OO=a.forwardRef((e,r)=>{const n=yO(jO,e.__scopeSelect),[o,s]=a.useState();if(Yd(()=>{s(new DocumentFragment)},[]),!n.open){const r=o;return r?i.createPortal(t.jsx(PO,{scope:e.__scopeSelect,children:t.jsx(dO.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),r):null}return t.jsx(NO,{...e,ref:r})});OO.displayName=jO;var SO=10,[PO,EO]=hO(jO),TO=Lt("SelectContent.RemoveScroll"),NO=a.forwardRef((e,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g,...x}=e,b=yO(jO,n),[k,_]=a.useState(null),[w,M]=a.useState(null),C=Ft(r,e=>_(e)),[D,j]=a.useState(null),[O,S]=a.useState(null),P=uO(n),[E,T]=a.useState(!1),N=a.useRef(!1);a.useEffect(()=>{if(k)return vf(k)},[k]),pu();const z=a.useCallback(e=>{const[t,...r]=P().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(const r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&w&&(w.scrollTop=0),r===n&&w&&(w.scrollTop=w.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[P,w]),A=a.useCallback(()=>z([D,k]),[z,D,k]);a.useEffect(()=>{E&&A()},[E,A]);const{onOpenChange:R,triggerPointerDownPosRef:F}=b;a.useEffect(()=>{if(k){let e={x:0,y:0};const t=t=>{var r,n;e={x:Math.abs(Math.round(t.pageX)-((null==(r=F.current)?void 0:r.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(n=F.current)?void 0:n.y)??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():k.contains(r.target)||R(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[k,R,F]),a.useEffect(()=>{const e=()=>R(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[R]);const[L,B]=dS(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=uS(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),V=a.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&(j(e),n&&(N.current=!0))},[b.value]),I=a.useCallback(()=>null==k?void 0:k.focus(),[k]),q=a.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&S(e)},[b.value]),H="popper"===o?AO:zO,$=H===AO?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g}:{};return t.jsx(PO,{scope:n,content:k,viewport:w,onViewportChange:M,itemRefCallback:V,selectedItem:D,onItemLeave:I,itemTextRefCallback:q,focusSelectedItem:A,selectedItemText:O,position:o,isPositioned:E,searchRef:L,children:t.jsx(am,{as:TO,allowPinchZoom:!0,children:t.jsx(yu,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:$d(i,e=>{var t;null==(t=b.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(su,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...x,...$,onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:$d(x.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});NO.displayName="SelectContentImpl";var zO=a.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:o,...i}=e,s=yO(jO,n),l=EO(jO,n),[c,d]=a.useState(null),[u,p]=a.useState(null),h=Ft(r,e=>p(e)),f=uO(n),m=a.useRef(!1),v=a.useRef(!0),{viewport:y,selectedItem:g,selectedItemText:x,focusSelectedItem:b}=l,k=a.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&y&&g&&x){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=s.valueNode.getBoundingClientRect(),n=x.getBoundingClientRect();if("rtl"!==s.dir){const o=n.left-t.left,a=r.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-SO,u=iO(a,[SO,Math.max(SO,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const o=t.right-n.right,a=window.innerWidth-r.right-o,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-SO,u=iO(a,[SO,Math.max(SO,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const a=f(),i=window.innerHeight-2*SO,l=y.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),b=p+h+l+parseInt(d.paddingBottom,10)+v,k=Math.min(5*g.offsetHeight,b),_=window.getComputedStyle(y),w=parseInt(_.paddingTop,10),M=parseInt(_.paddingBottom,10),C=e.top+e.height/2-SO,D=i-C,j=g.offsetHeight/2,O=p+h+(g.offsetTop+j),S=b-O;if(O<=C){const e=a.length>0&&g===a[a.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-y.offsetTop-y.offsetHeight,r=O+Math.max(D,j+(e?M:0)+t+v);c.style.height=r+"px"}else{const e=a.length>0&&g===a[0].ref.current;c.style.top="0px";const t=Math.max(C,p+y.offsetTop+(e?w:0)+j)+S;c.style.height=t+"px",y.scrollTop=O-C+y.offsetTop}c.style.margin=`${SO}px 0`,c.style.minHeight=k+"px",c.style.maxHeight=i+"px",null==o||o(),requestAnimationFrame(()=>m.current=!0)}},[f,s.trigger,s.valueNode,c,u,y,g,x,s.dir,o]);Yd(()=>k(),[k]);const[_,w]=a.useState();Yd(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]);const M=a.useCallback(e=>{e&&!0===v.current&&(k(),null==b||b(),v.current=!1)},[k,b]);return t.jsx(RO,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:M,children:t.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:t.jsx(Gd.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});zO.displayName="SelectItemAlignedPosition";var AO=a.forwardRef((e,r)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=SO,...i}=e,s=mO(n);return t.jsx(Vh,{...s,...i,ref:r,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});AO.displayName="SelectPopperPosition";var[RO,FO]=hO(jO,{}),LO="SelectViewport",BO=a.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:o,...i}=e,s=EO(LO,n),l=FO(LO,n),c=Ft(r,s.onViewportChange),d=a.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(dO.Slot,{scope:n,children:t.jsx(Gd.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:$d(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(null!=n&&n.current&&r){const e=Math.abs(d.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*SO,o=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(o,a);if(i<n){const o=i+e,a=Math.min(n,o),s=o-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});BO.displayName=LO;var VO="SelectGroup",[IO,qO]=hO(VO),HO=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=Du();return t.jsx(IO,{scope:n,id:a,children:t.jsx(Gd.div,{role:"group","aria-labelledby":a,...o,ref:r})})});HO.displayName=VO;var $O="SelectLabel",WO=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=qO($O,n);return t.jsx(Gd.div,{id:a.id,...o,ref:r})});WO.displayName=$O;var UO="SelectItem",[YO,ZO]=hO(UO),KO=a.forwardRef((e,r)=>{const{__scopeSelect:n,value:o,disabled:i=!1,textValue:s,...l}=e,c=yO(UO,n),d=EO(UO,n),u=c.value===o,[p,h]=a.useState(s??""),[f,m]=a.useState(!1),v=Ft(r,e=>{var t;return null==(t=d.itemRefCallback)?void 0:t.call(d,e,o,i)}),y=Du(),g=a.useRef("touch"),x=()=>{i||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(YO,{scope:n,value:o,disabled:i,textId:y,isSelected:u,onItemTextChange:a.useCallback(e=>{h(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:t.jsx(dO.ItemSlot,{scope:n,value:o,disabled:i,textValue:p,children:t.jsx(Gd.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:$d(l.onFocus,()=>m(!0)),onBlur:$d(l.onBlur,()=>m(!1)),onClick:$d(l.onClick,()=>{"mouse"!==g.current&&x()}),onPointerUp:$d(l.onPointerUp,()=>{"mouse"===g.current&&x()}),onPointerDown:$d(l.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:$d(l.onPointerMove,e=>{var t;g.current=e.pointerType,i?null==(t=d.onItemLeave)||t.call(d):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$d(l.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=d.onItemLeave)||t.call(d))}),onKeyDown:$d(l.onKeyDown,e=>{var t;""!==(null==(t=d.searchRef)?void 0:t.current)&&" "===e.key||(lO.includes(e.key)&&x()," "===e.key&&e.preventDefault())})})})})});KO.displayName=UO;var GO="SelectItemText",XO=a.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:s,...l}=e,c=yO(GO,n),d=EO(GO,n),u=ZO(GO,n),p=xO(GO,n),[h,f]=a.useState(null),m=Ft(r,e=>f(e),u.onItemTextChange,e=>{var t;return null==(t=d.itemTextRefCallback)?void 0:t.call(d,e,u.value,u.disabled)}),v=null==h?void 0:h.textContent,y=a.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=p;return Yd(()=>(g(y),()=>x(y)),[g,x,y]),t.jsxs(t.Fragment,{children:[t.jsx(Gd.span,{id:u.textId,...l,ref:m}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?i.createPortal(l.children,c.valueNode):null]})});XO.displayName=GO;var QO="SelectItemIndicator",JO=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return ZO(QO,n).isSelected?t.jsx(Gd.span,{"aria-hidden":!0,...o,ref:r}):null});JO.displayName=QO;var eS="SelectScrollUpButton",tS=a.forwardRef((e,r)=>{const n=EO(eS,e.__scopeSelect),o=FO(eS,e.__scopeSelect),[i,s]=a.useState(!1),l=Ft(r,o.onScrollButtonChange);return Yd(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?t.jsx(oS,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});tS.displayName=eS;var rS="SelectScrollDownButton",nS=a.forwardRef((e,r)=>{const n=EO(rS,e.__scopeSelect),o=FO(rS,e.__scopeSelect),[i,s]=a.useState(!1),l=Ft(r,o.onScrollButtonChange);return Yd(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;s(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?t.jsx(oS,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});nS.displayName=rS;var oS=a.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:o,...i}=e,s=EO("SelectScrollButton",n),l=a.useRef(null),c=uO(n),d=a.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),Yd(()=>{var e;const t=c().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[c]),t.jsx(Gd.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:$d(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:$d(i.onPointerMove,()=>{var e;null==(e=s.onItemLeave)||e.call(s),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:$d(i.onPointerLeave,()=>{d()})})}),aS=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return t.jsx(Gd.div,{"aria-hidden":!0,...o,ref:r})});aS.displayName="SelectSeparator";var iS="SelectArrow",sS=a.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=mO(n),i=yO(iS,n),s=EO(iS,n);return i.open&&"popper"===s.position?t.jsx(Ih,{...a,...o,ref:r}):null});sS.displayName=iS;var lS=a.forwardRef(({__scopeSelect:e,value:r,...n},o)=>{const i=a.useRef(null),s=Ft(o,i),l=cD(r);return a.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),t.jsx(Gd.select,{...n,style:{...gy,...n.style},ref:s,defaultValue:r})});function cS(e){return""===e||void 0===e}function dS(e){const t=tu(e),r=a.useRef(""),n=a.useRef(0),o=a.useCallback(e=>{const o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),i=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function uS(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}lS.displayName="SelectBubbleInput";var pS=_O,hS=CO,fS=DO,mS=OO,vS=BO,yS=WO,gS=KO,xS=XO,bS=JO,kS=tS,_S=nS,wS=aS;const MS=bO,CS=MO,DS=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(pS,{ref:o,className:Br("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,t.jsx(hS,{asChild:!0,children:t.jsx(vt,{className:"h-4 w-4 opacity-50"})})]}));DS.displayName=pS.displayName;const jS=a.forwardRef(({className:e,...r},n)=>t.jsx(kS,{ref:n,className:Br("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(xt,{className:"h-4 w-4"})}));jS.displayName=kS.displayName;const OS=a.forwardRef(({className:e,...r},n)=>t.jsx(_S,{ref:n,className:Br("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(vt,{className:"h-4 w-4"})}));OS.displayName=_S.displayName;const SS=a.forwardRef(({className:e,children:r,position:n="popper",...o},a)=>t.jsx(fS,{children:t.jsxs(mS,{ref:a,className:Br("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[t.jsx(jS,{}),t.jsx(vS,{className:Br("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(OS,{})]})}));SS.displayName=mS.displayName;const PS=a.forwardRef(({className:e,...r},n)=>t.jsx(yS,{ref:n,className:Br("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));PS.displayName=yS.displayName;const ES=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(gS,{ref:o,className:Br("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(bS,{children:t.jsx(mt,{className:"h-4 w-4"})})}),t.jsx(xS,{children:r})]}));ES.displayName=gS.displayName;const TS=a.forwardRef(({className:e,...r},n)=>t.jsx(wS,{ref:n,className:Br("-mx-1 my-1 h-px bg-muted",e),...r}));TS.displayName=wS.displayName;const NS=(e,t,r,n)=>{if(!n||!Ve(e,{start:t,end:r}))return!1;switch(n){case"daily":return!0;case"weekly":return ze(e)===ze(t);case"monthly":return e.getDate()===t.getDate();default:return!1}},zS=({field:e,form:n,translations:o})=>{const[a,i]=r.useState(0),[s,l]=r.useState(""),[c,d]=r.useState({}),u=n.getValues("startDate"),p=n.getValues("endDate"),h=n.getValues("isRepeatingInterval")||"daily",f=W({start:u,end:p}).filter(e=>{const t=h;return"daily"===t||("weekly"===t?e.getDay()===u.getDay():"monthly"===t&&e.getDate()===u.getDate())}),m=e.value||[],v=m.filter(e=>f.some(t=>L(e,t)));m.length!==v.length&&setTimeout(()=>{e.onChange(v)},0);const y=e=>e.length>=f.length;if("daily"===h)return t.jsx(MC,{mode:"multiple",selected:e.value||[],onSelect:t=>{t&&y(t)?v_.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):e.onChange(t||[])},fromDate:u,toDate:p,defaultMonth:u,className:"rounded-md border"});const g=f.reduce((e,t)=>{const r=Te(t,"yyyy-MM");return e[r]||(e[r]=[]),e[r].push(t),e},{}),x=Object.entries(g).sort(([e],[t])=>e.localeCompare(t));if(0===Object.keys(c).length&&x.length>0){const e={};x.forEach(([t],r)=>{e[t]=0===r}),d(e)}const b=""===s.trim()?x:x.filter(e=>{const t=e[1][0];return`${o.monthNames[t.getMonth()]} ${Te(t,"yyyy")}`.toLowerCase().includes(s.toLowerCase())}),k=Math.ceil(b.length/2),_=b.slice(2*a,2*(a+1));return t.jsxs("div",{className:"rounded-md p-1 w-[300px] overflow-y-auto",children:[t.jsx("div",{className:"text-center font-medium mb-2 text-sm",children:"weekly"===h?o.weeklyIntervalLabel.replace("{dayName}",o.fullDayNames[u.getDay()]).replace("{startDate}",`${Te(u,"dd")} ${o.monthNames[u.getMonth()].slice(0,3)}`).replace("{endDate}",`${Te(p,"dd")} ${o.monthNames[p.getMonth()].slice(0,3)} ${Te(p,"yyyy")}`):o.monthlyIntervalLabel.replace("{dayOfMonth}",Te(u,"do")).replace("{startDate}",o.monthNames[u.getMonth()].slice(0,3)).replace("{endDate}",`${o.monthNames[p.getMonth()].slice(0,3)} ${Te(p,"yyyy")}`)}),t.jsxs("div",{className:"flex gap-2 mb-2",children:[t.jsx("div",{className:"flex-grow",children:t.jsx(r_,{type:"text",placeholder:o.searchMonthPlaceholder,value:s,onChange:e=>{l(e.target.value),i(0)},className:"h-7 text-xs"})}),b.length>0&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.max(e-1,0))},disabled:0===a,children:"←"}),t.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[a+1,"/",Math.max(1,k)]}),t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.min(e+1,k-1))},disabled:a>=k-1,children:"→"})]})]}),0===f.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noMatchingDates}):0===b.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noSearchResults.replace("{query}",s)}):t.jsx("div",{children:_.map(([r,n])=>{const a=n[0],i=`${o.monthNames[a.getMonth()]} ${Te(a,"yyyy")}`,s=c[r],l=n.filter(e=>v.some(t=>L(t,e))).length;return t.jsxs("div",{className:"mb-2 border rounded-md overflow-hidden",children:[t.jsxs("div",{className:"py-1 px-2 bg-muted flex justify-between items-center cursor-pointer text-xs",onClick:()=>(e=>{d(t=>({...t,[e]:!t[e]}))})(r),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"mr-1 flex items-center justify-center w-4",children:s?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m6 9 6 6 6-6"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m9 18 6-6-6-6"})})}),t.jsx("span",{className:"font-medium",children:i}),t.jsx("span",{className:"ml-1 text-muted-foreground",children:o.ofExcluded.replace("{count}",l.toString()).replace("{total}",n.length.toString())})]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:t=>{t.stopPropagation(),(t=>{const r=v,n=t.filter(e=>!r.some(t=>L(t,e))),a=[...r,...n];y(a)?v_.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):e.onChange(a)})(n)},children:o.selectAll}),t.jsx(Ir,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:t=>{t.stopPropagation(),(t=>{const r=v.filter(e=>!t.some(t=>L(t,e)));e.onChange(r)})(n)},disabled:0===l,children:o.clearAll})]})]}),s&&t.jsx("div",{className:"p-1 flex flex-wrap gap-1 bg-background",children:n.map(r=>{const n=v.some(e=>L(e,r));return t.jsx(Ir,{type:"button",variant:n?"default":"outline",className:"h-6 px-1 text-[10px]",onClick:()=>{const t=v;if(n)e.onChange(t.filter(e=>!L(e,r)));else{const n=[...t,r];if(y(n))return void v_.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range");e.onChange(n)}},children:Te(r,o.dateButtonFormat)},r.toISOString())})})]},r)})})]})},AS=({form:e,translations:n,showRepeatToggle:o})=>{const[a,i]=r.useState(!1);r.useState(()=>{const t=e.getValues("isRepeatingExcludedDates");t&&t.length>0&&i(!0)});return o?t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsxs(UD,{className:"flex flex-col rounded-lg border p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(YD,{className:"text-base flex items-center cursor-pointer",children:[t.jsx(ht,{className:"mr-2 h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"leading-tight",children:n.repeatingEventQuestion})]}),t.jsx(tn,{mode:"wait",children:e.watch("isRepeating")&&t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},children:t.jsx(KD,{className:"text-xs leading-normal max-w-[90%]",children:((e,t,r,o,a,i)=>{const s=e=>Te(e,"MMM d"),l=n.fullDayNames[e.getDay()],c="enUS"===n.language?Te(e,"do"):e.getDate().toString(),d=s(e),u=Be(e,t)?s(t):Te(t,"MMM d, yyyy"),p=`${r} - ${o}`;let h="";switch(a||"daily"){case"daily":h=n.repeatDailyDescription.replace("{timeRange}",p).replace("{startDate}",d).replace("{endDate}",u);break;case"weekly":h=n.repeatWeeklyDescription.replace("{dayName}",l).replace("{timeRange}",p).replace("{startDate}",d).replace("{endDate}",u);break;case"monthly":h=n.repeatMonthlyDescription.replace("{dayOfMonth}",c).replace("{timeRange}",p).replace("{startDate}",d).replace("{endDate}",u)}if(i&&i.length>0){const e=i.length;h+=` (${n.withExcludedDates.replace("{count}",e.toString()).replace("{s}",e>1?"s":"")})`}return h})(e.watch("startDate"),e.watch("endDate"),e.watch("startTime"),e.watch("endTime"),e.watch("isRepeatingInterval"),e.watch("isRepeatingExcludedDates"))})})})]}),t.jsx(HD,{control:e.control,name:"isRepeating",render:({field:r})=>t.jsx(ZD,{children:t.jsx(aO,{checked:r.value,onCheckedChange:t=>{r.onChange(t),t||(i(!1),e.setValue("isRepeatingExcludedDates",[]))},className:"flex-shrink-0"})})})]}),t.jsx(tn,{children:e.watch("isRepeating")&&t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},children:t.jsxs("div",{className:"space-y-4",children:[t.jsx(HD,{control:e.control,name:"isRepeatingInterval",render:({field:r})=>t.jsxs(MS,{onValueChange:t=>{t!==r.value&&(e.setValue("isRepeatingExcludedDates",[]),i(!1)),r.onChange(t)},value:r.value||"daily",children:[t.jsx(ZD,{children:t.jsx(DS,{className:"w-full",children:t.jsx(CS,{})})}),t.jsxs(SS,{children:[t.jsx(ES,{value:"daily",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(dt,{className:"mr-2 h-4 w-4"}),n.repeatDaily]})}),t.jsx(ES,{value:"weekly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(ht,{className:"mr-2 h-4 w-4"}),n.repeatWeekly]})}),t.jsx(ES,{value:"monthly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),n.repeatMonthly]})})]})]})}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(YD,{className:"flex items-center text-sm cursor-pointer",children:[t.jsx(bt,{className:"mr-2 h-3 w-3"}),n.excludedDates]}),t.jsx(KD,{className:"text-xs",children:n.excludedDatesDescription})]}),t.jsx(aO,{checked:a,onCheckedChange:t=>{i(t),t||e.setValue("isRepeatingExcludedDates",[])},className:"flex-shrink-0"})]}),t.jsx(tn,{children:a&&t.jsx(qd.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.05,ease:"easeInOut"},className:"mt-4",children:t.jsx(HD,{control:e.control,name:"isRepeatingExcludedDates",render:({field:r})=>t.jsx(UD,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(Kk,{children:[t.jsx(Gk,{asChild:!0,children:t.jsxs(Ir,{variant:"outline",className:"w-full justify-start text-left font-normal text-sm h-9",type:"button",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),n.selectDatesToExclude]})}),t.jsx(Xk,{className:"w-auto p-0 max-w-[320px]",align:"start",children:t.jsx(zS,{field:r,form:e,translations:n})})]}),t.jsx(tn,{children:"daily"===e.watch("isRepeatingInterval")&&t.jsxs(qd.div,{initial:{opacity:0,height:0,overflow:"hidden"},animate:{opacity:1,height:"auto",overflow:"visible"},exit:{opacity:0,height:0,overflow:"hidden"},transition:{duration:.015,ease:"easeInOut"},className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(KD,{className:"text-xs mb-0",children:n.skipDays}),t.jsx(Ir,{type:"button",variant:"destructive",size:"sm",className:"text-xs h-5 mr-3",disabled:!((e.watch("isRepeatingExcludedDates")||[]).length>0),onClick:()=>{e.setValue("isRepeatingExcludedDates",[])},children:n.clearAll})]}),t.jsx("div",{children:t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:n.dayNames.map((r,o)=>{const a=o,i=e.watch("isRepeatingExcludedDates")||[],s=W({start:e.getValues("startDate"),end:e.getValues("endDate")}).filter(e=>e.getDay()===a),l=s.length>0,c=l&&s.every(e=>i.some(t=>L(t,e)));return t.jsx(Ir,{type:"button",variant:c?"default":"outline",size:"sm",className:Br("w-8 h-8 p-0 text-center flex items-center justify-center",0===a||6===a?"font-medium":"",l?"":"opacity-50 cursor-not-allowed"),disabled:!l,onClick:()=>{if(!l)return;const t=e.getValues("startDate"),r=e.getValues("endDate"),o=W({start:t,end:r}),i=o.filter(e=>e.getDay()===a);let s=[...e.getValues("isRepeatingExcludedDates")||[]];if(c)s=s.filter(e=>!i.some(t=>L(t,e)));else{i.forEach(e=>{s.some(t=>L(t,e))||s.push(e)});const e="daily",a=o.filter(n=>NS(n,t,r,e));if(s.length>=a.length)return void v_.error(n.errorCannotExcludeAllDates)}e.setValue("isRepeatingExcludedDates",s)},children:r.charAt(0)},o)})})})]})}),r.value&&r.value.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:r.value.map((e,n)=>t.jsxs(qd.div,{className:"bg-secondary text-secondary-foreground rounded-md px-2 py-1 text-xs flex items-center",initial:{opacity:0,scale:.6,y:15,rotateX:-10},animate:{opacity:1,scale:1,y:0,rotateX:0},whileHover:{scale:1.05},transition:{type:"spring",stiffness:500,damping:30,delay:0},children:[Te(e,"MMM d, yyyy"),t.jsxs(Ir,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:()=>{const e=[...r.value||[]];e.splice(n,1),r.onChange(e)},children:[t.jsx("span",{className:"sr-only",children:"Remove"}),"×"]})]},e.toISOString()))}),t.jsx(GD,{})]})})})})})]})})})]})}):null},RS=({open:e,editType:r,onEditTypeChange:n,onConfirm:o,onClose:a,translations:i})=>t.jsx(QC,{open:e,children:t.jsxs(rD,{className:"max-w-[425px]",children:[t.jsxs(nD,{children:[t.jsxs(aD,{className:"flex items-center",children:[t.jsx(pt,{className:"mr-2 h-5 w-5 text-primary"}),i.editRecurringEventTitle]}),t.jsx(iD,{className:"text-left",children:i.editRecurringEventDescription}),t.jsx("div",{className:"h-2"}),t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(AD,{defaultValue:"all",value:r,onValueChange:e=>n(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:i.editThisOccurrence,description:i.editThisOccurrenceDescription},{value:"future",label:i.editThisAndFuture,description:i.editThisAndFutureDescription},{value:"all",label:i.editAllOccurrences,description:i.editAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(RD,{value:e.value,id:`edit-${e.value}`}),t.jsxs(VD,{htmlFor:`edit-${e.value}`,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(oD,{children:[t.jsx(lD,{onClick:a,children:i.cancel}),t.jsxs(sD,{onClick:o,className:"w-full sm:w-auto",children:[t.jsx(pt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),i.save]})]})]})});var FS,LS;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(FS||(FS={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(LS||(LS={}));const BS=FS.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),VS=e=>{switch(typeof e){case"undefined":return BS.undefined;case"string":return BS.string;case"number":return Number.isNaN(e)?BS.nan:BS.number;case"boolean":return BS.boolean;case"function":return BS.function;case"bigint":return BS.bigint;case"symbol":return BS.symbol;case"object":return Array.isArray(e)?BS.array:null===e?BS.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?BS.promise:typeof Map<"u"&&e instanceof Map?BS.map:typeof Set<"u"&&e instanceof Set?BS.set:typeof Date<"u"&&e instanceof Date?BS.date:BS.object;default:return BS.unknown}},IS=FS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class qS extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof qS))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,FS.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}qS.create=e=>new qS(e);const HS=(e,t)=>{let r;switch(e.code){case IS.invalid_type:r=e.received===BS.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case IS.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,FS.jsonStringifyReplacer)}`;break;case IS.unrecognized_keys:r=`Unrecognized key(s) in object: ${FS.joinValues(e.keys,", ")}`;break;case IS.invalid_union:r="Invalid input";break;case IS.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${FS.joinValues(e.options)}`;break;case IS.invalid_enum_value:r=`Invalid enum value. Expected ${FS.joinValues(e.options)}, received '${e.received}'`;break;case IS.invalid_arguments:r="Invalid function arguments";break;case IS.invalid_return_type:r="Invalid function return type";break;case IS.invalid_date:r="Invalid date";break;case IS.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:FS.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case IS.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case IS.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case IS.custom:r="Invalid input";break;case IS.invalid_intersection_types:r="Intersection results could not be merged";break;case IS.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case IS.not_finite:r="Number must be finite";break;default:r=t.defaultError,FS.assertNever(e)}return{message:r}};let $S=HS;function WS(e,t){const r=$S,n=(e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],i={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...o,path:a,message:s}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===HS?void 0:HS].filter(e=>!!e)});e.common.issues.push(n)}class US{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return YS;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return US.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status||"aborted"===o.status)return YS;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==t.value&&(typeof o.value<"u"||n.alwaysSet)&&(r[t.value]=o.value)}return{status:e.value,value:r}}}const YS=Object.freeze({status:"aborted"}),ZS=e=>({status:"dirty",value:e}),KS=e=>({status:"valid",value:e}),GS=e=>"aborted"===e.status,XS=e=>"dirty"===e.status,QS=e=>"valid"===e.status,JS=e=>typeof Promise<"u"&&e instanceof Promise;var eP;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(eP||(eP={}));class tP{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const rP=(e,t)=>{if(QS(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new qS(e.common.issues);return this._error=t,this._error}}};function nP(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(t,o)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??o.defaultError}:typeof o.data>"u"?{message:a??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:a??r??o.defaultError}},description:o}}class oP{get description(){return this._def.description}_getType(e){return VS(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:VS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new US,ctx:{common:e.parent.common,data:e.data,parsedType:VS(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(JS(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(null==t?void 0:t.async)??!1,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:VS(e)},n=this._parseSync({data:e,path:r.path,parent:r});return rP(r,n)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:VS(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return QS(t)?{value:t.value}:{issues:n.common.issues}}catch(e){null!=(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>QS(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:VS(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(JS(n)?n:Promise.resolve(n));return rP(r,o)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const o=e(t),a=()=>n.addIssue({code:IS.custom,...r(t)});return typeof Promise<"u"&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new rE({schema:this,typeName:uE.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return nE.create(this,this._def)}nullable(){return oE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return IP.create(this)}promise(){return tE.create(this,this._def)}or(e){return $P.create([this,e],this._def)}and(e){return UP.create(this,e,this._def)}transform(e){return new rE({...nP(this._def),schema:this,typeName:uE.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new aE({...nP(this._def),innerType:this,defaultValue:t,typeName:uE.ZodDefault})}brand(){return new lE({typeName:uE.ZodBranded,type:this,...nP(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new iE({...nP(this._def),innerType:this,catchValue:t,typeName:uE.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return cE.create(this,e)}readonly(){return dE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const aP=/^c[^\s-]{8,}$/i,iP=/^[0-9a-z]+$/,sP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lP=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cP=/^[a-z0-9_-]{21}$/i,dP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,uP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let hP;const fP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",kP=new RegExp(`^${bP}$`);function _P(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function wP(e){return new RegExp(`^${_P(e)}$`)}function MP(e){let t=`${bP}T${_P(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function CP(e,t){return!(("v4"!==t&&t||!fP.test(e))&&("v6"!==t&&t||!vP.test(e)))}function DP(e,t){if(!dP.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!("object"!=typeof o||null===o||"typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&o.alg!==t)}catch{return!1}}function jP(e,t){return!(("v4"!==t&&t||!mP.test(e))&&("v6"!==t&&t||!yP.test(e)))}class OP extends oP{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==BS.string){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.string,received:t.parsedType}),YS}const t=new US;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?WS(r,{code:IS.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&WS(r,{code:IS.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)pP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"email",code:IS.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)hP||(hP=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),hP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"emoji",code:IS.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)lP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"uuid",code:IS.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)cP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"nanoid",code:IS.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)aP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"cuid",code:IS.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)iP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"cuid2",code:IS.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)sP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"ulid",code:IS.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),WS(r,{validation:"url",code:IS.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"regex",code:IS.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?MP(n).test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?kP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?wP(n).test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?uP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"duration",code:IS.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?CP(e.data,n.version)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"ip",code:IS.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?DP(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"jwt",code:IS.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?jP(e.data,n.version)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"cidr",code:IS.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?gP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"base64",code:IS.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?xP.test(e.data)||(r=this._getOrReturnCtx(e,r),WS(r,{validation:"base64url",code:IS.invalid_string,message:n.message}),t.dirty()):FS.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:IS.invalid_string,...eP.errToObj(r)})}_addCheck(e){return new OP({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...eP.errToObj(e)})}url(e){return this._addCheck({kind:"url",...eP.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...eP.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...eP.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...eP.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...eP.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...eP.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...eP.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...eP.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...eP.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...eP.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...eP.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...eP.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:(null==e?void 0:e.offset)??!1,local:(null==e?void 0:e.local)??!1,...eP.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...eP.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...eP.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...eP.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...eP.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...eP.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...eP.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...eP.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...eP.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...eP.errToObj(t)})}nonempty(e){return this.min(1,eP.errToObj(e))}trim(){return new OP({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new OP({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new OP({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function SP(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}OP.create=e=>new OP({checks:[],typeName:uE.ZodString,coerce:(null==e?void 0:e.coerce)??!1,...nP(e)});class PP extends oP{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==BS.number){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.number,received:t.parsedType}),YS}let t;const r=new US;for(const n of this._def.checks)"int"===n.kind?FS.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==SP(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.not_finite,message:n.message}),r.dirty()):FS.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,eP.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eP.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eP.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eP.toString(t))}setLimit(e,t,r,n){return new PP({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eP.toString(n)}]})}_addCheck(e){return new PP({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:eP.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:eP.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:eP.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:eP.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:eP.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eP.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:eP.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:eP.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:eP.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&FS.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}PP.create=e=>new PP({checks:[],typeName:uE.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...nP(e)});class EP extends oP{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==BS.bigint)return this._getInvalidInput(e);let t;const r=new US;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),WS(t,{code:IS.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):FS.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.bigint,received:t.parsedType}),YS}gte(e,t){return this.setLimit("min",e,!0,eP.toString(t))}gt(e,t){return this.setLimit("min",e,!1,eP.toString(t))}lte(e,t){return this.setLimit("max",e,!0,eP.toString(t))}lt(e,t){return this.setLimit("max",e,!1,eP.toString(t))}setLimit(e,t,r,n){return new EP({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:eP.toString(n)}]})}_addCheck(e){return new EP({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:eP.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:eP.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:eP.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:eP.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:eP.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}EP.create=e=>new EP({checks:[],typeName:uE.ZodBigInt,coerce:(null==e?void 0:e.coerce)??!1,...nP(e)});class TP extends oP{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==BS.boolean){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.boolean,received:t.parsedType}),YS}return KS(e.data)}}TP.create=e=>new TP({typeName:uE.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...nP(e)});class NP extends oP{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==BS.date){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.date,received:t.parsedType}),YS}if(Number.isNaN(e.data.getTime())){return WS(this._getOrReturnCtx(e),{code:IS.invalid_date}),YS}const t=new US;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),WS(r,{code:IS.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):FS.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new NP({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:eP.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:eP.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}NP.create=e=>new NP({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:uE.ZodDate,...nP(e)});class zP extends oP{_parse(e){if(this._getType(e)!==BS.symbol){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.symbol,received:t.parsedType}),YS}return KS(e.data)}}zP.create=e=>new zP({typeName:uE.ZodSymbol,...nP(e)});class AP extends oP{_parse(e){if(this._getType(e)!==BS.undefined){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.undefined,received:t.parsedType}),YS}return KS(e.data)}}AP.create=e=>new AP({typeName:uE.ZodUndefined,...nP(e)});class RP extends oP{_parse(e){if(this._getType(e)!==BS.null){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.null,received:t.parsedType}),YS}return KS(e.data)}}RP.create=e=>new RP({typeName:uE.ZodNull,...nP(e)});class FP extends oP{constructor(){super(...arguments),this._any=!0}_parse(e){return KS(e.data)}}FP.create=e=>new FP({typeName:uE.ZodAny,...nP(e)});class LP extends oP{constructor(){super(...arguments),this._unknown=!0}_parse(e){return KS(e.data)}}LP.create=e=>new LP({typeName:uE.ZodUnknown,...nP(e)});class BP extends oP{_parse(e){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.never,received:t.parsedType}),YS}}BP.create=e=>new BP({typeName:uE.ZodNever,...nP(e)});class VP extends oP{_parse(e){if(this._getType(e)!==BS.undefined){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.void,received:t.parsedType}),YS}return KS(e.data)}}VP.create=e=>new VP({typeName:uE.ZodVoid,...nP(e)});class IP extends oP{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==BS.array)return WS(t,{code:IS.invalid_type,expected:BS.array,received:t.parsedType}),YS;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(WS(t,{code:e?IS.too_big:IS.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(WS(t,{code:IS.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(WS(t,{code:IS.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new tP(t,e,t.path,r)))).then(e=>US.mergeArray(r,e));const o=[...t.data].map((e,r)=>n.type._parseSync(new tP(t,e,t.path,r)));return US.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new IP({...this._def,minLength:{value:e,message:eP.toString(t)}})}max(e,t){return new IP({...this._def,maxLength:{value:e,message:eP.toString(t)}})}length(e,t){return new IP({...this._def,exactLength:{value:e,message:eP.toString(t)}})}nonempty(e){return this.min(1,e)}}function qP(e){if(e instanceof HP){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=nE.create(qP(n))}return new HP({...e._def,shape:()=>t})}return e instanceof IP?new IP({...e._def,type:qP(e.element)}):e instanceof nE?nE.create(qP(e.unwrap())):e instanceof oE?oE.create(qP(e.unwrap())):e instanceof YP?YP.create(e.items.map(e=>qP(e))):e}IP.create=(e,t)=>new IP({type:e,minLength:null,maxLength:null,exactLength:null,typeName:uE.ZodArray,...nP(t)});class HP extends oP{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=FS.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==BS.object){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.object,received:t.parsedType}),YS}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof BP&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const i=[];for(const e of o){const t=n[e],o=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new tP(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof BP){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(WS(r,{code:IS.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new tP(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>US.mergeObjectSync(t,e)):US.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return eP.errToObj,new HP({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o;const a=(null==(o=(n=this._def).errorMap)?void 0:o.call(n,t,r).message)??r.defaultError;return"unrecognized_keys"===t.code?{message:eP.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new HP({...this._def,unknownKeys:"strip"})}passthrough(){return new HP({...this._def,unknownKeys:"passthrough"})}extend(e){return new HP({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new HP({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:uE.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new HP({...this._def,catchall:e})}pick(e){const t={};for(const r of FS.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new HP({...this._def,shape:()=>t})}omit(e){const t={};for(const r of FS.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new HP({...this._def,shape:()=>t})}deepPartial(){return qP(this)}partial(e){const t={};for(const r of FS.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new HP({...this._def,shape:()=>t})}required(e){const t={};for(const r of FS.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof nE;)e=e._def.innerType;t[r]=e}return new HP({...this._def,shape:()=>t})}keyof(){return QP(FS.objectKeys(this.shape))}}HP.create=(e,t)=>new HP({shape:()=>e,unknownKeys:"strip",catchall:BP.create(),typeName:uE.ZodObject,...nP(t)}),HP.strictCreate=(e,t)=>new HP({shape:()=>e,unknownKeys:"strict",catchall:BP.create(),typeName:uE.ZodObject,...nP(t)}),HP.lazycreate=(e,t)=>new HP({shape:e,unknownKeys:"strip",catchall:BP.create(),typeName:uE.ZodObject,...nP(t)});class $P extends oP{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new qS(e.ctx.common.issues));return WS(t,{code:IS.invalid_union,unionErrors:r}),YS});{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"===a.status&&!e&&(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map(e=>new qS(e));return WS(t,{code:IS.invalid_union,unionErrors:o}),YS}}get options(){return this._def.options}}function WP(e,t){const r=VS(e),n=VS(t);if(e===t)return{valid:!0,data:e};if(r===BS.object&&n===BS.object){const r=FS.objectKeys(t),n=FS.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(const r of n){const n=WP(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===BS.array&&n===BS.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=WP(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===BS.date&&n===BS.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}$P.create=(e,t)=>new $P({options:e,typeName:uE.ZodUnion,...nP(t)});class UP extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(GS(e)||GS(n))return YS;const o=WP(e.value,n.value);return o.valid?((XS(e)||XS(n))&&t.dirty(),{status:t.value,value:o.data}):(WS(r,{code:IS.invalid_intersection_types}),YS)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}UP.create=(e,t,r)=>new UP({left:e,right:t,typeName:uE.ZodIntersection,...nP(r)});class YP extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==BS.array)return WS(r,{code:IS.invalid_type,expected:BS.array,received:r.parsedType}),YS;if(r.data.length<this._def.items.length)return WS(r,{code:IS.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),YS;!this._def.rest&&r.data.length>this._def.items.length&&(WS(r,{code:IS.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new tP(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>US.mergeArray(t,e)):US.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new YP({...this._def,rest:e})}}YP.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new YP({items:e,typeName:uE.ZodTuple,rest:null,...nP(t)})};class ZP extends oP{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==BS.map)return WS(r,{code:IS.invalid_type,expected:BS.map,received:r.parsedType}),YS;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new tP(r,e,r.path,[a,"key"])),value:o._parse(new tP(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return YS;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return YS;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}ZP.create=(e,t,r)=>new ZP({valueType:t,keyType:e,typeName:uE.ZodMap,...nP(r)});class KP extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==BS.set)return WS(r,{code:IS.invalid_type,expected:BS.set,received:r.parsedType}),YS;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(WS(r,{code:IS.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(WS(r,{code:IS.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return YS;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>o._parse(new tP(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new KP({...this._def,minSize:{value:e,message:eP.toString(t)}})}max(e,t){return new KP({...this._def,maxSize:{value:e,message:eP.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}KP.create=(e,t)=>new KP({valueType:e,minSize:null,maxSize:null,typeName:uE.ZodSet,...nP(t)});class GP extends oP{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}GP.create=(e,t)=>new GP({getter:e,typeName:uE.ZodLazy,...nP(t)});class XP extends oP{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return WS(t,{received:t.data,code:IS.invalid_literal,expected:this._def.value}),YS}return{status:"valid",value:e.data}}get value(){return this._def.value}}function QP(e,t){return new JP({values:e,typeName:uE.ZodEnum,...nP(t)})}XP.create=(e,t)=>new XP({value:e,typeName:uE.ZodLiteral,...nP(t)});class JP extends oP{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return WS(t,{expected:FS.joinValues(r),received:t.parsedType,code:IS.invalid_type}),YS}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return WS(t,{received:t.data,code:IS.invalid_enum_value,options:r}),YS}return KS(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return JP.create(e,{...this._def,...t})}exclude(e,t=this._def){return JP.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}JP.create=QP;class eE extends oP{_parse(e){const t=FS.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==BS.string&&r.parsedType!==BS.number){const e=FS.objectValues(t);return WS(r,{expected:FS.joinValues(e),received:r.parsedType,code:IS.invalid_type}),YS}if(this._cache||(this._cache=new Set(FS.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=FS.objectValues(t);return WS(r,{received:r.data,code:IS.invalid_enum_value,options:e}),YS}return KS(e.data)}get enum(){return this._def.values}}eE.create=(e,t)=>new eE({values:e,typeName:uE.ZodNativeEnum,...nP(t)});class tE extends oP{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==BS.promise&&!1===t.common.async)return WS(t,{code:IS.invalid_type,expected:BS.promise,received:t.parsedType}),YS;const r=t.parsedType===BS.promise?t.data:Promise.resolve(t.data);return KS(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}tE.create=(e,t)=>new tE({type:e,typeName:uE.ZodPromise,...nP(t)});class rE extends oP{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===uE.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{WS(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return YS;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?YS:"dirty"===n.status||"dirty"===t.value?ZS(n.value):n});{if("aborted"===t.value)return YS;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?YS:"dirty"===n.status||"dirty"===t.value?ZS(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?YS:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?YS:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!QS(e))return YS;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>QS(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):YS)}FS.assertNever(n)}}rE.create=(e,t,r)=>new rE({schema:e,typeName:uE.ZodEffects,effect:t,...nP(r)}),rE.createWithPreprocess=(e,t,r)=>new rE({schema:t,effect:{type:"preprocess",transform:e},typeName:uE.ZodEffects,...nP(r)});class nE extends oP{_parse(e){return this._getType(e)===BS.undefined?KS(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nE.create=(e,t)=>new nE({innerType:e,typeName:uE.ZodOptional,...nP(t)});class oE extends oP{_parse(e){return this._getType(e)===BS.null?KS(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}oE.create=(e,t)=>new oE({innerType:e,typeName:uE.ZodNullable,...nP(t)});class aE extends oP{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===BS.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}aE.create=(e,t)=>new aE({innerType:e,typeName:uE.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...nP(t)});class iE extends oP{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return JS(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new qS(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new qS(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}iE.create=(e,t)=>new iE({innerType:e,typeName:uE.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...nP(t)});class sE extends oP{_parse(e){if(this._getType(e)!==BS.nan){const t=this._getOrReturnCtx(e);return WS(t,{code:IS.invalid_type,expected:BS.nan,received:t.parsedType}),YS}return{status:"valid",value:e.data}}}sE.create=e=>new sE({typeName:uE.ZodNaN,...nP(e)});class lE extends oP{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class cE extends oP{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?YS:"dirty"===e.status?(t.dirty(),ZS(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?YS:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new cE({in:e,out:t,typeName:uE.ZodPipeline})}}class dE extends oP{_parse(e){const t=this._def.innerType._parse(e),r=e=>(QS(e)&&(e.value=Object.freeze(e.value)),e);return JS(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var uE;dE.create=(e,t)=>new dE({innerType:e,typeName:uE.ZodReadonly,...nP(t)}),function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(uE||(uE={}));const pE=OP.create,hE=TP.create,fE=NP.create;BP.create;const mE=IP.create,vE=HP.create;$P.create,UP.create,YP.create;const yE=JP.create;tE.create,nE.create,oE.create;const gE=yE(["daily","weekly","monthly"]),xE=e=>vE({id:pE().optional(),title:pE().min(1,e.validations.eventNameRequired),description:pE().optional(),startDate:fE(),endDate:fE(),startTime:pE().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),endTime:pE().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),color:pE().min(1,e.validations.colorRequired),isRepeating:hE(),isRepeatingInterval:gE.default("daily").optional(),isRepeatingExcludedDates:mE(fE()).optional()}).refine(e=>{const t=new Date(`${e.startDate.toDateString()} ${e.startTime}`),r=new Date(`${e.endDate.toDateString()} ${e.endTime}`);if(e.isRepeating){const t=new Date(`2000-01-01 ${e.startTime}`);return new Date(`2000-01-01 ${e.endTime}`)>=t}return r>t},{message:e.validations.endTimeBeforeStart,path:["endTime"]}),bE=({event:e,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,open:l,dateFromViewClick:c,translations:d})=>{const[u,p]=r.useState(!1),[h,f]=r.useState(!1),[m,v]=r.useState(!1),[y,g]=r.useState(!1),[x,b]=r.useState(!1),[k,_]=r.useState("single"),[w,M]=r.useState("all"),[C,D]=r.useState(!1),j=function(e={}){const t=r.useRef(void 0),n=r.useRef(void 0),[o,a]=r.useState({isDirty:!1,isValidating:!1,isLoading:vw(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:vw(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!vw(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...n}=Yw(e);t.current={...n,formState:o}}const i=t.current.control;return i._options=e,ow(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),r.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),r.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),r.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),r.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),r.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==o.isDirty&&i._subjects.state.next({isDirty:e})}},[i,o.isDirty]),r.useEffect(()=>{e.values&&!hw(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,a(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),r.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=nw(o,i),t.current}({resolver:Jw(xE(d)),defaultValues:{id:(null==e?void 0:e.id)||"",title:(null==e?void 0:e.title)||"",description:(null==e?void 0:e.description)||"",startDate:(null==e?void 0:e.startDate)||new Date,endDate:(null==e?void 0:e.endDate)||new Date,startTime:(null==e?void 0:e.startTime)||"09:00",endTime:(null==e?void 0:e.endTime)||"10:00",color:(null==e?void 0:e.color)||"blue",isRepeating:(null==e?void 0:e.isRepeating)||!1,isRepeatingInterval:(null==e?void 0:e.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==e?void 0:e.isRepeatingExcludedDates)||[]}});if(r.useEffect(()=>{const e=j.getValues("startDate"),t=j.getValues("endDate"),r=e.toDateString()===t.toDateString();f(!r)},[j,l]),r.useEffect(()=>{j.reset({title:(null==e?void 0:e.title)||"",description:(null==e?void 0:e.description)||"",startDate:(null==e?void 0:e.startDate)||new Date,endDate:(null==e?void 0:e.endDate)||new Date,startTime:(null==e?void 0:e.startTime)||"09:00",endTime:(null==e?void 0:e.endTime)||"10:00",color:(null==e?void 0:e.color)||"blue",isRepeating:(null==e?void 0:e.isRepeating)||!1,isRepeatingInterval:(null==e?void 0:e.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==e?void 0:e.isRepeatingExcludedDates)||[]})},[j,l,e]),r.useEffect(()=>{const e=j.watch((e,{name:t})=>{if("startDate"===t||"endDate"===t){const t=e.startDate,r=e.endDate;t>r&&j.setValue("endDate",t);const n=t.toDateString()===r.toDateString();f(!n),n&&j.setValue("isRepeating",!1)}});return()=>e.unsubscribe()},[j]),!d)return console.error("Translations are required for PopupContent"),null;const O=async t=>{var r;p(!0);try{if(null==e||!e.id){const e={startDate:t.startDate,endDate:t.endDate,title:t.title,startTime:t.startTime,endTime:t.endTime,description:t.description,color:t.color,isRepeating:t.isRepeating,isRepeatingInterval:t.isRepeatingInterval||"daily",isRepeatingExcludedDates:t.isRepeatingExcludedDates||[]};return void await Promise.resolve(n(e))}if(!0!==e.isRepeating){console.log("Updating non-repeating event");const r={...e,startDate:t.startDate,endDate:t.endDate,title:t.title,startTime:t.startTime,endTime:t.endTime,description:t.description,color:t.color,isRepeating:t.isRepeating,isRepeatingInterval:t.isRepeatingInterval||"daily",isRepeatingExcludedDates:t.isRepeatingExcludedDates||[]};return void(o&&await Promise.resolve(o(r)))}const a=c||e.startDate||new Date;switch(w){case"single":{const r=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=(e.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),s=r.toDateString();if(!i.some(e=>e.toDateString()===s)){const t={...e,isRepeatingExcludedDates:[...i,r]};o&&await Promise.resolve(o(t))}const l={title:t.title,description:t.description,startDate:r,endDate:r,startTime:t.startTime,endTime:t.endTime,color:t.color,isRepeating:!1,isRepeatingInterval:"daily",isRepeatingExcludedDates:[]};await Promise.resolve(n(l));break}case"future":if(a.toDateString()===(null==(r=e.startDate)?void 0:r.toDateString())){const r={...e,...t};o&&await Promise.resolve(o(r))}else{const r=new Date(a);r.setDate(r.getDate()-1);const i={...e,endDate:r};o&&await Promise.resolve(o(i));const s={title:t.title,description:t.description,startDate:a,endDate:t.endDate,startTime:t.startTime,endTime:t.endTime,color:t.color,isRepeating:!0,isRepeatingInterval:t.isRepeatingInterval||"daily",isRepeatingExcludedDates:t.isRepeatingExcludedDates||[]};await Promise.resolve(n(s))}break;case"all":{const r={...e,...t};o&&await Promise.resolve(o(r));break}}}catch(e){console.error("Error saving event:",e),v_.error("Error saving event")}finally{p(!1),null==i||i()}};return t.jsxs(dk,{className:"sm:max-w-[425px] w-full max-h-[90vh] overflow-y-auto",children:[t.jsxs(uk,{children:[t.jsxs(hk,{className:"text-lg sm:text-xl flex items-center",children:[t.jsx(pt,{className:"mr-2 h-5 w-5"}),null!=e&&e.id?d.editEvent:d.addEvent]}),t.jsx(fk,{className:"text-sm sm:text-base",children:null!=e&&e.id?d.editEventDescription:d.createEventDescription})]}),t.jsxs(ID,{...j,children:[t.jsx(RS,{open:C,onClose:()=>D(!1),editType:w,onEditTypeChange:e=>M(e),onConfirm:()=>{D(!1),j.handleSubmit(O)()},translations:d}),t.jsxs("form",{onSubmit:t=>{var r,n,o,a;if(t.preventDefault(),null!=e&&e.id&&!0===e.isRepeating){const t=j.getValues(),i=(null==(r=t.startDate)?void 0:r.getTime())!==(null==(n=e.startDate)?void 0:n.getTime()),s=(null==(o=t.endDate)?void 0:o.getTime())!==(null==(a=e.endDate)?void 0:a.getTime()),l=t.isRepeating!==e.isRepeating,c=t.isRepeatingInterval!==(e.isRepeatingInterval||"daily"),d=t.isRepeatingExcludedDates||[],u=e.isRepeatingExcludedDates||[],p=JSON.stringify(d),h=JSON.stringify(u);if(!(i||s||l||c||p!==h||C||t.title===e.title&&t.description===e.description&&t.color===e.color&&t.startTime===e.startTime&&t.endTime===e.endTime))return void D(!0)}j.handleSubmit(O)(t)},className:"space-y-4",children:[t.jsx(HD,{control:j.control,name:"title",render:({field:r})=>t.jsxs(UD,{children:[t.jsx(YD,{children:d.eventTitle}),t.jsx(ZD,{children:t.jsx(r_,{placeholder:d.eventTitle,...r,autoFocus:!e})}),t.jsx(GD,{})]})}),t.jsx(HD,{control:j.control,name:"description",render:({field:e})=>t.jsxs(UD,{children:[t.jsx(YD,{children:d.eventDescription}),t.jsx(ZD,{children:t.jsx(XD,{placeholder:d.eventDescription,...e})}),t.jsx(GD,{})]})}),t.jsx(Uj,{form:j,translations:d}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(HD,{control:j.control,name:"startDate",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventDate}),t.jsxs(Kk,{open:m,onOpenChange:v,children:[t.jsx(Gk,{asChild:!0,children:t.jsx(ZD,{children:t.jsxs(Ir,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),e.value?Te(e.value,"PPP"):t.jsx("span",{children:d.pickADate})]})})}),t.jsx(Xk,{className:"w-auto p-0",children:t.jsx(MC,{mode:"single",selected:e.value,onSelect:t=>{e.onChange(t),v(!1)},defaultMonth:e.value||new Date})})]}),t.jsx(GD,{})]})}),t.jsx(HD,{control:j.control,name:"startTime",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventStartTime}),t.jsx(ZD,{children:t.jsx(QD,{value:e.value,onChange:e.onChange})}),t.jsx(GD,{})]})})]}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(HD,{control:j.control,name:"endDate",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventEndDate}),t.jsxs(Kk,{open:y,onOpenChange:g,children:[t.jsx(Gk,{asChild:!0,children:t.jsx(ZD,{children:t.jsxs(Ir,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(ut,{className:"mr-2 h-4 w-4"}),e.value?Te(e.value,"PPP"):t.jsx("span",{children:d.pickADate})]})})}),t.jsx(Xk,{className:"w-auto p-0",children:t.jsx(MC,{mode:"single",selected:e.value,onSelect:t=>{if(!t)return;const r=j.getValues("startDate"),n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate());o>n?(e.onChange(t),g(!1)):o<n?v_.error(d.errorEndDateBeforeStart):(e.onChange(t),g(!1))},fromDate:j.getValues("startDate"),defaultMonth:e.value||new Date})})]}),t.jsx(GD,{})]})}),t.jsx(HD,{control:j.control,name:"endTime",render:({field:e})=>t.jsxs(UD,{className:"flex-1",children:[t.jsx(YD,{children:d.eventEndTime}),t.jsx(ZD,{children:t.jsx(QD,{value:e.value,onChange:e.onChange})}),t.jsx(GD,{})]})})]}),t.jsx(tn,{children:t.jsx(AS,{form:j,translations:d,showRepeatToggle:h})}),t.jsx(HD,{control:j.control,name:"color",render:({field:e})=>t.jsxs(UD,{children:[t.jsx(YD,{children:d.eventColor}),t.jsxs(MS,{onValueChange:e.onChange,defaultValue:e.value,children:[t.jsx(ZD,{children:t.jsx(DS,{children:t.jsx(CS,{placeholder:d.selectAColor})})}),t.jsx(SS,{children:s.map(e=>t.jsx(ES,{value:e.value,children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value))})]}),t.jsx(GD,{})]})}),t.jsxs(pk,{className:"flex flex-col space-y-3 sm:space-y-0 sm:flex-row sm:justify-between items-center w-full",children:[(null==e?void 0:e.id)&&t.jsx("div",{className:"w-full sm:w-auto",children:t.jsxs(QC,{children:[t.jsx(JC,{asChild:!0,children:t.jsx(Ir,{disabled:x,type:"button",variant:"destructive",size:"sm",className:"w-full gap-1 h-10 sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 text-xs sm:text-sm",children:x?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{className:"h-4 w-4 animate-spin"}),d.deleting]}):t.jsxs(t.Fragment,{children:[t.jsx(Nt,{className:"h-4 w-4"}),d.delete]})})}),t.jsxs(rD,{className:"max-w-[425px]",children:[t.jsxs(nD,{children:[t.jsxs(aD,{className:"flex items-center",children:[t.jsx(bt,{className:"mr-2 h-5 w-5 text-red-500"}),null!=e&&e.isRepeating?d.repeatEventDeleteTitle:d.confirmDelete]}),t.jsx(iD,{className:"text-left",children:null!=e&&e.isRepeating?d.repeatEventDeleteDescription:d.confirmDeleteDescription}),t.jsx("div",{className:"h-2"}),(null==e?void 0:e.isRepeating)&&t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(AD,{defaultValue:"single",onValueChange:e=>_(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:d.deleteThisOccurrence,description:d.deleteThisOccurrenceDescription},{value:"future",label:d.deleteThisAndFuture,description:d.deleteThisAndFutureDescription},{value:"all",label:d.deleteAllOccurrences,description:d.deleteAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(RD,{value:e.value,id:e.value}),t.jsxs(VD,{htmlFor:e.value,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(oD,{children:[t.jsx(lD,{children:d.cancel}),t.jsxs(sD,{onClick:async()=>{var t;if(null==e||!e.id)throw Error("Missing Event Id");b(!0);try{const r=c||e.startDate||new Date;if(!e.isRepeating||"all"===k)return void(a&&await Promise.resolve(a(e.id)));if("single"===k){const t=new Date(r.getFullYear(),r.getMonth(),r.getDate()),n=(e.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),a=t.toDateString(),i=n.some(e=>e.toDateString()===a)?n:[...n,t],s={...e,id:e.id,isRepeatingExcludedDates:i};o&&await Promise.resolve(o(s))}else if("future"===k)if(r.toDateString()===(null==(t=e.startDate)?void 0:t.toDateString()))a&&await Promise.resolve(a(e.id));else{const t=new Date(r);t.setDate(t.getDate()-1);const n={...e,id:e.id,endDate:t};o&&await Promise.resolve(o(n))}}finally{b(!1),null==i||i()}},className:"w-full sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 sm:text-sm dark:text-white",children:[t.jsx(Nt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),d.delete]})]})]})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 w-full",children:[t.jsx(Ir,{type:"button",variant:"outline",onClick:i,className:"w-full sm:w-1/2 text-xs sm:text-sm",children:d.cancel}),t.jsx(Ir,{type:"submit",className:"w-full sm:w-1/2 text-xs sm:text-sm",disabled:u,children:u?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{className:"h-4 w-4 animate-spin"}),d.saving]}):d.save})]})]})]})]})]})},kE=({translations:e,children:r,isDisabled:n=!1})=>r?t.jsx(sk,{asChild:!0,disabled:n,children:r}):t.jsx(sk,{asChild:!0,children:t.jsxs(Ir,{variant:"default",size:"sm",className:"w-full gap-0 sm:w-auto text-xs sm:text-sm",disabled:n,children:[t.jsx(pt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),e.addEvent]})}),_E=({event:e,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,onOpenChange:s,dateFromViewClick:l,children:c,isDisabled:d=!1,translations:u})=>{const[p,h]=r.useState(!1),f=e=>{d||(h(e),null==s||s(e),e||null==i||i())};return t.jsxs(ik,{open:p,onOpenChange:f,children:[t.jsx(kE,{translations:u,isDisabled:d,children:c}),t.jsx(bE,{event:e,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:()=>f(!1),dateFromViewClick:l,open:p,translations:u})]})},wE=({currentDate:e,currentView:n,handlePrevious:o,handleNext:a,handleTodayClick:i,toggleTimeFormat:s,setCurrentView:l,isTimeFormatChanging:c,use24HourFormat:d,lastUpdated:u,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y,onEventAdd:g,onEventDelete:x,isListView:b,setIsListView:k,selectedColors:_,setSelectedColors:w})=>{const[M,C]=r.useState(!1);(({handleNext:e,handlePrevious:t})=>{const[n,o]=r.useState(0),[a,i]=r.useState(!1);r.useEffect(()=>{const r=r=>{if("ArrowLeft"===r.key||"ArrowRight"===r.key){r.preventDefault();const s=Date.now();!a&&s-n>200&&(i(!0),o(s),"ArrowLeft"===r.key?t():e())}},s=e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&i(!1)};return window.addEventListener("keydown",r),window.addEventListener("keyup",s),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",s)}},[e,t,a,n])})({handleNext:a,handlePrevious:o});const D=[{value:"day",label:y.localization.day,icon:St},{value:"week",label:y.localization.week,icon:Mt},{value:"month",label:y.localization.month,icon:Dt},{value:"year",label:y.localization.year,icon:jt}];return t.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center mb-4 space-y-4 sm:space-y-0",children:[t.jsx(o_,{currentDate:e,currentView:n,handlePrevious:o,handleNext:a,lastUpdated:u,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 w-full sm:w-auto",children:[t.jsx(Hd,{is24HourFormat:d,isTimeFormatChanging:c,toggleTimeFormat:s}),t.jsx(vy,{isFilterOpen:M,setIsFilterOpen:C,selectedColors:_,toggleColorSelection:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},currentConfig:y}),t.jsx(yy,{handleTodayClick:i,isTodayDisabled:(()=>{const t=new Date;switch(n){case"day":return L(e,t);case"week":return L(O(e,{weekStartsOn:d?1:0}),O(t,{weekStartsOn:d?1:0}));case"month":return Le(e,t);case"year":return e.getFullYear()===t.getFullYear();default:return!1}})(),getTodayButtonText:()=>{switch(n){case"day":default:return y.localization.today;case"week":return y.localization.thisWeek;case"month":return y.localization.thisMonth;case"year":return y.localization.thisYear}}}),t.jsx(Qy,{isListView:b,setIsListView:k,currentConfig:y}),t.jsx(Jy,{currentView:n,setCurrentView:l,viewOptions:D,currentConfig:y}),t.jsx(_E,{translations:y.localization,event:(()=>{switch(n){case"day":default:return{startDate:e,endDate:e};case"week":return{startDate:O(e,{weekStartsOn:d?1:0}),endDate:K(e,{weekStartsOn:d?1:0})}}})(),onAddEvent:g,onDeleteEvent:x})]})]})},ME=({currentView:e,currentDate:t,onDateRangeChange:n,is24HourFormat:o})=>{const a=r.useRef(t),i=r.useRef(e),s=r.useCallback(()=>{let r,n;switch(e){case"day":default:r=E(t),n=H(t);break;case"week":r=O(t,{weekStartsOn:o?1:0}),n=K(t,{weekStartsOn:o?1:0});break;case"month":r=U(t),n=$(t);break;case"year":r=Z(t),n=Y(t)}return{startDate:r,endDate:n}},[e,t,o]),l=r.useCallback(()=>{if(e!==i.current)return!0;const r=a.current;switch(e){case"day":return!L(t,r);case"week":return!function(e,t,r){return+O(e,r)==+O(t,r)}(t,r,{weekStartsOn:o?1:0});case"month":return!Le(t,r);case"year":return!Be(t,r);default:return!0}},[e,t,o]);r.useEffect(()=>{(async()=>{if(n&&l()){const{startDate:r,endDate:o}=s();await n(r,o),a.current=t,i.current=e}})()},[e,t,n,s,l])},CE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));CE.displayName="Card";const DE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("flex flex-col space-y-1.5 p-6",e),...r}));DE.displayName="CardHeader";const jE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("text-2xl font-semibold leading-none tracking-tight",e),...r}));jE.displayName="CardTitle";const OE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("text-sm text-muted-foreground",e),...r}));OE.displayName="CardDescription";const SE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("p-6 pt-0",e),...r}));SE.displayName="CardContent";const PE=a.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:Br("flex items-center p-6 pt-0",e),...r}));PE.displayName="CardFooter";var EE="ScrollArea",[TE,NE]=Wd(EE),[zE,AE]=TE(EE),RE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:i,scrollHideDelay:s=600,...l}=e,[c,d]=a.useState(null),[u,p]=a.useState(null),[h,f]=a.useState(null),[m,v]=a.useState(null),[y,g]=a.useState(null),[x,b]=a.useState(0),[k,_]=a.useState(0),[w,M]=a.useState(!1),[C,D]=a.useState(!1),j=Ft(r,e=>d(e)),O=eu(i);return t.jsx(zE,{scope:n,type:o,dir:O,scrollHideDelay:s,scrollArea:c,viewport:u,onViewportChange:p,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:w,onScrollbarXEnabledChange:M,scrollbarY:y,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:D,onCornerWidthChange:b,onCornerHeightChange:_,children:t.jsx(Gd.div,{dir:O,...l,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});RE.displayName=EE;var FE="ScrollAreaViewport",LE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,children:o,nonce:i,...s}=e,l=AE(FE,n),c=Ft(r,a.useRef(null),l.onViewportChange);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),t.jsx(Gd.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:t.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});LE.displayName=FE;var BE="ScrollAreaScrollbar",VE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=AE(BE,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=i,c="horizontal"===e.orientation;return a.useEffect(()=>(c?s(!0):l(!0),()=>{c?s(!1):l(!1)}),[c,s,l]),"hover"===i.type?t.jsx(IE,{...o,ref:r,forceMount:n}):"scroll"===i.type?t.jsx(qE,{...o,ref:r,forceMount:n}):"auto"===i.type?t.jsx(HE,{...o,ref:r,forceMount:n}):"always"===i.type?t.jsx($E,{...o,ref:r}):null});VE.displayName=BE;var IE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=AE(BE,e.__scopeScrollArea),[s,l]=a.useState(!1);return a.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),t.jsx(Hh,{present:n||s,children:t.jsx(HE,{"data-state":s?"visible":"hidden",...o,ref:r})})}),qE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=AE(BE,e.__scopeScrollArea),s="horizontal"===e.orientation,l=cT(()=>d("SCROLL_END"),100),[c,d]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,i.scrollHideDelay,d]),a.useEffect(()=>{const e=i.viewport,t=s?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(d("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,s,d,l]),t.jsx(Hh,{present:n||"hidden"!==c,children:t.jsx($E,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:$d(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:$d(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),HE=a.forwardRef((e,r)=>{const n=AE(BE,e.__scopeScrollArea),{forceMount:o,...i}=e,[s,l]=a.useState(!1),c="horizontal"===e.orientation,d=cT(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return dT(n.viewport,d),dT(n.content,d),t.jsx(Hh,{present:o||s,children:t.jsx($E,{"data-state":s?"visible":"hidden",...i,ref:r})})}),$E=a.forwardRef((e,r)=>{const{orientation:n="vertical",...o}=e,i=AE(BE,e.__scopeScrollArea),s=a.useRef(null),l=a.useRef(0),[c,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=nT(c.viewport,c.content),p={...o,sizes:c,onSizesChange:d,hasThumb:u>0&&u<1,onThumbChange:e=>s.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,r,n="ltr"){const o=oT(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return iT([l,c],u)(e)}(e,l.current,c,t)}return"horizontal"===n?t.jsx(WE,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=aT(i.viewport.scrollLeft,c,i.dir);s.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=h(e,i.dir))}}):"vertical"===n?t.jsx(UE,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&s.current){const e=aT(i.viewport.scrollTop,c);s.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=h(e))}}):null}),WE=a.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...i}=e,s=AE(BE,e.__scopeScrollArea),[l,c]=a.useState(),d=a.useRef(null),u=Ft(r,d,s.onScrollbarXChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),t.jsx(KE,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":oT(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(s.viewport){const n=s.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),sT(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:rT(l.paddingLeft),paddingEnd:rT(l.paddingRight)}})}})}),UE=a.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...i}=e,s=AE(BE,e.__scopeScrollArea),[l,c]=a.useState(),d=a.useRef(null),u=Ft(r,d,s.onScrollbarYChange);return a.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),t.jsx(KE,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":oT(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(s.viewport){const n=s.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),sT(n,r)&&t.preventDefault()}},onResize:()=>{d.current&&s.viewport&&l&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:rT(l.paddingTop),paddingEnd:rT(l.paddingBottom)}})}})}),[YE,ZE]=TE(BE),KE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:i,onThumbChange:s,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:h,...f}=e,m=AE(BE,n),[v,y]=a.useState(null),g=Ft(r,e=>y(e)),x=a.useRef(null),b=a.useRef(""),k=m.viewport,_=o.content-o.viewport,w=tu(p),M=tu(d),C=cT(h,10);function D(e){if(x.current){const t=e.clientX-x.current.left,r=e.clientY-x.current.top;u({x:t,y:r})}}return a.useEffect(()=>{const e=e=>{const t=e.target;(null==v?void 0:v.contains(t))&&w(e,_)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[k,v,_,w]),a.useEffect(M,[o,M]),dT(v,C),dT(m.content,C),t.jsx(YE,{scope:n,scrollbar:v,hasThumb:i,onThumbChange:tu(s),onThumbPointerUp:tu(l),onThumbPositionChange:M,onThumbPointerDown:tu(c),children:t.jsx(Gd.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:$d(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),x.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),D(e))}),onPointerMove:$d(e.onPointerMove,D),onPointerUp:$d(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),GE="ScrollAreaThumb",XE=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=ZE(GE,e.__scopeScrollArea);return t.jsx(Hh,{present:n||a.hasThumb,children:t.jsx(QE,{ref:r,...o})})}),QE=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,style:o,...i}=e,s=AE(GE,n),l=ZE(GE,n),{onThumbPositionChange:c}=l,d=Ft(r,e=>l.onThumbChange(e)),u=a.useRef(void 0),p=cT(()=>{u.current&&(u.current(),u.current=void 0)},100);return a.useEffect(()=>{const e=s.viewport;if(e){const t=()=>{if(p(),!u.current){const t=lT(e,c);u.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[s.viewport,p,c]),t.jsx(Gd.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:$d(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:$d(e.onPointerUp,l.onThumbPointerUp)})});XE.displayName=GE;var JE="ScrollAreaCorner",eT=a.forwardRef((e,r)=>{const n=AE(JE,e.__scopeScrollArea),o=!(!n.scrollbarX||!n.scrollbarY);return"scroll"!==n.type&&o?t.jsx(tT,{...e,ref:r}):null});eT.displayName=JE;var tT=a.forwardRef((e,r)=>{const{__scopeScrollArea:n,...o}=e,i=AE(JE,n),[s,l]=a.useState(0),[c,d]=a.useState(0),u=!(!s||!c);return dT(i.scrollbarX,()=>{var e;const t=(null==(e=i.scrollbarX)?void 0:e.offsetHeight)||0;i.onCornerHeightChange(t),d(t)}),dT(i.scrollbarY,()=>{var e;const t=(null==(e=i.scrollbarY)?void 0:e.offsetWidth)||0;i.onCornerWidthChange(t),l(t)}),u?t.jsx(Gd.div,{...o,ref:r,style:{width:s,height:c,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}}):null});function rT(e){return e?parseInt(e,10):0}function nT(e,t){const r=e/t;return isNaN(r)?0:r}function oT(e){const t=nT(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function aT(e,t,r="ltr"){const n=oT(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=iO(e,"ltr"===r?[0,i]:[-1*i,0]);return iT([0,i],[0,s])(l)}function iT(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function sT(e,t){return e>0&&e<t}var lT=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function cT(e,t){const r=tu(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function dT(e,t){const r=tu(t);Yd(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var uT=RE,pT=LE,hT=eT;const fT=a.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(uT,{ref:o,className:Br("relative overflow-hidden",e),...n,children:[t.jsx(pT,{className:"h-full w-full rounded-[inherit]",children:r}),t.jsx(mT,{}),t.jsx(hT,{})]}));fT.displayName=uT.displayName;const mT=a.forwardRef(({className:e,orientation:r="vertical",...n},o)=>t.jsx(VE,{ref:o,orientation:r,className:Br("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:t.jsx(XE,{className:"relative flex-1 rounded-full bg-border"})}));mT.displayName=VE.displayName;const vT=(e,t)=>{const[r,n]=e.split(":").map(Number),o=Qe(Je(new Date,n),r);return t?Te(o,"HH:mm"):Te(o,"h:mm").toLowerCase()+Te(o,"a").toLowerCase()},yT=(e,t,r)=>r?Te(Qe(e,t),"HH:mm"):Te(Qe(e,t),"h a").toLowerCase(),gT=e=>{const t=s.find(t=>t.value===e);return t?t.class:s[0].class},xT=({className:e,style:r})=>t.jsx(qd.div,{className:Br("bg-gray-50 dark:bg-transparent rounded-md overflow-hidden relative",e),style:r,initial:{opacity:.4},animate:{opacity:[.4,.5,.4]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-gray-200 dark:via-muted-foreground to-transparent skeleton-shimmer"})}),bT=({filteredEvents:e,currentDate:r,hoverLineRef:n,hoverTimeRef:o,setClickedTime:a,currentConfig:i,isAddEventPopupOpen:s,onEventAdd:l,onEventUpdate:c,onEventDelete:d,is24HourFormat:u,clickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isLoading:m,setIsAddEventPopupOpen:v,onDateRangeChange:y})=>{var g,x;const b=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,r)))&&NS(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Ve(r,{start:E(e.startDate),end:H(e.endDate)}):L(e.startDate,r)),k=Array.from({length:24},(e,t)=>t),_=(e,t)=>{if(e.isRepeating){const r=`${vT(e.startTime,u)} - ${vT(e.endTime,u)}`,n=Te(e.startDate,"MMM d"),o=Te(e.endDate||e.startDate,"MMM d"),a=Te(t,"EEEE"),s=Te(t,"do");switch(e.isRepeatingInterval||"daily"){case"daily":default:return i.localization.repeatDailyDescription.replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"weekly":return i.localization.repeatWeeklyDescription.replace("{dayName}",a).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"monthly":return i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",s).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o)}}else if(e.endDate&&!L(e.startDate,e.endDate)){const r=Math.floor(I(H(e.endDate),E(e.startDate)))+1,n=Math.floor(I(E(t),E(e.startDate)))+1;return i.localization.dayXofY.replace("{x}",n.toString()).replace("{y}",r.toString())}return null},w=b.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!L(t.startDate,t.endDate);return t.isRepeating?n?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):o?L(t.startDate,r)?e.multiDayEvents.push({...t,isStart:!0}):L(t.endDate,r)?e.multiDayEvents.push({...t,isEnd:!0}):e.multiDayEvents.push({...t,isMiddle:!0}):n?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),M=[...w.repeatingFullDayEvents,...w.multiDayEvents,...w.fullDayEvents],D=w.regularEvents,{sortedEvents:j,eventPositions:O,maxColumn:S}=(e=>{const t=e.sort((e,t)=>{const n=qe(`${Te(r,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(r,"yyyy-MM-dd")}T${t.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,t)=>{const n=qe(`${Te(r,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(r,"yyyy-MM-dd")}T${e.endTime}`),a=qe(`${Te(r,"yyyy-MM-dd")}T${t.startTime}`);return n<qe(`${Te(r,"yyyy-MM-dd")}T${t.endTime}`)&&a<o};return t.forEach((e,r)=>{let i=0,s=!1;for(let o=0;o<r;o++)a(e,t[o])&&(i=Math.max(i,n[t[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(t.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:t,eventPositions:n,maxColumn:1}):(t.forEach(e=>{if(n[e.id].column<o){let r=1;for(;r+n[e.id].column<=o&&!t.some(t=>n[t.id].column===n[e.id].column+r&&a(e,t));)r++;n[e.id].span=r}}),{sortedEvents:t,eventPositions:n,maxColumn:o+1})})(D),P=({event:e,currentDate:r})=>t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})(),"min-h-[44px]"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs font-medium",children:[vT(e.startTime,u)," - ",vT(e.endTime,u)]})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),T=({event:e,currentDate:r})=>t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]",e.isStart&&["border-l-4","border-l-black/70 dark:border-l-white/50"],e.isEnd&&["border-r-4","border-r-black/70 dark:border-r-white/50"],e.isMiddle&&"border-x-0"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:e.isStart?`${i.localization.starts}: ${vT(e.startTime,u)}`:e.isEnd?`${i.localization.ends}: ${vT(e.endTime,u)}`:i.localization.allDay})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),N=({event:e})=>t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]","border-l-4 border-r-4","border-black/70 dark:border-white/50"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:i.localization.allDay})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),z=({event:e,currentDate:r,index:n})=>e.isRepeating?t.jsx(P,{event:e,currentDate:r,index:n}):e.endDate&&!L(e.startDate,e.endDate)?t.jsx(T,{event:e,currentDate:r,index:n}):t.jsx(N,{event:e,index:n});return t.jsxs(CE,{className:"pb-4 pl-4 pr-4",children:[t.jsxs("div",{className:"sticky top-0 bg-background z-20 pt-4 pb-1",children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:`${i.localization.monthNames[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}),M.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsxs("h3",{className:"text-sm font-semibold mb-2",children:[i.localization.fullDayEvents," (",M.length,")"]}),M.map((e,n)=>t.jsx(qd.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*n},className:"space-y-2 mb-1",children:t.jsx(z,{event:e,currentDate:r,index:n},e.id)},e.id))]})]}),t.jsx(fT,{className:"px-4 h-[570px]",children:t.jsxs("div",{className:"relative mt-2 mb-2",children:[t.jsx("div",{className:"absolute left-0 w-16 z-10 bg-background",children:t.jsx(_E,{translations:i.localization,onAddEvent:l,event:{startDate:r,endDate:r,startTime:p||Te(new Date,"HH:mm"),endTime:p?C(qe(`2000-01-01T${p}`),1).toTimeString().slice(0,5):Te(C(new Date,1),"HH:mm")},children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top;let a,i,s;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);a=Math.floor(e/60),i=e%60,s=e/60*64}else a=Math.floor(r/64),i=Math.floor(r%64/64*60),s=r;const l=`${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`;n.current&&(n.current.style.top=`${s}px`,n.current.style.display="block"),o.current&&(o.current.textContent=l)},onMouseLeave:()=>{n.current&&(n.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),i=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;a(i)},children:k.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-right text-sm text-muted-foreground",children:yT(r,e,u)},`hour-${e}`))})})}),t.jsxs("div",{className:"ml-16 relative",onDoubleClick:e=>{if(s||!i.dayView.enableDoubleClickToAddEvent)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientY-t.top,o=Math.floor(n/(16/15)),a=Math.floor(o/60),c=o%60,d=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,u=`${(a+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;l({title:"",startDate:r,endDate:r,startTime:d,endTime:u,color:"blue",isRepeating:!1})},children:[k.map(e=>t.jsx("div",{className:"h-16 border-t border-border"},e)),!(null!=(g=i.dayView)&&g.hideHoverLine)&&t.jsx("div",{ref:n,className:"absolute left-0 right-0 h-px bg-primary z-40 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:o,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),L(r,new Date)&&!(null!=(x=i.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 z-30 pointer-events-none",style:{top:`${f}px`},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Te(new Date,"HH:mm")})}),m&&y&&Array.from({length:10}).map((e,r)=>t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),j.map((e,n)=>{const o=qe(`${Te(r,"yyyy-MM-dd")}T${e.startTime}`),a=qe(`${Te(r,"yyyy-MM-dd")}T${e.endTime}`),s=60*o.getHours()+o.getMinutes(),p=60*a.getHours()+a.getMinutes()-s,{column:h,span:f}=O[e.id],m=f/S*100,y=h/S*100,g=_(e,r);return t.jsx(_E,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:d,onOpenChange:v,dateFromViewClick:r,translations:i.localization,children:t.jsxs(qd.div,{className:Br(gT(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return"";switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})()),style:{top:s*(16/15)+"px",height:`${Math.max(p*(16/15),24)}px`,left:`${y}%`,width:`${m}%`,zIndex:n+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*n},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||i.localization.untitledEvent}),t.jsxs("div",{className:"text-xs",children:[vT(e.startTime,u)," - ",vT(e.endTime,u)]}),e.description&&t.jsx("div",{className:"text-xs font-semibold truncate",children:e.description}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${e.id}-${e.startTime}`)})]})]})})]})},kT=({events:e,date:n,addEvent:o,updateEvent:a,getEventColor:i,onDelete:s,children:l,onOpenChange:c,preSelectedColor:d,is24HourFormat:u,translations:p})=>{const[h,f]=r.useState(null),[m,v]=r.useState(!1),y=e=>{h&&(a(e),f(null))},g=e=>{const t=e.endDate&&!L(e.startDate,e.endDate),r=L(e.startDate,n),o=e.endDate&&L(e.endDate,n),a=t&&!r&&!o,s=e.isRepeating?Br("border-2 dark:border border-dashed border-opacity-50",r&&"border-l-solid border-l-2 border-l-black/90 dark:border-l-white/50",o&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",a&&"border-x-0"):Br(r&&"border-l-4 border-l-black/70 dark:border-l-white/50",o&&"border-r-4 border-r-black/70 dark:border-r-white/50",a&&"border-x-0");return Br(i(e.color),"p-2 rounded cursor-pointer hover:opacity-80 transition-opacity w-full text-left","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",s)},x=e=>{const t=L(e.startDate,n),r=e.endDate&&L(e.endDate,n);return!t||e.endDate&&!L(e.startDate,e.endDate)?t?`Starts ${vT(e.startTime,u)}`:r?e.isRepeating?`Ends today (${vT(e.startTime,u)} - ${vT(e.endTime,u)})`:`Ends ${vT(e.endTime,u)}`:e.isRepeating?`${vT(e.startTime,u)} - ${vT(e.endTime,u)}`:"All day":`${vT(e.startTime,u)} - ${vT(e.endTime,u)}`};return t.jsxs(ik,{open:m,onOpenChange:v,children:[t.jsx(sk,{asChild:!0,children:l}),t.jsxs(dk,{className:"sm:max-w-[425px]",children:[t.jsx(uk,{children:t.jsx(hk,{children:Te(n,"MMMM d, yyyy")})}),t.jsx(fT,{className:"h-[300px] mt-4",children:t.jsx("div",{className:"space-y-2 pr-4 flex flex-col items-center pl-6",children:e.sort((e,t)=>new Date(`${Te(n,"yyyy-MM-dd")}T${e.startTime}`).getTime()-new Date(`${Te(n,"yyyy-MM-dd")}T${t.startTime}`).getTime()).map(e=>t.jsx(_E,{event:e,onAddEvent:o,onUpdateEvent:y,onDeleteEvent:s,onOpenChange:c,dateFromViewClick:n,translations:p,children:t.jsxs("div",{className:g(e),onClick:()=>(e=>{f(e),v(!0)})(e),children:[e.title&&t.jsx("div",{className:"font-semibold truncate",children:e.title}),t.jsx("div",{className:"text-xs",children:x(e)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id))})}),t.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[t.jsx(_E,{translations:p,event:{startDate:n,endDate:n,color:d},onAddEvent:o,dateFromViewClick:n,children:t.jsxs(Ir,{variant:"outline",className:"flex-grow mr-2",children:[t.jsx(kt,{className:"mr-2 h-4 w-4"}),p.addEvent]})}),t.jsx(Ir,{variant:"outline",onClick:()=>{f(null),v(!1)},children:"Close"})]})]})]})},_T=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:l,isLoading:c,hoverLineRef:d,hoverTimeRef:u,clickedTime:p,setClickedTime:h,currentTimeLineRef:f,currentTimeTop:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:g})=>{var x,b;const k=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>{const r=s.findIndex(t=>t.value===e),n=s.findIndex(e=>e.value===t);return r-n}),_=e.filter(e=>{const t=E(e.startDate),n=E(r);return e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,n)))&&NS(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Ve(n,{start:t,end:H(e.endDate)}):L(t,n)}),w=Array.from({length:24},(e,t)=>({hour:t,label:yT(r,t,o)})),M=e=>{if(!e.isRepeating)return Br(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}},D=e=>{if(!e.isRepeating)return Br(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}};return t.jsx(CE,{className:"",children:t.jsxs(fT,{className:"h-[600px]",children:[t.jsxs("div",{className:"flex pl-2 pr-2",children:[t.jsxs("div",{className:"sticky left-0 z-30 w-16 bg-background border-r border-border h-full",children:[t.jsx("div",{className:"sticky top-0 z-[200] bg-background h-12 border-b border-border"}),t.jsx("div",{className:"sticky top-12 z-[200] bg-background h-[3.1rem] flex items-center justify-end pr-4 text-sm text-muted-foreground border-b border-border",children:n.localization.allDay}),t.jsx(_E,{onAddEvent:a,onDeleteEvent:l,event:{startDate:r,endDate:r,startTime:p||Te(new Date,"HH:mm"),endTime:Te(C(p?qe(`2000-01-01T${p}`):new Date,1),"HH:mm"),color:null!=k&&k.length?k[0]:void 0},translations:n.localization,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=r+96;let o,a,i;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);o=Math.floor(e/60),a=e%60,i=e/60*64+96}else o=Math.floor(r/64),a=Math.floor(r%64/64*60),i=n;o=Math.max(0,Math.min(23,o)),a=Math.max(0,Math.min(59,a));const s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;d.current&&(d.current.style.top=`${i}px`,d.current.style.display="block"),u.current&&(u.current.textContent=s)},onMouseLeave:()=>{d.current&&(d.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),a=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;h(a)},children:w.map(({hour:e,label:r})=>t.jsx("div",{className:"h-16 flex items-center justify-end pr-4 text-sm text-muted-foreground cursor-pointer",children:t.jsx("span",{className:"mt-[-46px]",children:r})},e))})})]}),t.jsx("div",{className:"flex-1 relative",children:t.jsxs("div",{className:"grid pb-4",style:{gridTemplateColumns:`repeat(${k.length}, 1fr)`},children:[!(null!=(x=n.dayView)&&x.hideHoverLine)&&t.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{zIndex:150},children:t.jsx("div",{ref:d,className:"absolute left-0 right-0 h-px bg-primary",style:{display:"none"},children:t.jsx("span",{ref:u,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})})}),L(r,new Date)&&!(null!=(b=n.dayView)&&b.hideTimeline)&&t.jsx("div",{ref:f,className:"absolute left-0 right-0 h-px bg-red-500 pointer-events-none",style:{top:`${m}px`,zIndex:30},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Te(new Date,"HH:mm")})}),k.map(e=>{const d=s.find(t=>t.value===e),u=_.filter(t=>t.color===e),{allDayEvents:p,regularEvents:h}=(e=>e.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!L(t.startDate,t.endDate);return n?o?L(t.startDate,r)?e.allDayEvents.push({...t,isStart:!0}):L(t.endDate,r)?e.allDayEvents.push({...t,isEnd:!0}):e.allDayEvents.push({...t,isMiddle:!0}):e.allDayEvents.push(t):e.regularEvents.push(t),e},{allDayEvents:[],regularEvents:[]}))(u),{events:f,totalColumns:m}=(e=>{const t=e.map(e=>{const t="00:00"===e.startTime&&"23:59"===e.endTime,n=t?0:60*parseInt(e.startTime.split(":")[0])+parseInt(e.startTime.split(":")[1]),o=t?1440:60*parseInt(e.endTime.split(":")[0])+parseInt(e.endTime.split(":")[1]),a=e.endDate&&!L(e.startDate,e.endDate),i=a&&L(e.startDate,r),s=a&&L(e.endDate,r);return{...e,isAllDay:t,startMinutes:n,endMinutes:o,column:0,width:1,isStart:i,isEnd:s,isMiddle:a&&!i&&!s}}).sort((e,t)=>e.isAllDay&&!t.isAllDay?-1:!e.isAllDay&&t.isAllDay?1:e.startMinutes-t.startMinutes),n=[];return t.forEach(e=>{let r=0;for(;;){if(!t.some(t=>t.column===r&&e!==t&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes))){e.column=r,n[r]=(n[r]||0)+1;break}r++}}),t.forEach(e=>{let r=1,o=e.column+1;for(;o<n.length&&!t.some(t=>t.column===o&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes));)r++,o++;e.width=r}),{events:t,totalColumns:Math.max(...n.map((e,t)=>t+1),1)}})(h),x=(e,t)=>{const r="00:00"===e.startTime&&"23:59"===e.endTime;if(e.isRepeating&&!r){const r=E(e.startDate),o=E(e.endDate||e.startDate);let a,i;switch(e.isRepeatingInterval||"daily"){case"weekly":a=Math.floor(I(o,r)/7)+1,i=Math.floor(I(t,r)/7)+1;break;case"monthly":a=12*(o.getFullYear()-r.getFullYear())+o.getMonth()-r.getMonth()+1,i=12*(t.getFullYear()-r.getFullYear())+t.getMonth()-r.getMonth()+1;break;default:a=I(o,r)+1,i=I(t,r)+1}return n.localization.repeatXofY.replace("{x}",i.toString()).replace("{y}",a.toString())}};return t.jsxs("div",{className:"relative border-r border-border flex-1",children:[t.jsx("div",{className:"sticky top-0 z-50 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:Br("w-3 h-3 rounded-full flex-shrink-0 hidden sm:block text-center",null==d?void 0:d.class)}),t.jsx("div",{className:"max-w-[150px] sm:max-w-[200px]",children:t.jsxs("span",{className:"relative font-medium text-sm sm:text-base group",children:[t.jsxs("span",{className:"block truncate",children:[null==d?void 0:d.label,u.length>0&&` (${u.length})`]}),t.jsx("span",{className:Br("absolute bottom-0 left-0 w-full h-[2px] sm:hidden",null==d?void 0:d.class)})]})})]})}),t.jsx("div",{className:"sticky top-12 z-50 bg-background min-h-[50px] border-b border-border",children:p.length<=1?p.map(e=>t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(_E,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:l,dateFromViewClick:r,translations:n.localization,children:t.jsx(qd.div,{className:Br(gT(e.color),"rounded px-2 py-1 mb-0.5 last:mb-0 cursor-pointer","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors",M(e)),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs("div",{className:"max-w-28 md:max-w-48",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs font-medium truncate",children:e.isStart?`${n.localization.starts}: ${vT(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${vT(e.endTime,o)}`:null})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),x(e,r)&&t.jsx("div",{className:"text-xs italic",children:x(e,r)})]})})},e.id)})):t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(kT,{events:p,date:r,addEvent:a,updateEvent:i,is24HourFormat:o,getEventColor:gT,onDelete:l,translations:n.localization,preSelectedColor:e,children:t.jsxs(qd.div,{className:Br(gT(p[0].color),"rounded px-2 py-1 cursor-pointer group","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors","border border-dashed border-opacity-50"),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("span",{className:"text-xs font-medium",children:[p.length," ",n.localization.allDay]})}),t.jsxs("div",{className:"text-xs mt-0.5 truncate max-w-24 sm:max-w-44",children:[p.slice(0,3).map(e=>e.title||n.localization.untitledEvent).join(", "),p.length>3&&`, +${p.length-3} more`]})]})})})}),t.jsxs("div",{className:"relative",onDoubleClick:t=>((e,t)=>{if(v||!n.dayView.enableDoubleClickToAddEvent)return;const o=e.currentTarget.getBoundingClientRect(),i=e.clientY-o.top,s=Math.floor(i/(16/15)),l=Math.floor(s/60),c=s%60,d=`${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,u=`${(l+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;a({title:"",startDate:r,endDate:r,startTime:d,endTime:u,color:t,isRepeating:!1})})(t,e),children:[w.map(({hour:e})=>t.jsx("div",{className:"h-16 border-b border-border"},e)),c&&g&&Array.from({length:10}).map((e,r)=>t.jsx(xT,{className:"absolute left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),t.jsx("div",{className:"absolute inset-0",children:f.map((e,s)=>{const c=e.column*(100/m),d=e.width*(100/m);return t.jsx(_E,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:l,onOpenChange:y,dateFromViewClick:r,translations:n.localization,children:t.jsxs(qd.div,{className:Br(gT(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",D(e)),style:{top:e.startMinutes*(16/15)+"px",height:`${Math.max((e.endMinutes-e.startMinutes)*(16/15),24)}px`,left:`${c}%`,width:`${d}%`},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*s},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs",children:e.isStart?`${n.localization.starts}: ${vT(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${vT(e.endTime,o)}`:`${vT(e.startTime,o)} - ${vT(e.endTime,o)}`}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),(e.isRepeating||e.isStart||e.isEnd||e.isMiddle)&&t.jsx("div",{className:"text-xs italic",children:x(e,r)})]})},e.id)})})]})]},e)})]})})]}),t.jsx(mT,{orientation:"horizontal"})]})})},wT=({filteredEvents:e,currentDate:r,currentConfig:n,isLoading:o,is24HourFormat:a,clickedTime:i,currentTimeTop:s,hoverLineRef:l,hoverTimeRef:c,currentTimeLineRef:d,setClickedTime:u,onEventAdd:p,onEventUpdate:h,onEventDelete:f,onDateRangeChange:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y})=>{var g;const x={filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:a,onEventAdd:p,onEventUpdate:h,onEventDelete:f,hoverLineRef:l,hoverTimeRef:c,clickedTime:i,setClickedTime:u,currentTimeLineRef:d,currentTimeTop:s,isLoading:o,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:m};return t.jsx(t.Fragment,{children:"resource"===(null==(g=n.dayView)?void 0:g.viewType)?t.jsx(_T,{...x}):t.jsx(bT,{...x})})},MT=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:d,setCurrentView:u,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b,k;const _=O(r,{weekStartsOn:n?1:0}),w=K(r,{weekStartsOn:n?1:0}),M=W({start:_,end:w}),D=Array.from({length:24},(e,t)=>t),j=le(_,{weekStartsOn:n?1:0}),S=(e,t)=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=E(e.startDate),n=H(e.endDate||e.startDate);return Ve(t,{start:r,end:n})},P=e.filter(e=>e.isRepeating?M.some(t=>NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily")):Ve(e.startDate,{start:_,end:w})||e.endDate&&Ve(e.endDate,{start:_,end:w})),T=(e=>e.reduce((e,t)=>{const r="00:00"===t.startTime&&"23:59"===t.endTime,n=t.endDate&&!L(t.startDate,t.endDate);return t.isRepeating?r?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):n?e.multiDayEvents.push(t):r?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(P),N=[...T.repeatingFullDayEvents,...T.multiDayEvents,...T.fullDayEvents],z=({event:e,day:r})=>{var n,o,a;const i=e.endDate&&!L(e.startDate,e.endDate),s=L(e.startDate,r),l=e.endDate&&L(e.endDate,r),d=i&&!s&&!l;return t.jsx(_E,{event:e,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,dateFromViewClick:r,translations:c.localization,children:t.jsxs("div",{className:Br(gT(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[24px] text-xs",(()=>{if(!e.isRepeating)return Br(s&&"border-l-4 border-l-black/70 dark:border-l-white/50",l&&"border-r-4 border-r-black/70 dark:border-r-white/50",d&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return Br("border border-dashed border-opacity-50",s&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",l&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",d&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),e.description&&t.jsx("div",{className:"truncate",children:e.description}),e.isRepeating&&t.jsx("div",{className:"text-[10px] opacity-75",children:"daily"===e.isRepeatingInterval?null==(n=c.localization)?void 0:n.repeatDaily:"weekly"===e.isRepeatingInterval?null==(o=c.localization)?void 0:o.repeatWeekly:null==(a=c.localization)?void 0:a.repeatMonthly})]})},e.id)};return t.jsxs(CE,{className:"p-4",children:[N.length>0&&t.jsxs("div",{className:"mb-4 relative z-20",children:[t.jsx("div",{className:"grid grid-cols-8 gap-0",children:M.map(e=>t.jsx("div",{className:"text-center text-xs font-semibold"},e.toString()))}),t.jsxs("div",{className:"grid grid-cols-8 gap-0 relative",children:[t.jsx("div",{className:"absolute left-0 top-0 bottom-2 w-[12.5%] flex items-center justify-center z-10",children:t.jsxs("div",{className:"text-xs truncate font-semibold whitespace-nowrap",children:[c.localization.fullDayEvents," (",N.length,")"]})}),N.map((e,r)=>t.jsxs(qd.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*r},className:"col-span-8 grid grid-cols-8 gap-0 mb-1",children:[t.jsx("div",{className:"w-[12.5%]"}),M.map(r=>t.jsx("div",{className:"min-h-[24px] px-1",children:Ve(r,{start:e.startDate,end:e.endDate||e.startDate})&&t.jsx(z,{event:e,day:r})},`${e.id}-${r.toString()}`))]},e.id))]})]}),t.jsx(fT,{className:"h-[600px]",children:t.jsxs("div",{className:"relative mb-2",children:[t.jsxs("div",{className:"grid grid-cols-8 gap-0",children:[t.jsx(_E,{event:{startDate:_,endDate:w,startTime:s||Te(new Date,"HH:mm"),endTime:Te(C(s?qe(`2000-01-01T${s}`):new Date,1),"HH:mm"),isRepeating:!0},onAddEvent:f,dateFromViewClick:_,translations:c.localization,children:t.jsxs("div",{className:"sticky top-0 left-0 z-30 bg-background",onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r);let i,s,l;if(e.ctrlKey){const e=15*Math.round(n/64*60/15);i=Math.floor(e/60),s=e%60,l=e/60*64}else i=Math.floor(n/64),s=Math.floor(n%64/64*60),l=n;const c=`${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;o.current&&(o.current.style.top=`${l+48}px`,o.current.style.display="block"),a.current&&(a.current.textContent=c)},onMouseLeave:()=>{o.current&&(o.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r),o=Math.floor(n/64),a=Math.floor(n%64/64*60),s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;i(s)},children:[t.jsx("div",{className:"sticky top-0 left-0 bg-background h-12 border-b border-r border-border flex items-center justify-center",children:t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground bg-background",children:["Week ",j]})}),D.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-center text-sm text-muted-foreground border-r border-border",children:yT(r,e,n)},e))]})}),t.jsx("div",{className:"col-span-7 relative z-20",children:t.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[M.map((e,r)=>{const o=T.regularEvents.filter(t=>S(t,e)),{sortedEvents:a,eventPositions:i,maxColumn:s}=((e,t)=>{const r=e.filter(e=>S(e,t)).sort((e,r)=>{const n=qe(`${Te(t,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(t,"yyyy-MM-dd")}T${r.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,r)=>{const n=qe(`${Te(t,"yyyy-MM-dd")}T${e.startTime}`),o=qe(`${Te(t,"yyyy-MM-dd")}T${e.endTime}`),a=qe(`${Te(t,"yyyy-MM-dd")}T${r.startTime}`);return n<qe(`${Te(t,"yyyy-MM-dd")}T${r.endTime}`)&&a<o};return r.forEach((e,t)=>{let i=0,s=!1;for(let o=0;o<t;o++)a(e,r[o])&&(i=Math.max(i,n[r[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(r.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:r,eventPositions:n,maxColumn:1}):(r.forEach(e=>{if(n[e.id].column<o){let t=1;for(;t+n[e.id].column<=o&&!r.some(r=>n[r.id].column===n[e.id].column+t&&a(e,r));)t++;n[e.id].span=t}}),{sortedEvents:r,eventPositions:n,maxColumn:o+1})})(o,e);return t.jsxs("div",{className:"relative",onDoubleClick:()=>(e=>{l||c.weekView.enableDoubleClickToShiftViewToDaily&&(d(e),u("day"))})(e),children:[t.jsx("div",{className:"sticky top-0 z-30 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:c.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:"text-sm "+(L(e,new Date)?"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto":""),children:Te(e,"d")})]})}),t.jsxs("div",{className:"relative h-[calc(100%-3rem)]",children:[D.map((e,r)=>t.jsx("div",{className:Br("h-16",0!==r&&"border-t border-border",r===D.length-1&&"border-b border-border")},e)),a.map((r,o)=>{const{top:a,height:l}=((e,t)=>{const r=qe(`${Te(e.startDate,"yyyy-MM-dd")}T${e.startTime}`),n=qe(`${Te(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),o=E(t),a=H(t);let i,s;e.isRepeating?(i=Je(Qe(t,r.getHours()),r.getMinutes()),s=Je(Qe(t,n.getHours()),n.getMinutes())):(i=R([r,o]),s=F([n,a]));const l=i.getHours()+i.getMinutes()/60;return{top:64*l,height:64*(s.getHours()+s.getMinutes()/60-l)}})(r,e),{column:d,span:u}=i[r.id],v=u/s*100,y=d/s*100,g=((e,t)=>{var r,n,o,a,i,s;if(!e.isRepeating){if(e.endDate&&!L(e.startDate,e.endDate)){const r=Math.floor(I(H(e.endDate),E(e.startDate)))+1;return`Day ${Math.floor(I(E(t),E(e.startDate)))+1} of ${r}`}return null}switch(e.isRepeatingInterval||"daily"){case"daily":{const a=Math.floor(I(qe(`${Te(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),qe(`${Te(e.startDate,"yyyy-MM-dd")}T${e.startTime}`)))+1,i=W({start:E(e.startDate),end:E(e.endDate||e.startDate)}),s=a-((null==(r=e.isRepeatingExcludedDates)?void 0:r.filter(e=>i.some(t=>L(t,e))).length)||0),l=W({start:E(e.startDate),end:E(t)}),d=(null==(n=e.isRepeatingExcludedDates)?void 0:n.filter(e=>l.some(t=>L(t,e))).length)||0,u=Math.floor(I(E(t),E(e.startDate)))+1-d;return`${null==(o=c.localization)?void 0:o.repeatDaily} ${u} of ${s}`}case"weekly":{const e=ze(t),r=null==(a=c.localization)?void 0:a.dayNames[e];return`${null==(i=c.localization)?void 0:i.repeatWeekly} ${r}`}case"monthly":return`${null==(s=c.localization)?void 0:s.repeatMonthly} ${Te(t,"do")}`;default:return null}})(r,e),x=L(r.startDate,e),b=r.endDate&&L(r.endDate,e);return t.jsx(_E,{event:r,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,onOpenChange:m,dateFromViewClick:e,translations:c.localization,children:t.jsxs(qd.div,{className:Br(gT(r.color),"absolute px-1 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40",r.isRepeating&&"border border-dashed border-opacity-50",x&&"border-l-1 border-l-black/70 dark:border-l-white/30",b&&"border-r-1 border-r-black/70 dark:border-r-white/30"),style:{top:`${a}px`,height:`${Math.max(l,24)}px`,left:`${y}%`,width:`${v}%`,zIndex:o+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*o},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:r.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs",children:[vT(r.startTime,n)," - ",vT(r.endTime,n)]}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${r.id}-${e.toISOString()}`)}),v&&x&&Array.from({length:10}).map((e,r)=>t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r))]}),r<M.length-1&&t.jsx("div",{className:"absolute top-12 right-0 w-px h-[calc(100%-3rem)] bg-border"})]},e.toString())}),t.jsx("div",{className:"absolute top-0 right-0 w-px h-full bg-border"})]})})]}),!(null!=(b=c.weekView)&&b.hideHoverLine)&&t.jsx("div",{ref:o,className:"absolute left-[12.5%] right-0 h-px bg-primary z-50 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:a,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),M.some(e=>L(e,new Date))&&!(null!=(k=c.weekView)&&k.hideTimeline)&&t.jsxs("div",{ref:y,className:"absolute left-[12.5%] right-0 h-px bg-red-500 z-40 pointer-events-none",style:{top:`${g+48}px`},children:[t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:Te(new Date,"HH:mm")}),M.map((e,r)=>L(e,new Date)&&t.jsx("div",{className:"absolute h-4 w-[1px] bg-red-500 transform -translate-y-1/2 opacity-75",style:{left:100/7*r+"%",boxShadow:"0 0 4px rgba(239, 68, 68, 0.5)"}},e.toString()))]})]})})]})},CT=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:l,isLoading:c,setCurrentDate:d,setCurrentView:u,isAddEventPopupOpen:p,setIsAddEventPopupOpen:h,onDateRangeChange:f})=>{var m;const v=O(r,{weekStartsOn:o?1:0}),y=W({start:v,end:K(r,{weekStartsOn:o?1:0})}),g=le(v,{weekStartsOn:o?1:0}),x=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>{const r=s.findIndex(t=>t.value===e),n=s.findIndex(e=>e.value===t);return r-n}),b=(e,t)=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?Ve(t,{start:E(e.startDate),end:H(e.endDate)}):L(e.startDate,t),k=e=>{p||n.weekView.enableDoubleClickToShiftViewToDaily&&(d(e),u("day"))},_=(null==(m=n.weekView)?void 0:m.resourceDisplayMode)||"row",w=(e,r,s)=>{const c=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,r),d=((e,t)=>{if(!e.isRepeating)return Br("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return Br("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,c),u=e.isRepeating||"single"===c||"start"===c&&!e.isRepeating||"end"===c&&!e.isRepeating;return t.jsx(_E,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:l,onOpenChange:h,dateFromViewClick:r,translations:n.localization,children:t.jsxs(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1*s},className:Br(gT(e.color),"mb-1 last:mb-0 px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-50 dark:hover:bg-opacity-60","flex items-center justify-between gap-1",d),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1 text-xs",children:e.title||n.localization.untitledEvent}),u&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==c?vT(e.startTime,o):`ends ${vT(e.endTime,o)}`})]})},e.id)},M=(e,r,s)=>e.length<=3?t.jsx(_E,{event:{startDate:r,endDate:r,color:s},onAddEvent:e=>a({...e}),onOpenChange:h,translations:n.localization,children:t.jsxs(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"group",children:[t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 md:hidden",children:"+"}),t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 hidden md:block opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:["+ ",n.localization.addEvent]})]})}):t.jsx(kT,{events:e,addEvent:a,updateEvent:i,onDelete:l,date:r,is24HourFormat:o,getEventColor:gT,preSelectedColor:s,translations:n.localization,children:t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",e.length-3," ",n.localization.more]})})});return t.jsx(CE,{className:"h-full flex flex-col overflow-hidden",children:t.jsxs(fT,{className:"flex-1 h-[calc(100vh-200px)]",children:[t.jsx("div",{className:"min-w-[768px] relative",children:t.jsx("div",{className:"relative",children:"row"===_?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid grid-cols-8 gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),y.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",onDoubleClick:()=>k(e),children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:n.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:Br("text-sm",L(e,new Date)&&"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto"),children:Te(e,"d")})]})},e.toString()))]}),x.map(r=>{const n=s.find(e=>e.value===r);return t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${y.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex items-center justify-center h-[125px]",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:Br("w-4 h-4 md:w-5 md:h-5 rounded-full flex-shrink-0",null==n?void 0:n.class)}),t.jsx("span",{className:"text-xs md:text-sm font-medium truncate max-w-[60px]",children:null==n?void 0:n.label})]})}),y.map(n=>{const o=e.filter(e=>e.color===r&&b(e,n));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>k(n),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>w(e,n,t))}),t.jsx("div",{className:"mt-auto",children:M(o,n,r)})]}),c&&f&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r}-${n.toString()}`)})]},r)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid gap-0",style:{gridTemplateColumns:`90px repeat(${x.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",g]})}),x.map(e=>{const r=s.find(t=>t.value===e);return t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.jsx("div",{className:Br("w-4 h-4 rounded-full",null==r?void 0:r.class)}),t.jsx("div",{className:"text-xs font-medium mt-1 truncate max-w-[90px] text-center",children:null==r?void 0:r.label})]})},e)})]}),y.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${x.length}, minmax(120px, 1fr))`},children:[t.jsxs("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex flex-col items-center justify-center h-[125px]",onDoubleClick:()=>k(r),children:[t.jsx("div",{className:"font-semibold text-sm",children:n.localization.dayNames[r.getDay()].slice(0,3)}),t.jsx("div",{className:Br("text-base w-7 h-7 flex items-center justify-center",L(r,new Date)&&"bg-primary text-primary-foreground rounded-full"),children:Te(r,"d")})]}),x.map(n=>{const o=e.filter(e=>e.color===n&&b(e,r));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>k(r),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>w(e,r,t))}),t.jsx("div",{className:"mt-auto",children:M(o,r,n)})]}),c&&f&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.toString()}-${n}`)})]},r.toString()))]})})}),t.jsx(mT,{orientation:"horizontal"})]})})},DT=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:d,setCurrentView:u,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b;const k={filteredEvents:e,currentDate:r,currentConfig:c,is24HourFormat:n,onEventAdd:f,onEventUpdate:p,onEventDelete:h,isLoading:v,isAddEventPopupOpen:l,setIsAddEventPopupOpen:m,setCurrentDate:d,setCurrentView:u,onDateRangeChange:x};return t.jsx(t.Fragment,{children:"resource"===(null==(b=c.weekView)?void 0:b.viewType)?t.jsx(CT,{...k}):t.jsx(MT,{...k,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,currentTimeLineRef:y,currentTimeTop:g})})},jT=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:d,onEventAdd:u,isLoading:p,onDateRangeChange:h})=>{var f;const m=U(r),v=$(r),y=null==(f=n.monthView)?void 0:f.showOnlyCurrentMonth,g=ze(m),x=new Date,b=n.localization.dayNames;let k,_;if(y)k=W({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=o?1:0;k=W({start:O(m,{weekStartsOn:e}),end:K(v,{weekStartsOn:e})}),_=o?[...b.slice(1),b[0]]:b}return t.jsx(CE,{className:"p-2 sm:p-4",children:t.jsx(fT,{children:t.jsxs("div",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:[_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm",children:e},e)),k.map(f=>{const m=Le(f,r);if(y&&!m)return t.jsx("div",{},f.toString());const v=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,f)))&&NS(f,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):L(e.startDate,f)||e.endDate&&Ve(f,{start:e.startDate,end:e.endDate})),g=((e,t)=>e.reduce((e,r)=>{const n="00:00"===r.startTime&&"23:59"===r.endTime,o=r.endDate&&!L(r.startDate,r.endDate);if(r.isRepeating){if(r.isRepeatingExcludedDates&&r.isRepeatingExcludedDates.some(e=>L(e,t)))return e;if(NS(t,r.startDate,r.endDate||r.startDate,r.isRepeatingInterval||"daily")){let o;o="weekly"===r.isRepeatingInterval||"monthly"===r.isRepeatingInterval||L(r.startDate,t)?"start":r.endDate&&L(r.endDate,t)?"end":"middle",n?e.repeatingFullDayEvents.push({...r,position:o}):e.regularEvents.push({...r,position:o})}}else if(o){let n;L(r.startDate,t)?n="start":L(r.endDate,t)?n="end":Ve(t,{start:r.startDate,end:r.endDate})&&(n="middle"),n&&e.multiDayEvents.push({...r,position:n})}else n?e.fullDayEvents.push(r):e.regularEvents.push(r);return e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(v,f),b=[...g.repeatingFullDayEvents,...g.multiDayEvents,...g.fullDayEvents],k=g.regularEvents,_=L(f,x);let w=[],M=0;return b.length>0?(w.push(b[0]),M=b.length-1+k.length):k.length>0&&(w.push(k[0]),M=k.length-1),M>0?w=w.slice(0,1):k.length>1&&w.length<2&&w.push(k[1]),t.jsxs("div",{className:Br("p-1 sm:p-2 h-[80px] sm:h-[130px] border rounded relative group flex flex-col",!m&&!y&&"bg-muted/50"),onDoubleClick:()=>(e=>{i||n.monthView.enableDoubleClickToShiftViewToWeekly&&(s(e),l("week"))})(f),children:[t.jsx("div",{className:Br("font-semibold mb-1 w-5 h-5 sm:w-6 sm:h-6 flex items-center justify-center text-xs sm:text-sm",_&&"bg-primary text-primary-foreground rounded-full"),children:Te(f,"d")}),t.jsxs("div",{className:"flex-grow overflow-hidden",children:[p&&h&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),w.map((e,r)=>((e,r,i)=>{const s="position"in e,l=s&&"start"===e.position,p=s&&"end"===e.position,h=s&&"middle"===e.position;return t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*r},children:t.jsx(_E,{event:e,onAddEvent:u,onUpdateEvent:c,onDeleteEvent:d,dateFromViewClick:i,onOpenChange:a,translations:n.localization,children:t.jsxs("div",{className:Br(gT(e.color),"p-1 text-[8px] h-10 sm:text-xs rounded mb-1 cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return Br(l&&"border-l-4 border-l-black/70 dark:border-l-white/50",p&&"border-r-4 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");switch(e.isRepeatingInterval){case"daily":return Br("border border-dashed border-opacity-50",l&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",p&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),!s&&t.jsxs("div",{className:"hidden sm:block truncate",children:[vT(e.startTime,o)," - ",vT(e.endTime,o)]}),s&&!e.isRepeating&&t.jsx("div",{className:"hidden sm:block truncate",children:e.description&&t.jsx("div",{className:"truncate",children:e.description})}),e.isRepeating&&t.jsxs("div",{className:"hidden sm:block truncate",children:[vT(e.startTime,o)," - ",vT(e.endTime,o)]})]})})},`${e.id}-${r}`)})(e,r,f)),0===v.length&&t.jsx(_E,{translations:n.localization,onOpenChange:a,onAddEvent:u,event:{startDate:f,endDate:f},onDeleteEvent:d,children:t.jsx(Ir,{variant:"ghost",size:"sm",className:"w-full h-1/2 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground transition-opacity truncate px-0.5 sm:px-2 sm:opacity-0 sm:group-hover:opacity-100",children:t.jsx("span",{className:"hidden sm:inline ml-1",children:n.localization.addEvent})})})]}),M>0&&t.jsx(kT,{translations:n.localization,events:v,date:f,addEvent:u,updateEvent:c,onDelete:d,is24HourFormat:o,getEventColor:gT,onOpenChange:a,children:t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 truncate px-0.5 sm:px-2 h-5 sm:h-8",children:[t.jsxs("span",{children:["+",M]}),t.jsxs("span",{className:"hidden sm:inline",children:[" ",n.localization.more]})]})})}),1===v.length&&t.jsx(_E,{translations:n.localization,onOpenChange:a,onAddEvent:u,event:{startDate:f},onDeleteEvent:d,children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity truncate px-0.5 sm:px-2 ",children:[t.jsx("span",{className:"font-bold",children:"+"}),t.jsx("span",{className:"hidden sm:inline",children:n.localization.addEvent})]})})]},f.toString())})]})})})},OT=({filteredEvents:e,onEventUpdate:r,onEventDelete:n,onEventAdd:o,isLoading:a,currentDate:i,currentConfig:s,is24HourFormat:l,isAddEventPopupOpen:c,setCurrentDate:d,setCurrentView:u,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{var f;const m=U(i),v=$(i),y=null==(f=s.monthView)?void 0:f.showOnlyCurrentMonth,g=ze(m),x=new Date,b=s.localization.dayNames;let k,_;if(y)k=W({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=l?1:0,t=O(m,{weekStartsOn:e}),r=K(v,{weekStartsOn:e});k=W({start:t,end:r}),_=l?[...b.slice(1),b[0]]:b}const w=Math.ceil(k.length/7);return t.jsx(CE,{className:"p-2 sm:p-4",children:t.jsx(fT,{children:t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"grid grid-cols-7 border-b",children:_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm p-2",children:e},e))}),Array.from({length:w}).map((f,m)=>{const v=k.slice(7*m,7*(m+1));return t.jsx("div",{className:"grid grid-cols-7",children:v.map((f,m)=>{const v=L(f,x),g=Le(f,i),b=(t=>e.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=E(e.startDate),n=H(e.endDate||e.startDate);return Ve(t,{start:r,end:n})}).sort((e,t)=>new Date(e.startDate).getTime()+(e.startTime?36e5*parseFloat(e.startTime.replace(":",".")):0)-(new Date(t.startDate).getTime()+(t.startTime?36e5*parseFloat(t.startTime.replace(":",".")):0))))(f);return y&&!g?t.jsx("div",{},f.toString()):t.jsxs("div",{className:Br("group min-h-[145px] border-b border-r p-1 relative","transition-colors duration-200",!g&&"bg-muted/50",0===m&&"border-l"),onDoubleClick:()=>(e=>{c||s.monthView.enableDoubleClickToShiftViewToWeekly&&(d(e),u("week"))})(f),children:[a&&h&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:Br("font-semibold w-6 h-6 flex items-center justify-center text-xs sm:text-sm rounded-full",v&&"bg-primary text-primary-foreground"),children:Te(f,"d")}),t.jsx(_E,{translations:s.localization,onOpenChange:p,onAddEvent:o,event:{startDate:f,endDate:f},dateFromViewClick:f,onDeleteEvent:n,children:t.jsx(Ir,{variant:"ghost",size:"sm",className:"h-6 text-xs text-muted-foreground px-2 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:t.jsx("span",{className:"ml-1 hidden sm:inline",children:s.localization.addEvent})})})]}),t.jsxs("div",{className:"space-y-1 mt-1 overflow-y-auto",children:[b.slice(0,b.length>4?3:4).map((e,a)=>{const i=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=L(e.startDate,t),n=e.endDate&&L(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,f),c=((e,t)=>{if(!e.isRepeating)return Br("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return Br("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,i),d=e.isRepeating||"single"===i||"start"===i&&!e.isRepeating||"end"===i&&!e.isRepeating;return t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*a},children:t.jsx(_E,{translations:s.localization,onAddEvent:o,onUpdateEvent:r,event:e,dateFromViewClick:f,onDeleteEvent:n,onOpenChange:p,children:t.jsxs("div",{className:Br(gT(e.color),"text-xs p-1 min-h-[24px] rounded cursor-pointer","hover:opacity-80 transition-opacity","flex items-center justify-between gap-1",c),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:e.title}),d&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==i?vT(e.startTime,l):`ends ${vT(e.endTime,l)}`})]})})},`${e.id}-${a}`)}),b.length>4&&t.jsx(kT,{translations:s.localization,events:b,date:f,addEvent:o,updateEvent:r,onDelete:n,is24HourFormat:l,getEventColor:gT,onOpenChange:p,children:t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs(Ir,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",b.length-3," ",s.localization.more]})})})]})]},f.toString())})},m)})]})})})},ST=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:d,onEventAdd:u,isLoading:p,onDateRangeChange:h})=>{var f;return t.jsx(t.Fragment,{children:"detailed"===(null==(f=n.monthView)?void 0:f.viewType)?t.jsx(OT,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:u,onEventUpdate:c,onEventDelete:d,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h}):t.jsx(jT,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:u,onEventUpdate:c,onEventDelete:d,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h})})},PT=({currentConfig:e,currentDate:r,filteredEvents:n,isAddEventPopupOpen:o,setCurrentDate:a,setCurrentView:i,is24HourFormat:s,isLoading:l,onEventAdd:c,onEventUpdate:d,onEventDelete:u,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{const f=function(e){const t=g(e.start),r=g(e.end);let n=+t>+r;const o=n?+t:+r,a=n?r:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=o;)i.push(g(a)),a.setMonth(a.getMonth()+1);return n?i.reverse():i}({start:Z(r),end:Y(r)}),m=s?1:0,v=s?e.localization.dayNames.slice(1).concat(e.localization.dayNames[0]):e.localization.dayNames;return t.jsx(CE,{className:"p-4",children:t.jsx(fT,{children:t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[l&&h&&t.jsx(xT,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),f.map(r=>{const l=U(r),h=W({start:l,end:$(r)}),f=(ze(l)-m+7)%7;return t.jsxs("div",{className:"border rounded p-2",onDoubleClick:()=>(t=>{o||e.yearView.enableDoubleClickToShiftViewToMonthly&&(a(t),i("month"))})(r),children:[t.jsx("h3",{className:"text-lg font-semibold mb-2 text-center",children:e.localization.monthNames[r.getMonth()]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[v.map((e,n)=>t.jsxs("div",{className:"text-center text-xs text-muted-foreground",children:[t.jsx("span",{className:"hidden sm:inline",children:e}),t.jsx("span",{className:"sm:hidden",children:e.charAt(0)})]},`${r.toString()}-${e}-${n}`)),Array.from({length:f}).map((e,r)=>t.jsx("div",{className:"h-6 w-6"},`empty-start-${r}`)),h.map(r=>{const o=(e=>n.filter(t=>{if(t.isRepeating)return(!t.isRepeatingExcludedDates||!t.isRepeatingExcludedDates.some(t=>L(t,e)))&&NS(e,t.startDate,t.endDate||t.startDate,t.isRepeatingInterval||"daily");const r=E(t.startDate),n=H(t.endDate||t.startDate);return Ve(e,{start:r,end:n})}).map(e=>gT(e.color)))(r),a=L(r,new Date),i=n.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,r)))&&NS(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const t=E(e.startDate),n=H(e.endDate||e.startDate);return Ve(r,{start:t,end:n})});return t.jsx(kT,{events:i,addEvent:c,updateEvent:d,onDelete:u,onOpenChange:p,date:r,is24HourFormat:s,getEventColor:gT,translations:e.localization,children:t.jsx("div",{className:Br("h-6 w-6 flex items-center justify-center text-xs cursor-pointer","text-foreground"),children:t.jsxs("div",{className:Br("h-5 w-5 flex items-center justify-center rounded-full relative","transition-all duration-200 ease-in-out",a&&"bg-accent text-accent-foreground",o.length>0?"hover:scale-150 hover:z-10":"hover:bg-gray-200 dark:hover:bg-gray-700"),children:[o.length>0?t.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",children:o.map((e,n)=>t.jsx("div",{className:`absolute inset-0 ${e}`,style:{backgroundColor:e.split(" ")[1],clipPath:`polygon(${n*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 100%, ${n*(100/o.length)}% 100%)`}},`${r.toString()}-${n}`))}):t.jsx("div",{className:"absolute inset-0 rounded-full transition-opacity opacity-0 hover:opacity-100 bg-gray-200 dark:bg-gray-700"}),t.jsx("time",{dateTime:Te(r,"yyyy-MM-dd"),className:"relative z-10",children:Te(r,"d")})]})})},r.toString())})]})]},r.toString())})]})})})},ET=({filteredEvents:e,currentView:r,currentDate:n,listSearchTerm:o,setListSearchTerm:a,currentConfig:i,onEventUpdate:s,onEventDelete:l,onEventAdd:c,is24HourFormat:d,isLoading:u})=>{let p,h;switch(r){case"day":default:p=E(n),h=H(n);break;case"week":p=O(n),h=K(n);break;case"month":p=U(n),h=$(n);break;case"year":p=Z(n),h=Y(n)}const f=e.filter(e=>{if(e.isRepeating){const t=()=>W({start:p,end:h}).some(t=>(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,t)))&&NS(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"));return"day"===r?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>L(e,n)))&&NS(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):t()}if("day"===r){const t=E(e.startDate),r=H(e.endDate||e.startDate);return Ve(n,{start:t,end:r})}return Ve(e.startDate,{start:p,end:h})||e.endDate&&Ve(e.endDate,{start:p,end:h})}).filter(e=>e.title.toLowerCase().includes(o.toLowerCase())||e.description&&e.description.toLowerCase().includes(o.toLowerCase())).sort((e,t)=>function(e,t){const r=g(e),n=g(t),o=r.getTime()-n.getTime();return o<0?-1:o>0?1:o}(e.startDate,t.startDate));return t.jsxs(CE,{className:"p-4",children:[t.jsx(qd.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},className:"mb-4",children:t.jsxs("div",{className:"relative",children:[t.jsx(tn,{initial:!1,mode:"wait",children:o?t.jsx(qd.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.6rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(Ir,{variant:"ghost",size:"icon",className:"h-5 w-5 p-0",onClick:()=>a(""),children:t.jsx(zt,{className:"h-4 w-4 text-muted-foreground"})})},"clearButton"):t.jsx(qd.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.75rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(Tt,{className:"h-4 w-4 text-muted-foreground"})},"searchIcon")}),t.jsx(r_,{type:"text",placeholder:i.localization.searchEvents,value:o,onChange:e=>a(e.target.value),className:"pl-10 pr-4 py-2 w-full"})]})}),t.jsxs(fT,{className:"h-[600px]",children:[t.jsx(tn,{initial:!0,children:f.map(e=>{const{dateInfo:r,isMultiDay:o,isOutOfRange:a,isRepeating:u}=(e=>{const t=E(e.startDate),r=H(e.endDate||e.startDate),n=!L(t,r),o=t<p||r>h,a=e.isRepeating;let s="";if(a&&(e.isRepeatingInterval,1)){const t=`${vT(e.startTime,d)} - ${vT(e.endTime,d)}`,r=Te(e.startDate,"MMM d"),n=Te(e.endDate||e.startDate,"MMM d, yyyy"),o=Te(e.startDate,"EEEE"),a=Te(e.startDate,"do");switch(e.isRepeatingInterval||"daily"){case"daily":s=i.localization.repeatDailyDescription.replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"weekly":s=i.localization.repeatWeeklyDescription.replace("{dayName}",o).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"monthly":s=i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",a).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n)}}else s=`${Te(t,"MMM d")}`,n&&(s+=` - ${Te(r,"MMM d")}`);return{dateInfo:s,isMultiDay:n,isOutOfRange:o,isRepeating:a}})(e);return t.jsx(qd.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsx(_E,{event:e,onAddEvent:c,onUpdateEvent:s,onDeleteEvent:l,dateFromViewClick:n,translations:i.localization,children:t.jsxs("div",{className:Br("p-2 rounded-lg cursor-pointer mb-2",gT(e.color),"hover:opacity-80 transition-opacity",e.isRepeating&&"border border-dashed border-opacity-50"),children:[t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"font-semibold",children:r}),t.jsxs("div",{className:"flex items-center space-x-2",children:[u&&t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{children:t.jsx(Et,{className:"h-4 w-4"})}),t.jsx(Xy,{children:t.jsx("p",{children:i.localization.repeatingEvent})})]})}),o&&!u&&t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{children:t.jsx(ft,{className:"h-4 w-4"})}),t.jsx(Xy,{children:t.jsx("p",{children:i.localization.multiDayEvent})})]})}),a&&t.jsx(Zy,{children:t.jsxs(Ky,{children:[t.jsx(Gy,{children:t.jsx(ct,{className:"h-4 w-4"})}),t.jsx(Xy,{children:t.jsx("p",{children:i.localization.extendsOutOfRange})})]})}),t.jsxs("span",{children:[vT(e.startTime,d)," - ",vT(e.endTime,d)]})]})]}),t.jsx("h3",{className:"text-lg font-bold mt-2",children:e.title||"Untitled Event"}),e.description&&t.jsx("p",{className:"mt-1 text-sm",children:e.description})]})})},e.id)})}),!u&&0===f.length&&t.jsx(qd.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-8",children:o?i.localization.noEvents:`${i.localization.noEvents} ${i.localization[r]}`})]})]})},TT=({currentView:e,isListView:n,animationDirection:o,currentDate:a,filteredEvents:i,listSearchTerm:s,setListSearchTerm:l,currentConfig:c,onEventUpdate:d,onEventDelete:u,isLoading:p,onEventAdd:h,is24HourFormat:f,setCurrentDate:m,setCurrentView:v,onDateRangeChange:y})=>{const[g,x]=r.useState(!1),[b,k]=r.useState(null),_=r.useRef(null),w=r.useRef(null),M=r.useRef(null),C=(()=>{const[e,t]=r.useState(0);return r.useEffect(()=>{const e=()=>{const e=new Date,r=(60*e.getHours()+e.getMinutes())*(16/15);t(r)};e();const r=setInterval(e,6e4);return()=>clearInterval(r)},[]),e})();ME({currentView:e,currentDate:a,onDateRangeChange:y,is24HourFormat:f});const D={filteredEvents:i,currentDate:a,currentConfig:c,onEventUpdate:d,onEventDelete:u,onEventAdd:h,is24HourFormat:f,isLoading:p},j={isAddEventPopupOpen:g,setIsAddEventPopupOpen:x,onDateRangeChange:y},O={hoverLineRef:_,hoverTimeRef:w},S={clickedTime:b,setClickedTime:k},P={currentTimeLineRef:M,currentTimeTop:C},E={setCurrentDate:m,setCurrentView:v};return t.jsx(tn,{mode:"wait",children:t.jsx(qd.div,{initial:{opacity:0,y:"up"===o?-20:"down"===o?20:0},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:"up"===o?20:"down"===o?-20:0},transition:{duration:.1},className:"h-full",children:n?t.jsx(ET,{...D,currentView:e,listSearchTerm:s,setListSearchTerm:l}):t.jsxs(t.Fragment,{children:["day"===e&&t.jsx(wT,{...D,...j,...O,...S,...P}),"week"===e&&t.jsx(DT,{...D,...j,...O,...S,...P,...E}),"month"===e&&t.jsx(ST,{...D,...j,...E}),"year"===e&&t.jsx(PT,{...D,...j,...E})]})},`${e}-${a.toISOString()}`)})},NT={language:"enUS",today:"Today",thisWeek:"This Week",thisMonth:"This Month",thisYear:"This Year",dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],viewBy:"View by",day:"Day",week:"Week",month:"Month",year:"Year",list:"List",addEvent:"Add Event",editEvent:"Edit Event",deleteEvent:"Delete Event",eventTitle:"Event Title",eventDescription:"Description",eventColor:"Event Color",eventDate:"Date",eventStartTime:"Start Time",eventEndTime:"End Time",eventEndDate:"End Date",eventIsRepeating:"Repeating Event",eventAdded:"Event added",eventUpdated:"Event updated",eventDeleted:"Event deleted",eventRestored:"Event restored",eventUpdateUndone:"Event update undone",failedToAddEvent:"Failed to add event",failedToUpdateEvent:"Failed to update event",failedToDeleteEvent:"Failed to delete event",failedToFetchEvents:"Failed to fetch events",errorCannotExcludeAllDates:"Cannot exclude all dates in the range",save:"Save",saving:"Saving",cancel:"Cancel",delete:"Delete",deleting:"Deleting",undo:"Undo",tryAgain:"Try again",close:"Close",search:"Search",searchEvents:"Search events...",noEvents:"No events",allDay:"All Day",fullDayEvents:"Full-Day Events",loadingEvents:"Loading events...",filterByColor:"Filter by Color",filter:"Filter",filtering:"Filtering",more:"more",use24HourFormat:"Use 24-hour format",repeatingEvent:"Repeating event",multiDayEvent:"Multi-day event",extendsOutOfRange:"Extends beyond current view",displayCalendar:"Display Calendar",displayList:"Display List",dayXofY:"Day {x} of {y}",repeatXofY:"#{x} of {y}",starts:"Starts",ends:"Ends",untitledEvent:"Untitled Event",repeatDaily:"Daily",repeatWeekly:"Weekly",repeatMonthly:"Monthly",repeatingEventQuestion:"Repeating Event?",repeatDailyDescription:"Repeats daily at {timeRange} from {startDate} to {endDate}",repeatWeeklyDescription:"Repeats every {dayName} at {timeRange} from {startDate} to {endDate}",repeatMonthlyDescription:"Repeats on the {dayOfMonth} of each month at {timeRange} from {startDate} to {endDate}",withExcludedDates:"with {count} excluded date{s}",excludedDates:"Excluded Dates?",excludedDatesDescription:"Select dates to exclude from the recurring pattern",skipDays:"Skip Days:",clearAll:"Clear All",selectDatesToExclude:"Select dates to exclude",selectAll:"Select All",noMatchingDates:"No dates match this repeat pattern",noSearchResults:'No matches found for "{query}"',searchMonthPlaceholder:"Search month...",ofExcluded:"{count} of {total} excluded",pageCount:"{current}/{total}",weeklyIntervalLabel:"{dayName}s ({startDate} - {endDate})",monthlyIntervalLabel:"{dayOfMonth} of each month ({startDate} - {endDate})",dateButtonFormat:"MMM d",editEventDescription:"Edit your event details.",createEventDescription:"Create a new event in your calendar.",timePresetAllDay:"All Day",timePresetEarlyMorning:"Early Morning",timePresetMorning:"Morning",timePresetLunch:"Lunch",timePresetEarlyAfternoon:"Early Afternoon",timePresetLateAfternoon:"Late Afternoon",timePresetEvening:"Evening",timePresetNight:"Night",selectDate:"Pick a date",selectColor:"Select a color",confirmDelete:"Are you sure?",confirmDeleteDescription:"Do you want to delete this event?",repeatEventDeleteTitle:"Delete Repeating Event",repeatEventDeleteDescription:"This is a repeating event. What would you like to delete?",deleteThisOccurrence:"Delete only this occurrence",deleteThisAndFuture:"Delete this and all future occurrences",deleteAllOccurrences:"Delete all occurrences",deleteThisOccurrenceDescription:"Only this specific date will be removed",deleteThisAndFutureDescription:"This and all future dates will be removed",deleteAllOccurrencesDescription:"The entire repeating event will be removed",editRecurringEventTitle:"Edit Recurring Event",editRecurringEventDescription:"This is a recurring event. Would you like to edit all occurrences, just this one, or this and future occurrences?",editThisOccurrence:"Edit this occurrence only",editThisOccurrenceDescription:"Make changes only to this specific event occurrence",editThisAndFuture:"Edit this and future occurrences",editThisAndFutureDescription:"Make changes to this and all future occurrences",editAllOccurrences:"Edit all occurrences",editAllOccurrencesDescription:"Make changes to all occurrences of this event",from:"from",to:"to",pickADate:"Pick a date",errorEndDateBeforeStart:"End date cannot be before start date",selectAColor:"Select a color",validations:{eventNameRequired:"Event name is required",invalidTimeFormat:"Invalid time format",colorRequired:"Color is required",endTimeBeforeStart:"End time can't be before start time"}},zT={defaultView:"month",use24HourFormatByDefault:!0,dayView:{enableDoubleClickToAddEvent:!1,viewType:"regular"},weekView:{enableDoubleClickToShiftViewToDaily:!1,viewType:"regular"},monthView:{enableDoubleClickToShiftViewToWeekly:!1,viewType:"basic"},yearView:{enableDoubleClickToShiftViewToMonthly:!1},localization:{...NT}},AT=({config:e,events:n,isLoading:o=!1,onEventAdd:a,onEventUpdate:i,onEventDelete:l,onDateRangeChange:c})=>{const d={...zT,...e},u=tt({config:{defaultView:d.defaultView||"month",use24HourFormatByDefault:d.use24HourFormatByDefault||!1},translations:d.localization}),[p,h]=r.useState(!1),[f,m]=r.useState(""),[v,g]=r.useState(s.map(e=>e.value)),x=n.filter(e=>v.includes(e.color)),b=(()=>{const[e,t]=r.useState(!1);return r.useEffect(()=>{t("ontouchstart"in window||navigator.maxTouchPoints>0)},[]),e})(),k=y({onSwipedLeft:()=>u.handleNext(),onSwipedRight:()=>u.handlePrevious(),preventScrollOnSwipe:!1,trackMouse:!1,delta:{left:100,right:100},swipeDuration:150,touchEventOptions:{passive:!0},trackTouch:!0}),_={...u,currentConfig:d,onEventAdd:a,onEventDelete:l,isListView:p};return t.jsxs("div",{...b?k:{},children:[t.jsx(wE,{..._,setIsListView:h,selectedColors:v,setSelectedColors:g}),t.jsx(TT,{..._,is24HourFormat:u.use24HourFormat,filteredEvents:x,listSearchTerm:f,setListSearchTerm:m,onEventUpdate:i,isLoading:o,onDateRangeChange:c})]})};function RT({config:e={},initialEvents:t=[],onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i}){var s,l;const[c,d]=r.useState(t),[u,p]=r.useState(!1),h=r.useRef(null),f=r.useRef(null),m=(null==(s=e.calendarConfig)?void 0:s.localization)||NT,v=async(t,r)=>{var o;let a;try{a=n?await n(t):{...t,id:Date.now().toString()+Math.random().toString(36).substring(2,7)},d(e=>[...e,a]),f.current=a,r?v_.success(m.eventRestored):v_.success(m.eventAdded,{action:{label:m.undo,onClick:()=>g(a.id,!0)}})}catch(n){console.error("Error adding event:",n),v_.error(m.failedToAddEvent,!1!==(null==(o=e.events)?void 0:o.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>v(t,r)}}:void 0)}},y=async(t,r)=>{var n;try{o&&await o(t),d(e=>e.map(e=>e.id===t.id?t:e)),r?v_.success(m.eventRestored):v_.success(m.eventUpdated,{action:{label:m.undo,onClick:()=>y(c.find(e=>e.id===t.id),!0)}})}catch(o){console.error("Error updating event:",o),v_.error(m.failedToUpdateEvent,!1!==(null==(n=e.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>y(t,r)}}:void 0)}},g=async(t,r)=>{var n;if(!t)return;const o=r?f.current:c.find(e=>e.id===t);if(o)try{a&&await a(t),d(e=>e.filter(e=>e.id!==t)),r?v_.success(m.eventDeleted):v_.success(m.eventDeleted,{action:{label:m.undo,onClick:()=>v(o,!0)}})}catch(o){console.error("Error deleting event:",o),v_.error(m.failedToDeleteEvent,!1!==(null==(n=e.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>g(t,r)}}:void 0)}else console.error(`Event with id ${t} not found`)},x=function(e,t,n){const o=r.useRef(),a=r.useRef(null),i=r.useCallback(()=>{var e;o.current&&(clearTimeout(o.current),o.current=void 0,null==(e=null==n?void 0:n.onCancel)||e.call(n),a.current&&(a.current(),a.current=null))},[n]);return r.useEffect(()=>()=>i(),[i]),r.useCallback((...r)=>{var s;return t?(i(),null==(s=null==n?void 0:n.onDebounce)||s.call(n),new Promise(n=>{a.current=n,o.current=setTimeout(async()=>{await e(...r),a.current=null,n()},t)})):e(...r)},[e,t,n,i])}(async(t,r)=>{var n;if(!i)return;h.current&&h.current.abort();const o=new AbortController;h.current=o;try{p(!0);const e=await i(t,r,o.signal);h.current===o&&d(t=>[...t,...e])}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)return;console.error("Error fetching events:",o),v_.error(m.failedToFetchEvents,!1!==(null==(n=e.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>x(t,r)}}:void 0)}finally{h.current===o&&(p(!1),h.current=null)}},null==(l=e.events)?void 0:l.debounceTimeOnViewOrDateChange,{onDebounce:()=>{}});return{events:c,isLoading:u,addEvent:v,updateEvent:y,deleteEvent:g,onViewOrDateChange:x}}const FT=[{id:"1",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),7),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),7),title:"All-Day Project Sprint",startTime:"00:00",endTime:"23:59",color:"red",isRepeating:!1},{id:"2",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),title:"International Client Call",startTime:"03:00",endTime:"04:00",color:"green",isRepeating:!1},{id:"3",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),9),title:"Team Standup",startTime:"05:30",endTime:"06:30",color:"blue",isRepeating:!1},{id:"4",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),12),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),12),title:"Product Development Workshop",startTime:"01:00",endTime:"05:00",color:"purple",isRepeating:!1},{id:"5",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),title:"Investor Presentation",startTime:"06:30",endTime:"08:00",color:"yellow",isRepeating:!1},{id:"6",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),15),title:"Team Breakfast",startTime:"08:00",endTime:"09:00",color:"green",isRepeating:!1},{id:"7",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),17),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),17),title:"Team Breakfast",startTime:"07:00",endTime:"08:30",color:"blue",isRepeating:!1},{id:"8",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Asia Market Review",startTime:"01:00",endTime:"03:00",color:"green",isRepeating:!1},{id:"9",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Product Roadmap Review",startTime:"04:30",endTime:"06:00",color:"purple",isRepeating:!1},{id:"10",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Team Building Breakfast",startTime:"07:00",endTime:"09:00",color:"yellow",isRepeating:!1},{id:"11",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Early Strategy Meeting",startTime:"02:00",endTime:"04:00",color:"purple",isRepeating:!1},{id:"12",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),title:"Early Bird Workout",startTime:"00:00",endTime:"01:30",color:"blue",isRepeating:!0},{id:"13",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),title:"Meditation Session",startTime:"02:00",endTime:"03:30",color:"blue",isRepeating:!1},{id:"14",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),title:"Code Review",startTime:"04:00",endTime:"05:30",color:"green",isRepeating:!1},{id:"15",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),title:"Breakfast Break",startTime:"06:30",endTime:"07:30",color:"yellow",isRepeating:!1},{id:"16",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Conference Call",startTime:"01:00",endTime:"03:00",color:"green",isRepeating:!1},{id:"17",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Code Review",startTime:"04:30",endTime:"06:00",color:"purple",isRepeating:!1},{id:"18",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),19),title:"Team Building",startTime:"07:00",endTime:"09:00",color:"yellow",isRepeating:!1},{id:"19",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),title:"Product Launch",startTime:"10:00",endTime:"12:00",color:"red",isRepeating:!1},{id:"20",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),22),title:"Press Conference",startTime:"13:00",endTime:"14:30",color:"blue",isRepeating:!1},{id:"21",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),25),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),25),title:"Training Session",startTime:"14:00",endTime:"17:00",color:"purple",isRepeating:!1},{id:"22",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),title:"Board Meeting",startTime:"15:00",endTime:"17:00",color:"blue",isRepeating:!1},{id:"23",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),title:"Strategy Planning",startTime:"09:00",endTime:"11:30",color:"green",isRepeating:!1},{id:"24",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),28),title:"Budget Review",startTime:"13:00",endTime:"14:30",color:"red",isRepeating:!1},{id:"25",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),title:"Meeting A",startTime:"10:00",endTime:"11:30",color:"blue",isRepeating:!1},{id:"26",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),title:"Meeting B",startTime:"10:00",endTime:"12:00",color:"green",isRepeating:!1},{id:"27",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),3),title:"Meeting C",startTime:"10:00",endTime:"13:00",color:"yellow",isRepeating:!1},{id:"28",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),title:"Workshop A",startTime:"14:00",endTime:"16:00",color:"purple",isRepeating:!1},{id:"29",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),title:"Workshop B",startTime:"14:30",endTime:"16:30",color:"red",isRepeating:!1},{id:"30",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),10),title:"Workshop C",startTime:"15:00",endTime:"17:00",color:"green",isRepeating:!1},{id:"31",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Seminar A",startTime:"09:00",endTime:"12:00",color:"blue",isRepeating:!1},{id:"32",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Seminar B",startTime:"10:00",endTime:"13:00",color:"yellow",isRepeating:!1},{id:"33",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),20),title:"Seminar C",startTime:"11:00",endTime:"14:00",color:"purple",isRepeating:!1},{id:"34",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),title:"Conference A",startTime:"13:00",endTime:"15:00",color:"green",isRepeating:!1},{id:"35",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),title:"Conference B",startTime:"13:00",endTime:"16:00",color:"blue",isRepeating:!1},{id:"36",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),24),title:"Conference C",startTime:"13:00",endTime:"17:00",color:"red",isRepeating:!1},{id:"37",startDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),endDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),title:"Ads Campaign Nr2",description:"AdSense + FB, Target Audience: SMB2-Delta3",startTime:"00:00",endTime:"01:30",color:"yellow",isRepeating:!1}],LT={defaultView:"month",use24HourFormatByDefault:!0,dayView:{enableDoubleClickToAddEvent:!1,viewType:"regular"},weekView:{enableDoubleClickToShiftViewToDaily:!1,viewType:"regular"},monthView:{enableDoubleClickToShiftViewToWeekly:!1,viewType:"detailed",showOnlyCurrentMonth:!0},yearView:{enableDoubleClickToShiftViewToMonthly:!1}},BT={events:{allowUserRetryAfterFailure:!0}};e.EVENT_COLOR_OPTIONS=s,e.EventCalendar=AT,e.MyEventCalendar=()=>{const{events:e,isLoading:r,addEvent:n,updateEvent:o,deleteEvent:a,onViewOrDateChange:i}=RT({config:BT,initialEvents:FT,onEventAdd:async e=>(await new Promise(e=>setTimeout(e,0)),{...e,id:Date.now().toString()}),onEventUpdate:async e=>(await new Promise(e=>setTimeout(e,0)),e),onEventDelete:async e=>{await new Promise(e=>setTimeout(e,0)),console.log(`Event deleted: ${e}`)},onDateRangeChange:async(e,t,r)=>(await new Promise(e=>setTimeout(e,0)),console.log(`Fetching events between ${e.toISOString()} and ${t.toISOString()}`),[])});return t.jsx(AT,{config:LT,events:e,isLoading:r,onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i})},e.da={language:"da",today:"I dag",thisWeek:"Denne uge",thisMonth:"Denne måned",thisYear:"Dette år",dayNames:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],fullDayNames:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],monthNames:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],viewBy:"Vis efter",day:"Dag",week:"Uge",month:"Måned",year:"År",list:"Liste",addEvent:"Ny begivenhed",editEvent:"Rediger begivenhed",deleteEvent:"Slet begivenhed",eventTitle:"Begivenhedstitel",eventDescription:"Beskrivelse",eventColor:"Farve",eventDate:"Dato",eventStartTime:"Starttidspunkt",eventEndTime:"Sluttidspunkt",eventEndDate:"Slutdato",eventIsRepeating:"Gentaget begivenhed",eventAdded:"Begivenhed tilføjet",eventUpdated:"Begivenhed opdateret",eventDeleted:"Begivenhed slettet",eventRestored:"Begivenhed gendannet",eventUpdateUndone:"Begivenhedsopdatering fortrudt",failedToAddEvent:"Kunne ikke tilføje begivenhed",failedToUpdateEvent:"Kunne ikke opdatere begivenhed",failedToDeleteEvent:"Kunne ikke slette begivenhed",failedToFetchEvents:"Kunne ikke hente begivenheder",errorCannotExcludeAllDates:"Kan ikke udelukke alle datoer i området",save:"Gem",saving:"Gemmer",cancel:"Annuller",delete:"Slet",deleting:"Sletter",undo:"Fortryd",tryAgain:"Prøv igen",close:"Luk",search:"Søg",searchEvents:"Søg i begivenheder...",noEvents:"Ingen begivenheder",allDay:"Hele dagen",fullDayEvents:"Heldagsbegivenheder",loadingEvents:"Indlæser begivenheder...",filterByColor:"Filtrer efter farve",filter:"Filter",filtering:"Filtrerer",more:"mere",use24HourFormat:"Brug 24-timers format",repeatingEvent:"Gentaget begivenhed",multiDayEvent:"Flerdagesbegivenhed",extendsOutOfRange:"Strækker sig ud over den aktuelle visning",displayCalendar:"Vis kalender",displayList:"Vis liste",dayXofY:"Dag {x} af {y}",repeatXofY:"#{x} af {y}",starts:"Starter",ends:"Slutter",untitledEvent:"Unavngiven begivenhed",repeatDaily:"Dagligt",repeatWeekly:"Ugentligt",repeatMonthly:"Månedligt",repeatingEventQuestion:"Gentages begivenhed?",repeatDailyDescription:"Gentages dagligt kl. {timeRange} fra {startDate} til {endDate}",repeatWeeklyDescription:"Gentages hver {dayName} kl. {timeRange} fra {startDate} til {endDate}",repeatMonthlyDescription:"Gentages den {dayOfMonth}. hver måned kl. {timeRange} fra {startDate} til {endDate}",withExcludedDates:"med {count} udelukket dato{s}",excludedDates:"Udelukkede datoer?",excludedDatesDescription:"Vælg datoer, der skal udelukkes fra det tilbagevendende mønster",skipDays:"Spring dage over:",clearAll:"Ryd alle",selectDatesToExclude:"Vælg datoer, der skal udelukkes",selectAll:"Vælg alle",noMatchingDates:"Ingen datoer matcher dette gentagelsesmønster",noSearchResults:'Ingen resultater fundet for "{query}"',searchMonthPlaceholder:"Søg måned...",ofExcluded:"{count} af {total} udelukket",pageCount:"{current}/{total}",weeklyIntervalLabel:"Hver {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Den {dayOfMonth}. hver måned ({startDate} - {endDate})",dateButtonFormat:"d. MMM",editEventDescription:"Rediger dine begivenhedsdetaljer.",createEventDescription:"Opret en ny begivenhed i din kalender.",timePresetAllDay:"Hele dagen",timePresetEarlyMorning:"Tidlig morgen",timePresetMorning:"Morgen",timePresetLunch:"Frokost",timePresetEarlyAfternoon:"Tidlig eftermiddag",timePresetLateAfternoon:"Sen eftermiddag",timePresetEvening:"Aften",timePresetNight:"Nat",selectDate:"Vælg en dato",selectColor:"Vælg en farve",confirmDelete:"Er du sikker?",confirmDeleteDescription:"Vil du slette denne begivenhed?",repeatEventDeleteTitle:"Slet gentaget begivenhed",repeatEventDeleteDescription:"Dette er en gentaget begivenhed. Hvad vil du slette?",deleteThisOccurrence:"Slet kun denne forekomst",deleteThisAndFuture:"Slet denne og alle fremtidige forekomster",deleteAllOccurrences:"Slet alle forekomster",deleteThisOccurrenceDescription:"Kun denne specifikke dato vil blive fjernet",deleteThisAndFutureDescription:"Denne og alle fremtidige datoer vil blive fjernet",deleteAllOccurrencesDescription:"Hele den gentagne begivenhed vil blive fjernet",editRecurringEventTitle:"Rediger gentaget begivenhed",editRecurringEventDescription:"Dette er en gentaget begivenhed. Vil du redigere alle forekomster, kun denne eller denne og fremtidige forekomster?",editThisOccurrence:"Rediger kun denne forekomst",editThisOccurrenceDescription:"Foretag kun ændringer på denne specifikke begivenhedsforekomst",editThisAndFuture:"Rediger denne og fremtidige forekomster",editThisAndFutureDescription:"Foretag ændringer på denne og alle fremtidige forekomster",editAllOccurrences:"Rediger alle forekomster",editAllOccurrencesDescription:"Foretag ændringer på alle forekomster af denne begivenhed",from:"fra",to:"til",pickADate:"Vælg en dato",errorEndDateBeforeStart:"Slutdato kan ikke være før startdato",selectAColor:"Vælg en farve",validations:{eventNameRequired:"Begivenhedsnavn er påkrævet",invalidTimeFormat:"Ugyldigt tidsformat",colorRequired:"Farve er påkrævet",endTimeBeforeStart:"Sluttidspunkt kan ikke være før starttidspunkt"}},e.doesDateMatchRepeatPattern=NS,e.enUS=NT,e.es={language:"es",today:"Hoy",thisWeek:"Esta Semana",thisMonth:"Este Mes",thisYear:"Este Año",dayNames:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],fullDayNames:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],viewBy:"Ver por",day:"Día",week:"Semana",month:"Mes",year:"Año",list:"Lista",addEvent:"+ Evento",editEvent:"Editar Evento",deleteEvent:"Eliminar Evento",eventTitle:"Título del Evento",eventDescription:"Descripción",eventColor:"Color del Evento",eventDate:"Fecha",eventStartTime:"Hora de Inicio",eventEndTime:"Hora de Fin",eventEndDate:"Fecha de Fin",eventIsRepeating:"Evento Recurrente",eventAdded:"Evento agregado",eventUpdated:"Evento actualizado",eventDeleted:"Evento eliminado",eventRestored:"Evento restaurado",eventUpdateUndone:"Cambios en el evento deshechos",failedToAddEvent:"Error al agregar el evento",failedToUpdateEvent:"Error al actualizar el evento",failedToDeleteEvent:"Error al eliminar el evento",failedToFetchEvents:"Error al cargar los eventos",errorCannotExcludeAllDates:"No se pueden excluir todas las fechas en el rango",save:"Guardar",saving:"Guardando",cancel:"Cancelar",delete:"Eliminar",deleting:"Eliminando",undo:"Deshacer",tryAgain:"Intentar de nuevo",close:"Cerrar",search:"Buscar",searchEvents:"Buscar eventos...",noEvents:"No hay eventos",allDay:"Todo el día",fullDayEvents:"Eventos de todo el día",loadingEvents:"Cargando eventos...",filterByColor:"Filtrar por color",filter:"Filtrar",filtering:"Filtrando",more:"más",use24HourFormat:"Usar formato 24 horas",repeatingEvent:"Evento recurrente",multiDayEvent:"Evento de varios días",extendsOutOfRange:"Se extiende más allá de la vista actual",displayCalendar:"Mostrar Calendario",displayList:"Mostrar Lista",dayXofY:"Día {x} de {y}",repeatXofY:"#{x} de {y}",starts:"Comienza",ends:"Termina",untitledEvent:"Evento sin título",repeatDaily:"Diariamente",repeatWeekly:"Semanalmente",repeatMonthly:"Mensualmente",repeatingEventQuestion:"¿Evento repetitivo?",repeatDailyDescription:"Se repite diariamente a las {timeRange} desde el {startDate} hasta el {endDate}",repeatWeeklyDescription:"Se repite cada {dayName} a las {timeRange} desde el {startDate} hasta el {endDate}",repeatMonthlyDescription:"Se repite el {dayOfMonth} de cada mes a las {timeRange} desde el {startDate} hasta el {endDate}",withExcludedDates:"con {count} fecha{s} excluida{s}",excludedDates:"Fechas excluidas?",excludedDatesDescription:"Seleccione fechas para excluir del patrón recurrente",skipDays:"Omitir días:",clearAll:"Borrar todo",selectDatesToExclude:"Seleccionar fechas para excluir",selectAll:"Seleccionar Todo",noMatchingDates:"Ninguna fecha coincide con este patrón de repetición",noSearchResults:'No se encontraron resultados para "{query}"',searchMonthPlaceholder:"Buscar mes...",ofExcluded:"{count} de {total} excluidas",pageCount:"{current}/{total}",weeklyIntervalLabel:"Cada {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"El {dayOfMonth} de cada mes ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Edita los detalles de tu evento.",createEventDescription:"Crea un nuevo evento en tu calendario.",timePresetAllDay:"Todo el día",timePresetEarlyMorning:"Temprano en la mañana",timePresetMorning:"Mañana",timePresetLunch:"Almuerzo",timePresetEarlyAfternoon:"Temprano en la tarde",timePresetLateAfternoon:"Final de la tarde",timePresetEvening:"Noche",timePresetNight:"Madrugada",selectDate:"Seleccionar fecha",selectColor:"Seleccionar color",confirmDelete:"¿Estás seguro?",confirmDeleteDescription:"¿Deseas eliminar este evento?",repeatEventDeleteTitle:"Eliminar Evento Recurrente",repeatEventDeleteDescription:"Este es un evento recurrente. ¿Qué deseas eliminar?",deleteThisOccurrence:"Eliminar solo esta ocurrencia",deleteThisAndFuture:"Eliminar esta y todas las ocurrencias futuras",deleteAllOccurrences:"Eliminar todas las ocurrencias",deleteThisOccurrenceDescription:"Solo se eliminará esta fecha específica",deleteThisAndFutureDescription:"Se eliminarán esta y todas las fechas futuras",deleteAllOccurrencesDescription:"Se eliminará todo el evento recurrente",editRecurringEventTitle:"Editar Evento Recurrente",editRecurringEventDescription:"Este es un evento recurrente. ¿Te gustaría editar todas las ocurrencias, solo esta, o esta y las futuras ocurrencias?",editThisOccurrence:"Editar solo esta ocurrencia",editThisOccurrenceDescription:"Hacer cambios solo a esta ocurrencia específica del evento",editThisAndFuture:"Editar esta y las ocurrencias futuras",editThisAndFutureDescription:"Hacer cambios a esta y todas las ocurrencias futuras",editAllOccurrences:"Editar todas las ocurrencias",editAllOccurrencesDescription:"Hacer cambios a todas las ocurrencias de este evento",from:"desde",to:"hasta",pickADate:"Seleccionar fecha",errorEndDateBeforeStart:"La fecha de fin no puede ser anterior a la fecha de inicio",selectAColor:"Seleccionar color",validations:{eventNameRequired:"El título del evento es obligatorio",invalidTimeFormat:"Formato de hora inválido",colorRequired:"El color es obligatorio",endTimeBeforeStart:"La hora de fin no puede ser anterior a la hora de inicio"}},e.filterEventsByColors=(e,t)=>e.filter(e=>t.includes(e.color)),e.formatEventTime=vT,e.fr={language:"fr",today:"Aujourd'hui",thisWeek:"Cette semaine",thisMonth:"Ce mois",thisYear:"Cette année",dayNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],fullDayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],viewBy:"Afficher par",day:"Jour",week:"Semaine",month:"Mois",year:"Année",list:"Liste",addEvent:"+ Événement",editEvent:"Modifier l'événement",deleteEvent:"Supprimer l'événement",eventTitle:"Titre de l'événement",eventDescription:"Description",eventColor:"Couleur",eventDate:"Date",eventStartTime:"Heure de début",eventEndTime:"Heure de fin",eventEndDate:"Date de fin",eventIsRepeating:"Événement récurrent",eventAdded:"Événement ajouté",eventUpdated:"Événement mis à jour",eventDeleted:"Événement supprimé",eventRestored:"Événement restauré",eventUpdateUndone:"Modification annulée",failedToAddEvent:"Échec de l'ajout",failedToUpdateEvent:"Échec de la mise à jour",failedToDeleteEvent:"Échec de la suppression",failedToFetchEvents:"Échec du chargement des événements",errorCannotExcludeAllDates:"Impossible d'exclure toutes les dates de la plage",save:"Enregistrer",saving:"Enregistrement",cancel:"Annuler",delete:"Supprimer",deleting:"Suppression",undo:"Annuler",tryAgain:"Réessayer",close:"Fermer",search:"Rechercher",searchEvents:"Rechercher des événements...",noEvents:"Aucun événement",allDay:"Toute la journée",fullDayEvents:"Événements journée complète",loadingEvents:"Chargement des événements...",filterByColor:"Filtrer par couleur",filter:"Filtrer",filtering:"Filtrage",more:"plus",use24HourFormat:"Format 24 heures",repeatingEvent:"Événement récurrent",multiDayEvent:"Événement sur plusieurs jours",extendsOutOfRange:"S'étend au-delà de la vue actuelle",displayCalendar:"Afficher le calendrier",displayList:"Afficher la liste",dayXofY:"Jour {x} sur {y}",repeatXofY:"#{x} sur {y}",starts:"Début",ends:"Fin",untitledEvent:"Événement sans titre",repeatDaily:"Quotidien",repeatWeekly:"Hebdomadaire",repeatMonthly:"Mensuel",repeatingEventQuestion:"Événement répétitif ?",repeatDailyDescription:"Se répète quotidiennement à {timeRange} du {startDate} au {endDate}",repeatWeeklyDescription:"Se répète chaque {dayName} à {timeRange} du {startDate} au {endDate}",repeatMonthlyDescription:"Se répète le {dayOfMonth} de chaque mois à {timeRange} du {startDate} au {endDate}",withExcludedDates:"avec {count} date{s} exclue{s}",excludedDates:"Dates exclues?",excludedDatesDescription:"Sélectionnez les dates à exclure du modèle récurrent",skipDays:"Jours à sauter :",clearAll:"Tout effacer",selectDatesToExclude:"Sélectionner des dates à exclure",selectAll:"Tout sélectionner",noMatchingDates:"Aucune date ne correspond à ce modèle de répétition",noSearchResults:'Aucun résultat trouvé pour "{query}"',searchMonthPlaceholder:"Rechercher un mois...",ofExcluded:"{count} sur {total} exclues",pageCount:"{current}/{total}",weeklyIntervalLabel:"Chaque {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Le {dayOfMonth} de chaque mois ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Modifiez les détails de votre événement.",createEventDescription:"Créez un nouvel événement dans votre calendrier.",timePresetAllDay:"Toute la journée",timePresetEarlyMorning:"Tôt le matin",timePresetMorning:"Matin",timePresetLunch:"Déjeuner",timePresetEarlyAfternoon:"Début d'après-midi",timePresetLateAfternoon:"Fin d'après-midi",timePresetEvening:"Soirée",timePresetNight:"Nuit",selectDate:"Choisir une date",selectColor:"Sélectionner une couleur",confirmDelete:"Êtes-vous sûr ?",confirmDeleteDescription:"Voulez-vous supprimer cet événement ?",repeatEventDeleteTitle:"Supprimer un événement récurrent",repeatEventDeleteDescription:"Il s'agit d'un événement récurrent. Que souhaitez-vous supprimer ?",deleteThisOccurrence:"Supprimer uniquement cette occurrence",deleteThisAndFuture:"Supprimer celle-ci et toutes les occurrences futures",deleteAllOccurrences:"Supprimer toutes les occurrences",deleteThisOccurrenceDescription:"Seule cette date spécifique sera supprimée",deleteThisAndFutureDescription:"Cette date et toutes les dates futures seront supprimées",deleteAllOccurrencesDescription:"L'événement récurrent entier sera supprimé",editRecurringEventTitle:"Modifier un événement récurrent",editRecurringEventDescription:"Il s'agit d'un événement récurrent. Souhaitez-vous modifier toutes les occurrences, uniquement celle-ci, ou celle-ci et les occurrences futures ?",editThisOccurrence:"Modifier uniquement cette occurrence",editThisOccurrenceDescription:"Apporter des modifications uniquement à cette occurrence spécifique",editThisAndFuture:"Modifier celle-ci et les occurrences futures",editThisAndFutureDescription:"Apporter des modifications à cette occurrence et à toutes les occurrences futures",editAllOccurrences:"Modifier toutes les occurrences",editAllOccurrencesDescription:"Apporter des modifications à toutes les occurrences de cet événement",from:"de",to:"à",pickADate:"Choisir une date",errorEndDateBeforeStart:"La date de fin ne peut pas être antérieure à la date de début",selectAColor:"Sélectionner une couleur",validations:{eventNameRequired:"Le titre de l'événement est requis",invalidTimeFormat:"Format d'heure invalide",colorRequired:"La couleur est requise",endTimeBeforeStart:"L'heure de fin ne peut pas être antérieure à l'heure de début"}},e.getEventColor=gT,e.l33t={language:"l33t",today:"T0d4y",thisWeek:"D1s W33k",thisMonth:"D1s M0nth",thisYear:"D1s Y34r",dayNames:["5un","M0n","Tu3","W3d","Thu","Fr1","54t"],fullDayNames:["5und4y","M0nd4y","Tu35d4y","W3dn35d4y","Thur5d4y","Fr1d4y","54turd4y"],monthNames:["J4nu4ry","F3bru4ry","M4rch","4pr1l","M4y","Jun3","Ju1y","4ugu5t","53pt3mb3r","0ct0b3r","N0v3mb3r","D3c3mb3r"],viewBy:"V13w By",day:"D4y",week:"W33k",month:"M0nth",year:"Y34r",list:"L15t",addEvent:"4dd 3v3nt",editEvent:"3d1t 3v3nt",deleteEvent:"D3l3t3 3v3nt",eventTitle:"3v3nt T1tl3",eventDescription:"D35cr1pt10n",eventColor:"3v3nt C0l0r",eventDate:"D4t3",eventStartTime:"5t4rt T1m3",eventEndTime:"3nd T1m3",eventEndDate:"3nd D4t3",eventIsRepeating:"R3p34t1ng 3v3nt",eventAdded:"3v3nt 4dd3d",eventUpdated:"3v3nt upd4t3d",eventDeleted:"3v3nt pwn3d",eventRestored:"3v3nt r35t0r3d",eventUpdateUndone:"3v3nt upd4t3 und0n3",failedToAddEvent:"F41l3d 2 4dd 3v3nt",failedToUpdateEvent:"F41l3d 2 upd4t3 3v3nt",failedToDeleteEvent:"F41l3d 2 pwn 3v3nt",failedToFetchEvents:"F41l3d 2 f3tch 3v3nt5",errorCannotExcludeAllDates:"C4nn0t 3xclud3 4ll d4t3z 1n r4ng3",save:"54v3",saving:"S4v1ng",cancel:"C4nc3l",delete:"Pwn",deleting:"D3l3t1ng",undo:"Und0",tryAgain:"Try 4g41n",close:"Cl053",search:"534rch",searchEvents:"534rch 3v3nt5...",noEvents:"N0 3v3nt5",allDay:"4ll D4y",fullDayEvents:"Full-D4y 3v3nt5",loadingEvents:"L04d1ng 3v3nt5...",filterByColor:"F1lt3r by C0l0r",filter:"F1lt3r",filtering:"F1lt3r1ng",more:"m0r3",use24HourFormat:"U53 24-h0ur f0rm4t",repeatingEvent:"R3p34t1ng 3v3nt",multiDayEvent:"Mult1-d4y 3v3nt",extendsOutOfRange:"3xt3nd5 b3y0nd v13w",displayCalendar:"5h0w C4l3nd4r",displayList:"5h0w L15t",dayXofY:"D4y {x} 0f {y}",repeatXofY:"#{x} 0f {y}",starts:"5t4rt5",ends:"3nd5",untitledEvent:"Unt1tl3d 3v3nt",repeatDaily:"D41ly",repeatWeekly:"W33kly",repeatMonthly:"M0n7hly",repeatingEventQuestion:"R3p34t1ng 3v3n7?",repeatDailyDescription:"R3p34tz d41ly 47 {timeRange} fr0m {startDate} 70 {endDate}",repeatWeeklyDescription:"R3p34tz 3v3ry {dayName} 47 {timeRange} fr0m {startDate} 70 {endDate}",repeatMonthlyDescription:"R3p34tz 0n 7h3 {dayOfMonth} 0f 34ch m0n7h 47 {timeRange} fr0m {startDate} 70 {endDate}",withExcludedDates:"w17h {count} 3xclud3d d4t3{s}",excludedDates:"3xclud3d D473z?",excludedDatesDescription:"53l3c7 d473z 2 3xclud3 fr0m r3curr1ng p4773rn",skipDays:"5k1p D4yz:",clearAll:"Cl34r 4ll",selectDatesToExclude:"53l3c7 d473z 2 3xclud3",selectAll:"53l3c7 4ll",noMatchingDates:"N0 d473z m47ch d15 r3p347 p4773rn",noSearchResults:'N0 m47ch3z f0und 4 "{query}"',searchMonthPlaceholder:"534rch m0n7h...",ofExcluded:"{count} 0f {total} 3xclud3d",pageCount:"{current}/{total}",weeklyIntervalLabel:"{dayName}z ({startDate} - {endDate})",monthlyIntervalLabel:"{dayOfMonth} 0f 34ch m0n7h ({startDate} - {endDate})",dateButtonFormat:"MMM d",editEventDescription:"3d1t ur 3v3nt d3t41l5",createEventDescription:"Cr34t3 4 n3w 3v3nt",timePresetAllDay:"4ll D4y",timePresetEarlyMorning:"34rly M0rn1ng",timePresetMorning:"M0rn1ng",timePresetLunch:"Lunch T1m3",timePresetEarlyAfternoon:"34rly 4ft3rn00n",timePresetLateAfternoon:"L4t3 4ft3rn00n",timePresetEvening:"3v3n1ng",timePresetNight:"N1ght",selectDate:"P1ck 4 d4t3",selectColor:"53l3ct 4 c0l0r",confirmDelete:"U 5ur3?",confirmDeleteDescription:"U w4nt 2 pwn d15 3v3nt?",repeatEventDeleteTitle:"D3l3t3 R3p34t1ng 3v3nt",repeatEventDeleteDescription:"D15 15 4 r3p34t1ng 3v3nt. Wh4t U w4nt 2 pwn?",deleteThisOccurrence:"Pwn 0nly d15 0ccurr3nc3",deleteThisAndFuture:"Pwn d15 & 4ll futur3 0ccurr3nc3z",deleteAllOccurrences:"Pwn 4ll 0ccurr3nc3z",deleteThisOccurrenceDescription:"0nly d15 5p3c1f1c d4t3 w1ll b3 r3m0v3d",deleteThisAndFutureDescription:"D15 & 4ll futur3 d4t3z w1ll b3 pwn3d",deleteAllOccurrencesDescription:"D4 3nt1r3 r3p34t1ng 3v3nt w1ll b3 pwn3d",editRecurringEventTitle:"3d1t R3p34t1ng 3v3nt",editRecurringEventDescription:"D15 15 4 r3curr1ng 3v3nt. W0uld U l1k3 2 3d1t 4ll 0ccurr3nc3z, ju5t d15 1, 0r d15 & futur3 0n3z?",editThisOccurrence:"3d1t d15 0ccurr3nc3 0nly",editThisOccurrenceDescription:"M4k3 ch4ng3z 0nly 2 d15 5p3c1f1c 3v3nt 0ccurr3nc3",editThisAndFuture:"3d1t d15 & futur3 0ccurr3nc3z",editThisAndFutureDescription:"M4k3 ch4ng3z 2 d15 & 4ll futur3 0ccurr3nc3z",editAllOccurrences:"3d1t 4ll 0ccurr3nc3z",editAllOccurrencesDescription:"M4k3 ch4ng3z 2 4ll 0ccurr3nc3z 0f d15 3v3nt",from:"fr0m",to:"2",pickADate:"P1ck 4 d4t3",errorEndDateBeforeStart:"3nd d4t3 c4nt b3 b4 5t4rt d4t3",selectAColor:"53l3ct 4 c0l0r",validations:{eventNameRequired:"3v3nt n4m3 r3qu1r3d",invalidTimeFormat:"1nv4l1d t1m3 f0rm4t",colorRequired:"c0l0r r3qu1r3d",endTimeBeforeStart:"3nd t1m3 c4nt b3 b4 5t4rt t1m3"}},e.nbNO={language:"nb",today:"I dag",thisWeek:"Denne uken",thisMonth:"Denne måneden",thisYear:"Dette året",dayNames:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],fullDayNames:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],monthNames:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],viewBy:"Vis etter",day:"Dag",week:"Uke",month:"Måned",year:"År",list:"Liste",addEvent:"Ny hendelse",editEvent:"Rediger hendelse",deleteEvent:"Slett hendelse",eventTitle:"Hendelsestittel",eventDescription:"Beskrivelse",eventColor:"Farge",eventDate:"Dato",eventStartTime:"Starttid",eventEndTime:"Sluttid",eventEndDate:"Sluttdato",eventIsRepeating:"Gjentakende hendelse",eventAdded:"Hendelse lagt til",eventUpdated:"Hendelse oppdatert",eventDeleted:"Hendelse slettet",eventRestored:"Hendelse gjenopprettet",eventUpdateUndone:"Hendelsesoppdatering angret",failedToAddEvent:"Kunne ikke legge til hendelse",failedToUpdateEvent:"Kunne ikke oppdatere hendelse",failedToDeleteEvent:"Kunne ikke slette hendelse",failedToFetchEvents:"Kunne ikke hente hendelser",errorCannotExcludeAllDates:"Kan ikke utelukke alle datoer i området",save:"Lagre",saving:"Lagrer",cancel:"Avbryt",delete:"Slett",deleting:"Sletter",undo:"Angre",tryAgain:"Prøv igjen",close:"Lukk",search:"Søk",searchEvents:"Søk i hendelser...",noEvents:"Ingen hendelser",allDay:"Hele dagen",fullDayEvents:"Heldagshendelser",loadingEvents:"Laster hendelser...",filterByColor:"Filtrer etter farge",filter:"Filter",filtering:"Filtrerer",more:"mer",use24HourFormat:"Bruk 24-timers format",repeatingEvent:"Gjentakende hendelse",multiDayEvent:"Flerdagshendelse",extendsOutOfRange:"Strekker seg utover gjeldende visning",displayCalendar:"Vis kalender",displayList:"Vis liste",dayXofY:"Dag {x} av {y}",repeatXofY:"#{x} av {y}",starts:"Starter",ends:"Slutter",untitledEvent:"Hendelse uten tittel",repeatDaily:"Daglig",repeatWeekly:"Ukentlig",repeatMonthly:"Månedlig",repeatingEventQuestion:"Gjentagende hendelse?",repeatDailyDescription:"Gjentas daglig kl. {timeRange} fra {startDate} til {endDate}",repeatWeeklyDescription:"Gjentas hver {dayName} kl. {timeRange} fra {startDate} til {endDate}",repeatMonthlyDescription:"Gjentas den {dayOfMonth}. hver måned kl. {timeRange} fra {startDate} til {endDate}",withExcludedDates:"med {count} utelukket dato{s}",excludedDates:"Utelukkede datoer?",excludedDatesDescription:"Velg datoer for å utelukke fra det gjentakende mønsteret",skipDays:"Hopp over dager:",clearAll:"Fjern alle",selectDatesToExclude:"Velg datoer å utelukke",selectAll:"Velg alle",noMatchingDates:"Ingen datoer samsvarer med dette gjentakelsesmønsteret",noSearchResults:'Ingen resultater funnet for "{query}"',searchMonthPlaceholder:"Søk måned...",ofExcluded:"{count} av {total} utelukket",pageCount:"{current}/{total}",weeklyIntervalLabel:"Hver {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Den {dayOfMonth}. hver måned ({startDate} - {endDate})",dateButtonFormat:"d. MMM",editEventDescription:"Rediger hendelsesdetaljene dine.",createEventDescription:"Opprett en ny hendelse i kalenderen din.",timePresetAllDay:"Hele dagen",timePresetEarlyMorning:"Tidlig morgen",timePresetMorning:"Morgen",timePresetLunch:"Lunsj",timePresetEarlyAfternoon:"Tidlig ettermiddag",timePresetLateAfternoon:"Sen ettermiddag",timePresetEvening:"Kveld",timePresetNight:"Natt",selectDate:"Velg en dato",selectColor:"Velg en farge",confirmDelete:"Er du sikker?",confirmDeleteDescription:"Vil du slette denne hendelsen?",repeatEventDeleteTitle:"Slett gjentakende hendelse",repeatEventDeleteDescription:"Dette er en gjentakende hendelse. Hva ønsker du å slette?",deleteThisOccurrence:"Slett kun denne forekomsten",deleteThisAndFuture:"Slett denne og alle fremtidige forekomster",deleteAllOccurrences:"Slett alle forekomster",deleteThisOccurrenceDescription:"Kun denne spesifikke datoen vil bli fjernet",deleteThisAndFutureDescription:"Denne og alle fremtidige datoer vil bli fjernet",deleteAllOccurrencesDescription:"Hele den gjentakende hendelsen vil bli fjernet",editRecurringEventTitle:"Rediger gjentakende hendelse",editRecurringEventDescription:"Dette er en gjentakende hendelse. Ønsker du å redigere alle forekomster, bare denne, eller denne og fremtidige forekomster?",editThisOccurrence:"Rediger kun denne forekomsten",editThisOccurrenceDescription:"Gjør endringer kun for denne spesifikke hendelsesforekomsten",editThisAndFuture:"Rediger denne og fremtidige forekomster",editThisAndFutureDescription:"Gjør endringer for denne og alle fremtidige forekomster",editAllOccurrences:"Rediger alle forekomster",editAllOccurrencesDescription:"Gjør endringer for alle forekomster av denne hendelsen",from:"fra",to:"til",pickADate:"Velg en dato",errorEndDateBeforeStart:"Sluttdato kan ikke være før startdato",selectAColor:"Velg en farge",validations:{eventNameRequired:"Hendelsestittel er påkrevd",invalidTimeFormat:"Ugyldig tidsformat",colorRequired:"Farge er påkrevd",endTimeBeforeStart:"Sluttid kan ikke være før starttid"}},e.ptBR={language:"pt",today:"Hoje",thisWeek:"Esta Semana",thisMonth:"Este Mês",thisYear:"Este Ano",dayNames:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],fullDayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],viewBy:"Visualizar por",day:"Dia",week:"Semana",month:"Mês",year:"Ano",list:"Lista",addEvent:"+ Evento",editEvent:"Editar Evento",deleteEvent:"Excluir Evento",eventTitle:"Título do Evento",eventDescription:"Descrição",eventColor:"Cor do Evento",eventDate:"Data",eventStartTime:"Hora de Início",eventEndTime:"Hora de Término",eventEndDate:"Data de Término",eventIsRepeating:"Evento Recorrente",eventAdded:"Evento adicionado",eventUpdated:"Evento atualizado",eventDeleted:"Evento excluído",eventRestored:"Evento restaurado",eventUpdateUndone:"Atualização do evento desfeita",failedToAddEvent:"Falha ao adicionar evento",failedToUpdateEvent:"Falha ao atualizar evento",failedToDeleteEvent:"Falha ao excluir evento",failedToFetchEvents:"Falha ao carregar eventos",errorCannotExcludeAllDates:"Não é possível excluir todas as datas no intervalo",save:"Salvar",saving:"Salvando",cancel:"Cancelar",delete:"Excluir",deleting:"Excluindo",undo:"Desfazer",tryAgain:"Tentar novamente",close:"Fechar",search:"Buscar",searchEvents:"Buscar eventos...",noEvents:"Sem eventos",allDay:"Dia Inteiro",fullDayEvents:"Eventos de Dia Inteiro",loadingEvents:"Carregando eventos...",filterByColor:"Filtrar por Cor",filter:"Filtrar",filtering:"Filtrando",more:"mais",use24HourFormat:"Usar formato 24 horas",repeatingEvent:"Evento recorrente",multiDayEvent:"Evento de vários dias",extendsOutOfRange:"Estende-se além da visualização atual",displayCalendar:"Exibir Calendário",displayList:"Exibir Lista",dayXofY:"Dia {x} de {y}",repeatXofY:"#{x} de {y}",starts:"Início",ends:"Término",untitledEvent:"Evento sem título",repeatDaily:"Diariamente",repeatWeekly:"Semanalmente",repeatMonthly:"Mensalmente",repeatingEventQuestion:"Evento recorrente?",repeatDailyDescription:"Repete diariamente às {timeRange} de {startDate} até {endDate}",repeatWeeklyDescription:"Repete toda(o) {dayName} às {timeRange} de {startDate} até {endDate}",repeatMonthlyDescription:"Repete todo dia {dayOfMonth} do mês às {timeRange} de {startDate} até {endDate}",withExcludedDates:"com {count} data{s} excluída{s}",excludedDates:"Datas excluídas?",excludedDatesDescription:"Selecione datas para excluir do padrão recorrente",skipDays:"Pular Dias:",clearAll:"Limpar tudo",selectDatesToExclude:"Selecionar datas para excluir",selectAll:"Selecionar Tudo",noMatchingDates:"Nenhuma data corresponde a este padrão de repetição",noSearchResults:'Nenhum resultado encontrado para "{query}"',searchMonthPlaceholder:"Pesquisar mês...",ofExcluded:"{count} de {total} excluídas",pageCount:"{current}/{total}",weeklyIntervalLabel:"Toda(o) {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Dia {dayOfMonth} de cada mês ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Edite os detalhes do seu evento.",createEventDescription:"Crie um novo evento no seu calendário.",timePresetAllDay:"Dia Inteiro",timePresetEarlyMorning:"Início da Manhã",timePresetMorning:"Manhã",timePresetLunch:"Almoço",timePresetEarlyAfternoon:"Início da Tarde",timePresetLateAfternoon:"Fim da Tarde",timePresetEvening:"Noite",timePresetNight:"Madrugada",selectDate:"Escolha uma data",selectColor:"Selecione uma cor",confirmDelete:"Tem certeza?",confirmDeleteDescription:"Deseja excluir este evento?",repeatEventDeleteTitle:"Excluir Evento Recorrente",repeatEventDeleteDescription:"Este é um evento recorrente. O que você deseja excluir?",deleteThisOccurrence:"Excluir apenas esta ocorrência",deleteThisAndFuture:"Excluir esta e todas as ocorrências futuras",deleteAllOccurrences:"Excluir todas as ocorrências",deleteThisOccurrenceDescription:"Apenas esta data específica será removida",deleteThisAndFutureDescription:"Esta e todas as datas futuras serão removidas",deleteAllOccurrencesDescription:"Todo o evento recorrente será removido",editRecurringEventTitle:"Editar Evento Recorrente",editRecurringEventDescription:"Este é um evento recorrente. Deseja editar todas as ocorrências, apenas esta, ou esta e as ocorrências futuras?",editThisOccurrence:"Editar apenas esta ocorrência",editThisOccurrenceDescription:"Fazer alterações apenas nesta ocorrência específica do evento",editThisAndFuture:"Editar esta e as ocorrências futuras",editThisAndFutureDescription:"Fazer alterações nesta e em todas as ocorrências futuras",editAllOccurrences:"Editar todas as ocorrências",editAllOccurrencesDescription:"Fazer alterações em todas as ocorrências deste evento",from:"de",to:"até",pickADate:"Escolha uma data",errorEndDateBeforeStart:"A data de término não pode ser anterior à data de início",selectAColor:"Selecione uma cor",validations:{eventNameRequired:"Nome do evento é obrigatório",invalidTimeFormat:"Formato de hora inválido",colorRequired:"Cor é obrigatória",endTimeBeforeStart:"O horário de término não pode ser anterior ao horário de início"}},e.svSE={language:"svSE",today:"Idag",thisWeek:"Denna vecka",thisMonth:"Denna månad",thisYear:"Detta år",dayNames:["Sön","Mån","Tis","Ons","Tors","Fre","Lör"],fullDayNames:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"],monthNames:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],viewBy:"Visa efter",day:"Dag",week:"Vecka",month:"Månad",year:"År",list:"Lista",addEvent:"Ny händelse",editEvent:"Redigera händelse",deleteEvent:"Ta bort händelse",eventTitle:"Händelsetitel",eventDescription:"Beskrivning",eventColor:"Händelsefärg",eventDate:"Startar",eventStartTime:"Klockan",eventEndTime:"Klockan",eventEndDate:"Slutar",eventIsRepeating:"Återkommande händelse",eventAdded:"Händelse tillagd",eventUpdated:"Händelse uppdaterad",eventDeleted:"Händelse borttagen",eventRestored:"Händelse återställd",eventUpdateUndone:"Händelseuppdatering ångrad",failedToAddEvent:"Kunde inte lägga till händelse",failedToUpdateEvent:"Kunde inte uppdatera händelse",failedToDeleteEvent:"Kunde inte ta bort händelse",failedToFetchEvents:"Kunde inte hämta händelser",errorCannotExcludeAllDates:"Kan inte undanta alla datum i intervallen",save:"Spara",saving:"Sparar",cancel:"Avbryt",delete:"Ta bort",deleting:"Raderar",undo:"Ångra",tryAgain:"Försök igen",close:"Stäng",search:"Sök",searchEvents:"Sök händelser...",noEvents:"Inga händelser",allDay:"Heldag",fullDayEvents:"Heldagshändelser",loadingEvents:"Laddar händelser...",filterByColor:"Filtrera efter färg",filter:"Filtrera",filtering:"Filtrerar",more:"mer",use24HourFormat:"Använd 24-timmarsformat",repeatingEvent:"Återkommande händelse",multiDayEvent:"Flerdagshändelse",extendsOutOfRange:"Sträcker sig utanför aktuell vy",displayCalendar:"Visa kalender",displayList:"Visa lista",dayXofY:"Dag {x} av {y}",repeatXofY:"#{x} av {y}",starts:"Börjar",ends:"Slutar",untitledEvent:"Namnlös händelse",repeatDaily:"Dagligen",repeatWeekly:"Veckovis",repeatMonthly:"Månadsvis",repeatingEventQuestion:"Återkommande händelse?",repeatDailyDescription:"Upprepas dagligen kl. {timeRange} från {startDate} till {endDate}",repeatWeeklyDescription:"Upprepas varje {dayName} kl. {timeRange} från {startDate} till {endDate}",repeatMonthlyDescription:"Upprepas den {dayOfMonth}:e varje månad kl. {timeRange} från {startDate} till {endDate}",withExcludedDates:"med {count} undantagna datum",excludedDates:"Undantagna datum?",excludedDatesDescription:"Välj datum att undanta från det återkommande mönstret",skipDays:"Hoppa över dagar:",clearAll:"Rensa alla",selectDatesToExclude:"Välj datum att undanta",selectAll:"Välj alla",noMatchingDates:"Inga datum matchar detta upprepningsmönster",noSearchResults:'Inga resultat hittades för "{query}"',searchMonthPlaceholder:"Sök månad...",ofExcluded:"{count} av {total} undantagna",pageCount:"{current}/{total}",weeklyIntervalLabel:"Varje {dayName} ({startDate} - {endDate})",monthlyIntervalLabel:"Den {dayOfMonth}:e varje månad ({startDate} - {endDate})",dateButtonFormat:"d MMM",editEventDescription:"Redigera dina händelsedetaljer.",createEventDescription:"Skapa en ny händelse i din kalender.",timePresetAllDay:"Heldag",timePresetEarlyMorning:"Tidig morgon",timePresetMorning:"Morgon",timePresetLunch:"Lunch",timePresetEarlyAfternoon:"Tidig eftermiddag",timePresetLateAfternoon:"Sen eftermiddag",timePresetEvening:"Kväll",timePresetNight:"Natt",selectDate:"Välj ett datum",selectColor:"Välj en färg",confirmDelete:"Är du säker?",confirmDeleteDescription:"Vill du ta bort den här händelsen?",repeatEventDeleteTitle:"Ta bort återkommande händelse",repeatEventDeleteDescription:"Detta är en återkommande händelse. Vad vill du ta bort?",deleteThisOccurrence:"Ta bort endast denna förekomst",deleteThisAndFuture:"Ta bort denna och alla framtida förekomster",deleteAllOccurrences:"Ta bort alla förekomster",deleteThisOccurrenceDescription:"Endast detta specifika datum kommer att tas bort",deleteThisAndFutureDescription:"Detta och alla framtida datum kommer att tas bort",deleteAllOccurrencesDescription:"Hela den återkommande händelsen kommer att tas bort",editRecurringEventTitle:"Redigera återkommande händelse",editRecurringEventDescription:"Detta är en återkommande händelse. Vill du redigera alla förekomster, bara denna, eller denna och framtida förekomster?",editThisOccurrence:"Redigera endast denna förekomst",editThisOccurrenceDescription:"Gör ändringar endast för denna specifika händelseförekomst",editThisAndFuture:"Redigera denna och framtida förekomster",editThisAndFutureDescription:"Gör ändringar för denna och alla framtida förekomster",editAllOccurrences:"Redigera alla förekomster",editAllOccurrencesDescription:"Gör ändringar för alla förekomster av denna händelse",from:"från",to:"till",pickADate:"Välj ett datum",errorEndDateBeforeStart:"Slutdatum kan inte vara före startdatum",selectAColor:"Välj en färg",validations:{eventNameRequired:"Händelsetitel krävs",invalidTimeFormat:"Ogiltigt tidsformat",colorRequired:"Färg krävs",endTimeBeforeStart:"Sluttid kan inte vara före starttid"}},e.useEventCalendar=RT}(dnt);var pnt=function(e){var t=e.configurationItemInfo,r=f(e,["configurationItemInfo"]),n=dnt.useEventCalendar({initialEvents:r.events,onEventAdd:function(e){return m(void 0,void 0,void 0,function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventCreate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,h(h({},e),{id:Date.now().toString()})]}})})},onEventUpdate:function(e){return m(void 0,void 0,void 0,function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventUpdate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,e]}})})},onEventDelete:r.onEventDelete,onDateRangeChange:r.onDateRangeChange}),o=n.events,a=n.isLoading,i=n.addEvent,s=n.updateEvent,l=n.deleteEvent,c=n.onViewOrDateChange;return je(rp,h({sx:r.css},t,{className:"fec-wrapper"},{children:je(dnt.EventCalendar,{events:o,isLoading:a,config:r.config,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})}))},hnt={exports:{}};const fnt={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};hnt.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(fnt,t)?fnt[t]:void 0},hnt.exports.currencySymbolMap=fnt;var mnt=function(t){var r,n,o=t.required,a=void 0!==o&&o,i=t.requiredErrorText,s=void 0===i?"This field is required":i,l=t.validationErrorText,c=void 0===l?"Invalid numeric value":l,d=t.isDisplayOnly,u=void 0!==d&&d,p=t.backgroundColor,f=t.textAlign,m=void 0===f?"left":f,v=t.textColor,y=void 0===v?"inherit":v,g=t.fontSize,x=void 0===g?"16px":g,b=t.fontFamily,k=void 0===b?"inherit":b,_=t.fontWeight,w=void 0===_?"normal":_,M=t.borderColor,C=t.marginLeft,D=void 0===C?"0":C,j=t.marginTop,O=void 0===j?"0":j,S=t.marginRight,P=void 0===S?"0":S,E=t.marginBottom,T=void 0===E?"0":E,N=t.paddingLeft,z=void 0===N?"0":N,A=t.paddingTop,R=void 0===A?"0":A,F=t.paddingRight,L=void 0===F?"0":F,B=t.paddingBottom,V=void 0===B?"0":B,I=t.width,q=t.height,H=t.minHeight,$=t.maxHeight,W=t.minWidth,U=t.maxWidth,Y=t.text,Z=t.placeholderText,K=t.configurationItemInfo,G=t.name,X=t.numericPrecision,Q=void 0===X?"1":X,J=t.currency,ee=t.placement,te=void 0===ee?"left":ee,re=t.sourceDataModelField,ne=HS(),oe=null==ne?void 0:ne.control,ae=Hnt().localStateObject,ie=Ynt().stateConfig,se=ae||ie,le=e.useState(""),ce=le[0],de=le[1],ue=!!oe&&!!G,pe=re?null===(r=null==se?void 0:se[re])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==pe&&(ue?ne.setValue(G,pe):de(String(null!=pe?pe:"")))},[pe,ue,ne,G]);var he=Number.isFinite(+Q)&&+Q>0?+Q:1,fe=J?null!==(n=hnt.exports(J.toUpperCase()))&&void 0!==n?n:J.toUpperCase():"",me={required:!!a&&s,pattern:{value:/^-?\d+(?:\.\d+)?$/,message:c}},ve=h(h(h(h(h(h(h({backgroundColor:p,color:y,fontSize:x,fontFamily:k,fontWeight:w},I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),H&&{minHeight:H}),$&&{maxHeight:$}),{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:M},"&:hover fieldset":{borderColor:M},"&.Mui-focused fieldset":{borderColor:M},"&.Mui-disabled fieldset":{borderColor:M}},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V}}),ye={color:y,"&.Mui-focused":{color:y}},ge={marginLeft:D,marginTop:O,marginRight:P,marginBottom:T,display:"inline-flex",flexDirection:"column"},xe=fe?je("span",h({style:{color:y,fontWeight:w}},{children:fe})):null;if(u){var be=ue?ne.watch(G):pe,ke=null!=be?be:"-";return Oe(rp,h({sx:h(h(h(h(h(h(h({},ge),I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),H&&{minHeight:H}),$&&{maxHeight:$})},K,{children:[Y&&je(Nf,h({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,marginLeft:0}},{children:Y})),je(gc,h({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,backgroundColor:p,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V,border:"1px solid ".concat(M||"#ccc"),borderRadius:"4px",minWidth:"100px"}},{children:"left"===te?"".concat(fe).concat(ke):"".concat(ke).concat(fe)}))]}))}var _e=function(e,t){return je(Lb,h({type:"number",label:Y,required:a,placeholder:Z,variant:"outlined",sx:ge,inputProps:{step:he},slotProps:{input:{sx:ve,style:{textAlign:m}},inputLabel:{sx:ye}},InputProps:{startAdornment:"left"===te&&xe?je(em,h({position:"start"},{children:xe})):void 0,endAdornment:"right"===te&&xe?je(em,h({position:"end"},{children:xe})):void 0},error:!!t,helperText:t||null},e,K))};return ue?je(GS,{name:G,rules:me,control:oe,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return _e(r,null===(t=n.error)||void 0===t?void 0:t.message)}}):_e({value:ce,onChange:function(e){return de(e.target.value)}})},vnt=e.forwardRef(function(e,t){var r=e.inputRef,n=f(e,["inputRef"]);return je(zk,h({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:p_,guide:!0,placeholderChar:" "}))}),ynt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=f(e,["masked","errorMsg","inputSx","labelSx"]);return je(Lb,h({},a,{variant:"outlined",error:!!r,helperText:r||null,type:"text",slotProps:{input:h({sx:n},t?{inputComponent:vnt}:{}),inputLabel:{sx:o}}}))},gnt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Email is required":s,c=t.validationErrorText,d=void 0===c?"Invalid email address":c,u=t.text,p=t.placeholderText,f=t.masked,m=void 0!==f&&f,v=t.multiLine,y=void 0!==v&&v,g=t.backgroundColor,x=t.borderColor,b=t.color,k=void 0===b?"inherit":b,_=t.fontSize,w=void 0===_?"16px":_,M=t.fontFamily,C=void 0===M?"inherit":M,D=t.fontWeight,j=void 0===D?"normal":D,O=t.textAlign,S=void 0===O?"left":O,P=t.marginLeft,E=void 0===P?"0":P,T=t.marginTop,N=void 0===T?"0":T,z=t.marginRight,A=void 0===z?"0":z,R=t.marginBottom,F=void 0===R?"0":R,L=t.paddingLeft,B=void 0===L?"0":L,V=t.paddingTop,I=void 0===V?"0":V,q=t.paddingRight,H=void 0===q?"0":q,$=t.paddingBottom,W=void 0===$?"0":$,U=t.width,Y=t.height,Z=t.minHeight,K=t.maxHeight,G=t.minWidth,X=t.maxWidth,Q=t.name,J=t.sourceDataModelField,ee=t.configurationItemInfo,te=HS(),re=null==te?void 0:te.control,ne=!(!re||!Q),oe=Hnt().localStateObject,ae=Ynt().stateConfig,ie=oe||ae,se=J?null===(r=null==ie?void 0:ie[J])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==se&&ne&&te.setValue(Q,se)},[se]);var le=e.useState("");le[0],le[1];var ce={required:!!i&&l,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:d}};if(o){var de=(ne?te.watch(Q)||"":se)||p||"-";return Oe("div",h({style:h(h(h({display:"inline-flex",flexDirection:"column",marginLeft:E,marginTop:N,marginRight:A,marginBottom:F},U&&{width:U}),Y&&{height:Y}),{minHeight:Z,maxHeight:K,minWidth:G,maxWidth:X})},ee,{children:[u&&je(Nf,h({sx:{fontSize:w,fontFamily:C,fontWeight:j,color:k,marginLeft:0,marginBottom:"4px"}},{children:u})),je(gc,h({sx:{fontSize:w,fontFamily:C,fontWeight:j,color:k,paddingLeft:B,paddingTop:I,paddingRight:H,paddingBottom:W,backgroundColor:g,border:"1px solid ".concat(x||"#ccc"),borderRadius:"4px",minWidth:"120px",textAlign:S}},{children:de}))]}))}var ue=h(h(h(h(h(h(h({backgroundColor:g,color:k,fontSize:w,fontFamily:C,fontWeight:j},U&&{width:U}),Y&&{height:Y}),G&&{minWidth:G}),X&&{maxWidth:X}),Z&&{minHeight:Z}),K&&{maxHeight:K}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-input":{textAlign:S,paddingLeft:B,paddingTop:I,paddingRight:H,paddingBottom:W}}),pe={color:k,"&.Mui-focused":{color:k}},he=y?3:1;if(ne)return je("div",h({style:{marginLeft:E,marginTop:N,marginRight:A,marginBottom:F}},{children:je(GS,{name:Q,rules:ce,control:re,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return je(ynt,h({masked:m,required:i,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:ue,labelSx:pe,label:u,placeholder:p,multiline:y,minRows:he,value:r.value||"",onChange:r.onChange},ee||{}))}})}));var fe=e.useState(""),me=fe[0],ve=fe[1];return je("div",h({style:{marginLeft:E,marginTop:N,marginRight:A,marginBottom:F}},{children:je(ynt,h({masked:m,required:i,errorMsg:void 0,inputSx:ue,labelSx:pe,label:u,placeholder:p,multiline:y,minRows:he,value:me,onChange:function(e){return ve(e.target.value)}},ee||{}))}))},xnt=function(e){return{justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}},bnt=function(t){var r,n=t.popover,o=void 0===n||n,a=t.items,i=t.marginTop,s=void 0===i?"0":i,l=t.marginRight,c=void 0===l?"0":l,d=t.marginBottom,u=void 0===d?"0":d,p=t.marginLeft,f=void 0===p?"0":p,m=t.paddingTop,v=void 0===m?"0":m,y=t.paddingRight,g=void 0===y?"0":y,x=t.paddingBottom,b=void 0===x?"0":x,k=t.paddingLeft,_=void 0===k?"0":k,w=t.cornerRadius,M=void 0===w?"4px":w,C=t.backgroundColor,D=void 0===C?"#fff":C,j=t.width,O=void 0===j?"100%":j,S=t.height,P=void 0===S?"auto":S,E=t.borderColor,T=void 0===E?"#ccc":E,N=t.borderWeight,z=void 0===N?"1px":N,A=t.buttonText,R=void 0===A?"Open Menu":A,F=t.buttonVariant,L=void 0===F?"contained":F,B=t.buttonTextColor,V=t.buttonFontSize,I=t.buttonFontWeight,q=t.buttonFontFamily,H=t.buttonDisabled,$=void 0!==H&&H,W=t.buttonGap,U=void 0===W?0:W,Y=t.buttonStartIcon,Z=t.buttonEndIcon,K=t.buttonCornerRadius,G=void 0===K?"0":K,X=t.buttonMarginTop,Q=void 0===X?"0":X,J=t.buttonMarginRight,ee=void 0===J?"0":J,te=t.buttonMarginBottom,re=void 0===te?"0":te,ne=t.buttonMarginLeft,oe=void 0===ne?"0":ne,ae=t.buttonPaddingTop,ie=void 0===ae?"0":ae,se=t.buttonPaddingRight,le=void 0===se?"0":se,ce=t.buttonPaddingBottom,de=void 0===ce?"0":ce,ue=t.buttonPaddingLeft,pe=void 0===ue?"0":ue,he=t.buttonIconOnly,fe=t.buttonElevation,me=t.buttonFillColor,ye=t.buttonFillColorDisabled,ge=t.buttonFillColorHover,xe=t.buttonFillColorPressed,be=t.buttonBorderColor,ke=t.buttonBorderColorDisabled,_e=t.buttonBorderColorHover,we=t.buttonBorderColorPressed,Me=t.buttonTextColorDisabled,Ce=t.buttonTextColorHover,De=t.buttonTextColorPressed,Se=t.buttonColor,Pe=void 0===Se?"#1976d2":Se,Ee=t.anchorOriginVertical,Te=void 0===Ee?"bottom":Ee,Ne=t.anchorOriginHorizontal,ze=void 0===Ne?"left":Ne,Ae=t.transformOriginVertical,Re=void 0===Ae?"top":Ae,Fe=t.transformOriginHorizontal,Le=void 0===Fe?"left":Fe,Be=t.elevation,Ve=void 0===Be?3:Be,Ie=t.moleculeId,qe=t.configurationItemInfo,He=ve(),$e=Hnt(),We=$e.isConfigurationMode,Ue=$e.selectedConfigurationItemId,Ye=$e.onConfigurationItemClicked,Ze=$e.onInternalNavigation,Ke=e.useState(null),Ge=Ke[0],Xe=Ke[1],Qe=e.useState(!1),Je=Qe[0],et=Qe[1],tt=Boolean(We&&(Ue===Ie||a.some(function(e){return e.id===Ue}))),rt=function(){return et(!1)},nt=h({marginTop:s,marginRight:c,marginBottom:u,marginLeft:f,paddingTop:v,paddingRight:g,paddingBottom:b,paddingLeft:_},o?{display:"inline-block",zIndex:null===(r=null==He?void 0:He.zIndex)||void 0===r?void 0:r.drawer}:{width:O,height:P,backgroundColor:D,display:"block",overflow:"hidden",border:"".concat(z," solid ").concat(T),borderRadius:M});return o?Oe(rp,{children:[je(R2e,{ref:Xe,text:R,variant:L,moleculeId:Ie,textColor:B,fontSize:V,fontWeight:I,fontFamily:q,disabled:$,gap:U,startIcon:Y,endIcon:Z,onClick:function(){return et(!0)},marginTop:Q,marginRight:ee,marginBottom:re,marginLeft:oe,paddingTop:ie,paddingRight:le,paddingBottom:de,paddingLeft:pe,borderRadius:G,iconOnly:he,elevation:fe,fillColor:me||Pe,fillColorDisabled:ye,fillColorHover:ge,fillColorPressed:xe,borderColor:be,borderColorDisabled:ke,borderColorHover:_e,borderColorPressed:we,textColorDisabled:Me,textColorHover:Ce,textColorPressed:De,configurationItemInfo:qe}),je(iv,h({open:We?tt:Je,variant:"menu",anchorEl:Ge,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:rt,anchorOrigin:{vertical:Te,horizontal:ze},transformOrigin:{vertical:Re,horizontal:Le},elevation:Ve,slotProps:{paper:{sx:{backgroundColor:D}}},sx:nt},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:t4e({theme:He,selected:t})}:{};return Oe(uv,h({sx:xnt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&($tt(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):Htt(null===(r=e.link)||void 0===r?void 0:r.externalLink)),rt()},disabled:e.disabled},a,{children:[e.startIcon&&je(E2e,{iconName:e.startIcon,color:e.textColor}),je(gc,h({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"}},{children:e.text})),e.endIcon&&je(E2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))]}):je(dl,h({id:Ie,sx:nt,elevation:Ve},qe,{children:je(ym,h({disablePadding:!0},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:t4e({theme:He,selected:t})}:{};return Oe(wm,h({disabled:e.disabled,sx:xnt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&($tt(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):Htt(null===(r=e.link)||void 0===r?void 0:r.externalLink))}},a,{children:[e.startIcon&&je(E2e,{iconName:e.startIcon,color:e.textColor}),je(Fm,{primary:je(gc,h({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"}},{children:e.text}))}),e.endIcon&&je(E2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))}))};var knt=function(e){var t=e.errorMsg,r=e.stepValue,n=e.minValue,o=e.allowNegative,a=e.inputSx,i=e.labelSx,s=f(e,["errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx"]);return je(Lb,h({},s,{variant:"outlined",type:"number",error:!!t,helperText:t||null,inputProps:{step:r,min:o?void 0:n},slotProps:{input:{sx:a},inputLabel:{sx:i}}}))},_nt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"This field is required":s,c=t.validationErrorText,d=void 0===c?"Invalid numeric value":c,u=t.text,p=t.placeholderText,f=t.backgroundColor,m=t.borderColor,v=t.textColor,y=void 0===v?"#000":v,g=t.fontSize,x=t.fontFamily,b=t.fontWeight,k=t.allowNegative,_=void 0!==k&&k,w=t.numericPrecision,M=void 0===w?"1":w,C=t.name,D=t.sourceDataModelField,j=t.marginLeft,O=void 0===j?"0":j,S=t.marginTop,P=void 0===S?"0":S,E=t.marginRight,T=void 0===E?"0":E,N=t.marginBottom,z=void 0===N?"0":N,A=t.paddingLeft,R=void 0===A?"0":A,F=t.paddingTop,L=void 0===F?"0":F,B=t.paddingRight,V=void 0===B?"0":B,I=t.paddingBottom,q=void 0===I?"0":I,H=t.width,$=t.height,W=t.configurationItemInfo;t._textAlign;var U=t.minHeight,Y=t.maxHeight,Z=t.minWidth,K=t.maxWidth,G=HS(),X=null==G?void 0:G.control,Q=!(!X||!C),J=Hnt().localStateObject,ee=Ynt().stateConfig,te=J||ee,re=D?null===(r=null==te?void 0:te[D])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==re&&Q&&G.setValue(C,re)},[re]);var ne=e.useState(""),oe=ne[0],ae=ne[1],ie=parseFloat(M),se=_?void 0:0,le={required:!!i&&l,pattern:{value:_?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:d}};if(_||(le.min={value:0,message:"Value cannot be less than zero"}),o){var ce="",de=(ce=Q?G.watch(C)||"":re)?function(e,t,r){if(!e)return"";var n=parseFloat(e);if(Number.isNaN(n))return e;if(!r&&n<0)return"0";if(t){var o=(t.split(".")[1]||"").length;if(o>0)return n.toFixed(o)}return e}(ce,M,_):p||"-";return Oe("div",h({style:h(h(h(h(h(h({display:"inline-flex",flexDirection:"column",marginLeft:O,marginTop:P,marginRight:T,marginBottom:z},H&&{width:H}),$&&{height:$}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y})},W,{children:[u&&je(Nf,h({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,marginBottom:"4px"}},{children:u})),je(gc,h({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,paddingLeft:R,paddingTop:L,paddingRight:V,paddingBottom:q,backgroundColor:f,border:"1px solid ".concat(m||"#ccc"),borderRadius:"4px",minWidth:"60px"}},{children:de}))]}))}var ue=h(h(h(h(h(h(h({backgroundColor:f,color:y,fontSize:g,fontFamily:x,fontWeight:b},H&&{width:H}),$&&{height:$}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"}}),pe={color:y,"&.Mui-focused":{color:y}};return je(yf,h({required:i,sx:{marginLeft:O,marginTop:P,marginRight:T,marginBottom:z,width:"fit-content"}},W,Q?{children:je(GS,{name:C,rules:le,control:X,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return je(knt,{errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,label:u,placeholder:p,stepValue:ie,minValue:se,allowNegative:_,inputSx:ue,labelSx:pe,value:r.value||"",onChange:function(e){return r.onChange(e.target.value)}})}})}:{children:je(knt,{errorMsg:void 0,label:u,placeholder:p,stepValue:ie,minValue:se,allowNegative:_,inputSx:ue,labelSx:pe,value:oe,onChange:function(e){return ae(e.target.value)}})}))},wnt=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],Mnt=e.forwardRef(function(e,t){var r=e.inputRef,n=f(e,["inputRef"]);return je(zk,h({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:wnt,guide:!0,placeholderChar:" "}))});var Cnt,Dnt,jnt,Ont,Snt,Pnt,Ent,Tnt,Nnt,znt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=f(e,["masked","errorMsg","inputSx","labelSx"]);return je(Lb,h({},a,{variant:"outlined",error:!!r,helperText:r||null,slotProps:{input:h({sx:n},t?{inputComponent:Mnt}:{}),inputLabel:{sx:o}}}))},Ant=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Phone is required":s,c=t.validationErrorText,d=void 0===c?"Invalid phone number":c,u=t.text,p=t.placeholderText,f=t.masked,m=void 0===f||f;t.multiLine;var v=t.backgroundColor,y=t.borderColor,g=t.textColor,x=void 0===g?"#000":g,b=t.fontSize,k=t.fontFamily,_=t.fontWeight;t.textAlign;var w=t.marginLeft,M=void 0===w?"0":w,C=t.marginTop,D=void 0===C?"0":C,j=t.marginRight,O=void 0===j?"0":j,S=t.marginBottom,P=void 0===S?"0":S,E=t.paddingLeft,T=void 0===E?"0":E,N=t.paddingTop,z=void 0===N?"0":N,A=t.paddingRight,R=void 0===A?"0":A,F=t.paddingBottom,L=void 0===F?"0":F,B=t.width,V=t.height,I=t.minHeight,q=t.maxHeight,H=t.minWidth,$=t.maxWidth,W=t.name,U=t.sourceDataModelField,Y=t.configurationItemInfo,Z=HS(),K=null==Z?void 0:Z.control,G=!(!K||!W),X=Hnt().localStateObject,Q=Ynt().stateConfig,J=X||Q,ee=U?null===(r=null==J?void 0:J[U])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==ee&&G&&Z.setValue(W,ee)},[ee]);var te=e.useState(""),re=te[0],ne=te[1],oe={required:!!i&&l,pattern:{value:/^\d{10}$/,message:d}};if(o){var ae="";ae=G?Z.watch(W)||"":ee;var ie=m?function(e){var t=(null!=e?e:"").replace(/\D+/g,"");if(!t)return"";var r="",n=0;return g_.forEach(function(e){"string"==typeof e?r+=e:n<t.length?(r+=t[n],n+=1):r+="_"}),r}(ae):ae,se=ie||p||"-";return Oe("div",h({style:h(h(h(h(h(h({display:"inline-flex",flexDirection:"column",marginLeft:M,marginTop:D,marginRight:O,marginBottom:P},B&&{width:B}),V&&{height:V}),H&&{minWidth:H}),$&&{maxWidth:$}),I&&{minHeight:I}),q&&{maxHeight:q})},Y,{children:[u&&je(Nf,h({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,marginLeft:0,marginBottom:"4px"}},{children:u})),je(gc,h({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,paddingLeft:T,paddingTop:z,paddingRight:R,paddingBottom:L,backgroundColor:v,border:"1px solid ".concat(y||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:se}))]}))}var le=h(h(h(h(h(h(h({backgroundColor:v,color:x,fontSize:b,fontFamily:k,fontWeight:_},B&&{width:B}),V&&{height:V}),H&&{minWidth:H}),$&&{maxWidth:$}),I&&{minHeight:I}),q&&{maxHeight:q}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"}}),ce={color:x,"&.Mui-focused":{color:x}},de={marginLeft:M,marginTop:D,marginRight:O,marginBottom:P,width:"fit-content"};return je(yf,h({required:i,sx:de},Y,G?{children:je(GS,{name:W,rules:oe,control:K,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return je(znt,{masked:m,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:le,labelSx:ce,label:u,placeholder:p,value:r.value||"",onChange:function(e){var t,n,o=(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:"").toString().replace(/\D+/g,"");r.onChange(o)}})}})}:{children:je(znt,{masked:m,errorMsg:void 0,inputSx:le,labelSx:ce,label:u,placeholder:p,value:re,onChange:function(e){var t,r,n=(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:"").toString();ne(n.replace(/\D+/g,""))}})}))},Rnt=function(t){var r=t.items,n=t.onTabChange,o=t.activeTabKey,a=t.isMobile,i=void 0!==a&&a,s=t.marginTop,l=t.marginRight,c=t.marginBottom,d=t.marginLeft,u=t.paddingTop,p=t.paddingRight,f=t.paddingBottom,m=t.paddingLeft,v=t.buttonPaddingTop,y=t.buttonPaddingRight,g=t.buttonPaddingBottom,x=t.buttonPaddingLeft,b=t.width,k=t.height,_=t.backgroundColor,w=t.borderRadius,M=t.elevation,C=void 0===M?1:M,D=t.gap,j=t.indicatorVisible,O=void 0===j||j,S=t.indicatorColor,P=t.lineWidth,E=void 0===P?"2px":P,T=t.orientation,N=void 0===T?"horizontal":T,z=t.activeTextColor,A=void 0===z?"#1976d2":z,R=t.inactiveTextColor,F=void 0===R?"#000":R,L=t.fontSize,B=t.fontWeight,V=t.fontFamily,I=t.wrapText,q=t.textAlign,H=t.iconName,$=t.iconColor,W=t.iconSize,U=t.iconPlacement,Y=void 0===U?"left":U,Z=t.hoverTextColor,K=t.itemBorder,G=t.itemBorderRadius,X=t.itemBackgroundColor,Q=t.itemSelectedBackgroundColor,J=t.itemHoverBackgroundColor,ee=t.selectedItemElevation,te=void 0===ee?0:ee,re=t.itemDisableRipple,ne=t.configurationItemInfo,oe=ve(),ae=Hnt(),ie=ae.isConfigurationMode,se=ae.onConfigurationItemClicked,le=ae.selectedConfigurationItemId,ce=e.useState(null),de=ce[0],ue=ce[1],pe=function(){return ue(null)},he={marginTop:s,marginRight:l,marginBottom:c,marginLeft:d,paddingTop:u,paddingRight:p,paddingBottom:f,paddingLeft:m,width:b,height:k,backgroundColor:_,borderRadius:w,display:"flex",overflow:"visible !important"},fe=function(e){var t=e?A:F,r=e&&Q||X;return{color:t,fontSize:L,fontWeight:B,fontFamily:V,textAlign:q,whiteSpace:I?"normal":"nowrap",border:K,borderRadius:G,backgroundColor:r,boxShadow:e?oe.shadows[te]:void 0,paddingTop:v,paddingRight:y,paddingBottom:g,paddingLeft:x,"&:hover":{color:Z||t,backgroundColor:J||r}}},me=function(e){null==n||n({newTabKey:e.tabKey,link:e.link})},ye=function(e){if(!ie)return{};var t=e.id===le,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:function(e){e.stopPropagation(),null==se||se(r,!1)},onDoubleClick:function(e){e.stopPropagation(),null==se||se(r,!0)},"data-organism-id":e.id,css:t4e({theme:oe,selected:t})}};if(i)return Oe(dl,h({elevation:C,style:he},ne,{children:[je(Ql,h({onClick:function(e){return ue(e.currentTarget)}},{children:je(E2e,{size:W,color:$,iconName:H})})),je(iv,h({anchorEl:de,open:Boolean(de),onClose:pe},{children:r.map(function(e){var t=e.tabKey===o,r=fe(t);return Oe(uv,h({onClick:function(){me(e),pe()},sx:h(h({},r),{display:"flex",alignItems:"center"})},ye(e),{children:[e.iconName&&je(E2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F,mr:1}}),je(rp,h({component:"span"},{children:e.label}))]}),e.id)})}))]}));var ge=r.findIndex(function(e){return e.tabKey===o});return je(dl,h({elevation:C,style:he},ne,{children:je(ob,h({value:ge<0?0:ge,onChange:function(e,t){return ie?null:me(r[t])},orientation:N,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:D}},TabIndicatorProps:{style:O?{height:E,borderRadius:w,backgroundColor:S||A}:{display:"none"}}},{children:r.map(function(e){var t=e.tabKey===o,r=h(h({},fe(t)),{"&.Mui-selected":{color:t?A:F}});return je(zx,h({label:e.label,disableRipple:re,sx:h(h({},r),{textTransform:"none"}),onClick:function(){return me(e)},iconPosition:"right"===Y?"end":"start",icon:e.iconName?je(E2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F}}):void 0},ye(e)),e.id)})}))}))},Fnt=function(t){var r,n,o,a=t.id,i=t.type,s=t.name,l=t.form,c=t.config;t.formData;var d=t.isMobile,u=t.children,p=t.tabsProps,y=t.properties,g=t.organismLibraryMoleculeId,x=ve(),b=d||$b("xs"),k=Hnt(),_=k.formId,w=k.isPreview,M=void 0!==w&&w,C=k.validations,D=k.submitHandler,j=k.isConfigurationMode,O=k.onConfigurationItemClicked,S=k.selectedConfigurationItemId,P=k.currentStyleProperties,E=k.currentContentProperties,T=k.onInternalNavigation,N=Hnt().localStateObject,z=Ynt().stateConfig,A=N||z,R=(null===(r=null==c?void 0:c.props)||void 0===r?void 0:r.dataCaptureName)||(null===(n=null==y?void 0:y.dataCapture)||void 0===n?void 0:n.dataCaptureName)||a,F=null===(o=null==y?void 0:y.dataCapture)||void 0===o?void 0:o.sourceDataModelFieldId,L=S===a,B=qnt(),V=B.setActivePopUpById,I=B.setDrawerVisible,q=B.onCloseModal,H=B.onCloseDrawer,$=function(e){var t=e.stateListenerId,r=Hnt().localStateObject,n=Ynt().stateConfig,o=r||n,a=!0,i=!1;if(!t)return{isStateDisabled:i,isStateVisible:a};var s=(null==o?void 0:o[t])||{},l=s||{},c=l.visible,d=void 0===c||c,u=l.disabled,p=void 0!==u&&u;return t in o&&(a=Boolean(d),i=Boolean(p)),{isStateDisabled:i,isStateVisible:a,stateValue:s}}({stateListenerId:a}),W=$.isStateDisabled,U=$.isStateVisible,Y=e.useMemo(function(){return{entityType:i,entity:"molecule",entityName:s,entityId:a,organismLibraryMoleculeId:g}},[i,s,a,g]),Z=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!1)},[O,Y]),K=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!0)},[O,Y]),G=j?{onClick:Z,onDoubleClick:K,"data-configuration-id":a,css:t4e({theme:x,selected:L})}:{},X=j||W;if(!U)return null;return function(){var e,t,r,n,o,s,d,g,x;switch(i){case"simple_text":var k=int(O={text:null==y?void 0:y.text},E,N=["text"],L).text,w=snt(null==c?void 0:c.props,P,L);return je(Rtt,h({},w,{text:(null==k?void 0:k.text)||"",htmlElementId:a,configurationsItemInfo:G}));case"text":var O={text:null==y?void 0:y.text},N=Object.keys(O);k=int(O,E,N,L).text,w=snt(null==c?void 0:c.props,P,L);return je(Att,h({},k,w,{htmlElementId:a,configurationItemInfo:G}));case"consent":var z=int(y,E,[],L);w=snt(null==c?void 0:c.props,P,L)||{};return je(a4e,h({},w,{htmlElementId:a,properties:z,configurationItemInfo:G}));case"signup_password_fields":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText,placeholderText:null==y?void 0:y.placeholderText,subPlaceholderText:null==y?void 0:y.subPlaceholderText,validationText:null==y?void 0:y.validationText},N=Object.keys(O);var B=int(O,E,N,L),$=snt(null==c?void 0:c.props,P,L),U=$.state,Y=$.gap,Z=f($,["state","gap"]);return je(art,{gap:Y,inputProps:Z,validations:C||[],htmlElementId:a,validationState:U,overridesProperties:B,configurationItemInfo:G});case"stepper":var K=snt(null==c?void 0:c.props,P,L),Q=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=f(r,["properties","config"]),i={title:null==n?void 0:n.title,subText:null==n?void 0:n.subText},s=Object.keys(i),l=int(i,E,s,t),c=l.title,d=l.subText,u=snt(null==o?void 0:o.props,P,t);return h(h(h({},a),u),{title:(null==c?void 0:c.text)||"",subText:(null==d?void 0:d.text)||""})});return je(Rrt,h({},K,{items:Q||[],isMobile:b,moleculeId:a,configurationItemInfo:G}));case"checklist":var J=snt(null==c?void 0:c.props,P,L)||{},ee=null==u?void 0:u.map(function(e){var t,r,n,o,a,i=S===e.id,s=e||{},l=s.properties,c=s.config,d=f(s,["properties","config"]);switch(e.type){case"checklist_item":var u={label:null==l?void 0:l.label,objectState:null==l?void 0:l.objectState},p=Object.keys(u),m=int(u,E,p,i),v=snt(null==c?void 0:c.props,P,i)||{},y=(null===(t=m.label)||void 0===t?void 0:t.text)||"",g=!!(null===(r=m.objectState)||void 0===r?void 0:r.pmiObjectId);return h(h(h({},d),v),{type:"checklist_item",label:y,textColor:v.textColor||"#000",fontSize:v.fontSize||"14px",fontFamily:v.fontFamily||"inherit",fontWeight:v.fontWeight||"normal",textAlign:v.textAlign||"left",isSystemDriven:g,disabled:g,interacted:(null===(n=null==A?void 0:A[e.id])||void 0===n?void 0:n.interacted)||"unchecked"});case"divider_item":v=snt(null==c?void 0:c.props,P,i)||{};return h(h(h({},d),v),{type:"divider_item"});case"text_item":u={text:null==l?void 0:l.text},p=Object.keys(u),m=int(u,E,p,i),v=snt(null==c?void 0:c.props,P,i)||{};var x=(null===(o=m.text)||void 0===o?void 0:o.text)||"";return h(h(h({},d),v),{type:"text_item",text:x});case"rich_text_item":u={text:null==l?void 0:l.text},p=Object.keys(u),m=int(u,E,p,i),v=snt(null==c?void 0:c.props,P,i)||{},x=(null===(a=m.text)||void 0===a?void 0:a.text)||lot;return h(h(h({},d),v),{type:"rich_text_item",text:x});default:return h(h({},d),{type:e.type})}});return je(n4e,h({},J,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"accordion":var te=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=f(r,["properties","config"]),i={text:null==n?void 0:n.text,subText:null==n?void 0:n.subText,bodyText:null==n?void 0:n.bodyText},s=Object.keys(i),l=int(i,E,s,t),c=l.text,d=l.subText,u=l.bodyText,p=snt(null==o?void 0:o.props,P,t);return h(h(h({},a),p),{text:(null==c?void 0:c.text)||"",subText:(null==d?void 0:d.text)||"",bodyText:(null==u?void 0:u.text)||""})});return je(lnt,h({},te,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"menu":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var re=int(O,E,N,L),ne=re.text,oe=re.disabled,ae=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t,r=S===e.id,n=e||{},o=n.properties,a=n.config,i=f(n,["properties","config"]),s={disabled:o&&"disabled"in o?o.disabled:void 0,text:o&&"text"in o?o.text:void 0,link:o&&"link"in o?o.link:void 0},l=Object.keys(s),c=int(s,E,l,r),d=c.text,u=c.disabled,p=c.link,m=snt(null==a?void 0:a.props,P,r);return h(h(h({},i),m),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null==u?void 0:u.value)||(null==m?void 0:m.disabled)||!1,text:(null==d?void 0:d.text)||"Menu Item",link:p})});return je(bnt,h({},ae,{items:ee||[],moleculeId:a,buttonText:(null==ne?void 0:ne.text)||"Open Menu",configurationItemInfo:G,buttonDisabled:(null==A?void 0:A[a])?null===(e=null==A?void 0:A[a])||void 0===e?void 0:e.disabled:(null==oe?void 0:oe.value)||(null==ae?void 0:ae.disabled)||!1}));case"tabs":w=snt(null==c?void 0:c.props,P,L);var ie=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a={label:null==n?void 0:n.label,link:null==n?void 0:n.link},i=Object.keys(a),s=int(a,E,i,t),l=s.label,c=s.link,d=snt(null==o?void 0:o.props,P,t);return h(h({},d),{id:e.id,tabKey:$tt(c)?qtt(Ftt,null==c?void 0:c.internalLink):void 0,label:(null==l?void 0:l.text)||"",link:c})}),se=null==p?void 0:p.tabs.map(function(e){var t=e.text,r=f(e,["text"]);return h(h({},r),{label:t||""})}),le=Boolean(null==w?void 0:w.isTabsSystemDerived),ce=le?se:ie,de=(null==p?void 0:p.activeTabKey)||(null===(t=null==ce?void 0:ce[0])||void 0===t?void 0:t.tabKey)||"";return je(Rnt,h({},w,{items:ce||[],isMobile:b,moleculeId:a,activeTabKey:de,configurationItemInfo:G,onTabChange:j?void 0:function(e){var t,r=e.newTabKey,n=e.link;le?null===(t=null==p?void 0:p.onTabChange)||void 0===t||t.call(p,r):$tt(n)?null==T||T((null==n?void 0:n.internalLink)||""):Htt(null==n?void 0:n.externalLink)}}));case"divider":w=snt(null==c?void 0:c.props,P,L);return je(Ttt,h({moleculeId:a,configurationItemInfo:G},w));case"link":O={text:null==y?void 0:y.text,link:null==y?void 0:y.link},N=Object.keys(O);var ue=int(O,E,N,L),pe=(k=ue.text,ue.link);w=snt(null==c?void 0:c.props,P,L);return je(trt,h({moleculeId:a},w,{type:null==pe?void 0:pe.type,src:X?void 0:Utt(pe,M)||"",text:(null==k?void 0:k.text)||"",disabled:(null==w?void 0:w.disabled)||W,configurationItemInfo:G}));case"video":O={video:null==y?void 0:y.video,coverImage:null==y?void 0:y.coverImage},N=Object.keys(O);var he=int(O,E,N,L),fe=he.video,me=he.coverImage;w=snt(null==c?void 0:c.props,P,L);return je(Brt,h({},w,{moleculeId:a,poster:null===(r=null==me?void 0:me.imageFile)||void 0===r?void 0:r.url,src:null!==(s=null!==(n=null==fe?void 0:fe.videoSource)&&void 0!==n?n:null===(o=null==fe?void 0:fe.videoFile)||void 0===o?void 0:o.url)&&void 0!==s?s:"",configurationItemInfo:G}));case"badge":w=snt(null==c?void 0:c.props,P,L);return je(N2e,h({},w,{configurationItemInfo:G}));case"alert":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText},N=Object.keys(O);var ve=int(O,E,N,L),ye=(k=ve.text,ve.subText);w=snt(null==c?void 0:c.props,P,L);return je(T2e,h({text:(null==k?void 0:k.text)||"",subText:(null==ye?void 0:ye.text)||""},w,{configurationItemInfo:G}));case"chip":O={text:null==y?void 0:y.text},N=Object.keys(O),k=int(O,E,N,L).text,w=snt(null==c?void 0:c.props,P,L);return je(o4e,h({text:(null==k?void 0:k.text)||""},w,{configurationItemInfo:G}));case"email_display_field":case"email_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var ge=int(O,E,N,L),xe=(k=ge.text,ge.placeholderText),be=ge.required,ke=ge.requiredErrorText,_e=ge.validationErrorText;w=snt(null==c?void 0:c.props,P,L);return je(gnt,h({name:R,text:(null==k?void 0:k.text)||"",placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,required:null==be?void 0:be.value,isDisplayOnly:"email_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text},w,{configurationItemInfo:G}));case"phone_number_display_field":case"phone_number_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var we=int(O,E,N,L);k=we.text,xe=we.placeholderText,be=we.required,ke=we.requiredErrorText,_e=we.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Ant,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,isDisplayOnly:"phone_number_display_field"===i},w,{configurationItemInfo:G}));case"numeric_display_field":case"numeric_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Me=int(O,E,N,L);k=Me.text,xe=Me.placeholderText,be=Me.required,ke=Me.requiredErrorText,_e=Me.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(_nt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"numeric_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"currency_display_field":case"currency_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ce=int(O,E,N,L);k=Ce.text,xe=Ce.placeholderText,be=Ce.required,ke=Ce.requiredErrorText,_e=Ce.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(mnt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"currency_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"basic_text_display_field":case"basic_text_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Oe=int(O,E,N,L);k=Oe.text,xe=Oe.placeholderText,be=Oe.required,ke=Oe.requiredErrorText,_e=Oe.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(A2e,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"basic_text_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"rating_display_field":case"rating":O={text:null==y?void 0:y.text,dataCapture:null==y?void 0:y.dataCapture,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Se=int(O,E,N,L);k=Se.text,be=Se.required,ke=Se.requiredErrorText,_e=Se.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(wrt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"rating_display_field"===i},w,{configurationItemInfo:G}));case"switch_display_field":case"switch":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Pe=int(O,E,N,L);k=Pe.text,be=Pe.required,ke=Pe.requiredErrorText,_e=Pe.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Lrt,h({name:R,moleculeId:a,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"switch_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"slider_display_field":case"slider":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ee=int(O,E,N,L);k=Ee.text,be=Ee.required,ke=Ee.requiredErrorText,_e=Ee.validationErrorText,xe=Ee.placeholderText,w=snt(null==c?void 0:c.props,P,L);return je(Art,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"slider_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:null==xe?void 0:xe.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"date_display_field":case"date_picker":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Te=int(O,E,N,L);k=Te.text,be=Te.required,xe=Te.placeholderText,ke=Te.requiredErrorText,_e=Te.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(f4e,h({dateAdapter:ant},{children:je(Ett,h({moleculeId:a,name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,placeholderText:(null==xe?void 0:xe.text)||"",isDisplayOnly:"date_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}))}));case"select_display_field":case"select":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ne=int(O,E,N,L);k=Ne.text,be=Ne.required,xe=Ne.placeholderText,ke=Ne.requiredErrorText,_e=Ne.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Crt,h({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"select_display_field"===i,placeholderText:(null==xe?void 0:xe.text)||"",requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"image":O={image:null==y?void 0:y.image,link:null==y?void 0:y.link},N=Object.keys(O);var ze=int(O,E,N,L),Ae=ze.image,Re=ze.link,Fe=(w=snt(null==c?void 0:c.props,P,L),(null==Ae?void 0:Ae.imageSource)||(null===(d=null==Ae?void 0:Ae.imageFile)||void 0===d?void 0:d.url)||"");return je(Ntt,h({},w,{src:Fe,onClick:function(){return $tt(Re)?null==T?void 0:T((null==Re?void 0:Re.internalLink)||""):Htt(null==Re?void 0:Re.externalLink)},moleculeId:a,configurationItemInfo:G}));case"button":O={text:null==y?void 0:y.text,action:null==y?void 0:y.action},N=Object.keys(O);var Le=int(O,E,N,L),Be=(k=Le.text,Le.action),Ve=(w=snt(null==c?void 0:c.props,P,L),(null==Be?void 0:Be.action)||{}),Ie=Ve.link,qe=Ve.popup,He=Ve.download,$e=Ve.submit,We={link:function(){return $tt(Ie)?T(null==Ie?void 0:Ie.internalLink):Htt(null==Ie?void 0:Ie.externalLink)},popup:function(){(null==qe?void 0:qe.id)&&V(null==qe?void 0:qe.id)},drawer:function(){I(!0)},download:function(){return He?function(e,t){return void 0===e&&(e=""),void 0===t&&(t="Downloaded file"),m(void 0,void 0,void 0,function(){var r,n,o,a;return v(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,i.sent().blob()];case 2:return r=i.sent(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=t,o.click(),URL.revokeObjectURL(n),[3,4];case 3:return a=i.sent(),sit({message:"Failed to download the file: ".concat(a),type:"error"}),[3,4];case 4:return[2]}})})}(He.url,He.name):sit({message:"File not found to download",type:"warning"})},submit:null==l?void 0:l.handleSubmit(function(e){return m(void 0,void 0,void 0,function(){var t,r,n,o;return v(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),_?[4,null==D?void 0:D({formId:_,data:e})]:[3,2];case 1:a.sent(),(t=null===(n=null==$e?void 0:$e.onSuccess)||void 0===n?void 0:n.link)&&($tt(t)?null==T||T(t.internalLink||""):Htt(t.externalLink)),l.reset(),a.label=2;case 2:return[3,4];case 3:return a.sent(),(r=null===(o=null==$e?void 0:$e.onError)||void 0===o?void 0:o.link)&&($tt(r)?null==T||T(r.internalLink||""):Htt(r.externalLink)),[3,4];case 4:return[2]}})})}),reset:function(){return null==l?void 0:l.reset()},destroy:function(){null==l||l.reset(),null==q||q(),null==H||H()}};return je(R2e,h({moleculeId:a,text:(null==k?void 0:k.text)||""},w,{disabled:(null==w?void 0:w.disabled)||W,onClick:null==We?void 0:We[(null===(g=null==Be?void 0:Be.action)||void 0===g?void 0:g.type)||"link"],configurationItemInfo:G}));case"avatar":w=snt(null==c?void 0:c.props,P,L);return je(cnt,h({},w,{sourceDataModelField:F,configurationItemInfo:G}));case"calendar":O={events:null==y?void 0:y.events},N=Object.keys(O);var Ue=int(O,E,N,L).events;w=snt(null==c?void 0:c.props,P,L);return console.log({props:w}),je(pnt,h({},w,{events:Ue||[],configurationItemInfo:G}));case"drawer":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var Ye=int(O,E,N,L),Ze=Ye.text,Ke=Ye.disabled,Ge=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t,r,n,o,a,i,s,l,c,d=S===e.id,u=e||{},p=u.properties,m=u.config,v=f(u,["properties","config"]),y={},g=[];switch(e.type){case"menu_item":var x=p;y={disabled:null==x?void 0:x.disabled,text:null==x?void 0:x.text,link:null==x?void 0:x.link},g=Object.keys(y);break;case"text_item":var b=p;y={text:null==b?void 0:b.text},g=Object.keys(y);break;case"rich_text_item":var k=p;y={text:null==k?void 0:k.text},g=Object.keys(y);break;case"image_item":var _=p;y={image:null==_?void 0:_.image,alt:null==_?void 0:_.alt,link:null==_?void 0:_.link},g=Object.keys(y);break;default:y={},g=[]}var w=int(y,E,g,d),M=snt(null==m?void 0:m.props,P,d),C=h(h({},v),M);switch(e.type){case"menu_item":return h(h({},C),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null===(r=null==w?void 0:w.disabled)||void 0===r?void 0:r.value)||(null==M?void 0:M.disabled)||!1,text:(null===(n=null==w?void 0:w.text)||void 0===n?void 0:n.text)||"Menu Item",link:null==w?void 0:w.link});case"text_item":return h(h({},C),{text:(null===(o=null==w?void 0:w.text)||void 0===o?void 0:o.text)||""});case"rich_text_item":return h(h({},C),{text:(null===(a=null==w?void 0:w.text)||void 0===a?void 0:a.text)||lot});case"image_item":var D=(null===(i=null==w?void 0:w.image)||void 0===i?void 0:i.imageSource)||(null===(l=null===(s=null==w?void 0:w.image)||void 0===s?void 0:s.imageFile)||void 0===l?void 0:l.url)||"";return h(h({},C),{src:D,alt:(null===(c=null==w?void 0:w.alt)||void 0===c?void 0:c.text)||"Drawer image",link:null==w?void 0:w.link});default:return C}});return je(ert,h({},Ge,{items:ee||[],moleculeId:a,buttonText:(null==Ze?void 0:Ze.text)||(null==Ge?void 0:Ge.buttonText),buttonDisabled:(null==A?void 0:A[a])?null===(x=null==A?void 0:A[a])||void 0===x?void 0:x.disabled:(null==Ke?void 0:Ke.value)||(null==Ge?void 0:Ge.disabled)||!1,configurationItemInfo:G}));case"speed_dial":var Xe=snt(null==c?void 0:c.props,P,L);ee=null==u?void 0:u.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=f(r,["properties","config"]),i={link:null==n?void 0:n.link,text:null==n?void 0:n.text},s=Object.keys(i),l=int(i,E,s,t),c=snt(null==o?void 0:o.props,P,t);return h(h({},a),{config:{props:h(h(h({},null==o?void 0:o.props),c),{tooltipText:(null==c?void 0:c.tooltipText)||""})},properties:{link:(null==l?void 0:l.link)||(null==n?void 0:n.link),text:(null==l?void 0:l.text)||(null==n?void 0:n.text)}})});return je(Grt,h({},Xe,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"checkbox":case"checkbox_display":O={label:null==y?void 0:y.label,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Qe=int(O,E,N,L),Je=Qe.label;be=Qe.required,ke=Qe.requiredErrorText,_e=Qe.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Urt,h({name:R,moleculeId:a,label:(null==Je?void 0:Je.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"checkbox_display"===i},w,{configurationItemInfo:G}));case"binary_radio_buttons":case"binary_radio_buttons_display":O={confirmText:null==y?void 0:y.confirmText,rejectText:null==y?void 0:y.rejectText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var et=int(O,E,N,L),tt=et.confirmText,rt=et.rejectText;be=et.required,ke=et.requiredErrorText,_e=et.validationErrorText,w=snt(null==c?void 0:c.props,P,L);return je(Wrt,h({name:R,moleculeId:a,confirmText:(null==tt?void 0:tt.text)||"Yes",rejectText:(null==rt?void 0:rt.text)||"No",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"binary_radio_buttons_display"===i},w,{configurationItemInfo:G}));default:return je(De,{children:"There is no such type of molecule yet."})}}()},Lnt=function(t){var r=t.item,n=t.activeChildrenIds,o=e.useState(),a=o[0],i=o[1],s=e.useMemo(function(){return n.map(function(e){var t=r.items.find(function(t){return t.id===e});return t?function(e){var t,r,n,o=(null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.formStepProps)||{};return h(h({},e),{config:h(h({},e.config),{props:h(h({},null===(n=e.config)||void 0===n?void 0:n.props),{formStepProps:h(h({},o),{order:0})})})})}(t):void 0}).filter(Boolean)},[n,r]);return e.useEffect(function(){i(function(){return h(h({},r),{items:s})})},[r]),a},Bnt=function(t){var r=t.config,n=t.tabsProps,o=t.id,a=t.type,i=t.items,s=t.metadata,l=t.formData,c=t.setFormData,d=t.isMobile,u=t.properties,p=t.isConfigurationMode,f=void 0!==p&&p,m=e.useState(),v=m[0],y=m[1];if(!i||!i.length)return null;var g=d||$b("xs");return je(Wnt,h({userInitials:"UN",logOutHandler:function(){return console.log("log out")},goToAccountInfo:function(){return console.log("account info page")}},{children:je(cS,h({organismMetadata:s,organismId:o,initItems:i,organismBodyId:o,submitHandler:function(e){return new Promise(function(t){setTimeout(function(){t(alert(JSON.stringify(e,null,2)))},600)})},formId:o,isConfigurationMode:f,onConfigurationItemHandler:function(e){y(null==e?void 0:e.entityId)},selectedConfigurationItemId:v},{children:je(Int,{item:{id:o,type:a,items:i,config:r,metadata:s,properties:u,instance:"container"},formData:l,tabsProps:n,isMobile:g,setFormData:c})}))}),"".concat(o,".").concat(g?"mobile":"desktop"))},Vnt=function(e){var t=e.formData,r=e.setFormData,n=e.isMobile,o=f(e,["formData","setFormData","isMobile"]),a=Lnt(o);return a?je(Bnt,h({},a,{isMobile:n,formData:t,setFormData:r})):null},Int=e.memo(function(t){var r,n=t.item,o=t.tabsProps,a=t.formData,i=t.setFormData,s=t.isMobile,l=t.parentId,c=HS(),d=Ynt().stateConfig,u=Hnt(),p=u.organismMetadata,f=u.localStateObject||d;if("molecule"===n.instance)return je(RP,h({additionalInfo:"molecule: ".concat(n.id)},{children:je(Fnt,h({},n,{form:c,isMobile:s,formData:a,parentId:l,tabsProps:o,setFormData:i,metadata:h(h({},n.metadata),{stateListenerId:(null==p?void 0:p.stateListenerId)||n.id})}))}));if(!n.items||!n.items.length)return null;var m="form"===n.type&&(null===(r=n.config.props)||void 0===r?void 0:r.activeChildrenIds)||[];if(m.length)return je(RP,h({additionalInfo:"form: ".concat(n.id)},{children:je(Vnt,{item:n,activeChildrenIds:m,formData:a,setFormData:i,isMobile:s})}));var v=e.useMemo(function(){var e;return null===(e=n.items)||void 0===e?void 0:e.filter(function(e){var t,r,n,o,a,i=null===(n=null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.visible)||void 0===n||n,s=null===(a=null===(o=null==f?void 0:f[e.id])||void 0===o?void 0:o.visible)||void 0===a||a;return i&&s})},[n.items,f]);return je(RP,h({additionalInfo:"container: ".concat(n.id)},{children:je(Jrt,h({},n,{isMobile:s,config:n.config?h(h({},n.config),{props:n.config.props||{},wide:n.config.wide||{},compact:n.config.compact||{}}):{props:{},wide:{},compact:{}}},{children:null==v?void 0:v.map(function(e){return je(Int,{item:e,parentId:e.id,formData:a,setFormData:i,isMobile:s,tabsProps:o},e.id)})}))}))}),qnt=function(){return e.useContext(iS)},Hnt=function(){return e.useContext(sS)},$nt=e.createContext({userInitials:"",logOutHandler:function(){return null},goToAccountInfo:function(){return null},username:""}),Wnt=function(t){var r=t.children,n=t.goToAccountInfo,o=t.userInitials,a=t.logOutHandler,i=t.username,s=e.useMemo(function(){return{logOutHandler:a,goToAccountInfo:n,userInitials:o,username:i}},[a,n,o,i]);return je($nt.Provider,h({value:s},{children:r}))},Unt=e.createContext({stateConfig:{},stateHandler:function(){return null},authenticated:!1}),Ynt=function(){return e.useContext(Unt)},Znt=function(){return e.useContext(ZN)},Knt={pickList:{get:function(e){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2,{data:[]}]})})}},calendar:{createEvent:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2]})})},updateEvent:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2]})})},deleteEvent:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2]})})},getEvents:function(){return m(void 0,void 0,void 0,function(){return v(this,function(e){return[2,[]]})})}}},Gnt=e.createContext(Knt),Xnt=function(){var t=e.useContext(Gnt);if(!t)throw new Error("useApi must be used within ApiProvider");return t},Qnt=function(e,t){var r=e.replace(/\D+/g,"");if(!r)return"";var n="",o=0;return t.reduce(function(e,t){return"string"==typeof t?n+=t:o<r.length&&(n+=r[o],o+=1),e},""),n},Jnt=function(e,t){try{var r=new Date(e);if(Number.isNaN(r.getTime()))return e;var n=void 0,o=void 0,a=void 0;switch("string"==typeof e&&(e.endsWith("Z")||e.includes("+")||e.includes("T"))?(n=String(r.getUTCMonth()+1).padStart(2,"0"),o=String(r.getUTCDate()).padStart(2,"0"),a=r.getUTCFullYear()):(n=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0"),a=r.getFullYear()),t){case"DD/MM/YYYY":return"".concat(o,"/").concat(n,"/").concat(a);case"MM/YYYY":return"".concat(n,"/").concat(a);case"YYYY/MM/DD":return"".concat(a,"/").concat(n,"/").concat(o);default:return"".concat(n,"/").concat(o,"/").concat(a)}}catch(t){return e}},eot=function(e){var t,r,n=e.variable,o=e.stateObject,a=e.leaf,i=(null==n?void 0:n.dataModelField)||{},s=i.defaultValue,l=i.dataModelFieldId,c=i.pmiObjectName,d=i.dataFieldName,u=i.dataType,p=i.format,h="[".concat(c," - ").concat(d,"]");if(!o||!l)return a&&(a.text=h),je("span",{children:h});try{r=null===(t=null==o?void 0:o[l])||void 0===t?void 0:t.value}catch(e){r=null}var f=null!=o&&(r||s)||h;if(a&&(a.text=f),!r&&0!==r)return je("span",{children:s||h});var m=String(r);if("date"===u){var v="MM/DD/YYYY";switch(p){case"day_month_year_date":v="DD/MM/YYYY";break;case"month_day_year_date":default:v="MM/DD/YYYY";break;case"year_month_day_date":v="YYYY/MM/DD";break;case"month_year_date":v="MM/YYYY"}m=Jnt(m,v)}else if(p)switch(p){case"phone_number":m=Qnt(m,g_);break;case"us_zip_code":case"zip_code":m=Qnt(m,h_);break;case"day_month_year_date":m=Jnt(m,"DD/MM/YYYY");break;case"month_day_year_date":m=Jnt(m,"MM/DD/YYYY");break;case"year_month_day_date":m=Jnt(m,"YYYY/MM/DD");break;case"month_year_date":m=Jnt(m,"MM/YYYY");break;case"numeric":var y=Number(r);m=Number.isNaN(y)?String(r):String(y);break;case"integer":var g=Number(r);m=Number.isNaN(g)?String(r):String(Math.floor(g));break;case"email":case"text":case"string":case"any":default:m=String(r);break;case"password":m="*".repeat(String(r).length)}return je("span",{children:m})},tot=qe.span(Dnt||(Dnt=g(["\n ","\n"],["\n ","\n"])),function(e){var t=e.$color,r=e.$backgroundColor,n=e.$fontSize,o=e.$fontFamily,a=e.$letterSpacing,i=e.$lineHeight;return Ee(Cnt||(Cnt=g(["\n ","\n ","\n ","\n ","\n ","\n ","\n "],["\n ","\n ","\n ","\n ","\n ","\n ","\n "])),t&&"color: ".concat(t," !important;"),r&&"background-color: ".concat(r," !important;"),n&&"font-size: ".concat(n," !important;"),o&&"\n font-family: ".concat(o," !important;\n \n /* More aggressive font-family overrides */\n &, & *, & span, & a, & [contenteditable] {\n font-family: ").concat(o," !important;\n }\n "),a&&"letter-spacing: ".concat(a," !important;"),i&&"line-height: ".concat(i," !important;"))}),rot=function(e){var t,r,n,o=e.leaf,a=e.children,i=e.attributes,s=aS(),l=s.showAnnotations,c=s.annotationsList,d=s.isMLRReview,u=Hnt(),p=u.isPreview,f=u.localStateObject,m=Ynt().stateConfig,v=f||m;if(o.tag){var y=c.tags.findIndex(function(e){var t,r=e.id;return(null===(t=o.tag)||void 0===t?void 0:t.id)===r})+1;d&&l&&y&&(a=Oe(zg,h({component:"span",display:"inline-flex",direction:"row",alignItems:"center",gap:.5,id:not},((t={})["data-".concat(aot)]=null===(n=o.tag)||void 0===n?void 0:n.id,t),{children:[je("span",h({style:{backgroundColor:"#FFF0D0B5"}},{children:a})),je(Ck,{index:c.tags.findIndex(function(e){var t,r,n=e.id,a=e.label;return(null===(t=o.tag)||void 0===t?void 0:t.id)===n||(null===(r=o.tag)||void 0===r?void 0:r.label)===a})+1,type:"message"})]})))}if(o.bold&&(a=je("span",h({style:{fontWeight:"bold"}},{children:a}))),o.strikethrough&&(a=je("s",{children:a})),o.italic&&(a=je("span",h({style:{fontStyle:"italic"}},{children:a}))),o.underline&&(a=je("u",{children:a})),(o.color||o.bgColor||o.fontSize||o.fontFamily||o.letterSpacing||o.lineHeight)&&(a=je(tot,h({$color:o.color,$backgroundColor:o.bgColor,$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight},{children:a}))),o.variable&&(a=je(tot,h({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color},{children:je(eot,h({variable:o.variable,stateObject:v,leaf:o},{children:a}))}))),o.communicationLink){var g=o.communicationLink,x=g.type,b=g.url,k="internalLink"===x,_=k?Wtt(b,p):b,w=c.links.findIndex(function(e){return b===e.url&&o.text===e.text})+1;a=je(De,{children:d&&l&&w?Oe(zg,h({component:"span",display:"inline-flex",alignItems:"center",gap:.2,marginBottom:.2,id:oot},(r={},r["data-".concat(iot)]=b,r["data-".concat(sot)]=o.text,r),{children:[je(tot,h({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Ze.colors.blue},{children:je("a",h({},i,{href:_,target:k?"_self":"_blank"},{children:a}))})),je(Ck,{index:w,type:"link"})]})):je(tot,h({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Ze.colors.blue},{children:je("a",h({},i,{href:_,target:k?"_self":"_blank"},{children:a}))}))})}return je("span",h({},i,{children:a}))},not="matrix-message",oot="communication-link",aot="matrix-message-id",iot="communication-link-url",sot="communication-link-text",lot=[{type:"paragraph",children:[{text:""}]}],cot=function(t){var r=t.value;t.numberOfLines;var n=e.useMemo(function(){return QO((()=>{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:t=>{for(var r of SM.pathRefs(e))BM.transform(r,t);for(var n of SM.pointRefs(e))HM.transform(n,t);for(var o of SM.rangeRefs(e))YM.transform(o,t);var a,i,s=Bw.get(e)||[],l=Vw.get(e)||new Set,c=e=>{if(e){var t=e.join(",");i.has(t)||(i.add(t),a.push(e))}};if(LM.operationCanTransformPath(t))for(var d of(a=[],i=new Set,s))c(LM.transform(d,t));else a=s,i=l;var u=e.getDirtyPaths(t);for(var p of u)c(p);Bw.set(e,a),Vw.set(e,i),xC.transform(e,t),e.operations.push(t),SM.normalize(e),"set_selection"===t.type&&(e.marks=null),Iw.get(e)||(Iw.set(e,!0),Promise.resolve().then(()=>{Iw.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,r)=>{var{selection:n,markableVoid:o}=e;if(n){var a=(t,r)=>{if(!tC.isText(t))return!1;var[n,o]=SM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},i=UM.isExpanded(n),s=!1;if(!i){var[l,c]=SM.node(e,n);if(l&&a(l,c)){var[d]=SM.parent(e,c);s=d&&e.markableVoid(d)}}if(i||s)xC.setNodes(e,{[t]:r},{match:a,split:!0,voids:!0});else{var u=Yw(Yw({},SM.marks(e)||{}),{},{[t]:r});e.marks=u,Iw.get(e)||e.onChange()}}},deleteBackward:t=>{var{selection:r}=e;r&&UM.isCollapsed(r)&&xC.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:r}=e;r&&UM.isCollapsed(r)&&xC.delete(e,{unit:t})},deleteFragment:t=>{var{selection:r}=e;r&&UM.isExpanded(r)&&xC.delete(e,{reverse:"backward"===t})},getFragment:()=>{var{selection:t}=e;return t?zM.fragment(e,t):[]},insertBreak:()=>{xC.splitNodes(e,{always:!0})},insertSoftBreak:()=>{xC.splitNodes(e,{always:!0})},insertFragment:t=>{xC.insertFragment(e,t)},insertNode:t=>{xC.insertNodes(e,t)},insertText:t=>{var{selection:r,marks:n}=e;if(r){if(n){var o=Yw({text:t},n);xC.insertNodes(e,o)}else xC.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[r,n]=t;if(!tC.isText(r))if(wM.isElement(r)&&0===r.children.length)xC.insertNodes(e,{text:""},{at:n.concat(0),voids:!0});else for(var o=!SM.isEditor(r)&&wM.isElement(r)&&(e.isInline(r)||0===r.children.length||tC.isText(r.children[0])||e.isInline(r.children[0])),a=0,i=0;i<r.children.length;i++,a++){var s=zM.get(e,n);if(!tC.isText(s)){var l=r.children[i],c=s.children[a-1],d=i===r.children.length-1;(tC.isText(l)||wM.isElement(l)&&e.isInline(l))!==o?(xC.removeNodes(e,{at:n.concat(a),voids:!0}),a--):wM.isElement(l)?e.isInline(l)&&(null!=c&&tC.isText(c)?d&&(xC.insertNodes(e,{text:""},{at:n.concat(a+1),voids:!0}),a++):(xC.insertNodes(e,{text:""},{at:n.concat(a),voids:!0}),a++)):null!=c&&tC.isText(c)&&(tC.equals(l,c,{loose:!0})?(xC.mergeNodes(e,{at:n.concat(a),voids:!0}),a--):""===c.text?(xC.removeNodes(e,{at:n.concat(a-1),voids:!0}),a--):""===l.text&&(xC.removeNodes(e,{at:n.concat(a),voids:!0}),a--))}}},removeMark:t=>{var{selection:r}=e;if(r){var n=(t,r)=>{if(!tC.isText(t))return!1;var[n,o]=SM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},o=UM.isExpanded(r),a=!1;if(!o){var[i,s]=SM.node(e,r);if(i&&n(i,s)){var[l]=SM.parent(e,s);a=l&&e.markableVoid(l)}}if(o||a)xC.unsetNodes(e,t,{match:n,split:!0,voids:!0});else{var c=Yw({},SM.marks(e)||{});delete c[t],e.marks=c,Iw.get(e)||e.onChange()}}},getDirtyPaths:e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return LM.levels(t);case"insert_node":var{node:r,path:n}=e,o=LM.levels(n),a=tC.isText(r)?[]:Array.from(zM.nodes(r),e=>{var[,t]=e;return n.concat(t)});return[...o,...a];case"merge_node":var{path:i}=e;return[...LM.ancestors(i),LM.previous(i)];case"move_node":var{path:s,newPath:l}=e;if(LM.equals(s,l))return[];var c=[],d=[];for(var u of LM.ancestors(s)){var p=LM.transform(u,e);c.push(p)}for(var h of LM.ancestors(l)){var f=LM.transform(h,e);d.push(f)}var m=d[d.length-1],v=l[l.length-1],y=m.concat(v);return[...c,...d,y];case"remove_node":var{path:g}=e;return[...LM.ancestors(g)];case"split_node":var{path:x}=e;return[...LM.levels(x),LM.next(x)];default:return[]}}};return e})())},[]),o=lot;if(null==r||"string"!=typeof r)o=lot;else{var a=r.replace(/\\/g,"");try{o=JSON.parse(r)}catch(e){console.error(e,"Value was parsed incorrectly. Trying to parse it...");try{o=JSON.parse(a)}catch(e){console.error(e,"Most probably that it's not possible to parse this value")}}}return je($O,h({editor:n,value:o},{children:je(TO,{readOnly:!0,renderLeaf:function(e){return je(rot,h({},e))},placeholder:o===lot?"No content available":"",renderElement:function(e){return je(eS,h({},e))}})}),JSON.stringify(o))},dot=qe.div(jnt||(jnt=g(["\n ",";\n\n ",";\n"],["\n ",";\n\n ",";\n"])),function(e){var t=e.theme.colors,r=e.hasError,n=e.disabled,o=e.isOpen,a=e.isEditMode;return"\n .select-wrapper {\n text-align: left;\n border: ".concat(a?"1px solid ".concat(t.gray3):"none",";\n position: relative;\n border-radius: ").concat(sizes.S,"px;\n &:hover,\n &:active,\n &:focus {\n border-color: ").concat(t.gray2,";\n }\n\n .select-input {\n padding: ").concat(a?"10px ".concat(sizes.S,"px 10px ").concat(sizes.M,"px"):"0",";\n display: flex;\n user-select: none;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n cursor: ").concat(a?"pointer":"default",";\n\n .icon-container {\n max-height: 33px;\n transform: rotate(0deg);\n transition: transform 0.2s ease-in-out;\n ").concat(o&&"transform: rotate(180deg);","\n }\n }\n\n ").concat(n&&"\n border-color: ".concat(t.gray4," !important;\n cursor: not-allowed;\n .select-input {\n background-color: ").concat(t.gray4,";\n pointer-events: none;\n .selected-text-value {\n color: ").concat(t.gray3,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.gray3,";\n }\n }\n }\n "),"\n \n ").concat(r&&"\n border-color: ".concat(t.red," !important;\n .select-input {\n .selected-text-value {\n color: ").concat(t.red,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.red,";\n }\n }\n }\n "),"\n ")},function(e){return e.$styles}),uot=qe.div(Ont||(Ont=g(["\n ",";\n"],["\n ",";\n"])),function(e){var t=e.theme,r=t.colors,n=t.sizes;return"\n position: absolute;\n width: 100%;\n border-radius: ".concat(n.S,"px;\n padding: ").concat(n.L,"px ").concat(n.M,"px;\n box-shadow: 0 0 ").concat(n.XL,"px 0 #0000001a;\n overflow: auto;\n max-height: 150px;\n z-index: 10;\n transform: translateY(").concat(n.S,"px);\n background-color: ").concat(r.white,";\n ")}),pot=qe.div(Snt||(Snt=g(["\n width: 100%;\n cursor: pointer;\n ",";\n"],["\n width: 100%;\n cursor: pointer;\n ",";\n"])),function(e){var t=e.theme,r=t.sizes,n=t.colors,o=t.fonts,a=e.$selected;return"\n border-radius: ".concat(r.S,"px;\n &:hover {\n background-color: ").concat(n.gray5,";\n }\n padding: ").concat(r.S,"px ").concat(r.M,"px;\n ").concat(o.M,";\n color: ").concat(n.gray2,";\n ").concat(a&&"\n background-color: ".concat(n.gray4," !important;\n color: ").concat(n.black,";\n "),";\n ")}),hot=function(e,t){void 0===t&&(t=!1);var r=e||{},n=r.horizontalPadding,o=void 0===n?0:n,a=r.verticalPadding,i=void 0===a?0:a,s=r.selectedTextColor,l=r.selectedTextFontSize,c=r.placeholderTextColor,d=r.placeholderTextFontSize,u=r.styles,p=r.wrapperStyles;return Ee(Ent||(Ent=g(["\n ",";\n "],["\n ",";\n "])),function(e){var r=e.theme.colors;return Ee(Pnt||(Pnt=g(["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "],["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "])),i||o?"padding: ".concat(i,"px ").concat(o,"px;"):"",t?"\n ".concat(s?"color: ".concat(r[s]||s,";"):"",";\n ").concat(l?"font-size: ".concat(l,"px;"):"",";\n "):"\n ".concat(c?"color: ".concat(r[c]||c,";"):"",";\n ").concat(d?"font-size: ".concat(d,"px;"):"",";\n "),u,p)})},fot=Te(Tnt||(Tnt=g(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"],["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),mot=qe.div(Nnt||(Nnt=g(["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"],["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"])),function(e){var t=e.theme,r=e.color,n=void 0===r?"secondary":r;return t.colors[n]},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},fot);function vot(e,t){if(null==e)return{};var r,n,o=xs(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function yot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function got(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yot(Object(r),!0).forEach(function(t){F9e(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yot(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function xot(e,t){this.v=e,this.k=t}function bot(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bot=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){bot(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},bot(e,t,r,n)}function kot(){
9548
9548
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
9549
9549
  var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return bot(c,"_invoke",function(r,n,o){var a,s,l,c=0,d=o||[],u=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return a=t,s=0,l=e,p.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!u&&c&&!o&&t<d.length;t++){var o,a=d[t],h=p.p,f=a[2];r>3?(o=f===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=h&&((o=r<2&&h<a[1])?(s=0,p.v=n,p.n=a[1]):h<f&&(o=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(o||r>1)return i;throw u=!0,n}return function(o,d,f){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&h(d,f),s=d,l=f;(t=s<2?e:l)||!u;){a||(s?s<3?(s>1&&(p.n=-1),h(s,l)):p.n=l:p.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(u=p.n<0)?l:r.call(n,p))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:u}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var d=[][n]?t(t([][n]())):(bot(t={},n,function(){return this}),t),u=c.prototype=s.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,bot(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,bot(u,"constructor",c),bot(c,"constructor",l),l.displayName="GeneratorFunction",bot(c,o,"GeneratorFunction"),bot(u),bot(u,o,"Generator"),bot(u,n,function(){return this}),bot(u,"toString",function(){return"[object Generator]"}),(kot=function(){return{w:a,m:p}})()}function _ot(e,t){function r(n,o,a,i){try{var s=e[n](o),l=s.value;return l instanceof xot?t.resolve(l.v).then(function(e){r("next",e,a,i)},function(e){r("throw",e,a,i)}):t.resolve(l).then(function(e){s.value=e,a(s)},function(e){return r("throw",e,a,i)})}catch(e){i(e)}}var n;this.next||(bot(_ot.prototype),bot(_ot.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),bot(this,"_invoke",function(e,o,a){function i(){return new t(function(t,n){r(e,a,t,n)})}return n=n?n.then(i,i):i()},!0)}function wot(e,t,r,n,o){return new _ot(kot().w(e,t,r,n),o||Promise)}function Mot(e,t,r,n,o){var a=wot(e,t,r,n,o);return a.next().then(function(e){return e.done?e.value:a.next()})}function Cot(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}}function Dot(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(i7e(e)+" is not iterable")}function jot(){var e=kot(),t=e.m(jot),r=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function n(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===r||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function a(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,o[e],t)},delegateYield:function(e,o,a){return t.resultName=o,r(n.d,Dot(e),a)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(jot=function(){return{wrap:function(t,r,n,o){return e.w(a(t),r,n,o&&o.reverse())},isGeneratorFunction:n,mark:e.m,awrap:function(e,t){return new xot(e,t)},AsyncIterator:_ot,async:function(e,t,r,o,i){return(n(t)?wot:Mot)(a(e),t,r,o,i)},keys:Cot,values:Dot}})()}function Oot(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function Sot(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Oot(a,n,o,i,s,"next",e)}function s(e){Oot(a,n,o,i,s,"throw",e)}i(void 0)})}}var Pot,Eot=got({},p),Tot=Eot.version,Not=Eot.render,zot=Eot.unmountComponentAtNode;try{Number((Tot||"").split(".")[0])>=18&&(Pot=Eot.createRoot)}catch(mD){}function Aot(e){var t=Eot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===i7e(t)&&(t.usingClientEntryPoint=e)}var Rot="__rc_react_root__";function Fot(e,t){Pot?function(e,t){Aot(!0);var r=t[Rot]||Pot(t);Aot(!1),r.render(e),t[Rot]=r}(e,t):function(e,t){Not(e,t)}(e,t)}function Lot(e){return Bot.apply(this,arguments)}function Bot(){return Bot=Sot(jot().mark(function e(t){return jot().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then(function(){var e;null===(e=t[Rot])||void 0===e||e.unmount(),delete t[Rot]}));case 1:case"end":return e.stop()}},e)})),Bot.apply(this,arguments)}function Vot(e){zot(e)}function Iot(){return Iot=Sot(jot().mark(function e(t){return jot().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Pot){e.next=2;break}return e.abrupt("return",Lot(t));case 2:Vot(t);case 3:case"end":return e.stop()}},e)})),Iot.apply(this,arguments)}function qot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||j9e(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 Hot(e){return e instanceof HTMLElement?e:u.default.findDOMNode(e)}function $ot(e,t){"function"==typeof e?e(t):"object"===i7e(e)&&e&&"current"in e&&(e.current=t)}function Wot(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.filter(function(e){return e});return n.length<=1?n[0]:function(e){t.forEach(function(t){$ot(t,e)})}}function Uot(e){var t,r,n=L.exports.isMemo(e)?e.type.type:e.type;return!("function"==typeof n&&!(null===(t=n.prototype)||void 0===t?void 0:t.render))&&!("function"==typeof e&&!(null===(r=e.prototype)||void 0===r?void 0:r.render))}function Yot(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function Zot(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit".concat(e)]="webkit".concat(t),r["Moz".concat(e)]="moz".concat(t),r["ms".concat(e)]="MS".concat(t),r["O".concat(e)]="o".concat(t.toLowerCase()),r}var Kot,Got,Xot,Qot=(Kot=Yot(),Got="undefined"!=typeof window?window:{},Xot={animationend:Zot("Animation","AnimationEnd"),transitionend:Zot("Transition","TransitionEnd")},Kot&&("AnimationEvent"in Got||delete Xot.animationend.animation,"TransitionEvent"in Got||delete Xot.transitionend.transition),Xot),Jot={};if(Yot()){var eat=document.createElement("div");Jot=eat.style}var tat={};function rat(e){if(tat[e])return tat[e];var t=Qot[e];if(t)for(var r=Object.keys(t),n=r.length,o=0;o<n;o+=1){var a=r[o];if(Object.prototype.hasOwnProperty.call(t,a)&&a in Jot)return tat[e]=t[a],tat[e]}return""}var nat=rat("animationend"),oat=rat("transitionend"),aat=!(!nat||!oat),iat=nat||"animationend",sat=oat||"transitionend";function lat(e,t){if(!e)return null;if("object"===i7e(e)){var r=t.replace(/-\w/g,function(e){return e[1].toUpperCase()});return e[r]}return"".concat(e,"-").concat(t)}var cat="none",dat="appear",uat="enter",pat="leave",hat="none",fat="prepare",mat="start",vat="active",yat="end";function gat(e){var t=s.useRef(!1),r=qot(s.useState(e),2),n=r[0],o=r[1];return s.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]),[n,function(e,r){r&&t.current||o(e)}]}var xat=function(e){return+setTimeout(e,16)},bat=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(xat=function(e){return window.requestAnimationFrame(e)},bat=function(e){return window.cancelAnimationFrame(e)});var kat=0,_at=new Map;function wat(e){_at.delete(e)}function Mat(e){var t=kat+=1;return function r(n){if(0===n)wat(t),e();else{var o=xat(function(){r(n-1)});_at.set(t,o)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t}Mat.cancel=function(e){var t=_at.get(e);return wat(t),bat(t)};var Cat=Yot()?e.useLayoutEffect:e.useEffect,Dat=[fat,mat,vat,yat],jat=!1;function Oat(e){return e===vat||e===yat}var Sat=function(e,t){var r=qot(gat(hat),2),n=r[0],o=r[1],a=function(){var e=s.useRef(null);function t(){Mat.cancel(e.current)}return s.useEffect(function(){return function(){t()}},[]),[function r(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var a=Mat(function(){o<=1?n({isCanceled:function(){return a!==e.current}}):r(n,o-1)});e.current=a},t]}(),i=qot(a,2),l=i[0],c=i[1];return Cat(function(){if(n!==hat&&n!==yat){var e=Dat.indexOf(n),r=Dat[e+1],a=t(n);a===jat?o(r,!0):l(function(e){function t(){e.isCanceled()||o(r,!0)}!0===a?t():Promise.resolve(a).then(t)})}},[e,n]),s.useEffect(function(){return function(){c()}},[]),[function(){o(fat,!0)},n]};function Pat(t,r,n,o){var a=o.motionEnter,i=void 0===a||a,l=o.motionAppear,c=void 0===l||l,d=o.motionLeave,u=void 0===d||d,p=o.motionDeadline,h=o.motionLeaveImmediately,f=o.onAppearPrepare,m=o.onEnterPrepare,v=o.onLeavePrepare,y=o.onAppearStart,g=o.onEnterStart,x=o.onLeaveStart,b=o.onAppearActive,k=o.onEnterActive,_=o.onLeaveActive,w=o.onAppearEnd,M=o.onEnterEnd,C=o.onLeaveEnd,D=o.onVisibleChanged,j=qot(gat(),2),O=j[0],S=j[1],P=qot(gat(cat),2),E=P[0],T=P[1],N=qot(gat(null),2),z=N[0],A=N[1],R=e.useRef(!1),F=e.useRef(null);function L(){return n()}var B=e.useRef(!1);function V(e){var t=L();if(!e||e.deadline||e.target===t){var r,n=B.current;E===dat&&n?r=null==w?void 0:w(t,e):E===uat&&n?r=null==M?void 0:M(t,e):E===pat&&n&&(r=null==C?void 0:C(t,e)),E!==cat&&n&&!1!==r&&(T(cat,!0),A(null,!0))}}var I=function(t){var r=e.useRef(),n=e.useRef(t);n.current=t;var o=s.useCallback(function(e){n.current(e)},[]);function a(e){e&&(e.removeEventListener(sat,o),e.removeEventListener(iat,o))}return s.useEffect(function(){return function(){a(r.current)}},[]),[function(e){r.current&&r.current!==e&&a(r.current),e&&e!==r.current&&(e.addEventListener(sat,o),e.addEventListener(iat,o),r.current=e)},a]}(V),q=qot(I,1)[0],H=s.useMemo(function(){var e,t,r;switch(E){case dat:return F9e(e={},fat,f),F9e(e,mat,y),F9e(e,vat,b),e;case uat:return F9e(t={},fat,m),F9e(t,mat,g),F9e(t,vat,k),t;case pat:return F9e(r={},fat,v),F9e(r,mat,x),F9e(r,vat,_),r;default:return{}}},[E]),$=qot(Sat(E,function(e){if(e===fat){var t=H[fat];return t?t(L()):jat}var r;U in H&&A((null===(r=H[U])||void 0===r?void 0:r.call(H,L(),null))||null);return U===vat&&(q(L()),p>0&&(clearTimeout(F.current),F.current=setTimeout(function(){V({deadline:!0})},p))),true}),2),W=$[0],U=$[1],Y=Oat(U);B.current=Y,Cat(function(){S(r);var e,n=R.current;(R.current=!0,t)&&(!n&&r&&c&&(e=dat),n&&r&&i&&(e=uat),(n&&!r&&u||!n&&h&&!r&&u)&&(e=pat),e&&(T(e),W()))},[r]),e.useEffect(function(){(E===dat&&!c||E===uat&&!i||E===pat&&!u)&&T(cat)},[c,i,u]),e.useEffect(function(){return function(){R.current=!1,clearTimeout(F.current)}},[]);var Z=s.useRef(!1);e.useEffect(function(){O&&(Z.current=!0),void 0!==O&&E===cat&&((Z.current||O)&&(null==D||D(O)),Z.current=!0)},[O,E]);var K=z;return H[fat]&&U===mat&&(K=got({transition:"none"},K)),[E,U,K,null!=O?O:r]}var Eat=function(){S9e(t,s.Component);var e=T9e(t);function t(){return N9e(this,t),e.apply(this,arguments)}return R9e(t,[{key:"render",value:function(){return this.props.children}}]),t}();var Tat=function(t){var r=t;function n(e){return!(!e.motionName||!r)}"object"===i7e(t)&&(r=t.transitionSupport);var o=s.forwardRef(function(t,r){var o=t.visible,a=void 0===o||o,i=t.removeOnLeave,l=void 0===i||i,c=t.forceRender,d=t.children,u=t.motionName,p=t.leavedClassName,h=t.eventProps,f=n(t),m=e.useRef(),v=e.useRef();var y=qot(Pat(f,a,function(){try{return m.current instanceof HTMLElement?m.current:Hot(v.current)}catch(e){return null}},t),4),g=y[0],x=y[1],b=y[2],k=y[3],_=s.useRef(k);k&&(_.current=!0);var w,M=s.useCallback(function(e){m.current=e,$ot(r,e)},[r]),C=got(got({},h),{},{visible:a});if(d)if(g!==cat&&n(t)){var D,j;x===fat?j="prepare":Oat(x)?j="active":x===mat&&(j="start"),w=d(got(got({},C),{},{className:nE(lat(u,g),(D={},F9e(D,lat(u,"".concat(g,"-").concat(j)),j),F9e(D,u,"string"==typeof u),D)),style:b}),M)}else w=k?d(got({},C),M):!l&&_.current?d(got(got({},C),{},{className:p}),M):c?d(got(got({},C),{},{style:{display:"none"}}),M):null;else w=null;s.isValidElement(w)&&Uot(w)&&(w.ref||(w=s.cloneElement(w,{ref:M})));return s.createElement(Eat,{ref:v},w)});return o.displayName="CSSMotion",o}(aat),Nat="add",zat="keep",Aat="remove",Rat="removed";function Fat(e){var t;return got(got({},t=e&&"object"===i7e(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Lat(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Fat)}var Bat=["component","children","onVisibleChanged","onAllRemoved"],Vat=["status"],Iat=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];var qat=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tat,t=function(){S9e(r,s.Component);var t=T9e(r);function r(){var e;N9e(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).state={keyEntities:[]},e.removeKey=function(t){var r=e.state.keyEntities.map(function(e){return e.key!==t?e:got(got({},e),{},{status:Rat})});return e.setState({keyEntities:r}),r.filter(function(e){return e.status!==Rat}).length},e}return R9e(r,[{key:"render",value:function(){var t=this,r=this.state.keyEntities,n=this.props,o=n.component,a=n.children,i=n.onVisibleChanged,l=n.onAllRemoved,c=vot(n,Bat),d=o||s.Fragment,u={};return Iat.forEach(function(e){u[e]=c[e],delete c[e]}),delete c.keys,s.createElement(d,c,r.map(function(r){var n=r.status,o=vot(r,Vat),c=n===Nat||n===zat;return s.createElement(e,R({},u,{key:o.key,visible:c,eventProps:o,onVisibleChanged:function(e){(null==i||i(e,{key:o.key}),e)||0===t.removeKey(o.key)&&l&&l()}}),a)}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=e.keys,n=t.keyEntities,o=Lat(r),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[],n=0,o=t.length,a=Lat(e),i=Lat(t);a.forEach(function(e){for(var t=!1,a=n;a<o;a+=1){var s=i[a];if(s.key===e.key){n<a&&(r=r.concat(i.slice(n,a).map(function(e){return got(got({},e),{},{status:Nat})})),n=a),r.push(got(got({},s),{},{status:zat})),n+=1,t=!0;break}}t||r.push(got(got({},e),{},{status:Aat}))}),n<o&&(r=r.concat(i.slice(n).map(function(e){return got(got({},e),{},{status:Nat})})));var s={};r.forEach(function(e){var t=e.key;s[t]=(s[t]||0)+1});var l=Object.keys(s).filter(function(e){return s[e]>1});return l.forEach(function(e){r=r.filter(function(t){var r=t.key,n=t.status;return r!==e||n!==Aat}),r.forEach(function(t){t.key===e&&(t.status=zat)})}),r}(n,o);return{keyEntities:a.filter(function(e){var t=n.find(function(t){var r=t.key;return e.key===r});return!t||t.status!==Rat||e.status!==Aat})}}}]),r}();return t.defaultProps={component:"div"},t}(aat),Hat=function(){S9e(r,e.Component);var t=T9e(r);function r(){var e;N9e(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).closeTimer=null,e.close=function(t){t&&t.stopPropagation(),e.clearCloseTimer();var r=e.props,n=r.onClose,o=r.noticeKey;n&&n(o)},e.startCloseTimer=function(){e.props.duration&&(e.closeTimer=window.setTimeout(function(){e.close()},1e3*e.props.duration))},e.clearCloseTimer=function(){e.closeTimer&&(clearTimeout(e.closeTimer),e.closeTimer=null)},e}return R9e(r,[{key:"componentDidMount",value:function(){this.startCloseTimer()}},{key:"componentDidUpdate",value:function(e){(this.props.duration!==e.duration||this.props.updateMark!==e.updateMark||this.props.visible!==e.visible&&this.props.visible)&&this.restartCloseTimer()}},{key:"componentWillUnmount",value:function(){this.clearCloseTimer()}},{key:"restartCloseTimer",value:function(){this.clearCloseTimer(),this.startCloseTimer()}},{key:"render",value:function(){var e=this,t=this.props,r=t.prefixCls,n=t.className,o=t.closable,a=t.closeIcon,i=t.style,l=t.onClick,c=t.children,d=t.holder,p="".concat(r,"-notice"),h=Object.keys(this.props).reduce(function(t,r){return"data-"!==r.substr(0,5)&&"aria-"!==r.substr(0,5)&&"role"!==r||(t[r]=e.props[r]),t},{}),f=s.createElement("div",R({className:nE(p,n,F9e({},"".concat(p,"-closable"),o)),style:i,onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onClick:l},h),s.createElement("div",{className:"".concat(p,"-content")},c),o?s.createElement("a",{tabIndex:0,onClick:this.close,className:"".concat(p,"-close")},a||s.createElement("span",{className:"".concat(p,"-close-x")})):null);return d?u.default.createPortal(f,d):f}}]),r}();function $at(e){return function(e){if(Array.isArray(e))return D9e(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j9e(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.")}()}Hat.defaultProps={onClose:function(){},duration:1.5};var Wat=["getContainer"],Uat=0,Yat=Date.now();function Zat(){var e=Uat;return Uat+=1,"rcNotification_".concat(Yat,"_").concat(e)}var Kat=function(){S9e(r,e.Component);var t=T9e(r);function r(){var e;N9e(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).state={notices:[]},e.hookRefs=new Map,e.add=function(t,r){var n=t.key||Zat(),o=got(got({},t),{},{key:n}),a=e.props.maxCount;e.setState(function(e){var t=e.notices,i=t.map(function(e){return e.notice.key}).indexOf(n),s=t.concat();return-1!==i?s.splice(i,1,{notice:o,holderCallback:r}):(a&&t.length>=a&&(o.key=s[0].notice.key,o.updateMark=Zat(),o.userPassKey=n,s.shift()),s.push({notice:o,holderCallback:r})),{notices:s}})},e.remove=function(t){e.setState(function(e){return{notices:e.notices.filter(function(e){var r=e.notice,n=r.key;return(r.userPassKey||n)!==t})}})},e.noticePropsMap={},e}return R9e(r,[{key:"getTransitionName",value:function(){var e=this.props,t=e.prefixCls,r=e.animation,n=this.props.transitionName;return!n&&r&&(n="".concat(t,"-").concat(r)),n}},{key:"render",value:function(){var e=this,t=this.state.notices,r=this.props,n=r.prefixCls,o=r.className,a=r.closeIcon,i=r.style,l=[];return t.forEach(function(r,o){var i=r.notice,s=r.holderCallback,c=o===t.length-1?i.updateMark:void 0,d=i.key,u=i.userPassKey,p=got(got(got({prefixCls:n,closeIcon:a},i),i.props),{},{key:d,noticeKey:u||d,updateMark:c,onClose:function(t){var r;e.remove(t),null===(r=i.onClose)||void 0===r||r.call(i)},onClick:i.onClick,children:i.content});l.push(d),e.noticePropsMap[d]={props:p,holderCallback:s}}),s.createElement("div",{className:nE(n,o),style:i},s.createElement(qat,{keys:l,motionName:this.getTransitionName(),onVisibleChanged:function(t,r){var n=r.key;t||delete e.noticePropsMap[n]}},function(t){var r=t.key,o=t.className,a=t.style,i=t.visible,l=e.noticePropsMap[r],c=l.props,d=l.holderCallback;return d?s.createElement("div",{key:r,className:nE(o,"".concat(n,"-hook-holder")),style:got({},a),ref:function(t){void 0!==r&&(t?(e.hookRefs.set(r,t),d(t,c)):e.hookRefs.delete(r))}}):s.createElement(Hat,R({},c,{className:nE(o,null==c?void 0:c.className),style:got(got({},a),null==c?void 0:c.style),visible:i}))}))}}]),r}();Kat.newInstance=void 0,Kat.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}},Kat.newInstance=function(e,t){var r=e||{},n=r.getContainer,o=vot(r,Wat),a=document.createElement("div");n?n().appendChild(a):document.body.appendChild(a);var i=!1;function l(e){i||(i=!0,t({notice:function(t){e.add(t)},removeNotice:function(t){e.remove(t)},component:e,destroy:function(){!function(e){Iot.apply(this,arguments)}(a),a.parentNode&&a.parentNode.removeChild(a)},useNotification:function(){return t=e,r=s.useRef({}),n=qot(s.useState([]),2),o=n[0],a=n[1],[function(e){var n=!0;t.add(e,function(e,t){var o=t.key;if(e&&(!r.current[o]||n)){var i=s.createElement(Hat,R({},t,{holder:e}));r.current[o]=i,a(function(e){var r=e.findIndex(function(e){return e.key===t.key});if(-1===r)return[].concat($at(e),[i]);var n=$at(e);return n[r]=i,n})}n=!1})},s.createElement(s.Fragment,null,o)];var t,r,n,o,a}}))}"test"===process.env.NODE_ENV&&e.TEST_RENDER?e.TEST_RENDER(s.createElement(Kat,R({},o,{ref:l}))):Fot(s.createElement(Kat,R({},o,{ref:l})),a)};var Gat,Xat,Qat,Jat=Ze.colors,eit=Ze.fonts,tit=Ze.sizes,rit=qe.span(Gat||(Gat=g(["\n color: ",";\n ",";\n"],["\n color: ",";\n ",";\n"])),function(e){return e.textColor},eit.L),nit=qe.div(Xat||(Xat=g(["\n display: flex;\n height: ","px;\n column-gap: ","px;\n align-items: center;\n padding-right: ","px;\n"],["\n display: flex;\n height: ","px;\n column-gap: ","px;\n align-items: center;\n padding-right: ","px;\n"])),tit.XL,tit.M,tit.XL),oit=qe.div(Qat||(Qat=g(["\n ",";\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background-color: ",";\n"],["\n ",";\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background-color: ",";\n"])),He(tit.XL),function(e){return e.backgroundColor}),ait=function(e){var t=e.type,r=e.message,n=function(e){switch(e){case"success":return{icon:"Check",backgroundColor:Jat.green,textColor:Jat.greenShade};case"error":return{icon:"Close",backgroundColor:Jat.red,textColor:Jat.redShade};case"warning":return{icon:"Warning",backgroundColor:Jat.yellow,textColor:Jat.yellowShade,iconColor:Jat.yellowShade,iconSize:18};case"infoTierOne":return{icon:"Bell",backgroundColor:Jat.blue,textColor:Jat.blueShade,iconSize:18};case"infoTierTwo":return{icon:"Bell",backgroundColor:Jat.gray2,textColor:Ue(Jat.gray2),iconSize:18};default:return{icon:"Bell",backgroundColor:Jat.blue,textColor:Jat.blueShade}}}(t),o=n.icon,a=n.iconColor,i=n.textColor,s=n.backgroundColor,l=n.iconSize;return Oe(nit,{children:[je(oit,h({backgroundColor:s},{children:je(Tk,{size:l||32,name:o,color:a||Jat.white})})),je(rit,h({textColor:i},{children:r}))]})},iit=null;Kat.newInstance({maxCount:2},function(e){return iit=e});var sit=function(e){var t=e.message,r=e.type,n=void 0===r?"success":r,o=e.duration,a=void 0===o?2.5:o;return null==iit?void 0:iit.notice({content:je(ait,{message:t,type:n}),className:"toast-".concat(n),closable:!0,closeIcon:je(Tk,{name:"Close"}),duration:a})};function lit(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1}function cit(e,t,r,n){var o=u.default.unstable_batchedUpdates?function(e){u.default.unstable_batchedUpdates(r,e)}:r;return e.addEventListener&&e.addEventListener(t,o,n),{remove:function(){e.removeEventListener&&e.removeEventListener(t,o,n)}}}var dit=e.forwardRef(function(t,r){var n=t.didUpdate,o=t.getContainer,a=t.children,i=e.useRef(),s=e.useRef();e.useImperativeHandle(r,function(){return{}});var l=e.useRef(!1);return!l.current&&Yot()&&(s.current=o(),i.current=s.current.parentNode,l.current=!0),e.useEffect(function(){null==n||n(t)}),e.useEffect(function(){return null===s.current.parentNode&&null!==i.current&&i.current.appendChild(s.current),function(){var e,t;null===(e=s.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(s.current)}},[]),s.current?u.default.createPortal(a,s.current):null});function uit(e,t,r){return r?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function pit(e){var t=e.prefixCls,r=e.motion,n=e.animation,o=e.transitionName;return r||(n?{motionName:"".concat(t,"-").concat(n)}:o?{motionName:o}:null)}function hit(e){var t=e.prefixCls,r=e.visible,n=e.zIndex,o=e.mask,a=e.maskMotion,i=e.maskAnimation,l=e.maskTransitionName;if(!o)return null;var c={};return(a||l||i)&&(c=got({motionAppear:!0},pit({motion:a,prefixCls:t,transitionName:l,animation:i}))),s.createElement(Tat,R({},c,{visible:r,removeOnLeave:!0}),function(e){var r=e.className;return s.createElement("div",{style:{zIndex:n},className:nE("".concat(t,"-mask"),r)})})}var fit;function mit(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function vit(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mit(Object(r),!0).forEach(function(t){git(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mit(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function yit(e){return yit="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},yit(e)}function git(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var xit={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function bit(){if(void 0!==fit)return fit;fit="";var e=document.createElement("p").style;for(var t in xit)t+"Transform"in e&&(fit=t);return fit}function kit(){return bit()?"".concat(bit(),"TransitionProperty"):"transitionProperty"}function _it(){return bit()?"".concat(bit(),"Transform"):"transform"}function wit(e,t){var r=kit();r&&(e.style[r]=t,"transitionProperty"!==r&&(e.style.transitionProperty=t))}function Mit(e,t){var r=_it();r&&(e.style[r]=t,"transform"!==r&&(e.style.transform=t))}var Cit,Dit=/matrix\((.*)\)/,jit=/matrix3d\((.*)\)/;function Oit(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Sit(e,t,r){var n=r;if("object"!==yit(t))return void 0!==n?("number"==typeof n&&(n="".concat(n,"px")),void(e.style[t]=n)):Cit(e,t);for(var o in t)t.hasOwnProperty(o)&&Sit(e,o,t[o])}function Pit(e,t){var r=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if("number"!=typeof r){var o=e.document;"number"!=typeof(r=o.documentElement[n])&&(r=o.body[n])}return r}function Eit(e){return Pit(e)}function Tit(e){return Pit(e,!0)}function Nit(e){var t=function(e){var t,r,n,o=e.ownerDocument,a=o.body,i=o&&o.documentElement;return t=e.getBoundingClientRect(),r=Math.floor(t.left),n=Math.floor(t.top),{left:r-=i.clientLeft||a.clientLeft||0,top:n-=i.clientTop||a.clientTop||0}}(e),r=e.ownerDocument,n=r.defaultView||r.parentWindow;return t.left+=Eit(n),t.top+=Tit(n),t}function zit(e){return null!=e&&e==e.window}function Ait(e){return zit(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Rit=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Fit=/^(top|right|bottom|left)$/,Lit="currentStyle",Bit="runtimeStyle",Vit="left";function Iit(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function qit(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function Hit(e,t,r){"static"===Sit(e,"position")&&(e.style.position="relative");var n=-999,o=-999,a=Iit("left",r),i=Iit("top",r),s=qit(a),l=qit(i);"left"!==a&&(n=999),"top"!==i&&(o=999);var c,d="",u=Nit(e);("left"in t||"top"in t)&&(d=(c=e).style.transitionProperty||c.style[kit()]||"",wit(e,"none")),"left"in t&&(e.style[s]="",e.style[a]="".concat(n,"px")),"top"in t&&(e.style[l]="",e.style[i]="".concat(o,"px")),Oit(e);var p=Nit(e),h={};for(var f in t)if(t.hasOwnProperty(f)){var m=Iit(f,r),v="left"===f?n:o,y=u[f]-p[f];h[m]=m===f?v+y:v-y}Sit(e,h),Oit(e),("left"in t||"top"in t)&&wit(e,d);var g={};for(var x in t)if(t.hasOwnProperty(x)){var b=Iit(x,r),k=t[x]-u[x];g[b]=x===b?h[b]+k:h[b]-k}Sit(e,g)}function $it(e,t){var r=Nit(e),n=function(e){var t=window.getComputedStyle(e,null),r=t.getPropertyValue("transform")||t.getPropertyValue(_it());if(r&&"none"!==r){var n=r.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}(e),o={x:n.x,y:n.y};"left"in t&&(o.x=n.x+t.left-r.left),"top"in t&&(o.y=n.y+t.top-r.top),function(e,t){var r=window.getComputedStyle(e,null),n=r.getPropertyValue("transform")||r.getPropertyValue(_it());if(n&&"none"!==n){var o,a=n.match(Dit);a?((o=(a=a[1]).split(",").map(function(e){return parseFloat(e,10)}))[4]=t.x,o[5]=t.y,Mit(e,"matrix(".concat(o.join(","),")"))):((o=n.match(jit)[1].split(",").map(function(e){return parseFloat(e,10)}))[12]=t.x,o[13]=t.y,Mit(e,"matrix3d(".concat(o.join(","),")")))}else Mit(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,o)}function Wit(e,t){for(var r=0;r<e.length;r++)t(e[r])}function Uit(e){return"border-box"===Cit(e,"boxSizing")}"undefined"!=typeof window&&(Cit=window.getComputedStyle?function(e,t,r){var n=r,o="",a=Ait(e);return(n=n||a.defaultView.getComputedStyle(e,null))&&(o=n.getPropertyValue(t)||n[t]),o}:function(e,t){var r=e[Lit]&&e[Lit][t];if(Rit.test(r)&&!Fit.test(t)){var n=e.style,o=n[Vit],a=e[Bit][Vit];e[Bit][Vit]=e[Lit][Vit],n[Vit]="fontSize"===t?"1em":r||0,r=n.pixelLeft+"px",n[Vit]=o,e[Bit][Vit]=a}return""===r?"auto":r});var Yit=["margin","border","padding"];function Zit(e,t,r){var n,o,a,i=0;for(o=0;o<t.length;o++)if(n=t[o])for(a=0;a<r.length;a++){var s=void 0;s="border"===n?"".concat(n).concat(r[a],"Width"):n+r[a],i+=parseFloat(Cit(e,s))||0}return i}var Kit={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function Git(e,t,r){var n=r;if(zit(e))return"width"===t?Kit.viewportWidth(e):Kit.viewportHeight(e);if(9===e.nodeType)return"width"===t?Kit.docWidth(e):Kit.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],a="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=Uit(e),s=0;(null==a||a<=0)&&(a=void 0,(null==(s=Cit(e,t))||Number(s)<0)&&(s=e.style[t]||0),s=parseFloat(s)||0),void 0===n&&(n=i?1:-1);var l=void 0!==a||i,c=a||s;return-1===n?l?c-Zit(e,["border","padding"],o):s:l?1===n?c:c+(2===n?-Zit(e,["border"],o):Zit(e,["margin"],o)):s+Zit(e,Yit.slice(n),o)}Wit(["Width","Height"],function(e){Kit["doc".concat(e)]=function(t){var r=t.document;return Math.max(r.documentElement["scroll".concat(e)],r.body["scroll".concat(e)],Kit["viewport".concat(e)](r))},Kit["viewport".concat(e)]=function(t){var r="client".concat(e),n=t.document,o=n.body,a=n.documentElement[r];return"CSS1Compat"===n.compatMode&&a||o&&o[r]||a}});var Xit={position:"absolute",visibility:"hidden",display:"block"};function Qit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,o=t[0];return 0!==o.offsetWidth?n=Git.apply(void 0,t):function(e,t,r){var n,o={},a=e.style;for(n in t)t.hasOwnProperty(n)&&(o[n]=a[n],a[n]=t[n]);for(n in r.call(e),t)t.hasOwnProperty(n)&&(a[n]=o[n])}(o,Xit,function(){n=Git.apply(void 0,t)}),n}function Jit(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}Wit(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Kit["outer".concat(t)]=function(t,r){return t&&Qit(t,e,r?0:1)};var r="width"===e?["Left","Right"]:["Top","Bottom"];Kit[e]=function(t,n){var o=n;return void 0!==o?t?(Uit(t)&&(o+=Zit(t,["padding","border"],r)),Sit(t,e,o)):void 0:t&&Qit(t,e,-1)}});var est={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Ait,offset:function(e,t,r){if(void 0===t)return Nit(e);!function(e,t,r){if(r.ignoreShake){var n=Nit(e),o=n.left.toFixed(0),a=n.top.toFixed(0),i=t.left.toFixed(0),s=t.top.toFixed(0);if(o===i&&a===s)return}r.useCssRight||r.useCssBottom?Hit(e,t,r):r.useCssTransform&&_it()in document.body.style?$it(e,t):Hit(e,t,r)}(e,t,r||{})},isWindow:zit,each:Wit,css:Sit,clone:function(e){var t,r={};for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(r.overflow[t]=e.overflow[t]);return r},mix:Jit,getWindowScrollLeft:function(e){return Eit(e)},getWindowScrollTop:function(e){return Tit(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)est.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};Jit(est,Kit);var tst=est.getParent;function rst(e){if(est.isWindow(e)||9===e.nodeType)return null;var t,r=est.getDocument(e).body,n=est.css(e,"position");if(!("fixed"===n||"absolute"===n))return"html"===e.nodeName.toLowerCase()?null:tst(e);for(t=tst(e);t&&t!==r&&9!==t.nodeType;t=tst(t))if("static"!==(n=est.css(t,"position")))return t;return null}var nst=est.getParent;function ost(e,t){for(var r={left:0,right:1/0,top:0,bottom:1/0},n=rst(e),o=est.getDocument(e),a=o.defaultView||o.parentWindow,i=o.body,s=o.documentElement;n;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===n.clientWidth||n===i||n===s||"visible"===est.css(n,"overflow")){if(n===i||n===s)break}else{var l=est.offset(n);l.left+=n.clientLeft,l.top+=n.clientTop,r.top=Math.max(r.top,l.top),r.right=Math.min(r.right,l.left+n.clientWidth),r.bottom=Math.min(r.bottom,l.top+n.clientHeight),r.left=Math.max(r.left,l.left)}n=rst(n)}var c=null;est.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===est.css(e,"position")&&(e.style.position="fixed"));var d=est.getWindowScrollLeft(a),u=est.getWindowScrollTop(a),p=est.viewportWidth(a),h=est.viewportHeight(a),f=s.scrollWidth,m=s.scrollHeight,v=window.getComputedStyle(i);if("hidden"===v.overflowX&&(f=a.innerWidth),"hidden"===v.overflowY&&(m=a.innerHeight),e.style&&(e.style.position=c),t||function(e){if(est.isWindow(e)||9===e.nodeType)return!1;var t=est.getDocument(e),r=t.body,n=null;for(n=nst(e);n&&n!==r&&n!==t;n=nst(n))if("fixed"===est.css(n,"position"))return!0;return!1}(e))r.left=Math.max(r.left,d),r.top=Math.max(r.top,u),r.right=Math.min(r.right,d+p),r.bottom=Math.min(r.bottom,u+h);else{var y=Math.max(f,d+p);r.right=Math.min(r.right,y);var g=Math.max(m,u+h);r.bottom=Math.min(r.bottom,g)}return r.top>=0&&r.left>=0&&r.bottom>r.top&&r.right>r.left?r:null}function ast(e){var t,r,n;if(est.isWindow(e)||9===e.nodeType){var o=est.getWindow(e);t={left:est.getWindowScrollLeft(o),top:est.getWindowScrollTop(o)},r=est.viewportWidth(o),n=est.viewportHeight(o)}else t=est.offset(e),r=est.outerWidth(e),n=est.outerHeight(e);return t.width=r,t.height=n,t}function ist(e,t){var r=t.charAt(0),n=t.charAt(1),o=e.width,a=e.height,i=e.left,s=e.top;return"c"===r?s+=a/2:"b"===r&&(s+=a),"c"===n?i+=o/2:"r"===n&&(i+=o),{left:i,top:s}}function sst(e,t,r,n,o){var a=ist(t,r[1]),i=ist(e,r[0]),s=[i.left-a.left,i.top-a.top];return{left:Math.round(e.left-s[0]+n[0]-o[0]),top:Math.round(e.top-s[1]+n[1]-o[1])}}function lst(e,t,r){return e.left<r.left||e.left+t.width>r.right}function cst(e,t,r){return e.top<r.top||e.top+t.height>r.bottom}function dst(e,t,r){var n=[];return est.each(e,function(e){n.push(e.replace(t,function(e){return r[e]}))}),n}function ust(e,t){return e[t]=-e[t],e}function pst(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function hst(e,t){e[0]=pst(e[0],t.width),e[1]=pst(e[1],t.height)}function fst(e,t,r,n){var o=r.points,a=r.offset||[0,0],i=r.targetOffset||[0,0],s=r.overflow,l=r.source||e;a=[].concat(a),i=[].concat(i);var c={},d=0,u=ost(l,!(!(s=s||{})||!s.alwaysByViewport)),p=ast(l);hst(a,p),hst(i,t);var h=sst(p,t,o,a,i),f=est.merge(p,h);if(u&&(s.adjustX||s.adjustY)&&n){if(s.adjustX&&lst(h,p,u)){var m=dst(o,/[lr]/gi,{l:"r",r:"l"}),v=ust(a,0),y=ust(i,0);(function(e,t,r){return e.left>r.right||e.left+t.width<r.left})(sst(p,t,m,v,y),p,u)||(d=1,o=m,a=v,i=y)}if(s.adjustY&&cst(h,p,u)){var g=dst(o,/[tb]/gi,{t:"b",b:"t"}),x=ust(a,1),b=ust(i,1);(function(e,t,r){return e.top>r.bottom||e.top+t.height<r.top})(sst(p,t,g,x,b),p,u)||(d=1,o=g,a=x,i=b)}d&&(h=sst(p,t,o,a,i),est.mix(f,h));var k=lst(h,p,u),_=cst(h,p,u);if(k||_){var w=o;k&&(w=dst(o,/[lr]/gi,{l:"r",r:"l"})),_&&(w=dst(o,/[tb]/gi,{t:"b",b:"t"})),o=w,a=r.offset||[0,0],i=r.targetOffset||[0,0]}c.adjustX=s.adjustX&&k,c.adjustY=s.adjustY&&_,(c.adjustX||c.adjustY)&&(f=function(e,t,r,n){var o=est.clone(e),a={width:t.width,height:t.height};return n.adjustX&&o.left<r.left&&(o.left=r.left),n.resizeWidth&&o.left>=r.left&&o.left+a.width>r.right&&(a.width-=o.left+a.width-r.right),n.adjustX&&o.left+a.width>r.right&&(o.left=Math.max(r.right-a.width,r.left)),n.adjustY&&o.top<r.top&&(o.top=r.top),n.resizeHeight&&o.top>=r.top&&o.top+a.height>r.bottom&&(a.height-=o.top+a.height-r.bottom),n.adjustY&&o.top+a.height>r.bottom&&(o.top=Math.max(r.bottom-a.height,r.top)),est.mix(o,a)}(h,p,u,c))}return f.width!==p.width&&est.css(l,"width",est.width(l)+f.width-p.width),f.height!==p.height&&est.css(l,"height",est.height(l)+f.height-p.height),est.offset(l,{left:f.left,top:f.top},{useCssRight:r.useCssRight,useCssBottom:r.useCssBottom,useCssTransform:r.useCssTransform,ignoreShake:r.ignoreShake}),{points:o,offset:a,targetOffset:i,overflow:c}}function mst(e,t,r){var n=r.target||t,o=ast(n),a=!function(e,t){var r=ost(e,t),n=ast(e);return!r||n.left+n.width<=r.left||n.top+n.height<=r.top||n.left>=r.right||n.top>=r.bottom}(n,r.overflow&&r.overflow.alwaysByViewport);return fst(e,o,r,a)}mst.__getOffsetParent=rst,mst.__getVisibleRectForElement=ost;var vst=function(){this.__data__=[],this.size=0};var yst=function(e,t){return e===t||e!=e&&t!=t},gst=yst;var xst=function(e,t){for(var r=e.length;r--;)if(gst(e[r][0],t))return r;return-1},bst=xst,kst=Array.prototype.splice;var _st=function(e){var t=this.__data__,r=bst(t,e);return!(r<0)&&(r==t.length-1?t.pop():kst.call(t,r,1),--this.size,!0)},wst=xst;var Mst=function(e){var t=this.__data__,r=wst(t,e);return r<0?void 0:t[r][1]},Cst=xst;var Dst=function(e){return Cst(this.__data__,e)>-1},jst=xst;var Ost=function(e,t){var r=this.__data__,n=jst(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Sst=vst,Pst=_st,Est=Mst,Tst=Dst,Nst=Ost;function zst(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}zst.prototype.clear=Sst,zst.prototype.delete=Pst,zst.prototype.get=Est,zst.prototype.has=Tst,zst.prototype.set=Nst;var Ast=zst,Rst=Ast;var Fst=function(){this.__data__=new Rst,this.size=0};var Lst=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var Bst=function(e){return this.__data__.get(e)};var Vst=function(e){return this.__data__.has(e)},Ist=ZC,qst=CC;var Hst,$st=function(e){if(!qst(e))return!1;var t=Ist(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Wst=SC["__core-js_shared__"],Ust=(Hst=/[^.]+$/.exec(Wst&&Wst.keys&&Wst.keys.IE_PROTO||""))?"Symbol(src)_1."+Hst:"";var Yst=function(e){return!!Ust&&Ust in e},Zst=Function.prototype.toString;var Kst=function(e){if(null!=e){try{return Zst.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Gst=$st,Xst=Yst,Qst=CC,Jst=Kst,elt=/^\[object .+?Constructor\]$/,tlt=Function.prototype,rlt=Object.prototype,nlt=tlt.toString,olt=rlt.hasOwnProperty,alt=RegExp("^"+nlt.call(olt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ilt=function(e,t){return null==e?void 0:e[t]},slt=function(e){return!(!Qst(e)||Xst(e))&&(Gst(e)?alt:elt).test(Jst(e))},llt=ilt;var clt=function(e,t){var r=llt(e,t);return slt(r)?r:void 0},dlt=clt(SC,"Map"),ult=clt(Object,"create"),plt=ult;var hlt=function(){this.__data__=plt?plt(null):{},this.size=0};var flt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},mlt=ult,vlt=Object.prototype.hasOwnProperty;var ylt=function(e){var t=this.__data__;if(mlt){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return vlt.call(t,e)?t[e]:void 0},glt=ult,xlt=Object.prototype.hasOwnProperty;var blt=function(e){var t=this.__data__;return glt?void 0!==t[e]:xlt.call(t,e)},klt=ult;var _lt=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=klt&&void 0===t?"__lodash_hash_undefined__":t,this},wlt=hlt,Mlt=flt,Clt=ylt,Dlt=blt,jlt=_lt;function Olt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Olt.prototype.clear=wlt,Olt.prototype.delete=Mlt,Olt.prototype.get=Clt,Olt.prototype.has=Dlt,Olt.prototype.set=jlt;var Slt=Olt,Plt=Ast,Elt=dlt;var Tlt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},Nlt=Tlt;var zlt=function(e,t){var r=e.__data__;return Nlt(t)?r["string"==typeof t?"string":"hash"]:r.map},Alt=zlt;var Rlt=function(e){var t=Alt(this,e).delete(e);return this.size-=t?1:0,t},Flt=zlt;var Llt=function(e){return Flt(this,e).get(e)},Blt=zlt;var Vlt=function(e){return Blt(this,e).has(e)},Ilt=zlt;var qlt=function(e,t){var r=Ilt(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Hlt=function(){this.size=0,this.__data__={hash:new Slt,map:new(Elt||Plt),string:new Slt}},$lt=Rlt,Wlt=Llt,Ult=Vlt,Ylt=qlt;function Zlt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Zlt.prototype.clear=Hlt,Zlt.prototype.delete=$lt,Zlt.prototype.get=Wlt,Zlt.prototype.has=Ult,Zlt.prototype.set=Ylt;var Klt=Zlt,Glt=Ast,Xlt=dlt,Qlt=Klt;var Jlt=function(e,t){var r=this.__data__;if(r instanceof Glt){var n=r.__data__;if(!Xlt||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Qlt(n)}return r.set(e,t),this.size=r.size,this},ect=Ast,tct=Fst,rct=Lst,nct=Bst,oct=Vst,act=Jlt;function ict(e){var t=this.__data__=new ect(e);this.size=t.size}ict.prototype.clear=tct,ict.prototype.delete=rct,ict.prototype.get=nct,ict.prototype.has=oct,ict.prototype.set=act;var sct=ict;var lct=Klt,cct=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},dct=function(e){return this.__data__.has(e)};function uct(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new lct;++t<r;)this.add(e[t])}uct.prototype.add=uct.prototype.push=cct,uct.prototype.has=dct;var pct=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var hct=function(e,t){return e.has(t)},fct=uct,mct=pct,vct=hct;var yct=function(e,t,r,n,o,a){var i=1&r,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var c=a.get(e),d=a.get(t);if(c&&d)return c==t&&d==e;var u=-1,p=!0,h=2&r?new fct:void 0;for(a.set(e,t),a.set(t,e);++u<s;){var f=e[u],m=t[u];if(n)var v=i?n(m,f,u,t,e,a):n(f,m,u,e,t,a);if(void 0!==v){if(v)continue;p=!1;break}if(h){if(!mct(t,function(e,t){if(!vct(h,t)&&(f===e||o(f,e,r,n,a)))return h.push(t)})){p=!1;break}}else if(f!==m&&!o(f,m,r,n,a)){p=!1;break}}return a.delete(e),a.delete(t),p};var gct=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var xct=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},bct=SC.Uint8Array,kct=yst,_ct=yct,wct=gct,Mct=xct,Cct=FC?FC.prototype:void 0,Dct=Cct?Cct.valueOf:void 0;var jct=function(e,t,r,n,o,a,i){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new bct(e),new bct(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return kct(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=wct;case"[object Set]":var l=1&n;if(s||(s=Mct),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;n|=2,i.set(e,t);var d=_ct(s(e),s(t),n,o,a,i);return i.delete(e),d;case"[object Symbol]":if(Dct)return Dct.call(e)==Dct.call(t)}return!1};var Oct=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e},Sct=Array.isArray,Pct=Oct,Ect=Sct;var Tct=function(e,t,r){var n=t(e);return Ect(e)?n:Pct(n,r(e))};var Nct=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};var zct=Nct,Act=function(){return[]},Rct=Object.prototype.propertyIsEnumerable,Fct=Object.getOwnPropertySymbols,Lct=Fct?function(e){return null==e?[]:(e=Object(e),zct(Fct(e),function(t){return Rct.call(e,t)}))}:Act;var Bct=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},Vct=ZC,Ict=KC;var qct=function(e){return Ict(e)&&"[object Arguments]"==Vct(e)},Hct=KC,$ct=Object.prototype,Wct=$ct.hasOwnProperty,Uct=$ct.propertyIsEnumerable,Yct=qct(function(){return arguments}())?qct:function(e){return Hct(e)&&Wct.call(e,"callee")&&!Uct.call(e,"callee")},Zct={exports:{}};var Kct=function(){return!1};!function(e,t){var r=SC,n=Kct,o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o?r.Buffer:void 0,s=(i?i.isBuffer:void 0)||n;e.exports=s}(Zct,Zct.exports);var Gct=/^(?:0|[1-9]\d*)$/;var Xct=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&Gct.test(e))&&e>-1&&e%1==0&&e<t};var Qct=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Jct=ZC,edt=Qct,tdt=KC,rdt={};rdt["[object Float32Array]"]=rdt["[object Float64Array]"]=rdt["[object Int8Array]"]=rdt["[object Int16Array]"]=rdt["[object Int32Array]"]=rdt["[object Uint8Array]"]=rdt["[object Uint8ClampedArray]"]=rdt["[object Uint16Array]"]=rdt["[object Uint32Array]"]=!0,rdt["[object Arguments]"]=rdt["[object Array]"]=rdt["[object ArrayBuffer]"]=rdt["[object Boolean]"]=rdt["[object DataView]"]=rdt["[object Date]"]=rdt["[object Error]"]=rdt["[object Function]"]=rdt["[object Map]"]=rdt["[object Number]"]=rdt["[object Object]"]=rdt["[object RegExp]"]=rdt["[object Set]"]=rdt["[object String]"]=rdt["[object WeakMap]"]=!1;var ndt=function(e){return tdt(e)&&edt(e.length)&&!!rdt[Jct(e)]};var odt=function(e){return function(t){return e(t)}},adt={exports:{}};!function(e,t){var r=DC,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,a=o&&o.exports===n&&r.process,i=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=i}(adt,adt.exports);var idt=ndt,sdt=odt,ldt=adt.exports,cdt=ldt&&ldt.isTypedArray,ddt=cdt?sdt(cdt):idt,udt=Bct,pdt=Yct,hdt=Sct,fdt=Zct.exports,mdt=Xct,vdt=ddt,ydt=Object.prototype.hasOwnProperty;var gdt=function(e,t){var r=hdt(e),n=!r&&pdt(e),o=!r&&!n&&fdt(e),a=!r&&!n&&!o&&vdt(e),i=r||n||o||a,s=i?udt(e.length,String):[],l=s.length;for(var c in e)!t&&!ydt.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mdt(c,l))||s.push(c);return s},xdt=Object.prototype;var bdt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xdt)};var kdt=function(e,t){return function(r){return e(t(r))}},_dt=kdt(Object.keys,Object),wdt=bdt,Mdt=_dt,Cdt=Object.prototype.hasOwnProperty;var Ddt=function(e){if(!wdt(e))return Mdt(e);var t=[];for(var r in Object(e))Cdt.call(e,r)&&"constructor"!=r&&t.push(r);return t},jdt=$st,Odt=Qct;var Sdt=gdt,Pdt=Ddt,Edt=function(e){return null!=e&&Odt(e.length)&&!jdt(e)};var Tdt=Tct,Ndt=Lct,zdt=function(e){return Edt(e)?Sdt(e):Pdt(e)};var Adt=function(e){return Tdt(e,zdt,Ndt)},Rdt=Object.prototype.hasOwnProperty;var Fdt=function(e,t,r,n,o,a){var i=1&r,s=Adt(e),l=s.length;if(l!=Adt(t).length&&!i)return!1;for(var c=l;c--;){var d=s[c];if(!(i?d in t:Rdt.call(t,d)))return!1}var u=a.get(e),p=a.get(t);if(u&&p)return u==t&&p==e;var h=!0;a.set(e,t),a.set(t,e);for(var f=i;++c<l;){var m=e[d=s[c]],v=t[d];if(n)var y=i?n(v,m,d,t,e,a):n(m,v,d,e,t,a);if(!(void 0===y?m===v||o(m,v,r,n,a):y)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){var g=e.constructor,x=t.constructor;g==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof x&&x instanceof x||(h=!1)}return a.delete(e),a.delete(t),h},Ldt=clt(SC,"DataView"),Bdt=dlt,Vdt=clt(SC,"Promise"),Idt=clt(SC,"Set"),qdt=clt(SC,"WeakMap"),Hdt=ZC,$dt=Kst,Wdt="[object Map]",Udt="[object Promise]",Ydt="[object Set]",Zdt="[object WeakMap]",Kdt="[object DataView]",Gdt=$dt(Ldt),Xdt=$dt(Bdt),Qdt=$dt(Vdt),Jdt=$dt(Idt),eut=$dt(qdt),tut=Hdt;(Ldt&&tut(new Ldt(new ArrayBuffer(1)))!=Kdt||Bdt&&tut(new Bdt)!=Wdt||Vdt&&tut(Vdt.resolve())!=Udt||Idt&&tut(new Idt)!=Ydt||qdt&&tut(new qdt)!=Zdt)&&(tut=function(e){var t=Hdt(e),r="[object Object]"==t?e.constructor:void 0,n=r?$dt(r):"";if(n)switch(n){case Gdt:return Kdt;case Xdt:return Wdt;case Qdt:return Udt;case Jdt:return Ydt;case eut:return Zdt}return t});var rut=sct,nut=yct,out=jct,aut=Fdt,iut=tut,sut=Sct,lut=Zct.exports,cut=ddt,dut="[object Arguments]",uut="[object Array]",put="[object Object]",hut=Object.prototype.hasOwnProperty;var fut=function(e,t,r,n,o,a){var i=sut(e),s=sut(t),l=i?uut:iut(e),c=s?uut:iut(t),d=(l=l==dut?put:l)==put,u=(c=c==dut?put:c)==put,p=l==c;if(p&&lut(e)){if(!lut(t))return!1;i=!0,d=!1}if(p&&!d)return a||(a=new rut),i||cut(e)?nut(e,t,r,n,o,a):out(e,t,l,r,n,o,a);if(!(1&r)){var h=d&&hut.call(e,"__wrapped__"),f=u&&hut.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,v=f?t.value():t;return a||(a=new rut),o(m,v,r,n,a)}}return!!p&&(a||(a=new rut),aut(e,t,r,n,o,a))},mut=KC;var vut=function e(t,r,n,o,a){return t===r||(null==t||null==r||!mut(t)&&!mut(r)?t!=t&&r!=r:fut(t,r,n,o,e,a))},yut=vut;var gut=function(e,t){return yut(e,t)};function xut(e,t){var r=null,n=null;var o=new oN(function(e){var o=qot(e,1)[0].target;if(document.documentElement.contains(o)){var a=o.getBoundingClientRect(),i=a.width,s=a.height,l=Math.floor(i),c=Math.floor(s);r===l&&n===c||Promise.resolve().then(function(){t({width:l,height:c})}),r=l,n=c}});return e&&o.observe(e),function(){o.disconnect()}}function but(e){return"function"!=typeof e?null:e()}function kut(e){return"object"===i7e(e)&&e?e:null}var _ut=function(e,t){var r=e.children,n=e.disabled,o=e.target,a=e.align,i=e.onAlign,s=e.monitorWindowResize,c=e.monitorBufferTime,d=void 0===c?0:c,u=l.default.useRef({}),p=l.default.useRef(),h=l.default.Children.only(r),f=l.default.useRef({});f.current.disabled=n,f.current.target=o,f.current.align=a,f.current.onAlign=i;var m=function(e,t){var r=l.default.useRef(!1),n=l.default.useRef(null);function o(){window.clearTimeout(n.current)}return[function a(i){if(o(),r.current&&!0!==i)n.current=window.setTimeout(function(){r.current=!1,a()},t);else{if(!1===e())return;r.current=!0,n.current=window.setTimeout(function(){r.current=!1},t)}},function(){r.current=!1,o()}]}(function(){var e=f.current,t=e.disabled,r=e.target,n=e.align,o=e.onAlign;if(!t&&r){var a,i=p.current,s=but(r),l=kut(r);u.current.element=s,u.current.point=l,u.current.align=n;var c=document.activeElement;return s&&function(e){if(!e)return!1;if(e instanceof HTMLElement&&e.offsetParent)return!0;if(e instanceof SVGGraphicsElement&&e.getBBox){var t=e.getBBox(),r=t.width,n=t.height;if(r||n)return!0}if(e instanceof HTMLElement&&e.getBoundingClientRect){var o=e.getBoundingClientRect(),a=o.width,i=o.height;if(a||i)return!0}return!1}(s)?a=mst(i,s,n):l&&(a=function(e,t,r){var n,o,a=est.getDocument(e),i=a.defaultView||a.parentWindow,s=est.getWindowScrollLeft(i),l=est.getWindowScrollTop(i),c=est.viewportWidth(i),d=est.viewportHeight(i),u={left:n="pageX"in t?t.pageX:s+t.clientX,top:o="pageY"in t?t.pageY:l+t.clientY,width:0,height:0},p=n>=0&&n<=s+c&&o>=0&&o<=l+d,h=[r.points[0],"cc"];return fst(e,u,vit(vit({},r),{},{points:h}),p)}(i,l,n)),function(e,t){e!==document.activeElement&&lit(t,e)&&"function"==typeof e.focus&&e.focus()}(c,i),o&&a&&o(i,a),!0}return!1},d),v=qot(m,2),y=v[0],g=v[1],x=l.default.useRef({cancel:function(){}}),b=l.default.useRef({cancel:function(){}});l.default.useEffect(function(){var e,t,r=but(o),n=kut(o);p.current!==b.current.element&&(b.current.cancel(),b.current.element=p.current,b.current.cancel=xut(p.current,y)),u.current.element===r&&((e=u.current.point)===(t=n)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&gut(u.current.align,a)||(y(),x.current.element!==r&&(x.current.cancel(),x.current.element=r,x.current.cancel=xut(r,y)))}),l.default.useEffect(function(){n?g():y()},[n]);var k=l.default.useRef(null);return l.default.useEffect(function(){s?k.current||(k.current=cit(window,"resize",y)):k.current&&(k.current.remove(),k.current=null)},[s]),l.default.useEffect(function(){return function(){x.current.cancel(),b.current.cancel(),k.current&&k.current.remove(),g()}},[]),l.default.useImperativeHandle(t,function(){return{forceAlign:function(){return y(!0)}}}),l.default.isValidElement(h)&&(h=l.default.cloneElement(h,{ref:Wot(h.ref,p)})),h},wut=l.default.forwardRef(_ut);wut.displayName="Align";var Mut="test"!==process.env.NODE_ENV&&Yot()?s.useLayoutEffect:s.useEffect,Cut=["measure","alignPre","align",null,"motion"],Dut=s.forwardRef(function(t,r){var n=t.visible,o=t.prefixCls,a=t.className,i=t.style,l=t.children,c=t.zIndex,d=t.stretch,u=t.destroyPopupOnHide,p=t.forceRender,h=t.align,f=t.point,m=t.getRootDomNode,v=t.getClassNameFromAlign,y=t.onAlign,g=t.onMouseEnter,x=t.onMouseLeave,b=t.onMouseDown,k=t.onTouchStart,_=t.onClick,w=e.useRef(),M=e.useRef(),C=qot(e.useState(),2),D=C[0],j=C[1],O=function(e){var t=qot(s.useState({width:0,height:0}),2),r=t[0],n=t[1],o=s.useMemo(function(){var t={};if(e){var n=r.width,o=r.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t},[e,r]);return[o,function(e){n({width:e.offsetWidth,height:e.offsetHeight})}]}(d),S=qot(O,2),P=S[0],E=S[1];var T=function(t,r){var n=qot(gat(null),2),o=n[0],a=n[1],i=e.useRef();function s(e){a(e,!0)}function l(){Mat.cancel(i.current)}return e.useEffect(function(){s("measure")},[t]),e.useEffect(function(){"measure"===o&&r(),o&&(i.current=Mat(Sot(jot().mark(function e(){var t,r;return jot().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=Cut.indexOf(o),(r=Cut[t+1])&&-1!==t&&s(r);case 3:case"end":return e.stop()}},e)}))))},[o]),e.useEffect(function(){return function(){l()}},[]),[o,function(e){l(),i.current=Mat(function(){s(function(e){switch(o){case"align":return"motion";case"motion":return"stable"}return e}),null==e||e()})}]}(n,function(){d&&E(m())}),N=qot(T,2),z=N[0],A=N[1],F=qot(e.useState(0),2),L=F[0],B=F[1],V=e.useRef();function I(){var e;null===(e=w.current)||void 0===e||e.forceAlign()}function q(e,t){var r=v(t);D!==r&&j(r),B(function(e){return e+1}),"align"===z&&(null==y||y(e,t))}Mut(function(){"alignPre"===z&&B(0)},[z]),Mut(function(){"align"===z&&(L<2?I():A(function(){var e;null===(e=V.current)||void 0===e||e.call(V)}))},[L]);var H=got({},pit(t));function $(){return new Promise(function(e){V.current=e})}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(e){var t=H[e];H[e]=function(e,r){return A(),null==t?void 0:t(e,r)}}),s.useEffect(function(){H.motionName||"motion"!==z||A()},[H.motionName,z]),s.useImperativeHandle(r,function(){return{forceAlign:I,getElement:function(){return M.current}}});var W=got(got({},P),{},{zIndex:c,opacity:"motion"!==z&&"stable"!==z&&n?0:void 0,pointerEvents:n||"stable"===z?void 0:"none"},i),U=!0;!(null==h?void 0:h.points)||"align"!==z&&"stable"!==z||(U=!1);var Y=l;return s.Children.count(l)>1&&(Y=s.createElement("div",{className:"".concat(o,"-content")},l)),s.createElement(Tat,R({visible:n,ref:M,leavedClassName:"".concat(o,"-hidden")},H,{onAppearPrepare:$,onEnterPrepare:$,removeOnLeave:u,forceRender:p}),function(e,t){var r=e.className,n=e.style,i=nE(o,a,D,r);return s.createElement(wut,{target:f||m,key:"popup",ref:w,monitorWindowResize:!0,disabled:U,align:h,onAlign:q},s.createElement("div",{ref:t,className:i,onMouseEnter:g,onMouseLeave:x,onMouseDownCapture:b,onTouchStartCapture:k,onClick:_,style:got(got({},n),W)},Y))})});Dut.displayName="PopupInner";var jut=s.forwardRef(function(e,t){var r=e.prefixCls,n=e.visible,o=e.zIndex,a=e.children,i=e.mobile,l=(i=void 0===i?{}:i).popupClassName,c=i.popupStyle,d=i.popupMotion,u=void 0===d?{}:d,p=i.popupRender,h=e.onClick,f=s.useRef();s.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return f.current}}});var m=got({zIndex:o},c),v=a;return s.Children.count(a)>1&&(v=s.createElement("div",{className:"".concat(r,"-content")},a)),p&&(v=p(v)),s.createElement(Tat,R({visible:n,ref:f,removeOnLeave:!0},u),function(e,t){var n=e.className,o=e.style,a=nE(r,l,n);return s.createElement("div",{ref:t,className:a,onClick:h,style:got(got({},o),m)},v)})});jut.displayName="MobilePopupInner";var Out=["visible","mobile"],Sut=s.forwardRef(function(t,r){var n=t.visible,o=t.mobile,a=vot(t,Out),i=qot(e.useState(n),2),l=i[0],c=i[1],d=qot(e.useState(!1),2),u=d[0],p=d[1],h=got(got({},a),{},{visible:l});e.useEffect(function(){c(n),n&&o&&p(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())},[n,o]);var f=u?s.createElement(jut,R({},h,{mobile:o,ref:r})):s.createElement(Dut,R({},h,{ref:r}));return s.createElement("div",null,s.createElement(hit,h),f)});Sut.displayName="Popup";var Put=s.createContext(null);function Eut(){}function Tut(){return""}function Nut(e){return e?e.ownerDocument:window.document}var zut=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var Aut=function(e){var t=function(){S9e(r,s.Component);var t=T9e(r);function r(e){var n,o;return N9e(this,r),(n=t.call(this,e)).popupRef=s.createRef(),n.triggerRef=s.createRef(),n.portalContainer=void 0,n.attachId=void 0,n.clickOutsideHandler=void 0,n.touchOutsideHandler=void 0,n.contextMenuOutsideHandler1=void 0,n.contextMenuOutsideHandler2=void 0,n.mouseDownTimeout=void 0,n.focusTime=void 0,n.preClickTime=void 0,n.preTouchTime=void 0,n.delayTimer=void 0,n.hasPopupMouseDown=void 0,n.onMouseEnter=function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)},n.onMouseMove=function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)},n.onMouseLeave=function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)},n.onPopupMouseEnter=function(){n.clearDelayTimer()},n.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&lit(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)},n.onFocus=function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))},n.onMouseDown=function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()},n.onTouchStart=function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()},n.onBlur=function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)},n.onContextMenu=function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)},n.onContextMenuClose=function(){n.isContextMenuToShow()&&n.close()},n.onClick=function(e){if(n.fireEvents("onClick",e),n.focusTime){var t;if(n.preClickTime&&n.preTouchTime?t=Math.min(n.preClickTime,n.preTouchTime):n.preClickTime?t=n.preClickTime:n.preTouchTime&&(t=n.preTouchTime),Math.abs(t-n.focusTime)<20)return;n.focusTime=0}n.preClickTime=0,n.preTouchTime=0,n.isClickToShow()&&(n.isClickToHide()||n.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var r=!n.state.popupVisible;(n.isClickToHide()&&!r||r&&n.isClickToShow())&&n.setPopupVisible(!n.state.popupVisible,e)},n.onPopupMouseDown=function(){var e;(n.hasPopupMouseDown=!0,clearTimeout(n.mouseDownTimeout),n.mouseDownTimeout=window.setTimeout(function(){n.hasPopupMouseDown=!1},0),n.context)&&(e=n.context).onPopupMouseDown.apply(e,arguments)},n.onDocumentClick=function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),o=n.getPopupDomNode();lit(r,t)&&!n.isContextMenuOnly()||lit(o,t)||n.hasPopupMouseDown||n.close()}},n.getRootDomNode=function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=Hot(n.triggerRef.current);if(t)return t}catch(e){}return u.default.findDOMNode(Ls(n))},n.getPopupClassNameFromAlign=function(e){var t=[],r=n.props,o=r.popupPlacement,a=r.builtinPlacements,i=r.prefixCls,s=r.alignPoint,l=r.getPopupClassNameFromAlign;return o&&a&&t.push(function(e,t,r,n){for(var o=r.points,a=Object.keys(e),i=0;i<a.length;i+=1){var s=a[i];if(uit(e[s].points,o,n))return"".concat(t,"-placement-").concat(s)}return""}(a,i,e,s)),l&&t.push(l(e)),t.join(" ")},n.getComponent=function(){var e=n.props,t=e.prefixCls,r=e.destroyPopupOnHide,o=e.popupClassName,a=e.onPopupAlign,i=e.popupMotion,l=e.popupAnimation,c=e.popupTransitionName,d=e.popupStyle,u=e.mask,p=e.maskAnimation,h=e.maskTransitionName,f=e.maskMotion,m=e.zIndex,v=e.popup,y=e.stretch,g=e.alignPoint,x=e.mobile,b=e.forceRender,k=e.onPopupClick,_=n.state,w=_.popupVisible,M=_.point,C=n.getPopupAlign(),D={};return n.isMouseEnterToShow()&&(D.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(D.onMouseLeave=n.onPopupMouseLeave),D.onMouseDown=n.onPopupMouseDown,D.onTouchStart=n.onPopupMouseDown,s.createElement(Sut,R({prefixCls:t,destroyPopupOnHide:r,visible:w,point:g&&M,className:o,align:C,onAlign:a,animation:l,getClassNameFromAlign:n.getPopupClassNameFromAlign},D,{stretch:y,getRootDomNode:n.getRootDomNode,style:d,mask:u,zIndex:m,transitionName:c,maskAnimation:p,maskTransitionName:h,maskMotion:f,ref:n.popupRef,motion:i,mobile:x,forceRender:b,onClick:k}),"function"==typeof v?v():v)},n.attachParent=function(e){Mat.cancel(n.attachId);var t,r=n.props,o=r.getPopupContainer,a=r.getDocument,i=n.getRootDomNode();o?(i||0===o.length)&&(t=o(i)):t=a(n.getRootDomNode()).body,t?t.appendChild(e):n.attachId=Mat(function(){n.attachParent(e)})},n.getContainer=function(){if(!n.portalContainer){var e=(0,n.props.getDocument)(n.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",n.portalContainer=e}return n.attachParent(n.portalContainer),n.portalContainer},n.setPoint=function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})},n.handlePortalUpdate=function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)},n.triggerContextValue={onPopupMouseDown:n.onPopupMouseDown},o="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,n.state={prevPopupVisible:o,popupVisible:o},zut.forEach(function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}}),n}return R9e(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=cit(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=cit(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=cit(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=cit(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Mat.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,r=e.popupAlign,n=e.builtinPlacements;return t&&n?function(e,t,r){return got(got({},e[t]||{}),r)}(n,t,r):r}},{key:"setPopupVisible",value:function(e,t){var r=this.props.alignPoint,n=this.state.popupVisible;this.clearDelayTimer(),n!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:n}),this.props.onPopupVisibleChange(e)),r&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,r){var n=this,o=1e3*t;if(this.clearDelayTimer(),o){var a=r?{pageX:r.pageX,pageY:r.pageY}:null;this.delayTimer=window.setTimeout(function(){n.setPopupVisible(e,a),n.clearDelayTimer()},o)}else this.setPopupVisible(e,r)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,r=this.props;return t[e]&&r[e]?this["fire".concat(e)]:t[e]||r[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("click")||-1!==r.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==r.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,r=e.hideAction;return-1!==t.indexOf("click")||-1!==r.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("hover")||-1!==r.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,r=e.hideAction;return-1!==t.indexOf("hover")||-1!==r.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("focus")||-1!==r.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,r=e.hideAction;return-1!==t.indexOf("focus")||-1!==r.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var r=this.props.children.props[e];r&&r(t);var n=this.props[e];n&&n(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,r=this.props,n=r.children,o=r.forceRender,a=r.alignPoint,i=r.className,l=r.autoDestroy,c=s.Children.only(n),d={key:"trigger"};this.isContextMenuToShow()?d.onContextMenu=this.onContextMenu:d.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(d.onClick=this.onClick,d.onMouseDown=this.onMouseDown,d.onTouchStart=this.onTouchStart):(d.onClick=this.createTwoChains("onClick"),d.onMouseDown=this.createTwoChains("onMouseDown"),d.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(d.onMouseEnter=this.onMouseEnter,a&&(d.onMouseMove=this.onMouseMove)):d.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?d.onMouseLeave=this.onMouseLeave:d.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(d.onFocus=this.onFocus,d.onBlur=this.onBlur):(d.onFocus=this.createTwoChains("onFocus"),d.onBlur=this.createTwoChains("onBlur"));var u=nE(c&&c.props&&c.props.className,i);u&&(d.className=u);var p=got({},d);Uot(c)&&(p.ref=Wot(this.triggerRef,c.ref));var h,f=s.cloneElement(c,p);return(t||this.popupRef.current||o)&&(h=s.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&l&&(h=null),s.createElement(Put.Provider,{value:this.triggerContextValue},f,h)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=e.popupVisible,n={};return void 0!==r&&t.popupVisible!==r&&(n.popupVisible=r,n.prevPopupVisible=t.popupVisible),n}}]),r}();return t.contextType=Put,t.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Tut,getDocument:Nut,onPopupVisibleChange:Eut,afterPopupVisibleChange:Eut,onPopupAlign:Eut,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},t}(dit),Rut={adjustX:1,adjustY:1},Fut=[0,0],Lut={left:{points:["cr","cl"],overflow:Rut,offset:[-4,0],targetOffset:Fut},right:{points:["cl","cr"],overflow:Rut,offset:[4,0],targetOffset:Fut},top:{points:["bc","tc"],overflow:Rut,offset:[0,-4],targetOffset:Fut},bottom:{points:["tc","bc"],overflow:Rut,offset:[0,4],targetOffset:Fut},topLeft:{points:["bl","tl"],overflow:Rut,offset:[0,-4],targetOffset:Fut},leftTop:{points:["tr","tl"],overflow:Rut,offset:[-4,0],targetOffset:Fut},topRight:{points:["br","tr"],overflow:Rut,offset:[0,-4],targetOffset:Fut},rightTop:{points:["tl","tr"],overflow:Rut,offset:[4,0],targetOffset:Fut},bottomRight:{points:["tr","br"],overflow:Rut,offset:[0,4],targetOffset:Fut},rightBottom:{points:["bl","br"],overflow:Rut,offset:[4,0],targetOffset:Fut},bottomLeft:{points:["tl","bl"],overflow:Rut,offset:[0,4],targetOffset:Fut},leftBottom:{points:["br","bl"],overflow:Rut,offset:[-4,0],targetOffset:Fut}};function But(e){var t=e.showArrow,r=e.arrowContent,n=e.children,o=e.prefixCls,a=e.id,i=e.overlayInnerStyle,l=e.className,c=e.style;return s.createElement("div",{className:nE("".concat(o,"-content"),l),style:c},!1!==t&&s.createElement("div",{className:"".concat(o,"-arrow"),key:"arrow"},r),s.createElement("div",{className:"".concat(o,"-inner"),id:a,role:"tooltip",style:i},"function"==typeof n?n():n))}var Vut,Iut,qut,Hut,$ut=function(t,r){var n=t.overlayClassName,o=t.trigger,a=void 0===o?["hover"]:o,i=t.mouseEnterDelay,l=void 0===i?0:i,c=t.mouseLeaveDelay,d=void 0===c?.1:c,u=t.overlayStyle,p=t.prefixCls,h=void 0===p?"rc-tooltip":p,f=t.children,m=t.onVisibleChange,v=t.afterVisibleChange,y=t.transitionName,g=t.animation,x=t.motion,b=t.placement,k=void 0===b?"right":b,_=t.align,w=void 0===_?{}:_,M=t.destroyTooltipOnHide,C=void 0!==M&&M,D=t.defaultVisible,j=t.getTooltipContainer,O=t.overlayInnerStyle,S=t.arrowContent,P=t.overlay,E=t.id,T=t.showArrow,N=vot(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),z=e.useRef(null);e.useImperativeHandle(r,function(){return z.current});var A=got({},N);"visible"in t&&(A.popupVisible=t.visible);var F=!1,L=!1;if("boolean"==typeof C)F=C;else if(C&&"object"===i7e(C)){var B=C.keepParent;F=!0===B,L=!1===B}return s.createElement(Aut,R({popupClassName:n,prefixCls:h,popup:function(){return s.createElement(But,{showArrow:T,arrowContent:S,key:"content",prefixCls:h,id:E,overlayInnerStyle:O},P)},action:a,builtinPlacements:Lut,popupPlacement:k,ref:z,popupAlign:w,getPopupContainer:j,onPopupVisibleChange:m,afterPopupVisibleChange:v,popupTransitionName:y,popupAnimation:g,popupMotion:x,defaultPopupVisible:D,destroyPopupOnHide:F,autoDestroy:L,mouseLeaveDelay:d,popupStyle:u,mouseEnterDelay:l},A),f)},Wut=e.forwardRef($ut),Uut=qe.div(Iut||(Iut=g(["\n ",";\n"],["\n ",";\n"])),function(e){var t=e.theme,r=t.colors,n=t.sizes,o=t.fonts,a=e.$styles;return Ee(Vut||(Vut=g(["\n .rc-tooltip {\n &-arrow {\n display: none;\n }\n &-inner {\n min-height: unset;\n padding: ","px;\n background-color: ",";\n color: ",";\n border-radius: ","px;\n ",";\n ",";\n }\n }\n "],["\n .rc-tooltip {\n &-arrow {\n display: none;\n }\n &-inner {\n min-height: unset;\n padding: ","px;\n background-color: ",";\n color: ",";\n border-radius: ","px;\n ",";\n ",";\n }\n }\n "])),n.S,r.indigo,r.white,n.S,o.S,a)}),Yut={DEFAULT:"Minus",ERROR:"Close",SUCCESS:"Check"},Zut=function(e){var t=e.text,r=e.status,n=function(e){var t=ve().colors;switch(e){case"SUCCESS":return{color:t.greenShade,backgroundColor:t.greenTint,borderColor:"transparent"};case"ERROR":return{color:t.redShade,backgroundColor:t.redTint,borderColor:"transparent"};default:return{color:t.gray2,backgroundColor:"transparent",borderColor:t.gray3}}}(r),o=n.backgroundColor,a=n.color,i=n.borderColor,s=ve().sizes;return Oe(Kut,h({style:{backgroundColor:o,borderColor:i}},{children:[je(Tk,{size:s.M,name:Yut[r],color:a}),je(i4e,{width:"S"}),je(s4e,h({variant:"M",color:a},{children:t}))]}))},Kut=qe.div(Hut||(Hut=g(["\n ","\n"],["\n ","\n"])),function(e){var t=e.theme.sizes;return Ee(qut||(qut=g(["\n display: flex;\n width: fit-content;\n align-items: center;\n border-radius: ","px;\n border: 1.5px solid transparent;\n padding: ","px ","px ","px ","px;\n "],["\n display: flex;\n width: fit-content;\n align-items: center;\n border-radius: ","px;\n border: 1.5px solid transparent;\n padding: ","px ","px ","px ","px;\n "])),t.M,t.XS,t.M,t.XS,t.S)}),Gut=function(e){var t,r=e.children,n=f(e,["children"]);return h(h({},n),{items:null!==(t=null==r?void 0:r.map(function(e){return"molecule"===e.instance&&"consent"===e.type?e:"container"===e.instance?Gut(e):e}))&&void 0!==t?t:[]})};exports.AccountButtonContext=$nt,exports.AccountButtonProvider=Wnt,exports.AlertMolecule=T2e,exports.ApiContext=Gnt,exports.ApiProvider=function(e){var t=e.api,r=e.children;return je(Gnt.Provider,h({value:t},{children:r}))},exports.Avatar=function(e){var t=e.size,r=void 0===t?"XL":t,n=e.withShadow,o=e.label,a=e.backgroundColor,i=e.onPress,s=e.content,l=s.initials,c=s.iconName,d=s.imageUrl,u=e.textConfig,p=void 0===u?{}:u,f=p.color,m=void 0===f?"white":f,v=p.font,y=void 0===v?"L":v,g="number"==typeof r?r:Ze.sizes[r],x=l?je(Zb,h({variant:y,color:m,avatarSize:g},{children:l})):c?je(Tk,{name:c,color:"white",size:g/1.5}):d?je(Kb,{avatarSize:g,src:d}):null;return Oe(Wb,{children:[je(Yb,h({clickable:!!i,onClick:i,withShadow:n,backgroundColor:d?"white":a,avatarSize:g},{children:x})),!!o&&je(Ub,h({variant:"L"},{children:o}))]})},exports.BackgroundImage=R_,exports.BadgeMolecule=N2e,exports.BaseMolecule=Fnt,exports.BaseTextButton=bk,exports.BasicTextField=A2e,exports.BinaryRadioButtons=Wrt,exports.Button=R2e,exports.ButtonActionsContext=iS,exports.ButtonActionsProvider=function(t){var r,n,o,a=t.children,i=t.popupProps,s=Hnt().localStateObject,l=Ynt().stateConfig,c=s||l,d=e.useState({}),u=d[0],p=d[1],f=e.useState(!1),m=f[0],v=f[1],y=e.useState(!1),g=y[0],x=y[1],b=e.useState(null),k=b[0],_=b[1],w=dS().onStateChange,M=function(e){var t=null==i?void 0:i.find(function(t){return t.id===e});_(t||null),v(!0),w({id:e,type:"opened"})};e.useEffect(function(){null==i||i.forEach(function(e){var t;(null===(t=c[e.id])||void 0===t?void 0:t.visible)&&M(e.id)})},[c]);var C=function(e){_(null),v(!1),w({id:e,type:"closed"})},D=function(){x(!1)};je(Int,{item:u});var j=e.useMemo(function(){return{actionContent:u,setActionContent:p,isModalVisible:m,isDrawerVisible:g,setDrawerVisible:x,setActivePopUpById:M,onCloseDrawer:D,onCloseModal:C}},[u,p,m,g,x,M,D,C]),O=k||{},S=O.config,P=O.content;return Oe(iS.Provider,h({value:j},{children:[k&&m&&Oe(qrt,h({size:null==S?void 0:S.size,open:m,onClose:function(){return C(k.id)},popupId:k.id,modalStyles:null==S?void 0:S.styles,withCloseIcon:null==S?void 0:S.withCloseIcon},{children:[null===(r=null==P?void 0:P.embedded)||void 0===r?void 0:r.map(function(e){var t;return je(cS,h({initItems:null===(t=null==e?void 0:e.body)||void 0===t?void 0:t.items},{children:je(Int,{item:null==e?void 0:e.body},e.id)}))}),(null==P?void 0:P.isi)&&je(Int,{item:null===(o=null===(n=null==k?void 0:k.content)||void 0===n?void 0:n.isi)||void 0===o?void 0:o.body})]})),a]}))},exports.COMMUNICATION_LINK_DATA_TEXT=sot,exports.COMMUNICATION_LINK_DATA_URL=iot,exports.COMMUNICATION_LINK_ELEMENT_ID=oot,exports.Checkbox=Urt,exports.Checklist=n4e,exports.ChipMolecule=o4e,exports.Circle=Ck,exports.CirclesWrapper=jk,exports.CircularIndicator=function(e){var t=e.activeColor,r=e.inactiveColor,n=f(e,["activeColor","inactiveColor"]),o=(ve()||Ze).colors;return je(Ok,h({},n,{activeColor:o[t]||t,inactiveColor:o[r]||r}))},exports.CircularIndicatorStyledComponent=Ok,exports.ConsentMolecule=a4e,exports.Container=Jrt,exports.ContainerWrapper=e4e,exports.ContentWrapper=function(t){var r=t.children,n=t.className,o=t.marginTop,a=void 0===o?"0px":o,i=t.marginLeft,s=void 0===i?"0px":i,l=t.marginRight,c=void 0===l?"0px":l,d=Zrt(),u=d.drawer,p=d.setDrawerContainerRef,f=e.useRef(null);e.useEffect(function(){return p&&p(f.current),function(){p&&p(null)}},[p]);var m=function(e){var t=parseFloat(e);return isNaN(t)?0:t},v=m(s),y="absolute"!==u.positionType&&"left"===u.position&&u.isOpen?"".concat(v+u.width,"px"):s,g=m(c),x="absolute"!==u.positionType&&"right"===u.position&&u.isOpen?"".concat(g+u.width,"px"):c;return je(Krt,h({ref:f,className:n,style:{marginTop:a,marginLeft:y,marginRight:x}},{children:r}))},exports.CustomValidation=c4e,exports.DatePickerMolecule=Ett,exports.Divider=Ttt,exports.Drawer=ert,exports.ErrorText=function(e){var t=e.text;return Oe(De,{children:[je(i4e,{height:"XS"}),je(s4e,h({variant:"XS",color:"red"},{children:t}))]})},exports.FormOrganismItem=Vnt,exports.FormStepContext=ZN,exports.FormStepContextProvider=KN,exports.HorizontalButtons=function(e){var t=e.onClick,r=e.disabled,n=e.buttonOptions,o=e.selectedButtonId,a=e.error,i=(null==n?void 0:n.slice(0,2))||[];return je(Sk,h({error:a,disabled:r},{children:i.map(function(e){var r=e.value,n=e.id;return je(Pk,h({isActive:n===o,onClick:function(){return t(n)}},{children:r}),n)})}))},exports.HorizontalPadding=O_,exports.Icon=Tk,exports.IconButton=function(e){var t=e.name,r=e.color,n=e.onClick,o=e.disabled,a=e.activeOpacity,i=e.withoutOpacityEffect,s=f(e,["name","color","onClick","disabled","activeOpacity","withoutOpacityEffect"]),l=(ve()||Ze).colors;return je(_k,h({onClick:n,disabled:o,activeOpacity:a,withoutOpacityEffect:i},{children:je(xk[t],h({},s,{color:l[r]||r}))}))},exports.IconRenderer=E2e,exports.IconWrapper=$rt,exports.Image=Ntt,exports.Input=function(t){var r=t.value,n=t.leftIcon,o=t.rightIcon,a=t.onChange,i=t.onBlur,s=t.disabled,l=t.isError,c=t.placeholder,d=t.isEditMode,u=void 0===d||d,p=t.type,m=void 0===p?"text":p,v=t.internalConfig,y=t.config,x=f(t,["value","leftIcon","rightIcon","onChange","onBlur","disabled","isError","placeholder","isEditMode","type","internalConfig","config"]),b=e.useState(!1),k=b[0],_=b[1],w=e.useRef(null),M=function(e){switch(e){case"text":return{type:"text",inputMode:"text"};case"phone_number":return{type:"tel",inputMode:"tel"};case"password":return{type:"password",inputMode:"text"};default:return{}}}(m),C=function(e,t){var r=(t||{}).maskPlaceholder;switch(e){case"month_year_date":return{keepCharPositions:!0,mask:y_,placeholder:r||"09/1970",pipe:Ak.exports.createAutoCorrectedDatePipe("mm/yyyy",k_)};case"day_month_year_date":return{keepCharPositions:!0,mask:v_,placeholder:r||"25/09/1970",pipe:Ak.exports.createAutoCorrectedDatePipe("dd/mm/yyyy",k_)};case"month_day_year_date":return{keepCharPositions:!0,mask:m_,placeholder:r||"09/25/1970",pipe:Ak.exports.createAutoCorrectedDatePipe("mm/dd/yyyy",k_)};case"year_month_day_date":return{keepCharPositions:!0,mask:f_,placeholder:r||"1970/09/25",pipe:Ak.exports.createAutoCorrectedDatePipe("yyyy/mm/dd",k_)};case"phone_number":return{keepCharPositions:!0,mask:g_,placeholder:r||"(555) 495-3947"};case"email":return{mask:p_,placeholder:r||"example@mail.com"};case"us_zip_code":return{keepCharPositions:!0,mask:h_,placeholder:r||"12345"};case"integer":return{mask:x_,placeholder:r||"123"};case"numerical":return{mask:b_,placeholder:r||"123.45"};default:return{mask:!1}}}(m,y),D=ve().colors,j=D[function(e){var t=e.isEditMode,r=e.isFocused,n=e.isError,o=e.disabled;return t?o?"gray3":n?"red":r?"gray1":"gray3":"gray1"}({isFocused:k,isError:l,disabled:s,isEditMode:u})],O=v||{},S=O.horizontalPadding,P=void 0===S?0:S,E=O.verticalPadding,T=void 0===E?0:E,N=O.placeholderTextColor,z=O.placeholderTextFontSize,A=O.textColor,R=O.textFontSize,F=O.styles,L=O.wrapperStyles,B=Ee(Fk||(Fk=g(["\n ",";\n ",";\n ",";\n &::placeholder {\n ",";\n ",";\n }\n ",";\n "],["\n ",";\n ",";\n ",";\n &::placeholder {\n ",";\n ",";\n }\n ",";\n "])),A?"color: ".concat(D[A]||A,";"):"",R?"font-size: ".concat(R,"px;"):"",P||T?"padding: ".concat(T,"px ").concat(P,"px;"):"",z?"font-size: ".concat(z,"px;"):"",N?"color: ".concat(D[N]||N,";"):"",F);return Oe(w_,h({withoutOpacityEffect:!0,disabled:!u||s,isEditMode:u,isFocused:k,isError:l,$styles:L,onClick:function(){var e;return null===(e=w.current)||void 0===e?void 0:e.inputElement.focus()}},{children:[!!n&&je(D_,h({withoutOpacityEffect:!n.onClick,onClick:function(e){return __(e,n.onClick)}},{children:je(Tk,{name:n.name,color:j})})),je(M_,h({id:"formatted-text-mask-input",value:r,$styles:B,onChange:function(e){return null==a?void 0:a(e.target.value)},onFocus:function(){return _(!0)},onBlur:function(){_(!1),null==i||i()},ref:w,isError:l,disabled:!u||s,placeholder:c,isEditMode:u,autoComplete:"off"},x,M,C)),!!o&&je(j_,h({withoutOpacityEffect:!o.onClick,onClick:function(e){return __(e,o.onClick)}},{children:je(Tk,{name:o.name,color:j})}))]}))},exports.LayoutContext=Yrt,exports.LayoutProvider=function(t){var r=t.children,n=t.layoutPosition,o=void 0===n?"normal":n,a=t.drawerMaxWidthPercent,i=void 0===a?80:a,s=t.headerHeight,l=void 0===s?"0px":s,c=t.isMLR,d=void 0!==c&&c,u=t.isMobile,p=void 0!==u&&u,f=e.useState({width:0,position:"right",isOpen:!1,positionType:o}),m=f[0],v=f[1],y=e.useRef(null),g=e.useState(null),x=g[0],b=g[1],k=$b("xs"),_=p||k;e.useEffect(function(){v(function(e){return h(h({},e),{positionType:o})})},[o]),e.useEffect(function(){if(y.current){var e=function(){var e;if(m.isOpen){var t=(null===(e=y.current)||void 0===e?void 0:e.clientWidth)||0,r=Math.floor(t*(i/100));m.width>r&&v(function(e){return h(h({},e),{width:r})})}};e();var t=new ResizeObserver(function(){e()});return t.observe(y.current),function(){t&&t.disconnect()}}},[m.isOpen,m.width,i]);var w=e.useMemo(function(){return function(e){v(function(t){var r=void 0!==e.width?e.width:t.width;if(y.current&&(e.isOpen||t.isOpen)){var n=y.current.clientWidth,o=Math.floor(n*(i/100));r=Math.min(r,o)}var a=void 0!==e.positionType?e.positionType:t.positionType;return h(h(h({},t),e),{width:r,positionType:a})})}},[i]),M=e.useMemo(function(){return{drawer:m,updateDrawer:w,drawerContainerRef:x,setDrawerContainerRef:b,headerHeight:l,isMobile:_,isMLR:d}},[m,w,x,l,_,d]);return je(Yrt.Provider,h({value:M},{children:je("div",h({ref:y,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},{children:r}))}))},exports.Link=trt,exports.MATRIX_MESSAGE_DATA_ID=aot,exports.MATRIX_MESSAGE_ELEMENT_ID=not,exports.MlrRichTextViewerContext=oS,exports.MlrRichTextViewerProvider=function(e){var t=e.children,r=e.isMLRReview,n=e.showAnnotations,o=e.annotationsList;return je(oS.Provider,h({value:{isMLRReview:r,annotationsList:o,showAnnotations:n}},{children:t}))},exports.ModalWrapper=Hrt,exports.Organism=function(e){var t=e.organism;return je(Int,{item:Gut(t.body)})},exports.OrganismContext=sS,exports.OrganismContextProvider=cS,exports.OrganismItem=Int,exports.PasswordSetup=art,exports.PdfDocument=function(t){var r=t.source,o=t.isMobile,a=void 0!==o&&o,i=t.customDocumentStyles,s=e.useState(0),l=s[0],c=s[1],d=e.useState(1),u=d[0],p=d[1],f=e.useState(null),m=f[0],v=f[1],y=i||{},g=y.pageWidth,x=void 0===g?a?342:856:g,b=y.pageHeight,k=m!==u;return je(yrt,h({pageWidth:x,pageHeight:void 0===b?a?442:1108:b},{children:Oe(grt,h({customDocumentStyles:i},{children:[Oe(n.Document,h({file:r,renderMode:"canvas",className:"document",onLoadSuccess:function(e){var t=e.numPages;c(t)},loading:je(Xp,{size:60})},{children:[k&&m?je(n.Page,{pageNumber:m,renderTextLayer:!1,className:"custom-pdf"},m):null,je(n.Page,{pageNumber:u,renderTextLayer:!1,className:"".concat(k?"loadingPage":"custom-pdf"),onRenderSuccess:function(){return v(u)}},u)]})),Oe(xrt,{children:[je(brt,h({disable:u<=1,onClick:function(){return p(function(e){return e+(e<=1?0:-1)})},customDocumentStyles:i},{children:je(Tk,{name:"CaretLeft",size:33})})),je(krt,{type:"number",size:"small",customDocumentStyles:i,onChange:function(e){var t=e.target.value,r=e.nativeEvent;return function(e,t){if(!Number.isNaN(e)){var r=Math.round(e);r>l?!Number.isNaN(t)&&t>0&&t<=l&&p(t):r<1||p(r)}}(+t,+((null==r?void 0:r.data)||""))},value:u}),je(brt,h({disabled:!0},{children:je(_rt,{})})),je(s4e,h({variant:"S",color:(null==i?void 0:i.pageNumberColor)||"white"},{children:l})),je(brt,h({disable:u>=l,onClick:function(){return p(function(e){return e+(e>=l?0:1)})},customDocumentStyles:i},{children:je(Tk,{name:"CaretRight"})}))]})]}))}))},exports.RadioButtons=function(e){var t=e.ref,r=e.name,n=e.value,o=e.options,a=e.onBlur,i=e.onChange,s=e.isRow,l=void 0!==s&&s,c=e.isError,d=void 0!==c&&c,u=e.disabled,p=void 0!==u&&u,f=e.isEditMode,m=void 0===f||f,v=e.isRichText,y=void 0!==v&&v,g=e.internalConfig,x=P_({internalConfig:g}).groupWrapperStyles;return je(z_,h({ref:t,row:l,$isRow:l,name:r,value:n,onBlur:a,onChange:function(e){m&&(null==i||i(e.target.value))},$styles:x},{children:null==o?void 0:o.map(function(e){return je(N_,{option:e,isError:d,disabled:p,isRichText:y,isEditMode:m,internalConfig:g},e.id)})}))},exports.RadioGroupWrapper=z_,exports.RatingMolecule=wrt,exports.RegularImage=A_,exports.RichTextViewer=cot,exports.Select=function(t){var r=t.ref,n=t.onBlur,o=t.onChange,a=t.value,i=t.placeholder,s=t.options,l=void 0===s?[]:s,c=t.disabled,d=void 0!==c&&c,u=t.optionsPresentation,p=void 0!==u&&u,f=t.isError,m=t.isEditMode,v=void 0===m||m,y=t.selectInternalConfig,g=t.isRichText,x=void 0!==g&&g,b=e.useState(p),k=b[0],_=b[1],w=e.useState(a),M=w[0],C=w[1],D=null==l?void 0:l.find(function(e){return e.id===M});e.useEffect(function(){var e=function(){return!p&&_(!1)};return window.addEventListener("click",e),function(){return window.removeEventListener("click",e)}}),e.useEffect(function(){return _(p)},[p]),e.useEffect(function(){return C(a)},[a]);var j=function(e){return e===M};return je(dot,h({ref:r,tabIndex:0,onBlur:n,disabled:d,isEditMode:v,hasValue:!!D,isOpen:k,hasError:!!f,$styles:hot(y,!!D)},{children:Oe("div",h({className:"select-wrapper"},{children:[Oe("div",h({className:"select-input",onClick:function(e){p||(e.stopPropagation(),_(function(e){return!e}))}},{children:[D?x?je(cot,{numberOfLines:1,value:D.label}):je(s4e,h({numberOfLines:1,variant:"M",color:"gray1"},{children:D.label})):je(s4e,h({numberOfLines:1,variant:"M",color:"gray3"},{children:i})),v&&je("div",h({className:"icon-container"},{children:je(Tk,{name:"CaretDown"})}))]})),k&&v&&je(uot,{children:l.map(function(e){var t,r=e.id,n=e.label;return je(pot,h({$selected:j(r),onClick:function(){return function(e){C(e),null==o||o(e)}(r)}},{children:x?(t=JSON.parse(n),t.map(function(e){return zM.string(e)}).join("\n")):n}),r)})})]}))}))},exports.SelectMolecule=Crt,exports.SliderMolecule=Art,exports.Spacer=i4e,exports.SpeedDial=Grt,exports.Spinner=mot,exports.StateContext=Unt,exports.StateContextProvider=function(t){var r=t.initStateConfig,n=t.children,o=t.stateHandler,a=t.authenticated,i=e.useMemo(function(){return{stateConfig:r,stateHandler:o,authenticated:a}},[r,o,a]);return je(Unt.Provider,h({value:i},{children:n}))},exports.Stepper=Rrt,exports.StyleWrapper=Uut,exports.SwitchMolecule=Lrt,exports.TextButton=kk,exports.TextMolecule=Att,exports.TextWrapper=s4e,exports.Tooltip=function(t){var r=t.trigger,n=void 0===r?"hover":r,o=t.placement,a=void 0===o?"top":o,i=t.styles,s=f(t,["trigger","placement","styles"]),l=e.useRef(null);return je(Uut,h({ref:l,$styles:i},{children:je(Wut,h({},s,{getTooltipContainer:function(){return l.current},trigger:n,placement:a}))}))},exports.TouchableOpacity=_k,exports.ValidationTag=Zut,exports.VerticalPadding=S_,exports.Video=Brt,exports.ZealThemeProvider=function(e){return je(Ct,h({injectFirst:!0},{children:je(ge,h({theme:h(h({},Hb),e.theme)},{children:Oe(os,h({theme:h(h({},Hb),e.theme)},{children:[je(oh,{}),je(Pe,{styles:qb}),e.children]}))}))}))},exports.ZealUIModal=qrt,exports.defaultTheme=Ze,exports.fontWeight=[100,200,300,400,500,600,700,800,900],exports.fonts=["3XL","2XL","XL","L","M","S","XS"],exports.passwordValidationMapper=rrt,exports.richTextDefaultValue=lot,exports.seoTags=["h1","h2","h3","h4","h5","h6"],exports.sizings=["5XL","4XL","3XL","2XL","XL","L","M","S","XS",0],exports.toast=sit,exports.toastStyles=Ib,exports.useAccountButtonContext=function(){return e.useContext($nt)},exports.useApi=Xnt,exports.useButtonActionsContext=qnt,exports.useFormStepContext=Znt,exports.useLayoutContext=Zrt,exports.useMediaQuery=$b,exports.useMlrRichTextViewerContext=aS,exports.useOrganismContext=Hnt,exports.useStateContext=Ynt;
9550
9550
  //# sourceMappingURL=index.js.map