| Server IP : 146.59.209.152 / Your IP : 216.73.216.152 Web Server : Apache System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : monpetu ( 144298) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/monpetu/www/ipprint/wp-content/plugins/power-coupons/admin/assets/build/rule-engine/ |
Upload File : |
(()=>{"use strict";var e,t,n={20(e,t,n){var r=n(609),o=Symbol.for("react.element"),l=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,l={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!a.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===l[r]&&(l[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:l,_owner:s.current}}t.Fragment=l,t.jsx=c,t.jsxs=c},848(e,t,n){e.exports=n(20)},609(e){e.exports=window.React}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var l=r[e]={exports:{}};return n[e](l,l.exports,o),l.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var l=Object.create(null);o.r(l);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,o.d(l,i),l},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l=o(609),i=o.t(l,2),s=o(848);const a=e=>{const t=f(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),c(n,t)||d(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},c=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?c(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const l=e.join("-");return t.validators.find(({validator:e})=>e(l))?.classGroupId},u=/^\[(.+)\]$/,d=e=>{if(u.test(e)){const t=u.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},f=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return h(Object.entries(e.classGroups),n).forEach(([e,n])=>{p(n,r,e,t)}),r},p=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?g(e)?void p(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,o])=>{p(o,m(t,e),n,r)});(""===e?t:m(t,e)).classGroupId=n})},m=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},g=e=>e.isThemeGetter,h=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,b=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},v=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],l=t.length,i=e=>{const n=[];let i,s=0,a=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===o&&(r||e.slice(c,c+l)===t)){n.push(e.slice(a,c)),a=c+l;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===n.length?e:e.substring(a),u=c.startsWith("!");return{modifiers:n,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>a?i-a:void 0}};return n?e=>n({className:e,parseClassName:i}):i},y=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},w=/\s+/;function x(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=_(e))&&(r&&(r+=" "),r+=t);return r}const _=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_(e[r]))&&(n&&(n+=" "),n+=t);return n};function E(e,...t){let n,r,o,l=function(s){const c=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:b(e.cacheSize),parseClassName:v(e),...a(e)}))(c),r=n.cache.get,o=n.cache.set,l=i,i(s)};function i(e){const t=r(e);if(t)return t;const l=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,l=[],i=e.trim().split(w);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:a,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?" "+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?" "+s:s);continue}f=!1}const m=y(a).join(":"),g=c?m+"!":m,h=g+p;if(l.includes(h))continue;l.push(h);const b=o(p,f);for(let e=0;e<b.length;++e){const t=b[e];l.push(g+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return o(e,l),l}return function(){return l(x.apply(null,arguments))}}const k=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},R=/^\[(?:([a-z-]+):)?(.+)\]$/i,C=/^\d+\/\d+$/,S=new Set(["px","full","screen"]),I=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N=/\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$/,O=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,L=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,M=e=>P(e)||S.has(e)||C.test(e),A=e=>U(e,"length",X),P=e=>Boolean(e)&&!Number.isNaN(Number(e)),T=e=>U(e,"number",P),z=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&P(e.slice(0,-1)),F=e=>R.test(e),B=e=>I.test(e),W=new Set(["length","size","percentage"]),q=e=>U(e,W,Y),$=e=>U(e,"position",Y),V=new Set(["image","url"]),K=e=>U(e,V,Z),H=e=>U(e,"",Q),G=()=>!0,U=(e,t,n)=>{const r=R.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},X=e=>N.test(e)&&!O.test(e),Y=()=>!1,Q=e=>L.test(e),Z=e=>j.test(e),J=E((Symbol.toStringTag,()=>{const e=k("colors"),t=k("spacing"),n=k("blur"),r=k("brightness"),o=k("borderColor"),l=k("borderRadius"),i=k("borderSpacing"),s=k("borderWidth"),a=k("contrast"),c=k("grayscale"),u=k("hueRotate"),d=k("invert"),f=k("gap"),p=k("gradientColorStops"),m=k("gradientColorStopPositions"),g=k("inset"),h=k("margin"),b=k("opacity"),v=k("padding"),y=k("saturate"),w=k("scale"),x=k("sepia"),_=k("skew"),E=k("space"),R=k("translate"),C=()=>["auto",F,t],S=()=>[F,t],I=()=>["",M,A],N=()=>["auto",P,F],O=()=>["","0",F],L=()=>[P,F];return{cacheSize:500,separator:":",theme:{colors:[G],spacing:[M,A],blur:["none","",B,F],brightness:L(),borderColor:[e],borderRadius:["none","","full",B,F],borderSpacing:S(),borderWidth:I(),contrast:L(),grayscale:O(),hueRotate:L(),invert:O(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[D,A],inset:C(),margin:C(),opacity:L(),padding:S(),saturate:L(),scale:L(),sepia:O(),skew:L(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",F]}],container:["container"],columns:[{columns:[B]}],"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",F]}],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:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",z,F]}],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",F]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",z,F]}],"grid-cols":[{"grid-cols":[G]}],"col-start-end":[{col:["auto",{span:["full",z,F]},F]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[G]}],"row-start-end":[{row:["auto",{span:[z,F]},F]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",F]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",F]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",F,t]}],"min-w":[{"min-w":[F,t,"min","max","fit"]}],"max-w":[{"max-w":[F,t,"none","full","min","max","fit","prose",{screen:[B]},B]}],h:[{h:[F,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[F,t,"auto","min","max","fit"]}],"font-size":[{text:["base",B,A]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",T]}],"font-family":[{font:[G]}],"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",F]}],"line-clamp":[{"line-clamp":["none",P,T]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",M,F]}],"list-image":[{"list-image":["none",F]}],"list-style-type":[{list:["none","disc","decimal",F]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"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",M,A]}],"underline-offset":[{"underline-offset":["auto",M,F]}],"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:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F]}],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",F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",q]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},K]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"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":[b]}],"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":[b]}],"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":[M,F]}],"outline-w":[{outline:[M,A]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[M,A]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",B,H]}],"shadow-color":[{shadow:[G]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",B,F]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"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",F]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",F]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",F]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[z,F]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",F]}],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",F]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",F]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[M,A,T]}],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 ee(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=ee(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function te(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ee(e))&&(r&&(r+=" "),r+=t);return r}const ne=(...e)=>J(te(...e)),re=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var oe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const le=(0,l.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},c)=>(0,l.createElement)("svg",{ref:c,...oe,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:re("lucide",o),...a},[...s.map(([e,t])=>(0,l.createElement)(e,t)),...Array.isArray(i)?i:[i]])),ie=(e,t)=>{const n=(0,l.forwardRef)(({className:n,...r},o)=>{return(0,l.createElement)(le,{ref:o,iconNode:t,className:re(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i});return n.displayName=`${e}`,n},se=ie("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),ae=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ce=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),ue=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function de(){return"undefined"!=typeof window}function fe(e){return ge(e)?(e.nodeName||"").toLowerCase():"#document"}function pe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function me(e){var t;return null==(t=(ge(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ge(e){return!!de()&&(e instanceof Node||e instanceof pe(e).Node)}function he(e){return!!de()&&(e instanceof Element||e instanceof pe(e).Element)}function be(e){return!!de()&&(e instanceof HTMLElement||e instanceof pe(e).HTMLElement)}function ve(e){return!(!de()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof pe(e).ShadowRoot)}const ye=new Set(["inline","contents"]);function we(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=je(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ye.has(o)}const xe=new Set(["table","td","th"]);function _e(e){return xe.has(fe(e))}const Ee=[":popover-open",":modal"];function ke(e){return Ee.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Re=["transform","translate","scale","rotate","perspective"],Ce=["transform","translate","scale","rotate","perspective","filter"],Se=["paint","layout","strict","content"];function Ie(e){const t=Ne(),n=he(e)?je(e):e;return Re.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Ce.some(e=>(n.willChange||"").includes(e))||Se.some(e=>(n.contain||"").includes(e))}function Ne(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Oe=new Set(["html","body","#document"]);function Le(e){return Oe.has(fe(e))}function je(e){return pe(e).getComputedStyle(e)}function Me(e){return he(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if("html"===fe(e))return e;const t=e.assignedSlot||e.parentNode||ve(e)&&e.host||me(e);return ve(t)?t.host:t}function Pe(e){const t=Ae(e);return Le(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&we(t)?t:Pe(t)}function Te(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Pe(e),l=o===(null==(r=e.ownerDocument)?void 0:r.body),i=pe(o);if(l){const e=ze(i);return t.concat(i,i.visualViewport||[],we(o)?o:[],e&&n?Te(e):[])}return t.concat(o,Te(o,[],n))}function ze(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function De(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Fe(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ve(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Be(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function We(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function qe(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Ke()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function $e(e){return!We().includes("jsdom/")&&(!Ke()&&0===e.width&&0===e.height||Ke()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function Ve(){return/apple/i.test(navigator.vendor)}function Ke(){const e=/android/i;return e.test(Be())||e.test(We())}function He(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ge(e){return(null==e?void 0:e.ownerDocument)||document}function Ue(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Xe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ye(e){return be(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Qe(e){e.preventDefault(),e.stopPropagation()}function Ze(e){return!!e&&"combobox"===e.getAttribute("role")&&Ye(e)}const Je=Math.min,et=Math.max,tt=Math.round,nt=Math.floor,rt=e=>({x:e,y:e}),ot={left:"right",right:"left",bottom:"top",top:"bottom"},lt={start:"end",end:"start"};function it(e,t){return"function"==typeof e?e(t):e}function st(e){return e.split("-")[0]}function at(e){return e.split("-")[1]}function ct(e){return"y"===e?"height":"width"}const ut=new Set(["top","bottom"]);function dt(e){return ut.has(st(e))?"y":"x"}function ft(e){return"x"===dt(e)?"y":"x"}function pt(e){return e.replace(/start|end/g,e=>lt[e])}const mt=["left","right"],gt=["right","left"],ht=["top","bottom"],bt=["bottom","top"];function vt(e){return e.replace(/left|right|bottom|top/g,e=>ot[e])}function yt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var wt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),xt="undefined"==typeof Element,_t=xt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Et=!xt&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},kt=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&kt(e.parentNode)},Rt=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var l=o.shift();if(!kt(l,!1))if("SLOT"===l.tagName){var i=l.assignedElements(),s=i.length?i:l.children,a=Rt(s,!0,n);n.flatten?r.push.apply(r,a):r.push({scopeParent:l,candidates:a})}else{_t.call(l,wt)&&n.filter(l)&&(t||!e.includes(l))&&r.push(l);var c=l.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(l),u=!kt(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(l));if(c&&u){var d=Rt(!0===c?l.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:l,candidates:d})}else o.unshift.apply(o,l.children)}}return r},Ct=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},St=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ct(e)?0:e.tabIndex},It=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Nt=function(e){return"INPUT"===e.tagName},Ot=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Lt=function(e,t){return!(t.disabled||kt(t)||function(e){return Nt(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=_t.call(e,"details>summary:first-of-type")?e.parentElement:e;if(_t.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ot(e)}else{if("function"==typeof r){for(var l=e;e;){var i=e.parentElement,s=Et(e);if(i&&!i.shadowRoot&&!0===r(i))return Ot(e);e=e.assignedSlot?e.assignedSlot:i||s===e.ownerDocument?i:s.host}e=l}if(function(e){var t,n,r,o,l=e&&Et(e),i=null===(t=l)||void 0===t?void 0:t.host,s=!1;if(l&&l!==e)for(s=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&i;){var a,c,u;s=!(null===(c=i=null===(a=l=Et(i))||void 0===a?void 0:a.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(i))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!_t.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},jt=function(e,t){return!(function(e){return function(e){return Nt(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Et(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||St(t)<0||!Lt(e,t))},Mt=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},At=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,l=o?e.scopeParent:e,i=function(e,t){var n=St(e);return n<0&&t&&!Ct(e)?0:n}(l,o),s=o?At(e.candidates):l;0===i?o?t.push.apply(t,s):t.push(l):n.push({documentOrder:r,tabIndex:i,item:e,isScope:o,content:s})}),n.sort(It).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Pt=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Rt([e],t.includeContainer,{filter:jt.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Mt}):function(e,t,n){if(kt(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(wt));return t&&_t.call(e,wt)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,jt.bind(null,t)),At(n)};const Tt=window.ReactDOM;function zt(e,t,n){let{reference:r,floating:o}=e;const l=dt(t),i=ft(t),s=ct(i),a=st(t),c="y"===l,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(a){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(at(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function Dt(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:l,rects:i,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=it(t,e),m=function(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}}(p),g=s[f?"floating"===d?"reference":"floating":d],h=yt(await l.getClippingRect({element:null==(n=await(null==l.isElement?void 0:l.isElement(g)))||n?g:g.contextElement||await(null==l.getDocumentElement?void 0:l.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:a})),b="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s.floating)),y=await(null==l.isElement?void 0:l.isElement(v))&&await(null==l.getScale?void 0:l.getScale(v))||{x:1,y:1},w=yt(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:a}):b);return{top:(h.top-w.top+m.top)/y.y,bottom:(w.bottom-h.bottom+m.bottom)/y.y,left:(h.left-w.left+m.left)/y.x,right:(w.right-h.right+m.right)/y.x}}const Ft=new Set(["left","top"]);function Bt(e){const t=je(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(e),l=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=tt(n)!==l||tt(r)!==i;return s&&(n=l,r=i),{width:n,height:r,$:s}}function Wt(e){return he(e)?e:e.contextElement}function qt(e){const t=Wt(e);if(!be(t))return rt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=Bt(t);let i=(l?tt(n.width):n.width)/r,s=(l?tt(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const $t=rt(0);function Vt(e){const t=pe(e);return Ne()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:$t}function Kt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),l=Wt(e);let i=rt(1);t&&(r?he(r)&&(i=qt(r)):i=qt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==pe(e))&&t}(l,n,r)?Vt(l):rt(0);let a=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(l){const e=pe(l),t=r&&he(r)?pe(r):r;let n=e,o=ze(n);for(;o&&r&&t!==n;){const e=qt(o),t=o.getBoundingClientRect(),r=je(o),l=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;a*=e.x,c*=e.y,u*=e.x,d*=e.y,a+=l,c+=i,n=pe(o),o=ze(n)}}return yt({width:u,height:d,x:a,y:c})}function Ht(e,t){const n=Me(e).scrollLeft;return t?t.left+n:Kt(me(e)).left+n}function Gt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ht(e,n),y:n.top+t.scrollTop}}const Ut=new Set(["absolute","fixed"]);function Xt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=pe(e),r=me(e),o=n.visualViewport;let l=r.clientWidth,i=r.clientHeight,s=0,a=0;if(o){l=o.width,i=o.height;const e=Ne();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}const c=Ht(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-o);i<=25&&(l-=i)}else c<=25&&(l+=c);return{width:l,height:i,x:s,y:a}}(e,n);else if("document"===t)r=function(e){const t=me(e),n=Me(e),r=e.ownerDocument.body,o=et(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=et(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ht(e);const s=-n.scrollTop;return"rtl"===je(r).direction&&(i+=et(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:i,y:s}}(me(e));else if(he(t))r=function(e,t){const n=Kt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=be(e)?qt(e):rt(1);return{width:e.clientWidth*l.x,height:e.clientHeight*l.y,x:o*l.x,y:r*l.y}}(t,n);else{const n=Vt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yt(r)}function Yt(e,t){const n=Ae(e);return!(n===t||!he(n)||Le(n))&&("fixed"===je(n).position||Yt(n,t))}function Qt(e,t,n){const r=be(t),o=me(t),l="fixed"===n,i=Kt(e,!0,l,t);let s={scrollLeft:0,scrollTop:0};const a=rt(0);function c(){a.x=Ht(o)}if(r||!r&&!l)if(("body"!==fe(t)||we(o))&&(s=Me(t)),r){const e=Kt(t,!0,l,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&c();l&&!r&&o&&c();const u=!o||r||l?rt(0):Gt(o,s);return{x:i.left+s.scrollLeft-a.x-u.x,y:i.top+s.scrollTop-a.y-u.y,width:i.width,height:i.height}}function Zt(e){return"static"===je(e).position}function Jt(e,t){if(!be(e)||"fixed"===je(e).position)return null;if(t)return t(e);let n=e.offsetParent;return me(e)===n&&(n=n.ownerDocument.body),n}function en(e,t){const n=pe(e);if(ke(e))return n;if(!be(e)){let t=Ae(e);for(;t&&!Le(t);){if(he(t)&&!Zt(t))return t;t=Ae(t)}return n}let r=Jt(e,t);for(;r&&_e(r)&&Zt(r);)r=Jt(r,t);return r&&Le(r)&&Zt(r)&&!Ie(r)?n:r||function(e){let t=Ae(e);for(;be(t)&&!Le(t);){if(Ie(t))return t;if(ke(t))return null;t=Ae(t)}return null}(e)||n}const tn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l="fixed"===o,i=me(r),s=!!t&&ke(t.floating);if(r===i||s&&l)return n;let a={scrollLeft:0,scrollTop:0},c=rt(1);const u=rt(0),d=be(r);if((d||!d&&!l)&&(("body"!==fe(r)||we(i))&&(a=Me(r)),be(r))){const e=Kt(r);c=qt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||l?rt(0):Gt(i,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-a.scrollTop*c.y+u.y+f.y}},getDocumentElement:me,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[..."clippingAncestors"===n?ke(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Te(e,[],!1).filter(e=>he(e)&&"body"!==fe(e)),o=null;const l="fixed"===je(e).position;let i=l?Ae(e):e;for(;he(i)&&!Le(i);){const t=je(i),n=Ie(i);n||"fixed"!==t.position||(o=null),(l?!n&&!o:!n&&"static"===t.position&&o&&Ut.has(o.position)||we(i)&&!n&&Yt(e,i))?r=r.filter(e=>e!==i):o=t,i=Ae(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=l[0],s=l.reduce((e,n)=>{const r=Xt(t,n,o);return e.top=et(r.top,e.top),e.right=Je(r.right,e.right),e.bottom=Je(r.bottom,e.bottom),e.left=et(r.left,e.left),e},Xt(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:en,getElementRects:async function(e){const t=this.getOffsetParent||en,n=this.getDimensions,r=await n(e.floating);return{reference:Qt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Bt(e);return{width:t,height:n}},getScale:qt,isElement:he,isRTL:function(e){return"rtl"===je(e).direction}};function nn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=r,c=Wt(e),u=o||l?[...c?Te(c):[],...Te(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=me(e);function l(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),l();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const m={rootMargin:-nt(d)+"px "+-nt(o.clientWidth-(u+f))+"px "+-nt(o.clientHeight-(d+p))+"px "+-nt(u)+"px",threshold:et(0,Je(1,a))||1};let g=!0;function h(t){const r=t[0].intersectionRatio;if(r!==a){if(!g)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||nn(c,e.getBoundingClientRect())||i(),g=!1}try{r=new IntersectionObserver(h,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),l}(c,n):null;let f,p=-1,m=null;i&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!a&&m.observe(c),m.observe(t));let g=a?Kt(e):null;return a&&function t(){const r=Kt(e);g&&!nn(g,r)&&n(),g=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,a&&cancelAnimationFrame(f)}}const on=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:i,middlewareData:s}=t,a=await async function(e,t){const{placement:n,platform:r,elements:o}=e,l=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=st(n),s=at(n),a="y"===dt(n),c=Ft.has(i)?-1:1,u=l&&a?-1:1,d=it(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),a?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:l+a.y,data:{...a,placement:i}}}}},ln=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,rects:i,initialPlacement:s,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...h}=it(e,t);if(null!=(n=l.arrow)&&n.alignmentOffset)return{};const b=st(o),v=dt(s),y=st(s)===s,w=await(null==a.isRTL?void 0:a.isRTL(c.floating)),x=f||(y||!g?[vt(s)]:function(e){const t=vt(e);return[pt(e),t,pt(t)]}(s)),_="none"!==m;!f&&_&&x.push(...function(e,t,n,r){const o=at(e);let l=function(e,t,n){switch(e){case"top":case"bottom":return n?t?gt:mt:t?mt:gt;case"left":case"right":return t?ht:bt;default:return[]}}(st(e),"start"===n,r);return o&&(l=l.map(e=>e+"-"+o),t&&(l=l.concat(l.map(pt)))),l}(s,g,m,w));const E=[s,...x],k=await Dt(t,h),R=[];let C=(null==(r=l.flip)?void 0:r.overflows)||[];if(u&&R.push(k[b]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=at(e),o=ft(e),l=ct(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=vt(i)),[i,vt(i)]}(o,i,w);R.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:R}],!R.every(e=>e<=0)){var S,I;const e=((null==(S=l.flip)?void 0:S.index)||0)+1,t=E[e];if(t&&("alignment"!==d||v===dt(t)||C.every(e=>dt(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(I=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(p){case"bestFit":{var N;const e=null==(N=C.filter(e=>{if(_){const t=dt(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},sn=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:i,elements:s}=t,{apply:a=()=>{},...c}=it(e,t),u=await Dt(t,c),d=st(o),f=at(o),p="y"===dt(o),{width:m,height:g}=l.floating;let h,b;"top"===d||"bottom"===d?(h=d,b=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,h="end"===f?"top":"bottom");const v=g-u.top-u.bottom,y=m-u.left-u.right,w=Je(g-u[h],v),x=Je(m-u[b],y),_=!t.middlewareData.shift;let E=w,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=v),_&&!f){const e=et(u.left,0),t=et(u.right,0),n=et(u.top,0),r=et(u.bottom,0);p?k=m-2*(0!==e||0!==t?e+t:et(u.left,u.right)):E=g-2*(0!==n||0!==r?n+r:et(u.top,u.bottom))}await a({...t,availableWidth:k,availableHeight:E});const R=await i.getDimensions(s.floating);return m!==R.width||g!==R.height?{reset:{rects:!0}}:{}}}},an=(e,t,n)=>{const r=new Map,o={platform:tn,...n},l={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:i}=n,s=l.filter(Boolean),a=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=zt(c,r,a),f=r,p={},m=0;for(let n=0;n<s.length;n++){const{name:l,fn:g}=s[n],{x:h,y:b,data:v,reset:y}=await g({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=h?h:u,d=null!=b?b:d,p={...p,[l]:{...p[l],...v}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(c=!0===y.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=zt(c,f,a))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:l})};var cn="undefined"!=typeof document?l.useLayoutEffect:function(){};function un(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!un(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||un(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function dn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fn(e,t){const n=dn(e);return Math.round(t*n)/n}function pn(e){const t=l.useRef(e);return cn(()=>{t.current=e}),t}const mn=(e,t)=>({...ln(e),options:[e,t]}),gn=(e,t)=>({...sn(e),options:[e,t]}),hn={...i},bn=hn.useInsertionEffect||(e=>e());function vn(e){const t=l.useRef(()=>{});return bn(()=>{t.current=e}),l.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}const yn="ArrowUp",wn="ArrowDown",xn="ArrowLeft",En="ArrowRight";function kn(e,t,n){return Math.floor(e/t)!==n}function Rn(e,t){return t<0||t>=e.current.length}function Cn(e,t){return In(e,{disabledIndices:t})}function Sn(e,t){return In(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function In(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:l=1}=void 0===t?{}:t;const i=e.current;let s=n;do{s+=r?-l:l}while(s>=0&&s<=i.length-1&&Ln(i,s,o));return s}function Nn(e,t,n,r,o){if(-1===e)return-1;const l=n.indexOf(e),i=t[e];switch(o){case"tl":return l;case"tr":return i?l+i.width-1:l;case"bl":return i?l+(i.height-1)*r:l;case"br":return n.lastIndexOf(e)}}function On(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Ln(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var jn="undefined"!=typeof document?l.useLayoutEffect:l.useEffect;function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mn.apply(this,arguments)}let An=!1,Pn=0;const Tn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Pn++,zn=hn.useId||function(){const[e,t]=l.useState(()=>An?Tn():void 0);return jn(()=>{null==e&&t(Tn())},[]),l.useEffect(()=>{An=!0},[]),e};const Dn=l.createContext(null),Fn=l.createContext(null),Bn=()=>{var e;return(null==(e=l.useContext(Dn))?void 0:e.id)||null},Wn=()=>l.useContext(Fn);function qn(e){return"data-floating-ui-"+e}function $n(e){const t=(0,l.useRef)(e);return jn(()=>{t.current=e}),t}let Vn=0;function Kn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Vn);const l=()=>null==e?void 0:e.focus({preventScroll:n});o?l():Vn=requestAnimationFrame(l)}function Hn(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}let Gn=new WeakMap,Un=new WeakSet,Xn={},Yn=0;const Qn=e=>e&&(e.host||Qn(e.parentNode));function Zn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Ge(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",l=r?"inert":n?"aria-hidden":null,i=(s=t,e.map(e=>{if(s.contains(e))return e;const t=Qn(e);return s.contains(t)?t:null}).filter(e=>null!=e));var s;const a=new Set,c=new Set(i),u=[];Xn[o]||(Xn[o]=new WeakMap);const d=Xn[o];return i.forEach(function e(t){t&&!a.has(t)&&(a.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,t=>{if("script"!==fe(t))if(a.has(t))e(t);else{const e=l?t.getAttribute(l):null,n=null!==e&&"false"!==e,r=(Gn.get(t)||0)+1,i=(d.get(t)||0)+1;Gn.set(t,r),d.set(t,i),u.push(t),1===r&&n&&Un.add(t),1===i&&t.setAttribute(o,""),!n&&l&&t.setAttribute(l,"true")}})}(t),a.clear(),Yn++,()=>{u.forEach(e=>{const t=(Gn.get(e)||0)-1,n=(d.get(e)||0)-1;Gn.set(e,t),d.set(e,n),t||(!Un.has(e)&&l&&e.removeAttribute(l),Un.delete(e)),n||e.removeAttribute(o)}),Yn--,Yn||(Gn=new WeakMap,Gn=new WeakMap,Un=new WeakSet,Xn={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Jn=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function er(e,t){const n=Pt(e,Jn());"prev"===t&&n.reverse();const r=n.indexOf(De(Ge(e)));return n.slice(r+1)[0]}function tr(){return er(document.body,"next")}function nr(){return er(document.body,"prev")}function rr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Fe(n,r)}function or(e){Pt(e,Jn()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function lr(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const ir={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function sr(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const ar=l.forwardRef(function(e,t){const[n,r]=l.useState();jn(()=>(Ve()&&r("button"),document.addEventListener("keydown",sr),()=>{document.removeEventListener("keydown",sr)}),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[qn("focus-guard")]:"",style:ir};return l.createElement("span",Mn({},e,o))}),cr=l.createContext(null),ur=qn("portal");function dr(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=zn(),o=fr(),[i,s]=l.useState(null),a=l.useRef(null);return jn(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),jn(()=>{if(!r)return;if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ur,""),e.appendChild(n),a.current=n,s(n)},[t,r]),jn(()=>{if(null===n)return;if(!r)return;if(a.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!he(e)&&(e=e.current),e=e||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,e.appendChild(l));const i=document.createElement("div");i.id=r,i.setAttribute(ur,""),e=l||e,e.appendChild(i),a.current=i,s(i)},[t,n,r,o]),i}({id:n,root:r}),[s,a]=l.useState(null),c=l.useRef(null),u=l.useRef(null),d=l.useRef(null),f=l.useRef(null),p=null==s?void 0:s.modal,m=null==s?void 0:s.open,g=!!s&&!s.modal&&s.open&&o&&!(!r&&!i);return l.useEffect(()=>{if(i&&o&&!p)return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&rr(e)&&("focusin"===e.type?lr:or)(i)}},[i,o,p]),l.useEffect(()=>{i&&(m||lr(i))},[m,i]),l.createElement(cr.Provider,{value:l.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:i,setFocusManagerState:a}),[o,i])},g&&i&&l.createElement(ar,{"data-type":"outside",ref:c,onFocus:e=>{if(rr(e,i)){var t;null==(t=d.current)||t.focus()}else{const e=nr()||(null==s?void 0:s.refs.domReference.current);null==e||e.focus()}}}),g&&i&&l.createElement("span",{"aria-owns":i.id,style:ir}),i&&Tt.createPortal(t,i),g&&i&&l.createElement(ar,{"data-type":"outside",ref:u,onFocus:e=>{if(rr(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=tr()||(null==s?void 0:s.refs.domReference.current);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const fr=()=>l.useContext(cr),pr="data-floating-ui-focusable";function mr(e){return e?e.hasAttribute(pr)?e:e.querySelector("["+pr+"]")||e:null}let gr=[];function hr(e){gr=gr.filter(e=>e.isConnected);let t=e;if(t&&"body"!==fe(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==_t.call(e,wt)&&jt(t,e)}(t,Jn())){const e=Pt(t,Jn())[0];e&&(t=e)}gr.push(t),gr.length>20&&(gr=gr.slice(-20))}}function br(){return gr.slice().reverse().find(e=>e.isConnected)}const vr=l.forwardRef(function(e,t){return l.createElement("button",Mn({},e,{type:"button",ref:t,tabIndex:-1,style:ir}))});function yr(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:p,refs:m,nodeId:g,onOpenChange:h,events:b,dataRef:v,floatingId:y,elements:{domReference:w,floating:x}}=t,_="number"==typeof s&&s<0,E=Ze(w)&&_,k="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||i,R=$n(o),C=$n(s),S=$n(a),I=Wn(),N=fr(),O=l.useRef(null),L=l.useRef(null),j=l.useRef(!1),M=l.useRef(!1),A=l.useRef(-1),P=null!=N,T=mr(x),z=vn(function(e){return void 0===e&&(e=T),e?Pt(e,Jn()):[]}),D=vn(e=>{const t=z(e);return R.current.map(e=>w&&"reference"===e?w:T&&"floating"===e?T:t).filter(Boolean).flat()});function F(e){return!r&&d&&u?l.createElement(vr,{ref:"start"===e?O:L,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}l.useEffect(()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){Fe(T,De(Ge(T)))&&0===z().length&&!E&&Qe(e);const t=D(),n=Xe(e);"reference"===R.current[0]&&n===w&&(Qe(e),e.shiftKey?Kn(t[t.length-1]):Kn(t[1])),"floating"===R.current[1]&&n===T&&e.shiftKey&&(Qe(e),Kn(t[0]))}}const t=Ge(T);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,w,T,u,R,E,z,D]),l.useEffect(()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=Xe(e),n=z().indexOf(t);-1!==n&&(A.current=n)}},[r,x,z]),l.useEffect(()=>{if(!r&&f)return x&&be(w)?(w.addEventListener("focusout",t),w.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{w.removeEventListener("focusout",t),w.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){M.current=!0,setTimeout(()=>{M.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(Fe(w,t)||Fe(x,t)||Fe(t,x)||Fe(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(qn("focus-guard"))||I&&(Hn(I.nodesRef.current,g).find(e=>{var n,r;return Fe(null==(n=e.context)?void 0:n.elements.floating,t)||Fe(null==(r=e.context)?void 0:r.elements.domReference,t)})||function(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(I.nodesRef.current,g).find(e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(c&&n&&De(Ge(T))===Ge(T).body){be(T)&&T.focus();const e=A.current,t=z(),n=t[e]||t[t.length-1]||T;be(n)&&n.focus()}!E&&u||!t||!n||M.current||t===br()||(j.current=!0,h(!1,e,"focus-out"))})}},[r,w,x,T,u,g,I,N,h,f,c,z,E]),l.useEffect(()=>{var e;if(r)return;const t=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+qn("portal")+"]"))||[]);if(x){const e=[x,...t,O.current,L.current,R.current.includes("reference")||E?w:null].filter(e=>null!=e),n=u||E?Zn(e,k,!k):Zn(e);return()=>{n()}}},[r,w,x,u,R,N,E,k]),jn(()=>{if(r||!be(T))return;const e=De(Ge(T));queueMicrotask(()=>{const t=D(T),n=C.current,r=("number"==typeof n?t[n]:n.current)||T,o=Fe(T,e);_||o||!p||Kn(r,{preventScroll:r===T})})},[r,p,T,_,D,C]),jn(()=>{if(r||!T)return;let e=!1;const t=Ge(T),n=De(t);let o=v.current.openEvent;function l(t){let{open:n,reason:r,event:l,nested:i}=t;n&&(o=l),"escape-key"===r&&m.domReference.current&&hr(m.domReference.current),"hover"===r&&"mouseleave"===l.type&&(j.current=!0),"outside-press"===r&&(i?(j.current=!1,e=!0):j.current=!(qe(l)||$e(l)))}hr(n),b.on("openchange",l);const i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,ir),P&&w&&w.insertAdjacentElement("afterend",i),()=>{b.off("openchange",l);const n=De(t),r=Fe(x,n)||I&&Hn(I.nodesRef.current,g).some(e=>{var t;return Fe(null==(t=e.context)?void 0:t.elements.floating,n)});(r||o&&["click","mousedown"].includes(o.type))&&m.domReference.current&&hr(m.domReference.current);const s="boolean"==typeof S.current?br()||i:S.current.current||i;queueMicrotask(()=>{S.current&&!j.current&&be(s)&&(s===n||n===t.body||r)&&s.focus({preventScroll:e}),i.remove()})}},[r,x,T,S,v,m,b,I,g,P,w]),l.useEffect(()=>{queueMicrotask(()=>{j.current=!1})},[r]),jn(()=>{if(!r&&N)return N.setFocusManagerState({modal:u,closeOnFocusOut:f,open:p,onOpenChange:h,refs:m}),()=>{N.setFocusManagerState(null)}},[r,N,u,p,h,m,f]),jn(()=>{if(r)return;if(!T)return;if("function"!=typeof MutationObserver)return;if(_)return;const e=()=>{const e=T.getAttribute("tabindex"),t=z(),n=De(Ge(x)),r=t.indexOf(n);-1!==r&&(A.current=r),R.current.includes("floating")||n!==m.domReference.current&&0===t.length?"0"!==e&&T.setAttribute("tabindex","0"):"-1"!==e&&T.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(T,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,x,T,m,R,z,_]);const B=!r&&k&&(!u||!E)&&(P||u);return l.createElement(l.Fragment,null,B&&l.createElement(ar,{"data-type":"inside",ref:null==N?void 0:N.beforeInsideRef,onFocus:e=>{if(u){const e=D();Kn("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(j.current=!1,rr(e,N.portalNode)){const e=tr()||w;null==e||e.focus()}else{var t;null==(t=N.beforeOutsideRef.current)||t.focus()}}}),!E&&F("start"),n,F("end"),B&&l.createElement(ar,{"data-type":"inside",ref:null==N?void 0:N.afterInsideRef,onFocus:e=>{if(u)Kn(D()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(f&&(j.current=!0),rr(e,N.portalNode)){const e=nr()||w;null==e||e.focus()}else{var t;null==(t=N.afterOutsideRef.current)||t.focus()}}}))}function wr(e){return be(e.target)&&"BUTTON"===e.target.tagName}function xr(e){return Ye(e)}const _r={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Er={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kr=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Rr(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=zn(),i=l.useRef({}),[s]=l.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),a=null!=Bn(),[c,u]=l.useState(r.reference),d=vn((e,t,r)=>{i.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)}),f=l.useMemo(()=>({setPositionReference:u}),[]),p=l.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return l.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:p,events:s,floatingId:o,refs:f}),[t,d,p,s,o,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=l.useState(null),[a,c]=l.useState(null),u=(null==o?void 0:o.domReference)||i,d=l.useRef(null),f=Wn();jn(()=>{u&&(d.current=u)},[u]);const p=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=l.useState(r);un(p,r)||m(r);const[g,h]=l.useState(null),[b,v]=l.useState(null),y=l.useCallback(e=>{e!==E.current&&(E.current=e,h(e))},[]),w=l.useCallback(e=>{e!==k.current&&(k.current=e,v(e))},[]),x=i||g,_=s||b,E=l.useRef(null),k=l.useRef(null),R=l.useRef(d),C=null!=c,S=pn(c),I=pn(o),N=pn(u),O=l.useCallback(()=>{if(!E.current||!k.current)return;const e={placement:t,strategy:n,middleware:p};I.current&&(e.platform=I.current),an(E.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==N.current};L.current&&!un(R.current,t)&&(R.current=t,Tt.flushSync(()=>{f(t)}))})},[p,t,n,I,N]);cn(()=>{!1===u&&R.current.isPositioned&&(R.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const L=l.useRef(!1);cn(()=>(L.current=!0,()=>{L.current=!1}),[]),cn(()=>{if(x&&(E.current=x),_&&(k.current=_),x&&_){if(S.current)return S.current(x,_,O);O()}},[x,_,O,S,C]);const j=l.useMemo(()=>({reference:E,floating:k,setReference:y,setFloating:w}),[y,w]),M=l.useMemo(()=>({reference:x,floating:_}),[x,_]),A=l.useMemo(()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=fn(M.floating,d.x),r=fn(M.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...dn(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,M.floating,d.x,d.y]);return l.useMemo(()=>({...d,update:O,refs:j,elements:M,floatingStyles:A}),[d,O,j,M,A])}({...e,elements:{...o,...a&&{reference:a}}}),m=l.useCallback(e=>{const t=he(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),p.refs.setReference(t)},[p.refs]),g=l.useCallback(e=>{(he(e)||null===e)&&(d.current=e,s(e)),(he(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!he(e))&&p.refs.setReference(e)},[p.refs]),h=l.useMemo(()=>({...p.refs,setReference:g,setPositionReference:m,domReference:d}),[p.refs,g,m]),b=l.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),v=l.useMemo(()=>({...p,...r,refs:h,elements:b,nodeId:t}),[p,h,b,t,r]);return jn(()=>{r.dataRef.current.floatingContext=v;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),l.useMemo(()=>({...p,context:v,refs:h,elements:b}),[p,h,b,v])}const Cr="active",Sr="selected";function Ir(e,t,n){const r=new Map,o="item"===n;let l=e;if(o&&e){const{[Cr]:t,[Sr]:__,...n}=e;l=n}return{..."floating"===n&&{tabIndex:-1,[pr]:""},...l,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,l]=t;var i;o&&[Cr,Sr].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof l&&(null==(i=r.get(n))||i.push(l),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),l=0;l<t;l++)o[l]=arguments[l];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=l)}),e):e,{})}}let Nr=!1;function Or(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Lr(e,t){return Or(t,e===yn||e===wn,e===xn||e===En)}function jr(e,t,n){return Or(t,e===wn,n?e===xn:e===En)||"Enter"===e||" "===e||""===e}function Mr(e,t,n){return Or(t,n?e===En:e===xn,e===yn)}function Ar(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:s,onNavigate:a=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:h="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:v=!0,disabledIndices:y,orientation:w="vertical",cols:x=1,scrollItemIntoView:_=!0,virtualItemRef:E,itemSizes:k,dense:R=!1}=t,C=$n(mr(o.floating)),S=Bn(),I=Wn(),N=vn(a),O=Ze(o.domReference),L=l.useRef(h),j=l.useRef(null!=u?u:-1),M=l.useRef(null),A=l.useRef(!0),P=l.useRef(N),T=l.useRef(!!o.floating),z=l.useRef(n),D=l.useRef(!1),F=l.useRef(!1),B=$n(y),W=$n(n),q=$n(_),$=$n(u),[V,K]=l.useState(),[H,G]=l.useState(),U=vn(function(e,t,n){function r(e){g?(K(e.id),null==I||I.events.emit("virtualfocus",e),E&&(E.current=e)):Kn(e,{preventScroll:!0,sync:!(!Be().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!Ve())&&(Nr||D.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame(()=>{const l=e.current[t.current]||o;if(!l)return;o||r(l);const i=q.current;i&&Y&&(n||!A.current)&&(null==l.scrollIntoView||l.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))})});jn(()=>{document.createElement("div").focus({get preventScroll(){return Nr=!0,!1}})},[]),jn(()=>{c&&(n&&o.floating?L.current&&null!=u&&(F.current=!0,j.current=u,N(u)):T.current&&(j.current=-1,P.current(null)))},[c,n,o.floating,u,N]),jn(()=>{if(c&&n&&o.floating)if(null==s){if(D.current=!1,null!=$.current)return;if(T.current&&(j.current=-1,U(i,j)),(!z.current||!T.current)&&L.current&&(null!=M.current||!0===L.current&&null==M.current)){let e=0;const t=()=>{null==i.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(j.current=null==M.current||jr(M.current,w,m)||p?Cn(i,B.current):Sn(i,B.current),M.current=null,N(j.current))};t()}}else Rn(i,s)||(j.current=s,U(i,j,F.current),F.current=!1)},[c,n,o.floating,s,$,p,i,w,m,N,U,B]),jn(()=>{var e;if(!c||o.floating||!I||g||!T.current)return;const t=I.nodesRef.current,n=null==(e=t.find(e=>e.id===S))||null==(e=e.context)?void 0:e.elements.floating,r=De(Ge(o.floating)),l=t.some(e=>e.context&&Fe(e.context.elements.floating,r));n&&!l&&A.current&&n.focus({preventScroll:!0})},[c,o.floating,I,S,g]),jn(()=>{if(c&&I&&g&&!S)return I.events.on("virtualfocus",e),()=>{I.events.off("virtualfocus",e)};function e(e){G(e.id),E&&(E.current=e)}},[c,I,g,S,E]),jn(()=>{P.current=N,T.current=!!o.floating}),jn(()=>{n||(M.current=null)},[n]),jn(()=>{z.current=n},[n]);const X=null!=s,Y=l.useMemo(()=>{function e(e){if(!n)return;const t=i.current.indexOf(e);-1!==t&&N(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...b&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;A.current&&"touch"!==t&&(j.current=-1,U(i,j),N(null),g||Kn(C.current,{preventScroll:!0}))}}}},[n,C,U,b,i,N,g]),Q=vn(e=>{if(A.current=!1,D.current=!0,229===e.which)return;if(!W.current&&e.currentTarget===C.current)return;if(p&&Mr(e.key,w,m))return Qe(e),r(!1,e.nativeEvent,"list-navigation"),void(be(o.domReference)&&(g?null==I||I.events.emit("virtualfocus",o.domReference):o.domReference.focus()));const t=j.current,l=Cn(i,y),s=Sn(i,y);if(O||("Home"===e.key&&(Qe(e),j.current=l,N(j.current)),"End"===e.key&&(Qe(e),j.current=s,N(j.current))),x>1){const t=k||Array.from({length:i.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let o=0;return e.forEach((e,l)=>{let{width:i,height:s}=e,a=!1;for(n&&(o=0);!a;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<s;r++)e.push(o+n+r*t);o%t+i<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=l}),a=!0):o++}}),[...r]}(t,x,R),r=n.findIndex(e=>null!=e&&!Ln(i.current,e,y)),o=n.reduce((e,t,n)=>null==t||Ln(i.current,t,y)?e:n,-1),a=n[function(e,t){let{event:n,orientation:r,loop:o,rtl:l,cols:i,disabledIndices:s,minIndex:a,maxIndex:c,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===yn){if(d&&Qe(n),-1===u)f=c;else if(f=In(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:s}),o&&(u-i<a||f<0)){const e=u%i,t=c%i,n=c-(t-e);f=t===e?c:t>e?n:n-i}Rn(e,f)&&(f=u)}if(n.key===wn&&(d&&Qe(n),-1===u?f=a:(f=In(e,{startingIndex:u,amount:i,disabledIndices:s}),o&&u+i>c&&(f=In(e,{startingIndex:u%i-i,amount:i,disabledIndices:s}))),Rn(e,f)&&(f=u)),"both"===r){const t=nt(u/i);n.key===(l?xn:En)&&(d&&Qe(n),u%i!==i-1?(f=In(e,{startingIndex:u,disabledIndices:s}),o&&kn(f,i,t)&&(f=In(e,{startingIndex:u-u%i-1,disabledIndices:s}))):o&&(f=In(e,{startingIndex:u-u%i-1,disabledIndices:s})),kn(f,i,t)&&(f=u)),n.key===(l?En:xn)&&(d&&Qe(n),u%i!==0?(f=In(e,{startingIndex:u,decrement:!0,disabledIndices:s}),o&&kn(f,i,t)&&(f=In(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s}))):o&&(f=In(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s})),kn(f,i,t)&&(f=u));const r=nt(c/i)===t;Rn(e,f)&&(f=o&&r?n.key===(l?En:xn)?c:In(e,{startingIndex:u-u%i-1,disabledIndices:s}):u)}return f}({current:n.map(e=>null!=e?i.current[e]:null)},{event:e,orientation:w,loop:f,rtl:m,cols:x,disabledIndices:On([...y||i.current.map((e,t)=>Ln(i.current,t)?t:void 0),void 0],n),minIndex:r,maxIndex:o,prevIndex:Nn(j.current>s?l:j.current,t,n,x,e.key===wn?"bl":e.key===(m?xn:En)?"tr":"tl"),stopEvent:!0})];if(null!=a&&(j.current=a,N(j.current)),"both"===w)return}if(Lr(e.key,w)){if(Qe(e),n&&!g&&De(e.currentTarget.ownerDocument)===e.currentTarget)return j.current=jr(e.key,w,m)?l:s,void N(j.current);jr(e.key,w,m)?j.current=f?t>=s?d&&t!==i.current.length?-1:l:In(i,{startingIndex:t,disabledIndices:y}):Math.min(s,In(i,{startingIndex:t,disabledIndices:y})):j.current=f?t<=l?d&&-1!==t?i.current.length:s:In(i,{startingIndex:t,decrement:!0,disabledIndices:y}):Math.max(l,In(i,{startingIndex:t,decrement:!0,disabledIndices:y})),Rn(i,j.current)?N(null):N(j.current)}}),Z=l.useMemo(()=>g&&n&&X&&{"aria-activedescendant":H||V},[g,n,X,H,V]),J=l.useMemo(()=>({"aria-orientation":"both"===w?void 0:w,...!Ze(o.domReference)&&Z,onKeyDown:Q,onPointerMove(){A.current=!0}}),[Z,Q,o.domReference,w]),ee=l.useMemo(()=>{function e(e){"auto"===h&&qe(e.nativeEvent)&&(L.current=!0)}return{...Z,onKeyDown(e){A.current=!1;const t=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),l=t||o,s=function(e,t,n){return Or(t,n?e===xn:e===En,e===wn)}(e.key,w,m),a=Mr(e.key,w,m),c=Lr(e.key,w),d=(p?s:c)||"Enter"===e.key||""===e.key.trim();if(g&&n){const t=null==I?void 0:I.nodesRef.current.find(e=>null==e.parentId),n=I&&t?function(e,t){let n,r=-1;return function t(o,l){l>r&&(n=o,r=l),Hn(e,o).forEach(e=>{t(e.id,l+1)})}(t,0),e.find(e=>e.id===n)}(I.nodesRef.current,t.id):null;if(l&&n&&E){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||a){var f,h;const r=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,o=a&&!r?null==(h=n.context)?void 0:h.elements.domReference:s?i.current.find(e=>(null==e?void 0:e.id)===V):null;o&&(Qe(e),o.dispatchEvent(t),G(void 0))}var b;if((c||o)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Qe(e),void(null==(b=n.context.elements.domReference)||b.dispatchEvent(t))}return Q(e)}(n||v||!t)&&(d&&(M.current=p&&c?null:e.key),p?s&&(Qe(e),n?(j.current=Cn(i,B.current),N(j.current)):r(!0,e.nativeEvent,"list-navigation")):c&&(null!=u&&(j.current=u),Qe(e),!n&&v?r(!0,e.nativeEvent,"list-navigation"):Q(e),n&&N(j.current)))},onFocus(){n&&!g&&N(null)},onPointerDown:function(e){L.current=h,"auto"===h&&$e(e.nativeEvent)&&(L.current=!0)},onMouseDown:e,onClick:e}},[V,Z,Q,B,h,i,p,N,r,n,v,w,m,u,I,g,E]);return l.useMemo(()=>c?{reference:ee,floating:J,item:Y}:{},[c,ee,J,Y])}const Pr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),Tr=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},zr={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2.5 py-2 rounded text-xs font-medium leading-4 min-h-[2rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-sm",searchbarIcon:"size-4",label:"text-sm font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-3.5 py-2.5 rounded-md text-sm font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-4 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-base font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-base font-medium"}},Dr="group-disabled:text-field-color-disabled",Fr={sm:"w-[calc(100%+0.75rem)] translate-x-[-0.375rem]",md:"w-[calc(100%+1rem)] translate-x-[-0.5rem]",lg:"w-[calc(100%+1rem)] translate-x-[-0.5rem]"},Br={sm:"py-1.5 px-2 text-xs font-normal",md:"p-2 text-sm font-normal",lg:"p-2 text-base font-normal"},Wr=e=>null===e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e.toString():Array.isArray(e)?e.map(Wr).join(" ").trim():(0,l.isValidElement)(e)?e.props&&e.props.children?Wr(e.props.children):"":"object"==typeof e&&"textContent"in e?e.textContent?.toString().toLowerCase()||"":"object"==typeof e&&"children"in e?Wr(e.children):"",qr=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$r=(0,l.forwardRef)(({label:e="",size:t="sm",className:n="",type:r="pill",variant:o="neutral",icon:l=null,disabled:i=!1,onClose:a=()=>{},closable:c=!1,onMouseDown:u=()=>{},disableHover:d=!1},f)=>{const p={neutral:"bg-badge-background-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"};let m="",g="group relative justify-center flex items-center cursor-pointer";const h={xxs:"[&>svg]:size-3",xs:"[&>svg]:size-3",sm:"[&>svg]:size-3",md:"[&>svg]:size-4",lg:"[&>svg]:size-5"};return i?(m=p.disabled,g+=" cursor-not-allowed disabled"):m=p[o],e?(0,s.jsxs)("span",{className:ne("font-medium border-badge-border-gray flex items-center justify-center border border-solid box-border max-w-full transition-colors duration-150 ease-in-out",{xxs:"py-0.5 px-0.5 text-xs h-4",xs:"py-0.5 px-1 text-xs h-5",sm:"py-1 px-1.5 text-xs h-6",md:"py-1 px-1.5 text-sm h-7",lg:"py-1 px-1.5 text-base h-8"}[t],{pill:"rounded-full",rounded:"rounded"}[r],"gap-0.5",m,!d&&{neutral:"hover:bg-badge-hover-gray",red:"hover:bg-badge-hover-red",yellow:"hover:bg-badge-hover-yellow",green:"hover:bg-badge-hover-green",blue:"hover:bg-badge-hover-sky",inverse:"hover:bg-badge-hover-inverse",disabled:"hover:bg-badge-hover-disabled"}[o],n),ref:f,children:[l?(0,s.jsx)("span",{className:ne("justify-center flex items-center",h[t]),children:l}):null,(0,s.jsx)("span",{className:"px-1 truncate inline-block",children:e}),c&&(0,s.jsxs)("span",{className:ne(g,h[t]),onMouseDown:u,role:"button",tabIndex:0,...!i&&{onClick:a},children:[(0,s.jsx)("span",{className:"sr-only",children:`Remove ${e}`}),(0,s.jsx)(qr,{}),(0,s.jsx)("span",{className:"absolute -inset-1"})]})]}):null});$r.displayName="Badge";const Vr=ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Kr=({variant:e="primary",size:t="md",icon:n=null,className:r=""})=>{const o={primary:"text-brand-primary-600",secondary:"text-background-primary"}[e],l={sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6",xl:"[&>svg]:size-8"}[t];return(0,s.jsx)("span",{className:ne("flex",l,o,r),children:n||(0,s.jsx)(Vr,{className:"animate-spin shrink-0"})})},Hr=(0,l.createContext)({}),Gr=()=>(0,l.useContext)(Hr),Ur=(0,l.forwardRef)(({children:e,icon:t=null,placeholder:n="Select an option",optionIcon:r=null,render:o,label:i,className:a,...c},u)=>{const{sizeValue:d,getReferenceProps:f,getValues:p,selectId:m,refs:g,isOpen:h,multiple:b,combobox:v,setSelected:y,onChange:w,isControlled:x,disabled:_,by:E}=Gr(),k={sm:"xs",md:"sm",lg:"md"}[d],R=(0,l.useCallback)(()=>{if(t)return t;const e="text-field-placeholder group-disabled:text-icon-disabled";return v?(0,s.jsx)(se,{className:e}):(0,s.jsx)(ae,{className:e})},[t]),C=(0,l.useCallback)(()=>{const t=p();if(!t)return null;if(b)return t.map((e,t)=>(0,s.jsx)($r,{className:"cursor-default",icon:r,type:"rounded",size:k,onMouseDown:S(e),label:"function"==typeof o?o(e):e.toString(),closable:!0,disabled:_},t));let n="string"==typeof t?t:"";if("function"==typeof o&&(n=o(t)),"function"==typeof e&&"function"!=typeof o){const r={value:t,...b?{onClose:S(t)}:{}};n=e(r)}return((0,l.isValidElement)(e)||"string"==typeof e)&&"function"!=typeof o&&(n=e),(0,s.jsx)("span",{className:ne("truncate",zr[d].displaySelected,Dr),children:n})},[p,_]),S=e=>t=>{t?.preventDefault(),t?.stopPropagation();const n=[...p()??[]],r=n.findIndex(t=>null!==t&&null!==e&&"object"==typeof t?t[E]===e[E]:t===e);-1!==r&&(n.splice(r,1),x||y(n),"function"==typeof w&&w(n))};return(0,s.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!i&&(0,s.jsx)("label",{className:ne(zr[d]?.label,"text-field-label"),htmlFor:m,children:i}),(0,s.jsxs)("button",{id:m,ref:Tr(g.setReference,u),className:ne("flex items-center justify-between w-full box-border transition-[outline,background-color,color,box-shadow] duration-200 bg-white","outline outline-1 outline-field-border border-none cursor-pointer",!h&&"focus:ring-2 focus:ring-offset-2 focus:outline-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:outline-border-strong",zr[d].selectButton,b&&zr[d].multiSelect,"group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",a),tabIndex:0,disabled:_,...c,...f(),children:[(0,s.jsxs)("div",{className:ne("flex-1 grid items-center justify-start gap-1.5 overflow-hidden",p()&&"flex flex-wrap"),children:[C(),(b?!p()?.length:!p())&&(0,s.jsx)("div",{className:ne("[grid-area:1/1/2/3] text-field-input px-1",zr[d].displaySelected,Dr),children:n})]}),(0,s.jsx)("div",{className:ne("flex items-center [&>svg]:shrink-0",zr[d].icon),children:R()})]})]})});function Xr({label:e,children:t,className:n,...r}){const{index:o,totalGroups:i}=r,{sizeValue:a}=Gr();return(0,s.jsxs)(l.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-col",role:"group","aria-label":e,children:[(0,s.jsx)("div",{className:ne("p-2 font-normal text-text-tertiary",{sm:"text-xs",md:"text-xs",lg:"text-sm"}[a],n),id:`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:e}),(0,s.jsx)("div",{className:"flex flex-col",role:"presentation","aria-labelledby":`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:t})]}),o<i&&!!(t&&l.Children.count(t)>0)&&(0,s.jsx)("hr",{className:ne("h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid",Fr[a])})]})}function Yr({children:e,className:t}){const{isOpen:n,context:r,refs:o,combobox:i,floatingStyles:a,getFloatingProps:c,sizeValue:u,setSearchKeyword:d,setActiveIndex:f,setSelectedIndex:p,value:m,selected:g,getValues:h,searchKeyword:b,listContentRef:v,by:y,searchPlaceholder:w,activeIndex:x,searchFn:_,debounceDelay:E}=Gr(),k=(0,l.useMemo)(()=>{const t=h();let n=-1;if(t){let r=l.Children.toArray(e);r.length>0&&(0,l.isValidElement)(r[0])&&r[0].type===Xr&&(r=l.Children.toArray(e).map(e=>(0,l.isValidElement)(e)?l.Children.toArray(e.props.children):[]).flat()),n=r.findIndex(e=>{if(!(0,l.isValidElement)(e))return!1;const n=e.props.value;return"object"==typeof n&&"object"==typeof t?n[y]===t[y]:n===t})}return n},[m,g,e,y]);(0,l.useLayoutEffect)(()=>{n||(f(k),p(k))},[k,n]),(0,l.useLayoutEffect)(()=>{n&&(i&&[-1,null].includes(x)||f(-1))},[b,n]);const R=(0,l.useMemo)(()=>{let t=0,n=0;l.Children.forEach(e,e=>{if((0,l.isValidElement)(e)&&e.type===Xr){let n=!1;if(b&&!_){const t=b.toLowerCase(),r=(e.props.label?.toLowerCase()||"").includes(t),o=l.Children.toArray(e.props.children).some(e=>!!(0,l.isValidElement)(e)&&(Wr(e.props.children)?.toLowerCase()).includes(t));n=r||o}else n=!0;n&&t++}}),n=Math.max(0,t-1);let r=0,o=0;return l.Children.map(e,e=>{if(!(0,l.isValidElement)(e))return null;if(e.type===Xr){let t=!1;if(b&&!_){const n=b.toLowerCase();t=(e.props.label?.toLowerCase()||"").includes(n)}const i=l.Children.map(e.props.children,e=>{if(!(0,l.isValidElement)(e))return null;if(t){const t={...e.props,index:r++};return(0,l.cloneElement)(e,t)}if(b&&!_){const t=Wr(e.props.children)?.toLowerCase(),n=b.toLowerCase();if(!t?.includes(n))return null}const n={...e.props,index:r++};return(0,l.cloneElement)(e,n)});if(!i?.some(e=>null!==e))return null;const s={...e.props,children:i,index:o,totalGroups:n};return o++,(0,l.cloneElement)(e,s)}if(b&&!_){const t=Wr(e.props?.children)?.toLowerCase(),n=b.toLowerCase();if(!t?.includes(n))return null}return(0,l.cloneElement)(e,{...e.props,index:r++})})},[b,m,g,e,_]),C=l.Children.count(R);(0,l.useEffect)(()=>{v.current=[];let t=l.Children.toArray(e);t&&(0,l.isValidElement)(t[0])&&t[0].type===Xr&&(t=l.Children.toArray(t).map(e=>(0,l.isValidElement)(e)?e.props.children:null).filter(Boolean)),l.Children.forEach(t,e=>{if(!(0,l.isValidElement)(e))return;const t=Wr(e.props?.children)?.toLowerCase();if(b&&!_){const e=b.toLowerCase();if(!t?.includes(e))return}v.current.push(t)})},[b,_]);const[S,I]=(0,l.useState)(!1),N=(0,l.useCallback)(async()=>{if(_&&"function"==typeof _&&!S){I(!0);try{await _(b)}catch(e){console.error(e)}finally{I(!1)}}},[b]),O=((e,t=500)=>{const n=(0,l.useRef)(null);return(0,l.useCallback)((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>e(...r),t)},[e,t])})(N,E);return(0,l.useEffect)(()=>{"function"==typeof _&&O()},[O]),(0,s.jsx)(s.Fragment,{children:n&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(yr,{context:r,modal:!1,visuallyHiddenDismiss:!0,children:(0,s.jsxs)("div",{ref:o.setFloating,className:ne("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",i&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",zr[u].dropdown,!i&&"h-auto",i?"overflow-hidden":"overflow-y-auto overflow-x-hidden",t),style:{...a,zIndex:1},...c(),children:[i&&(0,s.jsxs)("div",{className:ne(zr[u].searchbarWrapper),children:[S?(0,s.jsx)(Kr,{className:zr[u].searchbarIcon}):(0,s.jsx)(ce,{className:ne("text-icon-secondary shrink-0",zr[u].searchbarIcon)}),(0,s.jsx)("input",{className:ne("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",zr[u].searchbar),type:"search",name:"keyword",placeholder:w,onChange:e=>d(e.target.value),value:b,autoComplete:"off"})]}),(0,s.jsxs)("div",{className:ne("overflow-y-auto overflow-x-hidden",!i&&"w-full h-full",zr[u].dropdownItemsWrapper),children:[!!C&&R,!C&&(0,s.jsx)("div",{className:ne("p-2 text-center font-medium text-field-placeholder",Br[u]),children:"No items found"})]})]})})})})}function Qr({children:e,root:t,id:n}){return(0,s.jsx)(dr,{id:n,root:t,children:e})}function Zr({value:e,selected:t,children:n,className:r,...o}){const{sizeValue:i,getItemProps:a,onKeyDownItem:c,onClickItem:u,activeIndex:d,selectedIndex:f,updateListRef:p,getValues:m,by:g,multiple:h}=Gr(),{index:b}=o,v=(0,l.useRef)(b),y=(0,l.useMemo)(()=>{if(!h)return!1;const t=m();return!!t&&t.some(t=>null!==t&&null!==e&&"object"==typeof t?t[g]===e[g]:t===e)},[e,m]),w=(0,l.useMemo)(()=>"boolean"==typeof t?t:h?y:b===f,[y,f,t]);return(0,s.jsxs)("div",{className:ne("w-full flex items-center justify-between text-text-primary hover:bg-button-tertiary-hover rounded-md transition-all duration-150 cursor-pointer focus:outline-none focus-within:outline-none outline-none",Br[i],b===d&&"bg-button-tertiary-hover",r),ref:e=>{p(b,e)},role:"option",tabIndex:b===d?0:-1,"aria-selected":w&&b===d,...a({onClick(){u(v.current,e)},onKeyDown(t){c(t,v.current,e)}}),children:[(0,s.jsx)("span",{className:"w-full truncate",children:n}),w&&(0,s.jsx)(ue,{className:ne("text-icon-on-color-disabled",{sm:"size-4",md:"size-4",lg:"size-5"}[i])})]})}const Jr=({id:e,size:t="md",value:n,defaultValue:r,onChange:o,by:i="id",children:a,multiple:c=!1,combobox:u=!1,disabled:d=!1,searchPlaceholder:f="Search...",searchFn:p,debounceDelay:m=500})=>{const g=(0,l.useMemo)(()=>e||`select-${((e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t})()}`,[e]),h=(0,l.useMemo)(()=>typeof n<"u",[n]),[b,v]=(0,l.useState)(r),[y,w]=(0,l.useState)(""),x=(0,l.useCallback)(()=>h?n:b,[h,n,b]),[_,E]=(0,l.useState)(!1),[k,R]=(0,l.useState)(null),[C,S]=(0,l.useState)(null),I={sm:u?256:172,md:u?256:216,lg:u?256:216},{refs:N,floatingStyles:O,context:L}=Rr({strategy:"fixed",placement:"bottom-start",open:_,onOpenChange:E,whileElementsMounted:rn,middleware:[{...on(5),options:[5,undefined]},mn({padding:10}),gn({apply({rects:e,elements:n,availableHeight:r}){Object.assign(n.floating.style,{maxHeight:`min(${r}px, ${I[t]}px)`,maxWidth:`${e.reference.width}px`})},padding:10})]}),j=(0,l.useRef)([]),M=(0,l.useRef)([]),A=(0,l.useRef)(!1),P=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,p=l.useRef(),m=l.useRef(!1),g=l.useMemo(()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){const t=p.current;0===e.button&&"click"!==a&&(He(t,!0)&&u||(!n||!c||o.current.openEvent&&f&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=p.current;"mousedown"===a&&p.current?p.current=void 0:He(t,!0)&&u||(!n||!c||o.current.openEvent&&f&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){p.current=void 0,e.defaultPrevented||!d||wr(e)||(" "!==e.key||xr(i)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||wr(e)||xr(i)||" "===e.key&&m.current&&(m.current=!1,r(!n||!c,e.nativeEvent,"click"))}}),[o,i,a,u,d,r,n,f,c]);return l.useMemo(()=>s?{reference:g}:{},[s,g])}(L,{event:"mousedown"}),T=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:g}=t,h=Wn(),b=vn("function"==typeof c?c:()=>!1),v="function"==typeof c?b:c,y=l.useRef(!1),w=l.useRef(!1),{escapeKey:x,outsidePress:_}=kr(m),{escapeKey:E,outsidePress:k}=kr(g),R=l.useRef(!1),C=vn(e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;if(R.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=h?Hn(h.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),S=vn(e=>{var t;const n=()=>{var t;C(e),null==(t=Xe(e))||t.removeEventListener("keydown",n)};null==(t=Xe(e))||t.addEventListener("keydown",n)}),I=vn(e=>{var t;const n=y.current;y.current=!1;const l=w.current;if(w.current=!1,"click"===u&&l)return;if(n)return;if("function"==typeof v&&!v(e))return;const s=Xe(e),a="["+qn("inert")+"]",c=Ge(o.floating).querySelectorAll(a);let d=he(s)?s:null;for(;d&&!Le(d);){const e=Ae(d);if(Le(e)||!he(e))break;d=e}if(c.length&&he(s)&&!s.matches("html,body")&&!Fe(s,o.floating)&&Array.from(c).every(e=>!Fe(d,e)))return;if(be(s)&&L){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let r=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===je(s).direction&&(r=e.offsetX<=s.offsetWidth-s.clientWidth),r||t&&e.offsetY>s.clientHeight)return}const f=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=h&&Hn(h.nodesRef.current,f).some(t=>{var n;return Ue(e,null==(n=t.context)?void 0:n.elements.floating)});if(Ue(e,o.floating)||Ue(e,o.domReference)||p)return;const m=h?Hn(h.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),N=vn(e=>{var t;const n=()=>{var t;I(e),null==(t=Xe(e))||t.removeEventListener(u,n)};null==(t=Xe(e))||t.addEventListener(u,n)});l.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=_;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),R.current=!0}function c(){e=window.setTimeout(()=>{R.current=!1},Ne()?5:0)}const d=Ge(o.floating);a&&(d.addEventListener("keydown",E?S:C,E),d.addEventListener("compositionstart",l),d.addEventListener("compositionend",c)),v&&d.addEventListener(u,k?N:I,k);let f=[];return p&&(he(o.domReference)&&(f=Te(o.domReference)),he(o.floating)&&(f=f.concat(Te(o.floating))),!he(o.reference)&&o.reference&&o.reference.contextElement&&(f=f.concat(Te(o.reference.contextElement)))),f=f.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),f.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{a&&(d.removeEventListener("keydown",E?S:C,E),d.removeEventListener("compositionstart",l),d.removeEventListener("compositionend",c)),v&&d.removeEventListener(u,k?N:I,k),f.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,a,v,u,n,r,p,s,x,_,C,E,S,I,k,N]),l.useEffect(()=>{y.current=!1},[v,u]);const O=l.useMemo(()=>({onKeyDown:C,[_r[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}}),[C,r,d,f]),L=l.useMemo(()=>({onKeyDown:C,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Er[u]]:()=>{y.current=!0}}),[C,u]);return l.useMemo(()=>s?{reference:O,floating:L}:{},[s,O,L])}(L),z=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,a=null!=(n=Pr.get(s))?n:s,c=zn(),u=null!=Bn(),d=l.useMemo(()=>"tooltip"===a||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:c},..."menu"===a&&u&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[a,o,u,r,c,s]),f=l.useMemo(()=>{const e={id:o,...a&&{role:a}};return"tooltip"===a||"label"===s?e:{...e,..."menu"===a&&{"aria-labelledby":c}}},[a,o,c,s]),p=l.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(s){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}},[o,s]);return l.useMemo(()=>i?{reference:d,floating:f,item:p}:{},[i,d,f,p])}(L,{role:"listbox"}),D=Ar(L,{listRef:j,activeIndex:k,selectedIndex:C,onNavigate:R,loop:!0}),F=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:i,activeIndex:s,onMatch:a,onTypingChange:c,enabled:u=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:p=[],selectedIndex:m=null}=t,g=l.useRef(),h=l.useRef(""),b=l.useRef(null!=(n=null!=m?m:s)?n:-1),v=l.useRef(null),y=vn(a),w=vn(c),x=$n(d),_=$n(p);jn(()=>{r&&(clearTimeout(g.current),v.current=null,h.current="")},[r]),jn(()=>{var e;r&&""===h.current&&(b.current=null!=(e=null!=m?m:s)?e:-1)},[r,m,s]);const E=vn(e=>{e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}),k=vn(e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return r?e.indexOf(r):-1}const n=i.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(n,n,h.current)?E(!1):" "===e.key&&Qe(e)),null==n||_.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Qe(e),E(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&h.current===e.key&&(h.current="",b.current=v.current),h.current+=e.key,clearTimeout(g.current),g.current=setTimeout(()=>{h.current="",b.current=v.current,E(!1)},f);const o=b.current,l=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],h.current);-1!==l?(y(l),v.current=l):" "!==e.key&&(h.current="",E(!1))}),R=l.useMemo(()=>({onKeyDown:k}),[k]),C=l.useMemo(()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&E(!1)}}),[k,E]);return l.useMemo(()=>u?{reference:R,floating:C}:{},[u,R,C])}(L,{listRef:M,activeIndex:k,selectedIndex:C,onMatch:_?R:S,onTypingChange(e){A.current=e}}),{getReferenceProps:B,getFloatingProps:W,getItemProps:q}=function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=l.useCallback(t=>Ir(t,e,"reference"),t),i=l.useCallback(t=>Ir(t,e,"floating"),n),s=l.useCallback(t=>Ir(t,e,"item"),r);return l.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}([T,z,D,P,...u?[]:[F]]),$=(e,t)=>{if(c)return((e,t)=>{const n=[...x()??[]];-1===n.findIndex(e=>null!==e&&null!==t&&"object"==typeof e?e[i]===t[i]:e===t)&&(n.push(t),h||v(n),S(e),N.reference.current.focus(),E(!1),w(""),"function"==typeof o&&o(n))})(e,t);S(e),h||v(t),N.reference.current.focus(),E(!1),w(""),"function"==typeof o&&o(t)},V=(0,l.useCallback)((e,t)=>{j.current[e]=t},[]);return(0,s.jsx)(Hr.Provider,{value:{selectedIndex:C,setSelectedIndex:S,activeIndex:k,setActiveIndex:R,selected:b,setSelected:v,handleSelect:$,combobox:u,sizeValue:t,multiple:c,onChange:o,isTypingRef:A,getItemProps:q,onClickItem:(e,t)=>{$(e,t)},onKeyDownItem:(e,t,n)=>{"Enter"===e.key&&(e.preventDefault(),$(t,n))," "===e.key&&!A.current&&(e.preventDefault(),$(t,n))},getValues:x,selectId:g,getReferenceProps:B,isOpen:_,value:n,updateListRef:V,refs:N,listContentRef:M,by:i,getFloatingProps:W,floatingStyles:O,context:L,searchKeyword:y,setSearchKeyword:w,disabled:d,isControlled:h,searchPlaceholder:f,searchFn:p,debounceDelay:m},children:a})};Jr.displayName="Select";const eo=Object.assign(Jr,{Portal:Qr,Button:Ur,Options:Yr,Option:Zr,OptionGroup:Xr});function to({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}Qr.displayName="Select.Portal",Ur.displayName="Select.Button",Yr.displayName="Select.Options",Zr.displayName="Select.Option",Xr.displayName="Select.OptionGroup";const no=l.forwardRef(to);function ro({title:e,titleId:t,...n},r){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?l.createElement("title",{id:t},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const oo=l.forwardRef(ro),lo=window.wp.apiFetch;var io=o.n(lo);const so=window.wp.components,ao=window.wp.element,co=window.wp.i18n,uo=({value:e,onChange:t,searchType:n,placeholder:r})=>{const[o,i]=(0,ao.useState)([]),[s,a]=(0,ao.useState)(null),c=(0,ao.useRef)(null),u=(0,ao.useCallback)(async e=>{if(e&&""!==e&&0!==e)try{const t="products"===n?"products":"products/categories",r=await io()({path:`/wc/v3/${t}/${e}`});r&&r.id&&r.name?a({id:r.id,name:r.name}):a(null)}catch(e){console.error("Error loading selected item:",e),a(null)}else a(null)},[n]);return(0,ao.useEffect)(()=>{e&&""!==e&&0!==e?u(e):a(null)},[e,u]),(0,l.createElement)("div",{className:"power-coupons-rules-forceui-select-wrapper"},(0,l.createElement)(eo,{combobox:!0,size:"md",value:s,searchFn:e=>{clearTimeout(c.current),e.length<3?i([]):c.current=setTimeout(async()=>{try{const t="products"===n?"products":"products/categories",r=(await io()({path:`/wc/v3/${t}?search=${encodeURIComponent(e)}&per_page=20`})).map(({id:e,name:t})=>({id:e,name:t}));i(r)}catch(e){console.error("Search error:",e),i([])}},300)},onChange:e=>{a(e),t(e?e.id:"")}},(0,l.createElement)(eo.Button,{className:"power-coupons-rules-forceui-select-button",render:e=>e.name,placeholder:r||"Select"}),(0,l.createElement)(eo.Options,null,o.map(({id:e,name:t})=>(0,l.createElement)(eo.Option,{key:e,value:{id:e,name:t}},t)))))},fo=e=>`${e}_${Date.now()}_${(1e9*Math.random()|0).toString(36)}`,po=({children:e})=>e?(0,l.createElement)("div",{className:"power-coupons-rules__separator"},(0,l.createElement)("span",{className:"power-coupons-rules__separator-left"}),e,(0,l.createElement)("span",{className:"power-coupons-rules__separator-right"})):(0,l.createElement)("hr",{className:"power-coupons-rules__separator"}),mo=({groups:e,groupIndex:t,ruleIndex:n,removeCondition:r,updateRule:o})=>{const i=e[t].rules[n],s={cart_total:{label:(0,co.__)("Cart Total","power-coupons"),operators:[{key:"equal_to",name:(0,co.__)("Is equal to","power-coupons")},{key:"not_equal_to",name:(0,co.__)("Is not equal to","power-coupons")},{key:"less_than",name:(0,co.__)("Is less than","power-coupons")},{key:"less_than_or_equal",name:(0,co.__)("Is less than or equal to","power-coupons")},{key:"greater_than",name:(0,co.__)("Is greater than","power-coupons")},{key:"greater_than_or_equal",name:(0,co.__)("Is greater than or equal to","power-coupons")}],step:"0.01",inputType:"number",placeholder:(0,co.__)("Enter amount","power-coupons")},cart_items:{label:(0,co.__)("Number of Cart Items","power-coupons"),operators:[{key:"equal_to",name:(0,co.__)("Is equal to","power-coupons")},{key:"not_equal_to",name:(0,co.__)("Is not equal to","power-coupons")},{key:"less_than",name:(0,co.__)("Is less than","power-coupons")},{key:"less_than_or_equal",name:(0,co.__)("Is less than or equal to","power-coupons")},{key:"greater_than",name:(0,co.__)("Is greater than","power-coupons")},{key:"greater_than_or_equal",name:(0,co.__)("Is greater than or equal to","power-coupons")}],step:"1",inputType:"number",placeholder:(0,co.__)("Enter quantity","power-coupons")},products:{label:(0,co.__)("Products","power-coupons"),operators:[{key:"in_list",name:(0,co.__)("Includes","power-coupons")},{key:"not_in_list",name:(0,co.__)("Excludes","power-coupons")}],inputType:"dropdown",placeholder:(0,co.__)("Search for products…","power-coupons")},product_categories:{label:(0,co.__)("Product Categories","power-coupons"),operators:[{key:"in_list",name:(0,co.__)("Includes","power-coupons")},{key:"not_in_list",name:(0,co.__)("Excludes","power-coupons")}],inputType:"dropdown",placeholder:(0,co.__)("Search for categories…","power-coupons")}},[a,c]=(0,ao.useState)({id:i.type,name:s[i.type].label}),[u,d]=(0,ao.useState)({id:i.operator,name:s[i.type].operators.find(e=>e.key===i.operator)?.name||s[i.type].operators[0].name}),[f,p]=(0,ao.useState)(void 0!==i.value?i.value:""),m=(0,ao.useRef)(!0),g=e=>e.preventDefault();(0,ao.useEffect)(()=>{const e=document.querySelectorAll(".power-coupons-rules-forceui-select-button");if(e.forEach(e=>e.addEventListener("click",g)),m.current)return void(m.current=!1);const t={id:s?.[a.id]?.operators[0].key,name:s?.[a.id]?.operators[0].name};return d(t),o(n,{...i,type:a.id,operator:t.id,value:""}),p(""),()=>e.forEach(e=>e.removeEventListener("click",g))},[a.id]);const h=e=>{d(e),o(n,{...i,operator:e.id})},b=e=>{p(e),o(n,{...i,value:e})};return(0,l.createElement)("div",{className:"power-coupons-rules__body__conditions__fields"},(0,l.createElement)("input",{type:"hidden",name:`pc_rule_groups[${t}][rules][${n}][rule_id]`,value:i.rule_id}),(0,l.createElement)("input",{type:"hidden",name:`pc_rule_groups[${t}][rules][${n}][type]`,value:a.id}),(0,l.createElement)("input",{type:"hidden",name:`pc_rule_groups[${t}][rules][${n}][operator]`,value:u.id}),(0,l.createElement)("input",{type:"hidden",name:`pc_rule_groups[${t}][rules][${n}][value]`,value:f||""}),(0,l.createElement)("div",{className:"power-coupons-rules-forceui-select-wrapper"},(0,l.createElement)(eo,{size:"md",value:a,onChange:e=>{c(e)}},(0,l.createElement)(eo.Button,{className:"power-coupons-rules-forceui-select-button",render:e=>e.name}),(0,l.createElement)(eo.Options,null,Object.keys(s).map(e=>{const t=s[e].label;return(0,l.createElement)(eo.Option,{key:e,value:{id:e,name:t}},t)})))),Object.keys(s).map(e=>a.id===e?(0,l.createElement)(ao.Fragment,{key:e},(0,l.createElement)("div",{className:"power-coupons-rules-forceui-select-wrapper"},(0,l.createElement)(eo,{size:"md",value:u,onChange:h},(0,l.createElement)(eo.Button,{className:"power-coupons-rules-forceui-select-button",render:e=>e.name}),(0,l.createElement)(eo.Options,null,s[e].operators.map(({key:e,name:t})=>(0,l.createElement)(eo.Option,{key:e,value:{id:e,name:t}},t))))),"dropdown"===s[e].inputType?(0,l.createElement)(uo,{key:`${i.rule_id}-${a.id}`,value:f,onChange:b,searchType:"products"===a.id?"products":"categories",placeholder:s[e].placeholder}):(0,l.createElement)("input",{className:"power-coupons-rules__body__conditions__fields__input",type:"number",step:s[e].step,value:f||"",min:0,onChange:e=>b(+e.target.value),placeholder:s[e].placeholder})):null),(0,l.createElement)(so.Button,{className:"power-coupons-rules__body__conditions__fields__remove-condition",onClick:()=>r(n),icon:(0,l.createElement)(no,null)}))},go=({groups:e,groupIndex:t,setGroups:n})=>{const r=e[t].rules||[],o=()=>{const r=[...e];r[t].rules.push({rule_id:fo("rule"),type:"cart_total",operator:"greater_than_or_equal",value:""}),n(r)},i=r=>{const o=[...e];if(o[t].rules=o[t].rules.filter((e,t)=>t!==r),0===o[t].rules.length)return 1===o.length?void n(o):void(t=>{if(e.length<=1)return;const r=e.filter((e,n)=>n!==t);n(r)})(t);n(o)},s=(r,o)=>{const l=[...e];l[t].rules[r]=o,n(l)};return r.length?(0,l.createElement)("div",{className:"power-coupons-rules__body__conditions"},r.map((n,a)=>(0,l.createElement)("div",{key:n.rule_id,id:`power-coupons-rules-${n.rule_id}`},(0,l.createElement)(mo,{groups:e,groupIndex:t,ruleIndex:a,removeCondition:i,updateRule:s}),(0,l.createElement)(po,null,(0,co.__)("AND","power-coupons")),r.length===a+1&&(0,l.createElement)("div",{className:"power-coupons-rules__body__conditions__fields !justify-center !gap-0"},(0,l.createElement)(so.Button,{icon:(0,l.createElement)(oo,null),iconSize:16,iconPosition:"right",onClick:o,className:"power-coupons-rules__body__btn"},(0,co.__)("AND","power-coupons")))))):(0,l.createElement)("div",{className:"power-coupons-rules__body__conditions__add-new"},(0,l.createElement)(so.Button,{icon:(0,l.createElement)(oo,null),iconSize:16,iconPosition:"right",onClick:()=>{o(),(()=>{const t={group_id:fo("group"),rules:[]};n([...e,t])})()},className:"power-coupons-rules__body__btn"},(0,co.__)("Add Condition","power-coupons")))},ho=()=>{const[e,t]=(0,ao.useState)((e=>{if(!Array.isArray(e)||0===e.length)return[{group_id:fo("group"),rules:[]}];const t=e.map(e=>({...e,group_id:e.group_id||fo("group"),rules:Array.isArray(e.rules)&&e.rules.length>0?e.rules.map(e=>({rule_id:e.rule_id||fo("rule"),type:e.type||"cart_total",operator:e.operator||"greater_than_or_equal",value:void 0!==e.value?e.value:""})):[]}));return t[t.length-1].rules.length>0&&t.push({group_id:fo("group"),rules:[]}),t})(powerCouponsRules.data.groups));return(0,l.createElement)(ao.Fragment,null,(0,l.createElement)(po,null),(0,l.createElement)(so.Panel,{header:null,className:"power-coupons-rules__body"},e.map((n,r)=>(0,l.createElement)(ao.Fragment,{key:n.group_id},(0,l.createElement)(so.PanelBody,{className:`power-coupons-rules-${n.group_id}`,title:"Display This Coupon If:",initialOpen:!0},(0,l.createElement)("input",{type:"hidden",name:`pc_rule_groups[${r}][group_id]`,value:n.group_id}),(0,l.createElement)(so.PanelRow,null,(0,l.createElement)(go,{groups:e,groupIndex:r,setGroups:t}))),e.length!==r+1&&(0,l.createElement)(po,null,(0,co.__)("OR","power-coupons"))))))};jQuery(".coupon_data_tabs").ready(function(){const e=sessionStorage.getItem("_power_coupons_last_active_coupon_tab");if("power_coupons_rules_options"===e){const t=document.querySelector(`.coupon_data_tabs.wc-tabs li.${e} a`);t&&(t.click(),sessionStorage.removeItem("_power_coupons_last_active_coupon_tab"))}document.querySelector("form#post").addEventListener("submit",function(){const e=document.querySelector(".coupon_data_tabs.wc-tabs li.active").classList[0];sessionStorage.setItem("_power_coupons_last_active_coupon_tab",e)})}),jQuery(document).ready(function(){jQuery("._power_coupon_start_date_field").insertBefore(".expiry_date_field"),jQuery("#_power_coupon_divider").insertBefore(".free_shipping_field")});const bo=document.getElementById("power_coupons_rules_tab");(0,ao.createRoot)(bo).render((0,l.createElement)(()=>{const[e,t]=(0,ao.useState)("yes"===powerCouponsRules.data.enabled);return(0,l.createElement)(ao.Fragment,null,(0,l.createElement)("input",{type:"hidden",name:"_pc_rule_enable_conditions",value:e?"yes":"no"}),(0,l.createElement)("div",{className:"power-coupons-rules__toggle-rules__header"},(0,l.createElement)("div",{className:"power-coupons-rules__toggle-rules__header__title"},(0,l.createElement)("strong",null,(0,co.__)("Enable Conditional Rule","power-coupons")),(0,l.createElement)("p",null,(0,co.__)("Set rules to decide when this coupon works. The coupon applies only when the selected rules are met.","power-coupons"))),(0,l.createElement)(so.ToggleControl,{label:null,checked:e,onChange:t,className:"power-coupons-rules__toggle-rules__header__control",__nextHasNoMarginBottom:!0})),e&&(0,l.createElement)(ho,null))},null))})();