UNPKG

strapi-plugin-navigation

Version:
7 lines 934 kB
"use strict";const g=require("react"),u=require("react/jsx-runtime"),C=require("styled-components"),de=require("@strapi/strapi/admin"),$d=require("react-dnd"),ly=require("react-dnd-html5-backend"),wc=require("react-router-dom"),is=require("react-dom"),oe=require("lodash"),Re=require("@tanstack/react-query"),ue=require("react-intl"),Ce=require("@sensinum/strapi-utils"),B=require("zod"),ja=require("lodash/fp"),cy=t=>t&&t.__esModule?t:{default:t};function Ju(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const w=Ju(g),en=cy(C),Yr=Ju(is),M=Ju(B),Ht="navigation",dy=({setPlugin:t})=>{const e=g.useRef(t);return g.useEffect(()=>{e.current?.(Ht)},[]),null},uy=92,hy=en.default.svg` path { fill: ${({theme:t})=>t.colors.neutral500}; } `,fy=({width:t=20,height:e=20})=>u.jsx(hy,{viewBox:`0 0 ${t} ${e}`,xmlns:"http://www.w3.org/2000/svg",height:e,width:t,children:u.jsx("g",{style:{transform:`scale(${t/uy})`},children:u.jsx("path",{d:`M78,23.5H14c-3.6,0-6.5-2.9-6.5-6.5s2.9-6.5,6.5-6.5h64c3.6,0,6.5,2.9,6.5,6.5S81.6,23.5,78,23.5z M84.5,46 c0-3.6-2.9-6.5-6.5-6.5H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,52.5,84.5,49.6,84.5,46z M84.5,75c0-3.6-2.9-6.5-6.5-6.5 H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,81.5,84.5,78.6,84.5,75z`})})}),my=()=>u.jsx(fy,{});function Ke(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function yc(t,e){return t-e*Math.floor(t/e)}const kg=1721426;function Ms(t,e,n,r){e=eh(t,e);let o=e-1,i=-2;return n<=2?i=0:pa(e)&&(i=-1),kg-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function pa(t){return t%4===0&&(t%100!==0||t%400===0)}function eh(t,e){return t==="BC"?1-e:e}function gy(t){let e="AD";return t<=0&&(e="BC",t=1-t),[e,t]}const py={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class jo{fromJulianDay(e){let n=e,r=n-kg,o=Math.floor(r/146097),i=yc(r,146097),s=Math.floor(i/36524),a=yc(i,36524),l=Math.floor(a/1461),c=yc(a,1461),d=Math.floor(c/365),h=o*400+s*100+l*4+d+(s!==4&&d!==4?1:0),[f,m]=gy(h),p=n-Ms(f,m,1,1),b=2;n<Ms(f,m,3,1)?b=0:pa(m)&&(b=1);let v=Math.floor(((p+b)*12+373)/367),x=n-Ms(f,m,v,1)+1;return new Oi(f,m,v,x)}toJulianDay(e){return Ms(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return py[pa(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return pa(e.year)?366:365}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}const by={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Tg(t,e){return e=Ut(e,t.calendar),t.era===e.era&&t.year===e.year&&t.month===e.month&&t.day===e.day}function Rg(t,e){let n=t.calendar.toJulianDay(t),r=Math.ceil(n+1-$y(e))%7;return r<0&&(r+=7),r}function vy(t){return Vn(Date.now(),t)}function th(t){return Og(vy(t))}function Mg(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)}function xy(t,e){return d0(t)-d0(e)}function d0(t){return t.hour*36e5+t.minute*6e4+t.second*1e3+t.millisecond}let Cc=null;function Do(){return Cc==null&&(Cc=new Intl.DateTimeFormat().resolvedOptions().timeZone),Cc}function wy(t){return t.subtract({days:t.day-1})}function yy(t){return t.add({days:t.calendar.getDaysInMonth(t)-t.day})}function Eg(t,e){let n=Rg(t,e);return t.subtract({days:n})}const u0=new Map;function Cy(t){if(Intl.Locale){let n=u0.get(t);return n||(n=new Intl.Locale(t).maximize().region,n&&u0.set(t,n)),n}let e=t.split("-")[1];return e==="u"?void 0:e}function $y(t){let e=Cy(t);return e&&by[e]||0}function Sd(t,e){return t&&e?t.compare(e)<=0?t:e:t||e}function Ad(t,e){return t&&e?t.compare(e)>=0?t:e:t||e}function Oo(t){t=Ut(t,new jo);let e=eh(t.era,t.year);return Ig(e,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}function Ig(t,e,n,r,o,i,s){let a=new Date;return a.setUTCHours(r,o,i,s),a.setUTCFullYear(t,e-1,n),a.getTime()}function kd(t,e){if(e==="UTC")return 0;if(t>0&&e===Do())return new Date(t).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:s,second:a}=jg(t,e);return Ig(n,r,o,i,s,a,0)-Math.floor(t/1e3)*1e3}const h0=new Map;function jg(t,e){let n=h0.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),h0.set(e,n));let r=n.formatToParts(new Date(t)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}const f0=864e5;function Sy(t,e,n,r){return(n===r?[n]:[n,r]).filter(i=>Ay(t,e,i))}function Ay(t,e,n){let r=jg(n,e);return t.year===r.year&&t.month===r.month&&t.day===r.day&&t.hour===r.hour&&t.minute===r.minute&&t.second===r.second}function Bn(t,e,n="compatible"){let r=Fr(t);if(e==="UTC")return Oo(r);if(e===Do()&&n==="compatible"){r=Ut(r,new jo);let l=new Date,c=eh(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let o=Oo(r),i=kd(o-f0,e),s=kd(o+f0,e),a=Sy(r,e,o-i,o-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-s);case"compatible":case"later":return Math.max(o-i,o-s);case"reject":throw new RangeError("No such absolute time found")}}function Dg(t,e,n="compatible"){return new Date(Bn(t,e,n))}function Vn(t,e){let n=kd(t,e),r=new Date(t+n),o=r.getUTCFullYear(),i=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),d=r.getUTCMilliseconds();return new Lo(o,i,s,e,n,a,l,c,d)}function Og(t){return new Oi(t.calendar,t.era,t.year,t.month,t.day)}function Fr(t,e){let n=0,r=0,o=0,i=0;if("timeZone"in t)({hour:n,minute:r,second:o,millisecond:i}=t);else if("hour"in t&&!e)return t;return e&&({hour:n,minute:r,second:o,millisecond:i}=e),new Oa(t.calendar,t.era,t.year,t.month,t.day,n,r,o,i)}function Ut(t,e){if(t.calendar.identifier===e.identifier)return t;let n=e.fromJulianDay(t.calendar.toJulianDay(t)),r=t.copy();return r.calendar=e,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Vr(r),r}function ky(t,e,n){if(t instanceof Lo)return t.timeZone===e?t:Lg(t,e);let r=Bn(t,e,n);return Vn(r,e)}function Ty(t){let e=Oo(t)-t.offset;return new Date(e)}function Lg(t,e){let n=Oo(t)-t.offset;return Ut(Vn(n,e),t.calendar)}const di=36e5;function yl(t,e){let n=t.copy(),r="hour"in n?Iy(n,e):0;Td(n,e.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,t),n.month+=e.months||0,Rd(n),Ng(n),n.day+=(e.weeks||0)*7,n.day+=e.days||0,n.day+=r,Ry(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,s;let l=(i=(s=n.calendar).isInverseEra)===null||i===void 0?void 0:i.call(s,n);n.year=o,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Td(t,e){var n,r;!((n=(r=t.calendar).isInverseEra)===null||n===void 0)&&n.call(r,t)&&(e=-e),t.year+=e}function Rd(t){for(;t.month<1;)Td(t,-1),t.month+=t.calendar.getMonthsInYear(t);let e=0;for(;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,Td(t,1)}function Ry(t){for(;t.day<1;)t.month--,Rd(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,Rd(t)}function Ng(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))}function Vr(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),Ng(t)}function Bg(t){let e={};for(let n in t)typeof t[n]=="number"&&(e[n]=-t[n]);return e}function Fg(t,e){return yl(t,Bg(e))}function nh(t,e){let n=t.copy();return e.era!=null&&(n.era=e.era),e.year!=null&&(n.year=e.year),e.month!=null&&(n.month=e.month),e.day!=null&&(n.day=e.day),Vr(n),n}function Da(t,e){let n=t.copy();return e.hour!=null&&(n.hour=e.hour),e.minute!=null&&(n.minute=e.minute),e.second!=null&&(n.second=e.second),e.millisecond!=null&&(n.millisecond=e.millisecond),Ey(n),n}function My(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=Es(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=Es(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=Es(t.minute,60);let e=Math.floor(t.hour/24);return t.hour=Es(t.hour,24),e}function Ey(t){t.millisecond=Math.max(0,Math.min(t.millisecond,1e3)),t.second=Math.max(0,Math.min(t.second,59)),t.minute=Math.max(0,Math.min(t.minute,59)),t.hour=Math.max(0,Math.min(t.hour,23))}function Es(t,e){let n=t%e;return n<0&&(n+=e),n}function Iy(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,My(t)}function rh(t,e,n,r){let o=t.copy();switch(e){case"era":{let a=t.calendar.getEras(),l=a.indexOf(t.era);if(l<0)throw new Error("Invalid era: "+t.era);l=_n(l,n,0,a.length-1,r?.round),o.era=a[l],Vr(o);break}case"year":var i,s;!((i=(s=o.calendar).isInverseEra)===null||i===void 0)&&i.call(s,o)&&(n=-n),o.year=_n(t.year,n,-1/0,9999,r?.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,t);break;case"month":o.month=_n(t.month,n,1,t.calendar.getMonthsInYear(t),r?.round);break;case"day":o.day=_n(t.day,n,1,t.calendar.getDaysInMonth(t),r?.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(o),Vr(o),o}function Vg(t,e,n,r){let o=t.copy();switch(e){case"hour":{let i=t.hour,s=0,a=23;if(r?.hourCycle===12){let l=i>=12;s=l?12:0,a=l?23:11}o.hour=_n(i,n,s,a,r?.round);break}case"minute":o.minute=_n(t.minute,n,0,59,r?.round);break;case"second":o.second=_n(t.second,n,0,59,r?.round);break;case"millisecond":o.millisecond=_n(t.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+e)}return o}function _n(t,e,n,r,o=!1){if(o){t+=Math.sign(e),t<n&&(t=r);let i=Math.abs(e);e>0?t=Math.ceil(t/i)*i:t=Math.floor(t/i)*i,t>r&&(t=n)}else t+=e,t<n?t=r-(n-t-1):t>r&&(t=n+(t-r-1));return t}function _g(t,e){let n;if(e.years!=null&&e.years!==0||e.months!=null&&e.months!==0||e.weeks!=null&&e.weeks!==0||e.days!=null&&e.days!==0){let o=yl(Fr(t),{years:e.years,months:e.months,weeks:e.weeks,days:e.days});n=Bn(o,t.timeZone)}else n=Oo(t)-t.offset;n+=e.milliseconds||0,n+=(e.seconds||0)*1e3,n+=(e.minutes||0)*6e4,n+=(e.hours||0)*36e5;let r=Vn(n,t.timeZone);return Ut(r,t.calendar)}function jy(t,e){return _g(t,Bg(e))}function Dy(t,e,n,r){switch(e){case"hour":{let o=0,i=23;if(r?.hourCycle===12){let p=t.hour>=12;o=p?12:0,i=p?23:11}let s=Fr(t),a=Ut(Da(s,{hour:o}),new jo),l=[Bn(a,t.timeZone,"earlier"),Bn(a,t.timeZone,"later")].filter(p=>Vn(p,t.timeZone).day===a.day)[0],c=Ut(Da(s,{hour:i}),new jo),d=[Bn(c,t.timeZone,"earlier"),Bn(c,t.timeZone,"later")].filter(p=>Vn(p,t.timeZone).day===c.day).pop(),h=Oo(t)-t.offset,f=Math.floor(h/di),m=h%di;return h=_n(f,n,Math.floor(l/di),Math.floor(d/di),r?.round)*di+m,Ut(Vn(h,t.timeZone),t.calendar)}case"minute":case"second":case"millisecond":return Vg(t,e,n,r);case"era":case"year":case"month":case"day":{let o=rh(Fr(t),e,n,r),i=Bn(o,t.timeZone);return Ut(Vn(i,t.timeZone),t.calendar)}default:throw new Error("Unsupported field "+e)}}function Oy(t,e,n){let r=Fr(t),o=Da(nh(r,e),e);if(o.compare(r)===0)return t;let i=Bn(o,t.timeZone,n);return Ut(Vn(i,t.timeZone),t.calendar)}const Ly=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function zg(t,e){let n=t.match(Ly);if(!n)throw new Error("Invalid ISO 8601 date time string: "+t);let r=new Lo(Dn(n[1],1,9999),Dn(n[2],1,12),1,e,0,n[4]?Dn(n[4],0,23):0,n[5]?Dn(n[5],0,59):0,n[6]?Dn(n[6],0,59):0,n[7]?Dn(n[7],0,1/0)*1e3:0);r.day=Dn(n[3],0,r.calendar.getDaysInMonth(r));var o;return n[8]&&(r.offset=Dn(n[8],-23,23)*36e5+Dn((o=n[9])!==null&&o!==void 0?o:"0",0,59)*6e4),Lg(r,e)}function Ny(t){return zg(t,Do())}function Dn(t,e,n){let r=Number(t);if(r<e||r>n)throw new RangeError(`Value out of range: ${e} <= ${r} <= ${n}`);return r}function By(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}${t.millisecond?String(t.millisecond/1e3).slice(1):""}`}function Hg(t){let e=Ut(t,new jo);return`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`}function Pg(t){return`${Hg(t)}T${By(t)}`}function Fy(t){let e=Math.sign(t)<0?"-":"+";t=Math.abs(t);let n=Math.floor(t/36e5),r=t%36e5/6e4;return`${e}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function Vy(t){return`${Pg(t)}${Fy(t.offset)}[${t.timeZone}]`}function _y(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oh(t,e,n){_y(t,e),e.set(t,n)}function ih(t){let e=typeof t[0]=="object"?t.shift():new jo,n;if(typeof t[0]=="string")n=t.shift();else{let s=e.getEras();n=s[s.length-1]}let r=t.shift(),o=t.shift(),i=t.shift();return[e,n,r,o,i]}var zy=new WeakMap;class Oi{copy(){return this.era?new Oi(this.calendar,this.era,this.year,this.month,this.day):new Oi(this.calendar,this.year,this.month,this.day)}add(e){return yl(this,e)}subtract(e){return Fg(this,e)}set(e){return nh(this,e)}cycle(e,n,r){return rh(this,e,n,r)}toDate(e){return Dg(this,e)}toString(){return Hg(this)}compare(e){return Mg(this,e)}constructor(...e){oh(this,zy,{writable:!0,value:void 0});let[n,r,o,i,s]=ih(e);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,Vr(this)}}var Hy=new WeakMap;class Oa{copy(){return this.era?new Oa(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Oa(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return yl(this,e)}subtract(e){return Fg(this,e)}set(e){return nh(Da(this,e),e)}cycle(e,n,r){switch(e){case"era":case"year":case"month":case"day":return rh(this,e,n,r);default:return Vg(this,e,n,r)}}toDate(e,n){return Dg(this,e,n)}toString(){return Pg(this)}compare(e){let n=Mg(this,e);return n===0?xy(this,Fr(e)):n}constructor(...e){oh(this,Hy,{writable:!0,value:void 0});let[n,r,o,i,s]=ih(e);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Vr(this)}}var Py=new WeakMap;class Lo{copy(){return this.era?new Lo(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Lo(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return _g(this,e)}subtract(e){return jy(this,e)}set(e,n){return Oy(this,e,n)}cycle(e,n,r){return Dy(this,e,n,r)}toDate(){return Ty(this)}toString(){return Vy(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-ky(e,this.timeZone).toDate().getTime()}constructor(...e){oh(this,Py,{writable:!0,value:void 0});let[n,r,o,i,s]=ih(e),a=e.shift(),l=e.shift();this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=s,this.timeZone=a,this.offset=l,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Vr(this)}}let $c=new Map;class Wy{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.formatter.format(e)} – ${this.formatter.format(n)}`}formatRangeToParts(e,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(e),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return Ky()&&(this.resolvedHourCycle||(this.resolvedHourCycle=Gy(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),e.calendar==="ethiopic-amete-alem"&&(e.calendar="ethioaa"),e}constructor(e,n={}){this.formatter=Wg(e,n),this.options=n}}const qy={true:{ja:"h11"},false:{}};function Wg(t,e={}){if(typeof e.hour12=="boolean"&&Uy()){e={...e};let o=qy[String(e.hour12)][t.split("-")[0]],i=e.hour12?"h12":"h23";e.hourCycle=o??i,delete e.hour12}let n=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if($c.has(n))return $c.get(n);let r=new Intl.DateTimeFormat(t,e);return $c.set(n,r),r}let Sc=null;function Uy(){return Sc==null&&(Sc=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Sc}let Ac=null;function Ky(){return Ac==null&&(Ac=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Ac}function Gy(t,e){if(!e.timeStyle&&!e.hour)return;t=t.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),t+=(t.includes("-u-")?"":"-u")+"-nu-latn";let n=Wg(t,{...e,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},F.apply(null,arguments)}function U(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}function Yy(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Cl(...t){return e=>t.forEach(n=>Yy(n,e))}function le(...t){return g.useCallback(Cl(...t),t)}function sh(t,e){const n=g.createContext(e);function r(i){const{children:s,...a}=i,l=g.useMemo(()=>a,Object.values(a));return g.createElement(n.Provider,{value:l},s)}function o(i){const s=g.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,o]}function qe(t,e=[]){let n=[];function r(i,s){const a=g.createContext(s),l=n.length;n=[...n,s];function c(h){const{scope:f,children:m,...p}=h,b=f?.[t][l]||a,v=g.useMemo(()=>p,Object.values(p));return g.createElement(b.Provider,{value:v},m)}function d(h,f){const m=f?.[t][l]||a,p=g.useContext(m);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,d]}const o=()=>{const i=n.map(s=>g.createContext(s));return function(a){const l=a?.[t]||i;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return o.scopeName=t,[r,Xy(o,...e)]}function Xy(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const h=l(i)[`__scope${c}`];return{...a,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}const yn=g.forwardRef((t,e)=>{const{children:n,...r}=t,o=g.Children.toArray(n),i=o.find(Qy);if(i){const s=i.props.children,a=o.map(l=>l===i?g.Children.count(s)>1?g.Children.only(null):g.isValidElement(s)?s.props.children:null:l);return g.createElement(Md,F({},r,{ref:e}),g.isValidElement(s)?g.cloneElement(s,void 0,a):null)}return g.createElement(Md,F({},r,{ref:e}),n)});yn.displayName="Slot";const Md=g.forwardRef((t,e)=>{const{children:n,...r}=t;return g.isValidElement(n)?g.cloneElement(n,{...Zy(r,n.props),ref:e?Cl(e,n.ref):n.ref}):g.Children.count(n)>1?g.Children.only(null):null});Md.displayName="SlotClone";const ah=({children:t})=>g.createElement(g.Fragment,null,t);function Qy(t){return g.isValidElement(t)&&t.type===ah}function Zy(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}const Jy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ie=Jy.reduce((t,e)=>{const n=g.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?yn:e;return g.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),g.createElement(a,F({},s,{ref:o}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function e3(t,e){t&&is.flushSync(()=>t.dispatchEvent(e))}function t3(t,e=globalThis?.document){const n=Ke(t);g.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const Ed="dismissableLayer.update",n3="dismissableLayer.pointerDownOutside",r3="dismissableLayer.focusOutside";let m0;const o3=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xr=g.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,d=g.useContext(o3),[h,f]=g.useState(null),m=(n=h?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,p]=g.useState({}),b=le(e,I=>f(I)),v=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(x),$=h?v.indexOf(h):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,A=$>=y,k=i3(I=>{const E=I.target,j=[...d.branches].some(L=>L.contains(E));!A||j||(i?.(I),a?.(I),I.defaultPrevented||l?.())},m),T=s3(I=>{const E=I.target;[...d.branches].some(L=>L.contains(E))||(s?.(I),a?.(I),I.defaultPrevented||l?.())},m);return t3(I=>{$===d.layers.size-1&&(o?.(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},m),g.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(m0=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),g0(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=m0)}},[h,m,r,d]),g.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),g0())},[h,d]),g.useEffect(()=>{const I=()=>p({});return document.addEventListener(Ed,I),()=>document.removeEventListener(Ed,I)},[]),g.createElement(ie.div,F({},c,{ref:b,style:{pointerEvents:S?A?"auto":"none":void 0,...t.style},onFocusCapture:U(t.onFocusCapture,T.onFocusCapture),onBlurCapture:U(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:U(t.onPointerDownCapture,k.onPointerDownCapture)}))});function i3(t,e=globalThis?.document){const n=Ke(t),r=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){qg(n3,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=c,e.addEventListener("click",o.current,{once:!0})):c()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function s3(t,e=globalThis?.document){const n=Ke(t),r=g.useRef(!1);return g.useEffect(()=>{const o=i=>{i.target&&!r.current&&qg(r3,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function g0(){const t=new CustomEvent(Ed);document.dispatchEvent(t)}function qg(t,e,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?e3(o,i):o.dispatchEvent(i)}const a3=Xr,Be=globalThis?.document?g.useLayoutEffect:()=>{},l3=w.useId||(()=>{});let c3=0;function at(t){const[e,n]=w.useState(l3());return Be(()=>{n(r=>r??String(c3++))},[t]),e?`radix-${e}`:""}const d3=["top","right","bottom","left"],cr=Math.min,Dt=Math.max,La=Math.round,Is=Math.floor,bn=t=>({x:t,y:t}),u3={left:"right",right:"left",bottom:"top",top:"bottom"},h3={start:"end",end:"start"};function Id(t,e,n){return Dt(t,cr(e,n))}function Pn(t,e){return typeof t=="function"?t(e):t}function Wn(t){return t.split("-")[0]}function Xo(t){return t.split("-")[1]}function lh(t){return t==="x"?"y":"x"}function ch(t){return t==="y"?"height":"width"}const f3=new Set(["top","bottom"]);function fn(t){return f3.has(Wn(t))?"y":"x"}function dh(t){return lh(fn(t))}function m3(t,e,n){n===void 0&&(n=!1);const r=Xo(t),o=dh(t),i=ch(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Na(s)),[s,Na(s)]}function g3(t){const e=Na(t);return[jd(t),e,jd(e)]}function jd(t){return t.replace(/start|end/g,e=>h3[e])}const p0=["left","right"],b0=["right","left"],p3=["top","bottom"],b3=["bottom","top"];function v3(t,e,n){switch(t){case"top":case"bottom":return n?e?b0:p0:e?p0:b0;case"left":case"right":return e?p3:b3;default:return[]}}function x3(t,e,n,r){const o=Xo(t);let i=v3(Wn(t),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),e&&(i=i.concat(i.map(jd)))),i}function Na(t){return t.replace(/left|right|bottom|top/g,e=>u3[e])}function w3(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ug(t){return typeof t!="number"?w3(t):{top:t,right:t,bottom:t,left:t}}function Ba(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function v0(t,e,n){let{reference:r,floating:o}=t;const i=fn(e),s=dh(e),a=ch(s),l=Wn(e),c=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-o.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Xo(e)){case"start":m[s]-=f*(n&&c?-1:1);break;case"end":m[s]+=f*(n&&c?-1:1);break}return m}const y3=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:h}=v0(c,r,l),f=r,m={},p=0;for(let b=0;b<a.length;b++){const{name:v,fn:x}=a[b],{x:y,y:$,data:S,reset:A}=await x({x:d,y:h,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:t,floating:e}});d=y??d,h=$??h,m={...m,[v]:{...m[v],...S}},A&&p<=50&&(p++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(c=A.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):A.rects),{x:d,y:h}=v0(c,f,l)),b=-1)}return{x:d,y:h,placement:f,strategy:o,middlewareData:m}};async function Li(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=Pn(e,t),p=Ug(m),v=a[f?h==="floating"?"reference":"floating":h],x=Ba(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),y=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,$=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement($))?await(i.getScale==null?void 0:i.getScale($))||{x:1,y:1}:{x:1,y:1},A=Ba(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:$,strategy:l}):y);return{top:(x.top-A.top+p.top)/S.y,bottom:(A.bottom-x.bottom+p.bottom)/S.y,left:(x.left-A.left+p.left)/S.x,right:(A.right-x.right+p.right)/S.x}}const C3=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=Pn(t,e)||{};if(c==null)return{};const h=Ug(d),f={x:n,y:r},m=dh(o),p=ch(m),b=await s.getDimensions(c),v=m==="y",x=v?"top":"left",y=v?"bottom":"right",$=v?"clientHeight":"clientWidth",S=i.reference[p]+i.reference[m]-f[m]-i.floating[p],A=f[m]-i.reference[m],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=k?k[$]:0;(!T||!await(s.isElement==null?void 0:s.isElement(k)))&&(T=a.floating[$]||i.floating[p]);const I=S/2-A/2,E=T/2-b[p]/2-1,j=cr(h[x],E),L=cr(h[y],E),D=j,z=T-b[p]-L,V=T/2-b[p]/2+I,W=Id(D,V,z),G=!l.arrow&&Xo(o)!=null&&V!==W&&i.reference[p]/2-(V<D?j:L)-b[p]/2<0,P=G?V<D?V-D:V-z:0;return{[m]:f[m]+P,data:{[m]:W,centerOffset:V-W-P,...G&&{alignmentOffset:P}},reset:G}}}),$3=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,...v}=Pn(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Wn(o),y=fn(a),$=Wn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),A=f||($||!b?[Na(a)]:g3(a)),k=p!=="none";!f&&k&&A.push(...x3(a,b,p,S));const T=[a,...A],I=await Li(e,v),E=[];let j=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&E.push(I[x]),h){const V=m3(o,s,S);E.push(I[V[0]],I[V[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every(V=>V<=0)){var L,D;const V=(((L=i.flip)==null?void 0:L.index)||0)+1,W=T[V];if(W&&(!(h==="alignment"?y!==fn(W):!1)||j.every(_=>fn(_.placement)===y?_.overflows[0]>0:!0)))return{data:{index:V,overflows:j},reset:{placement:W}};let G=(D=j.filter(P=>P.overflows[0]<=0).sort((P,_)=>P.overflows[1]-_.overflows[1])[0])==null?void 0:D.placement;if(!G)switch(m){case"bestFit":{var z;const P=(z=j.filter(_=>{if(k){const O=fn(_.placement);return O===y||O==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(O=>O>0).reduce((O,X)=>O+X,0)]).sort((_,O)=>_[1]-O[1])[0])==null?void 0:z[0];P&&(G=P);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function x0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function w0(t){return d3.some(e=>t[e]>=0)}const S3=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=Pn(t,e);switch(r){case"referenceHidden":{const i=await Li(e,{...o,elementContext:"reference"}),s=x0(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:w0(s)}}}case"escaped":{const i=await Li(e,{...o,altBoundary:!0}),s=x0(i,n.floating);return{data:{escapedOffsets:s,escaped:w0(s)}}}default:return{}}}}},Kg=new Set(["left","top"]);async function A3(t,e){const{placement:n,platform:r,elements:o}=t,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Wn(n),a=Xo(n),l=fn(n)==="y",c=Kg.has(s)?-1:1,d=i&&l?-1:1,h=Pn(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const k3=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=e,l=await A3(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},T3=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x,y}=v;return{x,y}}},...l}=Pn(t,e),c={x:n,y:r},d=await Li(e,l),h=fn(Wn(o)),f=lh(h);let m=c[f],p=c[h];if(i){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=m+d[v],$=m-d[x];m=Id(y,m,$)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=p+d[v],$=p-d[x];p=Id(y,p,$)}const b=a.fn({...e,[f]:m,[h]:p});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:i,[h]:s}}}}}},R3=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Pn(t,e),d={x:n,y:r},h=fn(o),f=lh(h);let m=d[f],p=d[h];const b=Pn(a,e),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const $=f==="y"?"height":"width",S=i.reference[f]-i.floating[$]+v.mainAxis,A=i.reference[f]+i.reference[$]-v.mainAxis;m<S?m=S:m>A&&(m=A)}if(c){var x,y;const $=f==="y"?"width":"height",S=Kg.has(Wn(o)),A=i.reference[h]-i.floating[$]+(S&&((x=s.offset)==null?void 0:x[h])||0)+(S?0:v.crossAxis),k=i.reference[h]+i.reference[$]+(S?0:((y=s.offset)==null?void 0:y[h])||0)-(S?v.crossAxis:0);p<A?p=A:p>k&&(p=k)}return{[f]:m,[h]:p}}}},M3=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:i,platform:s,elements:a}=e,{apply:l=()=>{},...c}=Pn(t,e),d=await Li(e,c),h=Wn(o),f=Xo(o),m=fn(o)==="y",{width:p,height:b}=i.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=h,v=f==="end"?"top":"bottom");const y=b-d.top-d.bottom,$=p-d.left-d.right,S=cr(b-d[v],y),A=cr(p-d[x],$),k=!e.middlewareData.shift;let T=S,I=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=$),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=y),k&&!f){const j=Dt(d.left,0),L=Dt(d.right,0),D=Dt(d.top,0),z=Dt(d.bottom,0);m?I=p-2*(j!==0||L!==0?j+L:Dt(d.left,d.right)):T=b-2*(D!==0||z!==0?D+z:Dt(d.top,d.bottom))}await l({...e,availableWidth:I,availableHeight:T});const E=await s.getDimensions(a.floating);return p!==E.width||b!==E.height?{reset:{rects:!0}}:{}}}};function $l(){return typeof window<"u"}function Qo(t){return Gg(t)?(t.nodeName||"").toLowerCase():"#document"}function Lt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function kn(t){var e;return(e=(Gg(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gg(t){return $l()?t instanceof Node||t instanceof Lt(t).Node:!1}function Xt(t){return $l()?t instanceof Element||t instanceof Lt(t).Element:!1}function Cn(t){return $l()?t instanceof HTMLElement||t instanceof Lt(t).HTMLElement:!1}function y0(t){return!$l()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Lt(t).ShadowRoot}const E3=new Set(["inline","contents"]);function ss(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Qt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!E3.has(o)}const I3=new Set(["table","td","th"]);function j3(t){return I3.has(Qo(t))}const D3=[":popover-open",":modal"];function Sl(t){return D3.some(e=>{try{return t.matches(e)}catch{return!1}})}const O3=["transform","translate","scale","rotate","perspective"],L3=["transform","translate","scale","rotate","perspective","filter"],N3=["paint","layout","strict","content"];function uh(t){const e=hh(),n=Xt(t)?Qt(t):t;return O3.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||L3.some(r=>(n.willChange||"").includes(r))||N3.some(r=>(n.contain||"").includes(r))}function B3(t){let e=dr(t);for(;Cn(e)&&!No(e);){if(uh(e))return e;if(Sl(e))return null;e=dr(e)}return null}function hh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const F3=new Set(["html","body","#document"]);function No(t){return F3.has(Qo(t))}function Qt(t){return Lt(t).getComputedStyle(t)}function Al(t){return Xt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dr(t){if(Qo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||y0(t)&&t.host||kn(t);return y0(e)?e.host:e}function Yg(t){const e=dr(t);return No(e)?t.ownerDocument?t.ownerDocument.body:t.body:Cn(e)&&ss(e)?e:Yg(e)}function Ni(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Yg(t),i=o===((r=t.ownerDocument)==null?void 0:r.body),s=Lt(o);if(i){const a=Dd(s);return e.concat(s,s.visualViewport||[],ss(o)?o:[],a&&n?Ni(a):[])}return e.concat(o,Ni(o,[],n))}function Dd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Xg(t){const e=Qt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Cn(t),i=o?t.offsetWidth:n,s=o?t.offsetHeight:r,a=La(n)!==i||La(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function fh(t){return Xt(t)?t:t.contextElement}function wo(t){const e=fh(t);if(!Cn(e))return bn(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=Xg(e);let s=(i?La(n.width):n.width)/r,a=(i?La(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const V3=bn(0);function Qg(t){const e=Lt(t);return!hh()||!e.visualViewport?V3:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _3(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Lt(t)?!1:e}function _r(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=fh(t);let s=bn(1);e&&(r?Xt(r)&&(s=wo(r)):s=wo(t));const a=_3(i,n,r)?Qg(i):bn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,h=o.height/s.y;if(i){const f=Lt(i),m=r&&Xt(r)?Lt(r):r;let p=f,b=Dd(p);for(;b&&r&&m!==p;){const v=wo(b),x=b.getBoundingClientRect(),y=Qt(b),$=x.left+(b.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(b.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,h*=v.y,l+=$,c+=S,p=Lt(b),b=Dd(p)}}return Ba({width:d,height:h,x:l,y:c})}function mh(t,e){const n=Al(t).scrollLeft;return e?e.left+n:_r(kn(t)).left+n}function Zg(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),o=r.left+e.scrollLeft-(n?0:mh(t,r)),i=r.top+e.scrollTop;return{x:o,y:i}}function z3(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i=o==="fixed",s=kn(r),a=e?Sl(e.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=bn(1);const d=bn(0),h=Cn(r);if((h||!h&&!i)&&((Qo(r)!=="body"||ss(s))&&(l=Al(r)),Cn(r))){const m=_r(r);c=wo(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const f=s&&!h&&!i?Zg(s,l,!0):bn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function H3(t){return Array.from(t.getClientRects())}function P3(t){const e=kn(t),n=Al(t),r=t.ownerDocument.body,o=Dt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Dt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mh(t);const a=-n.scrollTop;return Qt(r).direction==="rtl"&&(s+=Dt(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function W3(t,e){const n=Lt(t),r=kn(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=hh();(!c||c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}const q3=new Set(["absolute","fixed"]);function U3(t,e){const n=_r(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=Cn(t)?wo(t):bn(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function C0(t,e,n){let r;if(e==="viewport")r=W3(t,n);else if(e==="document")r=P3(kn(t));else if(Xt(e))r=U3(e,n);else{const o=Qg(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Ba(r)}function Jg(t,e){const n=dr(t);return n===e||!Xt(n)||No(n)?!1:Qt(n).position==="fixed"||Jg(n,e)}function K3(t,e){const n=e.get(t);if(n)return n;let r=Ni(t,[],!1).filter(a=>Xt(a)&&Qo(a)!=="body"),o=null;const i=Qt(t).position==="fixed";let s=i?dr(t):t;for(;Xt(s)&&!No(s);){const a=Qt(s),l=uh(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&q3.has(o.position)||ss(s)&&!l&&Jg(t,s))?r=r.filter(d=>d!==s):o=a,s=dr(s)}return e.set(t,r),r}function G3(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?Sl(e)?[]:K3(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const h=C0(e,d,o);return c.top=Dt(h.top,c.top),c.right=cr(h.right,c.right),c.bottom=cr(h.bottom,c.bottom),c.left=Dt(h.left,c.left),c},C0(e,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Y3(t){const{width:e,height:n}=Xg(t);return{width:e,height:n}}function X3(t,e,n){const r=Cn(e),o=kn(e),i=n==="fixed",s=_r(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=bn(0);function c(){l.x=mh(o)}if(r||!r&&!i)if((Qo(e)!=="body"||ss(o))&&(a=Al(e)),r){const m=_r(e,!0,i,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else o&&c();i&&!r&&o&&c();const d=o&&!r&&!i?Zg(o,a):bn(0),h=s.left+a.scrollLeft-l.x-d.x,f=s.top+a.scrollTop-l.y-d.y;return{x:h,y:f,width:s.width,height:s.height}}function kc(t){return Qt(t).position==="static"}function $0(t,e){if(!Cn(t)||Qt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return kn(t)===n&&(n=n.ownerDocument.body),n}function ep(t,e){const n=Lt(t);if(Sl(t))return n;if(!Cn(t)){let o=dr(t);for(;o&&!No(o);){if(Xt(o)&&!kc(o))return o;o=dr(o)}return n}let r=$0(t,e);for(;r&&j3(r)&&kc(r);)r=$0(r,e);return r&&No(r)&&kc(r)&&!uh(r)?n:r||B3(t)||n}const Q3=async function(t){const e=this.getOffsetParent||ep,n=this.getDimensions,r=await n(t.floating);return{reference:X3(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Z3(t){return Qt(t).direction==="rtl"}const J3={convertOffsetParentRelativeRectToViewportRelativeRect:z3,getDocumentElement:kn,getClippingRect:G3,getOffsetParent:ep,getElementRects:Q3,getClientRects:H3,getDimensions:Y3,getScale:wo,isElement:Xt,isRTL:Z3};function tp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function e6(t,e){let n=null,r;const o=kn(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=t.getBoundingClientRect(),{left:d,top:h,width:f,height:m}=c;if(a||e(),!f||!m)return;const p=Is(h),b=Is(o.clientWidth-(d+f)),v=Is(o.clientHeight-(h+m)),x=Is(d),$={rootMargin:-p+"px "+-b+"px "+-v+"px "+-x+"px",threshold:Dt(0,cr(1,l))||1};let S=!0;function A(k){const T=k[0].intersectionRatio;if(T!==l){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!tp(c,t.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(A,{...$,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,$)}n.observe(t)}return s(!0),i}function np(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=fh(t),d=o||i?[...c?Ni(c):[],...Ni(e)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const h=c&&a?e6(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var $;($=m)==null||$.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let p,b=l?_r(t):null;l&&v();function v(){const x=_r(t);b&&!tp(b,x)&&n(),b=x,p=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),h?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const rp=k3,op=T3,ip=$3,t6=M3,n6=S3,S0=C3,r6=R3,sp=(t,e,n)=>{const r=new Map,o={platform:J3,...n},i={...o.platform,_c:r};return y3(t,e,{...o,platform:i})};var o6=typeof document<"u",i6=function(){},ba=o6?g.useLayoutEffect:i6;function Fa(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Fa(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!Fa(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function ap(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function A0(t,e){const n=ap(t);return Math.round(e*n)/n}function Tc(t){const e=w.useRef(t);return ba(()=>{e.current=t}),e}function s6(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,h]=w.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=w.useState(r);Fa(f,r)||m(r);const[p,b]=w.useState(null),[v,x]=w.useState(null),y=w.useCallback(_=>{_!==k.current&&(k.current=_,b(_))},[]),$=w.useCallback(_=>{_!==T.current&&(T.current=_,x(_))},[]),S=i||p,A=s||v,k=w.useRef(null),T=w.useRef(null),I=w.useRef(d),E=l!=null,j=Tc(l),L=Tc(o),D=Tc(c),z=w.useCallback(()=>{if(!k.current||!T.current)return;const _={placement:e,strategy:n,middleware:f};L.current&&(_.platform=L.current),sp(k.current,T.current,_).then(O=>{const X={...O,isPositioned:D.current!==!1};V.current&&!Fa(I.current,X)&&(I.current=X,Yr.flushSync(()=>{h(X)}))})},[f,e,n,L,D]);ba(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[c]);const V=w.useRef(!1);ba(()=>(V.current=!0,()=>{V.current=!1}),[]),ba(()=>{if(S&&(k.current=S),A&&(T.current=A),S&&A){if(j.current)return j.current(S,A,z);z()}},[S,A,z,j,E]);const W=w.useMemo(()=>({reference:k,floating:T,setReference:y,setFloating:$}),[y,$]),G=w.useMemo(()=>({reference:S,floating:A}),[S,A]),P=w.useMemo(()=>{const _={position:n,left:0,top:0};if(!G.floating)return _;const O=A0(G.floating,d.x),X=A0(G.floating,d.y);return a?{..._,transform:"translate("+O+"px, "+X+"px)",...ap(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:X}},[n,a,G.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:z,refs:W,elements:G,floatingStyles:P}),[d,z,W,G,P])}const a6=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?S0({element:r.current,padding:o}).fn(n):{}:r?S0({element:r,padding:o}).fn(n):{}}}},l6=(t,e)=>({...rp(t),options:[t,e]}),c6=(t,e)=>({...op(t),options:[t,e]}),d6=(t,e)=>({...r6(t),options:[t,e]}),u6=(t,e)=>({...ip(t),options:[t,e]}),h6=(t,e)=>({...t6(t),options:[t,e]}),f6=(t,e)=>({...n6(t),options:[t,e]}),m6=(t,e)=>({...a6(t),options:[t,e]}),g6=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...i}=t;return g.createElement(ie.svg,F({},i,{ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:g.createElement("polygon",{points:"0,0 30,0 15,10"}))}),p6=g6;function kl(t){const[e,n]=g.useState(void 0);return Be(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=t.offsetWidth,a=t.offsetHeight;n({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const lp="Popper",[cp,br]=qe(lp),[b6,dp]=cp(lp),v6=t=>{const{__scopePopper:e,children:n}=t,[r,o]=g.useState(null);return g.createElement(b6,{scope:e,anchor:r,onAnchorChange:o},n)},x6="PopperAnchor",w6=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=dp(x6,n),s=g.useRef(null),a=le(e,s);return g.useEffect(()=>{i.onAnchorChange(r?.current||s.current)}),r?null:g.createElement(ie.div,F({},o,{ref:a}))}),up="PopperContent",[y6,C6]=cp(up),$6=g.forwardRef((t,e)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:m="center",alignOffset:p=0,arrowPadding:b=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:$="partial",hideWhenDetached:S=!1,updatePositionStrategy:A="optimized",onPlaced:k,...T}=t,I=dp(up,d),[E,j]=g.useState(null),L=le(e,ye=>j(ye)),[D,z]=g.useState(null),V=kl(D),W=(n=V?.width)!==null&&n!==void 0?n:0,G=(r=V?.height)!==null&&r!==void 0?r:0,P=h+(m!=="center"?"-"+m:""),_=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},O=Array.isArray(x)?x:[x],X=O.length>0,J={padding:_,boundary:O.filter(T6),altBoundary:X},{refs:fe,floatingStyles:se,placement:pe,isPositioned:be,middlewareData:Se}=s6({strategy:"fixed",placement:P,whileElementsMounted:(...ye)=>np(...ye,{animationFrame:A==="always"}),elements:{reference:I.anchor},middleware:[l6({mainAxis:f+G,alignmentAxis:p}),v&&c6({mainAxis:!0,crossAxis:!1,limiter:$==="partial"?d6():void 0,...J}),v&&u6({...J}),h6({...J,apply:({elements:ye,rects:nt,availableWidth:mt,availableHeight:no})=>{const{width:Ar,height:ci}=nt.reference,Zn=ye.floating.style;Zn.setProperty("--radix-popper-available-width",`${mt}px`),Zn.setProperty(