strapi-plugin-navigation 3.2.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/index.js +37 -37
- package/dist/admin/index.mjs +916 -914
- package/package.json +1 -1
package/dist/admin/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
}
|
|
5
5
|
`,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
|
|
6
6
|
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
|
|
7
|
-
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),b=n-Ms(f,m,1,1),p=2;n<Ms(f,m,3,1)?p=0:pa(m)&&(p=1);let v=Math.floor(((b+p)*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 b=t.hour>=12;o=b?12:0,i=b?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(b=>Vn(b,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(b=>Vn(b,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,...b}=h,p=f?.[t][l]||a,v=g.useMemo(()=>b,Object.values(b));return g.createElement(p.Provider,{value:v},m)}function d(h,f){const m=f?.[t][l]||a,b=g.useContext(m);if(b)return b;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,[,b]=g.useState({}),p=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=()=>b({});return document.addEventListener(Ed,I),()=>document.removeEventListener(Ed,I)},[]),g.createElement(ie.div,F({},c,{ref:p,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={},b=0;for(let p=0;p<a.length;p++){const{name:v,fn:x}=a[p],{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&&b<=50&&(b++,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)),p=-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),b=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+b.top)/S.y,bottom:(A.bottom-x.bottom+b.bottom)/S.y,left:(x.left-A.left+b.left)/S.x,right:(A.right-x.right+b.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),b=ch(m),p=await s.getDimensions(c),v=m==="y",x=v?"top":"left",y=v?"bottom":"right",$=v?"clientHeight":"clientWidth",S=i.reference[b]+i.reference[m]-f[m]-i.floating[b],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[b]);const I=S/2-A/2,E=T/2-p[b]/2-1,j=cr(h[x],E),L=cr(h[y],E),D=j,z=T-p[b]-L,V=T/2-p[b]/2+I,W=Id(D,V,z),G=!l.arrow&&Xo(o)!=null&&V!==W&&i.reference[b]/2-(V<D?j:L)-p[b]/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:b="none",flipAlignment:p=!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||($||!p?[Na(a)]:g3(a)),k=b!=="none";!f&&k&&A.push(...x3(a,p,b,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:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof b=="number"&&(m=a==="end"?b*-1:b),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],b=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=b+d[v],$=b-d[x];b=Id(y,b,$)}const p=a.fn({...e,[f]:m,[h]:b});return{...p,data:{x:p.x-n,y:p.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],b=d[h];const p=Pn(a,e),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};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);b<A?b=A:b>k&&(b=k)}return{[f]:m,[h]:b}}}},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:b,height:p}=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=p-d.top-d.bottom,$=b-d.left-d.right,S=cr(p-d[v],y),A=cr(b-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=b-2*(j!==0||L!==0?j+L:Dt(d.left,d.right)):T=p-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 b!==E.width||p!==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 b=f,p=Dd(b);for(;p&&r&&m!==b;){const v=wo(p),x=p.getBoundingClientRect(),y=Qt(p),$=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,h*=v.y,l+=$,c+=S,b=Lt(p),p=Dd(b)}}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 b=Is(h),p=Is(o.clientWidth-(d+f)),v=Is(o.clientHeight-(h+m)),x=Is(d),$={rootMargin:-b+"px "+-p+"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 b,p=l?_r(t):null;l&&v();function v(){const x=_r(t);p&&!tp(p,x)&&n(),p=x,b=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(b)}}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[b,p]=w.useState(null),[v,x]=w.useState(null),y=w.useCallback(_=>{_!==k.current&&(k.current=_,p(_))},[]),$=w.useCallback(_=>{_!==T.current&&(T.current=_,x(_))},[]),S=i||b,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:b=0,arrowPadding:p=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:b}),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("--radix-popper-available-height",`${no}px`),Zn.setProperty("--radix-popper-anchor-width",`${Ar}px`),Zn.setProperty("--radix-popper-anchor-height",`${ci}px`)}}),D&&m6({element:D,padding:p}),R6({arrowWidth:W,arrowHeight:G}),S&&f6({strategy:"referenceHidden",...J})]}),[re,xe]=hp(pe),ge=Ke(k);Be(()=>{be&&ge?.()},[be,ge]);const ve=(o=Se.arrow)===null||o===void 0?void 0:o.x,he=(i=Se.arrow)===null||i===void 0?void 0:i.y,ce=((s=Se.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[je,Te]=g.useState();return Be(()=>{E&&Te(window.getComputedStyle(E).zIndex)},[E]),g.createElement("div",{ref:fe.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:be?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[(a=Se.transformOrigin)===null||a===void 0?void 0:a.x,(l=Se.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},g.createElement(y6,{scope:d,placedSide:re,onArrowChange:z,arrowX:ve,arrowY:he,shouldHideArrow:ce},g.createElement(ie.div,F({"data-side":re,"data-align":xe},T,{ref:L,style:{...T.style,animation:be?void 0:"none",opacity:(c=Se.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))}),S6="PopperArrow",A6={top:"bottom",right:"left",bottom:"top",left:"right"},k6=g.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=C6(S6,r),s=A6[i.placedSide];return g.createElement("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},g.createElement(p6,F({},o,{ref:n,style:{...o.style,display:"block"}})))});function T6(t){return t!==null}const R6=t=>({name:"transformOrigin",options:t,fn(e){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=e,h=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=h?0:t.arrowWidth,m=h?0:t.arrowHeight,[b,p]=hp(a),v={start:"0%",center:"50%",end:"100%"}[p],x=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,y=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+m/2;let $="",S="";return b==="bottom"?($=h?v:`${x}px`,S=`${-m}px`):b==="top"?($=h?v:`${x}px`,S=`${l.floating.height+m}px`):b==="right"?($=`${-m}px`,S=h?v:`${y}px`):b==="left"&&($=`${l.floating.width+m}px`,S=h?v:`${y}px`),{data:{x:$,y:S}}}});function hp(t){const[e,n="center"]=t.split("-");return[e,n]}const Tl=v6,as=w6,ls=$6,M6=k6,Zo=g.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=t;return r?Yr.default.createPortal(g.createElement(ie.div,F({},o,{ref:e})),r):null});function E6(t,e){return g.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const Qe=t=>{const{present:e,children:n}=t,r=I6(e),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=le(r.ref,o.ref);return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:i}):null};Qe.displayName="Presence";function I6(t){const[e,n]=g.useState(),r=g.useRef({}),o=g.useRef(t),i=g.useRef("none"),s=t?"mounted":"unmounted",[a,l]=E6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=js(r.current);i.current=a==="mounted"?c:"none"},[a]),Be(()=>{const c=r.current,d=o.current;if(d!==t){const f=i.current,m=js(c);t?l("MOUNT"):m==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),Be(()=>{if(e){const c=h=>{const m=js(r.current).includes(h.animationName);h.target===e&&m&&is.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===e&&(i.current=js(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function js(t){return t?.animationName||"none"}function it({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=j6({defaultProp:e,onChange:n}),i=t!==void 0,s=i?t:r,a=Ke(n),l=g.useCallback(c=>{if(i){const h=typeof c=="function"?c(t):c;h!==t&&a(h)}else o(c)},[i,t,o,a]);return[s,l]}function j6({defaultProp:t,onChange:e}){const n=g.useState(t),[r]=n,o=g.useRef(r),i=Ke(e);return g.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const fp=g.forwardRef((t,e)=>g.createElement(ie.span,F({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),D6=fp,[Rl,hW]=qe("Tooltip",[br]),gh=br(),O6="TooltipProvider",L6=700,Od="tooltip.open",[N6,ph]=Rl(O6),B6=t=>{const{__scopeTooltip:e,delayDuration:n=L6,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,[s,a]=g.useState(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),g.createElement(N6,{scope:e,isOpenDelayed:s,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:g.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:o},i)},bh="Tooltip",[F6,cs]=Rl(bh),V6=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=t,l=ph(bh,t.__scopeTooltip),c=gh(e),[d,h]=g.useState(null),f=at(),m=g.useRef(0),b=s??l.disableHoverableContent,p=a??l.delayDuration,v=g.useRef(!1),[x=!1,y]=it({prop:r,defaultProp:o,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(Od))):l.onClose(),i?.(T)}}),$=g.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=g.useCallback(()=>{window.clearTimeout(m.current),v.current=!1,y(!0)},[y]),A=g.useCallback(()=>{window.clearTimeout(m.current),y(!1)},[y]),k=g.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,y(!0)},p)},[p,y]);return g.useEffect(()=>()=>window.clearTimeout(m.current),[]),g.createElement(Tl,c,g.createElement(F6,{scope:e,contentId:f,open:x,stateAttribute:$,trigger:d,onTriggerChange:h,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayed?k():S()},[l.isOpenDelayed,k,S]),onTriggerLeave:g.useCallback(()=>{b?A():window.clearTimeout(m.current)},[A,b]),onOpen:S,onClose:A,disableHoverableContent:b},n))},k0="TooltipTrigger",_6=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=cs(k0,n),i=ph(k0,n),s=gh(n),a=g.useRef(null),l=le(e,a,o.onTriggerChange),c=g.useRef(!1),d=g.useRef(!1),h=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),g.createElement(as,F({asChild:!0},s),g.createElement(ie.button,F({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:U(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:U(t.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:U(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:U(t.onFocus,()=>{c.current||o.onOpen()}),onBlur:U(t.onBlur,o.onClose),onClick:U(t.onClick,o.onClose)})))}),mp="TooltipPortal",[z6,H6]=Rl(mp,{forceMount:void 0}),P6=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,i=cs(mp,e);return g.createElement(z6,{scope:e,forceMount:n},g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},r)))},Bi="TooltipContent",W6=g.forwardRef((t,e)=>{const n=H6(Bi,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=t,s=cs(Bi,t.__scopeTooltip);return g.createElement(Qe,{present:r||s.open},s.disableHoverableContent?g.createElement(gp,F({side:o},i,{ref:e})):g.createElement(q6,F({side:o},i,{ref:e})))}),q6=g.forwardRef((t,e)=>{const n=cs(Bi,t.__scopeTooltip),r=ph(Bi,t.__scopeTooltip),o=g.useRef(null),i=le(e,o),[s,a]=g.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:h}=r,f=g.useCallback(()=>{a(null),h(!1)},[h]),m=g.useCallback((b,p)=>{const v=b.currentTarget,x={x:b.clientX,y:b.clientY},y=K6(x,v.getBoundingClientRect()),$=G6(x,y),S=Y6(p.getBoundingClientRect()),A=Q6([...$,...S]);a(A),h(!0)},[h]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&d){const b=v=>m(v,d),p=v=>m(v,l);return l.addEventListener("pointerleave",b),d.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",p)}}},[l,d,m,f]),g.useEffect(()=>{if(s){const b=p=>{const v=p.target,x={x:p.clientX,y:p.clientY},y=l?.contains(v)||d?.contains(v),$=!X6(x,s);y?f():$&&(f(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,d,s,c,f]),g.createElement(gp,F({},t,{ref:i}))}),[U6,fW]=Rl(bh,{isInside:!1}),gp=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=t,l=cs(Bi,n),c=gh(n),{onClose:d}=l;return g.useEffect(()=>(document.addEventListener(Od,d),()=>document.removeEventListener(Od,d)),[d]),g.useEffect(()=>{if(l.trigger){const h=f=>{const m=f.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),g.createElement(Xr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d},g.createElement(ls,F({"data-state":l.stateAttribute},c,a,{ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),g.createElement(ah,null,r),g.createElement(U6,{scope:n,isInside:!0},g.createElement(D6,{id:l.contentId,role:"tooltip"},o||r))))});function K6(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function G6(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function Y6(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function X6(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const a=e[i].x,l=e[i].y,c=e[s].x,d=e[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function Q6(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Z6(e)}function Z6(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}const J6=B6,pp=V6,bp=_6,vp=P6,xp=W6;let Rc=0;function Jo(){g.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:T0()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:T0()),Rc++,()=>{Rc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Rc--}},[])}function T0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Mc="focusScope.autoFocusOnMount",Ec="focusScope.autoFocusOnUnmount",R0={bubbles:!1,cancelable:!0},ei=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[a,l]=g.useState(null),c=Ke(o),d=Ke(i),h=g.useRef(null),f=le(e,p=>l(p)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function($){if(m.paused||!a)return;const S=$.target;a.contains(S)?h.current=S:Jn(h.current,{select:!0})},v=function($){if(m.paused||!a)return;const S=$.relatedTarget;S!==null&&(a.contains(S)||Jn(h.current,{select:!0}))},x=function($){if(document.activeElement===document.body)for(const A of $)A.removedNodes.length>0&&Jn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const y=new MutationObserver(x);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),y.disconnect()}}},[r,a,m.paused]),g.useEffect(()=>{if(a){E0.add(m);const p=document.activeElement;if(!a.contains(p)){const x=new CustomEvent(Mc,R0);a.addEventListener(Mc,c),a.dispatchEvent(x),x.defaultPrevented||(eC(iC(wp(a)),{select:!0}),document.activeElement===p&&Jn(a))}return()=>{a.removeEventListener(Mc,c),setTimeout(()=>{const x=new CustomEvent(Ec,R0);a.addEventListener(Ec,d),a.dispatchEvent(x),x.defaultPrevented||Jn(p??document.body,{select:!0}),a.removeEventListener(Ec,d),E0.remove(m)},0)}}},[a,c,d,m]);const b=g.useCallback(p=>{if(!n&&!r||m.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(v&&x){const y=p.currentTarget,[$,S]=tC(y);$&&S?!p.shiftKey&&x===S?(p.preventDefault(),n&&Jn($,{select:!0})):p.shiftKey&&x===$&&(p.preventDefault(),n&&Jn(S,{select:!0})):x===y&&p.preventDefault()}},[n,r,m.paused]);return g.createElement(ie.div,F({tabIndex:-1},s,{ref:f,onKeyDown:b}))});function eC(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Jn(r,{select:e}),document.activeElement!==n)return}function tC(t){const e=wp(t),n=M0(e,t),r=M0(e.reverse(),t);return[n,r]}function wp(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function M0(t,e){for(const n of t)if(!nC(n,{upTo:e}))return n}function nC(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function rC(t){return t instanceof HTMLInputElement&&"select"in t}function Jn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&rC(t)&&e&&t.select()}}const E0=oC();function oC(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=I0(t,e),t.unshift(e)},remove(e){var n;t=I0(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function I0(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function iC(t){return t.filter(e=>e.tagName!=="A")}var sC=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ro=new WeakMap,Ds=new WeakMap,Os={},Ic=0,yp=function(t){return t&&(t.host||yp(t.parentNode))},aC=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=yp(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},lC=function(t,e,n,r){var o=aC(e,Array.isArray(t)?t:[t]);Os[n]||(Os[n]=new WeakMap);var i=Os[n],s=[],a=new Set,l=new Set(o),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};o.forEach(c);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(a.has(f))d(f);else try{var m=f.getAttribute(r),b=m!==null&&m!=="false",p=(ro.get(f)||0)+1,v=(i.get(f)||0)+1;ro.set(f,p),i.set(f,v),s.push(f),p===1&&b&&Ds.set(f,!0),v===1&&f.setAttribute(n,"true"),b||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return d(e),a.clear(),Ic++,function(){s.forEach(function(h){var f=ro.get(h)-1,m=i.get(h)-1;ro.set(h,f),i.set(h,m),f||(Ds.has(h)||h.removeAttribute(r),Ds.delete(h)),m||h.removeAttribute(n)}),Ic--,Ic||(ro=new WeakMap,ro=new WeakMap,Ds=new WeakMap,Os={})}},Cp=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=sC(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),lC(r,o,n,"aria-hidden")):function(){return null}},_e=function(){return _e=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_e.apply(this,arguments)};function Ml(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function vh(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var yo="right-scroll-bar-position",Co="width-before-scroll-bar",cC="with-scroll-bars-hidden",dC="--removed-body-scroll-bar-size";function jc(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function uC(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var hC=typeof window<"u"?w.useLayoutEffect:w.useEffect,j0=new WeakMap;function xh(t,e){var n=uC(null,function(r){return t.forEach(function(o){return jc(o,r)})});return hC(function(){var r=j0.get(n);if(r){var o=new Set(r),i=new Set(t),s=n.current;o.forEach(function(a){i.has(a)||jc(a,null)}),i.forEach(function(a){o.has(a)||jc(a,s)})}j0.set(n,t)},[t]),n}function fC(t){return t}function mC(t,e){e===void 0&&(e=fC);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var s=e(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return o}function wh(t){t===void 0&&(t={});var e=mC(null);return e.options=_e({async:!0,ssr:!1},t),e}var $p=function(t){var e=t.sideCar,n=Ml(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,_e({},n))};$p.isSideCarExport=!0;function yh(t,e){return t.useMedium(e),$p}var Sp=wh(),Dc=function(){},El=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Dc,onWheelCapture:Dc,onTouchMoveCapture:Dc}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,b=t.inert,p=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=t.gapMode,$=Ml(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,A=xh([n,e]),k=_e(_e({},$),o);return w.createElement(w.Fragment,null,d&&w.createElement(S,{sideCar:Sp,removeScrollBar:c,shards:h,noIsolation:m,inert:b,setCallbacks:i,allowPinchZoom:!!p,lockRef:n,gapMode:y}),s?w.cloneElement(w.Children.only(a),_e(_e({},k),{ref:A})):w.createElement(x,_e({},k,{className:l,ref:A}),a))});El.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};El.classNames={fullWidth:Co,zeroRight:yo};var gC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pC(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=gC();return e&&t.setAttribute("nonce",e),t}function bC(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function vC(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var xC=function(){var t=0,e=null;return{add:function(n){t==0&&(e=pC())&&(bC(e,n),vC(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},wC=function(){var t=xC();return function(e,n){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Il=function(){var t=wC(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},yC={left:0,top:0,right:0,gap:0},Oc=function(t){return parseInt(t||"",10)||0},CC=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[Oc(n),Oc(r),Oc(o)]},$C=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return yC;var e=CC(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},SC=Il(),$o="data-scroll-locked",AC=function(t,e,n,r){var o=t.left,i=t.top,s=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
7
|
+
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("--radix-popper-available-height",`${no}px`),Zn.setProperty("--radix-popper-anchor-width",`${Ar}px`),Zn.setProperty("--radix-popper-anchor-height",`${ci}px`)}}),D&&m6({element:D,padding:b}),R6({arrowWidth:W,arrowHeight:G}),S&&f6({strategy:"referenceHidden",...J})]}),[re,xe]=hp(pe),ge=Ke(k);Be(()=>{be&&ge?.()},[be,ge]);const ve=(o=Se.arrow)===null||o===void 0?void 0:o.x,he=(i=Se.arrow)===null||i===void 0?void 0:i.y,ce=((s=Se.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[je,Te]=g.useState();return Be(()=>{E&&Te(window.getComputedStyle(E).zIndex)},[E]),g.createElement("div",{ref:fe.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:be?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[(a=Se.transformOrigin)===null||a===void 0?void 0:a.x,(l=Se.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},g.createElement(y6,{scope:d,placedSide:re,onArrowChange:z,arrowX:ve,arrowY:he,shouldHideArrow:ce},g.createElement(ie.div,F({"data-side":re,"data-align":xe},T,{ref:L,style:{...T.style,animation:be?void 0:"none",opacity:(c=Se.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))}),S6="PopperArrow",A6={top:"bottom",right:"left",bottom:"top",left:"right"},k6=g.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,i=C6(S6,r),s=A6[i.placedSide];return g.createElement("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},g.createElement(p6,F({},o,{ref:n,style:{...o.style,display:"block"}})))});function T6(t){return t!==null}const R6=t=>({name:"transformOrigin",options:t,fn(e){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=e,h=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=h?0:t.arrowWidth,m=h?0:t.arrowHeight,[p,b]=hp(a),v={start:"0%",center:"50%",end:"100%"}[b],x=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,y=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+m/2;let $="",S="";return p==="bottom"?($=h?v:`${x}px`,S=`${-m}px`):p==="top"?($=h?v:`${x}px`,S=`${l.floating.height+m}px`):p==="right"?($=`${-m}px`,S=h?v:`${y}px`):p==="left"&&($=`${l.floating.width+m}px`,S=h?v:`${y}px`),{data:{x:$,y:S}}}});function hp(t){const[e,n="center"]=t.split("-");return[e,n]}const Tl=v6,as=w6,ls=$6,M6=k6,Zo=g.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=t;return r?Yr.default.createPortal(g.createElement(ie.div,F({},o,{ref:e})),r):null});function E6(t,e){return g.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const Qe=t=>{const{present:e,children:n}=t,r=I6(e),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=le(r.ref,o.ref);return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:i}):null};Qe.displayName="Presence";function I6(t){const[e,n]=g.useState(),r=g.useRef({}),o=g.useRef(t),i=g.useRef("none"),s=t?"mounted":"unmounted",[a,l]=E6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=js(r.current);i.current=a==="mounted"?c:"none"},[a]),Be(()=>{const c=r.current,d=o.current;if(d!==t){const f=i.current,m=js(c);t?l("MOUNT"):m==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),Be(()=>{if(e){const c=h=>{const m=js(r.current).includes(h.animationName);h.target===e&&m&&is.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===e&&(i.current=js(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function js(t){return t?.animationName||"none"}function it({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=j6({defaultProp:e,onChange:n}),i=t!==void 0,s=i?t:r,a=Ke(n),l=g.useCallback(c=>{if(i){const h=typeof c=="function"?c(t):c;h!==t&&a(h)}else o(c)},[i,t,o,a]);return[s,l]}function j6({defaultProp:t,onChange:e}){const n=g.useState(t),[r]=n,o=g.useRef(r),i=Ke(e);return g.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const fp=g.forwardRef((t,e)=>g.createElement(ie.span,F({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),D6=fp,[Rl,hW]=qe("Tooltip",[br]),gh=br(),O6="TooltipProvider",L6=700,Od="tooltip.open",[N6,ph]=Rl(O6),B6=t=>{const{__scopeTooltip:e,delayDuration:n=L6,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=t,[s,a]=g.useState(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),g.createElement(N6,{scope:e,isOpenDelayed:s,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:g.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:o},i)},bh="Tooltip",[F6,cs]=Rl(bh),V6=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=t,l=ph(bh,t.__scopeTooltip),c=gh(e),[d,h]=g.useState(null),f=at(),m=g.useRef(0),p=s??l.disableHoverableContent,b=a??l.delayDuration,v=g.useRef(!1),[x=!1,y]=it({prop:r,defaultProp:o,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(Od))):l.onClose(),i?.(T)}}),$=g.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=g.useCallback(()=>{window.clearTimeout(m.current),v.current=!1,y(!0)},[y]),A=g.useCallback(()=>{window.clearTimeout(m.current),y(!1)},[y]),k=g.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,y(!0)},b)},[b,y]);return g.useEffect(()=>()=>window.clearTimeout(m.current),[]),g.createElement(Tl,c,g.createElement(F6,{scope:e,contentId:f,open:x,stateAttribute:$,trigger:d,onTriggerChange:h,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayed?k():S()},[l.isOpenDelayed,k,S]),onTriggerLeave:g.useCallback(()=>{p?A():window.clearTimeout(m.current)},[A,p]),onOpen:S,onClose:A,disableHoverableContent:p},n))},k0="TooltipTrigger",_6=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=cs(k0,n),i=ph(k0,n),s=gh(n),a=g.useRef(null),l=le(e,a,o.onTriggerChange),c=g.useRef(!1),d=g.useRef(!1),h=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),g.createElement(as,F({asChild:!0},s),g.createElement(ie.button,F({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:U(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:U(t.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:U(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:U(t.onFocus,()=>{c.current||o.onOpen()}),onBlur:U(t.onBlur,o.onClose),onClick:U(t.onClick,o.onClose)})))}),mp="TooltipPortal",[z6,H6]=Rl(mp,{forceMount:void 0}),P6=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,i=cs(mp,e);return g.createElement(z6,{scope:e,forceMount:n},g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},r)))},Bi="TooltipContent",W6=g.forwardRef((t,e)=>{const n=H6(Bi,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=t,s=cs(Bi,t.__scopeTooltip);return g.createElement(Qe,{present:r||s.open},s.disableHoverableContent?g.createElement(gp,F({side:o},i,{ref:e})):g.createElement(q6,F({side:o},i,{ref:e})))}),q6=g.forwardRef((t,e)=>{const n=cs(Bi,t.__scopeTooltip),r=ph(Bi,t.__scopeTooltip),o=g.useRef(null),i=le(e,o),[s,a]=g.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:h}=r,f=g.useCallback(()=>{a(null),h(!1)},[h]),m=g.useCallback((p,b)=>{const v=p.currentTarget,x={x:p.clientX,y:p.clientY},y=K6(x,v.getBoundingClientRect()),$=G6(x,y),S=Y6(b.getBoundingClientRect()),A=Q6([...$,...S]);a(A),h(!0)},[h]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&d){const p=v=>m(v,d),b=v=>m(v,l);return l.addEventListener("pointerleave",p),d.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",b)}}},[l,d,m,f]),g.useEffect(()=>{if(s){const p=b=>{const v=b.target,x={x:b.clientX,y:b.clientY},y=l?.contains(v)||d?.contains(v),$=!X6(x,s);y?f():$&&(f(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,d,s,c,f]),g.createElement(gp,F({},t,{ref:i}))}),[U6,fW]=Rl(bh,{isInside:!1}),gp=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=t,l=cs(Bi,n),c=gh(n),{onClose:d}=l;return g.useEffect(()=>(document.addEventListener(Od,d),()=>document.removeEventListener(Od,d)),[d]),g.useEffect(()=>{if(l.trigger){const h=f=>{const m=f.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),g.createElement(Xr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d},g.createElement(ls,F({"data-state":l.stateAttribute},c,a,{ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),g.createElement(ah,null,r),g.createElement(U6,{scope:n,isInside:!0},g.createElement(D6,{id:l.contentId,role:"tooltip"},o||r))))});function K6(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function G6(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function Y6(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function X6(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const a=e[i].x,l=e[i].y,c=e[s].x,d=e[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function Q6(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Z6(e)}function Z6(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}const J6=B6,pp=V6,bp=_6,vp=P6,xp=W6;let Rc=0;function Jo(){g.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:T0()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:T0()),Rc++,()=>{Rc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Rc--}},[])}function T0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Mc="focusScope.autoFocusOnMount",Ec="focusScope.autoFocusOnUnmount",R0={bubbles:!1,cancelable:!0},ei=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[a,l]=g.useState(null),c=Ke(o),d=Ke(i),h=g.useRef(null),f=le(e,b=>l(b)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let b=function($){if(m.paused||!a)return;const S=$.target;a.contains(S)?h.current=S:Jn(h.current,{select:!0})},v=function($){if(m.paused||!a)return;const S=$.relatedTarget;S!==null&&(a.contains(S)||Jn(h.current,{select:!0}))},x=function($){if(document.activeElement===document.body)for(const A of $)A.removedNodes.length>0&&Jn(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const y=new MutationObserver(x);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),y.disconnect()}}},[r,a,m.paused]),g.useEffect(()=>{if(a){E0.add(m);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(Mc,R0);a.addEventListener(Mc,c),a.dispatchEvent(x),x.defaultPrevented||(eC(iC(wp(a)),{select:!0}),document.activeElement===b&&Jn(a))}return()=>{a.removeEventListener(Mc,c),setTimeout(()=>{const x=new CustomEvent(Ec,R0);a.addEventListener(Ec,d),a.dispatchEvent(x),x.defaultPrevented||Jn(b??document.body,{select:!0}),a.removeEventListener(Ec,d),E0.remove(m)},0)}}},[a,c,d,m]);const p=g.useCallback(b=>{if(!n&&!r||m.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(v&&x){const y=b.currentTarget,[$,S]=tC(y);$&&S?!b.shiftKey&&x===S?(b.preventDefault(),n&&Jn($,{select:!0})):b.shiftKey&&x===$&&(b.preventDefault(),n&&Jn(S,{select:!0})):x===y&&b.preventDefault()}},[n,r,m.paused]);return g.createElement(ie.div,F({tabIndex:-1},s,{ref:f,onKeyDown:p}))});function eC(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Jn(r,{select:e}),document.activeElement!==n)return}function tC(t){const e=wp(t),n=M0(e,t),r=M0(e.reverse(),t);return[n,r]}function wp(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function M0(t,e){for(const n of t)if(!nC(n,{upTo:e}))return n}function nC(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function rC(t){return t instanceof HTMLInputElement&&"select"in t}function Jn(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&rC(t)&&e&&t.select()}}const E0=oC();function oC(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=I0(t,e),t.unshift(e)},remove(e){var n;t=I0(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function I0(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function iC(t){return t.filter(e=>e.tagName!=="A")}var sC=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ro=new WeakMap,Ds=new WeakMap,Os={},Ic=0,yp=function(t){return t&&(t.host||yp(t.parentNode))},aC=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=yp(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},lC=function(t,e,n,r){var o=aC(e,Array.isArray(t)?t:[t]);Os[n]||(Os[n]=new WeakMap);var i=Os[n],s=[],a=new Set,l=new Set(o),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};o.forEach(c);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(a.has(f))d(f);else try{var m=f.getAttribute(r),p=m!==null&&m!=="false",b=(ro.get(f)||0)+1,v=(i.get(f)||0)+1;ro.set(f,b),i.set(f,v),s.push(f),b===1&&p&&Ds.set(f,!0),v===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return d(e),a.clear(),Ic++,function(){s.forEach(function(h){var f=ro.get(h)-1,m=i.get(h)-1;ro.set(h,f),i.set(h,m),f||(Ds.has(h)||h.removeAttribute(r),Ds.delete(h)),m||h.removeAttribute(n)}),Ic--,Ic||(ro=new WeakMap,ro=new WeakMap,Ds=new WeakMap,Os={})}},Cp=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=sC(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),lC(r,o,n,"aria-hidden")):function(){return null}},_e=function(){return _e=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_e.apply(this,arguments)};function Ml(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function vh(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var yo="right-scroll-bar-position",Co="width-before-scroll-bar",cC="with-scroll-bars-hidden",dC="--removed-body-scroll-bar-size";function jc(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function uC(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var hC=typeof window<"u"?w.useLayoutEffect:w.useEffect,j0=new WeakMap;function xh(t,e){var n=uC(null,function(r){return t.forEach(function(o){return jc(o,r)})});return hC(function(){var r=j0.get(n);if(r){var o=new Set(r),i=new Set(t),s=n.current;o.forEach(function(a){i.has(a)||jc(a,null)}),i.forEach(function(a){o.has(a)||jc(a,s)})}j0.set(n,t)},[t]),n}function fC(t){return t}function mC(t,e){e===void 0&&(e=fC);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var s=e(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return o}function wh(t){t===void 0&&(t={});var e=mC(null);return e.options=_e({async:!0,ssr:!1},t),e}var $p=function(t){var e=t.sideCar,n=Ml(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,_e({},n))};$p.isSideCarExport=!0;function yh(t,e){return t.useMedium(e),$p}var Sp=wh(),Dc=function(){},El=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Dc,onWheelCapture:Dc,onTouchMoveCapture:Dc}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,p=t.inert,b=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=t.gapMode,$=Ml(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,A=xh([n,e]),k=_e(_e({},$),o);return w.createElement(w.Fragment,null,d&&w.createElement(S,{sideCar:Sp,removeScrollBar:c,shards:h,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:y}),s?w.cloneElement(w.Children.only(a),_e(_e({},k),{ref:A})):w.createElement(x,_e({},k,{className:l,ref:A}),a))});El.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};El.classNames={fullWidth:Co,zeroRight:yo};var gC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pC(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=gC();return e&&t.setAttribute("nonce",e),t}function bC(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function vC(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var xC=function(){var t=0,e=null;return{add:function(n){t==0&&(e=pC())&&(bC(e,n),vC(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},wC=function(){var t=xC();return function(e,n){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Il=function(){var t=wC(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},yC={left:0,top:0,right:0,gap:0},Oc=function(t){return parseInt(t||"",10)||0},CC=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[Oc(n),Oc(r),Oc(o)]},$C=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return yC;var e=CC(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},SC=Il(),$o="data-scroll-locked",AC=function(t,e,n,r){var o=t.left,i=t.top,s=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
8
8
|
.`.concat(cC,` {
|
|
9
9
|
overflow: hidden `).concat(r,`;
|
|
10
10
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -41,34 +41,34 @@
|
|
|
41
41
|
body[`).concat($o,`] {
|
|
42
42
|
`).concat(dC,": ").concat(a,`px;
|
|
43
43
|
}
|
|
44
|
-
`)},D0=function(){var t=parseInt(document.body.getAttribute($o)||"0",10);return isFinite(t)?t:0},kC=function(){w.useEffect(function(){return document.body.setAttribute($o,(D0()+1).toString()),function(){var t=D0()-1;t<=0?document.body.removeAttribute($o):document.body.setAttribute($o,t.toString())}},[])},Ch=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;kC();var i=w.useMemo(function(){return $C(o)},[o]);return w.createElement(SC,{styles:AC(i,!e,o,n?"":"!important")})},Ld=!1;if(typeof window<"u")try{var Ls=Object.defineProperty({},"passive",{get:function(){return Ld=!0,!0}});window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Ld=!1}var oo=Ld?{passive:!1}:!1,TC=function(t){return t.tagName==="TEXTAREA"},Ap=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!TC(t)&&n[e]==="visible")},RC=function(t){return Ap(t,"overflowY")},MC=function(t){return Ap(t,"overflowX")},O0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=kp(t,r);if(o){var i=Tp(t,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},EC=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},IC=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},kp=function(t,e){return t==="v"?RC(e):MC(e)},Tp=function(t,e){return t==="v"?EC(e):IC(e)},jC=function(t,e){return t==="h"&&e==="rtl"?-1:1},DC=function(t,e,n,r,o){var i=jC(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=Tp(t,a),
|
|
44
|
+
`)},D0=function(){var t=parseInt(document.body.getAttribute($o)||"0",10);return isFinite(t)?t:0},kC=function(){w.useEffect(function(){return document.body.setAttribute($o,(D0()+1).toString()),function(){var t=D0()-1;t<=0?document.body.removeAttribute($o):document.body.setAttribute($o,t.toString())}},[])},Ch=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;kC();var i=w.useMemo(function(){return $C(o)},[o]);return w.createElement(SC,{styles:AC(i,!e,o,n?"":"!important")})},Ld=!1;if(typeof window<"u")try{var Ls=Object.defineProperty({},"passive",{get:function(){return Ld=!0,!0}});window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{Ld=!1}var oo=Ld?{passive:!1}:!1,TC=function(t){return t.tagName==="TEXTAREA"},Ap=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!TC(t)&&n[e]==="visible")},RC=function(t){return Ap(t,"overflowY")},MC=function(t){return Ap(t,"overflowX")},O0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=kp(t,r);if(o){var i=Tp(t,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},EC=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},IC=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},kp=function(t,e){return t==="v"?RC(e):MC(e)},Tp=function(t,e){return t==="v"?EC(e):IC(e)},jC=function(t,e){return t==="h"&&e==="rtl"?-1:1},DC=function(t,e,n,r,o){var i=jC(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=Tp(t,a),p=m[0],b=m[1],v=m[2],x=b-v-i*p;(p||x)&&kp(t,a)&&(h+=x,f+=p),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(c=!0),c},Ns=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},L0=function(t){return[t.deltaX,t.deltaY]},N0=function(t){return t&&"current"in t?t.current:t},OC=function(t,e){return t[0]===e[0]&&t[1]===e[1]},LC=function(t){return`
|
|
45
45
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
46
46
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
47
|
-
`)},NC=0,io=[];function BC(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(NC++)[0],i=w.useState(Il)[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var p=vh([t.lockRef.current],(t.shards||[]).map(N0),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(p,v){if("touches"in p&&p.touches.length===2)return!s.current.allowPinchZoom;var x=Ns(p),y=n.current,$="deltaX"in p?p.deltaX:y[0]-x[0],S="deltaY"in p?p.deltaY:y[1]-x[1],A,k=p.target,T=Math.abs($)>Math.abs(S)?"h":"v";if("touches"in p&&T==="h"&&k.type==="range")return!1;var I=O0(T,k);if(!I)return!0;if(I?A=T:(A=T==="v"?"h":"v",I=O0(T,k)),!I)return!1;if(!r.current&&"changedTouches"in p&&($||S)&&(r.current=A),!A)return!0;var E=r.current||A;return DC(E,v,p,E==="h"?$:S)},[]),l=w.useCallback(function(p){var v=p;if(!(!io.length||io[io.length-1]!==i)){var x="deltaY"in v?L0(v):Ns(v),y=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&OC(A.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(N0).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=$.length>0?a(v,$[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(p,v,x,y){var $={name:p,delta:v,target:x,should:y,shadowParent:FC(x)};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(S){return S!==$})},1)},[]),d=w.useCallback(function(p){n.current=Ns(p),r.current=void 0},[]),h=w.useCallback(function(p){c(p.type,L0(p),p.target,a(p,t.lockRef.current))},[]),f=w.useCallback(function(p){c(p.type,Ns(p),p.target,a(p,t.lockRef.current))},[]);w.useEffect(function(){return io.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,oo),document.addEventListener("touchmove",l,oo),document.addEventListener("touchstart",d,oo),function(){io=io.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,oo),document.removeEventListener("touchmove",l,oo),document.removeEventListener("touchstart",d,oo)}},[]);var m=t.removeScrollBar,b=t.inert;return w.createElement(w.Fragment,null,b?w.createElement(i,{styles:LC(o)}):null,m?w.createElement(Ch,{gapMode:t.gapMode}):null)}function FC(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const VC=yh(Sp,BC);var $h=w.forwardRef(function(t,e){return w.createElement(El,_e({},t,{ref:e,sideCar:VC}))});$h.classNames=El.classNames;function Nd(t,[e,n]){return Math.min(n,Math.max(e,t))}function jl(t){const e=t+"CollectionProvider",[n,r]=qe(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:b,children:p}=m,v=w.default.useRef(null),x=w.default.useRef(new Map).current;return w.default.createElement(o,{scope:b,itemMap:x,collectionRef:v},p)},a=t+"CollectionSlot",l=w.default.forwardRef((m,b)=>{const{scope:p,children:v}=m,x=i(a,p),y=le(b,x.collectionRef);return w.default.createElement(yn,{ref:y},v)}),c=t+"CollectionItemSlot",d="data-radix-collection-item",h=w.default.forwardRef((m,b)=>{const{scope:p,children:v,...x}=m,y=w.default.useRef(null),$=le(b,y),S=i(c,p);return w.default.useEffect(()=>(S.itemMap.set(y,{ref:y,...x}),()=>void S.itemMap.delete(y))),w.default.createElement(yn,{[d]:"",ref:$},v)});function f(m){const b=i(t+"CollectionConsumer",m);return w.default.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((S,A)=>x.indexOf(S.ref.current)-x.indexOf(A.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},f,r]}const _C=g.createContext(void 0);function Qr(t){const e=g.useContext(_C);return t||e||"ltr"}function Dl(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function zC(t){const e=`${t}CollectionProvider`,[n,r]=qe(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map,listeners:new Set}),s=m=>{const{scope:b,children:p}=m,v=w.useRef(null),x=w.useRef(new Map).current,y=w.useRef(new Set).current;return u.jsx(o,{scope:b,itemMap:x,collectionRef:v,listeners:y,children:p})};s.displayName=e;const a=`${t}CollectionSlot`,l=w.forwardRef((m,b)=>{const{scope:p,children:v}=m,x=i(a,p),y=le(b,x.collectionRef);return u.jsx(yn,{ref:y,children:v})});l.displayName=a;const c=`${t}CollectionItemSlot`,d="data-radix-collection-item",h=w.forwardRef((m,b)=>{const{scope:p,children:v,...x}=m,y=w.useRef(null),$=le(b,y),S=i(c,p);return w.useEffect(()=>{const A=Array.from(S.itemMap.values());return S.itemMap.set(y,{ref:y,...x}),S.listeners.forEach(k=>k(Array.from(S.itemMap.values()),A)),()=>{const k=Array.from(S.itemMap.values());S.itemMap.delete(y),S.listeners.forEach(T=>T(Array.from(S.itemMap.values()),k))}}),u.jsx(yn,{[d]:"",ref:$,children:v})});h.displayName=c;function f(m){const b=i(`${t}CollectionConsumer`,m),p=w.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,k)=>y.indexOf(A.ref.current)-y.indexOf(k.ref.current))},[b.collectionRef,b.itemMap]),v=w.useCallback(x=>(b.listeners.add(x),()=>b.listeners.delete(x)),[b.listeners]);return{getItems:p,subscribe:v}}return[{Provider:s,Slot:l,ItemSlot:h},f,r]}const Lc=new Map;function HC(t,e){const n=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Lc.has(n))return Lc.get(n);const r=new Intl.Collator(t,e);return Lc.set(n,r),r}function Sh(t,e){const n=HC(t,{usage:"search",...e});return{startsWith(r,o){return o.length===0?!0:(r=r.normalize("NFC"),o=o.normalize("NFC"),n.compare(r.slice(0,o.length),o)===0)},endsWith(r,o){return o.length===0?!0:(r=r.normalize("NFC"),o=o.normalize("NFC"),n.compare(r.slice(-o.length),o)===0)},contains(r,o){if(o.length===0)return!0;r=r.normalize("NFC"),o=o.normalize("NFC");let i=0;const s=o.length;for(;i+s<=r.length;i++){const a=r.slice(i,i+s);if(n.compare(o,a)===0)return!0}return!1}}}const PC=t=>{const e=w.useRef();return w.useEffect(()=>{e.current=t}),e.current},WC=[" ","Enter","ArrowUp","ArrowDown"],qC=["Enter"],UC=t=>!!(t.length===1&&t.match(/\S| /)),Rp="Combobox",[Bo,ds]=zC(Rp),[KC,Tn]=sh(Rp),GC=({children:t})=>u.jsx(Tl,{children:u.jsx(Bo.Provider,{scope:void 0,children:t})}),YC=t=>typeof t=="string"?t==="none"?{type:t,filter:void 0}:{type:t,filter:"startsWith"}:t,XC=t=>{const{allowCustomValue:e=!1,autocomplete:n="none",children:r,open:o,defaultOpen:i,onOpenChange:s,value:a,defaultValue:l,onValueChange:c,disabled:d,required:h=!1,locale:f="en-EN",onTextValueChange:m,textValue:b,defaultTextValue:p,filterValue:v,defaultFilterValue:x,onFilterValueChange:y,isPrintableCharacter:$=UC,visible:S=!1}=t,[A,k]=w.useState(null),[T,I]=w.useState(null),[E,j]=w.useState(null),[L,D]=w.useState(null),[z=!1,V]=it({prop:o,defaultProp:i,onChange:s}),[W,G]=it({prop:a,defaultProp:l,onChange:c}),[P,_]=it({prop:b,defaultProp:e&&!p?a:p,onChange:m}),[O,X]=it({prop:v,defaultProp:x,onChange:y}),J=at(),fe=w.useCallback((pe,be)=>{const Se=be.map(he=>he.ref.current),[re,...xe]=Se,[ge]=xe.slice(-1),ve=L??be.find(he=>he.value===W)?.ref.current;for(const he of pe){if(he===ve)return;if(he?.scrollIntoView({block:"nearest"}),he===re&&T&&(T.scrollTop=0),he===ge&&T&&(T.scrollTop=T.scrollHeight),D(he),n==="both"){const ce=be.find(je=>je.ref.current===he);ce&&_(ce.textValue)}if(he!==ve)return}},[n,_,T,L,W]),se=YC(n);return w.useEffect(()=>{n!=="both"&&D(null)},[P,n]),w.useEffect(()=>{if(E&&A)return Cp([E,A])},[E,A]),u.jsx(GC,{children:u.jsx(KC,{allowCustomValue:e,autocomplete:se,required:h,trigger:A,onTriggerChange:k,contentId:J,value:W,onValueChange:G,open:z,onOpenChange:V,disabled:d,locale:f,focusFirst:fe,textValue:P,onTextValueChange:_,onViewportChange:I,onContentChange:j,visuallyFocussedItem:L,filterValue:O,onFilterValueChange:X,onVisuallyFocussedItemChange:D,isPrintableCharacter:$,visible:S,children:r})})},Mp="ComboboxTrigger",Ep=w.forwardRef((t,e)=>{const{...n}=t,r=Tn(Mp),o=()=>{r.disabled||r.onOpenChange(!0)};return u.jsx(as,{asChild:!0,children:u.jsx(ei,{asChild:!0,trapped:r.open,onMountAutoFocus:i=>{i.preventDefault()},onUnmountAutoFocus:i=>{r.trigger?.focus({preventScroll:!0}),document.getSelection()?.empty(),i.preventDefault()},children:u.jsx("div",{ref:e,"data-disabled":r.disabled?"":void 0,...n,onClick:U(n.onClick,i=>{if(r.disabled){i.preventDefault();return}r.trigger?.focus()}),onPointerDown:U(n.onPointerDown,i=>{if(r.disabled){i.preventDefault();return}const s=i.target;s.hasPointerCapture(i.pointerId)&&s.releasePointerCapture(i.pointerId),(s.closest("button")??s.closest("div"))===i.currentTarget&&i.button===0&&i.ctrlKey===!1&&(o(),r.trigger?.focus())})})})})});Ep.displayName=Mp;const Ip="ComboboxInput",jp=w.forwardRef((t,e)=>{const n=Tn(Ip),r=w.useRef(null),{getItems:o}=ds(void 0),{startsWith:i}=Sh(n.locale,{sensitivity:"base"}),s=n.disabled,a=le(r,e,n.onTriggerChange),l=()=>{s||n.onOpenChange(!0)},c=PC(n.filterValue);return Be(()=>{const d=setTimeout(()=>{if(n.textValue===""||n.textValue===void 0||n.filterValue===""||n.filterValue===void 0)return;const h=o().find(m=>m.type==="option"&&i(m.textValue,n.textValue)),f=u4(c??"",n.filterValue);h&&!n.visuallyFocussedItem&&f===n.filterValue.length&&r.current?.setSelectionRange(n.filterValue.length,n.textValue.length)});return()=>clearTimeout(d)},[n.textValue,n.filterValue,i,n.visuallyFocussedItem,o,c]),u.jsx("input",{type:"text",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":n.autocomplete.type,"data-state":n.open?"open":"closed","aria-disabled":s,"aria-activedescendant":n.visuallyFocussedItem?.id,disabled:s,"data-disabled":s?"":void 0,"data-placeholder":n.textValue===void 0?"":void 0,value:n.textValue??"",...t,ref:a,onKeyDown:U(t.onKeyDown,d=>{if(["ArrowUp","ArrowDown","Home","End"].includes(d.key))n.open||l(),setTimeout(()=>{let f=o().filter(m=>!m.disabled&&m.isVisible).map(m=>m.ref.current);if(["ArrowUp","End"].includes(d.key)&&(f=f.slice().reverse()),["ArrowUp","ArrowDown"].includes(d.key)){const m=n.visuallyFocussedItem??o().find(b=>b.value===n.value)?.ref.current;if(m){let b=f.indexOf(m);b===f.length-1&&(b=-1),f=f.slice(b+1)}}if(["ArrowDown"].includes(d.key)&&n.autocomplete.type==="both"&&f.length>1){const[m,...b]=f,p=o().find(v=>v.ref.current===m).textValue;n.textValue===p&&(f=b)}n.focusFirst(f,o())}),d.preventDefault();else if(["Tab"].includes(d.key)&&n.open)d.preventDefault();else if(["Escape"].includes(d.key))n.open?n.onOpenChange(!1):(n.onValueChange(void 0),n.onTextValueChange("")),d.preventDefault();else if(qC.includes(d.key)){if(n.visuallyFocussedItem){const h=o().find(f=>f.ref.current===n.visuallyFocussedItem);h&&(n.onValueChange(h.value),n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue),h.ref.current?.click())}else{const h=o().find(f=>f.type==="option"&&!f.disabled&&f.textValue===n.textValue);h&&(n.onValueChange(h.value),n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue),h.ref.current?.click())}n.onOpenChange(!1),d.preventDefault()}else n.onVisuallyFocussedItemChange(null)}),onChange:U(t.onChange,d=>{n.onTextValueChange(d.currentTarget.value),n.autocomplete.type==="both"&&n.onFilterValueChange(d.currentTarget.value)}),onKeyUp:U(t.onKeyUp,d=>{if(!n.open&&(n.isPrintableCharacter(d.key)||["Backspace"].includes(d.key))&&l(),setTimeout(()=>{if(n.autocomplete.type==="both"&&n.isPrintableCharacter(d.key)&&n.filterValue!==void 0){const h=n.filterValue,f=o().find(m=>i(m.textValue,h));f&&n.onTextValueChange(f.textValue)}}),n.autocomplete.type==="none"&&n.isPrintableCharacter(d.key)){const h=n.textValue??"",f=o().find(m=>i(m.textValue,h));f&&(n.onVisuallyFocussedItemChange(f.ref.current),f.ref.current?.scrollIntoView())}}),onBlur:U(t.onBlur,()=>{if(n.open)return;n.onVisuallyFocussedItemChange(null);const[d]=o().filter(f=>f.textValue===n.textValue&&f.type==="option");if(d){n.onValueChange(d.value),n.autocomplete.type==="both"&&n.onFilterValueChange(d.textValue);return}if(n.allowCustomValue){n.onValueChange(n.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(n.textValue);return}const[h]=o().filter(f=>f.value===n.value&&f.type==="option");h&&n.textValue!==""?(n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue)):(n.onValueChange(void 0),n.onTextValueChange(""))})})});jp.displayName="ComboboxTextInput";const Dp=w.forwardRef((t,e)=>{const{children:n,...r}=t,o=Tn(Ip),i=o.disabled,s=()=>{i||(o.onOpenChange(!0),o.trigger?.focus())};return u.jsx(ie.button,{"aria-hidden":!0,type:"button","aria-disabled":i,"aria-controls":o.contentId,"aria-expanded":o.open,disabled:i,"data-disabled":i?"":void 0,...r,tabIndex:-1,ref:e,onClick:U(r.onClick,()=>{o.trigger?.focus()}),onPointerDown:U(r.onPointerDown,a=>{a.button===0&&a.ctrlKey===!1&&(s(),a.preventDefault())}),onKeyDown:U(r.onKeyDown,a=>{WC.includes(a.key)&&(s(),a.preventDefault())}),children:n||"▼"})});Dp.displayName="ComboboxIcon";const QC="ComboboxPortal",Op=t=>u.jsx(Zo,{asChild:!0,...t});Op.displayName=QC;const Ah="ComboboxContent",Lp=w.forwardRef((t,e)=>{const n=Tn(Ah),{getItems:r}=ds(void 0),[o,i]=w.useState();if(Be(()=>{i(new DocumentFragment)},[]),Be(()=>{n.open&&n.autocomplete.type==="none"&&setTimeout(()=>{r().find(a=>a.value===n.value)?.ref.current?.scrollIntoView({block:"nearest"})})},[r,n.autocomplete,n.value,n.open]),!n.open){const s=o;return s?Yr.createPortal(u.jsx(Bo.Slot,{scope:void 0,children:u.jsx("div",{children:t.children})}),s):null}return u.jsx(Np,{...t,ref:e})});Lp.displayName=Ah;const ZC=10,Np=w.forwardRef((t,e)=>{const{onEscapeKeyDown:n,onPointerDownOutside:r,...o}=t,i=Tn(Ah),s=le(e,l=>i.onContentChange(l)),{onOpenChange:a}=i;return Jo(),w.useEffect(()=>{const l=()=>{a(!1)};return window.addEventListener("blur",l),window.addEventListener("resize",l),()=>{window.removeEventListener("blur",l),window.removeEventListener("resize",l)}},[a]),u.jsx($h,{allowPinchZoom:!0,children:u.jsx(Xr,{asChild:!0,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:l=>{l.preventDefault()},onDismiss:()=>{i.onOpenChange(!1),i.trigger?.focus({preventScroll:!0})},children:u.jsx(Bp,{role:"listbox",id:i.contentId,"data-state":i.open?"open":"closed",onContextMenu:l=>l.preventDefault(),...o,ref:s,style:{display:"flex",flexDirection:"column",outline:"none",...o.style}})})})});Np.displayName="ComboboxContentImpl";const Bp=w.forwardRef((t,e)=>{const{align:n="start",collisionPadding:r=ZC,...o}=t;return u.jsx(ls,{...o,ref:e,align:n,collisionPadding:r,style:{boxSizing:"border-box",...o.style,"--radix-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-combobox-content-available-width":"var(--radix-popper-available-width)","--radix-combobox-content-available-height":"var(--radix-popper-available-height)","--radix-combobox-trigger-width":"var(--radix-popper-anchor-width)","--radix-combobox-trigger-height":"var(--radix-popper-anchor-height)"}})});Bp.displayName="ComboboxPopperPosition";const Fp="ComboboxViewport",Vp=w.forwardRef((t,e)=>{const n=Tn(Fp),r=le(e,n.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-combobox-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-combobox-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(Bo.Slot,{scope:void 0,children:u.jsx(ie.div,{"data-radix-combobox-viewport":"",role:"presentation",...t,ref:r,style:{position:"relative",flex:1,overflow:"auto",...t.style}})})]})});Vp.displayName=Fp;const Ol="ComboboxItem",[B0,kh]=sh(Ol),Th=w.forwardRef((t,e)=>{const{value:n,disabled:r=!1,textValue:o,...i}=t,[s,a]=w.useState();Be(()=>{a(new DocumentFragment)},[]);const{onTextValueChange:l,textValue:c,...d}=Tn(Ol),h=at(),[f,m]=w.useState(o??""),b=d.value===n,{startsWith:p,contains:v}=Sh(d.locale,{sensitivity:"base"}),x=w.useCallback(y=>{m($=>$||(y?.textContent??"").trim())},[]);return w.useEffect(()=>{b&&c===void 0&&f!==""&&l(f)},[f,b,c,l]),d.autocomplete.type==="both"&&f&&d.filterValue&&!p(f,d.filterValue)||d.autocomplete.type==="list"&&d.autocomplete.filter==="startsWith"&&f&&c&&!p(f,c)||d.autocomplete.type==="list"&&d.autocomplete.filter==="contains"&&f&&c&&!v(f,c)?s?Yr.createPortal(u.jsx(B0,{textId:h,onTextValueChange:x,isSelected:b,textValue:f,children:u.jsx(Bo.ItemSlot,{scope:void 0,value:n,textValue:f,disabled:r,type:"option",isVisible:!1,children:u.jsx(Bd,{ref:e,value:n,disabled:r,...i})})}),s):null:u.jsx(B0,{textId:h,onTextValueChange:x,isSelected:b,textValue:f,children:u.jsx(Bo.ItemSlot,{scope:void 0,value:n,textValue:f,disabled:r,type:"option",isVisible:!0,children:u.jsx(Bd,{ref:e,value:n,disabled:r,...i})})})});Th.displayName=Ol;const _p="ComboboxItemImpl",Bd=w.forwardRef((t,e)=>{const{value:n,disabled:r=!1,...o}=t,i=w.useRef(null),s=le(e,i),{getItems:a}=ds(void 0),{onTextValueChange:l,visuallyFocussedItem:c,...d}=Tn(Ol),{isSelected:h,textValue:f,textId:m}=kh(_p),b=()=>{r||(d.onValueChange(n),l(f),d.onOpenChange(!1),d.autocomplete.type==="both"&&d.onFilterValueChange(f),d.trigger?.focus({preventScroll:!0}))},p=w.useMemo(()=>c===a().find(x=>x.ref.current===i.current)?.ref.current,[a,c]),v=at();return u.jsx(ie.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":h&&p,"data-state":h?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,id:v,ref:s,onPointerUp:U(o.onPointerUp,b)})});Bd.displayName=_p;const zp="ComboboxItemText",Hp=w.forwardRef((t,e)=>{const{className:n,style:r,...o}=t,i=kh(zp),s=le(e,i.onTextValueChange);return u.jsx(ie.span,{id:i.textId,...o,ref:s})});Hp.displayName=zp;const Pp="ComboboxItemIndicator",Wp=w.forwardRef((t,e)=>{const{isSelected:n}=kh(Pp);return n?u.jsx(ie.span,{"aria-hidden":!0,...t,ref:e}):null});Wp.displayName=Pp;const Rh="ComboboxNoValueFound",qp=w.forwardRef((t,e)=>{const{textValue:n="",filterValue:r="",visible:o=!1,locale:i,autocomplete:s}=Tn(Rh),[a,l]=w.useState([]),{subscribe:c}=ds(void 0),{startsWith:d,contains:h}=Sh(i,{sensitivity:"base"});return w.useEffect(()=>{const f=c(m=>{if(o){const b=m.filter(p=>p.type!=="create");l(b)}else l(m)});return()=>{f()}},[o,c]),s.type==="none"&&a.length>0||s.type==="list"&&s.filter==="startsWith"&&a.some(f=>d(f.textValue,n))||s.type==="both"&&a.some(f=>d(f.textValue,r))||s.type==="list"&&s.filter==="contains"&&a.some(f=>h(f.textValue,n))?null:u.jsx(ie.div,{...t,ref:e})});qp.displayName=Rh;const Up=w.forwardRef((t,e)=>{const{disabled:n=!1,...r}=t,o=Tn(Rh),{textValue:i,visuallyFocussedItem:s}=o,{getItems:a,subscribe:l}=ds(void 0),c=w.useRef(null),[d,h]=w.useState(!1),f=le(e,c),m=w.useMemo(()=>s===a().find(v=>v.ref.current===c.current)?.ref.current,[a,s]),b=at(),p=()=>{!n&&i&&(o.onValueChange(i),o.onTextValueChange(i),o.onOpenChange(!1),o.autocomplete.type==="both"&&o.onFilterValueChange(i),o.trigger?.focus({preventScroll:!0}))};return Be(()=>{const v=l(x=>{h(!x.some(y=>y.textValue===i&&y.type!=="create"))});return a().length===0&&h(!0),()=>{v()}},[i,l,a]),(!i||!d)&&!o.visible?null:u.jsx(Bo.ItemSlot,{scope:void 0,value:i??"",textValue:i??"",disabled:n,isVisible:!0,type:"create",children:u.jsx(ie.div,{role:"option",tabIndex:n?void 0:-1,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,"data-highlighted":m?"":void 0,...r,id:b,ref:f,onPointerUp:U(r.onPointerUp,p)})})});Up.displayName="ComboboxCreateItem";const JC=XC,e4=Ep,t4=jp,n4=Dp,r4=Op,o4=Lp,i4=Vp,s4=Th,a4=Hp,l4=Wp,c4=qp,d4=Up;function u4(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++)if(t[r]!==e[r])return r;return n}const Kt=Object.freeze(Object.defineProperty({__proto__:null,ComboboxItem:Th,Content:o4,CreateItem:d4,Icon:n4,Item:s4,ItemIndicator:l4,ItemText:a4,NoValueFound:c4,Portal:r4,Root:JC,TextInput:t4,Trigger:e4,Viewport:i4},Symbol.toStringTag,{value:"Module"}));function Mh(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>e.current?.(...n),[])}const h4=[" ","Enter","ArrowUp","ArrowDown"],f4=[" ","Enter"],us="Select",[Ll,hs,m4]=jl(us),[ti,g4]=qe(us,[m4,br]),Nl=br(),[p4,Gn]=ti(us),[b4,v4]=ti(us),Eh=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,disabled:d,required:h,multi:f=!1}=t,m=Nl(e),[b,p]=w.useState(null),[v,x]=w.useState(null),[y,$]=w.useState(!1),S=Qr(c),[A=!1,k]=it({prop:r,defaultProp:o,onChange:i}),[T,I]=it({prop:s,defaultProp:a,onChange(D){l&&(Array.isArray(D),l(D))}}),E=w.useRef(null),[j,L]=w.useState(new Set);return u.jsx(Tl,{...m,children:u.jsx(p4,{required:h,scope:e,trigger:b,onTriggerChange:p,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:y,onValueNodeHasChildrenChange:$,contentId:at(),value:T,onValueChange:I,open:A,onOpenChange:k,dir:S,triggerPointerDownPosRef:E,disabled:d,multi:f,children:u.jsx(Ll.Provider,{scope:e,children:u.jsx(b4,{scope:t.__scopeSelect,onNativeOptionAdd:w.useCallback(D=>{L(z=>new Set(z).add(D))},[]),onNativeOptionRemove:w.useCallback(D=>{L(z=>{const V=new Set(z);return V.delete(D),V})},[]),children:n})})})})};Eh.displayName=us;const Kp="SelectTrigger",Ih=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Nl(n),i=Gn(Kp,n),s=i.disabled,a=le(e,i.onTriggerChange),l=hs(n),[c,d,h]=n2(m=>{const b=l().filter(x=>!x.disabled),p=b.find(x=>x.value===i.value),v=r2(b,m,p);if(v!==void 0&&!Array.isArray(v.value)){const x=i.multi?[v.value]:v.value;i.onValueChange(x)}}),f=()=>{s||(i.onOpenChange(!0),h())};return u.jsx(as,{asChild:!0,...o,children:u.jsx(ie.div,{role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed","data-disabled":s?"":void 0,"data-placeholder":i.value===void 0?"":void 0,tabIndex:s?void 0:0,...r,ref:a,onClick:U(r.onClick,m=>{m.currentTarget.focus()}),onPointerDown:U(r.onPointerDown,m=>{const b=m.target;b.hasPointerCapture(m.pointerId)&&b.releasePointerCapture(m.pointerId),(b.closest("button")??b.closest("div"))===m.currentTarget&&m.button===0&&m.ctrlKey===!1&&(f(),i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:U(r.onKeyDown,m=>{const b=c.current!=="",p=m.ctrlKey||m.altKey||m.metaKey,v=m.target;(v.closest("button")??v.closest("div"))===m.currentTarget&&(!p&&m.key.length===1&&d(m.key),!(b&&m.key===" ")&&h4.includes(m.key)&&(f(),m.preventDefault()))})})})});Ih.displayName=Kp;const Gp="SelectValue",jh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,placeholder:o,...i}=t,s=Gn(Gp,n),{onValueNodeHasChildrenChange:a}=s,l=r!==void 0,c=le(e,s.onValueNodeChange),[d,h]=w.useState([]),f=hs(n);Be(()=>{a(l)},[a,l]),w.useLayoutEffect(()=>{if(Array.isArray(s.value)&&d.length!==s.value.length){const b=setTimeout(()=>{const p=f().filter(v=>Array.isArray(v.value)?!1:s.value?.includes(v.value));h(p)});return()=>{clearTimeout(b)}}},[s.value,f,d]);let m;if((s.value===void 0||s.value.length===0)&&o!==void 0)m=u.jsx("span",{children:o});else if(typeof r=="function")if(Array.isArray(s.value)){const b=s.value.map(p=>{const v=d.find(x=>x.value===p);return v?r({value:p,textValue:v?.textValue}):null});m=b.every(p=>p===null)?o:b}else m=r(s.value);else m=r;return u.jsx(ie.span,{...i,ref:c,children:m||null})});jh.displayName=Gp;const x4="SelectIcon",Dh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return u.jsx(ie.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});Dh.displayName=x4;const w4="SelectPortal",Oh=t=>u.jsx(Zo,{asChild:!0,...t});Oh.displayName=w4;const zr="SelectContent",Lh=w.forwardRef((t,e)=>{const n=Gn(zr,t.__scopeSelect),[r,o]=w.useState();if(Be(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Yr.createPortal(u.jsx(Yp,{scope:t.__scopeSelect,children:u.jsx(Ll.Slot,{scope:t.__scopeSelect,children:u.jsx("div",{children:t.children})})}),i):null}return u.jsx(Xp,{...t,ref:e})});Lh.displayName=zr;const On=10,[Yp,vr]=ti(zr),y4="SelectContentImpl",Xp=w.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:b,hideWhenDetached:p,avoidCollisions:v,...x}=t,y=Gn(zr,n),[$,S]=w.useState(null),[A,k]=w.useState(null),T=le(e,re=>S(re)),[I,E]=w.useState(null),[j,L]=w.useState(null),D=hs(n),[z,V]=w.useState(!1),W=w.useRef(!1);w.useEffect(()=>{if($)return Cp($)},[$]),Jo();const G=w.useCallback(re=>{const[xe,...ge]=D().map(ce=>ce.ref.current),[ve]=ge.slice(-1),he=document.activeElement;for(const ce of re)if(ce===he||(ce?.scrollIntoView({block:"nearest"}),ce===xe&&A&&(A.scrollTop=0),ce===ve&&A&&(A.scrollTop=A.scrollHeight),ce?.focus(),document.activeElement!==he))return},[D,A]),P=w.useCallback(()=>G([I,$]),[G,I,$]);w.useEffect(()=>{z&&P()},[z,P]);const{onOpenChange:_,triggerPointerDownPosRef:O}=y;w.useEffect(()=>{if($){let re={x:0,y:0};const xe=ve=>{re={x:Math.abs(Math.round(ve.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(O.current?.y??0))}},ge=ve=>{re.x<=10&&re.y<=10?ve.preventDefault():$.contains(ve.target)||_(!1),document.removeEventListener("pointermove",xe),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",ge,{capture:!0})}}},[$,_,O]),w.useEffect(()=>{const re=()=>_(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[_]);const[X,J]=n2(re=>{const xe=D().filter(he=>!he.disabled),ge=xe.find(he=>he.ref.current===document.activeElement),ve=r2(xe,re,ge);ve&&setTimeout(()=>ve.ref.current.focus())}),fe=w.useCallback((re,xe,ge)=>{const ve=!W.current&&!ge;(y.value!==void 0&&y.value===xe||ve)&&(E(re),ve&&(W.current=!0))},[y.value]),se=w.useCallback(()=>$?.focus(),[$]),pe=w.useCallback((re,xe,ge)=>{const ve=!W.current&&!ge;(y.value!==void 0&&(Array.isArray(xe)?xe.every(ce=>y.value?.includes(ce)):y.value===xe)||ve)&&L(re)},[y.value]),be=r==="popper"?Fd:Qp,Se=be===Fd?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:b,hideWhenDetached:p,avoidCollisions:v}:{};return u.jsx(Yp,{scope:n,content:$,viewport:A,onViewportChange:k,itemRefCallback:fe,selectedItem:I,onItemLeave:se,itemTextRefCallback:pe,focusSelectedItem:P,selectedItemText:j,position:r,isPositioned:z,searchRef:X,children:u.jsx($h,{as:yn,allowPinchZoom:!0,children:u.jsx(ei,{asChild:!0,trapped:y.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:U(o,re=>{y.trigger?.focus({preventScroll:!0}),document.getSelection()?.empty(),re.preventDefault()}),children:u.jsx(Xr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(be,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed","aria-multiselectable":y.multi?"true":void 0,dir:y.dir,onContextMenu:re=>re.preventDefault(),...x,...Se,onPlaced:()=>V(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:U(x.onKeyDown,re=>{const xe=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!xe&&re.key.length===1&&J(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let ve=D().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(re.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const he=re.target,ce=ve.indexOf(he);ve=ve.slice(ce+1)}setTimeout(()=>G(ve)),re.preventDefault()}})})})})})})});Xp.displayName=y4;const C4="SelectItemAlignedPosition",Qp=w.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,i=Gn(zr,n),s=vr(zr,n),[a,l]=w.useState(null),[c,d]=w.useState(null),h=le(e,T=>d(T)),f=hs(n),m=w.useRef(!1),b=w.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=s,$=w.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&p&&v&&x){const T=i.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),j=x.getBoundingClientRect();if(i.dir!=="rtl"){const he=j.left-I.left,ce=E.left-he,je=T.left-ce,Te=T.width+je,ye=Math.max(Te,I.width),nt=window.innerWidth-On,mt=Nd(ce,[On,nt-ye]);a.style.minWidth=`${Te}px`,a.style.left=`${mt}px`}else{const he=I.right-j.right,ce=window.innerWidth-E.right-he,je=window.innerWidth-T.right-ce,Te=T.width+je,ye=Math.max(Te,I.width),nt=window.innerWidth-On,mt=Nd(ce,[On,nt-ye]);a.style.minWidth=`${Te}px`,a.style.right=`${mt}px`}const L=f(),D=window.innerHeight-On*2,z=p.scrollHeight,V=window.getComputedStyle(c),W=parseInt(V.borderTopWidth,10),G=parseInt(V.paddingTop,10),P=parseInt(V.borderBottomWidth,10),_=parseInt(V.paddingBottom,10),O=W+G+z+_+P,X=Math.min(v.offsetHeight*5,O),J=window.getComputedStyle(p),fe=parseInt(J.paddingTop,10),se=parseInt(J.paddingBottom,10),pe=T.top+T.height/2-On,be=D-pe,Se=v.offsetHeight/2,re=v.offsetTop+Se,xe=W+G+re,ge=O-xe;if(xe<=pe){const he=v===L[L.length-1].ref.current;a.style.bottom="0px";const ce=c.clientHeight-p.offsetTop-p.offsetHeight,je=Math.max(be,Se+(he?se:0)+ce+P),Te=xe+je;a.style.height=`${Te}px`}else{const he=v===L[0].ref.current;a.style.top="0px";const je=Math.max(pe,W+p.offsetTop+(he?fe:0)+Se)+ge;a.style.height=`${je}px`,p.scrollTop=xe-pe+p.offsetTop}a.style.margin=`${On}px 0`,a.style.minHeight=`${X}px`,a.style.maxHeight=`${D}px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,a,c,p,v,x,i.dir,r]);Be(()=>$(),[$]);const[S,A]=w.useState();Be(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const k=w.useCallback(T=>{T&&b.current===!0&&($(),y?.(),b.current=!1)},[$,y]);return u.jsx(S4,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(ie.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Qp.displayName=C4;const $4="SelectPopperPosition",Fd=w.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=On,...i}=t,s=Nl(n);return u.jsx(ls,{...s,...i,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Fd.displayName=$4;const[S4,Nh]=ti(zr,{}),Vd="SelectViewport",Bh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=vr(Vd,n),i=Nh(Vd,n),s=le(e,o.onViewportChange),a=w.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(Ll.Slot,{scope:n,children:u.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:U(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h?.current&&d){const f=Math.abs(a.current-c.scrollTop);if(f>0){const m=window.innerHeight-On*2,b=parseFloat(d.style.minHeight),p=parseFloat(d.style.height),v=Math.max(b,p);if(v<m){const x=v+f,y=Math.min(m,x),$=x-y;d.style.height=`${y}px`,d.style.bottom==="0px"&&(c.scrollTop=$>0?$:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});Bh.displayName=Vd;const Zp="SelectGroup",[A4,k4]=ti(Zp),Fh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=at();return u.jsx(A4,{scope:n,id:o,children:u.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:e})})});Fh.displayName=Zp;const Jp="SelectLabel",Vh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=k4(Jp,n);return u.jsx(ie.div,{id:o.id,...r,ref:e})});Vh.displayName=Jp;const Va="SelectItem",[T4,e2]=ti(Va),_h=w.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=t,a=Gn(Va,n),l=vr(Va,n),c=typeof r=="string"?Array.isArray(a.value)?a.value.includes(r):a.value===r:r.every(y=>a.value?.includes(y)),d=Array.isArray(a.value)&&Array.isArray(r)&&r.some(y=>a.value?.includes(y)),[h,f]=w.useState(i??""),[m,b]=w.useState(!1),p=le(e,y=>l.itemRefCallback?.(y,r,o)),v=at(),x=()=>{if(!o){let y=a.multi&&typeof r=="string"?[r]:r;d&&!c?a.onValueChange(y):Array.isArray(a.value)&&(y=o2(r,a.value)),a.onValueChange(y),a.multi||a.onOpenChange(!1)}};if(!a.multi&&Array.isArray(r))throw new Error("You can only pass an array of values in multi selects");return u.jsx(T4,{scope:n,value:r,disabled:o,textId:v,isSelected:c,isIntermediate:d,onItemTextChange:w.useCallback(y=>{f($=>$||(y?.textContent??"").trim())},[]),children:u.jsx(Ll.ItemSlot,{scope:n,value:r,disabled:o,textValue:h,children:u.jsx(ie.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":a.multi?void 0:c&&m,"aria-checked":a.multi?c:void 0,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:p,onFocus:U(s.onFocus,()=>b(!0)),onBlur:U(s.onBlur,()=>b(!1)),onPointerUp:U(s.onPointerUp,x),onPointerMove:U(s.onPointerMove,y=>{o?l.onItemLeave?.():y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:U(s.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(f4.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});_h.displayName=Va;const Ci="SelectItemText",zh=w.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...i}=t,s=Gn(Ci,n),a=vr(Ci,n),l=e2(Ci,n),c=v4(Ci,n),[d,h]=w.useState(null),f=le(e,x=>h(x),l.onItemTextChange,x=>a.itemTextRefCallback?.(x,l.value,l.disabled)),m=d?.textContent,b=w.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:m},Array.isArray(l.value)?l.value.join(";"):l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=c;return Be(()=>(p(b),()=>v(b)),[p,v,b]),u.jsxs(u.Fragment,{children:[u.jsx(ie.span,{id:l.textId,...i,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Yr.createPortal(i.children,s.valueNode):null]})});zh.displayName=Ci;const t2="SelectItemIndicator",Hh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t,i=e2(t2,n);return typeof r=="function"?u.jsx(ie.span,{"aria-hidden":!0,...o,ref:e,children:r({isSelected:i.isSelected,isIntermediate:i.isIntermediate})}):i.isSelected?u.jsx(ie.span,{"aria-hidden":!0,...o,ref:e,children:r}):null});Hh.displayName=t2;const _d="SelectScrollUpButton",Ph=w.forwardRef((t,e)=>{const n=vr(_d,t.__scopeSelect),r=Nh(_d,t.__scopeSelect),[o,i]=w.useState(!1),s=le(e,r.onScrollButtonChange);return Be(()=>{if(n.viewport&&n.isPositioned){const a=n.viewport,l=()=>{const c=a.scrollTop>0;i(c)};return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?u.jsx(qh,{...t,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop-=l.offsetHeight)}}):null});Ph.displayName=_d;const zd="SelectScrollDownButton",Wh=w.forwardRef((t,e)=>{const n=vr(zd,t.__scopeSelect),r=Nh(zd,t.__scopeSelect),[o,i]=w.useState(!1),s=le(e,r.onScrollButtonChange);return Be(()=>{if(n.viewport&&n.isPositioned){const a=n.viewport,l=()=>{const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;i(d)};return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?u.jsx(qh,{...t,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop+=l.offsetHeight)}}):null});Wh.displayName=zd;const qh=w.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,i=vr("SelectScrollButton",n),s=w.useRef(null),a=hs(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Be(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(ie.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerMove:U(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:U(o.onPointerLeave,()=>{l()})})});qh.displayName="SelectScrollButtonImpl";const R4="SelectSeparator",Uh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return u.jsx(ie.div,{"aria-hidden":!0,...r,ref:e})});Uh.displayName=R4;const Hd="SelectArrow",Kh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Nl(n),i=Gn(Hd,n),s=vr(Hd,n);return i.open&&s.position==="popper"?u.jsx(M6,{...o,...r,ref:e}):null});Kh.displayName=Hd;const M4="BubbleSelect",E4=w.forwardRef((t,e)=>{const{value:n,...r}=t,o=w.useRef(null),i=le(e,o),s=Dl(n),a=Gn(M4,void 0);w.useEffect(()=>{const c=o.current,d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==n&&f){const m=new Event("change",{bubbles:!0});f.call(c,n),c.dispatchEvent(m)}},[s,n]);let l=n;return a.multi&&!Array.isArray(n)&&(l=[]),u.jsx(fp,{asChild:!0,children:u.jsx("select",{...r,multiple:a.multi?!0:void 0,ref:i,defaultValue:l})})});E4.displayName="BubbleSelect";function n2(t){const e=Mh(t),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(s=>{const a=n.current+s;e(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function r2(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=I4(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function I4(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const o2=(t,e=[])=>{if(Array.isArray(t))return t.reduce((r,o)=>o2(o,r),e);const n=e.indexOf(t);return n===-1?[...e,t]:[...e.slice(0,n),...e.slice(n+1)]},j4=Eh,D4=Ih,O4=jh,L4=Dh,N4=Oh,B4=Lh,F4=Bh,V4=Fh,_4=Vh,z4=_h,H4=zh,P4=Hh,W4=Ph,q4=Wh,U4=Uh,K4=Kh,tn=Object.freeze(Object.defineProperty({__proto__:null,Arrow:K4,Content:B4,Group:V4,Icon:L4,Item:z4,ItemIndicator:P4,ItemText:H4,Label:_4,Portal:N4,Root:j4,ScrollDownButton:q4,ScrollUpButton:W4,Select:Eh,SelectArrow:Kh,SelectContent:Lh,SelectGroup:Fh,SelectIcon:Dh,SelectItem:_h,SelectItemIndicator:Hh,SelectItemText:zh,SelectLabel:Vh,SelectPortal:Oh,SelectScrollDownButton:Wh,SelectScrollUpButton:Ph,SelectSeparator:Uh,SelectTrigger:Ih,SelectValue:jh,SelectViewport:Bh,Separator:U4,Trigger:D4,Value:O4,Viewport:F4,createSelectScope:g4},Symbol.toStringTag,{value:"Module"}));function jr(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}const i2="Collapsible",[G4,s2]=qe(i2),[Y4,Gh]=G4(i2),X4=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=t,[l=!1,c]=it({prop:r,defaultProp:o,onChange:s});return g.createElement(Y4,{scope:n,disabled:i,contentId:at(),open:l,onOpenToggle:g.useCallback(()=>c(d=>!d),[c])},g.createElement(ie.div,F({"data-state":Yh(l),"data-disabled":i?"":void 0},a,{ref:e})))}),Q4="CollapsibleTrigger",Z4=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,o=Gh(Q4,n);return g.createElement(ie.button,F({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Yh(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:e,onClick:U(t.onClick,o.onOpenToggle)}))}),a2="CollapsibleContent",J4=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Gh(a2,t.__scopeCollapsible);return g.createElement(Qe,{present:n||o.open},({present:i})=>g.createElement(e$,F({},r,{ref:e,present:i})))}),e$=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=t,s=Gh(a2,n),[a,l]=g.useState(r),c=g.useRef(null),d=le(e,c),h=g.useRef(0),f=h.current,m=g.useRef(0),b=m.current,p=s.open||a,v=g.useRef(p),x=g.useRef();return g.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),Be(()=>{const y=c.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const $=y.getBoundingClientRect();h.current=$.height,m.current=$.width,v.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),l(r)}},[s.open,r]),g.createElement(ie.div,F({"data-state":Yh(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p},i,{ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...t.style}}),p&&o)});function Yh(t){return t?"open":"closed"}const t$=X4,n$=Z4,r$=J4,xr="Accordion",o$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Xh,i$,s$]=jl(xr),[Bl,mW]=qe(xr,[s$,s2]),Qh=s2(),l2=w.default.forwardRef((t,e)=>{const{type:n,...r}=t,o=r,i=r;return w.default.createElement(Xh.Provider,{scope:t.__scopeAccordion},n==="multiple"?w.default.createElement(d$,F({},i,{ref:e})):w.default.createElement(c$,F({},o,{ref:e})))});l2.propTypes={type(t){const e=t.value||t.defaultValue;return t.type&&!["single","multiple"].includes(t.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):t.type==="multiple"&&typeof e=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):t.type==="single"&&Array.isArray(e)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[c2,a$]=Bl(xr),[d2,l$]=Bl(xr,{collapsible:!1}),c$=w.default.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=t,[a,l]=it({prop:n,defaultProp:r,onChange:o});return w.default.createElement(c2,{scope:t.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:w.default.useCallback(()=>i&&l(""),[i,l])},w.default.createElement(d2,{scope:t.__scopeAccordion,collapsible:i},w.default.createElement(u2,F({},s,{ref:e}))))}),d$=w.default.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=t,[s=[],a]=it({prop:n,defaultProp:r,onChange:o}),l=w.default.useCallback(d=>a((h=[])=>[...h,d]),[a]),c=w.default.useCallback(d=>a((h=[])=>h.filter(f=>f!==d)),[a]);return w.default.createElement(c2,{scope:t.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},w.default.createElement(d2,{scope:t.__scopeAccordion,collapsible:!0},w.default.createElement(u2,F({},i,{ref:e}))))}),[u$,Fl]=Bl(xr),u2=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=t,a=w.default.useRef(null),l=le(a,e),c=i$(n),h=Qr(o)==="ltr",f=U(t.onKeyDown,m=>{var b;if(!o$.includes(m.key))return;const p=m.target,v=c().filter(E=>{var j;return!((j=E.ref.current)!==null&&j!==void 0&&j.disabled)}),x=v.findIndex(E=>E.ref.current===p),y=v.length;if(x===-1)return;m.preventDefault();let $=x;const S=0,A=y-1,k=()=>{$=x+1,$>A&&($=S)},T=()=>{$=x-1,$<S&&($=A)};switch(m.key){case"Home":$=S;break;case"End":$=A;break;case"ArrowRight":i==="horizontal"&&(h?k():T());break;case"ArrowDown":i==="vertical"&&k();break;case"ArrowLeft":i==="horizontal"&&(h?T():k());break;case"ArrowUp":i==="vertical"&&T();break}const I=$%y;(b=v[I].ref.current)===null||b===void 0||b.focus()});return w.default.createElement(u$,{scope:n,disabled:r,direction:o,orientation:i},w.default.createElement(Xh.Slot,{scope:n},w.default.createElement(ie.div,F({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:f}))))}),Pd="AccordionItem",[h$,Zh]=Bl(Pd),f$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...o}=t,i=Fl(Pd,n),s=a$(Pd,n),a=Qh(n),l=at(),c=r&&s.value.includes(r)||!1,d=i.disabled||t.disabled;return w.default.createElement(h$,{scope:n,open:c,disabled:d,triggerId:l},w.default.createElement(t$,F({"data-orientation":i.orientation,"data-state":h2(c)},a,o,{ref:e,disabled:d,open:c,onOpenChange:h=>{h?s.onItemOpen(r):s.onItemClose(r)}})))}),m$="AccordionHeader",g$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=Fl(xr,n),i=Zh(m$,n);return w.default.createElement(ie.h3,F({"data-orientation":o.orientation,"data-state":h2(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),F0="AccordionTrigger",p$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=Fl(xr,n),i=Zh(F0,n),s=l$(F0,n),a=Qh(n);return w.default.createElement(Xh.ItemSlot,{scope:n},w.default.createElement(n$,F({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:e})))}),b$="AccordionContent",v$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=Fl(xr,n),i=Zh(b$,n),s=Qh(n);return w.default.createElement(r$,F({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}}))});function h2(t){return t?"open":"closed"}const x$=l2,w$=f$,y$=g$,C$=p$,$$=v$,S$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 2A12.014 12.014 0 0 0 4 14c0 3 1.57 6.883 4.201 10.375C10.85 27.894 13.764 30 16 30s5.151-2.101 7.799-5.625C26.43 20.875 28 17 28 14A12.014 12.014 0 0 0 16 2M8 14.5A1.5 1.5 0 0 1 9.5 13a4.5 4.5 0 0 1 4.5 4.5 1.5 1.5 0 0 1-1.5 1.5A4.5 4.5 0 0 1 8 14.5M18 25h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2m1.5-6a1.5 1.5 0 0 1-1.5-1.5 4.5 4.5 0 0 1 4.5-4.5 1.5 1.5 0 0 1 1.5 1.5 4.5 4.5 0 0 1-4.5 4.5"})})};g.forwardRef(S$);const A$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 6H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2v11a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V13a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2m-9 12h-6a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2m9-7H4V8h24z"})})};g.forwardRef(A$);const k$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.5 7v6a1.5 1.5 0 0 1-1.5 1.5h-6a1.5 1.5 0 0 1 0-3h2.137l-2.375-2.173-.047-.046a9.5 9.5 0 1 0-6.84 16.219H16a9.44 9.44 0 0 0 6.519-2.59 1.5 1.5 0 1 1 2.061 2.181A12.43 12.43 0 0 1 16 28.5h-.171a12.5 12.5 0 1 1 8.985-21.368L27.5 9.59V7a1.5 1.5 0 0 1 3 0"})})},T$=g.forwardRef(k$),R$=T$,M$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.061 19.061-9 9a1.503 1.503 0 0 1-2.125 0l-9-9a1.503 1.503 0 1 1 2.125-2.125l6.439 6.439V5a1.5 1.5 0 1 1 3 0v18.375l6.439-6.44a1.502 1.502 0 1 1 2.125 2.125z"})})};g.forwardRef(M$);const E$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H8.625l6.44 6.439a1.502 1.502 0 1 1-2.125 2.125l-9-9a1.5 1.5 0 0 1 0-2.125l9-9a1.503 1.503 0 0 1 2.125 2.125L8.625 14.5H27a1.5 1.5 0 0 1 1.5 1.5"})})};g.forwardRef(E$);const I$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:i,viewBox:"0 0 16 16",stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.75 8a.75.75 0 0 1-.75.75H6.813l3.22 3.22a.751.751 0 1 1-1.063 1.062l-4.5-4.5a.75.75 0 0 1 0-1.063l4.5-4.5a.751.751 0 0 1 1.063 1.063L6.813 7.25H14a.75.75 0 0 1 .75.75M2.5 1.75a.75.75 0 0 0-.75.75v11a.75.75 0 0 0 1.5 0v-11a.75.75 0 0 0-.75-.75"})})};g.forwardRef(I$);const j$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:i,viewBox:"0 0 16 16",stroke:s,ref:r,...n,children:u.jsx("path",{d:"M11.53 7.47a.75.75 0 0 1 0 1.062l-4.5 4.5a.751.751 0 1 1-1.062-1.063l3.22-3.219H2a.75.75 0 1 1 0-1.5h7.188L5.969 4.03a.751.751 0 1 1 1.063-1.062zm1.97-5.72a.75.75 0 0 0-.75.75v11a.75.75 0 0 0 1.5 0v-11a.75.75 0 0 0-.75-.75"})})};g.forwardRef(j$);const D$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m28.061 17.061-9 9a1.503 1.503 0 1 1-2.125-2.125l6.439-6.436H5a1.5 1.5 0 1 1 0-3h18.375l-6.436-6.44a1.503 1.503 0 0 1 2.125-2.125l9 9a1.5 1.5 0 0 1-.003 2.126"})})},O$=g.forwardRef(D$),L$=O$,N$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.061 15.061a1.5 1.5 0 0 1-2.125 0L17.5 8.625V27a1.5 1.5 0 1 1-3 0V8.625l-6.439 6.436a1.503 1.503 0 1 1-2.125-2.125l9-9a1.5 1.5 0 0 1 2.125 0l9 9a1.5 1.5 0 0 1 0 2.125"})})};g.forwardRef(N$);const B$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M11 13.5H5A1.5 1.5 0 0 1 3.5 12V6a1.5 1.5 0 0 1 3 0v1.733C8.581 5.683 11.786 3.5 16 3.5c5.558 0 8.92 3.299 9.061 3.439a1.5 1.5 0 0 1-2.117 2.125C22.889 9.01 20.25 6.5 16 6.5c-3.625 0-6.367 2.21-8 4h3a1.5 1.5 0 1 1 0 3m16 5h-6a1.5 1.5 0 1 0 0 3h3c-1.625 1.79-4.375 4-8 4-4.25 0-6.889-2.511-6.944-2.565A1.5 1.5 0 0 0 6.94 25.06c.141.141 3.504 3.44 9.061 3.44 4.214 0 7.419-2.183 9.5-4.233V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5"})})};g.forwardRef(B$);const F$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M220 48v48a12 12 0 0 1-24 0V77l-39.51 39.52a12 12 0 0 1-17-17L179 60h-19a12 12 0 0 1 0-24h48a12 12 0 0 1 12 12M99.51 139.51 60 179v-19a12 12 0 0 0-24 0v48a12 12 0 0 0 12 12h48a12 12 0 0 0 0-24H77l39.52-39.51a12 12 0 0 0-17-17Z"})})};g.forwardRef(F$);const V$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.725 21.993C27.031 20.798 26 17.416 26 13a10 10 0 0 0-20 0c0 4.418-1.032 7.797-1.726 8.993A2 2 0 0 0 6 25h5.101a5 5 0 0 0 9.798 0H26a2 2 0 0 0 1.725-3.008M16 27a3 3 0 0 1-2.828-2h5.656A3 3 0 0 1 16 27"})})};g.forwardRef(V$);const _$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22.135 14.308A6.001 6.001 0 0 0 17.5 4.5H9A1.5 1.5 0 0 0 7.5 6v19A1.5 1.5 0 0 0 9 26.5h10a6.5 6.5 0 0 0 3.135-12.192M10.5 7.5h7a3 3 0 0 1 0 6h-7zm8.5 16h-8.5v-7H19a3.5 3.5 0 1 1 0 7"})})};g.forwardRef(_$);const z$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 4v20a1 1 0 0 1-1 1H9a2 2 0 0 0-2 2h17a1 1 0 0 1 0 2H6a1 1 0 0 1-1-1V7a4 4 0 0 1 4-4h17a1 1 0 0 1 1 1"})})};g.forwardRef(z$);const H$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19 14a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m10-5v16a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V6a3 3 0 0 1 3-3h6a3 3 0 0 1 3 3v1h5a2 2 0 0 1 2 2M12 7h8V6a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1zm15 7.201V9H5v5.201A23 23 0 0 0 16 17a23 23 0 0 0 11-2.799"})})};g.forwardRef(H$);const P$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M9.5 8A1.5 1.5 0 0 1 11 6.5h16a1.5 1.5 0 0 1 0 3H11A1.5 1.5 0 0 1 9.5 8M27 14.5H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3m0 8H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3M5.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0-8a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 16a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})};g.forwardRef(P$);const W$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 4h-3V3a1 1 0 0 0-2 0v1H11V3a1 1 0 0 0-2 0v1H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 6H6V6h3v1a1 1 0 0 0 2 0V6h10v1a1 1 0 0 0 2 0V6h3z"})})},q$=g.forwardRef(W$),U$=q$,K$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 14h-1.35l-3.472-7.812A2 2 0 0 0 23.35 5H8.65a2 2 0 0 0-1.828 1.188L3.35 14H2a1 1 0 0 0 0 2h1v10a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2v-2h12v2a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V16h1a1 1 0 0 0 0-2m-20 6H8a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2m12 0a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2z"})})};g.forwardRef(K$);const G$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 12.708-10 10a1 1 0 0 1-1.415 0l-10-10A1 1 0 0 1 6 11h20a1 1 0 0 1 .707 1.707"})})},Y$=g.forwardRef(G$),ur=Y$,X$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.924 20.383A1 1 0 0 1 26 21H6a1 1 0 0 1-.708-1.707l10-10a1 1 0 0 1 1.415 0l10 10a1 1 0 0 1 .217 1.09"})})},Q$=g.forwardRef(X$),Z$=Q$,J$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M7 26a1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 3 3 0 0 1 3 3m-3-7a1 1 0 0 0 0 2 5 5 0 0 1 5 5 1 1 0 1 0 2 0 7.01 7.01 0 0 0-7-7m0-4a1 1 0 0 0 0 2 9.01 9.01 0 0 1 9 9 1 1 0 0 0 2 0A11.01 11.01 0 0 0 4 15M27 5H5a2 2 0 0 0-2 2v5a1 1 0 0 0 1 1 13.014 13.014 0 0 1 13 13 1 1 0 0 0 1 1h9a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2"})})};g.forwardRef(J$);const e8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25 3h-1a2 2 0 0 0-2 2v2h-3.5V5a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v2H10V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v5.586A1.98 1.98 0 0 0 5.586 12L7 13.414V27a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V13.414L26.414 12A1.98 1.98 0 0 0 27 10.586V5a2 2 0 0 0-2-2m-6 24h-6v-8a3 3 0 0 1 6 0z"})})};g.forwardRef(e8);const t8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-5-2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3-5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M25 24H7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v13h17a1 1 0 0 1 0 2"})})};g.forwardRef(t8);const n8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.094 14.443a12.8 12.8 0 0 1 2.914-6.72 2 2 0 0 1 2.953-.138l3.459 3.533a1.98 1.98 0 0 1 .211 2.56 3.2 3.2 0 0 0-.462.968.5.5 0 0 1-.478.354h-8.1a.5.5 0 0 1-.497-.557m14.08-11.435A2 2 0 0 0 15 5v5.084a1.98 1.98 0 0 0 1.656 1.97 4 4 0 0 1 .677 7.72.51.51 0 0 0-.333.476v8.154a.5.5 0 0 0 .558.5A13.04 13.04 0 0 0 29 16.185C29.094 9.4 23.899 3.61 17.174 3.008M14.656 19.77a4 4 0 0 1-2.425-2.427.51.51 0 0 0-.475-.343H3.59a.5.5 0 0 0-.5.556A13.01 13.01 0 0 0 14.443 28.91a.5.5 0 0 0 .556-.5V20.25a.51.51 0 0 0-.343-.48"})})};g.forwardRef(n8);const r8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m0 2a11 11 0 0 1 8.984 4.659L16 14.845zm0 22a11 11 0 0 1-8.984-4.659l18.97-10.951A11 11 0 0 1 16 27"})})};g.forwardRef(r8);const o8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.061 10.061-16 16a1.5 1.5 0 0 1-2.125 0l-7-7a1.504 1.504 0 0 1 2.125-2.125L12 22.875 26.939 7.939a1.502 1.502 0 1 1 2.125 2.125z"})})},i8=g.forwardRef(o8),fs=i8,s8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5.708 10.708-7 7a1 1 0 0 1-1.415 0l-3-3a1 1 0 0 1 1.415-1.415L14 18.586l6.293-6.293a1 1 0 0 1 1.415 1.415"})})},a8=g.forwardRef(s8),l8=a8,c8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M176.49 95.51a12 12 0 0 1 0 17l-56 56a12 12 0 0 1-17 0l-24-24a12 12 0 1 1 17-17L112 143l47.51-47.52a12 12 0 0 1 16.98.03M236 128A108 108 0 1 1 128 20a108.12 108.12 0 0 1 108 108m-24 0a84 84 0 1 0-84 84 84.09 84.09 0 0 0 84-84"})})};g.forwardRef(c8);const d8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m27.061 13.061-10 10a1.503 1.503 0 0 1-2.125 0l-10-10a1.503 1.503 0 1 1 2.125-2.125L16 19.875l8.939-8.94a1.502 1.502 0 1 1 2.125 2.125z"})})};g.forwardRef(d8);const u8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M21.061 24.939a1.503 1.503 0 0 1-2.125 2.125l-10-10a1.5 1.5 0 0 1 0-2.125l10-10a1.503 1.503 0 0 1 2.125 2.125L12.125 16z"})})},h8=g.forwardRef(u8),f2=h8,f8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m23.061 17.061-10 10a1.503 1.503 0 0 1-2.125-2.125L19.875 16l-8.936-8.939a1.502 1.502 0 1 1 2.125-2.125l10 10a1.5 1.5 0 0 1-.003 2.125"})})},m8=g.forwardRef(f8),Jh=m8,g8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.061 21.061a1.503 1.503 0 0 1-2.125 0L16 12.125l-8.939 8.936a1.503 1.503 0 0 1-2.125-2.125l10-10a1.5 1.5 0 0 1 2.125 0l10 10a1.5 1.5 0 0 1 0 2.125"})})};g.forwardRef(g8);const p8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m7 14h-7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v6h6a1 1 0 0 1 0 2"})})},b8=g.forwardRef(p8),v8=b8,x8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 16a12 12 0 0 1-20.236 8.728 1.002 1.002 0 0 1 1.375-1.456 10 10 0 1 0-.21-14.343c-.441.446-.857.885-1.26 1.321l2.039 2.043A1 1 0 0 1 9 14H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1.707-.707L6.25 8.838c.402-.437.817-.875 1.258-1.32A12 12 0 0 1 28 16M16 9a1 1 0 0 0-1 1v6a1 1 0 0 0 .485.858l5 3a.999.999 0 0 0 1.486-1.1 1 1 0 0 0-.456-.616L17 15.434V10a1 1 0 0 0-1-1"})})};g.forwardRef(x8);const w8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435C30.764 9.693 25.884 5 20.008 5"})})};g.forwardRef(w8);const y8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.991 15.565C30.764 9.693 25.884 5 20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435m-7.283 3.143a1 1 0 0 1-1.415 0L20 16.414V24a1 1 0 0 1-2 0v-7.586l-2.293 2.293a1 1 0 0 1-1.415-1.415l4-4a1 1 0 0 1 1.415 0l4 4a1 1 0 0 1 0 1.415"})})};g.forwardRef(y8);const C8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M8.96 12.153 4.342 16l4.618 3.848a1.5 1.5 0 1 1-1.92 2.305l-6-5a1.5 1.5 0 0 1 0-2.305l6-5a1.5 1.5 0 0 1 1.92 2.304m22 2.694-6-5a1.5 1.5 0 1 0-1.92 2.306L27.658 16l-4.618 3.848a1.5 1.5 0 1 0 1.92 2.305l6-5a1.5 1.5 0 0 0 0-2.305M20.512 3.59a1.5 1.5 0 0 0-1.922.898l-8 22a1.5 1.5 0 0 0 2.82 1.024l8-22a1.5 1.5 0 0 0-.898-1.922"})})};g.forwardRef(C8);const $8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M200 40h-32a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v80a16 16 0 0 0 16 16h8v64a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m-93.66 21.66a8 8 0 0 1 11.32-11.32l24 24a8 8 0 0 1 0 11.32l-24 24a8 8 0 0 1-11.32-11.32L124.69 80Zm-64 24a8 8 0 0 1 0-11.32l24-24a8 8 0 0 1 11.32 11.32L59.31 80l18.35 18.34a8 8 0 0 1-11.32 11.32ZM200 200H56v-64h96a16 16 0 0 0 16-16V56h32Z"})})};g.forwardRef($8);const S8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 10H4a1 1 0 0 0-1 1v6a12.04 12.04 0 0 0 4.068 9H4a1 1 0 0 0 0 2h22a1 1 0 0 0 0-2h-3.067a12.1 12.1 0 0 0 3.375-5.011A5 5 0 0 0 31 16v-1a5 5 0 0 0-5-5m3 6a3 3 0 0 1-2.15 2.875Q27 17.944 27 17v-4.828A3 3 0 0 1 29 15zM14 7V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m4 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m-8 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0"})})};g.forwardRef(S8);const A8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.743 13.401a1 1 0 0 0-.487-.675l-3.729-2.125-.015-4.202a1 1 0 0 0-.353-.76 14 14 0 0 0-4.59-2.584 1 1 0 0 0-.808.074L16 5.23l-3.765-2.106a1 1 0 0 0-.809-.075 14 14 0 0 0-4.585 2.594 1 1 0 0 0-.354.758L6.47 10.61 2.74 12.734a1 1 0 0 0-.486.675 13.3 13.3 0 0 0 0 5.195 1 1 0 0 0 .486.675l3.729 2.125.015 4.204a1 1 0 0 0 .353.76 14 14 0 0 0 4.59 2.583 1 1 0 0 0 .808-.073L16 26.768l3.765 2.107a1.013 1.013 0 0 0 .809.073 14 14 0 0 0 4.585-2.592 1 1 0 0 0 .354-.759l.018-4.206 3.729-2.125a1 1 0 0 0 .486-.675c.34-1.713.338-3.477-.003-5.19M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10"})})},k8=g.forwardRef(A8),T8=k8,R8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18.5 12V6a1.5 1.5 0 1 1 3 0v4.5H26a1.5 1.5 0 1 1 0 3h-6a1.5 1.5 0 0 1-1.5-1.5M12 18.5H6a1.5 1.5 0 1 0 0 3h4.5V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5m14 0h-6a1.5 1.5 0 0 0-1.5 1.5v6a1.5 1.5 0 1 0 3 0v-4.5H26a1.5 1.5 0 1 0 0-3m-14-14A1.5 1.5 0 0 0 10.5 6v4.5H6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 0 0 1.5-1.5V6A1.5 1.5 0 0 0 12 4.5"})})};g.forwardRef(R8);const M8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22.5 17.5h-2v-3h2a5 5 0 1 0-5-5v2h-3v-2a5 5 0 1 0-5 5h2v3h-2a5 5 0 1 0 5 5v-2h3v2a5 5 0 1 0 5-5m-2-8a2 2 0 1 1 2 2h-2zm-13 0a2 2 0 0 1 4 0v2h-2a2 2 0 0 1-2-2m4 13a2 2 0 1 1-2-2h2zm3-8h3v3h-3zm8 10a2 2 0 0 1-2-2v-2h2a2 2 0 0 1 0 4"})})};g.forwardRef(M8);const E8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.5 24a1.5 1.5 0 0 1-1.5 1.5h-3.5V29a1.5 1.5 0 1 1-3 0v-3.5H8A1.5 1.5 0 0 1 6.5 24V9.5H3a1.5 1.5 0 0 1 0-3h3.5V3a1.5 1.5 0 0 1 3 0v19.5H29a1.5 1.5 0 0 1 1.5 1.5M13 9.5h9.5V19a1.5 1.5 0 1 0 3 0V8A1.5 1.5 0 0 0 24 6.5H13a1.5 1.5 0 0 0 0 3"})})};g.forwardRef(E8);const I8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.061 23.939a1.503 1.503 0 0 1-2.125 2.125L16 18.125l-7.939 7.936a1.503 1.503 0 1 1-2.125-2.125L13.875 16 5.939 8.061a1.503 1.503 0 1 1 2.125-2.125L16 13.875l7.939-7.94a1.502 1.502 0 1 1 2.125 2.125L18.125 16z"})})},j8=g.forwardRef(I8),Zr=j8,D8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m4.708 16.293a1 1 0 0 1-1.415 1.415L16 17.414l-3.293 3.293a1 1 0 0 1-1.415-1.415L14.587 16l-3.293-3.293a1 1 0 1 1 1.415-1.415L16 14.587l3.293-3.293a1 1 0 0 1 1.415 1.415L17.414 16z"})})};g.forwardRef(D8);const O8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.48 9.524a1.51 1.51 0 0 0-1.668-.213l-6.276 3.125-5.24-8.704a1.514 1.514 0 0 0-2.592 0l-5.24 8.708L3.19 9.315a1.514 1.514 0 0 0-2.113 1.825l4.625 14.17a1 1 0 0 0 1.46.55C7.194 25.841 10.39 24 16 24s8.806 1.841 8.835 1.859a1 1 0 0 0 1.464-.549l4.625-14.166a1.51 1.51 0 0 0-.444-1.62M21.98 19.6a1 1 0 0 1-1.159.811 28.5 28.5 0 0 0-9.652 0 1 1 0 0 1-.348-1.97 30.6 30.6 0 0 1 10.348 0 1 1 0 0 1 .816 1.159z"})})};g.forwardRef(O8);const L8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.414 24a2 2 0 0 1 0 2.829l-.585.585a2 2 0 0 1-2.829 0l-6.906-6.905-2.735 6.292A1.98 1.98 0 0 1 12.533 28h-.098a1.98 1.98 0 0 1-1.801-1.375L4.1 6.615A1.994 1.994 0 0 1 6.615 4.1l20.01 6.534a2 2 0 0 1 .176 3.725l-6.292 2.735z"})})};g.forwardRef(L8);const N8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3C9.271 3 4 6.075 4 10v12c0 3.925 5.271 7 12 7s12-3.075 12-7V10c0-3.925-5.271-7-12-7m10 13c0 1.203-.985 2.429-2.701 3.365C21.366 20.419 18.774 21 16 21s-5.366-.581-7.299-1.635C6.985 18.429 6 17.203 6 16v-2.08C8.133 15.795 11.779 17 16 17s7.868-1.21 10-3.08zm-2.701 9.365C21.366 26.419 18.774 27 16 27s-5.366-.581-7.299-1.635C6.985 24.429 6 23.203 6 22v-2.08C8.133 21.795 11.779 23 16 23s7.868-1.21 10-3.08V22c0 1.203-.985 2.429-2.701 3.365"})})};g.forwardRef(N8);const B8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 12a2 2 0 0 0-2-2h-4V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v16a1 1 0 0 0 1.625.777L9 19.25V23a2 2 0 0 0 2 2h11.699l4.676 3.778A1 1 0 0 0 29 28zm-5.319 11.223a1 1 0 0 0-.625-.223H11v-4h10a2 2 0 0 0 2-2v-5h4v13.906z"})})};g.forwardRef(B8);const F8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-13.561 1.061a1.5 1.5 0 0 0 2.125 0l5-5a1.502 1.502 0 1 0-2.125-2.125L17.5 15.375V5a1.5 1.5 0 1 0-3 0v10.375l-2.439-2.436a1.502 1.502 0 1 0-2.125 2.125z"})})};g.forwardRef(F8);const V8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M13.5 7.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0m7 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4m-9 4.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4m-9 8.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})},_8=g.forwardRef(V8),z8=_8,H8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 4H11a1 1 0 0 0-1 1v5H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-5h5a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1m-1 16h-4v-9a1 1 0 0 0-1-1h-9V6h14z"})})};g.forwardRef(H8);const P8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m11 13c.001 1.411-.27 2.81-.8 4.118l-5.587-3.437a2 2 0 0 0-.78-.279l-2.853-.385a2.01 2.01 0 0 0-2 .983h-1.09l-.475-.983a1.99 1.99 0 0 0-1.375-1.083l-1-.216.978-1.718h2.088c.338 0 .67-.087.966-.25l1.532-.845q.202-.113.375-.268l3.364-3.042a1.99 1.99 0 0 0 .407-2.458l-.045-.08A11.01 11.01 0 0 1 27 16M5 16a10.94 10.94 0 0 1 1.068-4.725l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99a2.01 2.01 0 0 0 1.8 1.125h.186l-.904 2.029a2 2 0 0 0 .357 2.171l.018.018L16 25.742l-.242 1.25A11.014 11.014 0 0 1 5 16"})})},W8=g.forwardRef(P8),q8=W8,U8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:[u.jsx("path",{d:"M20.689 3.88A13 13 0 0 0 16 3a13 13 0 0 0-8.155 23.124l1.02-1.765A11 11 0 0 1 5 16a10.94 10.94 0 0 1 1.068-4.724l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99q.113.226.275.418l1.169-2.025-.121-.25a1.99 1.99 0 0 0-1.375-1.084l-1-.217.978-1.717h2.088c.338 0 .67-.087.966-.25l.726-.4z"}),u.jsx("path",{fillRule:"evenodd",d:"m24 2.144 1.732 1-1.58 2.736q.54.435 1.036.932A13.01 13.01 0 0 1 29 16a13 13 0 0 1-17.69 12.124l-1.578 2.732-1.732-1zm-.86 5.49-4.936 8.549 1.628.22c.277.037.543.132.78.278l5.588 3.436c.53-1.308.801-2.706.8-4.117a11.01 11.01 0 0 0-3.86-8.367M13.92 23.6l-1.593 2.76a11 11 0 0 0 3.43.631l.242-1.25z",clipRule:"evenodd"})]})};g.forwardRef(U8);const K8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10.365 7.5C20.579 21.724 18.441 23 16 23s-4.579-1.275-5.865-3.5a1.001 1.001 0 0 1 1.477-1.31q.157.129.253.31C12.799 20.114 14.266 21 16 21s3.201-.887 4.135-2.5a1 1 0 1 1 1.73 1M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(K8);const G8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10 10.865a1 1 0 0 1-1.365-.365C19.201 20.886 17.734 20 16 20s-3.201.887-4.135 2.5a1.001 1.001 0 1 1-1.73-1C11.421 19.276 13.559 18 16 18s4.579 1.275 5.865 3.5a1 1 0 0 1-.365 1.365M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(G8);const Y8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.5 6v5a1.5 1.5 0 1 1-3 0V7.5H21a1.5 1.5 0 0 1 0-3h5A1.5 1.5 0 0 1 27.5 6M11 24.5H7.5V21a1.5 1.5 0 0 0-3 0v5A1.5 1.5 0 0 0 6 27.5h5a1.5 1.5 0 1 0 0-3m15-5a1.5 1.5 0 0 0-1.5 1.5v3.5H21a1.5 1.5 0 1 0 0 3h5a1.5 1.5 0 0 0 1.5-1.5v-5a1.5 1.5 0 0 0-1.5-1.5m-15-15H6A1.5 1.5 0 0 0 4.5 6v5a1.5 1.5 0 0 0 3 0V7.5H11a1.5 1.5 0 0 0 0-3"})})};g.forwardRef(Y8);const X8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 13a1.5 1.5 0 1 1-3 0V8.625l-7.439 7.439a1.503 1.503 0 1 1-2.125-2.125L23.375 6.5H19a1.5 1.5 0 0 1 0-3h8A1.5 1.5 0 0 1 28.5 5zM23 16a1.5 1.5 0 0 0-1.5 1.5v8h-15v-15h8a1.5 1.5 0 1 0 0-3H6A2.5 2.5 0 0 0 3.5 10v16A2.5 2.5 0 0 0 6 28.5h16a2.5 2.5 0 0 0 2.5-2.5v-8.5A1.5 1.5 0 0 0 23 16"})})},Q8=g.forwardRef(X8),Z8=Q8,J8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.914 15.595c-.044-.099-1.103-2.447-3.457-4.801C24.322 7.657 20.36 6 16 6S7.679 7.657 4.542 10.794C2.19 13.148 1.125 15.5 1.086 15.595a1 1 0 0 0 0 .812c.044.1 1.103 2.447 3.456 4.8C7.68 24.344 11.64 26 16 26s8.321-1.657 11.458-4.792c2.353-2.354 3.412-4.702 3.456-4.8a1 1 0 0 0 0-.813M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10"})})},e7=g.forwardRef(J8),m2=e7,t7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M6.74 4.328a1 1 0 1 0-1.48 1.345l2.405 2.646c-4.54 2.786-6.493 7.081-6.579 7.276a1 1 0 0 0 0 .813c.044.098 1.103 2.446 3.456 4.8C7.68 24.343 11.64 26 16 26c2.24.013 4.459-.448 6.509-1.354l2.75 3.027a1 1 0 1 0 1.48-1.345zm11.125 15.21a4 4 0 0 1-5.209-5.73zm13.049-3.13c-.053.117-1.319 2.92-4.17 5.475a1 1 0 0 1-1.408-.072L12.675 7.884a1 1 0 0 1 .575-1.66A17 17 0 0 1 16 6c4.36 0 8.321 1.658 11.458 4.794 2.353 2.354 3.412 4.702 3.456 4.801a1 1 0 0 1 0 .813"})})},n7=g.forwardRef(t7),r7=n7,o7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17 15v12a1 1 0 0 1-2 0V15a1 1 0 0 1 2 0m8 9a1 1 0 0 0-1 1v2a1 1 0 0 0 2 0v-2a1 1 0 0 0-1-1m3-6h-2V5a1 1 0 0 0-2 0v13h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1M7 20a1 1 0 0 0-1 1v6a1 1 0 1 0 2 0v-6a1 1 0 0 0-1-1m3-6H8V5a1 1 0 0 0-2 0v9H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1m9-6h-2V5a1 1 0 0 0-2 0v3h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1"})})};g.forwardRef(o7);const i7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.48 16.851-7.474 7.559a1.97 1.97 0 0 1-1.4.585H9.415l-3.707 3.712a1.001 1.001 0 0 1-1.415-1.415l2.823-2.822L15.588 16h10.537a.5.5 0 0 1 .355.851m.607-13.03a8 8 0 0 0-10.737.518l-1.2 1.185a.5.5 0 0 0-.15.351v7.875l6.875-6.875a1 1 0 0 1 1.414 1.414L17.589 14h11.047a.5.5 0 0 0 .445-.27 8.01 8.01 0 0 0-1.994-9.909M7.854 20.904 13 15.758V8.845a.5.5 0 0 0-.851-.355L7.586 13A1.99 1.99 0 0 0 7 14.414v6.136a.5.5 0 0 0 .854.354"})})},s7=g.forwardRef(i7),a7=s7,l7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707M19 11V5.5l5.5 5.5z"})})};g.forwardRef(l7);const c7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m213.66 82.34-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44ZM48 180c0 11 7.18 20 16 20a14.18 14.18 0 0 0 10.06-4.5 8.21 8.21 0 0 1 10.9-.91 8 8 0 0 1 .82 11.81A30.06 30.06 0 0 1 64 216c-17.64 0-32-16.15-32-36s14.36-36 32-36a30 30 0 0 1 21.39 9.19 8.26 8.26 0 0 1 .73 11.09 8 8 0 0 1-11.9.38A14.17 14.17 0 0 0 64 160c-8.82 0-16 9-16 20m103.81 16.31a20.82 20.82 0 0 1-9.19 15.23C137.43 215 131 216 125.13 216a61.1 61.1 0 0 1-15.13-2 8 8 0 1 1 4.3-15.41c4.38 1.2 14.95 2.7 19.55-.36.88-.59 1.83-1.52 2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56 20.56 0 0 1 9-14.95c11.84-8 30.71-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54 4.54 0 0 0-2 3.67c-.12.9-.14 1.09 1.11 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.79 2.83 26.35 7.66 24.11 24.97M215.42 155l-19.89 55.68a8 8 0 0 1-15.06 0L160.58 155a8.21 8.21 0 0 1 4.5-10.45 8 8 0 0 1 10.45 4.76l12.47 34.9 12.47-34.9a8 8 0 0 1 10.45-4.76 8.23 8.23 0 0 1 4.5 10.45"})})};g.forwardRef(c7);const d7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707m-7 11a1 1 0 0 1-1.415 1.415L16 20.414l-2.293 2.293a1 1 0 0 1-1.415-1.415L14.587 19l-2.293-2.293a1 1 0 1 1 1.415-1.415L16 17.587l2.293-2.293a1 1 0 0 1 1.415 1.415L17.414 19zM19 11V5.5l5.5 5.5z"})})};g.forwardRef(d7);const u7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M6 15h20a1 1 0 0 0 1-1v-3a1 1 0 0 0-.293-.707l-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v9a1 1 0 0 0 1 1m13-9.5 5.5 5.5H19zM28 19a1 1 0 0 1-1 1h-3v2h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1M8 18H6a1 1 0 0 0-1 1v7a1 1 0 1 0 2 0v-1h1a3.5 3.5 0 1 0 0-7m0 5H7v-3h1a1.5 1.5 0 1 1 0 3m8-5h-2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h2a4.5 4.5 0 1 0 0-9m0 7h-1v-5h1a2.5 2.5 0 0 1 0 5"})})};g.forwardRef(u7);const h7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M44 120h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4m108-76 44 44h-44Zm4 164.53a8.18 8.18 0 0 1-8.25 7.47H120a8 8 0 0 1-8-8v-55.73a8.18 8.18 0 0 1 7.47-8.25 8 8 0 0 1 8.53 8v48h20a8 8 0 0 1 8 8.51m-61.49-51.88L77.83 180l16.68 23.35a8 8 0 0 1-13 9.3L68 193.76l-13.49 18.89a8 8 0 1 1-13-9.3L58.17 180l-16.68-23.35a8 8 0 0 1 2.3-11.46 8.19 8.19 0 0 1 10.88 2.38L68 166.24l13.49-18.89a8 8 0 0 1 13 9.3Zm121.28 39.66a20.81 20.81 0 0 1-9.18 15.23c-5.19 3.46-11.67 4.46-17.49 4.46a60.6 60.6 0 0 1-15.19-2 8 8 0 0 1 4.31-15.41c4.38 1.21 14.94 2.71 19.54-.35.89-.6 1.84-1.52 2.15-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58 20.58 0 0 1 8.95-14.94c11.84-8 30.72-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.48-1.17-15.22-2.56-19.82.56a4.54 4.54 0 0 0-2 3.67c-.11.9-.13 1.08 1.12 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.87 2.82 26.39 7.65 24.18 24.96"})})};g.forwardRef(h7);const f7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M184 144h-16a8 8 0 0 0-8 8v55.73a8.17 8.17 0 0 0 7.47 8.25 8 8 0 0 0 8.53-8v-8h7.4c15.24 0 28.14-11.92 28.59-27.15A28 28 0 0 0 184 144m-.35 40H176v-24h8a12 12 0 0 1 12 13.16A12.25 12.25 0 0 1 183.65 184M136 152v55.73a8.17 8.17 0 0 1-7.47 8.25 8 8 0 0 1-8.53-8v-55.71a8.17 8.17 0 0 1 7.47-8.25A8 8 0 0 1 136 152m-40 56.53a8.17 8.17 0 0 1-8.27 7.47h-31.5a8.27 8.27 0 0 1-6-2.5 8 8 0 0 1-1.18-9.5l25.16-44H56.27a8.17 8.17 0 0 1-8.27-7.47 8 8 0 0 1 8-8.53h31.77a8.27 8.27 0 0 1 6 2.5A8 8 0 0 1 95 156l-25.21 44H88a8 8 0 0 1 8 8.53M213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44Z"})})};g.forwardRef(f7);const m7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m13.687 4.146-2.5-2.5a.5.5 0 0 0-.354-.146h-5a1 1 0 0 0-1 1v1h-1a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-1h1a1 1 0 0 0 1-1v-7a.5.5 0 0 0-.146-.354M8.833 12h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1m0-2h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1m4 1.5h-1v-5a.5.5 0 0 0-.146-.354l-2.5-2.5a.5.5 0 0 0-.354-.146h-3v-1h4.793l2.207 2.207z"})})};g.forwardRef(m7);const g7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 16a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M29 8.5H3a1.5 1.5 0 0 0 0 3h26a1.5 1.5 0 1 0 0-3m-10 12h-6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(g7);const p7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 9H16.414L13 5.586A1.98 1.98 0 0 0 11.586 5H5a2 2 0 0 0-2 2v18.078A1.926 1.926 0 0 0 4.924 27H27.11A1.89 1.89 0 0 0 29 25.111V11a2 2 0 0 0-2-2M5 7h6.586l2 2H5z"})})};g.forwardRef(p7);const b7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 9h-4.385q.075-.06.146-.125A3.7 3.7 0 0 0 24 6.196 4.08 4.08 0 0 0 19.805 2a3.7 3.7 0 0 0-2.68 1.239A6.9 6.9 0 0 0 16 5.049a6.9 6.9 0 0 0-1.125-1.81A3.7 3.7 0 0 0 12.195 2 4.08 4.08 0 0 0 8 6.196a3.7 3.7 0 0 0 1.239 2.679q.072.06.146.125H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2v8a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V15H5v-4h10v4h2v-4h10v4H17v11.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-8a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2M10.564 7.375A1.7 1.7 0 0 1 10 6.125 2.076 2.076 0 0 1 12.074 4h.061a1.71 1.71 0 0 1 1.25.563c1.049 1.185 1.419 3.15 1.549 4.365-1.22-.13-3.184-.5-4.37-1.553m10.875 0c-1.186 1.05-3.155 1.42-4.375 1.55.148-1.314.561-3.237 1.561-4.361A1.7 1.7 0 0 1 19.875 4h.061A2.077 2.077 0 0 1 22 6.135a1.7 1.7 0 0 1-.564 1.24z"})})};g.forwardRef(b7);const v7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m9.796 8h-4.428a17.8 17.8 0 0 0-2.533-5.625A11.05 11.05 0 0 1 25.796 11M16 5.014c1.5 1.625 2.625 3.693 3.296 5.986h-6.592C13.375 8.707 14.5 6.641 16 5.014M12 16c0-1.005.084-2.009.25-3h7.5a18.2 18.2 0 0 1 0 6h-7.5a18 18 0 0 1-.25-3m.704 5h6.592c-.671 2.293-1.796 4.359-3.296 5.986-1.5-1.627-2.625-3.693-3.296-5.986m6.131 5.625A17.8 17.8 0 0 0 21.367 21h4.43a11.05 11.05 0 0 1-6.962 5.625M21.776 19a20.2 20.2 0 0 0 0-6h4.808a11 11 0 0 1 0 6z"})})};g.forwardRef(v7);const x7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M13 9.5c-.357 0-.71.085-1.028.25l-1.337-1.04a2.2 2.2 0 0 0 .116-.67l.646-.214a2.25 2.25 0 1 0-.636-1.37l-.487.162A2.25 2.25 0 0 0 8.5 5.75c-.062 0-.117 0-.175.008l-.278-.625A2.25 2.25 0 1 0 6.5 5.75c.063 0 .118 0 .176-.008l.278.625a2.24 2.24 0 0 0-.537 2.482l-1.33 1.182a2.25 2.25 0 1 0 .997 1.12l1.33-1.182a2.25 2.25 0 0 0 2.3-.075l1.224.954A2.25 2.25 0 1 0 13.001 9.5m0-4A.75.75 0 1 1 13 7a.75.75 0 0 1 0-1.5m-7.25-2a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0M4 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5M7.75 8a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0M13 12.5a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5"})})};g.forwardRef(x7);const w7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M13.29 28.226 6.765 24.46a2.822 2.822 0 1 1-2.708-4.693v-7.532a2.824 2.824 0 1 1 2.708-4.693l6.525-3.767a2.824 2.824 0 1 1 5.42 0l6.524 3.766a2.822 2.822 0 1 1 2.71 4.693v7.533a2.824 2.824 0 1 1-2.71 4.694l-6.524 3.766A2.825 2.825 0 0 1 16 31.84a2.822 2.822 0 0 1-2.71-3.614M16 5.806q.413-.002.791-.113l8.531 14.776a2.8 2.8 0 0 0-.791 1.37H7.467a2.8 2.8 0 0 0-.79-1.369L15.21 5.693q.377.11.791.112M7.468 23.178l-.033.12 6.526 3.767A2.81 2.81 0 0 1 16 26.195c.802 0 1.526.334 2.04.871l6.523-3.766-.032-.121zM5.397 12.233a2.824 2.824 0 0 0 2.038-3.532l6.526-3.767q.043.045.088.088L5.517 19.8l-.12-.032zM26.482 19.8q.06-.018.121-.033v-7.532a2.824 2.824 0 0 1-2.04-3.534L18.04 4.934q-.045.045-.089.088z",clipRule:"evenodd"})})};g.forwardRef(w7);const y7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 7v7.5a.5.5 0 0 1-.5.5H17V5.5a.5.5 0 0 1 .5-.5H25a2 2 0 0 1 2 2M14.5 5H7a2 2 0 0 0-2 2v7.5a.5.5 0 0 0 .5.5H15V5.5a.5.5 0 0 0-.5-.5m12 12H17v9.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-7.5a.5.5 0 0 0-.5-.5M5 17.5V25a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V17H5.5a.5.5 0 0 0-.5.5"})})};g.forwardRef(y7);const C7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10.5 6.5v5h-7A.5.5 0 0 1 3 11V8a2 2 0 0 1 2-2h5a.5.5 0 0 1 .5.5m2 19a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5v-5h-7zM3 21v3a2 2 0 0 0 2 2h5a.5.5 0 0 0 .5-.5v-5h-7a.5.5 0 0 0-.5.5m0-7v4a.5.5 0 0 0 .5.5h7v-5h-7a.5.5 0 0 0-.5.5m16-8h-6a.5.5 0 0 0-.5.5v5h7v-5A.5.5 0 0 0 19 6m9.5 7.5h-7v5h7a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-.5-.5m-16 5h7v-5h-7zM27 6h-5a.5.5 0 0 0-.5.5v5h7a.5.5 0 0 0 .5-.5V8a2 2 0 0 0-2-2m1.5 14.5h-7v5a.5.5 0 0 0 .5.5h5a2 2 0 0 0 2-2v-3a.5.5 0 0 0-.5-.5"})})};g.forwardRef(C7);const $7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.791 17.633a3.04 3.04 0 0 0-2.326-.597C28.813 14.666 30 12.31 30 10c0-3.309-2.661-6-5.933-6A5.95 5.95 0 0 0 19.5 6.094 5.95 5.95 0 0 0 14.932 4C11.663 4 9 6.691 9 10c0 1.375.405 2.711 1.258 4.125a4 4 0 0 0-1.844 1.05L5.586 18H2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h13q.123 0 .242-.03l8-2a1 1 0 0 0 .15-.05l4.858-2.067.055-.025a3.074 3.074 0 0 0 .491-5.195zm-1.362 3.393-4.75 2.023L14.875 25H7v-5.586l2.829-2.828A1.98 1.98 0 0 1 11.242 16H17.5a1.5 1.5 0 0 1 0 3H14a1 1 0 0 0 0 2h4q.113 0 .224-.025l8.375-1.926.038-.01a1.075 1.075 0 0 1 .788 1.987z"})})};g.forwardRef($7);const S7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 10.5h-5.475l.951-5.231a1.5 1.5 0 1 0-2.952-.538L19.475 10.5h-4.95l.951-5.231a1.5 1.5 0 1 0-2.952-.538L11.475 10.5H6a1.5 1.5 0 0 0 0 3h4.93l-.909 5H4a1.5 1.5 0 0 0 0 3h5.475l-.951 5.231a1.5 1.5 0 0 0 1.207 1.75q.134.022.269.019a1.5 1.5 0 0 0 1.475-1.233l1.05-5.767h4.95l-.951 5.231a1.5 1.5 0 1 0 2.952.543l1.049-5.774H26a1.5 1.5 0 1 0 0-3h-4.93l.909-5H28a1.5 1.5 0 1 0 0-3m-9.979 8H13.07l.909-5h4.951z"})})};g.forwardRef(S7);const A7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31.5 22.5a5 5 0 0 1-5 5 4.94 4.94 0 0 1-3.571-1.45 1.5 1.5 0 0 1 2.142-2.1 1.94 1.94 0 0 0 1.429.55 2 2 0 0 0 0-4 1.94 1.94 0 0 0-1.429.55 1.5 1.5 0 0 1-2.551-1.3l1-6A1.5 1.5 0 0 1 25 12.5h5a1.5 1.5 0 1 1 0 3h-3.729l-.338 2.029q.283-.03.567-.029a5 5 0 0 1 5 5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(A7);const k7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M32 22a1.5 1.5 0 0 1-1.5 1.5V26a1.5 1.5 0 1 1-3 0v-2.5H23a1.5 1.5 0 0 1-1.422-1.974l3-9a1.5 1.5 0 0 1 2.845.948L25.08 20.5H27.5V18a1.5 1.5 0 1 1 3 0v2.5A1.5 1.5 0 0 1 32 22M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(k7);const T7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.5 14v12a1.5 1.5 0 1 1-3 0v-9.198l-.668.448a1.503 1.503 0 0 1-1.665-2.5l3-2A1.5 1.5 0 0 1 29.5 14M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(T7);const R7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m27.133 17.541 1.655-2.772a1.5 1.5 0 1 0-2.576-1.538l-4.03 6.75q-.018.029-.032.059a5 5 0 1 0 4.983-2.5zM26.5 24.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0"})})};g.forwardRef(R7);const M7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31.5 22.5a5 5 0 0 1-8.571 3.5 1.5 1.5 0 1 1 2.142-2.099A2 2 0 1 0 26.5 20.5a1.5 1.5 0 0 1-1.229-2.36l1.854-2.64H24a1.5 1.5 0 1 1 0-3h6a1.5 1.5 0 0 1 1.229 2.36l-2.293 3.275A5 5 0 0 1 31.5 22.5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(M7);const E7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0M30 24.5h-3l3.593-4.791a4.499 4.499 0 1 0-7.837-4.209 1.5 1.5 0 1 0 2.829 1q.076-.218.216-.402a1.5 1.5 0 1 1 2.394 1.807L22.8 25.1a1.5 1.5 0 0 0 1.2 2.4h6a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(E7);const I7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 17v7a3 3 0 0 1-3 3h-2a3 3 0 0 1-3-3v-5a3 3 0 0 1 3-3h2.956A10.964 10.964 0 0 0 16.081 6H16A11 11 0 0 0 5.045 16H8a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a13.014 13.014 0 0 1 22.236-9.167A12.93 12.93 0 0 1 29 17"})})};g.forwardRef(I7);const j7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 11.75c0 8.75-12.974 15.833-13.526 16.125a1 1 0 0 1-.948 0C14.974 27.582 2 20.5 2 11.75A7.76 7.76 0 0 1 9.75 4c2.581 0 4.841 1.11 6.25 2.986C17.409 5.11 19.669 4 22.25 4A7.76 7.76 0 0 1 30 11.75"})})};g.forwardRef(j7);const D7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 14.444V26a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V14.444a2 2 0 0 1 .646-1.473l10-9.435.014-.013a2 2 0 0 1 2.705.013l10 9.435A2 2 0 0 1 28 14.444"})})};g.forwardRef(D7);const O7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-7.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M5 25v-3.5l6.5-6.5 10 10zm22 0h-2.671l-4.5-4.5 2.5-2.5L27 22.672z"})})};g.forwardRef(O7);const L7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H9a2 2 0 0 0-2 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-2h2a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M23 25H5V11h2v10a2 2 0 0 0 2 2h14zm4-4H9v-4.5l4.5-4.5 6.208 6.208a1 1 0 0 0 1.413 0L24.33 15 27 17.672z"})})};g.forwardRef(L7);const N7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 0 0 0-3m-18-4a1.5 1.5 0 0 0 1.061-2.561L6.125 12l3.936-3.94a1.503 1.503 0 1 0-2.125-2.125l-5 5a1.5 1.5 0 0 0 0 2.125l5 5A1.5 1.5 0 0 0 9 18.5"})})};g.forwardRef(N7);const B7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 0 0 0 3h22a1.5 1.5 0 1 0 0-3M3.939 18.06a1.5 1.5 0 0 0 2.125 0l5-5a1.5 1.5 0 0 0 0-2.125l-5-5a1.503 1.503 0 0 0-2.125 2.125L7.875 12l-3.936 3.939a1.5 1.5 0 0 0 0 2.122"})})};g.forwardRef(B7);const F7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M17 23a2 2 0 0 1-2-2v-5a1 1 0 0 1 0-2 2 2 0 0 1 2 2v5a1 1 0 0 1 0 2"})})},V7=g.forwardRef(F7),g2=V7,_7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 7A1.5 1.5 0 0 1 24 8.5h-3.919l-5 15H18a1.5 1.5 0 1 1 0 3H8a1.5 1.5 0 1 1 0-3h3.919l5-15H14a1.5 1.5 0 0 1 0-3h10A1.5 1.5 0 0 1 25.5 7"})})};g.forwardRef(_7);const z7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20 2a10.01 10.01 0 0 0-9.511 13.098l-7.196 7.195A1 1 0 0 0 3 23v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 .707-.293l1.195-1.196A10 10 0 1 0 20 2m2.5 9.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4"})})};g.forwardRef(z7);const H7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M5 7h22v5H5zm22 18H14V14h13z"})})};g.forwardRef(H7);const P7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22 29a1 1 0 0 1-1 1H11a1 1 0 1 1 0-2h10a1 1 0 0 1 1 1m5-16a10.94 10.94 0 0 1-4.205 8.651A2.03 2.03 0 0 0 22 23.25V24a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-.75a2 2 0 0 0-.779-1.582A10.95 10.95 0 0 1 5 13.06C4.967 7.104 9.782 2.143 15.735 2A11 11 0 0 1 27 13m-4.014-1.168a7.2 7.2 0 0 0-5.82-5.818 1 1 0 1 0-.332 1.972c2.071.349 3.829 2.106 4.18 4.182a1 1 0 0 0 1.972-.335"})})};g.forwardRef(P7);const W7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m21.731 14.683-14 15a1 1 0 0 1-1.711-.875l1.832-9.167L.65 16.936a1 1 0 0 1-.375-1.625l14-15a1 1 0 0 1 1.71.875l-1.837 9.177 7.204 2.7a1 1 0 0 1 .375 1.62z"})})};g.forwardRef(W7);const q7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17.046 23.441a1.5 1.5 0 0 1 0 2.125l-.742.743a7.502 7.502 0 1 1-10.61-10.61l3.015-3.014A7.5 7.5 0 0 1 19 12.375a1.506 1.506 0 0 1-2 2.25 4.5 4.5 0 0 0-6.171.184l-3.013 3.01a4.5 4.5 0 0 0 6.365 6.365l.743-.743a1.5 1.5 0 0 1 2.122 0m9.26-17.75a7.51 7.51 0 0 0-10.61 0l-.742.743a1.503 1.503 0 1 0 2.125 2.125l.742-.743a4.5 4.5 0 0 1 6.365 6.365l-3.014 3.015a4.5 4.5 0 0 1-6.172.179 1.506 1.506 0 1 0-2 2.25 7.5 7.5 0 0 0 10.288-.304l3.014-3.014a7.51 7.51 0 0 0 .004-10.613z"})})},U7=g.forwardRef(q7),K7=U7,G7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M5 9.5h22a1.5 1.5 0 0 0 0-3H5a1.5 1.5 0 0 0 0 3m22 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(G7);const Y7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 17.5h22a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m13 5H5a1.5 1.5 0 1 0 0 3h13a1.5 1.5 0 1 0 0-3m11 0h-1.5V21a1.5 1.5 0 1 0-3 0v1.5H23a1.5 1.5 0 1 0 0 3h1.5V27a1.5 1.5 0 1 0 3 0v-1.5H29a1.5 1.5 0 1 0 0-3"})})},X7=g.forwardRef(Y7),Q7=X7,Z7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 64a12 12 0 0 1 12-12h176a12 12 0 0 1 0 24H40a12 12 0 0 1-12-12m12 76h64a12 12 0 0 0 0-24H40a12 12 0 0 0 0 24m80 40H40a12 12 0 0 0 0 24h80a12 12 0 0 0 0-24m120.49 20.49a12 12 0 0 1-17 0l-18.08-18.08a44 44 0 1 1 17-17l18.08 18.07a12 12 0 0 1 0 17.01M184 164a20 20 0 1 0-20-20 20 20 0 0 0 20 20"})})};g.forwardRef(Z7);const J7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17.5 4v4a1.5 1.5 0 1 1-3 0V4a1.5 1.5 0 1 1 3 0m4.156 7.844a1.5 1.5 0 0 0 1.062-.44l2.828-2.829a1.503 1.503 0 1 0-2.125-2.125l-2.825 2.833a1.5 1.5 0 0 0 1.06 2.56M28 14.5h-4a1.5 1.5 0 1 0 0 3h4a1.5 1.5 0 1 0 0-3m-5.282 6.096a1.501 1.501 0 0 0-2.451 1.638c.075.182.186.348.326.487l2.828 2.829a1.503 1.503 0 0 0 2.125-2.125zM16 22.5a1.5 1.5 0 0 0-1.5 1.5v4a1.5 1.5 0 1 0 3 0v-4a1.5 1.5 0 0 0-1.5-1.5m-6.717-1.904-2.83 2.829A1.503 1.503 0 0 0 8.58 25.55l2.829-2.829a1.503 1.503 0 0 0-2.125-2.125M9.5 16A1.5 1.5 0 0 0 8 14.5H4a1.5 1.5 0 1 0 0 3h4A1.5 1.5 0 0 0 9.5 16m-.925-9.546A1.503 1.503 0 0 0 6.45 8.579l2.833 2.825a1.503 1.503 0 0 0 2.125-2.125z"})})},eS=g.forwardRef(J7),p2=eS,tS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 10h-4V7a6 6 0 1 0-12 0v3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V12a2 2 0 0 0-2-2M16 20.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M20 10h-8V7a4 4 0 1 1 8 0z"})})};g.forwardRef(tS);const nS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31 19a1 1 0 0 1-1 1h-2v2a1 1 0 0 1-2 0v-2h-2a1 1 0 0 1 0-2h2v-2a1 1 0 1 1 2 0v2h2a1 1 0 0 1 1 1M7 9h2v2a1 1 0 1 0 2 0V9h2a1 1 0 0 0 0-2h-2V5a1 1 0 0 0-2 0v2H7a1 1 0 0 0 0 2m16 15h-1v-1a1 1 0 0 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 1 0 2 0v-1h1a1 1 0 0 0 0-2m4.414-14L10 27.414a2 2 0 0 1-2.828 0l-2.587-2.585a2 2 0 0 1 0-2.829L22 4.586a2 2 0 0 1 2.829 0l2.585 2.585a2 2 0 0 1 0 2.829M26 8.586 23.414 6l-4 4L22 12.586z"})})};g.forwardRef(nS);const rS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 6H4a1 1 0 0 0-1 1v17a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a1 1 0 0 0-1-1M12.339 16 5 22.726V9.274zm1.48 1.356 1.5 1.381a1 1 0 0 0 1.352 0l1.5-1.38L25.421 24H6.571zM19.66 16 27 9.273v13.455z"})})};g.forwardRef(rS);const oS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M11 7q0 .432-.088.838L16 10.382l5.088-2.544a4 4 0 1 1 .895 1.789L18.236 11.5l3.747 1.873a4 4 0 1 1 0 5.253L18.236 20.5l3.747 1.874a4 4 0 1 1-.895 1.788L16 21.618l-5.088 2.544Q11 24.567 11 25a4 4 0 1 1-.983-2.626l3.747-1.874-3.747-1.873a4 4 0 1 1 0-5.253l3.747-1.874-3.747-1.874A4 4 0 1 1 11 7M9 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m2.236 8h9.528L16 12.618zM9 25a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4M27 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4m2-11a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-11 3.382L20.764 17h-9.528z",clipRule:"evenodd"})})};g.forwardRef(oS);const iS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M14.8 8.254a4 4 0 1 0-1.082 1.682l7.483 4.81a4 4 0 0 0-.075.254H10.874A4.002 4.002 0 0 0 3 16a4 4 0 0 0 7.874 1h10.252q.033.128.075.254l-7.484 4.81a4 4 0 1 0 1.082 1.682l7.484-4.81a4 4 0 1 0 0-5.871zM11 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4M9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0m16 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};g.forwardRef(iS);const sS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M18.842 3.227a1 1 0 1 0-.445 1.95l1.747.399L9.6 12.959a4 4 0 1 0 0 6.081l10.546 7.385-1.748.399a1 1 0 1 0 .445 1.95l3.945-.9a1 1 0 0 0 .77-1.1l-.503-4.014a1 1 0 0 0-1.985.248l.223 1.779-10.545-7.384a4 4 0 0 0 .127-.403h14.712l-1.293 1.293a1 1 0 1 0 1.414 1.414l3-3a1 1 0 0 0 0-1.414l-3-3a1 1 0 0 0-1.414 1.414L25.586 15H10.874a4 4 0 0 0-.127-.403l10.544-7.383-.222 1.778a1 1 0 0 0 1.984.249l.503-4.015a1 1 0 0 0-.77-1.099zM9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0",clipRule:"evenodd"})})};g.forwardRef(sS);const aS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 6H5a2 2 0 0 0-2 2v20a1.98 1.98 0 0 0 1.156 1.813 1.986 1.986 0 0 0 2.141-.299L10.312 26H27a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2M10.5 17.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(aS);const lS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10 16V8a6 6 0 1 1 12 0v8a6 6 0 1 1-12 0m16 0a1 1 0 0 0-2 0 8 8 0 0 1-16 0 1 1 0 1 0-2 0 10.014 10.014 0 0 0 9 9.95V29a1 1 0 0 0 2 0v-3.05A10.014 10.014 0 0 0 26 16"})})};g.forwardRef(lS);const cS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5"})})},dS=g.forwardRef(cS),b2=dS,uS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5 14H11a1 1 0 0 1 0-2h10a1 1 0 0 1 0 2"})})};g.forwardRef(uS);const hS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 5H6a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h20a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3M20 27h-8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2"})})};g.forwardRef(hS);const fS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.443 18.776a13.1 13.1 0 0 1-4.626 6.614A13 13 0 0 1 4 15a12.9 12.9 0 0 1 2.61-7.815 13.1 13.1 0 0 1 6.614-4.625 1 1 0 0 1 1.25 1.25 11.01 11.01 0 0 0 13.725 13.725 1 1 0 0 1 1.25 1.25z"})})};g.forwardRef(fS);const mS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0M7.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m17 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})};g.forwardRef(mS);const gS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10.939 8.061a1.5 1.5 0 0 1 0-2.125l4-4a1.5 1.5 0 0 1 2.125 0l4 4a1.503 1.503 0 1 1-2.125 2.125L17.5 6.625V12a1.5 1.5 0 1 1-3 0V6.625l-1.439 1.436a1.5 1.5 0 0 1-2.122 0m8 15.875L17.5 25.375V20a1.5 1.5 0 1 0-3 0v5.375l-1.439-1.44a1.504 1.504 0 0 0-2.125 2.125l4 4a1.5 1.5 0 0 0 2.125 0l4-4a1.502 1.502 0 1 0-2.125-2.125zm11.125-9-4-4a1.503 1.503 0 0 0-2.125 2.125l1.436 1.439H20a1.5 1.5 0 0 0 0 3h5.375l-1.44 1.439a1.503 1.503 0 0 0 2.125 2.125l4-4a1.5 1.5 0 0 0 .001-2.125zM6.625 17.5H12a1.5 1.5 0 1 0 0-3H6.625l1.44-1.439a1.503 1.503 0 1 0-2.125-2.125l-4 4a1.5 1.5 0 0 0 0 2.125l4 4a1.503 1.503 0 0 0 2.125-2.125z"})})};g.forwardRef(gS);const pS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.615 3.214a.99.99 0 0 0-.857-.183l-16 4a1 1 0 0 0-.758.97v13.762a4.5 4.5 0 1 0 2 3.737V13.781l14-3.5v7.482a4.5 4.5 0 1 0 2 3.737V4a1 1 0 0 0-.385-.786"})})};g.forwardRef(pS);const bS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H14.5a1.5 1.5 0 1 1 0-3H27a1.5 1.5 0 0 1 1.5 1.5m-14-6.5H27a1.5 1.5 0 0 0 0-3H14.5a1.5 1.5 0 0 0 0 3m12.5 13H14.5a1.5 1.5 0 1 0 0 3H27a1.5 1.5 0 1 0 0-3M5.5 7.414V13a1.5 1.5 0 0 0 3 0V5a1.5 1.5 0 0 0-2.17-1.341l-2 1a1.5 1.5 0 0 0 1.17 2.75zm4.966 12.107a3.46 3.46 0 0 0-1.4-2.329 3.61 3.61 0 0 0-4.954.683 3.5 3.5 0 0 0-.52.942 1.5 1.5 0 0 0 2.818 1.027.5.5 0 0 1 .072-.125.6.6 0 0 1 .813-.103.48.48 0 0 1 .201.325.45.45 0 0 1-.096.347l-.016.02-3.585 4.794A1.5 1.5 0 0 0 5 27.5h4a1.5 1.5 0 1 0 0-3H8l1.785-2.389a3.43 3.43 0 0 0 .681-2.59"})})};g.forwardRef(bS);const vS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M17.2 8.254a4 4 0 1 1 1.082 1.682l-7.482 4.81q.04.125.074.254h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1H10.874q-.033.128-.075.254l7.484 4.81a4 4 0 1 1-1.082 1.682l-7.484-4.81a4 4 0 1 1 0-5.871zM21 9a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4m2-11a2 2 0 1 0 4 0 2 2 0 0 0-4 0M7 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4",clipRule:"evenodd"})})};g.forwardRef(vS);const xS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M10.874 17A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1zM7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m18 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};g.forwardRef(xS);const wS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M28.924 16.384c-.05.12-.124.231-.217.324l-4 4a1 1 0 0 1-1.632-.324 1 1 0 0 1 .217-1.09L25.585 17H10.875A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h14.712l-2.294-2.293a1 1 0 0 1 1.415-1.415l4 4a1 1 0 0 1 .217 1.09M7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};g.forwardRef(wS);const yS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 4a1 1 0 0 0-1-1c-5.51 0-11.164 6.214-14.304 10.329A7.5 7.5 0 0 0 4 20.5c0 3.86-2.443 5.591-2.559 5.671A1 1 0 0 0 2 28h9.5a7.5 7.5 0 0 0 7.171-9.696C22.788 15.164 29 9.51 29 4M15.553 14.194a48 48 0 0 1 1.26-1.569 9.5 9.5 0 0 1 2.562 2.561q-.738.618-1.569 1.262a7.6 7.6 0 0 0-2.254-2.254m5.337-.335a11.6 11.6 0 0 0-2.75-2.75c3.973-4.316 6.969-5.625 8.738-5.989-.357 1.77-1.672 4.766-5.988 8.739"})})};g.forwardRef(yS);const CS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31 13v6.25a2.01 2.01 0 0 1-1.45 1.922L17 24.75V29a1 1 0 0 1-2 0v-4.25a2.01 2.01 0 0 1 1.45-1.922L29 19.25V13h-2v3a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3H2a1 1 0 0 1 0-2h2V8a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v3h2a2 2 0 0 1 2 2"})})};g.forwardRef(CS);const $S=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.096 6.736A12.9 12.9 0 0 0 16 3h-.134A13 13 0 0 0 3 16c0 5.375 3.323 9.883 8.67 11.771A4 4 0 0 0 17 24a2 2 0 0 1 2-2h5.776a3.976 3.976 0 0 0 3.9-3.11c.224-.984.332-1.99.324-3a12.9 12.9 0 0 0-3.904-9.154M10.5 21a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5-3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef($S);const SS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.925 5.543v.018L21.65 29.554A1.985 1.985 0 0 1 19.728 31a1.98 1.98 0 0 1-1.803-1.144l-4.464-9.423a.5.5 0 0 1 .099-.568l7.158-7.159a1 1 0 0 0-1.414-1.413l-7.169 7.157a.5.5 0 0 1-.567.099l-9.376-4.441A2.05 2.05 0 0 1 1 12.17a1.99 1.99 0 0 1 1.446-1.815L26.44 3.08h.018a2 2 0 0 1 2.468 2.463"})})};g.forwardRef(SS);const AS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.56 17.061-10.257 10.25a7.501 7.501 0 0 1-10.607-10.61l12.27-12.236a5 5 0 0 1 7.07 7.074l-.021.02L13.04 23.086a1.503 1.503 0 0 1-2.121-.041 1.5 1.5 0 0 1 .041-2.121L22.924 9.409a2 2 0 1 0-2.838-2.82L7.816 18.82a4.5 4.5 0 1 0 6.366 6.364l10.258-10.25a1.503 1.503 0 0 1 2.125 2.125z"})})};g.forwardRef(AS);const kS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 14.5h16a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m22 2H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3m-6 5H5a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(kS);const TS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m28.414 9.171-5.585-5.586a2 2 0 0 0-2.829 0L4.586 19A1.98 1.98 0 0 0 4 20.414V26a2 2 0 0 0 2 2h5.586A1.98 1.98 0 0 0 13 27.414L28.414 12a2 2 0 0 0 0-2.829M24 13.585 18.414 8l3-3L27 10.585z"})})},RS=g.forwardRef(TS),ef=RS,MS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.985 21.885A7.03 7.03 0 0 1 22 28c-9.925 0-18-8.075-18-18a7.03 7.03 0 0 1 6.115-6.985 2 2 0 0 1 2.078 1.19l2.64 5.894v.015a2 2 0 0 1-.16 1.886 1 1 0 0 1-.07.096L12 15.181c.936 1.903 2.926 3.875 4.854 4.814l3.042-2.589q.045-.037.094-.07a2 2 0 0 1 1.896-.175l.017.008 5.888 2.639a2 2 0 0 1 1.194 2.077"})})};g.forwardRef(MS);const ES=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.416 13-6.683 6.706c.57 1.584.806 4.236-1.65 7.5a2 2 0 0 1-1.458.794h-.141a2 2 0 0 1-1.415-.586l-6.033-6.04-5.328 5.333a1 1 0 1 1-1.415-1.415l5.332-5.328-6.037-6.038a2 2 0 0 1 .162-2.972c3.178-2.564 6.219-2.06 7.55-1.643L19 2.587a2 2 0 0 1 2.829 0l7.586 7.585A2 2 0 0 1 29.416 13"})})};g.forwardRef(ES);const IS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 2A11.013 11.013 0 0 0 5 13c0 9.413 10 16.521 10.426 16.819a1 1 0 0 0 1.148 0C17 29.52 27 22.413 27 13A11.01 11.01 0 0 0 16 2m0 7a4 4 0 1 1 0 8 4 4 0 0 1 0-8"})})};g.forwardRef(IS);const jS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 17v4a1 1 0 0 1-1.196.98L19.5 20.125v2.966l2.207 2.206A1 1 0 0 1 22 26v3a1 1 0 0 1-1.375.929L16 28.078l-4.625 1.85A1 1 0 0 1 10 29v-3a1 1 0 0 1 .293-.707l2.207-2.207v-2.961L3.196 21.98A1 1 0 0 1 2 21v-4a1 1 0 0 1 .553-.895l9.947-4.972V5.5a3.5 3.5 0 1 1 7 0v5.633l9.948 4.972A1 1 0 0 1 30 17"})})};g.forwardRef(jS);const DS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.676 18.884a7.6 7.6 0 0 1-3.978 1.107 9 9 0 0 1-3.42-.707A6.94 6.94 0 0 0 17 23.314V27a1 1 0 0 1-1.066 1A1.023 1.023 0 0 1 15 26.969v-1.555l-4.828-4.828A6.6 6.6 0 0 1 7.93 21a5.73 5.73 0 0 1-2.99-.834C2.216 18.511.75 14.702 1.034 9.974a1 1 0 0 1 .94-.94c4.728-.28 8.537 1.182 10.187 3.906a5.75 5.75 0 0 1 .806 3.56.5.5 0 0 1-.86.304l-2.4-2.513a1 1 0 0 0-1.415 1.414l6.736 6.906q.01-.146.026-.291a8.57 8.57 0 0 1 2.33-4.933l6.323-6.682a1 1 0 0 0-1.413-1.415l-6.125 6.477a.5.5 0 0 1-.848-.217c-.592-2.185-.331-4.36.8-6.228 2.233-3.685 7.428-5.657 13.898-5.277a1 1 0 0 1 .94.94c.375 6.471-1.598 11.666-5.283 13.899"})})};g.forwardRef(DS);const OS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 16a1.97 1.97 0 0 1-.95 1.689L11.04 28.706a2 2 0 0 1-2.767-.688A2 2 0 0 1 8 27.016V4.984a1.98 1.98 0 0 1 1.015-1.728 2 2 0 0 1 2.025.038L29.05 14.31A1.97 1.97 0 0 1 30 16"})})},LS=g.forwardRef(OS),NS=LS,BS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-9.5V27a1.5 1.5 0 1 1-3 0v-9.5H5a1.5 1.5 0 1 1 0-3h9.5V5a1.5 1.5 0 1 1 3 0v9.5H27a1.5 1.5 0 0 1 1.5 1.5"})})},FS=g.forwardRef(BS),tf=FS,VS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.016 13.016 0 0 0 16 3m5 14h-4v4a1 1 0 0 1-2 0v-4h-4a1 1 0 0 1 0-2h4v-4a1 1 0 0 1 2 0v4h4a1 1 0 0 1 0 2"})})};g.forwardRef(VS);const _S=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H17V3a1 1 0 0 0-2 0v2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h4.92l-2.701 3.375a1 1 0 0 0 1.562 1.25L12.48 24h7.04l3.699 4.625a1 1 0 1 0 1.562-1.25L22.08 24H27a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 18a1 1 0 0 1-2 0v-3a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-5a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-7a1 1 0 0 1 2 0z"})})};g.forwardRef(_S);const zS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.414 17 18 4.586A1.98 1.98 0 0 0 16.586 4H5a1 1 0 0 0-1 1v11.586A1.98 1.98 0 0 0 4.586 18L17 30.414a2 2 0 0 0 2.829 0l10.585-10.585a2 2 0 0 0 0-2.829M10.5 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})},HS=g.forwardRef(zS),PS=HS,WS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20.723 28H26a2 2 0 0 0 2-2v-4.706a1 1 0 0 0-1.383-.919 2.9 2.9 0 0 1-1.117.221c-1.654 0-3-1.387-3-3.091s1.346-3.091 3-3.091c.383 0 .763.075 1.117.221A1 1 0 0 0 28 13.706V9a2 2 0 0 0-2-2h-4.527a4.5 4.5 0 1 0-8.945 0H8a2 2 0 0 0-2 2v4.028a4.5 4.5 0 1 0 0 8.945V26a2 2 0 0 0 2 2h5.278"})})};g.forwardRef(WS);const qS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18 22.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0M29.5 16A13.5 13.5 0 1 1 16 2.5 13.515 13.515 0 0 1 29.5 16m-3 0A10.5 10.5 0 1 0 16 26.5 10.51 10.51 0 0 0 26.5 16M16 8c-3.033 0-5.5 2.242-5.5 5v.5a1.5 1.5 0 1 0 3 0V13c0-1.102 1.125-2 2.5-2s2.5.898 2.5 2-1.125 2-2.5 2a1.5 1.5 0 0 0-1.5 1.5v1a1.5 1.5 0 0 0 2.966.32C19.79 17.235 21.5 15.296 21.5 13c0-2.758-2.468-5-5.5-5"})})};g.forwardRef(qS);const US=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.5 9v11a6.006 6.006 0 0 1-6 6 1 1 0 0 1 0-2 4 4 0 0 0 4-4v-1H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h7.5a2 2 0 0 1 2 2M27 7h-7.5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2H27v1a4 4 0 0 1-4 4 1 1 0 0 0 0 2 6.006 6.006 0 0 0 6-6V9a2 2 0 0 0-2-2"})})};g.forwardRef(US);const KS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5v23a1 1 0 0 1-2 0v-6h-6a1 1 0 0 1-1-1c.046-2.395.349-4.779.902-7.11 1.223-5.061 3.54-8.454 6.704-9.809a1 1 0 0 1 1.394.92m-12.014-.164a.999.999 0 1 0-1.972.33L13.986 11H11V5a1 1 0 0 0-2 0v6H6.014l.972-5.835a1 1 0 1 0-1.972-.329l-1 6A1 1 0 0 0 4 11a6.01 6.01 0 0 0 5 5.915V28a1 1 0 1 0 2 0V16.915A6.01 6.01 0 0 0 16 11q0-.083-.014-.164z"})})};g.forwardRef(KS);const GS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19 28a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m8.953-8.521-1.546 6.954a2 2 0 0 1-3.188 1.138l-3.405-2.57h-7.625L8.78 27.57a2 2 0 0 1-3.189-1.138l-1.545-6.954a2.01 2.01 0 0 1 .415-1.714l3.57-4.282c.12-1.574.482-3.12 1.072-4.584 1.612-4.043 4.5-6.579 5.671-7.481a2 2 0 0 1 2.45 0c1.167.902 4.059 3.438 5.671 7.48.59 1.465.952 3.01 1.072 4.585l3.57 4.282a2.01 2.01 0 0 1 .415 1.714m-17.404 4.25q-2.014-3.666-2.445-7.209L6 19.045 7.545 26l.022-.016zM17.5 12.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m8.5 6.545-2.104-2.525q-.428 3.535-2.445 7.211l2.982 2.25.022.017z"})})};g.forwardRef(GS);const YS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.716 14.141a1 1 0 0 1 .261-1.391l8.458-5.788a1 1 0 0 1 1.125 1.652L21.101 14.4a1 1 0 0 1-1.39-.261zm10.109 10.634a1 1 0 0 1-1.39.261L17 17.211l-5.315 3.636a4.5 4.5 0 1 1-1.125-1.65L15.229 16l-4.673-3.198a4.5 4.5 0 1 1 1.125-1.65l17.875 12.233a1 1 0 0 1 .269 1.39M9 22.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m0-13a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"})})};g.forwardRef(YS);const XS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M225.86 102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28 23.51 138.44 16 128 16s-18.27 7.51-25.18 14.14c-3.94 3.77-8 7.67-11.57 9.14-3.25 1.36-8.69 1.44-13.94 1.52-9.76.15-20.82.31-28.51 8s-7.8 18.75-8 28.51c-.08 5.25-.16 10.67-1.52 13.94-1.47 3.56-5.37 7.63-9.14 11.57C23.51 109.72 16 117.56 16 128s7.51 18.27 14.14 25.18c3.77 3.94 7.67 8 9.14 11.57 1.36 3.27 1.44 8.69 1.52 13.94.15 9.76.31 20.82 8 28.51s18.75 7.85 28.51 8c5.25.08 10.67.16 13.94 1.52 3.56 1.47 7.63 5.37 11.57 9.14 6.9 6.63 14.74 14.14 25.18 14.14s18.27-7.51 25.18-14.14c3.94-3.77 8-7.67 11.57-9.14 3.27-1.36 8.69-1.44 13.94-1.52 9.76-.15 20.82-.31 28.51-8s7.85-18.75 8-28.51c.08-5.25.16-10.67 1.52-13.94 1.47-3.56 5.37-7.63 9.14-11.57 6.63-6.9 14.14-14.74 14.14-25.18s-7.51-18.27-14.14-25.18m-52.2 6.84-56 56a8 8 0 0 1-11.32 0l-24-24a8 8 0 0 1 11.32-11.32L112 148.69l50.34-50.35a8 8 0 0 1 11.32 11.32"})})};g.forwardRef(XS);const QS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.061 26.939 23.125 21A11.515 11.515 0 1 0 21 23.125l5.941 5.942a1.503 1.503 0 0 0 2.125-2.125zM5.5 14a8.5 8.5 0 1 1 8.5 8.5A8.51 8.51 0 0 1 5.5 14"})})},ZS=g.forwardRef(QS),v2=ZS,JS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 5H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M26 17H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(JS);const e9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 7v7.346c0 11.202-9.477 14.918-11.375 15.549a1.94 1.94 0 0 1-1.25 0C13.475 29.264 4 25.548 4 14.346V7a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2"})})};g.forwardRef(e9);const t9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m30.949 7.653-6.47-3.528A1 1 0 0 0 24 4h-4a1 1 0 0 0-1 1 3 3 0 0 1-6 0 1 1 0 0 0-1-1H8a1 1 0 0 0-.48.125L1.051 7.653a1.97 1.97 0 0 0-.824 2.657l2.41 4.601A2.05 2.05 0 0 0 4.458 16H7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V16h2.543a2.05 2.05 0 0 0 1.822-1.089l2.409-4.601a1.97 1.97 0 0 0-.825-2.658M4.459 14a.08.08 0 0 1-.051-.016L2.01 9.408 7 6.685V14zm23.134-.018a.07.07 0 0 1-.052.018H25V6.685l4.99 2.723z"})})};g.forwardRef(t9);const n9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M12 27a2 2 0 1 1-4 0 2 2 0 0 1 4 0m11-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4m5.805-16.594A1 1 0 0 0 28 8H6.04L5.026 4.45A2.01 2.01 0 0 0 3.103 3H1a1 1 0 0 0 0 2h2.103l4.522 15.824A3.01 3.01 0 0 0 10.509 23h12.014a2.99 2.99 0 0 0 2.867-2.117l3.566-11.59a1 1 0 0 0-.151-.887"})})};g.forwardRef(n9);const r9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.5 27a1.5 1.5 0 0 1-1.5 1.5H6A2.5 2.5 0 0 1 3.5 26V6A2.5 2.5 0 0 1 6 3.5h7a1.5 1.5 0 0 1 0 3H6.5v19H13a1.5 1.5 0 0 1 1.5 1.5m13.561-12.061-5-5a1.503 1.503 0 0 0-2.125 2.125l2.439 2.436H13a1.5 1.5 0 1 0 0 3h10.375l-2.44 2.439a1.503 1.503 0 0 0 2.125 2.125l5-5a1.5 1.5 0 0 0 .001-2.125"})})};g.forwardRef(r9);const o9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M4 10a1 1 0 0 1 1-1h4.646a3.5 3.5 0 0 1 6.708 0H27a1 1 0 1 1 0 2H16.354a3.5 3.5 0 0 1-6.708 0H5a1 1 0 0 1-1-1m23 11h-2.646a3.5 3.5 0 0 0-6.708 0H5a1 1 0 0 0 0 2h12.646a3.5 3.5 0 0 0 6.708 0H27a1 1 0 1 0 0-2"})})};g.forwardRef(o9);const i9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 18a1.97 1.97 0 0 1-1.302 1.867l-6.457 2.375-2.375 6.452a1.99 1.99 0 0 1-3.735 0L9.75 22.25l-6.452-2.375a1.99 1.99 0 0 1 0-3.735l6.456-2.375 2.375-6.451a1.99 1.99 0 0 1 3.735 0l2.375 6.456 6.451 2.375A1.97 1.97 0 0 1 26 18M19 6h2v2a1 1 0 0 0 2 0V6h2a1 1 0 1 0 0-2h-2V2a1 1 0 1 0-2 0v2h-2a1 1 0 1 0 0 2m11 4h-1V9a1 1 0 1 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 0 0 2 0v-1h1a1 1 0 0 0 0-2"})})};g.forwardRef(i9);const s9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 7v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2m10-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 17H7a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m12 0h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2"})})};g.forwardRef(s9);const a9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:[u.jsx("path",{d:"M27.5 21.136 16 27.843 4.5 21.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728"}),u.jsx("path",{d:"M27.5 15.136 16 21.843 4.5 15.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728"}),u.jsx("path",{d:"m3.5 10.864 12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 0 0 0-1.728l-12-7a1 1 0 0 0-1.008 0l-12 7a1 1 0 0 0 0 1.728"})]})};g.forwardRef(a9);const l9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.313 14.298-5.638 4.92 1.689 7.325a2 2 0 0 1-2.98 2.167l-6.389-3.875L9.62 28.71a2 2 0 0 1-2.98-2.168l1.686-7.317-5.638-4.928a2 2 0 0 1 1.138-3.507l7.433-.644 2.901-6.92a1.994 1.994 0 0 1 3.68 0l2.91 6.92 7.43.644a2 2 0 0 1 1.139 3.508z"})})};g.forwardRef(l9);const c9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 19a4 4 0 1 0-4.991 3.875A1 1 0 0 0 24 23a4 4 0 0 1-4 4h-3a4 4 0 0 1-4-4v-5.065c3.934-.5 7-3.934 7-8.039V5a2 2 0 0 0-2-2h-2a1 1 0 1 0 0 2h2v4.896c0 3.323-2.656 6.061-5.92 6.104A6 6 0 0 1 6 10V5h2a1 1 0 0 0 0-2H6a2 2 0 0 0-2 2v5a8 8 0 0 0 7 7.936V23a6.006 6.006 0 0 0 6 6h3a6.006 6.006 0 0 0 6-6 1 1 0 0 0-.009-.125A4 4 0 0 0 29 19m-4 1a1 1 0 1 1 0-2 1 1 0 0 1 0 2"})})};g.forwardRef(c9);const d9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M216 56v144a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16V56a16 16 0 0 1 16-16h144a16 16 0 0 1 16 16"})})};g.forwardRef(d9);const u9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 12a1 1 0 0 0-.038-.275L27.17 5.45A2.01 2.01 0 0 0 25.25 4H6.75a2.01 2.01 0 0 0-1.919 1.45L3.04 11.725A1 1 0 0 0 3 12v2a5 5 0 0 0 2 4v8a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-8a5 5 0 0 0 2-4zm-18 2a3 3 0 0 1-4.39 2.657 1 1 0 0 0-.228-.132A3 3 0 0 1 5 14v-1h6zm8 0a3 3 0 0 1-6 0v-1h6zm8 0a3 3 0 0 1-1.384 2.525q-.12.051-.225.131A3 3 0 0 1 21 14v-1h6z"})})};g.forwardRef(u9);const h9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-3.767A5.19 5.19 0 0 1 24.5 21c0 1.806-.976 3.54-2.679 4.756C20.25 26.881 18.18 27.5 16 27.5s-4.25-.619-5.821-1.744C8.476 24.54 7.5 22.806 7.5 21a1.5 1.5 0 0 1 3 0c0 1.898 2.519 3.5 5.5 3.5s5.5-1.602 5.5-3.5c0-1.595-1.163-2.523-4.419-3.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M9.389 12.5a1.5 1.5 0 0 0 1.5-1.5c0-2 2.197-3.5 5.111-3.5 2.17 0 3.921.831 4.685 2.223a1.5 1.5 0 0 0 2.625-1.446C22.016 5.914 19.281 4.5 16 4.5c-4.625 0-8.111 2.794-8.111 6.5a1.5 1.5 0 0 0 1.5 1.5"})})};g.forwardRef(h9);const f9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 5V2a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0m1 3a8 8 0 1 0 8 8 8.01 8.01 0 0 0-8-8m-8.707.707a1 1 0 1 0 1.414-1.415l-2-2a1 1 0 1 0-1.414 1.415zm0 14.586-2 2a1 1 0 1 0 1.414 1.415l2-2a1 1 0 1 0-1.415-1.415M24 9a1 1 0 0 0 .707-.293l2-2a1 1 0 0 0-1.415-1.414l-2 2A1 1 0 0 0 24 9m.707 14.293a1 1 0 1 0-1.415 1.415l2 2a1 1 0 0 0 1.415-1.415zM6 16a1 1 0 0 0-1-1H2a1 1 0 0 0 0 2h3a1 1 0 0 0 1-1m10 10a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0v-3a1 1 0 0 0-1-1m14-11h-3a1 1 0 0 0 0 2h3a1 1 0 0 0 0-2"})})};g.forwardRef(f9);const m9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 8h-8.586l4.293-4.292a1 1 0 0 0-1.415-1.415L16 7.586l-5.292-5.293a1 1 0 1 0-1.415 1.415L13.586 8H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2m0 17h-7V10h7zm-2-10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0 6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"})})};g.forwardRef(m9);const g9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.978 19.625-1.5-12A3 3 0 0 0 25.5 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h5.383l4.722 9.448A1 1 0 0 0 15 30a5 5 0 0 0 5-5v-2h7a3 3 0 0 0 2.977-3.375M9 18H4V7h5z"})})};g.forwardRef(g9);const p9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.25 10.015A3 3 0 0 0 27 9h-7V7a5 5 0 0 0-5-5 1 1 0 0 0-.895.553L9.383 12H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h21.5a3 3 0 0 0 2.977-2.625l1.5-12a3 3 0 0 0-.727-2.36M4 14h5v11H4z"})})};g.forwardRef(p9);const b9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M23 3H9a4 4 0 0 0-4 4v16a4 4 0 0 0 4 4h1l-1.8 2.4a1 1 0 0 0 1.6 1.2l2.7-3.6h7l2.7 3.6a1 1 0 0 0 1.6-1.2L22 27h1a4 4 0 0 0 4-4V7a4 4 0 0 0-4-4M10.5 23a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m4.5-8H7v-5h8zm6.5 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m3.5-8h-8v-5h8z"})})};g.forwardRef(b9);const v9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 6h-5V5a3 3 0 0 0-3-3h-6a3 3 0 0 0-3 3v1H5a1 1 0 0 0 0 2h1v18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h1a1 1 0 1 0 0-2M14 21a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm6 0a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm0-15h-8V5a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1z"})})},x9=g.forwardRef(v9),nf=x9,w9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15.583 3.5v4a.75.75 0 1 1-1.5 0V5.313l-4.72 4.72a.75.75 0 0 1-1.062 0l-1.968-1.97-3.97 3.968a.751.751 0 1 1-1.062-1.063l4.5-4.5a.75.75 0 0 1 1.063 0l1.969 1.97 4.188-4.188h-2.188a.75.75 0 1 1 0-1.5h4a.75.75 0 0 1 .75.75"})})};g.forwardRef(w9);const y9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m23.54 2.267-3.711 3.377c1.7.52 3.298 1.397 4.653 2.631 4.684 4.266 4.684 11.184 0 15.45q-5.184 4.72-16.021 6.008l3.71-3.377a12.2 12.2 0 0 1-4.653-2.63c-4.684-4.267-4.712-11.16 0-15.45q5.184-4.721 16.021-6.01m-7.54 8.4c-3.314 0-6 2.388-6 5.333s2.686 5.333 6 5.333 6-2.387 6-5.333c0-2.945-2.686-5.333-6-5.333"})})},C9=g.forwardRef(y9),$9=C9,S9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 28a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M16 24.5a8.51 8.51 0 0 0 8.5-8.5V7a1.5 1.5 0 1 0-3 0v9a5.5 5.5 0 0 1-11 0V7a1.5 1.5 0 1 0-3 0v9a8.51 8.51 0 0 0 8.5 8.5"})})};g.forwardRef(S9);const A9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-16.439-7.939L14.5 8.625V19a1.5 1.5 0 1 0 3 0V8.625l2.439 2.44a1.503 1.503 0 0 0 2.125-2.125l-5-5a1.5 1.5 0 0 0-2.125 0l-5 5a1.503 1.503 0 1 0 2.125 2.125z"})})};g.forwardRef(A9);const k9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.866 27.5A1 1 0 0 1 28 28H4a1 1 0 0 1-.865-1.5c1.904-3.291 4.838-5.651 8.261-6.77a9 9 0 1 1 9.208 0c3.424 1.119 6.357 3.479 8.261 6.77a1 1 0 0 1 .001 1"})})};g.forwardRef(k9);const T9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.44 3.101a1 1 0 0 0-1.054.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1 1 0 0 0 20 28V4a1 1 0 0 0-.56-.899M28.414 16l2.293-2.292a1.001 1.001 0 0 0-1.415-1.415L27 14.586l-2.293-2.293a1 1 0 1 0-1.415 1.415L25.587 16l-2.293 2.293a1 1 0 0 0 1.415 1.415L27 17.414l2.293 2.294a1 1 0 0 0 1.415-1.415z"})})};g.forwardRef(T9);const R9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.439 3.101a1 1 0 0 0-1.053.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1.001 1.001 0 0 0 20 28V4a1 1 0 0 0-.561-.899M9 20H4v-8h5zm15.75-7.305a5 5 0 0 1 0 6.61 1 1 0 0 1-1.5-1.322 3 3 0 0 0 0-3.966 1 1 0 0 1 1.5-1.322M31 16a10 10 0 0 1-2.546 6.668 1 1 0 0 1-1.49-1.334 8 8 0 0 0 0-10.666.998.998 0 0 1 .407-1.624 1 1 0 0 1 1.083.29A9.98 9.98 0 0 1 31 16"})})};g.forwardRef(R9);const M9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 6a4 4 0 1 1 8 0 4 4 0 0 1-8 0m11 11c-3.58 0-5.226-1.662-6.969-3.421a25 25 0 0 0-1.375-1.323C13.031 8.24 5.63 15.098 5.316 15.391a1 1 0 0 0 1.369 1.458 20.5 20.5 0 0 1 3.815-2.724c1.723-.922 3.174-1.279 4.338-1.072L8.082 28.6a1 1 0 0 0 1.835.798l4.2-9.659L18 22.515V29a1 1 0 1 0 2 0v-7a1 1 0 0 0-.419-.814l-4.65-3.321L16.61 14c.33.305.657.634 1 .98C19.381 16.774 21.586 19 26 19a1 1 0 0 0 0-2"})})};g.forwardRef(M9);const E9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-1 7a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0zm1 13a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})},I9=g.forwardRef(E9),x2=I9,j9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.468 10 5.9 5.786l-.14-.243a3 3 0 1 1 5.316-2.76.51.51 0 0 1-.2.65.5.5 0 0 1-.71-.233 2 2 0 1 0-3.542 1.84l.864 1.496a.5.5 0 0 1 0 .5L5.2 11a1 1 0 0 1-1.731-1m8.812-2.5h-.771l-2.31-4a1 1 0 0 0-1.731 1l2.165 3.75a.5.5 0 0 0 .432.25h2.227c1.118 0 2.06.915 2.041 2.033a2 2 0 0 1-1.98 1.967.515.515 0 0 0-.518.458.5.5 0 0 0 .5.542 3.003 3.003 0 0 0 3-3.058c-.034-1.643-1.41-2.942-3.052-2.942zm1.053 2.952c-.025-.538-.489-.952-1.027-.952H7.51a.5.5 0 0 0-.433.25l-1.01 1.75a2 2 0 1 1-3.342-2.187.51.51 0 0 0-.058-.688.5.5 0 0 0-.732.073A3 3 0 1 0 6.93 12l.289-.5h5.114a1 1 0 0 0 1-1.048"})})};g.forwardRef(j9);const D9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m31.316 24.949-3 1a1 1 0 0 1-1.211-.5l-3.724-7.45H13a1 1 0 0 1-1-1v-3.707A7 7 0 0 0 14 27c3.239 0 6.261-2.256 7.031-5.25a1 1 0 1 1 1.938.5C21.96 26.162 18.19 29 14 29a9 9 0 0 1-2-17.774V8.851a3.5 3.5 0 1 1 2 0V11h7a1 1 0 0 1 0 2h-7v3h10a1 1 0 0 1 .894.552l3.612 7.225 2.178-.726a1 1 0 1 1 .632 1.898"})})};g.forwardRef(D9);const w2="Avatar",[O9,gW]=qe(w2),[L9,y2]=O9(w2),N9=g.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[o,i]=g.useState("idle");return g.createElement(L9,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i},g.createElement(ie.span,F({},r,{ref:e})))}),B9="AvatarImage",F9=g.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=t,s=y2(B9,n),a=z9(r),l=Ke(c=>{o(c),s.onImageLoadingStatusChange(c)});return Be(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.createElement(ie.img,F({},i,{ref:e,src:r})):null}),V9="AvatarFallback",_9=g.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...o}=t,i=y2(V9,n),[s,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?g.createElement(ie.span,F({},o,{ref:e})):null});function z9(t){const[e,n]=g.useState("idle");return Be(()=>{if(!t){n("error");return}let r=!0;const o=new window.Image,i=s=>()=>{r&&n(s)};return n("loading"),o.onload=i("loaded"),o.onerror=i("error"),o.src=t,()=>{r=!1}},[t]),e}const H9=N9,P9=F9,W9=_9,Nc="rovingFocusGroup.onEntryFocus",q9={bubbles:!1,cancelable:!0},rf="RovingFocusGroup",[Wd,C2,U9]=jl(rf),[K9,ni]=qe(rf,[U9]),[G9,Y9]=K9(rf),X9=g.forwardRef((t,e)=>g.createElement(Wd.Provider,{scope:t.__scopeRovingFocusGroup},g.createElement(Wd.Slot,{scope:t.__scopeRovingFocusGroup},g.createElement(Q9,F({},t,{ref:e}))))),Q9=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=t,h=g.useRef(null),f=le(e,h),m=Qr(i),[b=null,p]=it({prop:s,defaultProp:a,onChange:l}),[v,x]=g.useState(!1),y=Ke(c),$=C2(n),S=g.useRef(!1),[A,k]=g.useState(0);return g.useEffect(()=>{const T=h.current;if(T)return T.addEventListener(Nc,y),()=>T.removeEventListener(Nc,y)},[y]),g.createElement(G9,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:b,onItemFocus:g.useCallback(T=>p(T),[p]),onItemShiftTab:g.useCallback(()=>x(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>k(T=>T-1),[])},g.createElement(ie.div,F({tabIndex:v||A===0?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...t.style},onMouseDown:U(t.onMouseDown,()=>{S.current=!0}),onFocus:U(t.onFocus,T=>{const I=!S.current;if(T.target===T.currentTarget&&I&&!v){const E=new CustomEvent(Nc,q9);if(T.currentTarget.dispatchEvent(E),!E.defaultPrevented){const j=$().filter(W=>W.focusable),L=j.find(W=>W.active),D=j.find(W=>W.id===b),V=[L,D,...j].filter(Boolean).map(W=>W.ref.current);$2(V)}}S.current=!1}),onBlur:U(t.onBlur,()=>x(!1))})))}),Z9="RovingFocusGroupItem",J9=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=t,a=at(),l=i||a,c=Y9(Z9,n),d=c.currentTabStopId===l,h=C2(n),{onFocusableItemAdd:f,onFocusableItemRemove:m}=c;return g.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),g.createElement(Wd.ItemSlot,{scope:n,id:l,focusable:r,active:o},g.createElement(ie.span,F({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:e,onMouseDown:U(t.onMouseDown,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:U(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:U(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const p=nA(b,c.orientation,c.dir);if(p!==void 0){b.preventDefault();let x=h().filter(y=>y.focusable).map(y=>y.ref.current);if(p==="last")x.reverse();else if(p==="prev"||p==="next"){p==="prev"&&x.reverse();const y=x.indexOf(b.currentTarget);x=c.loop?rA(x,y+1):x.slice(y+1)}setTimeout(()=>$2(x))}})})))}),eA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tA(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function nA(t,e,n){const r=tA(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return eA[r]}function $2(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function rA(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const of=X9,sf=J9;var oA=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},so=new WeakMap,Bs=new WeakMap,Fs={},Bc=0,S2=function(t){return t&&(t.host||S2(t.parentNode))},iA=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=S2(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},sA=function(t,e,n,r){var o=iA(e,Array.isArray(t)?t:[t]);Fs[n]||(Fs[n]=new WeakMap);var i=Fs[n],s=[],a=new Set,l=new Set(o),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};o.forEach(c);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(a.has(f))d(f);else try{var m=f.getAttribute(r),b=m!==null&&m!=="false",p=(so.get(f)||0)+1,v=(i.get(f)||0)+1;so.set(f,p),i.set(f,v),s.push(f),p===1&&b&&Bs.set(f,!0),v===1&&f.setAttribute(n,"true"),b||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return d(e),a.clear(),Bc++,function(){s.forEach(function(h){var f=so.get(h)-1,m=i.get(h)-1;so.set(h,f),i.set(h,m),f||(Bs.has(h)||h.removeAttribute(r),Bs.delete(h)),m||h.removeAttribute(n)}),Bc--,Bc||(so=new WeakMap,so=new WeakMap,Bs=new WeakMap,Fs={})}},af=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=oA(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),sA(r,o,n,"aria-hidden")):function(){return null}},A2=wh(),Fc=function(){},Vl=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Fc,onWheelCapture:Fc,onTouchMoveCapture:Fc}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,b=t.inert,p=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=Ml(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),$=f,S=xh([n,e]),A=_e(_e({},y),o);return w.createElement(w.Fragment,null,d&&w.createElement($,{sideCar:A2,removeScrollBar:c,shards:h,noIsolation:m,inert:b,setCallbacks:i,allowPinchZoom:!!p,lockRef:n}),s?w.cloneElement(w.Children.only(a),_e(_e({},A),{ref:S})):w.createElement(x,_e({},A,{className:l,ref:S}),a))});Vl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vl.classNames={fullWidth:Co,zeroRight:yo};var qd=!1;if(typeof window<"u")try{var Vs=Object.defineProperty({},"passive",{get:function(){return qd=!0,!0}});window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch{qd=!1}var ao=qd?{passive:!1}:!1,aA=function(t){return t.tagName==="TEXTAREA"},k2=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!aA(t)&&n[e]==="visible")},lA=function(t){return k2(t,"overflowY")},cA=function(t){return k2(t,"overflowX")},V0=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=T2(t,n);if(r){var o=R2(t,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},dA=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},uA=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},T2=function(t,e){return t==="v"?lA(e):cA(e)},R2=function(t,e){return t==="v"?dA(e):uA(e)},hA=function(t,e){return t==="h"&&e==="rtl"?-1:1},fA=function(t,e,n,r,o){var i=hA(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=R2(t,a),b=m[0],p=m[1],v=m[2],x=p-v-i*b;(b||x)&&T2(t,a)&&(h+=x,f+=b),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&h===0||!d&&f===0)&&(c=!0),c},_s=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_0=function(t){return[t.deltaX,t.deltaY]},z0=function(t){return t&&"current"in t?t.current:t},mA=function(t,e){return t[0]===e[0]&&t[1]===e[1]},gA=function(t){return`
|
|
47
|
+
`)},NC=0,io=[];function BC(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(NC++)[0],i=w.useState(Il)[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=vh([t.lockRef.current],(t.shards||[]).map(N0),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(b,v){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Ns(b),y=n.current,$="deltaX"in b?b.deltaX:y[0]-x[0],S="deltaY"in b?b.deltaY:y[1]-x[1],A,k=b.target,T=Math.abs($)>Math.abs(S)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var I=O0(T,k);if(!I)return!0;if(I?A=T:(A=T==="v"?"h":"v",I=O0(T,k)),!I)return!1;if(!r.current&&"changedTouches"in b&&($||S)&&(r.current=A),!A)return!0;var E=r.current||A;return DC(E,v,b,E==="h"?$:S)},[]),l=w.useCallback(function(b){var v=b;if(!(!io.length||io[io.length-1]!==i)){var x="deltaY"in v?L0(v):Ns(v),y=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&OC(A.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(N0).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=$.length>0?a(v,$[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(b,v,x,y){var $={name:b,delta:v,target:x,should:y,shadowParent:FC(x)};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(S){return S!==$})},1)},[]),d=w.useCallback(function(b){n.current=Ns(b),r.current=void 0},[]),h=w.useCallback(function(b){c(b.type,L0(b),b.target,a(b,t.lockRef.current))},[]),f=w.useCallback(function(b){c(b.type,Ns(b),b.target,a(b,t.lockRef.current))},[]);w.useEffect(function(){return io.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,oo),document.addEventListener("touchmove",l,oo),document.addEventListener("touchstart",d,oo),function(){io=io.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,oo),document.removeEventListener("touchmove",l,oo),document.removeEventListener("touchstart",d,oo)}},[]);var m=t.removeScrollBar,p=t.inert;return w.createElement(w.Fragment,null,p?w.createElement(i,{styles:LC(o)}):null,m?w.createElement(Ch,{gapMode:t.gapMode}):null)}function FC(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const VC=yh(Sp,BC);var $h=w.forwardRef(function(t,e){return w.createElement(El,_e({},t,{ref:e,sideCar:VC}))});$h.classNames=El.classNames;function Nd(t,[e,n]){return Math.min(n,Math.max(e,t))}function jl(t){const e=t+"CollectionProvider",[n,r]=qe(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:p,children:b}=m,v=w.default.useRef(null),x=w.default.useRef(new Map).current;return w.default.createElement(o,{scope:p,itemMap:x,collectionRef:v},b)},a=t+"CollectionSlot",l=w.default.forwardRef((m,p)=>{const{scope:b,children:v}=m,x=i(a,b),y=le(p,x.collectionRef);return w.default.createElement(yn,{ref:y},v)}),c=t+"CollectionItemSlot",d="data-radix-collection-item",h=w.default.forwardRef((m,p)=>{const{scope:b,children:v,...x}=m,y=w.default.useRef(null),$=le(p,y),S=i(c,b);return w.default.useEffect(()=>(S.itemMap.set(y,{ref:y,...x}),()=>void S.itemMap.delete(y))),w.default.createElement(yn,{[d]:"",ref:$},v)});function f(m){const p=i(t+"CollectionConsumer",m);return w.default.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(p.itemMap.values()).sort((S,A)=>x.indexOf(S.ref.current)-x.indexOf(A.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},f,r]}const _C=g.createContext(void 0);function Qr(t){const e=g.useContext(_C);return t||e||"ltr"}function Dl(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function zC(t){const e=`${t}CollectionProvider`,[n,r]=qe(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map,listeners:new Set}),s=m=>{const{scope:p,children:b}=m,v=w.useRef(null),x=w.useRef(new Map).current,y=w.useRef(new Set).current;return u.jsx(o,{scope:p,itemMap:x,collectionRef:v,listeners:y,children:b})};s.displayName=e;const a=`${t}CollectionSlot`,l=w.forwardRef((m,p)=>{const{scope:b,children:v}=m,x=i(a,b),y=le(p,x.collectionRef);return u.jsx(yn,{ref:y,children:v})});l.displayName=a;const c=`${t}CollectionItemSlot`,d="data-radix-collection-item",h=w.forwardRef((m,p)=>{const{scope:b,children:v,...x}=m,y=w.useRef(null),$=le(p,y),S=i(c,b);return w.useEffect(()=>{const A=Array.from(S.itemMap.values());return S.itemMap.set(y,{ref:y,...x}),S.listeners.forEach(k=>k(Array.from(S.itemMap.values()),A)),()=>{const k=Array.from(S.itemMap.values());S.itemMap.delete(y),S.listeners.forEach(T=>T(Array.from(S.itemMap.values()),k))}}),u.jsx(yn,{[d]:"",ref:$,children:v})});h.displayName=c;function f(m){const p=i(`${t}CollectionConsumer`,m),b=w.useCallback(()=>{const x=p.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(p.itemMap.values()).sort((A,k)=>y.indexOf(A.ref.current)-y.indexOf(k.ref.current))},[p.collectionRef,p.itemMap]),v=w.useCallback(x=>(p.listeners.add(x),()=>p.listeners.delete(x)),[p.listeners]);return{getItems:b,subscribe:v}}return[{Provider:s,Slot:l,ItemSlot:h},f,r]}const Lc=new Map;function HC(t,e){const n=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(Lc.has(n))return Lc.get(n);const r=new Intl.Collator(t,e);return Lc.set(n,r),r}function Sh(t,e){const n=HC(t,{usage:"search",...e});return{startsWith(r,o){return o.length===0?!0:(r=r.normalize("NFC"),o=o.normalize("NFC"),n.compare(r.slice(0,o.length),o)===0)},endsWith(r,o){return o.length===0?!0:(r=r.normalize("NFC"),o=o.normalize("NFC"),n.compare(r.slice(-o.length),o)===0)},contains(r,o){if(o.length===0)return!0;r=r.normalize("NFC"),o=o.normalize("NFC");let i=0;const s=o.length;for(;i+s<=r.length;i++){const a=r.slice(i,i+s);if(n.compare(o,a)===0)return!0}return!1}}}const PC=t=>{const e=w.useRef();return w.useEffect(()=>{e.current=t}),e.current},WC=[" ","Enter","ArrowUp","ArrowDown"],qC=["Enter"],UC=t=>!!(t.length===1&&t.match(/\S| /)),Rp="Combobox",[Bo,ds]=zC(Rp),[KC,Tn]=sh(Rp),GC=({children:t})=>u.jsx(Tl,{children:u.jsx(Bo.Provider,{scope:void 0,children:t})}),YC=t=>typeof t=="string"?t==="none"?{type:t,filter:void 0}:{type:t,filter:"startsWith"}:t,XC=t=>{const{allowCustomValue:e=!1,autocomplete:n="none",children:r,open:o,defaultOpen:i,onOpenChange:s,value:a,defaultValue:l,onValueChange:c,disabled:d,required:h=!1,locale:f="en-EN",onTextValueChange:m,textValue:p,defaultTextValue:b,filterValue:v,defaultFilterValue:x,onFilterValueChange:y,isPrintableCharacter:$=UC,visible:S=!1}=t,[A,k]=w.useState(null),[T,I]=w.useState(null),[E,j]=w.useState(null),[L,D]=w.useState(null),[z=!1,V]=it({prop:o,defaultProp:i,onChange:s}),[W,G]=it({prop:a,defaultProp:l,onChange:c}),[P,_]=it({prop:p,defaultProp:e&&!b?a:b,onChange:m}),[O,X]=it({prop:v,defaultProp:x,onChange:y}),J=at(),fe=w.useCallback((pe,be)=>{const Se=be.map(he=>he.ref.current),[re,...xe]=Se,[ge]=xe.slice(-1),ve=L??be.find(he=>he.value===W)?.ref.current;for(const he of pe){if(he===ve)return;if(he?.scrollIntoView({block:"nearest"}),he===re&&T&&(T.scrollTop=0),he===ge&&T&&(T.scrollTop=T.scrollHeight),D(he),n==="both"){const ce=be.find(je=>je.ref.current===he);ce&&_(ce.textValue)}if(he!==ve)return}},[n,_,T,L,W]),se=YC(n);return w.useEffect(()=>{n!=="both"&&D(null)},[P,n]),w.useEffect(()=>{if(E&&A)return Cp([E,A])},[E,A]),u.jsx(GC,{children:u.jsx(KC,{allowCustomValue:e,autocomplete:se,required:h,trigger:A,onTriggerChange:k,contentId:J,value:W,onValueChange:G,open:z,onOpenChange:V,disabled:d,locale:f,focusFirst:fe,textValue:P,onTextValueChange:_,onViewportChange:I,onContentChange:j,visuallyFocussedItem:L,filterValue:O,onFilterValueChange:X,onVisuallyFocussedItemChange:D,isPrintableCharacter:$,visible:S,children:r})})},Mp="ComboboxTrigger",Ep=w.forwardRef((t,e)=>{const{...n}=t,r=Tn(Mp),o=()=>{r.disabled||r.onOpenChange(!0)};return u.jsx(as,{asChild:!0,children:u.jsx(ei,{asChild:!0,trapped:r.open,onMountAutoFocus:i=>{i.preventDefault()},onUnmountAutoFocus:i=>{r.trigger?.focus({preventScroll:!0}),document.getSelection()?.empty(),i.preventDefault()},children:u.jsx("div",{ref:e,"data-disabled":r.disabled?"":void 0,...n,onClick:U(n.onClick,i=>{if(r.disabled){i.preventDefault();return}r.trigger?.focus()}),onPointerDown:U(n.onPointerDown,i=>{if(r.disabled){i.preventDefault();return}const s=i.target;s.hasPointerCapture(i.pointerId)&&s.releasePointerCapture(i.pointerId),(s.closest("button")??s.closest("div"))===i.currentTarget&&i.button===0&&i.ctrlKey===!1&&(o(),r.trigger?.focus())})})})})});Ep.displayName=Mp;const Ip="ComboboxInput",jp=w.forwardRef((t,e)=>{const n=Tn(Ip),r=w.useRef(null),{getItems:o}=ds(void 0),{startsWith:i}=Sh(n.locale,{sensitivity:"base"}),s=n.disabled,a=le(r,e,n.onTriggerChange),l=()=>{s||n.onOpenChange(!0)},c=PC(n.filterValue);return Be(()=>{const d=setTimeout(()=>{if(n.textValue===""||n.textValue===void 0||n.filterValue===""||n.filterValue===void 0)return;const h=o().find(m=>m.type==="option"&&i(m.textValue,n.textValue)),f=u4(c??"",n.filterValue);h&&!n.visuallyFocussedItem&&f===n.filterValue.length&&r.current?.setSelectionRange(n.filterValue.length,n.textValue.length)});return()=>clearTimeout(d)},[n.textValue,n.filterValue,i,n.visuallyFocussedItem,o,c]),u.jsx("input",{type:"text",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":n.autocomplete.type,"data-state":n.open?"open":"closed","aria-disabled":s,"aria-activedescendant":n.visuallyFocussedItem?.id,disabled:s,"data-disabled":s?"":void 0,"data-placeholder":n.textValue===void 0?"":void 0,value:n.textValue??"",...t,ref:a,onKeyDown:U(t.onKeyDown,d=>{if(["ArrowUp","ArrowDown","Home","End"].includes(d.key))n.open||l(),setTimeout(()=>{let f=o().filter(m=>!m.disabled&&m.isVisible).map(m=>m.ref.current);if(["ArrowUp","End"].includes(d.key)&&(f=f.slice().reverse()),["ArrowUp","ArrowDown"].includes(d.key)){const m=n.visuallyFocussedItem??o().find(p=>p.value===n.value)?.ref.current;if(m){let p=f.indexOf(m);p===f.length-1&&(p=-1),f=f.slice(p+1)}}if(["ArrowDown"].includes(d.key)&&n.autocomplete.type==="both"&&f.length>1){const[m,...p]=f,b=o().find(v=>v.ref.current===m).textValue;n.textValue===b&&(f=p)}n.focusFirst(f,o())}),d.preventDefault();else if(["Tab"].includes(d.key)&&n.open)d.preventDefault();else if(["Escape"].includes(d.key))n.open?n.onOpenChange(!1):(n.onValueChange(void 0),n.onTextValueChange("")),d.preventDefault();else if(qC.includes(d.key)){if(n.visuallyFocussedItem){const h=o().find(f=>f.ref.current===n.visuallyFocussedItem);h&&(n.onValueChange(h.value),n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue),h.ref.current?.click())}else{const h=o().find(f=>f.type==="option"&&!f.disabled&&f.textValue===n.textValue);h&&(n.onValueChange(h.value),n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue),h.ref.current?.click())}n.onOpenChange(!1),d.preventDefault()}else n.onVisuallyFocussedItemChange(null)}),onChange:U(t.onChange,d=>{n.onTextValueChange(d.currentTarget.value),n.autocomplete.type==="both"&&n.onFilterValueChange(d.currentTarget.value)}),onKeyUp:U(t.onKeyUp,d=>{if(!n.open&&(n.isPrintableCharacter(d.key)||["Backspace"].includes(d.key))&&l(),setTimeout(()=>{if(n.autocomplete.type==="both"&&n.isPrintableCharacter(d.key)&&n.filterValue!==void 0){const h=n.filterValue,f=o().find(m=>i(m.textValue,h));f&&n.onTextValueChange(f.textValue)}}),n.autocomplete.type==="none"&&n.isPrintableCharacter(d.key)){const h=n.textValue??"",f=o().find(m=>i(m.textValue,h));f&&(n.onVisuallyFocussedItemChange(f.ref.current),f.ref.current?.scrollIntoView())}}),onBlur:U(t.onBlur,()=>{if(n.open)return;n.onVisuallyFocussedItemChange(null);const[d]=o().filter(f=>f.textValue===n.textValue&&f.type==="option");if(d){n.onValueChange(d.value),n.autocomplete.type==="both"&&n.onFilterValueChange(d.textValue);return}if(n.allowCustomValue){n.onValueChange(n.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(n.textValue);return}const[h]=o().filter(f=>f.value===n.value&&f.type==="option");h&&n.textValue!==""?(n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue)):(n.onValueChange(void 0),n.onTextValueChange(""))})})});jp.displayName="ComboboxTextInput";const Dp=w.forwardRef((t,e)=>{const{children:n,...r}=t,o=Tn(Ip),i=o.disabled,s=()=>{i||(o.onOpenChange(!0),o.trigger?.focus())};return u.jsx(ie.button,{"aria-hidden":!0,type:"button","aria-disabled":i,"aria-controls":o.contentId,"aria-expanded":o.open,disabled:i,"data-disabled":i?"":void 0,...r,tabIndex:-1,ref:e,onClick:U(r.onClick,()=>{o.trigger?.focus()}),onPointerDown:U(r.onPointerDown,a=>{a.button===0&&a.ctrlKey===!1&&(s(),a.preventDefault())}),onKeyDown:U(r.onKeyDown,a=>{WC.includes(a.key)&&(s(),a.preventDefault())}),children:n||"▼"})});Dp.displayName="ComboboxIcon";const QC="ComboboxPortal",Op=t=>u.jsx(Zo,{asChild:!0,...t});Op.displayName=QC;const Ah="ComboboxContent",Lp=w.forwardRef((t,e)=>{const n=Tn(Ah),{getItems:r}=ds(void 0),[o,i]=w.useState();if(Be(()=>{i(new DocumentFragment)},[]),Be(()=>{n.open&&n.autocomplete.type==="none"&&setTimeout(()=>{r().find(a=>a.value===n.value)?.ref.current?.scrollIntoView({block:"nearest"})})},[r,n.autocomplete,n.value,n.open]),!n.open){const s=o;return s?Yr.createPortal(u.jsx(Bo.Slot,{scope:void 0,children:u.jsx("div",{children:t.children})}),s):null}return u.jsx(Np,{...t,ref:e})});Lp.displayName=Ah;const ZC=10,Np=w.forwardRef((t,e)=>{const{onEscapeKeyDown:n,onPointerDownOutside:r,...o}=t,i=Tn(Ah),s=le(e,l=>i.onContentChange(l)),{onOpenChange:a}=i;return Jo(),w.useEffect(()=>{const l=()=>{a(!1)};return window.addEventListener("blur",l),window.addEventListener("resize",l),()=>{window.removeEventListener("blur",l),window.removeEventListener("resize",l)}},[a]),u.jsx($h,{allowPinchZoom:!0,children:u.jsx(Xr,{asChild:!0,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:l=>{l.preventDefault()},onDismiss:()=>{i.onOpenChange(!1),i.trigger?.focus({preventScroll:!0})},children:u.jsx(Bp,{role:"listbox",id:i.contentId,"data-state":i.open?"open":"closed",onContextMenu:l=>l.preventDefault(),...o,ref:s,style:{display:"flex",flexDirection:"column",outline:"none",...o.style}})})})});Np.displayName="ComboboxContentImpl";const Bp=w.forwardRef((t,e)=>{const{align:n="start",collisionPadding:r=ZC,...o}=t;return u.jsx(ls,{...o,ref:e,align:n,collisionPadding:r,style:{boxSizing:"border-box",...o.style,"--radix-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-combobox-content-available-width":"var(--radix-popper-available-width)","--radix-combobox-content-available-height":"var(--radix-popper-available-height)","--radix-combobox-trigger-width":"var(--radix-popper-anchor-width)","--radix-combobox-trigger-height":"var(--radix-popper-anchor-height)"}})});Bp.displayName="ComboboxPopperPosition";const Fp="ComboboxViewport",Vp=w.forwardRef((t,e)=>{const n=Tn(Fp),r=le(e,n.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-combobox-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-combobox-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(Bo.Slot,{scope:void 0,children:u.jsx(ie.div,{"data-radix-combobox-viewport":"",role:"presentation",...t,ref:r,style:{position:"relative",flex:1,overflow:"auto",...t.style}})})]})});Vp.displayName=Fp;const Ol="ComboboxItem",[B0,kh]=sh(Ol),Th=w.forwardRef((t,e)=>{const{value:n,disabled:r=!1,textValue:o,...i}=t,[s,a]=w.useState();Be(()=>{a(new DocumentFragment)},[]);const{onTextValueChange:l,textValue:c,...d}=Tn(Ol),h=at(),[f,m]=w.useState(o??""),p=d.value===n,{startsWith:b,contains:v}=Sh(d.locale,{sensitivity:"base"}),x=w.useCallback(y=>{m($=>$||(y?.textContent??"").trim())},[]);return w.useEffect(()=>{p&&c===void 0&&f!==""&&l(f)},[f,p,c,l]),d.autocomplete.type==="both"&&f&&d.filterValue&&!b(f,d.filterValue)||d.autocomplete.type==="list"&&d.autocomplete.filter==="startsWith"&&f&&c&&!b(f,c)||d.autocomplete.type==="list"&&d.autocomplete.filter==="contains"&&f&&c&&!v(f,c)?s?Yr.createPortal(u.jsx(B0,{textId:h,onTextValueChange:x,isSelected:p,textValue:f,children:u.jsx(Bo.ItemSlot,{scope:void 0,value:n,textValue:f,disabled:r,type:"option",isVisible:!1,children:u.jsx(Bd,{ref:e,value:n,disabled:r,...i})})}),s):null:u.jsx(B0,{textId:h,onTextValueChange:x,isSelected:p,textValue:f,children:u.jsx(Bo.ItemSlot,{scope:void 0,value:n,textValue:f,disabled:r,type:"option",isVisible:!0,children:u.jsx(Bd,{ref:e,value:n,disabled:r,...i})})})});Th.displayName=Ol;const _p="ComboboxItemImpl",Bd=w.forwardRef((t,e)=>{const{value:n,disabled:r=!1,...o}=t,i=w.useRef(null),s=le(e,i),{getItems:a}=ds(void 0),{onTextValueChange:l,visuallyFocussedItem:c,...d}=Tn(Ol),{isSelected:h,textValue:f,textId:m}=kh(_p),p=()=>{r||(d.onValueChange(n),l(f),d.onOpenChange(!1),d.autocomplete.type==="both"&&d.onFilterValueChange(f),d.trigger?.focus({preventScroll:!0}))},b=w.useMemo(()=>c===a().find(x=>x.ref.current===i.current)?.ref.current,[a,c]),v=at();return u.jsx(ie.div,{role:"option","aria-labelledby":m,"data-highlighted":b?"":void 0,"aria-selected":h&&b,"data-state":h?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,id:v,ref:s,onPointerUp:U(o.onPointerUp,p)})});Bd.displayName=_p;const zp="ComboboxItemText",Hp=w.forwardRef((t,e)=>{const{className:n,style:r,...o}=t,i=kh(zp),s=le(e,i.onTextValueChange);return u.jsx(ie.span,{id:i.textId,...o,ref:s})});Hp.displayName=zp;const Pp="ComboboxItemIndicator",Wp=w.forwardRef((t,e)=>{const{isSelected:n}=kh(Pp);return n?u.jsx(ie.span,{"aria-hidden":!0,...t,ref:e}):null});Wp.displayName=Pp;const Rh="ComboboxNoValueFound",qp=w.forwardRef((t,e)=>{const{textValue:n="",filterValue:r="",visible:o=!1,locale:i,autocomplete:s}=Tn(Rh),[a,l]=w.useState([]),{subscribe:c}=ds(void 0),{startsWith:d,contains:h}=Sh(i,{sensitivity:"base"});return w.useEffect(()=>{const f=c(m=>{if(o){const p=m.filter(b=>b.type!=="create");l(p)}else l(m)});return()=>{f()}},[o,c]),s.type==="none"&&a.length>0||s.type==="list"&&s.filter==="startsWith"&&a.some(f=>d(f.textValue,n))||s.type==="both"&&a.some(f=>d(f.textValue,r))||s.type==="list"&&s.filter==="contains"&&a.some(f=>h(f.textValue,n))?null:u.jsx(ie.div,{...t,ref:e})});qp.displayName=Rh;const Up=w.forwardRef((t,e)=>{const{disabled:n=!1,...r}=t,o=Tn(Rh),{textValue:i,visuallyFocussedItem:s}=o,{getItems:a,subscribe:l}=ds(void 0),c=w.useRef(null),[d,h]=w.useState(!1),f=le(e,c),m=w.useMemo(()=>s===a().find(v=>v.ref.current===c.current)?.ref.current,[a,s]),p=at(),b=()=>{!n&&i&&(o.onValueChange(i),o.onTextValueChange(i),o.onOpenChange(!1),o.autocomplete.type==="both"&&o.onFilterValueChange(i),o.trigger?.focus({preventScroll:!0}))};return Be(()=>{const v=l(x=>{h(!x.some(y=>y.textValue===i&&y.type!=="create"))});return a().length===0&&h(!0),()=>{v()}},[i,l,a]),(!i||!d)&&!o.visible?null:u.jsx(Bo.ItemSlot,{scope:void 0,value:i??"",textValue:i??"",disabled:n,isVisible:!0,type:"create",children:u.jsx(ie.div,{role:"option",tabIndex:n?void 0:-1,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,"data-highlighted":m?"":void 0,...r,id:p,ref:f,onPointerUp:U(r.onPointerUp,b)})})});Up.displayName="ComboboxCreateItem";const JC=XC,e4=Ep,t4=jp,n4=Dp,r4=Op,o4=Lp,i4=Vp,s4=Th,a4=Hp,l4=Wp,c4=qp,d4=Up;function u4(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++)if(t[r]!==e[r])return r;return n}const Kt=Object.freeze(Object.defineProperty({__proto__:null,ComboboxItem:Th,Content:o4,CreateItem:d4,Icon:n4,Item:s4,ItemIndicator:l4,ItemText:a4,NoValueFound:c4,Portal:r4,Root:JC,TextInput:t4,Trigger:e4,Viewport:i4},Symbol.toStringTag,{value:"Module"}));function Mh(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>e.current?.(...n),[])}const h4=[" ","Enter","ArrowUp","ArrowDown"],f4=[" ","Enter"],us="Select",[Ll,hs,m4]=jl(us),[ti,g4]=qe(us,[m4,br]),Nl=br(),[p4,Gn]=ti(us),[b4,v4]=ti(us),Eh=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,disabled:d,required:h,multi:f=!1}=t,m=Nl(e),[p,b]=w.useState(null),[v,x]=w.useState(null),[y,$]=w.useState(!1),S=Qr(c),[A=!1,k]=it({prop:r,defaultProp:o,onChange:i}),[T,I]=it({prop:s,defaultProp:a,onChange(D){l&&(Array.isArray(D),l(D))}}),E=w.useRef(null),[j,L]=w.useState(new Set);return u.jsx(Tl,{...m,children:u.jsx(p4,{required:h,scope:e,trigger:p,onTriggerChange:b,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:y,onValueNodeHasChildrenChange:$,contentId:at(),value:T,onValueChange:I,open:A,onOpenChange:k,dir:S,triggerPointerDownPosRef:E,disabled:d,multi:f,children:u.jsx(Ll.Provider,{scope:e,children:u.jsx(b4,{scope:t.__scopeSelect,onNativeOptionAdd:w.useCallback(D=>{L(z=>new Set(z).add(D))},[]),onNativeOptionRemove:w.useCallback(D=>{L(z=>{const V=new Set(z);return V.delete(D),V})},[]),children:n})})})})};Eh.displayName=us;const Kp="SelectTrigger",Ih=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Nl(n),i=Gn(Kp,n),s=i.disabled,a=le(e,i.onTriggerChange),l=hs(n),[c,d,h]=n2(m=>{const p=l().filter(x=>!x.disabled),b=p.find(x=>x.value===i.value),v=r2(p,m,b);if(v!==void 0&&!Array.isArray(v.value)){const x=i.multi?[v.value]:v.value;i.onValueChange(x)}}),f=()=>{s||(i.onOpenChange(!0),h())};return u.jsx(as,{asChild:!0,...o,children:u.jsx(ie.div,{role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed","data-disabled":s?"":void 0,"data-placeholder":i.value===void 0?"":void 0,tabIndex:s?void 0:0,...r,ref:a,onClick:U(r.onClick,m=>{m.currentTarget.focus()}),onPointerDown:U(r.onPointerDown,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),(p.closest("button")??p.closest("div"))===m.currentTarget&&m.button===0&&m.ctrlKey===!1&&(f(),i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:U(r.onKeyDown,m=>{const p=c.current!=="",b=m.ctrlKey||m.altKey||m.metaKey,v=m.target;(v.closest("button")??v.closest("div"))===m.currentTarget&&(!b&&m.key.length===1&&d(m.key),!(p&&m.key===" ")&&h4.includes(m.key)&&(f(),m.preventDefault()))})})})});Ih.displayName=Kp;const Gp="SelectValue",jh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,placeholder:o,...i}=t,s=Gn(Gp,n),{onValueNodeHasChildrenChange:a}=s,l=r!==void 0,c=le(e,s.onValueNodeChange),[d,h]=w.useState([]),f=hs(n);Be(()=>{a(l)},[a,l]),w.useLayoutEffect(()=>{if(Array.isArray(s.value)&&d.length!==s.value.length){const p=setTimeout(()=>{const b=f().filter(v=>Array.isArray(v.value)?!1:s.value?.includes(v.value));h(b)});return()=>{clearTimeout(p)}}},[s.value,f,d]);let m;if((s.value===void 0||s.value.length===0)&&o!==void 0)m=u.jsx("span",{children:o});else if(typeof r=="function")if(Array.isArray(s.value)){const p=s.value.map(b=>{const v=d.find(x=>x.value===b);return v?r({value:b,textValue:v?.textValue}):null});m=p.every(b=>b===null)?o:p}else m=r(s.value);else m=r;return u.jsx(ie.span,{...i,ref:c,children:m||null})});jh.displayName=Gp;const x4="SelectIcon",Dh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return u.jsx(ie.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});Dh.displayName=x4;const w4="SelectPortal",Oh=t=>u.jsx(Zo,{asChild:!0,...t});Oh.displayName=w4;const zr="SelectContent",Lh=w.forwardRef((t,e)=>{const n=Gn(zr,t.__scopeSelect),[r,o]=w.useState();if(Be(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Yr.createPortal(u.jsx(Yp,{scope:t.__scopeSelect,children:u.jsx(Ll.Slot,{scope:t.__scopeSelect,children:u.jsx("div",{children:t.children})})}),i):null}return u.jsx(Xp,{...t,ref:e})});Lh.displayName=zr;const On=10,[Yp,vr]=ti(zr),y4="SelectContentImpl",Xp=w.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:p,hideWhenDetached:b,avoidCollisions:v,...x}=t,y=Gn(zr,n),[$,S]=w.useState(null),[A,k]=w.useState(null),T=le(e,re=>S(re)),[I,E]=w.useState(null),[j,L]=w.useState(null),D=hs(n),[z,V]=w.useState(!1),W=w.useRef(!1);w.useEffect(()=>{if($)return Cp($)},[$]),Jo();const G=w.useCallback(re=>{const[xe,...ge]=D().map(ce=>ce.ref.current),[ve]=ge.slice(-1),he=document.activeElement;for(const ce of re)if(ce===he||(ce?.scrollIntoView({block:"nearest"}),ce===xe&&A&&(A.scrollTop=0),ce===ve&&A&&(A.scrollTop=A.scrollHeight),ce?.focus(),document.activeElement!==he))return},[D,A]),P=w.useCallback(()=>G([I,$]),[G,I,$]);w.useEffect(()=>{z&&P()},[z,P]);const{onOpenChange:_,triggerPointerDownPosRef:O}=y;w.useEffect(()=>{if($){let re={x:0,y:0};const xe=ve=>{re={x:Math.abs(Math.round(ve.pageX)-(O.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(O.current?.y??0))}},ge=ve=>{re.x<=10&&re.y<=10?ve.preventDefault():$.contains(ve.target)||_(!1),document.removeEventListener("pointermove",xe),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",ge,{capture:!0})}}},[$,_,O]),w.useEffect(()=>{const re=()=>_(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[_]);const[X,J]=n2(re=>{const xe=D().filter(he=>!he.disabled),ge=xe.find(he=>he.ref.current===document.activeElement),ve=r2(xe,re,ge);ve&&setTimeout(()=>ve.ref.current.focus())}),fe=w.useCallback((re,xe,ge)=>{const ve=!W.current&&!ge;(y.value!==void 0&&y.value===xe||ve)&&(E(re),ve&&(W.current=!0))},[y.value]),se=w.useCallback(()=>$?.focus(),[$]),pe=w.useCallback((re,xe,ge)=>{const ve=!W.current&&!ge;(y.value!==void 0&&(Array.isArray(xe)?xe.every(ce=>y.value?.includes(ce)):y.value===xe)||ve)&&L(re)},[y.value]),be=r==="popper"?Fd:Qp,Se=be===Fd?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:p,hideWhenDetached:b,avoidCollisions:v}:{};return u.jsx(Yp,{scope:n,content:$,viewport:A,onViewportChange:k,itemRefCallback:fe,selectedItem:I,onItemLeave:se,itemTextRefCallback:pe,focusSelectedItem:P,selectedItemText:j,position:r,isPositioned:z,searchRef:X,children:u.jsx($h,{as:yn,allowPinchZoom:!0,children:u.jsx(ei,{asChild:!0,trapped:y.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:U(o,re=>{y.trigger?.focus({preventScroll:!0}),document.getSelection()?.empty(),re.preventDefault()}),children:u.jsx(Xr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(be,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed","aria-multiselectable":y.multi?"true":void 0,dir:y.dir,onContextMenu:re=>re.preventDefault(),...x,...Se,onPlaced:()=>V(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:U(x.onKeyDown,re=>{const xe=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!xe&&re.key.length===1&&J(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let ve=D().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(re.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const he=re.target,ce=ve.indexOf(he);ve=ve.slice(ce+1)}setTimeout(()=>G(ve)),re.preventDefault()}})})})})})})});Xp.displayName=y4;const C4="SelectItemAlignedPosition",Qp=w.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,i=Gn(zr,n),s=vr(zr,n),[a,l]=w.useState(null),[c,d]=w.useState(null),h=le(e,T=>d(T)),f=hs(n),m=w.useRef(!1),p=w.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=s,$=w.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&v&&x){const T=i.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),j=x.getBoundingClientRect();if(i.dir!=="rtl"){const he=j.left-I.left,ce=E.left-he,je=T.left-ce,Te=T.width+je,ye=Math.max(Te,I.width),nt=window.innerWidth-On,mt=Nd(ce,[On,nt-ye]);a.style.minWidth=`${Te}px`,a.style.left=`${mt}px`}else{const he=I.right-j.right,ce=window.innerWidth-E.right-he,je=window.innerWidth-T.right-ce,Te=T.width+je,ye=Math.max(Te,I.width),nt=window.innerWidth-On,mt=Nd(ce,[On,nt-ye]);a.style.minWidth=`${Te}px`,a.style.right=`${mt}px`}const L=f(),D=window.innerHeight-On*2,z=b.scrollHeight,V=window.getComputedStyle(c),W=parseInt(V.borderTopWidth,10),G=parseInt(V.paddingTop,10),P=parseInt(V.borderBottomWidth,10),_=parseInt(V.paddingBottom,10),O=W+G+z+_+P,X=Math.min(v.offsetHeight*5,O),J=window.getComputedStyle(b),fe=parseInt(J.paddingTop,10),se=parseInt(J.paddingBottom,10),pe=T.top+T.height/2-On,be=D-pe,Se=v.offsetHeight/2,re=v.offsetTop+Se,xe=W+G+re,ge=O-xe;if(xe<=pe){const he=v===L[L.length-1].ref.current;a.style.bottom="0px";const ce=c.clientHeight-b.offsetTop-b.offsetHeight,je=Math.max(be,Se+(he?se:0)+ce+P),Te=xe+je;a.style.height=`${Te}px`}else{const he=v===L[0].ref.current;a.style.top="0px";const je=Math.max(pe,W+b.offsetTop+(he?fe:0)+Se)+ge;a.style.height=`${je}px`,b.scrollTop=xe-pe+b.offsetTop}a.style.margin=`${On}px 0`,a.style.minHeight=`${X}px`,a.style.maxHeight=`${D}px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,a,c,b,v,x,i.dir,r]);Be(()=>$(),[$]);const[S,A]=w.useState();Be(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const k=w.useCallback(T=>{T&&p.current===!0&&($(),y?.(),p.current=!1)},[$,y]);return u.jsx(S4,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(ie.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Qp.displayName=C4;const $4="SelectPopperPosition",Fd=w.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=On,...i}=t,s=Nl(n);return u.jsx(ls,{...s,...i,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Fd.displayName=$4;const[S4,Nh]=ti(zr,{}),Vd="SelectViewport",Bh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=vr(Vd,n),i=Nh(Vd,n),s=le(e,o.onViewportChange),a=w.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(Ll.Slot,{scope:n,children:u.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:U(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h?.current&&d){const f=Math.abs(a.current-c.scrollTop);if(f>0){const m=window.innerHeight-On*2,p=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(p,b);if(v<m){const x=v+f,y=Math.min(m,x),$=x-y;d.style.height=`${y}px`,d.style.bottom==="0px"&&(c.scrollTop=$>0?$:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});Bh.displayName=Vd;const Zp="SelectGroup",[A4,k4]=ti(Zp),Fh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=at();return u.jsx(A4,{scope:n,id:o,children:u.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:e})})});Fh.displayName=Zp;const Jp="SelectLabel",Vh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=k4(Jp,n);return u.jsx(ie.div,{id:o.id,...r,ref:e})});Vh.displayName=Jp;const Va="SelectItem",[T4,e2]=ti(Va),_h=w.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=t,a=Gn(Va,n),l=vr(Va,n),c=typeof r=="string"?Array.isArray(a.value)?a.value.includes(r):a.value===r:r.every(y=>a.value?.includes(y)),d=Array.isArray(a.value)&&Array.isArray(r)&&r.some(y=>a.value?.includes(y)),[h,f]=w.useState(i??""),[m,p]=w.useState(!1),b=le(e,y=>l.itemRefCallback?.(y,r,o)),v=at(),x=()=>{if(!o){let y=a.multi&&typeof r=="string"?[r]:r;d&&!c?a.onValueChange(y):Array.isArray(a.value)&&(y=o2(r,a.value)),a.onValueChange(y),a.multi||a.onOpenChange(!1)}};if(!a.multi&&Array.isArray(r))throw new Error("You can only pass an array of values in multi selects");return u.jsx(T4,{scope:n,value:r,disabled:o,textId:v,isSelected:c,isIntermediate:d,onItemTextChange:w.useCallback(y=>{f($=>$||(y?.textContent??"").trim())},[]),children:u.jsx(Ll.ItemSlot,{scope:n,value:r,disabled:o,textValue:h,children:u.jsx(ie.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":a.multi?void 0:c&&m,"aria-checked":a.multi?c:void 0,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:b,onFocus:U(s.onFocus,()=>p(!0)),onBlur:U(s.onBlur,()=>p(!1)),onPointerUp:U(s.onPointerUp,x),onPointerMove:U(s.onPointerMove,y=>{o?l.onItemLeave?.():y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:U(s.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(f4.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});_h.displayName=Va;const Ci="SelectItemText",zh=w.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...i}=t,s=Gn(Ci,n),a=vr(Ci,n),l=e2(Ci,n),c=v4(Ci,n),[d,h]=w.useState(null),f=le(e,x=>h(x),l.onItemTextChange,x=>a.itemTextRefCallback?.(x,l.value,l.disabled)),m=d?.textContent,p=w.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:m},Array.isArray(l.value)?l.value.join(";"):l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=c;return Be(()=>(b(p),()=>v(p)),[b,v,p]),u.jsxs(u.Fragment,{children:[u.jsx(ie.span,{id:l.textId,...i,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Yr.createPortal(i.children,s.valueNode):null]})});zh.displayName=Ci;const t2="SelectItemIndicator",Hh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t,i=e2(t2,n);return typeof r=="function"?u.jsx(ie.span,{"aria-hidden":!0,...o,ref:e,children:r({isSelected:i.isSelected,isIntermediate:i.isIntermediate})}):i.isSelected?u.jsx(ie.span,{"aria-hidden":!0,...o,ref:e,children:r}):null});Hh.displayName=t2;const _d="SelectScrollUpButton",Ph=w.forwardRef((t,e)=>{const n=vr(_d,t.__scopeSelect),r=Nh(_d,t.__scopeSelect),[o,i]=w.useState(!1),s=le(e,r.onScrollButtonChange);return Be(()=>{if(n.viewport&&n.isPositioned){const a=n.viewport,l=()=>{const c=a.scrollTop>0;i(c)};return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?u.jsx(qh,{...t,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop-=l.offsetHeight)}}):null});Ph.displayName=_d;const zd="SelectScrollDownButton",Wh=w.forwardRef((t,e)=>{const n=vr(zd,t.__scopeSelect),r=Nh(zd,t.__scopeSelect),[o,i]=w.useState(!1),s=le(e,r.onScrollButtonChange);return Be(()=>{if(n.viewport&&n.isPositioned){const a=n.viewport,l=()=>{const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;i(d)};return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?u.jsx(qh,{...t,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop+=l.offsetHeight)}}):null});Wh.displayName=zd;const qh=w.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,i=vr("SelectScrollButton",n),s=w.useRef(null),a=hs(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Be(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(ie.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerMove:U(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:U(o.onPointerLeave,()=>{l()})})});qh.displayName="SelectScrollButtonImpl";const R4="SelectSeparator",Uh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return u.jsx(ie.div,{"aria-hidden":!0,...r,ref:e})});Uh.displayName=R4;const Hd="SelectArrow",Kh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Nl(n),i=Gn(Hd,n),s=vr(Hd,n);return i.open&&s.position==="popper"?u.jsx(M6,{...o,...r,ref:e}):null});Kh.displayName=Hd;const M4="BubbleSelect",E4=w.forwardRef((t,e)=>{const{value:n,...r}=t,o=w.useRef(null),i=le(e,o),s=Dl(n),a=Gn(M4,void 0);w.useEffect(()=>{const c=o.current,d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==n&&f){const m=new Event("change",{bubbles:!0});f.call(c,n),c.dispatchEvent(m)}},[s,n]);let l=n;return a.multi&&!Array.isArray(n)&&(l=[]),u.jsx(fp,{asChild:!0,children:u.jsx("select",{...r,multiple:a.multi?!0:void 0,ref:i,defaultValue:l})})});E4.displayName="BubbleSelect";function n2(t){const e=Mh(t),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(s=>{const a=n.current+s;e(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function r2(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=I4(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function I4(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const o2=(t,e=[])=>{if(Array.isArray(t))return t.reduce((r,o)=>o2(o,r),e);const n=e.indexOf(t);return n===-1?[...e,t]:[...e.slice(0,n),...e.slice(n+1)]},j4=Eh,D4=Ih,O4=jh,L4=Dh,N4=Oh,B4=Lh,F4=Bh,V4=Fh,_4=Vh,z4=_h,H4=zh,P4=Hh,W4=Ph,q4=Wh,U4=Uh,K4=Kh,tn=Object.freeze(Object.defineProperty({__proto__:null,Arrow:K4,Content:B4,Group:V4,Icon:L4,Item:z4,ItemIndicator:P4,ItemText:H4,Label:_4,Portal:N4,Root:j4,ScrollDownButton:q4,ScrollUpButton:W4,Select:Eh,SelectArrow:Kh,SelectContent:Lh,SelectGroup:Fh,SelectIcon:Dh,SelectItem:_h,SelectItemIndicator:Hh,SelectItemText:zh,SelectLabel:Vh,SelectPortal:Oh,SelectScrollDownButton:Wh,SelectScrollUpButton:Ph,SelectSeparator:Uh,SelectTrigger:Ih,SelectValue:jh,SelectViewport:Bh,Separator:U4,Trigger:D4,Value:O4,Viewport:F4,createSelectScope:g4},Symbol.toStringTag,{value:"Module"}));function jr(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}const i2="Collapsible",[G4,s2]=qe(i2),[Y4,Gh]=G4(i2),X4=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=t,[l=!1,c]=it({prop:r,defaultProp:o,onChange:s});return g.createElement(Y4,{scope:n,disabled:i,contentId:at(),open:l,onOpenToggle:g.useCallback(()=>c(d=>!d),[c])},g.createElement(ie.div,F({"data-state":Yh(l),"data-disabled":i?"":void 0},a,{ref:e})))}),Q4="CollapsibleTrigger",Z4=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,o=Gh(Q4,n);return g.createElement(ie.button,F({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Yh(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:e,onClick:U(t.onClick,o.onOpenToggle)}))}),a2="CollapsibleContent",J4=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Gh(a2,t.__scopeCollapsible);return g.createElement(Qe,{present:n||o.open},({present:i})=>g.createElement(e$,F({},r,{ref:e,present:i})))}),e$=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=t,s=Gh(a2,n),[a,l]=g.useState(r),c=g.useRef(null),d=le(e,c),h=g.useRef(0),f=h.current,m=g.useRef(0),p=m.current,b=s.open||a,v=g.useRef(b),x=g.useRef();return g.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),Be(()=>{const y=c.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const $=y.getBoundingClientRect();h.current=$.height,m.current=$.width,v.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),l(r)}},[s.open,r]),g.createElement(ie.div,F({"data-state":Yh(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},i,{ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style}}),b&&o)});function Yh(t){return t?"open":"closed"}const t$=X4,n$=Z4,r$=J4,xr="Accordion",o$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Xh,i$,s$]=jl(xr),[Bl,mW]=qe(xr,[s$,s2]),Qh=s2(),l2=w.default.forwardRef((t,e)=>{const{type:n,...r}=t,o=r,i=r;return w.default.createElement(Xh.Provider,{scope:t.__scopeAccordion},n==="multiple"?w.default.createElement(d$,F({},i,{ref:e})):w.default.createElement(c$,F({},o,{ref:e})))});l2.propTypes={type(t){const e=t.value||t.defaultValue;return t.type&&!["single","multiple"].includes(t.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):t.type==="multiple"&&typeof e=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):t.type==="single"&&Array.isArray(e)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[c2,a$]=Bl(xr),[d2,l$]=Bl(xr,{collapsible:!1}),c$=w.default.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=t,[a,l]=it({prop:n,defaultProp:r,onChange:o});return w.default.createElement(c2,{scope:t.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:w.default.useCallback(()=>i&&l(""),[i,l])},w.default.createElement(d2,{scope:t.__scopeAccordion,collapsible:i},w.default.createElement(u2,F({},s,{ref:e}))))}),d$=w.default.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=t,[s=[],a]=it({prop:n,defaultProp:r,onChange:o}),l=w.default.useCallback(d=>a((h=[])=>[...h,d]),[a]),c=w.default.useCallback(d=>a((h=[])=>h.filter(f=>f!==d)),[a]);return w.default.createElement(c2,{scope:t.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},w.default.createElement(d2,{scope:t.__scopeAccordion,collapsible:!0},w.default.createElement(u2,F({},i,{ref:e}))))}),[u$,Fl]=Bl(xr),u2=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=t,a=w.default.useRef(null),l=le(a,e),c=i$(n),h=Qr(o)==="ltr",f=U(t.onKeyDown,m=>{var p;if(!o$.includes(m.key))return;const b=m.target,v=c().filter(E=>{var j;return!((j=E.ref.current)!==null&&j!==void 0&&j.disabled)}),x=v.findIndex(E=>E.ref.current===b),y=v.length;if(x===-1)return;m.preventDefault();let $=x;const S=0,A=y-1,k=()=>{$=x+1,$>A&&($=S)},T=()=>{$=x-1,$<S&&($=A)};switch(m.key){case"Home":$=S;break;case"End":$=A;break;case"ArrowRight":i==="horizontal"&&(h?k():T());break;case"ArrowDown":i==="vertical"&&k();break;case"ArrowLeft":i==="horizontal"&&(h?T():k());break;case"ArrowUp":i==="vertical"&&T();break}const I=$%y;(p=v[I].ref.current)===null||p===void 0||p.focus()});return w.default.createElement(u$,{scope:n,disabled:r,direction:o,orientation:i},w.default.createElement(Xh.Slot,{scope:n},w.default.createElement(ie.div,F({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:f}))))}),Pd="AccordionItem",[h$,Zh]=Bl(Pd),f$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...o}=t,i=Fl(Pd,n),s=a$(Pd,n),a=Qh(n),l=at(),c=r&&s.value.includes(r)||!1,d=i.disabled||t.disabled;return w.default.createElement(h$,{scope:n,open:c,disabled:d,triggerId:l},w.default.createElement(t$,F({"data-orientation":i.orientation,"data-state":h2(c)},a,o,{ref:e,disabled:d,open:c,onOpenChange:h=>{h?s.onItemOpen(r):s.onItemClose(r)}})))}),m$="AccordionHeader",g$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=Fl(xr,n),i=Zh(m$,n);return w.default.createElement(ie.h3,F({"data-orientation":o.orientation,"data-state":h2(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),F0="AccordionTrigger",p$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=Fl(xr,n),i=Zh(F0,n),s=l$(F0,n),a=Qh(n);return w.default.createElement(Xh.ItemSlot,{scope:n},w.default.createElement(n$,F({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:e})))}),b$="AccordionContent",v$=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=Fl(xr,n),i=Zh(b$,n),s=Qh(n);return w.default.createElement(r$,F({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}}))});function h2(t){return t?"open":"closed"}const x$=l2,w$=f$,y$=g$,C$=p$,$$=v$,S$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 2A12.014 12.014 0 0 0 4 14c0 3 1.57 6.883 4.201 10.375C10.85 27.894 13.764 30 16 30s5.151-2.101 7.799-5.625C26.43 20.875 28 17 28 14A12.014 12.014 0 0 0 16 2M8 14.5A1.5 1.5 0 0 1 9.5 13a4.5 4.5 0 0 1 4.5 4.5 1.5 1.5 0 0 1-1.5 1.5A4.5 4.5 0 0 1 8 14.5M18 25h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2m1.5-6a1.5 1.5 0 0 1-1.5-1.5 4.5 4.5 0 0 1 4.5-4.5 1.5 1.5 0 0 1 1.5 1.5 4.5 4.5 0 0 1-4.5 4.5"})})};g.forwardRef(S$);const A$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 6H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2v11a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V13a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2m-9 12h-6a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2m9-7H4V8h24z"})})};g.forwardRef(A$);const k$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.5 7v6a1.5 1.5 0 0 1-1.5 1.5h-6a1.5 1.5 0 0 1 0-3h2.137l-2.375-2.173-.047-.046a9.5 9.5 0 1 0-6.84 16.219H16a9.44 9.44 0 0 0 6.519-2.59 1.5 1.5 0 1 1 2.061 2.181A12.43 12.43 0 0 1 16 28.5h-.171a12.5 12.5 0 1 1 8.985-21.368L27.5 9.59V7a1.5 1.5 0 0 1 3 0"})})},T$=g.forwardRef(k$),R$=T$,M$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.061 19.061-9 9a1.503 1.503 0 0 1-2.125 0l-9-9a1.503 1.503 0 1 1 2.125-2.125l6.439 6.439V5a1.5 1.5 0 1 1 3 0v18.375l6.439-6.44a1.502 1.502 0 1 1 2.125 2.125z"})})};g.forwardRef(M$);const E$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H8.625l6.44 6.439a1.502 1.502 0 1 1-2.125 2.125l-9-9a1.5 1.5 0 0 1 0-2.125l9-9a1.503 1.503 0 0 1 2.125 2.125L8.625 14.5H27a1.5 1.5 0 0 1 1.5 1.5"})})};g.forwardRef(E$);const I$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:i,viewBox:"0 0 16 16",stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.75 8a.75.75 0 0 1-.75.75H6.813l3.22 3.22a.751.751 0 1 1-1.063 1.062l-4.5-4.5a.75.75 0 0 1 0-1.063l4.5-4.5a.751.751 0 0 1 1.063 1.063L6.813 7.25H14a.75.75 0 0 1 .75.75M2.5 1.75a.75.75 0 0 0-.75.75v11a.75.75 0 0 0 1.5 0v-11a.75.75 0 0 0-.75-.75"})})};g.forwardRef(I$);const j$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:i,viewBox:"0 0 16 16",stroke:s,ref:r,...n,children:u.jsx("path",{d:"M11.53 7.47a.75.75 0 0 1 0 1.062l-4.5 4.5a.751.751 0 1 1-1.062-1.063l3.22-3.219H2a.75.75 0 1 1 0-1.5h7.188L5.969 4.03a.751.751 0 1 1 1.063-1.062zm1.97-5.72a.75.75 0 0 0-.75.75v11a.75.75 0 0 0 1.5 0v-11a.75.75 0 0 0-.75-.75"})})};g.forwardRef(j$);const D$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m28.061 17.061-9 9a1.503 1.503 0 1 1-2.125-2.125l6.439-6.436H5a1.5 1.5 0 1 1 0-3h18.375l-6.436-6.44a1.503 1.503 0 0 1 2.125-2.125l9 9a1.5 1.5 0 0 1-.003 2.126"})})},O$=g.forwardRef(D$),L$=O$,N$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.061 15.061a1.5 1.5 0 0 1-2.125 0L17.5 8.625V27a1.5 1.5 0 1 1-3 0V8.625l-6.439 6.436a1.503 1.503 0 1 1-2.125-2.125l9-9a1.5 1.5 0 0 1 2.125 0l9 9a1.5 1.5 0 0 1 0 2.125"})})};g.forwardRef(N$);const B$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M11 13.5H5A1.5 1.5 0 0 1 3.5 12V6a1.5 1.5 0 0 1 3 0v1.733C8.581 5.683 11.786 3.5 16 3.5c5.558 0 8.92 3.299 9.061 3.439a1.5 1.5 0 0 1-2.117 2.125C22.889 9.01 20.25 6.5 16 6.5c-3.625 0-6.367 2.21-8 4h3a1.5 1.5 0 1 1 0 3m16 5h-6a1.5 1.5 0 1 0 0 3h3c-1.625 1.79-4.375 4-8 4-4.25 0-6.889-2.511-6.944-2.565A1.5 1.5 0 0 0 6.94 25.06c.141.141 3.504 3.44 9.061 3.44 4.214 0 7.419-2.183 9.5-4.233V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5"})})};g.forwardRef(B$);const F$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M220 48v48a12 12 0 0 1-24 0V77l-39.51 39.52a12 12 0 0 1-17-17L179 60h-19a12 12 0 0 1 0-24h48a12 12 0 0 1 12 12M99.51 139.51 60 179v-19a12 12 0 0 0-24 0v48a12 12 0 0 0 12 12h48a12 12 0 0 0 0-24H77l39.52-39.51a12 12 0 0 0-17-17Z"})})};g.forwardRef(F$);const V$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.725 21.993C27.031 20.798 26 17.416 26 13a10 10 0 0 0-20 0c0 4.418-1.032 7.797-1.726 8.993A2 2 0 0 0 6 25h5.101a5 5 0 0 0 9.798 0H26a2 2 0 0 0 1.725-3.008M16 27a3 3 0 0 1-2.828-2h5.656A3 3 0 0 1 16 27"})})};g.forwardRef(V$);const _$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22.135 14.308A6.001 6.001 0 0 0 17.5 4.5H9A1.5 1.5 0 0 0 7.5 6v19A1.5 1.5 0 0 0 9 26.5h10a6.5 6.5 0 0 0 3.135-12.192M10.5 7.5h7a3 3 0 0 1 0 6h-7zm8.5 16h-8.5v-7H19a3.5 3.5 0 1 1 0 7"})})};g.forwardRef(_$);const z$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 4v20a1 1 0 0 1-1 1H9a2 2 0 0 0-2 2h17a1 1 0 0 1 0 2H6a1 1 0 0 1-1-1V7a4 4 0 0 1 4-4h17a1 1 0 0 1 1 1"})})};g.forwardRef(z$);const H$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19 14a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m10-5v16a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V6a3 3 0 0 1 3-3h6a3 3 0 0 1 3 3v1h5a2 2 0 0 1 2 2M12 7h8V6a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1zm15 7.201V9H5v5.201A23 23 0 0 0 16 17a23 23 0 0 0 11-2.799"})})};g.forwardRef(H$);const P$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M9.5 8A1.5 1.5 0 0 1 11 6.5h16a1.5 1.5 0 0 1 0 3H11A1.5 1.5 0 0 1 9.5 8M27 14.5H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3m0 8H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3M5.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0-8a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 16a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})};g.forwardRef(P$);const W$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 4h-3V3a1 1 0 0 0-2 0v1H11V3a1 1 0 0 0-2 0v1H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 6H6V6h3v1a1 1 0 0 0 2 0V6h10v1a1 1 0 0 0 2 0V6h3z"})})},q$=g.forwardRef(W$),U$=q$,K$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 14h-1.35l-3.472-7.812A2 2 0 0 0 23.35 5H8.65a2 2 0 0 0-1.828 1.188L3.35 14H2a1 1 0 0 0 0 2h1v10a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2v-2h12v2a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V16h1a1 1 0 0 0 0-2m-20 6H8a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2m12 0a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2z"})})};g.forwardRef(K$);const G$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 12.708-10 10a1 1 0 0 1-1.415 0l-10-10A1 1 0 0 1 6 11h20a1 1 0 0 1 .707 1.707"})})},Y$=g.forwardRef(G$),ur=Y$,X$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.924 20.383A1 1 0 0 1 26 21H6a1 1 0 0 1-.708-1.707l10-10a1 1 0 0 1 1.415 0l10 10a1 1 0 0 1 .217 1.09"})})},Q$=g.forwardRef(X$),Z$=Q$,J$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M7 26a1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 3 3 0 0 1 3 3m-3-7a1 1 0 0 0 0 2 5 5 0 0 1 5 5 1 1 0 1 0 2 0 7.01 7.01 0 0 0-7-7m0-4a1 1 0 0 0 0 2 9.01 9.01 0 0 1 9 9 1 1 0 0 0 2 0A11.01 11.01 0 0 0 4 15M27 5H5a2 2 0 0 0-2 2v5a1 1 0 0 0 1 1 13.014 13.014 0 0 1 13 13 1 1 0 0 0 1 1h9a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2"})})};g.forwardRef(J$);const e8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25 3h-1a2 2 0 0 0-2 2v2h-3.5V5a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v2H10V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v5.586A1.98 1.98 0 0 0 5.586 12L7 13.414V27a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V13.414L26.414 12A1.98 1.98 0 0 0 27 10.586V5a2 2 0 0 0-2-2m-6 24h-6v-8a3 3 0 0 1 6 0z"})})};g.forwardRef(e8);const t8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-5-2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3-5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M25 24H7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v13h17a1 1 0 0 1 0 2"})})};g.forwardRef(t8);const n8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.094 14.443a12.8 12.8 0 0 1 2.914-6.72 2 2 0 0 1 2.953-.138l3.459 3.533a1.98 1.98 0 0 1 .211 2.56 3.2 3.2 0 0 0-.462.968.5.5 0 0 1-.478.354h-8.1a.5.5 0 0 1-.497-.557m14.08-11.435A2 2 0 0 0 15 5v5.084a1.98 1.98 0 0 0 1.656 1.97 4 4 0 0 1 .677 7.72.51.51 0 0 0-.333.476v8.154a.5.5 0 0 0 .558.5A13.04 13.04 0 0 0 29 16.185C29.094 9.4 23.899 3.61 17.174 3.008M14.656 19.77a4 4 0 0 1-2.425-2.427.51.51 0 0 0-.475-.343H3.59a.5.5 0 0 0-.5.556A13.01 13.01 0 0 0 14.443 28.91a.5.5 0 0 0 .556-.5V20.25a.51.51 0 0 0-.343-.48"})})};g.forwardRef(n8);const r8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m0 2a11 11 0 0 1 8.984 4.659L16 14.845zm0 22a11 11 0 0 1-8.984-4.659l18.97-10.951A11 11 0 0 1 16 27"})})};g.forwardRef(r8);const o8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.061 10.061-16 16a1.5 1.5 0 0 1-2.125 0l-7-7a1.504 1.504 0 0 1 2.125-2.125L12 22.875 26.939 7.939a1.502 1.502 0 1 1 2.125 2.125z"})})},i8=g.forwardRef(o8),fs=i8,s8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5.708 10.708-7 7a1 1 0 0 1-1.415 0l-3-3a1 1 0 0 1 1.415-1.415L14 18.586l6.293-6.293a1 1 0 0 1 1.415 1.415"})})},a8=g.forwardRef(s8),l8=a8,c8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M176.49 95.51a12 12 0 0 1 0 17l-56 56a12 12 0 0 1-17 0l-24-24a12 12 0 1 1 17-17L112 143l47.51-47.52a12 12 0 0 1 16.98.03M236 128A108 108 0 1 1 128 20a108.12 108.12 0 0 1 108 108m-24 0a84 84 0 1 0-84 84 84.09 84.09 0 0 0 84-84"})})};g.forwardRef(c8);const d8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m27.061 13.061-10 10a1.503 1.503 0 0 1-2.125 0l-10-10a1.503 1.503 0 1 1 2.125-2.125L16 19.875l8.939-8.94a1.502 1.502 0 1 1 2.125 2.125z"})})};g.forwardRef(d8);const u8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M21.061 24.939a1.503 1.503 0 0 1-2.125 2.125l-10-10a1.5 1.5 0 0 1 0-2.125l10-10a1.503 1.503 0 0 1 2.125 2.125L12.125 16z"})})},h8=g.forwardRef(u8),f2=h8,f8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m23.061 17.061-10 10a1.503 1.503 0 0 1-2.125-2.125L19.875 16l-8.936-8.939a1.502 1.502 0 1 1 2.125-2.125l10 10a1.5 1.5 0 0 1-.003 2.125"})})},m8=g.forwardRef(f8),Jh=m8,g8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.061 21.061a1.503 1.503 0 0 1-2.125 0L16 12.125l-8.939 8.936a1.503 1.503 0 0 1-2.125-2.125l10-10a1.5 1.5 0 0 1 2.125 0l10 10a1.5 1.5 0 0 1 0 2.125"})})};g.forwardRef(g8);const p8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m7 14h-7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v6h6a1 1 0 0 1 0 2"})})},b8=g.forwardRef(p8),v8=b8,x8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 16a12 12 0 0 1-20.236 8.728 1.002 1.002 0 0 1 1.375-1.456 10 10 0 1 0-.21-14.343c-.441.446-.857.885-1.26 1.321l2.039 2.043A1 1 0 0 1 9 14H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1.707-.707L6.25 8.838c.402-.437.817-.875 1.258-1.32A12 12 0 0 1 28 16M16 9a1 1 0 0 0-1 1v6a1 1 0 0 0 .485.858l5 3a.999.999 0 0 0 1.486-1.1 1 1 0 0 0-.456-.616L17 15.434V10a1 1 0 0 0-1-1"})})};g.forwardRef(x8);const w8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435C30.764 9.693 25.884 5 20.008 5"})})};g.forwardRef(w8);const y8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.991 15.565C30.764 9.693 25.884 5 20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435m-7.283 3.143a1 1 0 0 1-1.415 0L20 16.414V24a1 1 0 0 1-2 0v-7.586l-2.293 2.293a1 1 0 0 1-1.415-1.415l4-4a1 1 0 0 1 1.415 0l4 4a1 1 0 0 1 0 1.415"})})};g.forwardRef(y8);const C8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M8.96 12.153 4.342 16l4.618 3.848a1.5 1.5 0 1 1-1.92 2.305l-6-5a1.5 1.5 0 0 1 0-2.305l6-5a1.5 1.5 0 0 1 1.92 2.304m22 2.694-6-5a1.5 1.5 0 1 0-1.92 2.306L27.658 16l-4.618 3.848a1.5 1.5 0 1 0 1.92 2.305l6-5a1.5 1.5 0 0 0 0-2.305M20.512 3.59a1.5 1.5 0 0 0-1.922.898l-8 22a1.5 1.5 0 0 0 2.82 1.024l8-22a1.5 1.5 0 0 0-.898-1.922"})})};g.forwardRef(C8);const $8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M200 40h-32a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v80a16 16 0 0 0 16 16h8v64a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m-93.66 21.66a8 8 0 0 1 11.32-11.32l24 24a8 8 0 0 1 0 11.32l-24 24a8 8 0 0 1-11.32-11.32L124.69 80Zm-64 24a8 8 0 0 1 0-11.32l24-24a8 8 0 0 1 11.32 11.32L59.31 80l18.35 18.34a8 8 0 0 1-11.32 11.32ZM200 200H56v-64h96a16 16 0 0 0 16-16V56h32Z"})})};g.forwardRef($8);const S8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 10H4a1 1 0 0 0-1 1v6a12.04 12.04 0 0 0 4.068 9H4a1 1 0 0 0 0 2h22a1 1 0 0 0 0-2h-3.067a12.1 12.1 0 0 0 3.375-5.011A5 5 0 0 0 31 16v-1a5 5 0 0 0-5-5m3 6a3 3 0 0 1-2.15 2.875Q27 17.944 27 17v-4.828A3 3 0 0 1 29 15zM14 7V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m4 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m-8 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0"})})};g.forwardRef(S8);const A8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.743 13.401a1 1 0 0 0-.487-.675l-3.729-2.125-.015-4.202a1 1 0 0 0-.353-.76 14 14 0 0 0-4.59-2.584 1 1 0 0 0-.808.074L16 5.23l-3.765-2.106a1 1 0 0 0-.809-.075 14 14 0 0 0-4.585 2.594 1 1 0 0 0-.354.758L6.47 10.61 2.74 12.734a1 1 0 0 0-.486.675 13.3 13.3 0 0 0 0 5.195 1 1 0 0 0 .486.675l3.729 2.125.015 4.204a1 1 0 0 0 .353.76 14 14 0 0 0 4.59 2.583 1 1 0 0 0 .808-.073L16 26.768l3.765 2.107a1.013 1.013 0 0 0 .809.073 14 14 0 0 0 4.585-2.592 1 1 0 0 0 .354-.759l.018-4.206 3.729-2.125a1 1 0 0 0 .486-.675c.34-1.713.338-3.477-.003-5.19M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10"})})},k8=g.forwardRef(A8),T8=k8,R8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18.5 12V6a1.5 1.5 0 1 1 3 0v4.5H26a1.5 1.5 0 1 1 0 3h-6a1.5 1.5 0 0 1-1.5-1.5M12 18.5H6a1.5 1.5 0 1 0 0 3h4.5V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5m14 0h-6a1.5 1.5 0 0 0-1.5 1.5v6a1.5 1.5 0 1 0 3 0v-4.5H26a1.5 1.5 0 1 0 0-3m-14-14A1.5 1.5 0 0 0 10.5 6v4.5H6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 0 0 1.5-1.5V6A1.5 1.5 0 0 0 12 4.5"})})};g.forwardRef(R8);const M8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22.5 17.5h-2v-3h2a5 5 0 1 0-5-5v2h-3v-2a5 5 0 1 0-5 5h2v3h-2a5 5 0 1 0 5 5v-2h3v2a5 5 0 1 0 5-5m-2-8a2 2 0 1 1 2 2h-2zm-13 0a2 2 0 0 1 4 0v2h-2a2 2 0 0 1-2-2m4 13a2 2 0 1 1-2-2h2zm3-8h3v3h-3zm8 10a2 2 0 0 1-2-2v-2h2a2 2 0 0 1 0 4"})})};g.forwardRef(M8);const E8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.5 24a1.5 1.5 0 0 1-1.5 1.5h-3.5V29a1.5 1.5 0 1 1-3 0v-3.5H8A1.5 1.5 0 0 1 6.5 24V9.5H3a1.5 1.5 0 0 1 0-3h3.5V3a1.5 1.5 0 0 1 3 0v19.5H29a1.5 1.5 0 0 1 1.5 1.5M13 9.5h9.5V19a1.5 1.5 0 1 0 3 0V8A1.5 1.5 0 0 0 24 6.5H13a1.5 1.5 0 0 0 0 3"})})};g.forwardRef(E8);const I8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.061 23.939a1.503 1.503 0 0 1-2.125 2.125L16 18.125l-7.939 7.936a1.503 1.503 0 1 1-2.125-2.125L13.875 16 5.939 8.061a1.503 1.503 0 1 1 2.125-2.125L16 13.875l7.939-7.94a1.502 1.502 0 1 1 2.125 2.125L18.125 16z"})})},j8=g.forwardRef(I8),Zr=j8,D8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m4.708 16.293a1 1 0 0 1-1.415 1.415L16 17.414l-3.293 3.293a1 1 0 0 1-1.415-1.415L14.587 16l-3.293-3.293a1 1 0 1 1 1.415-1.415L16 14.587l3.293-3.293a1 1 0 0 1 1.415 1.415L17.414 16z"})})};g.forwardRef(D8);const O8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.48 9.524a1.51 1.51 0 0 0-1.668-.213l-6.276 3.125-5.24-8.704a1.514 1.514 0 0 0-2.592 0l-5.24 8.708L3.19 9.315a1.514 1.514 0 0 0-2.113 1.825l4.625 14.17a1 1 0 0 0 1.46.55C7.194 25.841 10.39 24 16 24s8.806 1.841 8.835 1.859a1 1 0 0 0 1.464-.549l4.625-14.166a1.51 1.51 0 0 0-.444-1.62M21.98 19.6a1 1 0 0 1-1.159.811 28.5 28.5 0 0 0-9.652 0 1 1 0 0 1-.348-1.97 30.6 30.6 0 0 1 10.348 0 1 1 0 0 1 .816 1.159z"})})};g.forwardRef(O8);const L8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.414 24a2 2 0 0 1 0 2.829l-.585.585a2 2 0 0 1-2.829 0l-6.906-6.905-2.735 6.292A1.98 1.98 0 0 1 12.533 28h-.098a1.98 1.98 0 0 1-1.801-1.375L4.1 6.615A1.994 1.994 0 0 1 6.615 4.1l20.01 6.534a2 2 0 0 1 .176 3.725l-6.292 2.735z"})})};g.forwardRef(L8);const N8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3C9.271 3 4 6.075 4 10v12c0 3.925 5.271 7 12 7s12-3.075 12-7V10c0-3.925-5.271-7-12-7m10 13c0 1.203-.985 2.429-2.701 3.365C21.366 20.419 18.774 21 16 21s-5.366-.581-7.299-1.635C6.985 18.429 6 17.203 6 16v-2.08C8.133 15.795 11.779 17 16 17s7.868-1.21 10-3.08zm-2.701 9.365C21.366 26.419 18.774 27 16 27s-5.366-.581-7.299-1.635C6.985 24.429 6 23.203 6 22v-2.08C8.133 21.795 11.779 23 16 23s7.868-1.21 10-3.08V22c0 1.203-.985 2.429-2.701 3.365"})})};g.forwardRef(N8);const B8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 12a2 2 0 0 0-2-2h-4V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v16a1 1 0 0 0 1.625.777L9 19.25V23a2 2 0 0 0 2 2h11.699l4.676 3.778A1 1 0 0 0 29 28zm-5.319 11.223a1 1 0 0 0-.625-.223H11v-4h10a2 2 0 0 0 2-2v-5h4v13.906z"})})};g.forwardRef(B8);const F8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-13.561 1.061a1.5 1.5 0 0 0 2.125 0l5-5a1.502 1.502 0 1 0-2.125-2.125L17.5 15.375V5a1.5 1.5 0 1 0-3 0v10.375l-2.439-2.436a1.502 1.502 0 1 0-2.125 2.125z"})})};g.forwardRef(F8);const V8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M13.5 7.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0m7 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4m-9 4.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4m-9 8.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})},_8=g.forwardRef(V8),z8=_8,H8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 4H11a1 1 0 0 0-1 1v5H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-5h5a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1m-1 16h-4v-9a1 1 0 0 0-1-1h-9V6h14z"})})};g.forwardRef(H8);const P8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m11 13c.001 1.411-.27 2.81-.8 4.118l-5.587-3.437a2 2 0 0 0-.78-.279l-2.853-.385a2.01 2.01 0 0 0-2 .983h-1.09l-.475-.983a1.99 1.99 0 0 0-1.375-1.083l-1-.216.978-1.718h2.088c.338 0 .67-.087.966-.25l1.532-.845q.202-.113.375-.268l3.364-3.042a1.99 1.99 0 0 0 .407-2.458l-.045-.08A11.01 11.01 0 0 1 27 16M5 16a10.94 10.94 0 0 1 1.068-4.725l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99a2.01 2.01 0 0 0 1.8 1.125h.186l-.904 2.029a2 2 0 0 0 .357 2.171l.018.018L16 25.742l-.242 1.25A11.014 11.014 0 0 1 5 16"})})},W8=g.forwardRef(P8),q8=W8,U8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:[u.jsx("path",{d:"M20.689 3.88A13 13 0 0 0 16 3a13 13 0 0 0-8.155 23.124l1.02-1.765A11 11 0 0 1 5 16a10.94 10.94 0 0 1 1.068-4.724l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99q.113.226.275.418l1.169-2.025-.121-.25a1.99 1.99 0 0 0-1.375-1.084l-1-.217.978-1.717h2.088c.338 0 .67-.087.966-.25l.726-.4z"}),u.jsx("path",{fillRule:"evenodd",d:"m24 2.144 1.732 1-1.58 2.736q.54.435 1.036.932A13.01 13.01 0 0 1 29 16a13 13 0 0 1-17.69 12.124l-1.578 2.732-1.732-1zm-.86 5.49-4.936 8.549 1.628.22c.277.037.543.132.78.278l5.588 3.436c.53-1.308.801-2.706.8-4.117a11.01 11.01 0 0 0-3.86-8.367M13.92 23.6l-1.593 2.76a11 11 0 0 0 3.43.631l.242-1.25z",clipRule:"evenodd"})]})};g.forwardRef(U8);const K8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10.365 7.5C20.579 21.724 18.441 23 16 23s-4.579-1.275-5.865-3.5a1.001 1.001 0 0 1 1.477-1.31q.157.129.253.31C12.799 20.114 14.266 21 16 21s3.201-.887 4.135-2.5a1 1 0 1 1 1.73 1M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(K8);const G8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10 10.865a1 1 0 0 1-1.365-.365C19.201 20.886 17.734 20 16 20s-3.201.887-4.135 2.5a1.001 1.001 0 1 1-1.73-1C11.421 19.276 13.559 18 16 18s4.579 1.275 5.865 3.5a1 1 0 0 1-.365 1.365M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(G8);const Y8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.5 6v5a1.5 1.5 0 1 1-3 0V7.5H21a1.5 1.5 0 0 1 0-3h5A1.5 1.5 0 0 1 27.5 6M11 24.5H7.5V21a1.5 1.5 0 0 0-3 0v5A1.5 1.5 0 0 0 6 27.5h5a1.5 1.5 0 1 0 0-3m15-5a1.5 1.5 0 0 0-1.5 1.5v3.5H21a1.5 1.5 0 1 0 0 3h5a1.5 1.5 0 0 0 1.5-1.5v-5a1.5 1.5 0 0 0-1.5-1.5m-15-15H6A1.5 1.5 0 0 0 4.5 6v5a1.5 1.5 0 0 0 3 0V7.5H11a1.5 1.5 0 0 0 0-3"})})};g.forwardRef(Y8);const X8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 13a1.5 1.5 0 1 1-3 0V8.625l-7.439 7.439a1.503 1.503 0 1 1-2.125-2.125L23.375 6.5H19a1.5 1.5 0 0 1 0-3h8A1.5 1.5 0 0 1 28.5 5zM23 16a1.5 1.5 0 0 0-1.5 1.5v8h-15v-15h8a1.5 1.5 0 1 0 0-3H6A2.5 2.5 0 0 0 3.5 10v16A2.5 2.5 0 0 0 6 28.5h16a2.5 2.5 0 0 0 2.5-2.5v-8.5A1.5 1.5 0 0 0 23 16"})})},Q8=g.forwardRef(X8),Z8=Q8,J8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.914 15.595c-.044-.099-1.103-2.447-3.457-4.801C24.322 7.657 20.36 6 16 6S7.679 7.657 4.542 10.794C2.19 13.148 1.125 15.5 1.086 15.595a1 1 0 0 0 0 .812c.044.1 1.103 2.447 3.456 4.8C7.68 24.344 11.64 26 16 26s8.321-1.657 11.458-4.792c2.353-2.354 3.412-4.702 3.456-4.8a1 1 0 0 0 0-.813M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10"})})},e7=g.forwardRef(J8),m2=e7,t7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M6.74 4.328a1 1 0 1 0-1.48 1.345l2.405 2.646c-4.54 2.786-6.493 7.081-6.579 7.276a1 1 0 0 0 0 .813c.044.098 1.103 2.446 3.456 4.8C7.68 24.343 11.64 26 16 26c2.24.013 4.459-.448 6.509-1.354l2.75 3.027a1 1 0 1 0 1.48-1.345zm11.125 15.21a4 4 0 0 1-5.209-5.73zm13.049-3.13c-.053.117-1.319 2.92-4.17 5.475a1 1 0 0 1-1.408-.072L12.675 7.884a1 1 0 0 1 .575-1.66A17 17 0 0 1 16 6c4.36 0 8.321 1.658 11.458 4.794 2.353 2.354 3.412 4.702 3.456 4.801a1 1 0 0 1 0 .813"})})},n7=g.forwardRef(t7),r7=n7,o7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17 15v12a1 1 0 0 1-2 0V15a1 1 0 0 1 2 0m8 9a1 1 0 0 0-1 1v2a1 1 0 0 0 2 0v-2a1 1 0 0 0-1-1m3-6h-2V5a1 1 0 0 0-2 0v13h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1M7 20a1 1 0 0 0-1 1v6a1 1 0 1 0 2 0v-6a1 1 0 0 0-1-1m3-6H8V5a1 1 0 0 0-2 0v9H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1m9-6h-2V5a1 1 0 0 0-2 0v3h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1"})})};g.forwardRef(o7);const i7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.48 16.851-7.474 7.559a1.97 1.97 0 0 1-1.4.585H9.415l-3.707 3.712a1.001 1.001 0 0 1-1.415-1.415l2.823-2.822L15.588 16h10.537a.5.5 0 0 1 .355.851m.607-13.03a8 8 0 0 0-10.737.518l-1.2 1.185a.5.5 0 0 0-.15.351v7.875l6.875-6.875a1 1 0 0 1 1.414 1.414L17.589 14h11.047a.5.5 0 0 0 .445-.27 8.01 8.01 0 0 0-1.994-9.909M7.854 20.904 13 15.758V8.845a.5.5 0 0 0-.851-.355L7.586 13A1.99 1.99 0 0 0 7 14.414v6.136a.5.5 0 0 0 .854.354"})})},s7=g.forwardRef(i7),a7=s7,l7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707M19 11V5.5l5.5 5.5z"})})};g.forwardRef(l7);const c7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m213.66 82.34-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44ZM48 180c0 11 7.18 20 16 20a14.18 14.18 0 0 0 10.06-4.5 8.21 8.21 0 0 1 10.9-.91 8 8 0 0 1 .82 11.81A30.06 30.06 0 0 1 64 216c-17.64 0-32-16.15-32-36s14.36-36 32-36a30 30 0 0 1 21.39 9.19 8.26 8.26 0 0 1 .73 11.09 8 8 0 0 1-11.9.38A14.17 14.17 0 0 0 64 160c-8.82 0-16 9-16 20m103.81 16.31a20.82 20.82 0 0 1-9.19 15.23C137.43 215 131 216 125.13 216a61.1 61.1 0 0 1-15.13-2 8 8 0 1 1 4.3-15.41c4.38 1.2 14.95 2.7 19.55-.36.88-.59 1.83-1.52 2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56 20.56 0 0 1 9-14.95c11.84-8 30.71-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54 4.54 0 0 0-2 3.67c-.12.9-.14 1.09 1.11 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.79 2.83 26.35 7.66 24.11 24.97M215.42 155l-19.89 55.68a8 8 0 0 1-15.06 0L160.58 155a8.21 8.21 0 0 1 4.5-10.45 8 8 0 0 1 10.45 4.76l12.47 34.9 12.47-34.9a8 8 0 0 1 10.45-4.76 8.23 8.23 0 0 1 4.5 10.45"})})};g.forwardRef(c7);const d7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707m-7 11a1 1 0 0 1-1.415 1.415L16 20.414l-2.293 2.293a1 1 0 0 1-1.415-1.415L14.587 19l-2.293-2.293a1 1 0 1 1 1.415-1.415L16 17.587l2.293-2.293a1 1 0 0 1 1.415 1.415L17.414 19zM19 11V5.5l5.5 5.5z"})})};g.forwardRef(d7);const u7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M6 15h20a1 1 0 0 0 1-1v-3a1 1 0 0 0-.293-.707l-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v9a1 1 0 0 0 1 1m13-9.5 5.5 5.5H19zM28 19a1 1 0 0 1-1 1h-3v2h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1M8 18H6a1 1 0 0 0-1 1v7a1 1 0 1 0 2 0v-1h1a3.5 3.5 0 1 0 0-7m0 5H7v-3h1a1.5 1.5 0 1 1 0 3m8-5h-2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h2a4.5 4.5 0 1 0 0-9m0 7h-1v-5h1a2.5 2.5 0 0 1 0 5"})})};g.forwardRef(u7);const h7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M44 120h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4m108-76 44 44h-44Zm4 164.53a8.18 8.18 0 0 1-8.25 7.47H120a8 8 0 0 1-8-8v-55.73a8.18 8.18 0 0 1 7.47-8.25 8 8 0 0 1 8.53 8v48h20a8 8 0 0 1 8 8.51m-61.49-51.88L77.83 180l16.68 23.35a8 8 0 0 1-13 9.3L68 193.76l-13.49 18.89a8 8 0 1 1-13-9.3L58.17 180l-16.68-23.35a8 8 0 0 1 2.3-11.46 8.19 8.19 0 0 1 10.88 2.38L68 166.24l13.49-18.89a8 8 0 0 1 13 9.3Zm121.28 39.66a20.81 20.81 0 0 1-9.18 15.23c-5.19 3.46-11.67 4.46-17.49 4.46a60.6 60.6 0 0 1-15.19-2 8 8 0 0 1 4.31-15.41c4.38 1.21 14.94 2.71 19.54-.35.89-.6 1.84-1.52 2.15-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58 20.58 0 0 1 8.95-14.94c11.84-8 30.72-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.48-1.17-15.22-2.56-19.82.56a4.54 4.54 0 0 0-2 3.67c-.11.9-.13 1.08 1.12 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.87 2.82 26.39 7.65 24.18 24.96"})})};g.forwardRef(h7);const f7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M184 144h-16a8 8 0 0 0-8 8v55.73a8.17 8.17 0 0 0 7.47 8.25 8 8 0 0 0 8.53-8v-8h7.4c15.24 0 28.14-11.92 28.59-27.15A28 28 0 0 0 184 144m-.35 40H176v-24h8a12 12 0 0 1 12 13.16A12.25 12.25 0 0 1 183.65 184M136 152v55.73a8.17 8.17 0 0 1-7.47 8.25 8 8 0 0 1-8.53-8v-55.71a8.17 8.17 0 0 1 7.47-8.25A8 8 0 0 1 136 152m-40 56.53a8.17 8.17 0 0 1-8.27 7.47h-31.5a8.27 8.27 0 0 1-6-2.5 8 8 0 0 1-1.18-9.5l25.16-44H56.27a8.17 8.17 0 0 1-8.27-7.47 8 8 0 0 1 8-8.53h31.77a8.27 8.27 0 0 1 6 2.5A8 8 0 0 1 95 156l-25.21 44H88a8 8 0 0 1 8 8.53M213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44Z"})})};g.forwardRef(f7);const m7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m13.687 4.146-2.5-2.5a.5.5 0 0 0-.354-.146h-5a1 1 0 0 0-1 1v1h-1a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-1h1a1 1 0 0 0 1-1v-7a.5.5 0 0 0-.146-.354M8.833 12h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1m0-2h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1m4 1.5h-1v-5a.5.5 0 0 0-.146-.354l-2.5-2.5a.5.5 0 0 0-.354-.146h-3v-1h4.793l2.207 2.207z"})})};g.forwardRef(m7);const g7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 16a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M29 8.5H3a1.5 1.5 0 0 0 0 3h26a1.5 1.5 0 1 0 0-3m-10 12h-6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(g7);const p7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 9H16.414L13 5.586A1.98 1.98 0 0 0 11.586 5H5a2 2 0 0 0-2 2v18.078A1.926 1.926 0 0 0 4.924 27H27.11A1.89 1.89 0 0 0 29 25.111V11a2 2 0 0 0-2-2M5 7h6.586l2 2H5z"})})};g.forwardRef(p7);const b7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 9h-4.385q.075-.06.146-.125A3.7 3.7 0 0 0 24 6.196 4.08 4.08 0 0 0 19.805 2a3.7 3.7 0 0 0-2.68 1.239A6.9 6.9 0 0 0 16 5.049a6.9 6.9 0 0 0-1.125-1.81A3.7 3.7 0 0 0 12.195 2 4.08 4.08 0 0 0 8 6.196a3.7 3.7 0 0 0 1.239 2.679q.072.06.146.125H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2v8a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V15H5v-4h10v4h2v-4h10v4H17v11.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-8a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2M10.564 7.375A1.7 1.7 0 0 1 10 6.125 2.076 2.076 0 0 1 12.074 4h.061a1.71 1.71 0 0 1 1.25.563c1.049 1.185 1.419 3.15 1.549 4.365-1.22-.13-3.184-.5-4.37-1.553m10.875 0c-1.186 1.05-3.155 1.42-4.375 1.55.148-1.314.561-3.237 1.561-4.361A1.7 1.7 0 0 1 19.875 4h.061A2.077 2.077 0 0 1 22 6.135a1.7 1.7 0 0 1-.564 1.24z"})})};g.forwardRef(b7);const v7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m9.796 8h-4.428a17.8 17.8 0 0 0-2.533-5.625A11.05 11.05 0 0 1 25.796 11M16 5.014c1.5 1.625 2.625 3.693 3.296 5.986h-6.592C13.375 8.707 14.5 6.641 16 5.014M12 16c0-1.005.084-2.009.25-3h7.5a18.2 18.2 0 0 1 0 6h-7.5a18 18 0 0 1-.25-3m.704 5h6.592c-.671 2.293-1.796 4.359-3.296 5.986-1.5-1.627-2.625-3.693-3.296-5.986m6.131 5.625A17.8 17.8 0 0 0 21.367 21h4.43a11.05 11.05 0 0 1-6.962 5.625M21.776 19a20.2 20.2 0 0 0 0-6h4.808a11 11 0 0 1 0 6z"})})};g.forwardRef(v7);const x7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M13 9.5c-.357 0-.71.085-1.028.25l-1.337-1.04a2.2 2.2 0 0 0 .116-.67l.646-.214a2.25 2.25 0 1 0-.636-1.37l-.487.162A2.25 2.25 0 0 0 8.5 5.75c-.062 0-.117 0-.175.008l-.278-.625A2.25 2.25 0 1 0 6.5 5.75c.063 0 .118 0 .176-.008l.278.625a2.24 2.24 0 0 0-.537 2.482l-1.33 1.182a2.25 2.25 0 1 0 .997 1.12l1.33-1.182a2.25 2.25 0 0 0 2.3-.075l1.224.954A2.25 2.25 0 1 0 13.001 9.5m0-4A.75.75 0 1 1 13 7a.75.75 0 0 1 0-1.5m-7.25-2a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0M4 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5M7.75 8a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0M13 12.5a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5"})})};g.forwardRef(x7);const w7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M13.29 28.226 6.765 24.46a2.822 2.822 0 1 1-2.708-4.693v-7.532a2.824 2.824 0 1 1 2.708-4.693l6.525-3.767a2.824 2.824 0 1 1 5.42 0l6.524 3.766a2.822 2.822 0 1 1 2.71 4.693v7.533a2.824 2.824 0 1 1-2.71 4.694l-6.524 3.766A2.825 2.825 0 0 1 16 31.84a2.822 2.822 0 0 1-2.71-3.614M16 5.806q.413-.002.791-.113l8.531 14.776a2.8 2.8 0 0 0-.791 1.37H7.467a2.8 2.8 0 0 0-.79-1.369L15.21 5.693q.377.11.791.112M7.468 23.178l-.033.12 6.526 3.767A2.81 2.81 0 0 1 16 26.195c.802 0 1.526.334 2.04.871l6.523-3.766-.032-.121zM5.397 12.233a2.824 2.824 0 0 0 2.038-3.532l6.526-3.767q.043.045.088.088L5.517 19.8l-.12-.032zM26.482 19.8q.06-.018.121-.033v-7.532a2.824 2.824 0 0 1-2.04-3.534L18.04 4.934q-.045.045-.089.088z",clipRule:"evenodd"})})};g.forwardRef(w7);const y7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 7v7.5a.5.5 0 0 1-.5.5H17V5.5a.5.5 0 0 1 .5-.5H25a2 2 0 0 1 2 2M14.5 5H7a2 2 0 0 0-2 2v7.5a.5.5 0 0 0 .5.5H15V5.5a.5.5 0 0 0-.5-.5m12 12H17v9.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-7.5a.5.5 0 0 0-.5-.5M5 17.5V25a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V17H5.5a.5.5 0 0 0-.5.5"})})};g.forwardRef(y7);const C7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10.5 6.5v5h-7A.5.5 0 0 1 3 11V8a2 2 0 0 1 2-2h5a.5.5 0 0 1 .5.5m2 19a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5v-5h-7zM3 21v3a2 2 0 0 0 2 2h5a.5.5 0 0 0 .5-.5v-5h-7a.5.5 0 0 0-.5.5m0-7v4a.5.5 0 0 0 .5.5h7v-5h-7a.5.5 0 0 0-.5.5m16-8h-6a.5.5 0 0 0-.5.5v5h7v-5A.5.5 0 0 0 19 6m9.5 7.5h-7v5h7a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-.5-.5m-16 5h7v-5h-7zM27 6h-5a.5.5 0 0 0-.5.5v5h7a.5.5 0 0 0 .5-.5V8a2 2 0 0 0-2-2m1.5 14.5h-7v5a.5.5 0 0 0 .5.5h5a2 2 0 0 0 2-2v-3a.5.5 0 0 0-.5-.5"})})};g.forwardRef(C7);const $7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.791 17.633a3.04 3.04 0 0 0-2.326-.597C28.813 14.666 30 12.31 30 10c0-3.309-2.661-6-5.933-6A5.95 5.95 0 0 0 19.5 6.094 5.95 5.95 0 0 0 14.932 4C11.663 4 9 6.691 9 10c0 1.375.405 2.711 1.258 4.125a4 4 0 0 0-1.844 1.05L5.586 18H2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h13q.123 0 .242-.03l8-2a1 1 0 0 0 .15-.05l4.858-2.067.055-.025a3.074 3.074 0 0 0 .491-5.195zm-1.362 3.393-4.75 2.023L14.875 25H7v-5.586l2.829-2.828A1.98 1.98 0 0 1 11.242 16H17.5a1.5 1.5 0 0 1 0 3H14a1 1 0 0 0 0 2h4q.113 0 .224-.025l8.375-1.926.038-.01a1.075 1.075 0 0 1 .788 1.987z"})})};g.forwardRef($7);const S7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 10.5h-5.475l.951-5.231a1.5 1.5 0 1 0-2.952-.538L19.475 10.5h-4.95l.951-5.231a1.5 1.5 0 1 0-2.952-.538L11.475 10.5H6a1.5 1.5 0 0 0 0 3h4.93l-.909 5H4a1.5 1.5 0 0 0 0 3h5.475l-.951 5.231a1.5 1.5 0 0 0 1.207 1.75q.134.022.269.019a1.5 1.5 0 0 0 1.475-1.233l1.05-5.767h4.95l-.951 5.231a1.5 1.5 0 1 0 2.952.543l1.049-5.774H26a1.5 1.5 0 1 0 0-3h-4.93l.909-5H28a1.5 1.5 0 1 0 0-3m-9.979 8H13.07l.909-5h4.951z"})})};g.forwardRef(S7);const A7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31.5 22.5a5 5 0 0 1-5 5 4.94 4.94 0 0 1-3.571-1.45 1.5 1.5 0 0 1 2.142-2.1 1.94 1.94 0 0 0 1.429.55 2 2 0 0 0 0-4 1.94 1.94 0 0 0-1.429.55 1.5 1.5 0 0 1-2.551-1.3l1-6A1.5 1.5 0 0 1 25 12.5h5a1.5 1.5 0 1 1 0 3h-3.729l-.338 2.029q.283-.03.567-.029a5 5 0 0 1 5 5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(A7);const k7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M32 22a1.5 1.5 0 0 1-1.5 1.5V26a1.5 1.5 0 1 1-3 0v-2.5H23a1.5 1.5 0 0 1-1.422-1.974l3-9a1.5 1.5 0 0 1 2.845.948L25.08 20.5H27.5V18a1.5 1.5 0 1 1 3 0v2.5A1.5 1.5 0 0 1 32 22M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(k7);const T7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.5 14v12a1.5 1.5 0 1 1-3 0v-9.198l-.668.448a1.503 1.503 0 0 1-1.665-2.5l3-2A1.5 1.5 0 0 1 29.5 14M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(T7);const R7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m27.133 17.541 1.655-2.772a1.5 1.5 0 1 0-2.576-1.538l-4.03 6.75q-.018.029-.032.059a5 5 0 1 0 4.983-2.5zM26.5 24.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0"})})};g.forwardRef(R7);const M7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31.5 22.5a5 5 0 0 1-8.571 3.5 1.5 1.5 0 1 1 2.142-2.099A2 2 0 1 0 26.5 20.5a1.5 1.5 0 0 1-1.229-2.36l1.854-2.64H24a1.5 1.5 0 1 1 0-3h6a1.5 1.5 0 0 1 1.229 2.36l-2.293 3.275A5 5 0 0 1 31.5 22.5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};g.forwardRef(M7);const E7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0M30 24.5h-3l3.593-4.791a4.499 4.499 0 1 0-7.837-4.209 1.5 1.5 0 1 0 2.829 1q.076-.218.216-.402a1.5 1.5 0 1 1 2.394 1.807L22.8 25.1a1.5 1.5 0 0 0 1.2 2.4h6a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(E7);const I7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 17v7a3 3 0 0 1-3 3h-2a3 3 0 0 1-3-3v-5a3 3 0 0 1 3-3h2.956A10.964 10.964 0 0 0 16.081 6H16A11 11 0 0 0 5.045 16H8a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a13.014 13.014 0 0 1 22.236-9.167A12.93 12.93 0 0 1 29 17"})})};g.forwardRef(I7);const j7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 11.75c0 8.75-12.974 15.833-13.526 16.125a1 1 0 0 1-.948 0C14.974 27.582 2 20.5 2 11.75A7.76 7.76 0 0 1 9.75 4c2.581 0 4.841 1.11 6.25 2.986C17.409 5.11 19.669 4 22.25 4A7.76 7.76 0 0 1 30 11.75"})})};g.forwardRef(j7);const D7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 14.444V26a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V14.444a2 2 0 0 1 .646-1.473l10-9.435.014-.013a2 2 0 0 1 2.705.013l10 9.435A2 2 0 0 1 28 14.444"})})};g.forwardRef(D7);const O7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-7.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M5 25v-3.5l6.5-6.5 10 10zm22 0h-2.671l-4.5-4.5 2.5-2.5L27 22.672z"})})};g.forwardRef(O7);const L7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H9a2 2 0 0 0-2 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-2h2a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M23 25H5V11h2v10a2 2 0 0 0 2 2h14zm4-4H9v-4.5l4.5-4.5 6.208 6.208a1 1 0 0 0 1.413 0L24.33 15 27 17.672z"})})};g.forwardRef(L7);const N7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 0 0 0-3m-18-4a1.5 1.5 0 0 0 1.061-2.561L6.125 12l3.936-3.94a1.503 1.503 0 1 0-2.125-2.125l-5 5a1.5 1.5 0 0 0 0 2.125l5 5A1.5 1.5 0 0 0 9 18.5"})})};g.forwardRef(N7);const B7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 0 0 0 3h22a1.5 1.5 0 1 0 0-3M3.939 18.06a1.5 1.5 0 0 0 2.125 0l5-5a1.5 1.5 0 0 0 0-2.125l-5-5a1.503 1.503 0 0 0-2.125 2.125L7.875 12l-3.936 3.939a1.5 1.5 0 0 0 0 2.122"})})};g.forwardRef(B7);const F7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M17 23a2 2 0 0 1-2-2v-5a1 1 0 0 1 0-2 2 2 0 0 1 2 2v5a1 1 0 0 1 0 2"})})},V7=g.forwardRef(F7),g2=V7,_7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 7A1.5 1.5 0 0 1 24 8.5h-3.919l-5 15H18a1.5 1.5 0 1 1 0 3H8a1.5 1.5 0 1 1 0-3h3.919l5-15H14a1.5 1.5 0 0 1 0-3h10A1.5 1.5 0 0 1 25.5 7"})})};g.forwardRef(_7);const z7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20 2a10.01 10.01 0 0 0-9.511 13.098l-7.196 7.195A1 1 0 0 0 3 23v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 .707-.293l1.195-1.196A10 10 0 1 0 20 2m2.5 9.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4"})})};g.forwardRef(z7);const H7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M5 7h22v5H5zm22 18H14V14h13z"})})};g.forwardRef(H7);const P7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22 29a1 1 0 0 1-1 1H11a1 1 0 1 1 0-2h10a1 1 0 0 1 1 1m5-16a10.94 10.94 0 0 1-4.205 8.651A2.03 2.03 0 0 0 22 23.25V24a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-.75a2 2 0 0 0-.779-1.582A10.95 10.95 0 0 1 5 13.06C4.967 7.104 9.782 2.143 15.735 2A11 11 0 0 1 27 13m-4.014-1.168a7.2 7.2 0 0 0-5.82-5.818 1 1 0 1 0-.332 1.972c2.071.349 3.829 2.106 4.18 4.182a1 1 0 0 0 1.972-.335"})})};g.forwardRef(P7);const W7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m21.731 14.683-14 15a1 1 0 0 1-1.711-.875l1.832-9.167L.65 16.936a1 1 0 0 1-.375-1.625l14-15a1 1 0 0 1 1.71.875l-1.837 9.177 7.204 2.7a1 1 0 0 1 .375 1.62z"})})};g.forwardRef(W7);const q7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17.046 23.441a1.5 1.5 0 0 1 0 2.125l-.742.743a7.502 7.502 0 1 1-10.61-10.61l3.015-3.014A7.5 7.5 0 0 1 19 12.375a1.506 1.506 0 0 1-2 2.25 4.5 4.5 0 0 0-6.171.184l-3.013 3.01a4.5 4.5 0 0 0 6.365 6.365l.743-.743a1.5 1.5 0 0 1 2.122 0m9.26-17.75a7.51 7.51 0 0 0-10.61 0l-.742.743a1.503 1.503 0 1 0 2.125 2.125l.742-.743a4.5 4.5 0 0 1 6.365 6.365l-3.014 3.015a4.5 4.5 0 0 1-6.172.179 1.506 1.506 0 1 0-2 2.25 7.5 7.5 0 0 0 10.288-.304l3.014-3.014a7.51 7.51 0 0 0 .004-10.613z"})})},U7=g.forwardRef(q7),K7=U7,G7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M5 9.5h22a1.5 1.5 0 0 0 0-3H5a1.5 1.5 0 0 0 0 3m22 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(G7);const Y7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 17.5h22a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m13 5H5a1.5 1.5 0 1 0 0 3h13a1.5 1.5 0 1 0 0-3m11 0h-1.5V21a1.5 1.5 0 1 0-3 0v1.5H23a1.5 1.5 0 1 0 0 3h1.5V27a1.5 1.5 0 1 0 3 0v-1.5H29a1.5 1.5 0 1 0 0-3"})})},X7=g.forwardRef(Y7),Q7=X7,Z7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 64a12 12 0 0 1 12-12h176a12 12 0 0 1 0 24H40a12 12 0 0 1-12-12m12 76h64a12 12 0 0 0 0-24H40a12 12 0 0 0 0 24m80 40H40a12 12 0 0 0 0 24h80a12 12 0 0 0 0-24m120.49 20.49a12 12 0 0 1-17 0l-18.08-18.08a44 44 0 1 1 17-17l18.08 18.07a12 12 0 0 1 0 17.01M184 164a20 20 0 1 0-20-20 20 20 0 0 0 20 20"})})};g.forwardRef(Z7);const J7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17.5 4v4a1.5 1.5 0 1 1-3 0V4a1.5 1.5 0 1 1 3 0m4.156 7.844a1.5 1.5 0 0 0 1.062-.44l2.828-2.829a1.503 1.503 0 1 0-2.125-2.125l-2.825 2.833a1.5 1.5 0 0 0 1.06 2.56M28 14.5h-4a1.5 1.5 0 1 0 0 3h4a1.5 1.5 0 1 0 0-3m-5.282 6.096a1.501 1.501 0 0 0-2.451 1.638c.075.182.186.348.326.487l2.828 2.829a1.503 1.503 0 0 0 2.125-2.125zM16 22.5a1.5 1.5 0 0 0-1.5 1.5v4a1.5 1.5 0 1 0 3 0v-4a1.5 1.5 0 0 0-1.5-1.5m-6.717-1.904-2.83 2.829A1.503 1.503 0 0 0 8.58 25.55l2.829-2.829a1.503 1.503 0 0 0-2.125-2.125M9.5 16A1.5 1.5 0 0 0 8 14.5H4a1.5 1.5 0 1 0 0 3h4A1.5 1.5 0 0 0 9.5 16m-.925-9.546A1.503 1.503 0 0 0 6.45 8.579l2.833 2.825a1.503 1.503 0 0 0 2.125-2.125z"})})},eS=g.forwardRef(J7),p2=eS,tS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 10h-4V7a6 6 0 1 0-12 0v3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V12a2 2 0 0 0-2-2M16 20.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M20 10h-8V7a4 4 0 1 1 8 0z"})})};g.forwardRef(tS);const nS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31 19a1 1 0 0 1-1 1h-2v2a1 1 0 0 1-2 0v-2h-2a1 1 0 0 1 0-2h2v-2a1 1 0 1 1 2 0v2h2a1 1 0 0 1 1 1M7 9h2v2a1 1 0 1 0 2 0V9h2a1 1 0 0 0 0-2h-2V5a1 1 0 0 0-2 0v2H7a1 1 0 0 0 0 2m16 15h-1v-1a1 1 0 0 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 1 0 2 0v-1h1a1 1 0 0 0 0-2m4.414-14L10 27.414a2 2 0 0 1-2.828 0l-2.587-2.585a2 2 0 0 1 0-2.829L22 4.586a2 2 0 0 1 2.829 0l2.585 2.585a2 2 0 0 1 0 2.829M26 8.586 23.414 6l-4 4L22 12.586z"})})};g.forwardRef(nS);const rS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 6H4a1 1 0 0 0-1 1v17a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a1 1 0 0 0-1-1M12.339 16 5 22.726V9.274zm1.48 1.356 1.5 1.381a1 1 0 0 0 1.352 0l1.5-1.38L25.421 24H6.571zM19.66 16 27 9.273v13.455z"})})};g.forwardRef(rS);const oS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M11 7q0 .432-.088.838L16 10.382l5.088-2.544a4 4 0 1 1 .895 1.789L18.236 11.5l3.747 1.873a4 4 0 1 1 0 5.253L18.236 20.5l3.747 1.874a4 4 0 1 1-.895 1.788L16 21.618l-5.088 2.544Q11 24.567 11 25a4 4 0 1 1-.983-2.626l3.747-1.874-3.747-1.873a4 4 0 1 1 0-5.253l3.747-1.874-3.747-1.874A4 4 0 1 1 11 7M9 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m2.236 8h9.528L16 12.618zM9 25a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4M27 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4m2-11a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-11 3.382L20.764 17h-9.528z",clipRule:"evenodd"})})};g.forwardRef(oS);const iS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M14.8 8.254a4 4 0 1 0-1.082 1.682l7.483 4.81a4 4 0 0 0-.075.254H10.874A4.002 4.002 0 0 0 3 16a4 4 0 0 0 7.874 1h10.252q.033.128.075.254l-7.484 4.81a4 4 0 1 0 1.082 1.682l7.484-4.81a4 4 0 1 0 0-5.871zM11 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4M9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0m16 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};g.forwardRef(iS);const sS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M18.842 3.227a1 1 0 1 0-.445 1.95l1.747.399L9.6 12.959a4 4 0 1 0 0 6.081l10.546 7.385-1.748.399a1 1 0 1 0 .445 1.95l3.945-.9a1 1 0 0 0 .77-1.1l-.503-4.014a1 1 0 0 0-1.985.248l.223 1.779-10.545-7.384a4 4 0 0 0 .127-.403h14.712l-1.293 1.293a1 1 0 1 0 1.414 1.414l3-3a1 1 0 0 0 0-1.414l-3-3a1 1 0 0 0-1.414 1.414L25.586 15H10.874a4 4 0 0 0-.127-.403l10.544-7.383-.222 1.778a1 1 0 0 0 1.984.249l.503-4.015a1 1 0 0 0-.77-1.099zM9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0",clipRule:"evenodd"})})};g.forwardRef(sS);const aS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 6H5a2 2 0 0 0-2 2v20a1.98 1.98 0 0 0 1.156 1.813 1.986 1.986 0 0 0 2.141-.299L10.312 26H27a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2M10.5 17.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(aS);const lS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10 16V8a6 6 0 1 1 12 0v8a6 6 0 1 1-12 0m16 0a1 1 0 0 0-2 0 8 8 0 0 1-16 0 1 1 0 1 0-2 0 10.014 10.014 0 0 0 9 9.95V29a1 1 0 0 0 2 0v-3.05A10.014 10.014 0 0 0 26 16"})})};g.forwardRef(lS);const cS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5"})})},dS=g.forwardRef(cS),b2=dS,uS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5 14H11a1 1 0 0 1 0-2h10a1 1 0 0 1 0 2"})})};g.forwardRef(uS);const hS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 5H6a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h20a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3M20 27h-8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2"})})};g.forwardRef(hS);const fS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.443 18.776a13.1 13.1 0 0 1-4.626 6.614A13 13 0 0 1 4 15a12.9 12.9 0 0 1 2.61-7.815 13.1 13.1 0 0 1 6.614-4.625 1 1 0 0 1 1.25 1.25 11.01 11.01 0 0 0 13.725 13.725 1 1 0 0 1 1.25 1.25z"})})};g.forwardRef(fS);const mS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0M7.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m17 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})};g.forwardRef(mS);const gS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10.939 8.061a1.5 1.5 0 0 1 0-2.125l4-4a1.5 1.5 0 0 1 2.125 0l4 4a1.503 1.503 0 1 1-2.125 2.125L17.5 6.625V12a1.5 1.5 0 1 1-3 0V6.625l-1.439 1.436a1.5 1.5 0 0 1-2.122 0m8 15.875L17.5 25.375V20a1.5 1.5 0 1 0-3 0v5.375l-1.439-1.44a1.504 1.504 0 0 0-2.125 2.125l4 4a1.5 1.5 0 0 0 2.125 0l4-4a1.502 1.502 0 1 0-2.125-2.125zm11.125-9-4-4a1.503 1.503 0 0 0-2.125 2.125l1.436 1.439H20a1.5 1.5 0 0 0 0 3h5.375l-1.44 1.439a1.503 1.503 0 0 0 2.125 2.125l4-4a1.5 1.5 0 0 0 .001-2.125zM6.625 17.5H12a1.5 1.5 0 1 0 0-3H6.625l1.44-1.439a1.503 1.503 0 1 0-2.125-2.125l-4 4a1.5 1.5 0 0 0 0 2.125l4 4a1.503 1.503 0 0 0 2.125-2.125z"})})};g.forwardRef(gS);const pS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.615 3.214a.99.99 0 0 0-.857-.183l-16 4a1 1 0 0 0-.758.97v13.762a4.5 4.5 0 1 0 2 3.737V13.781l14-3.5v7.482a4.5 4.5 0 1 0 2 3.737V4a1 1 0 0 0-.385-.786"})})};g.forwardRef(pS);const bS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H14.5a1.5 1.5 0 1 1 0-3H27a1.5 1.5 0 0 1 1.5 1.5m-14-6.5H27a1.5 1.5 0 0 0 0-3H14.5a1.5 1.5 0 0 0 0 3m12.5 13H14.5a1.5 1.5 0 1 0 0 3H27a1.5 1.5 0 1 0 0-3M5.5 7.414V13a1.5 1.5 0 0 0 3 0V5a1.5 1.5 0 0 0-2.17-1.341l-2 1a1.5 1.5 0 0 0 1.17 2.75zm4.966 12.107a3.46 3.46 0 0 0-1.4-2.329 3.61 3.61 0 0 0-4.954.683 3.5 3.5 0 0 0-.52.942 1.5 1.5 0 0 0 2.818 1.027.5.5 0 0 1 .072-.125.6.6 0 0 1 .813-.103.48.48 0 0 1 .201.325.45.45 0 0 1-.096.347l-.016.02-3.585 4.794A1.5 1.5 0 0 0 5 27.5h4a1.5 1.5 0 1 0 0-3H8l1.785-2.389a3.43 3.43 0 0 0 .681-2.59"})})};g.forwardRef(bS);const vS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M17.2 8.254a4 4 0 1 1 1.082 1.682l-7.482 4.81q.04.125.074.254h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1H10.874q-.033.128-.075.254l7.484 4.81a4 4 0 1 1-1.082 1.682l-7.484-4.81a4 4 0 1 1 0-5.871zM21 9a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4m2-11a2 2 0 1 0 4 0 2 2 0 0 0-4 0M7 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4",clipRule:"evenodd"})})};g.forwardRef(vS);const xS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M10.874 17A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1zM7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m18 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};g.forwardRef(xS);const wS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M28.924 16.384c-.05.12-.124.231-.217.324l-4 4a1 1 0 0 1-1.632-.324 1 1 0 0 1 .217-1.09L25.585 17H10.875A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h14.712l-2.294-2.293a1 1 0 0 1 1.415-1.415l4 4a1 1 0 0 1 .217 1.09M7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};g.forwardRef(wS);const yS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 4a1 1 0 0 0-1-1c-5.51 0-11.164 6.214-14.304 10.329A7.5 7.5 0 0 0 4 20.5c0 3.86-2.443 5.591-2.559 5.671A1 1 0 0 0 2 28h9.5a7.5 7.5 0 0 0 7.171-9.696C22.788 15.164 29 9.51 29 4M15.553 14.194a48 48 0 0 1 1.26-1.569 9.5 9.5 0 0 1 2.562 2.561q-.738.618-1.569 1.262a7.6 7.6 0 0 0-2.254-2.254m5.337-.335a11.6 11.6 0 0 0-2.75-2.75c3.973-4.316 6.969-5.625 8.738-5.989-.357 1.77-1.672 4.766-5.988 8.739"})})};g.forwardRef(yS);const CS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31 13v6.25a2.01 2.01 0 0 1-1.45 1.922L17 24.75V29a1 1 0 0 1-2 0v-4.25a2.01 2.01 0 0 1 1.45-1.922L29 19.25V13h-2v3a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3H2a1 1 0 0 1 0-2h2V8a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v3h2a2 2 0 0 1 2 2"})})};g.forwardRef(CS);const $S=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.096 6.736A12.9 12.9 0 0 0 16 3h-.134A13 13 0 0 0 3 16c0 5.375 3.323 9.883 8.67 11.771A4 4 0 0 0 17 24a2 2 0 0 1 2-2h5.776a3.976 3.976 0 0 0 3.9-3.11c.224-.984.332-1.99.324-3a12.9 12.9 0 0 0-3.904-9.154M10.5 21a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5-3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef($S);const SS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.925 5.543v.018L21.65 29.554A1.985 1.985 0 0 1 19.728 31a1.98 1.98 0 0 1-1.803-1.144l-4.464-9.423a.5.5 0 0 1 .099-.568l7.158-7.159a1 1 0 0 0-1.414-1.413l-7.169 7.157a.5.5 0 0 1-.567.099l-9.376-4.441A2.05 2.05 0 0 1 1 12.17a1.99 1.99 0 0 1 1.446-1.815L26.44 3.08h.018a2 2 0 0 1 2.468 2.463"})})};g.forwardRef(SS);const AS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.56 17.061-10.257 10.25a7.501 7.501 0 0 1-10.607-10.61l12.27-12.236a5 5 0 0 1 7.07 7.074l-.021.02L13.04 23.086a1.503 1.503 0 0 1-2.121-.041 1.5 1.5 0 0 1 .041-2.121L22.924 9.409a2 2 0 1 0-2.838-2.82L7.816 18.82a4.5 4.5 0 1 0 6.366 6.364l10.258-10.25a1.503 1.503 0 0 1 2.125 2.125z"})})};g.forwardRef(AS);const kS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 14.5h16a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m22 2H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3m-6 5H5a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3"})})};g.forwardRef(kS);const TS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m28.414 9.171-5.585-5.586a2 2 0 0 0-2.829 0L4.586 19A1.98 1.98 0 0 0 4 20.414V26a2 2 0 0 0 2 2h5.586A1.98 1.98 0 0 0 13 27.414L28.414 12a2 2 0 0 0 0-2.829M24 13.585 18.414 8l3-3L27 10.585z"})})},RS=g.forwardRef(TS),ef=RS,MS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.985 21.885A7.03 7.03 0 0 1 22 28c-9.925 0-18-8.075-18-18a7.03 7.03 0 0 1 6.115-6.985 2 2 0 0 1 2.078 1.19l2.64 5.894v.015a2 2 0 0 1-.16 1.886 1 1 0 0 1-.07.096L12 15.181c.936 1.903 2.926 3.875 4.854 4.814l3.042-2.589q.045-.037.094-.07a2 2 0 0 1 1.896-.175l.017.008 5.888 2.639a2 2 0 0 1 1.194 2.077"})})};g.forwardRef(MS);const ES=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.416 13-6.683 6.706c.57 1.584.806 4.236-1.65 7.5a2 2 0 0 1-1.458.794h-.141a2 2 0 0 1-1.415-.586l-6.033-6.04-5.328 5.333a1 1 0 1 1-1.415-1.415l5.332-5.328-6.037-6.038a2 2 0 0 1 .162-2.972c3.178-2.564 6.219-2.06 7.55-1.643L19 2.587a2 2 0 0 1 2.829 0l7.586 7.585A2 2 0 0 1 29.416 13"})})};g.forwardRef(ES);const IS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 2A11.013 11.013 0 0 0 5 13c0 9.413 10 16.521 10.426 16.819a1 1 0 0 0 1.148 0C17 29.52 27 22.413 27 13A11.01 11.01 0 0 0 16 2m0 7a4 4 0 1 1 0 8 4 4 0 0 1 0-8"})})};g.forwardRef(IS);const jS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 17v4a1 1 0 0 1-1.196.98L19.5 20.125v2.966l2.207 2.206A1 1 0 0 1 22 26v3a1 1 0 0 1-1.375.929L16 28.078l-4.625 1.85A1 1 0 0 1 10 29v-3a1 1 0 0 1 .293-.707l2.207-2.207v-2.961L3.196 21.98A1 1 0 0 1 2 21v-4a1 1 0 0 1 .553-.895l9.947-4.972V5.5a3.5 3.5 0 1 1 7 0v5.633l9.948 4.972A1 1 0 0 1 30 17"})})};g.forwardRef(jS);const DS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.676 18.884a7.6 7.6 0 0 1-3.978 1.107 9 9 0 0 1-3.42-.707A6.94 6.94 0 0 0 17 23.314V27a1 1 0 0 1-1.066 1A1.023 1.023 0 0 1 15 26.969v-1.555l-4.828-4.828A6.6 6.6 0 0 1 7.93 21a5.73 5.73 0 0 1-2.99-.834C2.216 18.511.75 14.702 1.034 9.974a1 1 0 0 1 .94-.94c4.728-.28 8.537 1.182 10.187 3.906a5.75 5.75 0 0 1 .806 3.56.5.5 0 0 1-.86.304l-2.4-2.513a1 1 0 0 0-1.415 1.414l6.736 6.906q.01-.146.026-.291a8.57 8.57 0 0 1 2.33-4.933l6.323-6.682a1 1 0 0 0-1.413-1.415l-6.125 6.477a.5.5 0 0 1-.848-.217c-.592-2.185-.331-4.36.8-6.228 2.233-3.685 7.428-5.657 13.898-5.277a1 1 0 0 1 .94.94c.375 6.471-1.598 11.666-5.283 13.899"})})};g.forwardRef(DS);const OS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 16a1.97 1.97 0 0 1-.95 1.689L11.04 28.706a2 2 0 0 1-2.767-.688A2 2 0 0 1 8 27.016V4.984a1.98 1.98 0 0 1 1.015-1.728 2 2 0 0 1 2.025.038L29.05 14.31A1.97 1.97 0 0 1 30 16"})})},LS=g.forwardRef(OS),NS=LS,BS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-9.5V27a1.5 1.5 0 1 1-3 0v-9.5H5a1.5 1.5 0 1 1 0-3h9.5V5a1.5 1.5 0 1 1 3 0v9.5H27a1.5 1.5 0 0 1 1.5 1.5"})})},FS=g.forwardRef(BS),tf=FS,VS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.016 13.016 0 0 0 16 3m5 14h-4v4a1 1 0 0 1-2 0v-4h-4a1 1 0 0 1 0-2h4v-4a1 1 0 0 1 2 0v4h4a1 1 0 0 1 0 2"})})};g.forwardRef(VS);const _S=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H17V3a1 1 0 0 0-2 0v2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h4.92l-2.701 3.375a1 1 0 0 0 1.562 1.25L12.48 24h7.04l3.699 4.625a1 1 0 1 0 1.562-1.25L22.08 24H27a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 18a1 1 0 0 1-2 0v-3a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-5a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-7a1 1 0 0 1 2 0z"})})};g.forwardRef(_S);const zS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.414 17 18 4.586A1.98 1.98 0 0 0 16.586 4H5a1 1 0 0 0-1 1v11.586A1.98 1.98 0 0 0 4.586 18L17 30.414a2 2 0 0 0 2.829 0l10.585-10.585a2 2 0 0 0 0-2.829M10.5 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})},HS=g.forwardRef(zS),PS=HS,WS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20.723 28H26a2 2 0 0 0 2-2v-4.706a1 1 0 0 0-1.383-.919 2.9 2.9 0 0 1-1.117.221c-1.654 0-3-1.387-3-3.091s1.346-3.091 3-3.091c.383 0 .763.075 1.117.221A1 1 0 0 0 28 13.706V9a2 2 0 0 0-2-2h-4.527a4.5 4.5 0 1 0-8.945 0H8a2 2 0 0 0-2 2v4.028a4.5 4.5 0 1 0 0 8.945V26a2 2 0 0 0 2 2h5.278"})})};g.forwardRef(WS);const qS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18 22.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0M29.5 16A13.5 13.5 0 1 1 16 2.5 13.515 13.515 0 0 1 29.5 16m-3 0A10.5 10.5 0 1 0 16 26.5 10.51 10.51 0 0 0 26.5 16M16 8c-3.033 0-5.5 2.242-5.5 5v.5a1.5 1.5 0 1 0 3 0V13c0-1.102 1.125-2 2.5-2s2.5.898 2.5 2-1.125 2-2.5 2a1.5 1.5 0 0 0-1.5 1.5v1a1.5 1.5 0 0 0 2.966.32C19.79 17.235 21.5 15.296 21.5 13c0-2.758-2.468-5-5.5-5"})})};g.forwardRef(qS);const US=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.5 9v11a6.006 6.006 0 0 1-6 6 1 1 0 0 1 0-2 4 4 0 0 0 4-4v-1H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h7.5a2 2 0 0 1 2 2M27 7h-7.5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2H27v1a4 4 0 0 1-4 4 1 1 0 0 0 0 2 6.006 6.006 0 0 0 6-6V9a2 2 0 0 0-2-2"})})};g.forwardRef(US);const KS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5v23a1 1 0 0 1-2 0v-6h-6a1 1 0 0 1-1-1c.046-2.395.349-4.779.902-7.11 1.223-5.061 3.54-8.454 6.704-9.809a1 1 0 0 1 1.394.92m-12.014-.164a.999.999 0 1 0-1.972.33L13.986 11H11V5a1 1 0 0 0-2 0v6H6.014l.972-5.835a1 1 0 1 0-1.972-.329l-1 6A1 1 0 0 0 4 11a6.01 6.01 0 0 0 5 5.915V28a1 1 0 1 0 2 0V16.915A6.01 6.01 0 0 0 16 11q0-.083-.014-.164z"})})};g.forwardRef(KS);const GS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19 28a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m8.953-8.521-1.546 6.954a2 2 0 0 1-3.188 1.138l-3.405-2.57h-7.625L8.78 27.57a2 2 0 0 1-3.189-1.138l-1.545-6.954a2.01 2.01 0 0 1 .415-1.714l3.57-4.282c.12-1.574.482-3.12 1.072-4.584 1.612-4.043 4.5-6.579 5.671-7.481a2 2 0 0 1 2.45 0c1.167.902 4.059 3.438 5.671 7.48.59 1.465.952 3.01 1.072 4.585l3.57 4.282a2.01 2.01 0 0 1 .415 1.714m-17.404 4.25q-2.014-3.666-2.445-7.209L6 19.045 7.545 26l.022-.016zM17.5 12.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m8.5 6.545-2.104-2.525q-.428 3.535-2.445 7.211l2.982 2.25.022.017z"})})};g.forwardRef(GS);const YS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.716 14.141a1 1 0 0 1 .261-1.391l8.458-5.788a1 1 0 0 1 1.125 1.652L21.101 14.4a1 1 0 0 1-1.39-.261zm10.109 10.634a1 1 0 0 1-1.39.261L17 17.211l-5.315 3.636a4.5 4.5 0 1 1-1.125-1.65L15.229 16l-4.673-3.198a4.5 4.5 0 1 1 1.125-1.65l17.875 12.233a1 1 0 0 1 .269 1.39M9 22.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m0-13a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"})})};g.forwardRef(YS);const XS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M225.86 102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28 23.51 138.44 16 128 16s-18.27 7.51-25.18 14.14c-3.94 3.77-8 7.67-11.57 9.14-3.25 1.36-8.69 1.44-13.94 1.52-9.76.15-20.82.31-28.51 8s-7.8 18.75-8 28.51c-.08 5.25-.16 10.67-1.52 13.94-1.47 3.56-5.37 7.63-9.14 11.57C23.51 109.72 16 117.56 16 128s7.51 18.27 14.14 25.18c3.77 3.94 7.67 8 9.14 11.57 1.36 3.27 1.44 8.69 1.52 13.94.15 9.76.31 20.82 8 28.51s18.75 7.85 28.51 8c5.25.08 10.67.16 13.94 1.52 3.56 1.47 7.63 5.37 11.57 9.14 6.9 6.63 14.74 14.14 25.18 14.14s18.27-7.51 25.18-14.14c3.94-3.77 8-7.67 11.57-9.14 3.27-1.36 8.69-1.44 13.94-1.52 9.76-.15 20.82-.31 28.51-8s7.85-18.75 8-28.51c.08-5.25.16-10.67 1.52-13.94 1.47-3.56 5.37-7.63 9.14-11.57 6.63-6.9 14.14-14.74 14.14-25.18s-7.51-18.27-14.14-25.18m-52.2 6.84-56 56a8 8 0 0 1-11.32 0l-24-24a8 8 0 0 1 11.32-11.32L112 148.69l50.34-50.35a8 8 0 0 1 11.32 11.32"})})};g.forwardRef(XS);const QS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.061 26.939 23.125 21A11.515 11.515 0 1 0 21 23.125l5.941 5.942a1.503 1.503 0 0 0 2.125-2.125zM5.5 14a8.5 8.5 0 1 1 8.5 8.5A8.51 8.51 0 0 1 5.5 14"})})},ZS=g.forwardRef(QS),v2=ZS,JS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 5H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M26 17H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};g.forwardRef(JS);const e9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 7v7.346c0 11.202-9.477 14.918-11.375 15.549a1.94 1.94 0 0 1-1.25 0C13.475 29.264 4 25.548 4 14.346V7a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2"})})};g.forwardRef(e9);const t9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m30.949 7.653-6.47-3.528A1 1 0 0 0 24 4h-4a1 1 0 0 0-1 1 3 3 0 0 1-6 0 1 1 0 0 0-1-1H8a1 1 0 0 0-.48.125L1.051 7.653a1.97 1.97 0 0 0-.824 2.657l2.41 4.601A2.05 2.05 0 0 0 4.458 16H7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V16h2.543a2.05 2.05 0 0 0 1.822-1.089l2.409-4.601a1.97 1.97 0 0 0-.825-2.658M4.459 14a.08.08 0 0 1-.051-.016L2.01 9.408 7 6.685V14zm23.134-.018a.07.07 0 0 1-.052.018H25V6.685l4.99 2.723z"})})};g.forwardRef(t9);const n9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M12 27a2 2 0 1 1-4 0 2 2 0 0 1 4 0m11-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4m5.805-16.594A1 1 0 0 0 28 8H6.04L5.026 4.45A2.01 2.01 0 0 0 3.103 3H1a1 1 0 0 0 0 2h2.103l4.522 15.824A3.01 3.01 0 0 0 10.509 23h12.014a2.99 2.99 0 0 0 2.867-2.117l3.566-11.59a1 1 0 0 0-.151-.887"})})};g.forwardRef(n9);const r9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.5 27a1.5 1.5 0 0 1-1.5 1.5H6A2.5 2.5 0 0 1 3.5 26V6A2.5 2.5 0 0 1 6 3.5h7a1.5 1.5 0 0 1 0 3H6.5v19H13a1.5 1.5 0 0 1 1.5 1.5m13.561-12.061-5-5a1.503 1.503 0 0 0-2.125 2.125l2.439 2.436H13a1.5 1.5 0 1 0 0 3h10.375l-2.44 2.439a1.503 1.503 0 0 0 2.125 2.125l5-5a1.5 1.5 0 0 0 .001-2.125"})})};g.forwardRef(r9);const o9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M4 10a1 1 0 0 1 1-1h4.646a3.5 3.5 0 0 1 6.708 0H27a1 1 0 1 1 0 2H16.354a3.5 3.5 0 0 1-6.708 0H5a1 1 0 0 1-1-1m23 11h-2.646a3.5 3.5 0 0 0-6.708 0H5a1 1 0 0 0 0 2h12.646a3.5 3.5 0 0 0 6.708 0H27a1 1 0 1 0 0-2"})})};g.forwardRef(o9);const i9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 18a1.97 1.97 0 0 1-1.302 1.867l-6.457 2.375-2.375 6.452a1.99 1.99 0 0 1-3.735 0L9.75 22.25l-6.452-2.375a1.99 1.99 0 0 1 0-3.735l6.456-2.375 2.375-6.451a1.99 1.99 0 0 1 3.735 0l2.375 6.456 6.451 2.375A1.97 1.97 0 0 1 26 18M19 6h2v2a1 1 0 0 0 2 0V6h2a1 1 0 1 0 0-2h-2V2a1 1 0 1 0-2 0v2h-2a1 1 0 1 0 0 2m11 4h-1V9a1 1 0 1 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 0 0 2 0v-1h1a1 1 0 0 0 0-2"})})};g.forwardRef(i9);const s9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 7v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2m10-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 17H7a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m12 0h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2"})})};g.forwardRef(s9);const a9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:[u.jsx("path",{d:"M27.5 21.136 16 27.843 4.5 21.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728"}),u.jsx("path",{d:"M27.5 15.136 16 21.843 4.5 15.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728"}),u.jsx("path",{d:"m3.5 10.864 12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 0 0 0-1.728l-12-7a1 1 0 0 0-1.008 0l-12 7a1 1 0 0 0 0 1.728"})]})};g.forwardRef(a9);const l9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.313 14.298-5.638 4.92 1.689 7.325a2 2 0 0 1-2.98 2.167l-6.389-3.875L9.62 28.71a2 2 0 0 1-2.98-2.168l1.686-7.317-5.638-4.928a2 2 0 0 1 1.138-3.507l7.433-.644 2.901-6.92a1.994 1.994 0 0 1 3.68 0l2.91 6.92 7.43.644a2 2 0 0 1 1.139 3.508z"})})};g.forwardRef(l9);const c9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 19a4 4 0 1 0-4.991 3.875A1 1 0 0 0 24 23a4 4 0 0 1-4 4h-3a4 4 0 0 1-4-4v-5.065c3.934-.5 7-3.934 7-8.039V5a2 2 0 0 0-2-2h-2a1 1 0 1 0 0 2h2v4.896c0 3.323-2.656 6.061-5.92 6.104A6 6 0 0 1 6 10V5h2a1 1 0 0 0 0-2H6a2 2 0 0 0-2 2v5a8 8 0 0 0 7 7.936V23a6.006 6.006 0 0 0 6 6h3a6.006 6.006 0 0 0 6-6 1 1 0 0 0-.009-.125A4 4 0 0 0 29 19m-4 1a1 1 0 1 1 0-2 1 1 0 0 1 0 2"})})};g.forwardRef(c9);const d9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M216 56v144a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16V56a16 16 0 0 1 16-16h144a16 16 0 0 1 16 16"})})};g.forwardRef(d9);const u9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 12a1 1 0 0 0-.038-.275L27.17 5.45A2.01 2.01 0 0 0 25.25 4H6.75a2.01 2.01 0 0 0-1.919 1.45L3.04 11.725A1 1 0 0 0 3 12v2a5 5 0 0 0 2 4v8a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-8a5 5 0 0 0 2-4zm-18 2a3 3 0 0 1-4.39 2.657 1 1 0 0 0-.228-.132A3 3 0 0 1 5 14v-1h6zm8 0a3 3 0 0 1-6 0v-1h6zm8 0a3 3 0 0 1-1.384 2.525q-.12.051-.225.131A3 3 0 0 1 21 14v-1h6z"})})};g.forwardRef(u9);const h9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-3.767A5.19 5.19 0 0 1 24.5 21c0 1.806-.976 3.54-2.679 4.756C20.25 26.881 18.18 27.5 16 27.5s-4.25-.619-5.821-1.744C8.476 24.54 7.5 22.806 7.5 21a1.5 1.5 0 0 1 3 0c0 1.898 2.519 3.5 5.5 3.5s5.5-1.602 5.5-3.5c0-1.595-1.163-2.523-4.419-3.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M9.389 12.5a1.5 1.5 0 0 0 1.5-1.5c0-2 2.197-3.5 5.111-3.5 2.17 0 3.921.831 4.685 2.223a1.5 1.5 0 0 0 2.625-1.446C22.016 5.914 19.281 4.5 16 4.5c-4.625 0-8.111 2.794-8.111 6.5a1.5 1.5 0 0 0 1.5 1.5"})})};g.forwardRef(h9);const f9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 5V2a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0m1 3a8 8 0 1 0 8 8 8.01 8.01 0 0 0-8-8m-8.707.707a1 1 0 1 0 1.414-1.415l-2-2a1 1 0 1 0-1.414 1.415zm0 14.586-2 2a1 1 0 1 0 1.414 1.415l2-2a1 1 0 1 0-1.415-1.415M24 9a1 1 0 0 0 .707-.293l2-2a1 1 0 0 0-1.415-1.414l-2 2A1 1 0 0 0 24 9m.707 14.293a1 1 0 1 0-1.415 1.415l2 2a1 1 0 0 0 1.415-1.415zM6 16a1 1 0 0 0-1-1H2a1 1 0 0 0 0 2h3a1 1 0 0 0 1-1m10 10a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0v-3a1 1 0 0 0-1-1m14-11h-3a1 1 0 0 0 0 2h3a1 1 0 0 0 0-2"})})};g.forwardRef(f9);const m9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 8h-8.586l4.293-4.292a1 1 0 0 0-1.415-1.415L16 7.586l-5.292-5.293a1 1 0 1 0-1.415 1.415L13.586 8H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2m0 17h-7V10h7zm-2-10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0 6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"})})};g.forwardRef(m9);const g9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.978 19.625-1.5-12A3 3 0 0 0 25.5 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h5.383l4.722 9.448A1 1 0 0 0 15 30a5 5 0 0 0 5-5v-2h7a3 3 0 0 0 2.977-3.375M9 18H4V7h5z"})})};g.forwardRef(g9);const p9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.25 10.015A3 3 0 0 0 27 9h-7V7a5 5 0 0 0-5-5 1 1 0 0 0-.895.553L9.383 12H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h21.5a3 3 0 0 0 2.977-2.625l1.5-12a3 3 0 0 0-.727-2.36M4 14h5v11H4z"})})};g.forwardRef(p9);const b9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M23 3H9a4 4 0 0 0-4 4v16a4 4 0 0 0 4 4h1l-1.8 2.4a1 1 0 0 0 1.6 1.2l2.7-3.6h7l2.7 3.6a1 1 0 0 0 1.6-1.2L22 27h1a4 4 0 0 0 4-4V7a4 4 0 0 0-4-4M10.5 23a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m4.5-8H7v-5h8zm6.5 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m3.5-8h-8v-5h8z"})})};g.forwardRef(b9);const v9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 6h-5V5a3 3 0 0 0-3-3h-6a3 3 0 0 0-3 3v1H5a1 1 0 0 0 0 2h1v18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h1a1 1 0 1 0 0-2M14 21a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm6 0a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm0-15h-8V5a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1z"})})},x9=g.forwardRef(v9),nf=x9,w9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15.583 3.5v4a.75.75 0 1 1-1.5 0V5.313l-4.72 4.72a.75.75 0 0 1-1.062 0l-1.968-1.97-3.97 3.968a.751.751 0 1 1-1.062-1.063l4.5-4.5a.75.75 0 0 1 1.063 0l1.969 1.97 4.188-4.188h-2.188a.75.75 0 1 1 0-1.5h4a.75.75 0 0 1 .75.75"})})};g.forwardRef(w9);const y9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m23.54 2.267-3.711 3.377c1.7.52 3.298 1.397 4.653 2.631 4.684 4.266 4.684 11.184 0 15.45q-5.184 4.72-16.021 6.008l3.71-3.377a12.2 12.2 0 0 1-4.653-2.63c-4.684-4.267-4.712-11.16 0-15.45q5.184-4.721 16.021-6.01m-7.54 8.4c-3.314 0-6 2.388-6 5.333s2.686 5.333 6 5.333 6-2.387 6-5.333c0-2.945-2.686-5.333-6-5.333"})})},C9=g.forwardRef(y9),$9=C9,S9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 28a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M16 24.5a8.51 8.51 0 0 0 8.5-8.5V7a1.5 1.5 0 1 0-3 0v9a5.5 5.5 0 0 1-11 0V7a1.5 1.5 0 1 0-3 0v9a8.51 8.51 0 0 0 8.5 8.5"})})};g.forwardRef(S9);const A9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-16.439-7.939L14.5 8.625V19a1.5 1.5 0 1 0 3 0V8.625l2.439 2.44a1.503 1.503 0 0 0 2.125-2.125l-5-5a1.5 1.5 0 0 0-2.125 0l-5 5a1.503 1.503 0 1 0 2.125 2.125z"})})};g.forwardRef(A9);const k9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.866 27.5A1 1 0 0 1 28 28H4a1 1 0 0 1-.865-1.5c1.904-3.291 4.838-5.651 8.261-6.77a9 9 0 1 1 9.208 0c3.424 1.119 6.357 3.479 8.261 6.77a1 1 0 0 1 .001 1"})})};g.forwardRef(k9);const T9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.44 3.101a1 1 0 0 0-1.054.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1 1 0 0 0 20 28V4a1 1 0 0 0-.56-.899M28.414 16l2.293-2.292a1.001 1.001 0 0 0-1.415-1.415L27 14.586l-2.293-2.293a1 1 0 1 0-1.415 1.415L25.587 16l-2.293 2.293a1 1 0 0 0 1.415 1.415L27 17.414l2.293 2.294a1 1 0 0 0 1.415-1.415z"})})};g.forwardRef(T9);const R9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.439 3.101a1 1 0 0 0-1.053.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1.001 1.001 0 0 0 20 28V4a1 1 0 0 0-.561-.899M9 20H4v-8h5zm15.75-7.305a5 5 0 0 1 0 6.61 1 1 0 0 1-1.5-1.322 3 3 0 0 0 0-3.966 1 1 0 0 1 1.5-1.322M31 16a10 10 0 0 1-2.546 6.668 1 1 0 0 1-1.49-1.334 8 8 0 0 0 0-10.666.998.998 0 0 1 .407-1.624 1 1 0 0 1 1.083.29A9.98 9.98 0 0 1 31 16"})})};g.forwardRef(R9);const M9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 6a4 4 0 1 1 8 0 4 4 0 0 1-8 0m11 11c-3.58 0-5.226-1.662-6.969-3.421a25 25 0 0 0-1.375-1.323C13.031 8.24 5.63 15.098 5.316 15.391a1 1 0 0 0 1.369 1.458 20.5 20.5 0 0 1 3.815-2.724c1.723-.922 3.174-1.279 4.338-1.072L8.082 28.6a1 1 0 0 0 1.835.798l4.2-9.659L18 22.515V29a1 1 0 1 0 2 0v-7a1 1 0 0 0-.419-.814l-4.65-3.321L16.61 14c.33.305.657.634 1 .98C19.381 16.774 21.586 19 26 19a1 1 0 0 0 0-2"})})};g.forwardRef(M9);const E9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-1 7a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0zm1 13a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})},I9=g.forwardRef(E9),x2=I9,j9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 16",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.468 10 5.9 5.786l-.14-.243a3 3 0 1 1 5.316-2.76.51.51 0 0 1-.2.65.5.5 0 0 1-.71-.233 2 2 0 1 0-3.542 1.84l.864 1.496a.5.5 0 0 1 0 .5L5.2 11a1 1 0 0 1-1.731-1m8.812-2.5h-.771l-2.31-4a1 1 0 0 0-1.731 1l2.165 3.75a.5.5 0 0 0 .432.25h2.227c1.118 0 2.06.915 2.041 2.033a2 2 0 0 1-1.98 1.967.515.515 0 0 0-.518.458.5.5 0 0 0 .5.542 3.003 3.003 0 0 0 3-3.058c-.034-1.643-1.41-2.942-3.052-2.942zm1.053 2.952c-.025-.538-.489-.952-1.027-.952H7.51a.5.5 0 0 0-.433.25l-1.01 1.75a2 2 0 1 1-3.342-2.187.51.51 0 0 0-.058-.688.5.5 0 0 0-.732.073A3 3 0 1 0 6.93 12l.289-.5h5.114a1 1 0 0 0 1-1.048"})})};g.forwardRef(j9);const D9=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:o}=C.useTheme(),i=t&&t in o?o[t]:t,s=e&&e in o?o[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:i,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m31.316 24.949-3 1a1 1 0 0 1-1.211-.5l-3.724-7.45H13a1 1 0 0 1-1-1v-3.707A7 7 0 0 0 14 27c3.239 0 6.261-2.256 7.031-5.25a1 1 0 1 1 1.938.5C21.96 26.162 18.19 29 14 29a9 9 0 0 1-2-17.774V8.851a3.5 3.5 0 1 1 2 0V11h7a1 1 0 0 1 0 2h-7v3h10a1 1 0 0 1 .894.552l3.612 7.225 2.178-.726a1 1 0 1 1 .632 1.898"})})};g.forwardRef(D9);const w2="Avatar",[O9,gW]=qe(w2),[L9,y2]=O9(w2),N9=g.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[o,i]=g.useState("idle");return g.createElement(L9,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i},g.createElement(ie.span,F({},r,{ref:e})))}),B9="AvatarImage",F9=g.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=t,s=y2(B9,n),a=z9(r),l=Ke(c=>{o(c),s.onImageLoadingStatusChange(c)});return Be(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.createElement(ie.img,F({},i,{ref:e,src:r})):null}),V9="AvatarFallback",_9=g.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...o}=t,i=y2(V9,n),[s,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?g.createElement(ie.span,F({},o,{ref:e})):null});function z9(t){const[e,n]=g.useState("idle");return Be(()=>{if(!t){n("error");return}let r=!0;const o=new window.Image,i=s=>()=>{r&&n(s)};return n("loading"),o.onload=i("loaded"),o.onerror=i("error"),o.src=t,()=>{r=!1}},[t]),e}const H9=N9,P9=F9,W9=_9,Nc="rovingFocusGroup.onEntryFocus",q9={bubbles:!1,cancelable:!0},rf="RovingFocusGroup",[Wd,C2,U9]=jl(rf),[K9,ni]=qe(rf,[U9]),[G9,Y9]=K9(rf),X9=g.forwardRef((t,e)=>g.createElement(Wd.Provider,{scope:t.__scopeRovingFocusGroup},g.createElement(Wd.Slot,{scope:t.__scopeRovingFocusGroup},g.createElement(Q9,F({},t,{ref:e}))))),Q9=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=t,h=g.useRef(null),f=le(e,h),m=Qr(i),[p=null,b]=it({prop:s,defaultProp:a,onChange:l}),[v,x]=g.useState(!1),y=Ke(c),$=C2(n),S=g.useRef(!1),[A,k]=g.useState(0);return g.useEffect(()=>{const T=h.current;if(T)return T.addEventListener(Nc,y),()=>T.removeEventListener(Nc,y)},[y]),g.createElement(G9,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:p,onItemFocus:g.useCallback(T=>b(T),[b]),onItemShiftTab:g.useCallback(()=>x(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>k(T=>T-1),[])},g.createElement(ie.div,F({tabIndex:v||A===0?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...t.style},onMouseDown:U(t.onMouseDown,()=>{S.current=!0}),onFocus:U(t.onFocus,T=>{const I=!S.current;if(T.target===T.currentTarget&&I&&!v){const E=new CustomEvent(Nc,q9);if(T.currentTarget.dispatchEvent(E),!E.defaultPrevented){const j=$().filter(W=>W.focusable),L=j.find(W=>W.active),D=j.find(W=>W.id===p),V=[L,D,...j].filter(Boolean).map(W=>W.ref.current);$2(V)}}S.current=!1}),onBlur:U(t.onBlur,()=>x(!1))})))}),Z9="RovingFocusGroupItem",J9=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=t,a=at(),l=i||a,c=Y9(Z9,n),d=c.currentTabStopId===l,h=C2(n),{onFocusableItemAdd:f,onFocusableItemRemove:m}=c;return g.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),g.createElement(Wd.ItemSlot,{scope:n,id:l,focusable:r,active:o},g.createElement(ie.span,F({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:e,onMouseDown:U(t.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:U(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:U(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const b=nA(p,c.orientation,c.dir);if(b!==void 0){p.preventDefault();let x=h().filter(y=>y.focusable).map(y=>y.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const y=x.indexOf(p.currentTarget);x=c.loop?rA(x,y+1):x.slice(y+1)}setTimeout(()=>$2(x))}})})))}),eA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tA(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function nA(t,e,n){const r=tA(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return eA[r]}function $2(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function rA(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const of=X9,sf=J9;var oA=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},so=new WeakMap,Bs=new WeakMap,Fs={},Bc=0,S2=function(t){return t&&(t.host||S2(t.parentNode))},iA=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=S2(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},sA=function(t,e,n,r){var o=iA(e,Array.isArray(t)?t:[t]);Fs[n]||(Fs[n]=new WeakMap);var i=Fs[n],s=[],a=new Set,l=new Set(o),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};o.forEach(c);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(a.has(f))d(f);else try{var m=f.getAttribute(r),p=m!==null&&m!=="false",b=(so.get(f)||0)+1,v=(i.get(f)||0)+1;so.set(f,b),i.set(f,v),s.push(f),b===1&&p&&Bs.set(f,!0),v===1&&f.setAttribute(n,"true"),p||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return d(e),a.clear(),Bc++,function(){s.forEach(function(h){var f=so.get(h)-1,m=i.get(h)-1;so.set(h,f),i.set(h,m),f||(Bs.has(h)||h.removeAttribute(r),Bs.delete(h)),m||h.removeAttribute(n)}),Bc--,Bc||(so=new WeakMap,so=new WeakMap,Bs=new WeakMap,Fs={})}},af=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=oA(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),sA(r,o,n,"aria-hidden")):function(){return null}},A2=wh(),Fc=function(){},Vl=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Fc,onWheelCapture:Fc,onTouchMoveCapture:Fc}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,p=t.inert,b=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=Ml(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),$=f,S=xh([n,e]),A=_e(_e({},y),o);return w.createElement(w.Fragment,null,d&&w.createElement($,{sideCar:A2,removeScrollBar:c,shards:h,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!b,lockRef:n}),s?w.cloneElement(w.Children.only(a),_e(_e({},A),{ref:S})):w.createElement(x,_e({},A,{className:l,ref:S}),a))});Vl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vl.classNames={fullWidth:Co,zeroRight:yo};var qd=!1;if(typeof window<"u")try{var Vs=Object.defineProperty({},"passive",{get:function(){return qd=!0,!0}});window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch{qd=!1}var ao=qd?{passive:!1}:!1,aA=function(t){return t.tagName==="TEXTAREA"},k2=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!aA(t)&&n[e]==="visible")},lA=function(t){return k2(t,"overflowY")},cA=function(t){return k2(t,"overflowX")},V0=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=T2(t,n);if(r){var o=R2(t,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},dA=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},uA=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},T2=function(t,e){return t==="v"?lA(e):cA(e)},R2=function(t,e){return t==="v"?dA(e):uA(e)},hA=function(t,e){return t==="h"&&e==="rtl"?-1:1},fA=function(t,e,n,r,o){var i=hA(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=R2(t,a),p=m[0],b=m[1],v=m[2],x=b-v-i*p;(p||x)&&T2(t,a)&&(h+=x,f+=p),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&h===0||!d&&f===0)&&(c=!0),c},_s=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_0=function(t){return[t.deltaX,t.deltaY]},z0=function(t){return t&&"current"in t?t.current:t},mA=function(t,e){return t[0]===e[0]&&t[1]===e[1]},gA=function(t){return`
|
|
48
48
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
49
49
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
50
|
-
`)},pA=0,lo=[];function bA(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(pA++)[0],i=w.useState(function(){return Il()})[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var p=vh([t.lockRef.current],(t.shards||[]).map(z0),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(p,v){if("touches"in p&&p.touches.length===2)return!s.current.allowPinchZoom;var x=_s(p),y=n.current,$="deltaX"in p?p.deltaX:y[0]-x[0],S="deltaY"in p?p.deltaY:y[1]-x[1],A,k=p.target,T=Math.abs($)>Math.abs(S)?"h":"v";if("touches"in p&&T==="h"&&k.type==="range")return!1;var I=V0(T,k);if(!I)return!0;if(I?A=T:(A=T==="v"?"h":"v",I=V0(T,k)),!I)return!1;if(!r.current&&"changedTouches"in p&&($||S)&&(r.current=A),!A)return!0;var E=r.current||A;return fA(E,v,p,E==="h"?$:S)},[]),l=w.useCallback(function(p){var v=p;if(!(!lo.length||lo[lo.length-1]!==i)){var x="deltaY"in v?_0(v):_s(v),y=e.current.filter(function(A){return A.name===v.type&&A.target===v.target&&mA(A.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(z0).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=$.length>0?a(v,$[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(p,v,x,y){var $={name:p,delta:v,target:x,should:y};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(S){return S!==$})},1)},[]),d=w.useCallback(function(p){n.current=_s(p),r.current=void 0},[]),h=w.useCallback(function(p){c(p.type,_0(p),p.target,a(p,t.lockRef.current))},[]),f=w.useCallback(function(p){c(p.type,_s(p),p.target,a(p,t.lockRef.current))},[]);w.useEffect(function(){return lo.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ao),document.addEventListener("touchmove",l,ao),document.addEventListener("touchstart",d,ao),function(){lo=lo.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,ao),document.removeEventListener("touchmove",l,ao),document.removeEventListener("touchstart",d,ao)}},[]);var m=t.removeScrollBar,b=t.inert;return w.createElement(w.Fragment,null,b?w.createElement(i,{styles:gA(o)}):null,m?w.createElement(Ch,{gapMode:"margin"}):null)}const vA=yh(A2,bA);var _l=w.forwardRef(function(t,e){return w.createElement(Vl,_e({},t,{ref:e,sideCar:vA}))});_l.classNames=Vl.classNames;const H0=["Enter"," "],xA=["ArrowDown","PageUp","Home"],M2=["ArrowUp","PageDown","End"],wA=[...xA,...M2],yA={ltr:[...H0,"ArrowRight"],rtl:[...H0,"ArrowLeft"]},CA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zl="Menu",[Fi,$A,SA]=jl(zl),[Jr,E2]=qe(zl,[SA,br,ni]),lf=br(),I2=ni(),[AA,eo]=Jr(zl),[kA,Hl]=Jr(zl),TA=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=t,a=lf(e),[l,c]=g.useState(null),d=g.useRef(!1),h=Ke(i),f=Qr(o);return g.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),g.createElement(Tl,a,g.createElement(AA,{scope:e,open:n,onOpenChange:h,content:l,onContentChange:c},g.createElement(kA,{scope:e,onClose:g.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},j2=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=lf(n);return g.createElement(as,F({},o,r,{ref:e}))}),D2="MenuPortal",[RA,O2]=Jr(D2,{forceMount:void 0}),MA=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=eo(D2,e);return g.createElement(RA,{scope:e,forceMount:n},g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},r)))},Yt="MenuContent",[EA,L2]=Jr(Yt),IA=g.forwardRef((t,e)=>{const n=O2(Yt,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=eo(Yt,t.__scopeMenu),s=Hl(Yt,t.__scopeMenu);return g.createElement(Fi.Provider,{scope:t.__scopeMenu},g.createElement(Qe,{present:r||i.open},g.createElement(Fi.Slot,{scope:t.__scopeMenu},s.modal?g.createElement(jA,F({},o,{ref:e})):g.createElement(DA,F({},o,{ref:e})))))}),jA=g.forwardRef((t,e)=>{const n=eo(Yt,t.__scopeMenu),r=g.useRef(null),o=le(e,r);return g.useEffect(()=>{const i=r.current;if(i)return af(i)},[]),g.createElement(cf,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:U(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),DA=g.forwardRef((t,e)=>{const n=eo(Yt,t.__scopeMenu);return g.createElement(cf,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),cf=g.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:b,...p}=t,v=eo(Yt,n),x=Hl(Yt,n),y=lf(n),$=I2(n),S=$A(n),[A,k]=g.useState(null),T=g.useRef(null),I=le(e,T,v.onContentChange),E=g.useRef(0),j=g.useRef(""),L=g.useRef(0),D=g.useRef(null),z=g.useRef("right"),V=g.useRef(0),W=b?_l:g.Fragment,G=b?{as:yn,allowPinchZoom:!0}:void 0,P=O=>{var X,J;const fe=j.current+O,se=S().filter(ge=>!ge.disabled),pe=document.activeElement,be=(X=se.find(ge=>ge.ref.current===pe))===null||X===void 0?void 0:X.textValue,Se=se.map(ge=>ge.textValue),re=UA(Se,fe,be),xe=(J=se.find(ge=>ge.textValue===re))===null||J===void 0?void 0:J.ref.current;(function ge(ve){j.current=ve,window.clearTimeout(E.current),ve!==""&&(E.current=window.setTimeout(()=>ge(""),1e3))})(fe),xe&&setTimeout(()=>xe.focus())};g.useEffect(()=>()=>window.clearTimeout(E.current),[]),Jo();const _=g.useCallback(O=>{var X,J;return z.current===((X=D.current)===null||X===void 0?void 0:X.side)&&GA(O,(J=D.current)===null||J===void 0?void 0:J.area)},[]);return g.createElement(EA,{scope:n,searchRef:j,onItemEnter:g.useCallback(O=>{_(O)&&O.preventDefault()},[_]),onItemLeave:g.useCallback(O=>{var X;_(O)||((X=T.current)===null||X===void 0||X.focus(),k(null))},[_]),onTriggerLeave:g.useCallback(O=>{_(O)&&O.preventDefault()},[_]),pointerGraceTimerRef:L,onPointerGraceIntentChange:g.useCallback(O=>{D.current=O},[])},g.createElement(W,G,g.createElement(ei,{asChild:!0,trapped:o,onMountAutoFocus:U(i,O=>{var X;O.preventDefault(),(X=T.current)===null||X===void 0||X.focus()}),onUnmountAutoFocus:s},g.createElement(Xr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m},g.createElement(of,F({asChild:!0},$,{dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:U(l,O=>{x.isUsingKeyboardRef.current||O.preventDefault()})}),g.createElement(ls,F({role:"menu","aria-orientation":"vertical","data-state":B2(v.open),"data-radix-menu-content":"",dir:x.dir},y,p,{ref:I,style:{outline:"none",...p.style},onKeyDown:U(p.onKeyDown,O=>{const J=O.target.closest("[data-radix-menu-content]")===O.currentTarget,fe=O.ctrlKey||O.altKey||O.metaKey,se=O.key.length===1;J&&(O.key==="Tab"&&O.preventDefault(),!fe&&se&&P(O.key));const pe=T.current;if(O.target!==pe||!wA.includes(O.key))return;O.preventDefault();const Se=S().filter(re=>!re.disabled).map(re=>re.ref.current);M2.includes(O.key)&&Se.reverse(),WA(Se)}),onBlur:U(t.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(E.current),j.current="")}),onPointerMove:U(t.onPointerMove,Vi(O=>{const X=O.target,J=V.current!==O.clientX;if(O.currentTarget.contains(X)&&J){const fe=O.clientX>V.current?"right":"left";z.current=fe,V.current=O.clientX}}))})))))))}),OA=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.createElement(ie.div,F({},r,{ref:e}))}),LA="MenuItem",NA=g.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,s=L2(LA,n),a=I2(n),l=g.useRef(null),c=le(e,l),[d,h]=g.useState(!1),[f,m]=g.useState("");return g.useEffect(()=>{const b=l.current;if(b){var p;m(((p=b.textContent)!==null&&p!==void 0?p:"").trim())}},[i.children]),g.createElement(Fi.ItemSlot,{scope:n,disabled:r,textValue:o??f},g.createElement(sf,F({asChild:!0},a,{focusable:!r}),g.createElement(ie.div,F({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:U(t.onPointerMove,Vi(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:U(t.onPointerLeave,Vi(b=>s.onItemLeave(b))),onFocus:U(t.onFocus,()=>h(!0)),onBlur:U(t.onBlur,()=>h(!1))}))))}),BA="MenuRadioGroup",[pW,bW]=Jr(BA,{value:void 0,onValueChange:()=>{}}),FA="MenuItemIndicator",[vW,xW]=Jr(FA,{checked:!1}),VA=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.createElement(ie.div,F({role:"separator","aria-orientation":"horizontal"},r,{ref:e}))}),_A="MenuSub",[wW,N2]=Jr(_A),zs="MenuSubTrigger",zA=g.forwardRef((t,e)=>{const n=eo(zs,t.__scopeMenu),r=Hl(zs,t.__scopeMenu),o=N2(zs,t.__scopeMenu),i=L2(zs,t.__scopeMenu),s=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},d=g.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return g.useEffect(()=>d,[d]),g.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),g.createElement(j2,F({asChild:!0},c),g.createElement(NA,F({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":B2(n.open)},t,{ref:Cl(e,o.onTriggerChange),onClick:h=>{var f;(f=t.onClick)===null||f===void 0||f.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:U(t.onPointerMove,Vi(h=>{i.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:U(t.onPointerLeave,Vi(h=>{var f;d();const m=(f=n.content)===null||f===void 0?void 0:f.getBoundingClientRect();if(m){var b;const p=(b=n.content)===null||b===void 0?void 0:b.dataset.side,v=p==="right",x=v?-5:5,y=m[v?"left":"right"],$=m[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:y,y:m.top},{x:$,y:m.top},{x:$,y:m.bottom},{x:y,y:m.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:U(t.onKeyDown,h=>{const f=i.searchRef.current!=="";if(!(t.disabled||f&&h.key===" ")&&yA[r.dir].includes(h.key)){var m;n.onOpenChange(!0),(m=n.content)===null||m===void 0||m.focus(),h.preventDefault()}})})))}),HA="MenuSubContent",PA=g.forwardRef((t,e)=>{const n=O2(Yt,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=eo(Yt,t.__scopeMenu),s=Hl(Yt,t.__scopeMenu),a=N2(HA,t.__scopeMenu),l=g.useRef(null),c=le(e,l);return g.createElement(Fi.Provider,{scope:t.__scopeMenu},g.createElement(Qe,{present:r||i.open},g.createElement(Fi.Slot,{scope:t.__scopeMenu},g.createElement(cf,F({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;s.isUsingKeyboardRef.current&&((h=l.current)===null||h===void 0||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:U(t.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:U(t.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:U(t.onKeyDown,d=>{const h=d.currentTarget.contains(d.target),f=CA[s.dir].includes(d.key);if(h&&f){var m;i.onOpenChange(!1),(m=a.trigger)===null||m===void 0||m.focus(),d.preventDefault()}})})))))});function B2(t){return t?"open":"closed"}function WA(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function qA(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function UA(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=qA(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function KA(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const a=e[i].x,l=e[i].y,c=e[s].x,d=e[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function GA(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return KA(n,e)}function Vi(t){return e=>e.pointerType==="mouse"?t(e):void 0}const YA=TA,XA=j2,QA=MA,ZA=IA,JA=OA,ek=VA,tk=zA,nk=PA,F2="DropdownMenu",[rk,yW]=qe(F2,[E2]),wr=E2(),[ok,V2]=rk(F2),ik=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,l=wr(e),c=g.useRef(null),[d=!1,h]=it({prop:o,defaultProp:i,onChange:s});return g.createElement(ok,{scope:e,triggerId:at(),triggerRef:c,contentId:at(),open:d,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(f=>!f),[h]),modal:a},g.createElement(YA,F({},l,{open:d,onOpenChange:h,dir:r,modal:a}),n))},sk="DropdownMenuTrigger",ak=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=V2(sk,n),s=wr(n);return g.createElement(XA,F({asChild:!0},s),g.createElement(ie.button,F({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Cl(e,i.triggerRef),onPointerDown:U(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:U(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),lk=t=>{const{__scopeDropdownMenu:e,...n}=t,r=wr(e);return g.createElement(QA,F({},r,n))},ck="DropdownMenuContent",dk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=V2(ck,n),i=wr(n),s=g.useRef(!1);return g.createElement(ZA,F({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:e,onCloseAutoFocus:U(t.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:U(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),uk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(JA,F({},o,r,{ref:e}))}),hk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(ek,F({},o,r,{ref:e}))}),fk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(tk,F({},o,r,{ref:e}))}),mk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(nk,F({},o,r,{ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),gk=ik,pk=ak,_2=lk,bk=dk,vk=uk,xk=hk,wk=fk,yk=mk,z2="Checkbox",[Ck,CW]=qe(z2),[$k,Sk]=Ck(z2),Ak=g.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=t,[h,f]=g.useState(null),m=le(e,$=>f($)),b=g.useRef(!1),p=h?!!h.closest("form"):!0,[v=!1,x]=it({prop:o,defaultProp:i,onChange:c}),y=g.useRef(v);return g.useEffect(()=>{const $=h?.form;if($){const S=()=>x(y.current);return $.addEventListener("reset",S),()=>$.removeEventListener("reset",S)}},[h,x]),g.createElement($k,{scope:n,state:v,disabled:a},g.createElement(ie.button,F({type:"button",role:"checkbox","aria-checked":Dr(v)?"mixed":v,"aria-required":s,"data-state":H2(v),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:m,onKeyDown:U(t.onKeyDown,$=>{$.key==="Enter"&&$.preventDefault()}),onClick:U(t.onClick,$=>{x(S=>Dr(S)?!0:!S),p&&(b.current=$.isPropagationStopped(),b.current||$.stopPropagation())})})),p&&g.createElement(Rk,{control:h,bubbles:!b.current,name:r,value:l,checked:v,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),kk="CheckboxIndicator",Tk=g.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,i=Sk(kk,n);return g.createElement(Qe,{present:r||Dr(i.state)||i.state===!0},g.createElement(ie.span,F({"data-state":H2(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:e,style:{pointerEvents:"none",...t.style}})))}),Rk=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=g.useRef(null),s=Dl(n),a=kl(e);return g.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const f=new Event("click",{bubbles:r});l.indeterminate=Dr(n),h.call(l,Dr(n)?!1:n),l.dispatchEvent(f)}},[s,n,r]),g.createElement("input",F({type:"checkbox","aria-hidden":!0,defaultChecked:Dr(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Dr(t){return t==="indeterminate"}function H2(t){return Dr(t)?"indeterminate":t?"checked":"unchecked"}const Mk=Ak,Ek=Tk;function Ik(t,e){return g.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const P2="ScrollArea",[W2,$W]=qe(P2),[jk,Rn]=W2(P2),Dk=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=t,[a,l]=g.useState(null),[c,d]=g.useState(null),[h,f]=g.useState(null),[m,b]=g.useState(null),[p,v]=g.useState(null),[x,y]=g.useState(0),[$,S]=g.useState(0),[A,k]=g.useState(!1),[T,I]=g.useState(!1),E=le(e,L=>l(L)),j=Qr(o);return g.createElement(jk,{scope:n,type:r,dir:j,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:b,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:p,onScrollbarYChange:v,scrollbarYEnabled:T,onScrollbarYEnabledChange:I,onCornerWidthChange:y,onCornerHeightChange:S},g.createElement(ie.div,F({dir:j},s,{ref:E,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":$+"px",...t.style}})))}),Ok="ScrollAreaViewport",Lk=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,...o}=t,i=Rn(Ok,n),s=g.useRef(null),a=le(e,s,i.onViewportChange);return g.createElement(g.Fragment,null,g.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),g.createElement(ie.div,F({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style}}),g.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Yn="ScrollAreaScrollbar",Nk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Rn(Yn,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=t.orientation==="horizontal";return g.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?g.createElement(Bk,F({},r,{ref:e,forceMount:n})):o.type==="scroll"?g.createElement(Fk,F({},r,{ref:e,forceMount:n})):o.type==="auto"?g.createElement(q2,F({},r,{ref:e,forceMount:n})):o.type==="always"?g.createElement(df,F({},r,{ref:e})):null}),Bk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Rn(Yn,t.__scopeScrollArea),[i,s]=g.useState(!1);return g.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),g.createElement(Qe,{present:n||i},g.createElement(q2,F({"data-state":i?"visible":"hidden"},r,{ref:e})))}),Fk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Rn(Yn,t.__scopeScrollArea),i=t.orientation==="horizontal",s=Wl(()=>l("SCROLL_END"),100),[a,l]=Ik("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),g.useEffect(()=>{const c=o.viewport,d=i?"scrollLeft":"scrollTop";if(c){let h=c[d];const f=()=>{const m=c[d];h!==m&&(l("SCROLL"),s()),h=m};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),g.createElement(Qe,{present:n||a!=="hidden"},g.createElement(df,F({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:U(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:U(t.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),q2=g.forwardRef((t,e)=>{const n=Rn(Yn,t.__scopeScrollArea),{forceMount:r,...o}=t,[i,s]=g.useState(!1),a=t.orientation==="horizontal",l=Wl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:d)}},10);return za(n.viewport,l),za(n.content,l),g.createElement(Qe,{present:r||i},g.createElement(df,F({"data-state":i?"visible":"hidden"},o,{ref:e})))}),df=g.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,o=Rn(Yn,t.__scopeScrollArea),i=g.useRef(null),s=g.useRef(0),[a,l]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=G2(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,m){return Wk(f,s.current,a,m)}return n==="horizontal"?g.createElement(Vk,F({},d,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,m=P0(f,a,o.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=h(f,o.dir))}})):n==="vertical"?g.createElement(_k,F({},d,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,m=P0(f,a);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=h(f))}})):null}),Vk=g.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=Rn(Yn,t.__scopeScrollArea),[s,a]=g.useState(),l=g.useRef(null),c=le(e,l,i.onScrollbarXChange);return g.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),g.createElement(K2,F({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Pl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(i.viewport){const f=i.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),X2(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:_a(s.paddingLeft),paddingEnd:_a(s.paddingRight)}})}}))}),_k=g.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=Rn(Yn,t.__scopeScrollArea),[s,a]=g.useState(),l=g.useRef(null),c=le(e,l,i.onScrollbarYChange);return g.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),g.createElement(K2,F({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Pl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(i.viewport){const f=i.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),X2(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:_a(s.paddingTop),paddingEnd:_a(s.paddingBottom)}})}}))}),[zk,U2]=W2(Yn),K2=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:h,...f}=t,m=Rn(Yn,n),[b,p]=g.useState(null),v=le(e,E=>p(E)),x=g.useRef(null),y=g.useRef(""),$=m.viewport,S=r.content-r.viewport,A=Ke(d),k=Ke(l),T=Wl(h,10);function I(E){if(x.current){const j=E.clientX-x.current.left,L=E.clientY-x.current.top;c({x:j,y:L})}}return g.useEffect(()=>{const E=j=>{const L=j.target;b?.contains(L)&&A(j,S)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[$,b,S,A]),g.useEffect(k,[r,k]),za(b,T),za(m.content,T),g.createElement(zk,{scope:n,scrollbar:b,hasThumb:o,onThumbChange:Ke(i),onThumbPointerUp:Ke(s),onThumbPositionChange:k,onThumbPointerDown:Ke(a)},g.createElement(ie.div,F({},f,{ref:v,style:{position:"absolute",...f.style},onPointerDown:U(t.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),x.current=b.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),I(E))}),onPointerMove:U(t.onPointerMove,I),onPointerUp:U(t.onPointerUp,E=>{const j=E.target;j.hasPointerCapture(E.pointerId)&&j.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})))}),Ud="ScrollAreaThumb",Hk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=U2(Ud,t.__scopeScrollArea);return g.createElement(Qe,{present:n||o.hasThumb},g.createElement(Pk,F({ref:e},r)))}),Pk=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...o}=t,i=Rn(Ud,n),s=U2(Ud,n),{onThumbPositionChange:a}=s,l=le(e,h=>s.onThumbChange(h)),c=g.useRef(),d=Wl(()=>{c.current&&(c.current(),c.current=void 0)},100);return g.useEffect(()=>{const h=i.viewport;if(h){const f=()=>{if(d(),!c.current){const m=qk(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[i.viewport,d,a]),g.createElement(ie.div,F({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:U(t.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),b=h.clientX-m.left,p=h.clientY-m.top;s.onThumbPointerDown({x:b,y:p})}),onPointerUp:U(t.onPointerUp,s.onThumbPointerUp)}))});function _a(t){return t?parseInt(t,10):0}function G2(t,e){const n=t/e;return isNaN(n)?0:n}function Pl(t){const e=G2(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Wk(t,e,n,r="ltr"){const o=Pl(n),i=o/2,s=e||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return Y2([l,c],h)(t)}function P0(t,e,n="ltr"){const r=Pl(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-o,s=e.content-e.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Nd(t,l);return Y2([0,s],[0,a])(c)}function Y2(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function X2(t,e){return t>0&&t<e}const qk=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function o(){const i={left:t.scrollLeft,top:t.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&e(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Wl(t,e){const n=Ke(t),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function za(t,e){const n=Ke(e);Be(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}const Uk=Dk,Kk=Lk,Gk=Nk,Yk=Hk,Q2="Dialog",[Z2,J2]=qe(Q2),[Xk,nn]=Z2(Q2),Qk=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=t,a=g.useRef(null),l=g.useRef(null),[c=!1,d]=it({prop:r,defaultProp:o,onChange:i});return g.createElement(Xk,{scope:e,triggerRef:a,contentRef:l,contentId:at(),titleId:at(),descriptionId:at(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(h=>!h),[d]),modal:s},n)},Zk="DialogTrigger",Jk=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(Zk,n),i=le(e,o.triggerRef);return g.createElement(ie.button,F({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":uf(o.open)},r,{ref:i,onClick:U(t.onClick,o.onOpenToggle)}))}),eb="DialogPortal",[eT,tb]=Z2(eb,{forceMount:void 0}),tT=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,i=nn(eb,e);return g.createElement(eT,{scope:e,forceMount:n},g.Children.map(r,s=>g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},s))))},Kd="DialogOverlay",nT=g.forwardRef((t,e)=>{const n=tb(Kd,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=nn(Kd,t.__scopeDialog);return i.modal?g.createElement(Qe,{present:r||i.open},g.createElement(rT,F({},o,{ref:e}))):null}),rT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(Kd,n);return g.createElement(_l,{as:yn,allowPinchZoom:!0,shards:[o.contentRef]},g.createElement(ie.div,F({"data-state":uf(o.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),Fo="DialogContent",oT=g.forwardRef((t,e)=>{const n=tb(Fo,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=nn(Fo,t.__scopeDialog);return g.createElement(Qe,{present:r||i.open},i.modal?g.createElement(iT,F({},o,{ref:e})):g.createElement(sT,F({},o,{ref:e})))}),iT=g.forwardRef((t,e)=>{const n=nn(Fo,t.__scopeDialog),r=g.useRef(null),o=le(e,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return af(i)},[]),g.createElement(nb,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(t.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:U(t.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:U(t.onFocusOutside,i=>i.preventDefault())}))}),sT=g.forwardRef((t,e)=>{const n=nn(Fo,t.__scopeDialog),r=g.useRef(!1),o=g.useRef(!1);return g.createElement(nb,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),nb=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=t,a=nn(Fo,n),l=g.useRef(null),c=le(e,l);return Jo(),g.createElement(g.Fragment,null,g.createElement(ei,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},g.createElement(Xr,F({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":uf(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),rb="DialogTitle",aT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(rb,n);return g.createElement(ie.h2,F({id:o.titleId},r,{ref:e}))}),lT="DialogDescription",cT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(lT,n);return g.createElement(ie.p,F({id:o.descriptionId},r,{ref:e}))}),dT="DialogClose",uT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(dT,n);return g.createElement(ie.button,F({type:"button"},r,{ref:e,onClick:U(t.onClick,()=>o.onOpenChange(!1))}))});function uf(t){return t?"open":"closed"}const hT="DialogTitleWarning",[fT,SW]=sh(hT,{contentName:Fo,titleName:rb,docsSlug:"dialog"}),ob=Qk,ib=Jk,sb=tT,ab=nT,lb=oT,cb=aT,mT=cT,hf=uT,gT="AlertDialog",[pT,AW]=qe(gT,[J2]),Xn=J2(),bT=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xn(e);return g.createElement(ob,F({},r,n,{modal:!0}))},vT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(ib,F({},o,r,{ref:e}))}),xT=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xn(e);return g.createElement(sb,F({},r,n))},wT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(ab,F({},o,r,{ref:e}))}),db="AlertDialogContent",[yT,CT]=pT(db),$T=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...o}=t,i=Xn(n),s=g.useRef(null),a=le(e,s),l=g.useRef(null);return g.createElement(fT,{contentName:db,titleName:ST,docsSlug:"alert-dialog"},g.createElement(yT,{scope:n,cancelRef:l},g.createElement(lb,F({role:"alertdialog"},i,o,{ref:a,onOpenAutoFocus:U(o.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)===null||d===void 0||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault()}),g.createElement(ah,null,r),!1)))}),ST="AlertDialogTitle",AT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(cb,F({},o,r,{ref:e}))}),kT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(mT,F({},o,r,{ref:e}))}),TT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(hf,F({},o,r,{ref:e}))}),RT="AlertDialogCancel",MT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:o}=CT(RT,n),i=Xn(n),s=le(e,o);return g.createElement(hf,F({},i,r,{ref:s}))}),ET=bT,IT=vT,jT=xT,DT=wT,OT=$T,LT=TT,NT=MT,BT=AT,FT=kT;var va=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Ha(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(!Ha(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)&&!Ha(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function ub(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function W0(t,e){const n=ub(t);return Math.round(e*n)/n}function q0(t){const e=w.useRef(t);return va(()=>{e.current=t}),e}function VT(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);Ha(f,r)||m(r);const[b,p]=w.useState(null),[v,x]=w.useState(null),y=w.useCallback(P=>{P!==k.current&&(k.current=P,p(P))},[]),$=w.useCallback(P=>{P!==T.current&&(T.current=P,x(P))},[]),S=i||b,A=s||v,k=w.useRef(null),T=w.useRef(null),I=w.useRef(d),E=l!=null,j=q0(l),L=q0(o),D=w.useCallback(()=>{if(!k.current||!T.current)return;const P={placement:e,strategy:n,middleware:f};L.current&&(P.platform=L.current),sp(k.current,T.current,P).then(_=>{const O={..._,isPositioned:!0};z.current&&!Ha(I.current,O)&&(I.current=O,Yr.flushSync(()=>{h(O)}))})},[f,e,n,L]);va(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[c]);const z=w.useRef(!1);va(()=>(z.current=!0,()=>{z.current=!1}),[]),va(()=>{if(S&&(k.current=S),A&&(T.current=A),S&&A){if(j.current)return j.current(S,A,D);D()}},[S,A,D,j,E]);const V=w.useMemo(()=>({reference:k,floating:T,setReference:y,setFloating:$}),[y,$]),W=w.useMemo(()=>({reference:S,floating:A}),[S,A]),G=w.useMemo(()=>{const P={position:n,left:0,top:0};if(!W.floating)return P;const _=W0(W.floating,d.x),O=W0(W.floating,d.y);return a?{...P,transform:"translate("+_+"px, "+O+"px)",...ub(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:O}},[n,a,W.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:D,refs:V,elements:W,floatingStyles:G}),[d,D,V,W,G])}const _T=(t,e)=>({...rp(t),options:[t,e]}),zT=(t,e)=>({...op(t),options:[t,e]}),HT=(t,e)=>({...ip(t),options:[t,e]});var hb=wh(),Vc=function(){},ql=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Vc,onWheelCapture:Vc,onTouchMoveCapture:Vc}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,b=t.inert,p=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=t.gapMode,$=Ml(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,A=xh([n,e]),k=_e(_e({},$),o);return w.createElement(w.Fragment,null,d&&w.createElement(S,{sideCar:hb,removeScrollBar:c,shards:h,noIsolation:m,inert:b,setCallbacks:i,allowPinchZoom:!!p,lockRef:n,gapMode:y}),s?w.cloneElement(w.Children.only(a),_e(_e({},k),{ref:A})):w.createElement(x,_e({},k,{className:l,ref:A}),a))});ql.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ql.classNames={fullWidth:Co,zeroRight:yo};var Gd=!1;if(typeof window<"u")try{var Hs=Object.defineProperty({},"passive",{get:function(){return Gd=!0,!0}});window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Gd=!1}var co=Gd?{passive:!1}:!1,PT=function(t){return t.tagName==="TEXTAREA"},fb=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!PT(t)&&n[e]==="visible")},WT=function(t){return fb(t,"overflowY")},qT=function(t){return fb(t,"overflowX")},U0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mb(t,r);if(o){var i=gb(t,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},UT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},KT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},mb=function(t,e){return t==="v"?WT(e):qT(e)},gb=function(t,e){return t==="v"?UT(e):KT(e)},GT=function(t,e){return t==="h"&&e==="rtl"?-1:1},YT=function(t,e,n,r,o){var i=GT(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=gb(t,a),b=m[0],p=m[1],v=m[2],x=p-v-i*b;(b||x)&&mb(t,a)&&(h+=x,f+=b),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(c=!0),c},Ps=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},K0=function(t){return[t.deltaX,t.deltaY]},G0=function(t){return t&&"current"in t?t.current:t},XT=function(t,e){return t[0]===e[0]&&t[1]===e[1]},QT=function(t){return`
|
|
50
|
+
`)},pA=0,lo=[];function bA(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(pA++)[0],i=w.useState(function(){return Il()})[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=vh([t.lockRef.current],(t.shards||[]).map(z0),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(b,v){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=_s(b),y=n.current,$="deltaX"in b?b.deltaX:y[0]-x[0],S="deltaY"in b?b.deltaY:y[1]-x[1],A,k=b.target,T=Math.abs($)>Math.abs(S)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var I=V0(T,k);if(!I)return!0;if(I?A=T:(A=T==="v"?"h":"v",I=V0(T,k)),!I)return!1;if(!r.current&&"changedTouches"in b&&($||S)&&(r.current=A),!A)return!0;var E=r.current||A;return fA(E,v,b,E==="h"?$:S)},[]),l=w.useCallback(function(b){var v=b;if(!(!lo.length||lo[lo.length-1]!==i)){var x="deltaY"in v?_0(v):_s(v),y=e.current.filter(function(A){return A.name===v.type&&A.target===v.target&&mA(A.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(z0).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=$.length>0?a(v,$[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(b,v,x,y){var $={name:b,delta:v,target:x,should:y};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(S){return S!==$})},1)},[]),d=w.useCallback(function(b){n.current=_s(b),r.current=void 0},[]),h=w.useCallback(function(b){c(b.type,_0(b),b.target,a(b,t.lockRef.current))},[]),f=w.useCallback(function(b){c(b.type,_s(b),b.target,a(b,t.lockRef.current))},[]);w.useEffect(function(){return lo.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ao),document.addEventListener("touchmove",l,ao),document.addEventListener("touchstart",d,ao),function(){lo=lo.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ao),document.removeEventListener("touchmove",l,ao),document.removeEventListener("touchstart",d,ao)}},[]);var m=t.removeScrollBar,p=t.inert;return w.createElement(w.Fragment,null,p?w.createElement(i,{styles:gA(o)}):null,m?w.createElement(Ch,{gapMode:"margin"}):null)}const vA=yh(A2,bA);var _l=w.forwardRef(function(t,e){return w.createElement(Vl,_e({},t,{ref:e,sideCar:vA}))});_l.classNames=Vl.classNames;const H0=["Enter"," "],xA=["ArrowDown","PageUp","Home"],M2=["ArrowUp","PageDown","End"],wA=[...xA,...M2],yA={ltr:[...H0,"ArrowRight"],rtl:[...H0,"ArrowLeft"]},CA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zl="Menu",[Fi,$A,SA]=jl(zl),[Jr,E2]=qe(zl,[SA,br,ni]),lf=br(),I2=ni(),[AA,eo]=Jr(zl),[kA,Hl]=Jr(zl),TA=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=t,a=lf(e),[l,c]=g.useState(null),d=g.useRef(!1),h=Ke(i),f=Qr(o);return g.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),g.createElement(Tl,a,g.createElement(AA,{scope:e,open:n,onOpenChange:h,content:l,onContentChange:c},g.createElement(kA,{scope:e,onClose:g.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},j2=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=lf(n);return g.createElement(as,F({},o,r,{ref:e}))}),D2="MenuPortal",[RA,O2]=Jr(D2,{forceMount:void 0}),MA=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=eo(D2,e);return g.createElement(RA,{scope:e,forceMount:n},g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},r)))},Yt="MenuContent",[EA,L2]=Jr(Yt),IA=g.forwardRef((t,e)=>{const n=O2(Yt,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=eo(Yt,t.__scopeMenu),s=Hl(Yt,t.__scopeMenu);return g.createElement(Fi.Provider,{scope:t.__scopeMenu},g.createElement(Qe,{present:r||i.open},g.createElement(Fi.Slot,{scope:t.__scopeMenu},s.modal?g.createElement(jA,F({},o,{ref:e})):g.createElement(DA,F({},o,{ref:e})))))}),jA=g.forwardRef((t,e)=>{const n=eo(Yt,t.__scopeMenu),r=g.useRef(null),o=le(e,r);return g.useEffect(()=>{const i=r.current;if(i)return af(i)},[]),g.createElement(cf,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:U(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),DA=g.forwardRef((t,e)=>{const n=eo(Yt,t.__scopeMenu);return g.createElement(cf,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),cf=g.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:p,...b}=t,v=eo(Yt,n),x=Hl(Yt,n),y=lf(n),$=I2(n),S=$A(n),[A,k]=g.useState(null),T=g.useRef(null),I=le(e,T,v.onContentChange),E=g.useRef(0),j=g.useRef(""),L=g.useRef(0),D=g.useRef(null),z=g.useRef("right"),V=g.useRef(0),W=p?_l:g.Fragment,G=p?{as:yn,allowPinchZoom:!0}:void 0,P=O=>{var X,J;const fe=j.current+O,se=S().filter(ge=>!ge.disabled),pe=document.activeElement,be=(X=se.find(ge=>ge.ref.current===pe))===null||X===void 0?void 0:X.textValue,Se=se.map(ge=>ge.textValue),re=UA(Se,fe,be),xe=(J=se.find(ge=>ge.textValue===re))===null||J===void 0?void 0:J.ref.current;(function ge(ve){j.current=ve,window.clearTimeout(E.current),ve!==""&&(E.current=window.setTimeout(()=>ge(""),1e3))})(fe),xe&&setTimeout(()=>xe.focus())};g.useEffect(()=>()=>window.clearTimeout(E.current),[]),Jo();const _=g.useCallback(O=>{var X,J;return z.current===((X=D.current)===null||X===void 0?void 0:X.side)&&GA(O,(J=D.current)===null||J===void 0?void 0:J.area)},[]);return g.createElement(EA,{scope:n,searchRef:j,onItemEnter:g.useCallback(O=>{_(O)&&O.preventDefault()},[_]),onItemLeave:g.useCallback(O=>{var X;_(O)||((X=T.current)===null||X===void 0||X.focus(),k(null))},[_]),onTriggerLeave:g.useCallback(O=>{_(O)&&O.preventDefault()},[_]),pointerGraceTimerRef:L,onPointerGraceIntentChange:g.useCallback(O=>{D.current=O},[])},g.createElement(W,G,g.createElement(ei,{asChild:!0,trapped:o,onMountAutoFocus:U(i,O=>{var X;O.preventDefault(),(X=T.current)===null||X===void 0||X.focus()}),onUnmountAutoFocus:s},g.createElement(Xr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m},g.createElement(of,F({asChild:!0},$,{dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:U(l,O=>{x.isUsingKeyboardRef.current||O.preventDefault()})}),g.createElement(ls,F({role:"menu","aria-orientation":"vertical","data-state":B2(v.open),"data-radix-menu-content":"",dir:x.dir},y,b,{ref:I,style:{outline:"none",...b.style},onKeyDown:U(b.onKeyDown,O=>{const J=O.target.closest("[data-radix-menu-content]")===O.currentTarget,fe=O.ctrlKey||O.altKey||O.metaKey,se=O.key.length===1;J&&(O.key==="Tab"&&O.preventDefault(),!fe&&se&&P(O.key));const pe=T.current;if(O.target!==pe||!wA.includes(O.key))return;O.preventDefault();const Se=S().filter(re=>!re.disabled).map(re=>re.ref.current);M2.includes(O.key)&&Se.reverse(),WA(Se)}),onBlur:U(t.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(E.current),j.current="")}),onPointerMove:U(t.onPointerMove,Vi(O=>{const X=O.target,J=V.current!==O.clientX;if(O.currentTarget.contains(X)&&J){const fe=O.clientX>V.current?"right":"left";z.current=fe,V.current=O.clientX}}))})))))))}),OA=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.createElement(ie.div,F({},r,{ref:e}))}),LA="MenuItem",NA=g.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,s=L2(LA,n),a=I2(n),l=g.useRef(null),c=le(e,l),[d,h]=g.useState(!1),[f,m]=g.useState("");return g.useEffect(()=>{const p=l.current;if(p){var b;m(((b=p.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),g.createElement(Fi.ItemSlot,{scope:n,disabled:r,textValue:o??f},g.createElement(sf,F({asChild:!0},a,{focusable:!r}),g.createElement(ie.div,F({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:U(t.onPointerMove,Vi(p=>{r?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus())})),onPointerLeave:U(t.onPointerLeave,Vi(p=>s.onItemLeave(p))),onFocus:U(t.onFocus,()=>h(!0)),onBlur:U(t.onBlur,()=>h(!1))}))))}),BA="MenuRadioGroup",[pW,bW]=Jr(BA,{value:void 0,onValueChange:()=>{}}),FA="MenuItemIndicator",[vW,xW]=Jr(FA,{checked:!1}),VA=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return g.createElement(ie.div,F({role:"separator","aria-orientation":"horizontal"},r,{ref:e}))}),_A="MenuSub",[wW,N2]=Jr(_A),zs="MenuSubTrigger",zA=g.forwardRef((t,e)=>{const n=eo(zs,t.__scopeMenu),r=Hl(zs,t.__scopeMenu),o=N2(zs,t.__scopeMenu),i=L2(zs,t.__scopeMenu),s=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},d=g.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return g.useEffect(()=>d,[d]),g.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),g.createElement(j2,F({asChild:!0},c),g.createElement(NA,F({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":B2(n.open)},t,{ref:Cl(e,o.onTriggerChange),onClick:h=>{var f;(f=t.onClick)===null||f===void 0||f.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:U(t.onPointerMove,Vi(h=>{i.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:U(t.onPointerLeave,Vi(h=>{var f;d();const m=(f=n.content)===null||f===void 0?void 0:f.getBoundingClientRect();if(m){var p;const b=(p=n.content)===null||p===void 0?void 0:p.dataset.side,v=b==="right",x=v?-5:5,y=m[v?"left":"right"],$=m[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:y,y:m.top},{x:$,y:m.top},{x:$,y:m.bottom},{x:y,y:m.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:U(t.onKeyDown,h=>{const f=i.searchRef.current!=="";if(!(t.disabled||f&&h.key===" ")&&yA[r.dir].includes(h.key)){var m;n.onOpenChange(!0),(m=n.content)===null||m===void 0||m.focus(),h.preventDefault()}})})))}),HA="MenuSubContent",PA=g.forwardRef((t,e)=>{const n=O2(Yt,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=eo(Yt,t.__scopeMenu),s=Hl(Yt,t.__scopeMenu),a=N2(HA,t.__scopeMenu),l=g.useRef(null),c=le(e,l);return g.createElement(Fi.Provider,{scope:t.__scopeMenu},g.createElement(Qe,{present:r||i.open},g.createElement(Fi.Slot,{scope:t.__scopeMenu},g.createElement(cf,F({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;s.isUsingKeyboardRef.current&&((h=l.current)===null||h===void 0||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:U(t.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:U(t.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:U(t.onKeyDown,d=>{const h=d.currentTarget.contains(d.target),f=CA[s.dir].includes(d.key);if(h&&f){var m;i.onOpenChange(!1),(m=a.trigger)===null||m===void 0||m.focus(),d.preventDefault()}})})))))});function B2(t){return t?"open":"closed"}function WA(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function qA(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function UA(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=qA(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function KA(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const a=e[i].x,l=e[i].y,c=e[s].x,d=e[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function GA(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return KA(n,e)}function Vi(t){return e=>e.pointerType==="mouse"?t(e):void 0}const YA=TA,XA=j2,QA=MA,ZA=IA,JA=OA,ek=VA,tk=zA,nk=PA,F2="DropdownMenu",[rk,yW]=qe(F2,[E2]),wr=E2(),[ok,V2]=rk(F2),ik=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,l=wr(e),c=g.useRef(null),[d=!1,h]=it({prop:o,defaultProp:i,onChange:s});return g.createElement(ok,{scope:e,triggerId:at(),triggerRef:c,contentId:at(),open:d,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(f=>!f),[h]),modal:a},g.createElement(YA,F({},l,{open:d,onOpenChange:h,dir:r,modal:a}),n))},sk="DropdownMenuTrigger",ak=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=V2(sk,n),s=wr(n);return g.createElement(XA,F({asChild:!0},s),g.createElement(ie.button,F({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Cl(e,i.triggerRef),onPointerDown:U(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:U(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),lk=t=>{const{__scopeDropdownMenu:e,...n}=t,r=wr(e);return g.createElement(QA,F({},r,n))},ck="DropdownMenuContent",dk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=V2(ck,n),i=wr(n),s=g.useRef(!1);return g.createElement(ZA,F({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:e,onCloseAutoFocus:U(t.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:U(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),uk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(JA,F({},o,r,{ref:e}))}),hk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(ek,F({},o,r,{ref:e}))}),fk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(tk,F({},o,r,{ref:e}))}),mk=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=wr(n);return g.createElement(nk,F({},o,r,{ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),gk=ik,pk=ak,_2=lk,bk=dk,vk=uk,xk=hk,wk=fk,yk=mk,z2="Checkbox",[Ck,CW]=qe(z2),[$k,Sk]=Ck(z2),Ak=g.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=t,[h,f]=g.useState(null),m=le(e,$=>f($)),p=g.useRef(!1),b=h?!!h.closest("form"):!0,[v=!1,x]=it({prop:o,defaultProp:i,onChange:c}),y=g.useRef(v);return g.useEffect(()=>{const $=h?.form;if($){const S=()=>x(y.current);return $.addEventListener("reset",S),()=>$.removeEventListener("reset",S)}},[h,x]),g.createElement($k,{scope:n,state:v,disabled:a},g.createElement(ie.button,F({type:"button",role:"checkbox","aria-checked":Dr(v)?"mixed":v,"aria-required":s,"data-state":H2(v),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:m,onKeyDown:U(t.onKeyDown,$=>{$.key==="Enter"&&$.preventDefault()}),onClick:U(t.onClick,$=>{x(S=>Dr(S)?!0:!S),b&&(p.current=$.isPropagationStopped(),p.current||$.stopPropagation())})})),b&&g.createElement(Rk,{control:h,bubbles:!p.current,name:r,value:l,checked:v,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),kk="CheckboxIndicator",Tk=g.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,i=Sk(kk,n);return g.createElement(Qe,{present:r||Dr(i.state)||i.state===!0},g.createElement(ie.span,F({"data-state":H2(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:e,style:{pointerEvents:"none",...t.style}})))}),Rk=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=g.useRef(null),s=Dl(n),a=kl(e);return g.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const f=new Event("click",{bubbles:r});l.indeterminate=Dr(n),h.call(l,Dr(n)?!1:n),l.dispatchEvent(f)}},[s,n,r]),g.createElement("input",F({type:"checkbox","aria-hidden":!0,defaultChecked:Dr(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Dr(t){return t==="indeterminate"}function H2(t){return Dr(t)?"indeterminate":t?"checked":"unchecked"}const Mk=Ak,Ek=Tk;function Ik(t,e){return g.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const P2="ScrollArea",[W2,$W]=qe(P2),[jk,Rn]=W2(P2),Dk=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=t,[a,l]=g.useState(null),[c,d]=g.useState(null),[h,f]=g.useState(null),[m,p]=g.useState(null),[b,v]=g.useState(null),[x,y]=g.useState(0),[$,S]=g.useState(0),[A,k]=g.useState(!1),[T,I]=g.useState(!1),E=le(e,L=>l(L)),j=Qr(o);return g.createElement(jk,{scope:n,type:r,dir:j,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:d,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:p,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:T,onScrollbarYEnabledChange:I,onCornerWidthChange:y,onCornerHeightChange:S},g.createElement(ie.div,F({dir:j},s,{ref:E,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":$+"px",...t.style}})))}),Ok="ScrollAreaViewport",Lk=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,...o}=t,i=Rn(Ok,n),s=g.useRef(null),a=le(e,s,i.onViewportChange);return g.createElement(g.Fragment,null,g.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),g.createElement(ie.div,F({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style}}),g.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Yn="ScrollAreaScrollbar",Nk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Rn(Yn,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=t.orientation==="horizontal";return g.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?g.createElement(Bk,F({},r,{ref:e,forceMount:n})):o.type==="scroll"?g.createElement(Fk,F({},r,{ref:e,forceMount:n})):o.type==="auto"?g.createElement(q2,F({},r,{ref:e,forceMount:n})):o.type==="always"?g.createElement(df,F({},r,{ref:e})):null}),Bk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Rn(Yn,t.__scopeScrollArea),[i,s]=g.useState(!1);return g.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),g.createElement(Qe,{present:n||i},g.createElement(q2,F({"data-state":i?"visible":"hidden"},r,{ref:e})))}),Fk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Rn(Yn,t.__scopeScrollArea),i=t.orientation==="horizontal",s=Wl(()=>l("SCROLL_END"),100),[a,l]=Ik("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),g.useEffect(()=>{const c=o.viewport,d=i?"scrollLeft":"scrollTop";if(c){let h=c[d];const f=()=>{const m=c[d];h!==m&&(l("SCROLL"),s()),h=m};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),g.createElement(Qe,{present:n||a!=="hidden"},g.createElement(df,F({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:U(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:U(t.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),q2=g.forwardRef((t,e)=>{const n=Rn(Yn,t.__scopeScrollArea),{forceMount:r,...o}=t,[i,s]=g.useState(!1),a=t.orientation==="horizontal",l=Wl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:d)}},10);return za(n.viewport,l),za(n.content,l),g.createElement(Qe,{present:r||i},g.createElement(df,F({"data-state":i?"visible":"hidden"},o,{ref:e})))}),df=g.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,o=Rn(Yn,t.__scopeScrollArea),i=g.useRef(null),s=g.useRef(0),[a,l]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=G2(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,m){return Wk(f,s.current,a,m)}return n==="horizontal"?g.createElement(Vk,F({},d,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,m=P0(f,a,o.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=h(f,o.dir))}})):n==="vertical"?g.createElement(_k,F({},d,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,m=P0(f,a);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=h(f))}})):null}),Vk=g.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=Rn(Yn,t.__scopeScrollArea),[s,a]=g.useState(),l=g.useRef(null),c=le(e,l,i.onScrollbarXChange);return g.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),g.createElement(K2,F({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Pl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(i.viewport){const f=i.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),X2(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:_a(s.paddingLeft),paddingEnd:_a(s.paddingRight)}})}}))}),_k=g.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=Rn(Yn,t.__scopeScrollArea),[s,a]=g.useState(),l=g.useRef(null),c=le(e,l,i.onScrollbarYChange);return g.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),g.createElement(K2,F({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Pl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(i.viewport){const f=i.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),X2(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:_a(s.paddingTop),paddingEnd:_a(s.paddingBottom)}})}}))}),[zk,U2]=W2(Yn),K2=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:h,...f}=t,m=Rn(Yn,n),[p,b]=g.useState(null),v=le(e,E=>b(E)),x=g.useRef(null),y=g.useRef(""),$=m.viewport,S=r.content-r.viewport,A=Ke(d),k=Ke(l),T=Wl(h,10);function I(E){if(x.current){const j=E.clientX-x.current.left,L=E.clientY-x.current.top;c({x:j,y:L})}}return g.useEffect(()=>{const E=j=>{const L=j.target;p?.contains(L)&&A(j,S)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[$,p,S,A]),g.useEffect(k,[r,k]),za(p,T),za(m.content,T),g.createElement(zk,{scope:n,scrollbar:p,hasThumb:o,onThumbChange:Ke(i),onThumbPointerUp:Ke(s),onThumbPositionChange:k,onThumbPointerDown:Ke(a)},g.createElement(ie.div,F({},f,{ref:v,style:{position:"absolute",...f.style},onPointerDown:U(t.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),x.current=p.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),I(E))}),onPointerMove:U(t.onPointerMove,I),onPointerUp:U(t.onPointerUp,E=>{const j=E.target;j.hasPointerCapture(E.pointerId)&&j.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})))}),Ud="ScrollAreaThumb",Hk=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=U2(Ud,t.__scopeScrollArea);return g.createElement(Qe,{present:n||o.hasThumb},g.createElement(Pk,F({ref:e},r)))}),Pk=g.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...o}=t,i=Rn(Ud,n),s=U2(Ud,n),{onThumbPositionChange:a}=s,l=le(e,h=>s.onThumbChange(h)),c=g.useRef(),d=Wl(()=>{c.current&&(c.current(),c.current=void 0)},100);return g.useEffect(()=>{const h=i.viewport;if(h){const f=()=>{if(d(),!c.current){const m=qk(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[i.viewport,d,a]),g.createElement(ie.div,F({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:U(t.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),p=h.clientX-m.left,b=h.clientY-m.top;s.onThumbPointerDown({x:p,y:b})}),onPointerUp:U(t.onPointerUp,s.onThumbPointerUp)}))});function _a(t){return t?parseInt(t,10):0}function G2(t,e){const n=t/e;return isNaN(n)?0:n}function Pl(t){const e=G2(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Wk(t,e,n,r="ltr"){const o=Pl(n),i=o/2,s=e||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return Y2([l,c],h)(t)}function P0(t,e,n="ltr"){const r=Pl(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-o,s=e.content-e.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Nd(t,l);return Y2([0,s],[0,a])(c)}function Y2(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function X2(t,e){return t>0&&t<e}const qk=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function o(){const i={left:t.scrollLeft,top:t.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&e(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Wl(t,e){const n=Ke(t),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function za(t,e){const n=Ke(e);Be(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}const Uk=Dk,Kk=Lk,Gk=Nk,Yk=Hk,Q2="Dialog",[Z2,J2]=qe(Q2),[Xk,nn]=Z2(Q2),Qk=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=t,a=g.useRef(null),l=g.useRef(null),[c=!1,d]=it({prop:r,defaultProp:o,onChange:i});return g.createElement(Xk,{scope:e,triggerRef:a,contentRef:l,contentId:at(),titleId:at(),descriptionId:at(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(h=>!h),[d]),modal:s},n)},Zk="DialogTrigger",Jk=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(Zk,n),i=le(e,o.triggerRef);return g.createElement(ie.button,F({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":uf(o.open)},r,{ref:i,onClick:U(t.onClick,o.onOpenToggle)}))}),eb="DialogPortal",[eT,tb]=Z2(eb,{forceMount:void 0}),tT=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,i=nn(eb,e);return g.createElement(eT,{scope:e,forceMount:n},g.Children.map(r,s=>g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},s))))},Kd="DialogOverlay",nT=g.forwardRef((t,e)=>{const n=tb(Kd,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=nn(Kd,t.__scopeDialog);return i.modal?g.createElement(Qe,{present:r||i.open},g.createElement(rT,F({},o,{ref:e}))):null}),rT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(Kd,n);return g.createElement(_l,{as:yn,allowPinchZoom:!0,shards:[o.contentRef]},g.createElement(ie.div,F({"data-state":uf(o.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),Fo="DialogContent",oT=g.forwardRef((t,e)=>{const n=tb(Fo,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=nn(Fo,t.__scopeDialog);return g.createElement(Qe,{present:r||i.open},i.modal?g.createElement(iT,F({},o,{ref:e})):g.createElement(sT,F({},o,{ref:e})))}),iT=g.forwardRef((t,e)=>{const n=nn(Fo,t.__scopeDialog),r=g.useRef(null),o=le(e,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return af(i)},[]),g.createElement(nb,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(t.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:U(t.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:U(t.onFocusOutside,i=>i.preventDefault())}))}),sT=g.forwardRef((t,e)=>{const n=nn(Fo,t.__scopeDialog),r=g.useRef(!1),o=g.useRef(!1);return g.createElement(nb,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),nb=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=t,a=nn(Fo,n),l=g.useRef(null),c=le(e,l);return Jo(),g.createElement(g.Fragment,null,g.createElement(ei,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},g.createElement(Xr,F({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":uf(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),rb="DialogTitle",aT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(rb,n);return g.createElement(ie.h2,F({id:o.titleId},r,{ref:e}))}),lT="DialogDescription",cT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(lT,n);return g.createElement(ie.p,F({id:o.descriptionId},r,{ref:e}))}),dT="DialogClose",uT=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=nn(dT,n);return g.createElement(ie.button,F({type:"button"},r,{ref:e,onClick:U(t.onClick,()=>o.onOpenChange(!1))}))});function uf(t){return t?"open":"closed"}const hT="DialogTitleWarning",[fT,SW]=sh(hT,{contentName:Fo,titleName:rb,docsSlug:"dialog"}),ob=Qk,ib=Jk,sb=tT,ab=nT,lb=oT,cb=aT,mT=cT,hf=uT,gT="AlertDialog",[pT,AW]=qe(gT,[J2]),Xn=J2(),bT=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xn(e);return g.createElement(ob,F({},r,n,{modal:!0}))},vT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(ib,F({},o,r,{ref:e}))}),xT=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xn(e);return g.createElement(sb,F({},r,n))},wT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(ab,F({},o,r,{ref:e}))}),db="AlertDialogContent",[yT,CT]=pT(db),$T=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...o}=t,i=Xn(n),s=g.useRef(null),a=le(e,s),l=g.useRef(null);return g.createElement(fT,{contentName:db,titleName:ST,docsSlug:"alert-dialog"},g.createElement(yT,{scope:n,cancelRef:l},g.createElement(lb,F({role:"alertdialog"},i,o,{ref:a,onOpenAutoFocus:U(o.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)===null||d===void 0||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault()}),g.createElement(ah,null,r),!1)))}),ST="AlertDialogTitle",AT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(cb,F({},o,r,{ref:e}))}),kT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(mT,F({},o,r,{ref:e}))}),TT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,o=Xn(n);return g.createElement(hf,F({},o,r,{ref:e}))}),RT="AlertDialogCancel",MT=g.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:o}=CT(RT,n),i=Xn(n),s=le(e,o);return g.createElement(hf,F({},i,r,{ref:s}))}),ET=bT,IT=vT,jT=xT,DT=wT,OT=$T,LT=TT,NT=MT,BT=AT,FT=kT;var va=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Ha(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(!Ha(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)&&!Ha(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function ub(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function W0(t,e){const n=ub(t);return Math.round(e*n)/n}function q0(t){const e=w.useRef(t);return va(()=>{e.current=t}),e}function VT(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);Ha(f,r)||m(r);const[p,b]=w.useState(null),[v,x]=w.useState(null),y=w.useCallback(P=>{P!==k.current&&(k.current=P,b(P))},[]),$=w.useCallback(P=>{P!==T.current&&(T.current=P,x(P))},[]),S=i||p,A=s||v,k=w.useRef(null),T=w.useRef(null),I=w.useRef(d),E=l!=null,j=q0(l),L=q0(o),D=w.useCallback(()=>{if(!k.current||!T.current)return;const P={placement:e,strategy:n,middleware:f};L.current&&(P.platform=L.current),sp(k.current,T.current,P).then(_=>{const O={..._,isPositioned:!0};z.current&&!Ha(I.current,O)&&(I.current=O,Yr.flushSync(()=>{h(O)}))})},[f,e,n,L]);va(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[c]);const z=w.useRef(!1);va(()=>(z.current=!0,()=>{z.current=!1}),[]),va(()=>{if(S&&(k.current=S),A&&(T.current=A),S&&A){if(j.current)return j.current(S,A,D);D()}},[S,A,D,j,E]);const V=w.useMemo(()=>({reference:k,floating:T,setReference:y,setFloating:$}),[y,$]),W=w.useMemo(()=>({reference:S,floating:A}),[S,A]),G=w.useMemo(()=>{const P={position:n,left:0,top:0};if(!W.floating)return P;const _=W0(W.floating,d.x),O=W0(W.floating,d.y);return a?{...P,transform:"translate("+_+"px, "+O+"px)",...ub(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:O}},[n,a,W.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:D,refs:V,elements:W,floatingStyles:G}),[d,D,V,W,G])}const _T=(t,e)=>({...rp(t),options:[t,e]}),zT=(t,e)=>({...op(t),options:[t,e]}),HT=(t,e)=>({...ip(t),options:[t,e]});var hb=wh(),Vc=function(){},ql=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Vc,onWheelCapture:Vc,onTouchMoveCapture:Vc}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,p=t.inert,b=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=t.gapMode,$=Ml(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,A=xh([n,e]),k=_e(_e({},$),o);return w.createElement(w.Fragment,null,d&&w.createElement(S,{sideCar:hb,removeScrollBar:c,shards:h,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:y}),s?w.cloneElement(w.Children.only(a),_e(_e({},k),{ref:A})):w.createElement(x,_e({},k,{className:l,ref:A}),a))});ql.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ql.classNames={fullWidth:Co,zeroRight:yo};var Gd=!1;if(typeof window<"u")try{var Hs=Object.defineProperty({},"passive",{get:function(){return Gd=!0,!0}});window.addEventListener("test",Hs,Hs),window.removeEventListener("test",Hs,Hs)}catch{Gd=!1}var co=Gd?{passive:!1}:!1,PT=function(t){return t.tagName==="TEXTAREA"},fb=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!PT(t)&&n[e]==="visible")},WT=function(t){return fb(t,"overflowY")},qT=function(t){return fb(t,"overflowX")},U0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mb(t,r);if(o){var i=gb(t,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},UT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},KT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},mb=function(t,e){return t==="v"?WT(e):qT(e)},gb=function(t,e){return t==="v"?UT(e):KT(e)},GT=function(t,e){return t==="h"&&e==="rtl"?-1:1},YT=function(t,e,n,r,o){var i=GT(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=gb(t,a),p=m[0],b=m[1],v=m[2],x=b-v-i*p;(p||x)&&mb(t,a)&&(h+=x,f+=p),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(c=!0),c},Ps=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},K0=function(t){return[t.deltaX,t.deltaY]},G0=function(t){return t&&"current"in t?t.current:t},XT=function(t,e){return t[0]===e[0]&&t[1]===e[1]},QT=function(t){return`
|
|
51
51
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
52
52
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
53
|
-
`)},ZT=0,uo=[];function JT(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(ZT++)[0],i=w.useState(Il)[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var p=vh([t.lockRef.current],(t.shards||[]).map(G0),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(p,v){if("touches"in p&&p.touches.length===2)return!s.current.allowPinchZoom;var x=Ps(p),y=n.current,$="deltaX"in p?p.deltaX:y[0]-x[0],S="deltaY"in p?p.deltaY:y[1]-x[1],A,k=p.target,T=Math.abs($)>Math.abs(S)?"h":"v";if("touches"in p&&T==="h"&&k.type==="range")return!1;var I=U0(T,k);if(!I)return!0;if(I?A=T:(A=T==="v"?"h":"v",I=U0(T,k)),!I)return!1;if(!r.current&&"changedTouches"in p&&($||S)&&(r.current=A),!A)return!0;var E=r.current||A;return YT(E,v,p,E==="h"?$:S)},[]),l=w.useCallback(function(p){var v=p;if(!(!uo.length||uo[uo.length-1]!==i)){var x="deltaY"in v?K0(v):Ps(v),y=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&XT(A.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(G0).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=$.length>0?a(v,$[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(p,v,x,y){var $={name:p,delta:v,target:x,should:y,shadowParent:eR(x)};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(S){return S!==$})},1)},[]),d=w.useCallback(function(p){n.current=Ps(p),r.current=void 0},[]),h=w.useCallback(function(p){c(p.type,K0(p),p.target,a(p,t.lockRef.current))},[]),f=w.useCallback(function(p){c(p.type,Ps(p),p.target,a(p,t.lockRef.current))},[]);w.useEffect(function(){return uo.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,co),document.addEventListener("touchmove",l,co),document.addEventListener("touchstart",d,co),function(){uo=uo.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,co),document.removeEventListener("touchmove",l,co),document.removeEventListener("touchstart",d,co)}},[]);var m=t.removeScrollBar,b=t.inert;return w.createElement(w.Fragment,null,b?w.createElement(i,{styles:QT(o)}):null,m?w.createElement(Ch,{gapMode:t.gapMode}):null)}function eR(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const tR=yh(hb,JT);var pb=w.forwardRef(function(t,e){return w.createElement(ql,_e({},t,{ref:e,sideCar:tR}))});pb.classNames=ql.classNames;const bb=1024;let nR=0,_c=class{constructor(e,n){this.from=e,this.to=n}};class we{constructor(e={}){this.id=nR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=St.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}we.closedBy=new we({deserialize:t=>t.split(" ")});we.openedBy=new we({deserialize:t=>t.split(" ")});we.group=new we({deserialize:t=>t.split(" ")});we.isolate=new we({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});we.contextHash=new we({perNode:!0});we.lookAhead=new we({perNode:!0});we.mounted=new we({perNode:!0});class Pa{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[we.mounted.id]}}const rR=Object.create(null);class St{constructor(e,n,r,o=0){this.name=e,this.props=n,this.id=r,this.flags=o}static define(e){let n=e.props&&e.props.length?Object.create(null):rR,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new St(e.name||"",n,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(o)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return o}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(we.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let o of r.split(" "))n[o]=e[r];return r=>{for(let o=r.prop(we.group),i=-1;i<(o?o.length:0);i++){let s=n[i<0?r.name:o[i]];if(s)return s}}}}St.none=new St("",Object.create(null),0,8);class ff{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let o=null;for(let i of e){let s=i(r);s&&(o||(o=Object.assign({},r.props)),o[s[0].id]=s[1])}n.push(o?new St(r.name,o,r.id,r.flags):r)}return new ff(n)}}const Ws=new WeakMap,Y0=new WeakMap;var Ze;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Ze||(Ze={}));class Ge{constructor(e,n,r,o,i){if(this.type=e,this.children=n,this.positions=r,this.length=o,this.props=null,i&&i.length){this.props=Object.create(null);for(let[s,a]of i)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=Pa.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let o=r.toString();o&&(n&&(n+=","),n+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Xd(this.topNode,e)}cursorAt(e,n=0,r=0){let o=Ws.get(this)||this.topNode,i=new Xd(o);return i.moveTo(e,n),Ws.set(this,i._tree),i}get topNode(){return new Ft(this,0,0,null)}resolve(e,n=0){let r=_i(Ws.get(this)||this.topNode,e,n,!1);return Ws.set(this,r),r}resolveInner(e,n=0){let r=_i(Y0.get(this)||this.topNode,e,n,!0);return Y0.set(this,r),r}resolveStack(e,n=0){return sR(this,e,n)}iterate(e){let{enter:n,leave:r,from:o=0,to:i=this.length}=e,s=e.mode||0,a=(s&Ze.IncludeAnonymous)>0;for(let l=this.cursor(s|Ze.IncludeAnonymous);;){let c=!1;if(l.from<=i&&l.to>=o&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:pf(St.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,o)=>new Ge(this.type,n,r,o,this.propValues),e.makeTree||((n,r,o)=>new Ge(St.none,n,r,o)))}static build(e){return aR(e)}}Ge.empty=new Ge(St.none,[],[],0);class mf{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new mf(this.buffer,this.index)}}class hr{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return St.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],o=this.set.types[n],i=o.name;if(/\W/.test(i)&&!o.isError&&(i=JSON.stringify(i)),e+=4,r==e)return i;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return i+"("+s.join(",")+")"}findChild(e,n,r,o,i){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(vb(i,o,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(e,n,r){let o=this.buffer,i=new Uint16Array(n-e),s=0;for(let a=e,l=0;a<n;){i[l++]=o[a++],i[l++]=o[a++]-r;let c=i[l++]=o[a++]-r;i[l++]=o[a++]-e,s=Math.max(s,c)}return new hr(i,s,this.set)}}function vb(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function _i(t,e,n,r){for(var o;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Ft&&t.index<0?null:t.parent;if(!s)return t;t=s}let i=r?0:Ze.IgnoreOverlays;if(r)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Ft&&s.index<0&&((o=a.enter(e,n,i))===null||o===void 0?void 0:o.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,i);if(!s)return t;t=s}}class xb{cursor(e=0){return new Xd(this,e)}getChild(e,n=null,r=null){let o=X0(this,e,n,r);return o.length?o[0]:null}getChildren(e,n=null,r=null){return X0(this,e,n,r)}resolve(e,n=0){return _i(this,e,n,!1)}resolveInner(e,n=0){return _i(this,e,n,!0)}matchContext(e){return Yd(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let o=n.lastChild;if(!o||o.to!=n.to)break;o.type.isError&&o.from==o.to?(r=n,n=o.prevSibling):n=o}return r}get node(){return this}get next(){return this.parent}}class Ft extends xb{constructor(e,n,r,o){super(),this._tree=e,this.from=n,this.index=r,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,o,i=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let d=a[e],h=l[e]+s.from;if(vb(o,r,h,h+d.length)){if(d instanceof hr){if(i&Ze.ExcludeBuffers)continue;let f=d.findChild(0,d.buffer.length,n,r-h,o);if(f>-1)return new rr(new oR(s,d,e,h),null,f)}else if(i&Ze.IncludeAnonymous||!d.type.isAnonymous||gf(d)){let f;if(!(i&Ze.IgnoreMounts)&&(f=Pa.get(d))&&!f.overlay)return new Ft(f.tree,h,e,s);let m=new Ft(d,h,e,s);return i&Ze.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?d.children.length-1:0,n,r,o)}}}if(i&Ze.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let o;if(!(r&Ze.IgnoreOverlays)&&(o=Pa.get(this._tree))&&o.overlay){let i=e-this.from;for(let{from:s,to:a}of o.overlay)if((n>0?s<=i:s<i)&&(n<0?a>=i:a>i))return new Ft(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function X0(t,e,n,r){let o=t.cursor(),i=[];if(!o.firstChild())return i;if(n!=null){for(let s=!1;!s;)if(s=o.type.is(n),!o.nextSibling())return i}for(;;){if(r!=null&&o.type.is(r))return i;if(o.type.is(e)&&i.push(o.node),!o.nextSibling())return r==null?i:[]}}function Yd(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class oR{constructor(e,n,r,o){this.parent=e,this.buffer=n,this.index=r,this.start=o}}class rr extends xb{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:o}=this.context,i=o.findChild(this.index+4,o.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new rr(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Ze.ExcludeBuffers)return null;let{buffer:o}=this.context,i=o.findChild(this.index+4,o.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new rr(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new rr(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new rr(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,o=this.index+4,i=r.buffer[this.index+3];if(i>o){let s=r.buffer[this.index+1];e.push(r.slice(o,i,s)),n.push(0)}return new Ge(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function wb(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;i<t.length;i++){let s=t[i];(s.from>n.from||s.to<n.to)&&(n=s,e=i)}let r=n instanceof Ft&&n.index<0?null:n.parent,o=t.slice();return r?o[e]=r:o.splice(e,1),new iR(o,n)}class iR{constructor(e,n){this.heads=e,this.node=n}get next(){return wb(this.heads)}}function sR(t,e,n){let r=t.resolveInner(e,n),o=null;for(let i=r instanceof Ft?r:r.context.parent;i;i=i.parent)if(i.index<0){let s=i.parent;(o||(o=[r])).push(s.resolve(e,n)),i=s}else{let s=Pa.get(i.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Ft(s.tree,s.overlay[0].from+i.from,-1,i);(o||(o=[r])).push(_i(a,e,n,!1))}}return o?wb(o):r}class Xd{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ft)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:o}=this.buffer;return this.type=n||o.set.types[o.buffer[e]],this.from=r+o.buffer[e+1],this.to=r+o.buffer[e+2],!0}yield(e){return e?e instanceof Ft?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:o}=this.buffer,i=o.findChild(this.index+4,o.buffer[this.index+3],e,n-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Ze.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ze.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ze.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let o=r<0?0:this.stack[r]+4;if(this.index!=o)return this.yieldBuf(n.findChild(o,this.index,-1,0,4))}else{let o=n.buffer[this.index+3];if(o<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(o)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:o}=this;if(o){if(e>0){if(this.index<o.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(o.buffer.buffer[i+3]<this.index)return!1;({index:n,parent:r}=o)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let i=n+e,s=e<0?-1:r._tree.children.length;i!=s;i+=e){let a=r._tree.children[i];if(this.mode&Ze.IncludeAnonymous||a instanceof hr||!a.type.isAnonymous||gf(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let o=this.index,i=this.stack.length;i>=0;){for(let s=e;s;s=s._parent)if(s.index==o){if(o==this.index)return s;n=s,r=i+1;break e}o=this.stack[--i]}for(let o=r;o<this.stack.length;o++)n=new rr(this.buffer,n,this.stack[o]);return this.bufferNode=new rr(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let o=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&n&&n(this),o=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,o=!0}}}matchContext(e){if(!this.buffer)return Yd(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let o=e.length-1,i=this.stack.length-1;o>=0;i--){if(i<0)return Yd(this._tree,e,o);let s=r[n.buffer[this.stack[i]]];if(!s.isAnonymous){if(e[o]&&e[o]!=s.name)return!1;o--}}return!0}}function gf(t){return t.children.some(e=>e instanceof hr||!e.type.isAnonymous||gf(e))}function aR(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:o=bb,reused:i=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new mf(n,n.length):n,l=r.types,c=0,d=0;function h(A,k,T,I,E,j){let{id:L,start:D,end:z,size:V}=a,W=d,G=c;for(;V<0;)if(a.next(),V==-1){let J=i[L];T.push(J),I.push(D-A);return}else if(V==-3){c=L;return}else if(V==-4){d=L;return}else throw new RangeError(`Unrecognized record size: ${V}`);let P=l[L],_,O,X=D-A;if(z-D<=o&&(O=v(a.pos-k,E))){let J=new Uint16Array(O.size-O.skip),fe=a.pos-O.size,se=J.length;for(;a.pos>fe;)se=x(O.start,J,se);_=new hr(J,z-O.start,r),X=O.start-A}else{let J=a.pos-V;a.next();let fe=[],se=[],pe=L>=s?L:-1,be=0,Se=z;for(;a.pos>J;)pe>=0&&a.id==pe&&a.size>=0?(a.end<=Se-o&&(b(fe,se,D,be,a.end,Se,pe,W,G),be=fe.length,Se=a.end),a.next()):j>2500?f(D,J,fe,se):h(D,J,fe,se,pe,j+1);if(pe>=0&&be>0&&be<fe.length&&b(fe,se,D,be,D,Se,pe,W,G),fe.reverse(),se.reverse(),pe>-1&&be>0){let re=m(P,G);_=pf(P,fe,se,0,fe.length,0,z-D,re,re)}else _=p(P,fe,se,z-D,W-z,G)}T.push(_),I.push(X)}function f(A,k,T,I){let E=[],j=0,L=-1;for(;a.pos>k;){let{id:D,start:z,end:V,size:W}=a;if(W>4)a.next();else{if(L>-1&&z<L)break;L<0&&(L=V-o),E.push(D,z,V),j++,a.next()}}if(j){let D=new Uint16Array(j*4),z=E[E.length-2];for(let V=E.length-3,W=0;V>=0;V-=3)D[W++]=E[V],D[W++]=E[V+1]-z,D[W++]=E[V+2]-z,D[W++]=W;T.push(new hr(D,E[2]-z,r)),I.push(z-A)}}function m(A,k){return(T,I,E)=>{let j=0,L=T.length-1,D,z;if(L>=0&&(D=T[L])instanceof Ge){if(!L&&D.type==A&&D.length==E)return D;(z=D.prop(we.lookAhead))&&(j=I[L]+D.length+z)}return p(A,T,I,E,j,k)}}function b(A,k,T,I,E,j,L,D,z){let V=[],W=[];for(;A.length>I;)V.push(A.pop()),W.push(k.pop()+T-E);A.push(p(r.types[L],V,W,j-E,D-j,z)),k.push(E-T)}function p(A,k,T,I,E,j,L){if(j){let D=[we.contextHash,j];L=L?[D].concat(L):[D]}if(E>25){let D=[we.lookAhead,E];L=L?[D].concat(L):[D]}return new Ge(A,k,T,I,L)}function v(A,k){let T=a.fork(),I=0,E=0,j=0,L=T.end-o,D={size:0,start:0,skip:0};e:for(let z=T.pos-A;T.pos>z;){let V=T.size;if(T.id==k&&V>=0){D.size=I,D.start=E,D.skip=j,j+=4,I+=4,T.next();continue}let W=T.pos-V;if(V<0||W<z||T.start<L)break;let G=T.id>=s?4:0,P=T.start;for(T.next();T.pos>W;){if(T.size<0)if(T.size==-3)G+=4;else break e;else T.id>=s&&(G+=4);T.next()}E=P,I+=V,j+=G}return(k<0||I==A)&&(D.size=I,D.start=E,D.skip=j),D.size>4?D:void 0}function x(A,k,T){let{id:I,start:E,end:j,size:L}=a;if(a.next(),L>=0&&I<s){let D=T;if(L>4){let z=a.pos-(L-4);for(;a.pos>z;)T=x(A,k,T)}k[--T]=D,k[--T]=j-A,k[--T]=E-A,k[--T]=I}else L==-3?c=I:L==-4&&(d=I);return T}let y=[],$=[];for(;a.pos>0;)h(t.start||0,t.bufferStart||0,y,$,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:y.length?$[0]+y[0].length:0;return new Ge(l[t.topID],y.reverse(),$.reverse(),S)}const Q0=new WeakMap;function xa(t,e){if(!t.isAnonymous||e instanceof hr||e.type!=t)return 1;let n=Q0.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Ge)){n=1;break}n+=xa(t,r)}Q0.set(e,n)}return n}function pf(t,e,n,r,o,i,s,a,l){let c=0;for(let b=r;b<o;b++)c+=xa(t,e[b]);let d=Math.ceil(c*1.5/8),h=[],f=[];function m(b,p,v,x,y){for(let $=v;$<x;){let S=$,A=p[$],k=xa(t,b[$]);for($++;$<x;$++){let T=xa(t,b[$]);if(k+T>=d)break;k+=T}if($==S+1){if(k>d){let T=b[S];m(T.children,T.positions,0,T.children.length,p[S]+y);continue}h.push(b[S])}else{let T=p[$-1]+b[$-1].length-A;h.push(pf(t,b,p,S,$,A,T,null,l))}f.push(A+y-i)}}return m(e,n,r,o,0),(a||l)(h,f,s)}class Or{constructor(e,n,r,o,i=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=o,this.open=(i?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let o=[new Or(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&o.push(i);return o}static applyChanges(e,n,r=128){if(!n.length)return e;let o=[],i=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let d=a<n.length?n[a]:null,h=d?d.fromA:1e9;if(h-l>=r)for(;s&&s.from<h;){let f=s;if(l>=f.from||h<=f.to||c){let m=Math.max(f.from,l)-c,b=Math.min(f.to,h)-c;f=m>=b?null:new Or(m,b,f.tree,f.offset+c,a>0,!!d)}if(f&&o.push(f),s.to>h)break;s=i<e.length?e[i++]:null}if(!d)break;l=d.toA,c=d.toA-d.toB}return o}}class yb{startParse(e,n,r){return typeof e=="string"&&(e=new lR(e)),r=r?r.length?r.map(o=>new _c(o.from,o.to)):[new _c(0,0)]:[new _c(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let o=this.startParse(e,n,r);for(;;){let i=o.advance();if(i)return i}}}class lR{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new we({perNode:!0});class Wa{constructor(e,n,r,o,i,s,a,l,c,d=0,h){this.p=e,this.stack=n,this.state=r,this.reducePos=o,this.pos=i,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=d,this.parent=h}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let o=e.parser.context;return new Wa(e,[],n,r,r,0,[],0,o?new Z0(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,o=e&65535,{parser:i}=this.p,s=this.reducePos<this.pos-25;s&&this.setLookAhead(this.pos);let a=i.dynamicPrecedence(o);if(a&&(this.score+=a),r==0){this.pushState(i.getGoto(this.state,o,!0),this.reducePos),o<i.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(o,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,d=this.reducePos-c;d>=2e3&&!(!((n=this.p.parser.nodeSet.types[o])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=d));let h=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-h;if(o<i.minRepeatTerm||e&131072){let m=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,c,m,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let m=this.stack[l-3];this.state=i.getGoto(m,o,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(o,c)}storeNode(e,n,r,o=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,o);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,o>4&&(o-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=o}}shift(e,n,r,o){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=o,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,o,4);else{let i=e,{parser:s}=this.p;(o>this.pos||n<=s.maxNode)&&(this.pos=o,s.stateFlag(i,1)||(this.reducePos=o)),this.pushState(i,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,o,4)}}apply(e,n,r,o){e&65536?this.reduce(e):this.shift(e,n,r,o)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(n,o),this.buffer.push(r,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),o=e.bufferBase+n;for(;e&&o==e.bufferBase;)e=e.parent;return new Wa(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new cR(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let o=[];for(let i=0,s;i<n.length;i+=2)(s=n[i+1])!=this.state&&this.p.parser.hasAction(s,e)&&o.push(n[i],s);if(this.stack.length<120)for(let i=0;o.length<8&&i<n.length;i+=2){let s=n[i+1];o.some((a,l)=>l&1&&a==s)||o.push(n[i],s)}n=o}let r=[];for(let o=0;o<n.length&&r.length<4;o+=2){let i=n[o+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[o],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,o=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],o,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(o,i)=>{if(!n.includes(o))return n.push(o),e.allActions(o,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-i;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,i+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new Z0(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Z0{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class cR{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=o}}class qa{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new qa(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new qa(this.stack,this.pos,this.index)}}function qs(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,o=0;r<t.length;){let i=0;for(;;){let s=t.charCodeAt(r++),a=!1;if(s==126){i=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),i+=l,a)break;i*=46}n?n[o++]=i:n=new e(i)}return n}class wa{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const J0=new wa;class dR{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=J0,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,o=this.rangeIndex,i=this.pos+e;for(;i<r.from;){if(!o)return null;let s=this.ranges[--o];i-=r.from-s.to,r=s}for(;n<0?i>r.to:i>=r.to;){if(o==this.ranges.length-1)return null;let s=this.ranges[++o];i+=s.from-r.to,r=s}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,o;if(n>=0&&n<this.chunk.length)r=this.pos+e,o=this.chunk.charCodeAt(n);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(r=i,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),o=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),o}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=J0,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let o of this.ranges){if(o.from>=n)break;o.to>e&&(r+=this.input.read(Math.max(o.from,e),Math.min(o.to,n)))}return r}}class So{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;uR(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}So.prototype.contextual=So.prototype.fallback=So.prototype.extend=!1;So.prototype.fallback=So.prototype.extend=!1;function uR(t,e,n,r,o,i){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&t[s];){let c=t[s+1];for(let m=s+3;m<c;m+=2)if((t[m+1]&a)>0){let b=t[m];if(l.allows(b)&&(e.token.value==-1||e.token.value==b||hR(b,e.token.value,o,i))){e.acceptToken(b);break}}let d=e.next,h=0,f=t[s+2];if(e.next<0&&f>h&&t[c+f*3-3]==65535){s=t[c+f*3-1];continue e}for(;h<f;){let m=h+f>>1,b=c+m+(m<<1),p=t[b],v=t[b+1]||65536;if(d<p)f=m;else if(d>=v)h=m+1;else{s=t[b+2],e.advance();continue e}}break}}function e1(t,e,n){for(let r=e,o;(o=t[r])!=65535;r++)if(o==n)return r-e;return-1}function hR(t,e,n,r){let o=e1(n,r,e);return o<0||e1(n,r,t)<o}const Mt=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let zc=null;function t1(t,e,n){let r=t.cursor(Ze.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class fR{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?t1(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?t1(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],o=this.index[n];if(o==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=r.children[o],s=this.start[n]+r.positions[o];if(s>e)return this.nextStart=s,null;if(i instanceof Ge){if(s==e){if(s<this.safeFrom)return null;let a=s+i.length;if(a<=this.safeTo){let l=i.prop(we.lookAhead);if(!l||a+l<this.fragment.to)return i}}this.index[n]++,s+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+i.length}}}class mR{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new wa)}getActions(e){let n=0,r=null,{parser:o}=e.p,{tokenizers:i}=o,s=o.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<i.length;c++){if(!(1<<c&s))continue;let d=i[c],h=this.tokens[c];if(!(r&&!d.fallback)&&((d.contextual||h.start!=e.pos||h.mask!=s||h.context!=a)&&(this.updateCachedToken(h,d,e),h.mask=s,h.context=a),h.lookAhead>h.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let f=n;if(h.extended>-1&&(n=this.addActions(e,h.extended,h.end,n)),n=this.addActions(e,h.value,h.end,n),!d.extend&&(r=h,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new wa,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new wa,{pos:r,p:o}=e;return n.start=r,n.end=Math.min(r+1,o.stream.end),n.value=r==o.stream.end?o.parser.eofTerm:0,n}updateCachedToken(e,n,r){let o=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(o,e),r),e.value>-1){let{parser:i}=r.p;for(let s=0;s<i.specialized.length;s++)if(i.specialized[s]==e.value){let a=i.specializers[s](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,n,r,o){for(let i=0;i<o;i+=3)if(this.actions[i]==e)return o;return this.actions[o++]=e,this.actions[o++]=n,this.actions[o++]=r,o}addActions(e,n,r,o){let{state:i}=e,{parser:s}=e.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(i,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Ln(a,c+2);else{o==0&&a[c+1]==2&&(o=this.putAction(Ln(a,c+2),n,r,o));break}a[c]==n&&(o=this.putAction(Ln(a,c+1),n,r,o))}return o}}class gR{constructor(e,n,r,o){this.parser=e,this.input=n,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new dR(n,o),this.tokens=new mR(e,this.stream),this.topTerm=e.top[1];let{from:i}=o[0];this.stacks=[Wa.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new fR(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],o,i;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let a=e[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,e))continue;{o||(o=[],i=[]),o.push(a);let l=this.tokens.getMainToken(a);i.push(l.value,l.end)}}break}}if(!r.length){let s=o&&bR(o);if(s)return Mt&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Mt&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&o){let s=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,i,r);if(s)return Mt&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let o=e.pos,{parser:i}=this,s=Mt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,d=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(o);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?i.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!c||(h.prop(we.contextHash)||0)==d))return e.useNode(h,f),Mt&&console.log(s+this.stackID(e)+` (via reuse of ${i.getName(h.type.id)})`),!0;if(!(h instanceof Ge)||h.children.length==0||h.positions[0]>0)break;let m=h.children[0];if(m instanceof Ge&&h.positions[0]==0)h=m;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),Mt&&console.log(s+this.stackID(e)+` (via always-reduce ${i.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let d=l[c++],h=l[c++],f=l[c++],m=c==l.length||!r,b=m?e:e.split(),p=this.tokens.mainToken;if(b.apply(d,h,p?p.start:b.pos,f),Mt&&console.log(s+this.stackID(b)+` (via ${d&65536?`reduce of ${i.getName(d&65535)}`:"shift"} for ${i.getName(h)} @ ${o}${b==e?"":", split"})`),m)return!0;b.pos>o?n.push(b):r.push(b)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return n1(e,n),!0}}runRecovery(e,n,r){let o=null,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=n[s<<1],c=n[(s<<1)+1],d=Mt?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),Mt&&console.log(d+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),f=d;for(let m=0;h.forceReduce()&&m<10&&(Mt&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));m++)Mt&&(f=this.stackID(h)+" -> ");for(let m of a.recoverByInsert(l))Mt&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Mt&&console.log(d+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),n1(a,r)):(!o||o.score<a.score)&&(o=a)}return o}stackToTree(e){return e.close(),Ge.build({buffer:qa.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(zc||(zc=new WeakMap)).get(e);return n||zc.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function n1(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class pR{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class Ua extends yb{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<e.repeatNodeCount;a++)n.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),o=[];for(let a=0;a<n.length;a++)o.push([]);function i(a,l,c){o[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=we[l]);for(let c=1;c<a.length;){let d=a[c++];if(d>=0)i(d,l,a[c++]);else{let h=a[c+-d];for(let f=-d;f>0;f--)i(a[c++],l,h);c++}}}this.nodeSet=new ff(n.map((a,l)=>St.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:o[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=bb;let s=qs(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(r1),this.states=qs(e.states,Uint32Array),this.data=qs(e.stateData),this.goto=qs(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new So(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let o=new gR(this,e,n,r);for(let i of this.wrappers)o=i(o,e,n,r);return o}getGoto(e,n,r=!1){let o=this.goto;if(n>=o[0])return-1;for(let i=o[n+1];;){let s=o[i++],a=s&1,l=o[i++];if(a&&r)return l;for(let c=i+(s>>1);i<c;i++)if(o[i]==e)return l;if(a)return-1}}hasAction(e,n){let r=this.data;for(let o=0;o<2;o++)for(let i=this.stateSlot(e,o?2:1),s;;i+=3){if((s=r[i])==65535)if(r[i+1]==1)s=r[i=Ln(r,i+2)];else{if(r[i+1]==2)return Ln(r,i+2);break}if(s==n||s==0)return Ln(r,i+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),o=r?n(r):void 0;for(let i=this.stateSlot(e,1);o==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ln(this.data,i+2);else break;o=n(Ln(this.data,i+1))}return o}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ln(this.data,r+2);else break;if(!(this.data[r+2]&1)){let o=this.data[r+1];n.some((i,s)=>s&1&&i==o)||n.push(this.data[r],o)}}return n}configure(e){let n=Object.assign(Object.create(Ua.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let o=e.tokenizers.find(i=>i.from==r);return o?o.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,o)=>{let i=e.specializers.find(a=>a.from==r.external);if(!i)return r;let s=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[o]=r1(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let s=n.indexOf(i);s>=0&&(r[s]=!0)}let o=null;for(let i=0;i<n.length;i++)if(!r[i])for(let s=this.dialects[n[i]],a;(a=this.data[s++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[a]=1;return new pR(e,r,o)}static deserialize(e){return new Ua(e)}}function Ln(t,e){return t[e]|t[e+1]<<16}function bR(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function r1(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}let vR=0,Nn=class Qd{constructor(e,n,r,o){this.name=e,this.set=n,this.base=r,this.modified=o,this.id=vR++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Qd&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let o=new Qd(r,[],null,[]);if(o.set.push(o),n)for(let i of n.set)o.set.push(i);return o}static defineModifier(e){let n=new Ka(e);return r=>r.modified.indexOf(n)>-1?r:Ka.get(r.base||r,r.modified.concat(n).sort((o,i)=>o.id-i.id))}},xR=0;class Ka{constructor(e){this.name=e,this.instances=[],this.id=xR++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&wR(n,a.modified));if(r)return r;let o=[],i=new Nn(e.name,o,e,n);for(let a of n)a.instances.push(i);let s=yR(n);for(let a of e.set)if(!a.modified.length)for(let l of s)o.push(Ka.get(a,l));return i}}function wR(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function yR(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,o=e.length;r<o;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Cb(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let o of n.split(" "))if(o){let i=[],s=2,a=o;for(let h=0;;){if(a=="..."&&h>0&&h+3==o.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+o);if(i.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==o.length)break;let m=o[h++];if(h==o.length&&m=="!"){s=0;break}if(m!="/")throw new RangeError("Invalid path: "+o);a=o.slice(h)}let l=i.length-1,c=i[l];if(!c)throw new RangeError("Invalid path: "+o);let d=new Ga(r,s,l>0?i.slice(0,l):null);e[c]=d.sort(e[c])}}return $b.add(e)}const $b=new we;class Ga{constructor(e,n,r,o){this.tags=e,this.mode=n,this.context=r,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ga.empty=new Ga([],2,null);function Sb(t,e){let n=Object.create(null);for(let i of t)if(!Array.isArray(i.tag))n[i.tag.id]=i.class;else for(let s of i.tag)n[s.id]=i.class;let{scope:r,all:o=null}=e||{};return{style:i=>{let s=o;for(let a of i)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function CR(t,e){let n=null;for(let r of t){let o=r.style(e);o&&(n=n?n+" "+o:o)}return n}function $R(t,e,n,r=0,o=t.length){let i=new SR(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,o,"",i.highlighters),i.flush(o)}class SR{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,o,i){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(i=this.highlighters.filter(m=>!m.scope||m.scope(s)));let c=o,d=AR(e)||Ga.empty,h=CR(i,d.tags);if(h&&(c&&(c+=" "),c+=h,d.mode==1&&(o+=(o?" ":"")+h)),this.startSpan(Math.max(n,a),c),d.opaque)return;let f=e.tree&&e.tree.prop(we.mounted);if(f&&f.overlay){let m=e.node.enter(f.overlay[0].from+a,1),b=this.highlighters.filter(v=>!v.scope||v.scope(f.tree.type)),p=e.firstChild();for(let v=0,x=a;;v++){let y=v<f.overlay.length?f.overlay[v]:null,$=y?y.from+a:l,S=Math.max(n,x),A=Math.min(r,$);if(S<A&&p)for(;e.from<A&&(this.highlightRange(e,S,A,o,i),this.startSpan(Math.min(A,e.to),c),!(e.to>=$||!e.nextSibling())););if(!y||$>r)break;x=y.to+a,x>n&&(this.highlightRange(m.cursor(),Math.max(n,y.from+a),Math.min(r,x),"",b),this.startSpan(Math.min(r,x),c))}p&&e.parent()}else if(e.firstChild()){f&&(o="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,o,i),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function AR(t){let e=t.type.prop($b);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Y=Nn.define,Us=Y(),er=Y(),o1=Y(er),i1=Y(er),tr=Y(),Ks=Y(tr),Hc=Y(tr),cn=Y(),kr=Y(cn),sn=Y(),an=Y(),Zd=Y(),ui=Y(Zd),Gs=Y(),N={comment:Us,lineComment:Y(Us),blockComment:Y(Us),docComment:Y(Us),name:er,variableName:Y(er),typeName:o1,tagName:Y(o1),propertyName:i1,attributeName:Y(i1),className:Y(er),labelName:Y(er),namespace:Y(er),macroName:Y(er),literal:tr,string:Ks,docString:Y(Ks),character:Y(Ks),attributeValue:Y(Ks),number:Hc,integer:Y(Hc),float:Y(Hc),bool:Y(tr),regexp:Y(tr),escape:Y(tr),color:Y(tr),url:Y(tr),keyword:sn,self:Y(sn),null:Y(sn),atom:Y(sn),unit:Y(sn),modifier:Y(sn),operatorKeyword:Y(sn),controlKeyword:Y(sn),definitionKeyword:Y(sn),moduleKeyword:Y(sn),operator:an,derefOperator:Y(an),arithmeticOperator:Y(an),logicOperator:Y(an),bitwiseOperator:Y(an),compareOperator:Y(an),updateOperator:Y(an),definitionOperator:Y(an),typeOperator:Y(an),controlOperator:Y(an),punctuation:Zd,separator:Y(Zd),bracket:ui,angleBracket:Y(ui),squareBracket:Y(ui),paren:Y(ui),brace:Y(ui),content:cn,heading:kr,heading1:Y(kr),heading2:Y(kr),heading3:Y(kr),heading4:Y(kr),heading5:Y(kr),heading6:Y(kr),contentSeparator:Y(cn),list:Y(cn),quote:Y(cn),emphasis:Y(cn),strong:Y(cn),link:Y(cn),monospace:Y(cn),strikethrough:Y(cn),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Gs,documentMeta:Y(Gs),annotation:Y(Gs),processingInstruction:Y(Gs),definition:Nn.defineModifier("definition"),constant:Nn.defineModifier("constant"),function:Nn.defineModifier("function"),standard:Nn.defineModifier("standard"),local:Nn.defineModifier("local"),special:Nn.defineModifier("special")};for(let t in N){let e=N[t];e instanceof Nn&&(e.name=t)}Sb([{tag:N.link,class:"tok-link"},{tag:N.heading,class:"tok-heading"},{tag:N.emphasis,class:"tok-emphasis"},{tag:N.strong,class:"tok-strong"},{tag:N.keyword,class:"tok-keyword"},{tag:N.atom,class:"tok-atom"},{tag:N.bool,class:"tok-bool"},{tag:N.url,class:"tok-url"},{tag:N.labelName,class:"tok-labelName"},{tag:N.inserted,class:"tok-inserted"},{tag:N.deleted,class:"tok-deleted"},{tag:N.literal,class:"tok-literal"},{tag:N.string,class:"tok-string"},{tag:N.number,class:"tok-number"},{tag:[N.regexp,N.escape,N.special(N.string)],class:"tok-string2"},{tag:N.variableName,class:"tok-variableName"},{tag:N.local(N.variableName),class:"tok-variableName tok-local"},{tag:N.definition(N.variableName),class:"tok-variableName tok-definition"},{tag:N.special(N.variableName),class:"tok-variableName2"},{tag:N.definition(N.propertyName),class:"tok-propertyName tok-definition"},{tag:N.typeName,class:"tok-typeName"},{tag:N.namespace,class:"tok-namespace"},{tag:N.className,class:"tok-className"},{tag:N.macroName,class:"tok-macroName"},{tag:N.propertyName,class:"tok-propertyName"},{tag:N.operator,class:"tok-operator"},{tag:N.comment,class:"tok-comment"},{tag:N.meta,class:"tok-meta"},{tag:N.invalid,class:"tok-invalid"},{tag:N.punctuation,class:"tok-punctuation"}]);const kR=Cb({String:N.string,Number:N.number,"True False":N.bool,PropertyName:N.propertyName,Null:N.null,", :":N.separator,"[ ]":N.squareBracket,"{ }":N.brace}),TR=Ua.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[kR],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Jd=[],Ab=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?Ab:Jd).push(n=n+t[e])})();function RR(t){if(t<768)return!1;for(let e=0,n=Jd.length;;){let r=e+n>>1;if(t<Jd[r])n=r;else if(t>=Ab[r])e=r+1;else return!0;if(e==n)return!1}}function s1(t){return t>=127462&&t<=127487}const a1=8205;function MR(t,e,n=!0,r=!0){return(n?kb:ER)(t,e,r)}function kb(t,e,n){if(e==t.length)return e;e&&Tb(t.charCodeAt(e))&&Rb(t.charCodeAt(e-1))&&e--;let r=Pc(t,e);for(e+=l1(r);e<t.length;){let o=Pc(t,e);if(r==a1||o==a1||n&&RR(o))e+=l1(o),r=o;else if(s1(o)){let i=0,s=e-2;for(;s>=0&&s1(Pc(t,s));)i++,s-=2;if(i%2==0)break;e+=2}else break}return e}function ER(t,e,n){for(;e>0;){let r=kb(t,e-2,n);if(r<e)return r;e--}return 0}function Pc(t,e){let n=t.charCodeAt(e);if(!Rb(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Tb(r)?(n-55296<<10)+(r-56320)+65536:n}function Tb(t){return t>=56320&&t<57344}function Rb(t){return t>=55296&&t<56320}function l1(t){return t<65536?1:2}class ke{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Vo(this,e,n);let o=[];return this.decompose(0,e,o,2),r.length&&r.decompose(0,r.length,o,3),this.decompose(n,this.length,o,1),dn.from(o,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Vo(this,e,n);let r=[];return this.decompose(e,n,r,0),dn.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),o=new Ri(this),i=new Ri(e);for(let s=n,a=n;;){if(o.next(s),i.next(s),s=0,o.lineBreak!=i.lineBreak||o.done!=i.done||o.value!=i.value)return!1;if(a+=o.value.length,o.done||a>=r)return!0}}iter(e=1){return new Ri(this,e)}iterRange(e,n=this.length){return new Mb(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let o=this.line(e).from;r=this.iterRange(o,Math.max(o,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Eb(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ke.empty:e.length<=32?new He(e):dn.from(He.split(e,[]))}}class He extends ke{constructor(e,n=IR(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,o){for(let i=0;;i++){let s=this.text[i],a=o+s.length;if((n?r:a)>=e)return new jR(o,a,r,s);o=a+1,r++}}decompose(e,n,r,o){let i=e<=0&&n>=this.length?this:new He(c1(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(o&1){let s=r.pop(),a=ya(i.text,s.text.slice(),0,i.length);if(a.length<=32)r.push(new He(a,s.length+i.length));else{let l=a.length>>1;r.push(new He(a.slice(0,l)),new He(a.slice(l)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof He))return super.replace(e,n,r);[e,n]=Vo(this,e,n);let o=ya(this.text,ya(r.text,c1(this.text,0,e)),n),i=this.length+r.length-(n-e);return o.length<=32?new He(o,i):dn.from(He.split(o,[]),i)}sliceString(e,n=this.length,r=`
|
|
53
|
+
`)},ZT=0,uo=[];function JT(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(ZT++)[0],i=w.useState(Il)[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=vh([t.lockRef.current],(t.shards||[]).map(G0),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(b,v){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Ps(b),y=n.current,$="deltaX"in b?b.deltaX:y[0]-x[0],S="deltaY"in b?b.deltaY:y[1]-x[1],A,k=b.target,T=Math.abs($)>Math.abs(S)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var I=U0(T,k);if(!I)return!0;if(I?A=T:(A=T==="v"?"h":"v",I=U0(T,k)),!I)return!1;if(!r.current&&"changedTouches"in b&&($||S)&&(r.current=A),!A)return!0;var E=r.current||A;return YT(E,v,b,E==="h"?$:S)},[]),l=w.useCallback(function(b){var v=b;if(!(!uo.length||uo[uo.length-1]!==i)){var x="deltaY"in v?K0(v):Ps(v),y=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&XT(A.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(G0).filter(Boolean).filter(function(A){return A.contains(v.target)}),S=$.length>0?a(v,$[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(b,v,x,y){var $={name:b,delta:v,target:x,should:y,shadowParent:eR(x)};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(S){return S!==$})},1)},[]),d=w.useCallback(function(b){n.current=Ps(b),r.current=void 0},[]),h=w.useCallback(function(b){c(b.type,K0(b),b.target,a(b,t.lockRef.current))},[]),f=w.useCallback(function(b){c(b.type,Ps(b),b.target,a(b,t.lockRef.current))},[]);w.useEffect(function(){return uo.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,co),document.addEventListener("touchmove",l,co),document.addEventListener("touchstart",d,co),function(){uo=uo.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,co),document.removeEventListener("touchmove",l,co),document.removeEventListener("touchstart",d,co)}},[]);var m=t.removeScrollBar,p=t.inert;return w.createElement(w.Fragment,null,p?w.createElement(i,{styles:QT(o)}):null,m?w.createElement(Ch,{gapMode:t.gapMode}):null)}function eR(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const tR=yh(hb,JT);var pb=w.forwardRef(function(t,e){return w.createElement(ql,_e({},t,{ref:e,sideCar:tR}))});pb.classNames=ql.classNames;const bb=1024;let nR=0,_c=class{constructor(e,n){this.from=e,this.to=n}};class we{constructor(e={}){this.id=nR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=St.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}we.closedBy=new we({deserialize:t=>t.split(" ")});we.openedBy=new we({deserialize:t=>t.split(" ")});we.group=new we({deserialize:t=>t.split(" ")});we.isolate=new we({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});we.contextHash=new we({perNode:!0});we.lookAhead=new we({perNode:!0});we.mounted=new we({perNode:!0});class Pa{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[we.mounted.id]}}const rR=Object.create(null);class St{constructor(e,n,r,o=0){this.name=e,this.props=n,this.id=r,this.flags=o}static define(e){let n=e.props&&e.props.length?Object.create(null):rR,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new St(e.name||"",n,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(o)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return o}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(we.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let o of r.split(" "))n[o]=e[r];return r=>{for(let o=r.prop(we.group),i=-1;i<(o?o.length:0);i++){let s=n[i<0?r.name:o[i]];if(s)return s}}}}St.none=new St("",Object.create(null),0,8);class ff{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let o=null;for(let i of e){let s=i(r);s&&(o||(o=Object.assign({},r.props)),o[s[0].id]=s[1])}n.push(o?new St(r.name,o,r.id,r.flags):r)}return new ff(n)}}const Ws=new WeakMap,Y0=new WeakMap;var Ze;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Ze||(Ze={}));class Ge{constructor(e,n,r,o,i){if(this.type=e,this.children=n,this.positions=r,this.length=o,this.props=null,i&&i.length){this.props=Object.create(null);for(let[s,a]of i)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=Pa.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let o=r.toString();o&&(n&&(n+=","),n+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Xd(this.topNode,e)}cursorAt(e,n=0,r=0){let o=Ws.get(this)||this.topNode,i=new Xd(o);return i.moveTo(e,n),Ws.set(this,i._tree),i}get topNode(){return new Ft(this,0,0,null)}resolve(e,n=0){let r=_i(Ws.get(this)||this.topNode,e,n,!1);return Ws.set(this,r),r}resolveInner(e,n=0){let r=_i(Y0.get(this)||this.topNode,e,n,!0);return Y0.set(this,r),r}resolveStack(e,n=0){return sR(this,e,n)}iterate(e){let{enter:n,leave:r,from:o=0,to:i=this.length}=e,s=e.mode||0,a=(s&Ze.IncludeAnonymous)>0;for(let l=this.cursor(s|Ze.IncludeAnonymous);;){let c=!1;if(l.from<=i&&l.to>=o&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:pf(St.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,o)=>new Ge(this.type,n,r,o,this.propValues),e.makeTree||((n,r,o)=>new Ge(St.none,n,r,o)))}static build(e){return aR(e)}}Ge.empty=new Ge(St.none,[],[],0);class mf{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new mf(this.buffer,this.index)}}class hr{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return St.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],o=this.set.types[n],i=o.name;if(/\W/.test(i)&&!o.isError&&(i=JSON.stringify(i)),e+=4,r==e)return i;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return i+"("+s.join(",")+")"}findChild(e,n,r,o,i){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(vb(i,o,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(e,n,r){let o=this.buffer,i=new Uint16Array(n-e),s=0;for(let a=e,l=0;a<n;){i[l++]=o[a++],i[l++]=o[a++]-r;let c=i[l++]=o[a++]-r;i[l++]=o[a++]-e,s=Math.max(s,c)}return new hr(i,s,this.set)}}function vb(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function _i(t,e,n,r){for(var o;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Ft&&t.index<0?null:t.parent;if(!s)return t;t=s}let i=r?0:Ze.IgnoreOverlays;if(r)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Ft&&s.index<0&&((o=a.enter(e,n,i))===null||o===void 0?void 0:o.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,i);if(!s)return t;t=s}}class xb{cursor(e=0){return new Xd(this,e)}getChild(e,n=null,r=null){let o=X0(this,e,n,r);return o.length?o[0]:null}getChildren(e,n=null,r=null){return X0(this,e,n,r)}resolve(e,n=0){return _i(this,e,n,!1)}resolveInner(e,n=0){return _i(this,e,n,!0)}matchContext(e){return Yd(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let o=n.lastChild;if(!o||o.to!=n.to)break;o.type.isError&&o.from==o.to?(r=n,n=o.prevSibling):n=o}return r}get node(){return this}get next(){return this.parent}}class Ft extends xb{constructor(e,n,r,o){super(),this._tree=e,this.from=n,this.index=r,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,o,i=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let d=a[e],h=l[e]+s.from;if(vb(o,r,h,h+d.length)){if(d instanceof hr){if(i&Ze.ExcludeBuffers)continue;let f=d.findChild(0,d.buffer.length,n,r-h,o);if(f>-1)return new rr(new oR(s,d,e,h),null,f)}else if(i&Ze.IncludeAnonymous||!d.type.isAnonymous||gf(d)){let f;if(!(i&Ze.IgnoreMounts)&&(f=Pa.get(d))&&!f.overlay)return new Ft(f.tree,h,e,s);let m=new Ft(d,h,e,s);return i&Ze.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?d.children.length-1:0,n,r,o)}}}if(i&Ze.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let o;if(!(r&Ze.IgnoreOverlays)&&(o=Pa.get(this._tree))&&o.overlay){let i=e-this.from;for(let{from:s,to:a}of o.overlay)if((n>0?s<=i:s<i)&&(n<0?a>=i:a>i))return new Ft(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function X0(t,e,n,r){let o=t.cursor(),i=[];if(!o.firstChild())return i;if(n!=null){for(let s=!1;!s;)if(s=o.type.is(n),!o.nextSibling())return i}for(;;){if(r!=null&&o.type.is(r))return i;if(o.type.is(e)&&i.push(o.node),!o.nextSibling())return r==null?i:[]}}function Yd(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class oR{constructor(e,n,r,o){this.parent=e,this.buffer=n,this.index=r,this.start=o}}class rr extends xb{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:o}=this.context,i=o.findChild(this.index+4,o.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new rr(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Ze.ExcludeBuffers)return null;let{buffer:o}=this.context,i=o.findChild(this.index+4,o.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new rr(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new rr(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new rr(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,o=this.index+4,i=r.buffer[this.index+3];if(i>o){let s=r.buffer[this.index+1];e.push(r.slice(o,i,s)),n.push(0)}return new Ge(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function wb(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;i<t.length;i++){let s=t[i];(s.from>n.from||s.to<n.to)&&(n=s,e=i)}let r=n instanceof Ft&&n.index<0?null:n.parent,o=t.slice();return r?o[e]=r:o.splice(e,1),new iR(o,n)}class iR{constructor(e,n){this.heads=e,this.node=n}get next(){return wb(this.heads)}}function sR(t,e,n){let r=t.resolveInner(e,n),o=null;for(let i=r instanceof Ft?r:r.context.parent;i;i=i.parent)if(i.index<0){let s=i.parent;(o||(o=[r])).push(s.resolve(e,n)),i=s}else{let s=Pa.get(i.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Ft(s.tree,s.overlay[0].from+i.from,-1,i);(o||(o=[r])).push(_i(a,e,n,!1))}}return o?wb(o):r}class Xd{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ft)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:o}=this.buffer;return this.type=n||o.set.types[o.buffer[e]],this.from=r+o.buffer[e+1],this.to=r+o.buffer[e+2],!0}yield(e){return e?e instanceof Ft?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:o}=this.buffer,i=o.findChild(this.index+4,o.buffer[this.index+3],e,n-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Ze.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ze.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ze.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let o=r<0?0:this.stack[r]+4;if(this.index!=o)return this.yieldBuf(n.findChild(o,this.index,-1,0,4))}else{let o=n.buffer[this.index+3];if(o<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(o)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:o}=this;if(o){if(e>0){if(this.index<o.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(o.buffer.buffer[i+3]<this.index)return!1;({index:n,parent:r}=o)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let i=n+e,s=e<0?-1:r._tree.children.length;i!=s;i+=e){let a=r._tree.children[i];if(this.mode&Ze.IncludeAnonymous||a instanceof hr||!a.type.isAnonymous||gf(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let o=this.index,i=this.stack.length;i>=0;){for(let s=e;s;s=s._parent)if(s.index==o){if(o==this.index)return s;n=s,r=i+1;break e}o=this.stack[--i]}for(let o=r;o<this.stack.length;o++)n=new rr(this.buffer,n,this.stack[o]);return this.bufferNode=new rr(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let o=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&n&&n(this),o=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,o=!0}}}matchContext(e){if(!this.buffer)return Yd(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let o=e.length-1,i=this.stack.length-1;o>=0;i--){if(i<0)return Yd(this._tree,e,o);let s=r[n.buffer[this.stack[i]]];if(!s.isAnonymous){if(e[o]&&e[o]!=s.name)return!1;o--}}return!0}}function gf(t){return t.children.some(e=>e instanceof hr||!e.type.isAnonymous||gf(e))}function aR(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:o=bb,reused:i=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new mf(n,n.length):n,l=r.types,c=0,d=0;function h(A,k,T,I,E,j){let{id:L,start:D,end:z,size:V}=a,W=d,G=c;for(;V<0;)if(a.next(),V==-1){let J=i[L];T.push(J),I.push(D-A);return}else if(V==-3){c=L;return}else if(V==-4){d=L;return}else throw new RangeError(`Unrecognized record size: ${V}`);let P=l[L],_,O,X=D-A;if(z-D<=o&&(O=v(a.pos-k,E))){let J=new Uint16Array(O.size-O.skip),fe=a.pos-O.size,se=J.length;for(;a.pos>fe;)se=x(O.start,J,se);_=new hr(J,z-O.start,r),X=O.start-A}else{let J=a.pos-V;a.next();let fe=[],se=[],pe=L>=s?L:-1,be=0,Se=z;for(;a.pos>J;)pe>=0&&a.id==pe&&a.size>=0?(a.end<=Se-o&&(p(fe,se,D,be,a.end,Se,pe,W,G),be=fe.length,Se=a.end),a.next()):j>2500?f(D,J,fe,se):h(D,J,fe,se,pe,j+1);if(pe>=0&&be>0&&be<fe.length&&p(fe,se,D,be,D,Se,pe,W,G),fe.reverse(),se.reverse(),pe>-1&&be>0){let re=m(P,G);_=pf(P,fe,se,0,fe.length,0,z-D,re,re)}else _=b(P,fe,se,z-D,W-z,G)}T.push(_),I.push(X)}function f(A,k,T,I){let E=[],j=0,L=-1;for(;a.pos>k;){let{id:D,start:z,end:V,size:W}=a;if(W>4)a.next();else{if(L>-1&&z<L)break;L<0&&(L=V-o),E.push(D,z,V),j++,a.next()}}if(j){let D=new Uint16Array(j*4),z=E[E.length-2];for(let V=E.length-3,W=0;V>=0;V-=3)D[W++]=E[V],D[W++]=E[V+1]-z,D[W++]=E[V+2]-z,D[W++]=W;T.push(new hr(D,E[2]-z,r)),I.push(z-A)}}function m(A,k){return(T,I,E)=>{let j=0,L=T.length-1,D,z;if(L>=0&&(D=T[L])instanceof Ge){if(!L&&D.type==A&&D.length==E)return D;(z=D.prop(we.lookAhead))&&(j=I[L]+D.length+z)}return b(A,T,I,E,j,k)}}function p(A,k,T,I,E,j,L,D,z){let V=[],W=[];for(;A.length>I;)V.push(A.pop()),W.push(k.pop()+T-E);A.push(b(r.types[L],V,W,j-E,D-j,z)),k.push(E-T)}function b(A,k,T,I,E,j,L){if(j){let D=[we.contextHash,j];L=L?[D].concat(L):[D]}if(E>25){let D=[we.lookAhead,E];L=L?[D].concat(L):[D]}return new Ge(A,k,T,I,L)}function v(A,k){let T=a.fork(),I=0,E=0,j=0,L=T.end-o,D={size:0,start:0,skip:0};e:for(let z=T.pos-A;T.pos>z;){let V=T.size;if(T.id==k&&V>=0){D.size=I,D.start=E,D.skip=j,j+=4,I+=4,T.next();continue}let W=T.pos-V;if(V<0||W<z||T.start<L)break;let G=T.id>=s?4:0,P=T.start;for(T.next();T.pos>W;){if(T.size<0)if(T.size==-3)G+=4;else break e;else T.id>=s&&(G+=4);T.next()}E=P,I+=V,j+=G}return(k<0||I==A)&&(D.size=I,D.start=E,D.skip=j),D.size>4?D:void 0}function x(A,k,T){let{id:I,start:E,end:j,size:L}=a;if(a.next(),L>=0&&I<s){let D=T;if(L>4){let z=a.pos-(L-4);for(;a.pos>z;)T=x(A,k,T)}k[--T]=D,k[--T]=j-A,k[--T]=E-A,k[--T]=I}else L==-3?c=I:L==-4&&(d=I);return T}let y=[],$=[];for(;a.pos>0;)h(t.start||0,t.bufferStart||0,y,$,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:y.length?$[0]+y[0].length:0;return new Ge(l[t.topID],y.reverse(),$.reverse(),S)}const Q0=new WeakMap;function xa(t,e){if(!t.isAnonymous||e instanceof hr||e.type!=t)return 1;let n=Q0.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Ge)){n=1;break}n+=xa(t,r)}Q0.set(e,n)}return n}function pf(t,e,n,r,o,i,s,a,l){let c=0;for(let p=r;p<o;p++)c+=xa(t,e[p]);let d=Math.ceil(c*1.5/8),h=[],f=[];function m(p,b,v,x,y){for(let $=v;$<x;){let S=$,A=b[$],k=xa(t,p[$]);for($++;$<x;$++){let T=xa(t,p[$]);if(k+T>=d)break;k+=T}if($==S+1){if(k>d){let T=p[S];m(T.children,T.positions,0,T.children.length,b[S]+y);continue}h.push(p[S])}else{let T=b[$-1]+p[$-1].length-A;h.push(pf(t,p,b,S,$,A,T,null,l))}f.push(A+y-i)}}return m(e,n,r,o,0),(a||l)(h,f,s)}class Or{constructor(e,n,r,o,i=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=o,this.open=(i?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let o=[new Or(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&o.push(i);return o}static applyChanges(e,n,r=128){if(!n.length)return e;let o=[],i=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let d=a<n.length?n[a]:null,h=d?d.fromA:1e9;if(h-l>=r)for(;s&&s.from<h;){let f=s;if(l>=f.from||h<=f.to||c){let m=Math.max(f.from,l)-c,p=Math.min(f.to,h)-c;f=m>=p?null:new Or(m,p,f.tree,f.offset+c,a>0,!!d)}if(f&&o.push(f),s.to>h)break;s=i<e.length?e[i++]:null}if(!d)break;l=d.toA,c=d.toA-d.toB}return o}}class yb{startParse(e,n,r){return typeof e=="string"&&(e=new lR(e)),r=r?r.length?r.map(o=>new _c(o.from,o.to)):[new _c(0,0)]:[new _c(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let o=this.startParse(e,n,r);for(;;){let i=o.advance();if(i)return i}}}class lR{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new we({perNode:!0});class Wa{constructor(e,n,r,o,i,s,a,l,c,d=0,h){this.p=e,this.stack=n,this.state=r,this.reducePos=o,this.pos=i,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=d,this.parent=h}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let o=e.parser.context;return new Wa(e,[],n,r,r,0,[],0,o?new Z0(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,o=e&65535,{parser:i}=this.p,s=this.reducePos<this.pos-25;s&&this.setLookAhead(this.pos);let a=i.dynamicPrecedence(o);if(a&&(this.score+=a),r==0){this.pushState(i.getGoto(this.state,o,!0),this.reducePos),o<i.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(o,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,d=this.reducePos-c;d>=2e3&&!(!((n=this.p.parser.nodeSet.types[o])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=d));let h=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-h;if(o<i.minRepeatTerm||e&131072){let m=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,c,m,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let m=this.stack[l-3];this.state=i.getGoto(m,o,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(o,c)}storeNode(e,n,r,o=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,o);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,o>4&&(o-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=o}}shift(e,n,r,o){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=o,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,o,4);else{let i=e,{parser:s}=this.p;(o>this.pos||n<=s.maxNode)&&(this.pos=o,s.stateFlag(i,1)||(this.reducePos=o)),this.pushState(i,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,o,4)}}apply(e,n,r,o){e&65536?this.reduce(e):this.shift(e,n,r,o)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(n,o),this.buffer.push(r,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),o=e.bufferBase+n;for(;e&&o==e.bufferBase;)e=e.parent;return new Wa(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new cR(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let o=[];for(let i=0,s;i<n.length;i+=2)(s=n[i+1])!=this.state&&this.p.parser.hasAction(s,e)&&o.push(n[i],s);if(this.stack.length<120)for(let i=0;o.length<8&&i<n.length;i+=2){let s=n[i+1];o.some((a,l)=>l&1&&a==s)||o.push(n[i],s)}n=o}let r=[];for(let o=0;o<n.length&&r.length<4;o+=2){let i=n[o+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[o],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,o=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],o,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(o,i)=>{if(!n.includes(o))return n.push(o),e.allActions(o,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-i;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,i+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new Z0(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Z0{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class cR{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=o}}class qa{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new qa(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new qa(this.stack,this.pos,this.index)}}function qs(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,o=0;r<t.length;){let i=0;for(;;){let s=t.charCodeAt(r++),a=!1;if(s==126){i=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),i+=l,a)break;i*=46}n?n[o++]=i:n=new e(i)}return n}class wa{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const J0=new wa;class dR{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=J0,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,o=this.rangeIndex,i=this.pos+e;for(;i<r.from;){if(!o)return null;let s=this.ranges[--o];i-=r.from-s.to,r=s}for(;n<0?i>r.to:i>=r.to;){if(o==this.ranges.length-1)return null;let s=this.ranges[++o];i+=s.from-r.to,r=s}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,o;if(n>=0&&n<this.chunk.length)r=this.pos+e,o=this.chunk.charCodeAt(n);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(r=i,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),o=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),o}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=J0,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let o of this.ranges){if(o.from>=n)break;o.to>e&&(r+=this.input.read(Math.max(o.from,e),Math.min(o.to,n)))}return r}}class So{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;uR(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}So.prototype.contextual=So.prototype.fallback=So.prototype.extend=!1;So.prototype.fallback=So.prototype.extend=!1;function uR(t,e,n,r,o,i){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&t[s];){let c=t[s+1];for(let m=s+3;m<c;m+=2)if((t[m+1]&a)>0){let p=t[m];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||hR(p,e.token.value,o,i))){e.acceptToken(p);break}}let d=e.next,h=0,f=t[s+2];if(e.next<0&&f>h&&t[c+f*3-3]==65535){s=t[c+f*3-1];continue e}for(;h<f;){let m=h+f>>1,p=c+m+(m<<1),b=t[p],v=t[p+1]||65536;if(d<b)f=m;else if(d>=v)h=m+1;else{s=t[p+2],e.advance();continue e}}break}}function e1(t,e,n){for(let r=e,o;(o=t[r])!=65535;r++)if(o==n)return r-e;return-1}function hR(t,e,n,r){let o=e1(n,r,e);return o<0||e1(n,r,t)<o}const Mt=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let zc=null;function t1(t,e,n){let r=t.cursor(Ze.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class fR{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?t1(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?t1(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],o=this.index[n];if(o==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=r.children[o],s=this.start[n]+r.positions[o];if(s>e)return this.nextStart=s,null;if(i instanceof Ge){if(s==e){if(s<this.safeFrom)return null;let a=s+i.length;if(a<=this.safeTo){let l=i.prop(we.lookAhead);if(!l||a+l<this.fragment.to)return i}}this.index[n]++,s+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+i.length}}}class mR{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new wa)}getActions(e){let n=0,r=null,{parser:o}=e.p,{tokenizers:i}=o,s=o.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<i.length;c++){if(!(1<<c&s))continue;let d=i[c],h=this.tokens[c];if(!(r&&!d.fallback)&&((d.contextual||h.start!=e.pos||h.mask!=s||h.context!=a)&&(this.updateCachedToken(h,d,e),h.mask=s,h.context=a),h.lookAhead>h.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let f=n;if(h.extended>-1&&(n=this.addActions(e,h.extended,h.end,n)),n=this.addActions(e,h.value,h.end,n),!d.extend&&(r=h,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new wa,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new wa,{pos:r,p:o}=e;return n.start=r,n.end=Math.min(r+1,o.stream.end),n.value=r==o.stream.end?o.parser.eofTerm:0,n}updateCachedToken(e,n,r){let o=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(o,e),r),e.value>-1){let{parser:i}=r.p;for(let s=0;s<i.specialized.length;s++)if(i.specialized[s]==e.value){let a=i.specializers[s](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,n,r,o){for(let i=0;i<o;i+=3)if(this.actions[i]==e)return o;return this.actions[o++]=e,this.actions[o++]=n,this.actions[o++]=r,o}addActions(e,n,r,o){let{state:i}=e,{parser:s}=e.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(i,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Ln(a,c+2);else{o==0&&a[c+1]==2&&(o=this.putAction(Ln(a,c+2),n,r,o));break}a[c]==n&&(o=this.putAction(Ln(a,c+1),n,r,o))}return o}}class gR{constructor(e,n,r,o){this.parser=e,this.input=n,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new dR(n,o),this.tokens=new mR(e,this.stream),this.topTerm=e.top[1];let{from:i}=o[0];this.stacks=[Wa.start(this,e.top[0],i)],this.fragments=r.length&&this.stream.end-i>e.bufferLength*4?new fR(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],o,i;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let a=e[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,e))continue;{o||(o=[],i=[]),o.push(a);let l=this.tokens.getMainToken(a);i.push(l.value,l.end)}}break}}if(!r.length){let s=o&&bR(o);if(s)return Mt&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Mt&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&o){let s=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,i,r);if(s)return Mt&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let o=e.pos,{parser:i}=this,s=Mt?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,d=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(o);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?i.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!c||(h.prop(we.contextHash)||0)==d))return e.useNode(h,f),Mt&&console.log(s+this.stackID(e)+` (via reuse of ${i.getName(h.type.id)})`),!0;if(!(h instanceof Ge)||h.children.length==0||h.positions[0]>0)break;let m=h.children[0];if(m instanceof Ge&&h.positions[0]==0)h=m;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),Mt&&console.log(s+this.stackID(e)+` (via always-reduce ${i.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let d=l[c++],h=l[c++],f=l[c++],m=c==l.length||!r,p=m?e:e.split(),b=this.tokens.mainToken;if(p.apply(d,h,b?b.start:p.pos,f),Mt&&console.log(s+this.stackID(p)+` (via ${d&65536?`reduce of ${i.getName(d&65535)}`:"shift"} for ${i.getName(h)} @ ${o}${p==e?"":", split"})`),m)return!0;p.pos>o?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return n1(e,n),!0}}runRecovery(e,n,r){let o=null,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=n[s<<1],c=n[(s<<1)+1],d=Mt?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),Mt&&console.log(d+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),f=d;for(let m=0;h.forceReduce()&&m<10&&(Mt&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));m++)Mt&&(f=this.stackID(h)+" -> ");for(let m of a.recoverByInsert(l))Mt&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Mt&&console.log(d+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),n1(a,r)):(!o||o.score<a.score)&&(o=a)}return o}stackToTree(e){return e.close(),Ge.build({buffer:qa.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(zc||(zc=new WeakMap)).get(e);return n||zc.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function n1(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class pR{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class Ua extends yb{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<e.repeatNodeCount;a++)n.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),o=[];for(let a=0;a<n.length;a++)o.push([]);function i(a,l,c){o[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=we[l]);for(let c=1;c<a.length;){let d=a[c++];if(d>=0)i(d,l,a[c++]);else{let h=a[c+-d];for(let f=-d;f>0;f--)i(a[c++],l,h);c++}}}this.nodeSet=new ff(n.map((a,l)=>St.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:o[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=bb;let s=qs(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(r1),this.states=qs(e.states,Uint32Array),this.data=qs(e.stateData),this.goto=qs(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new So(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let o=new gR(this,e,n,r);for(let i of this.wrappers)o=i(o,e,n,r);return o}getGoto(e,n,r=!1){let o=this.goto;if(n>=o[0])return-1;for(let i=o[n+1];;){let s=o[i++],a=s&1,l=o[i++];if(a&&r)return l;for(let c=i+(s>>1);i<c;i++)if(o[i]==e)return l;if(a)return-1}}hasAction(e,n){let r=this.data;for(let o=0;o<2;o++)for(let i=this.stateSlot(e,o?2:1),s;;i+=3){if((s=r[i])==65535)if(r[i+1]==1)s=r[i=Ln(r,i+2)];else{if(r[i+1]==2)return Ln(r,i+2);break}if(s==n||s==0)return Ln(r,i+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),o=r?n(r):void 0;for(let i=this.stateSlot(e,1);o==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ln(this.data,i+2);else break;o=n(Ln(this.data,i+1))}return o}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ln(this.data,r+2);else break;if(!(this.data[r+2]&1)){let o=this.data[r+1];n.some((i,s)=>s&1&&i==o)||n.push(this.data[r],o)}}return n}configure(e){let n=Object.assign(Object.create(Ua.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let o=e.tokenizers.find(i=>i.from==r);return o?o.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,o)=>{let i=e.specializers.find(a=>a.from==r.external);if(!i)return r;let s=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[o]=r1(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let s=n.indexOf(i);s>=0&&(r[s]=!0)}let o=null;for(let i=0;i<n.length;i++)if(!r[i])for(let s=this.dialects[n[i]],a;(a=this.data[s++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[a]=1;return new pR(e,r,o)}static deserialize(e){return new Ua(e)}}function Ln(t,e){return t[e]|t[e+1]<<16}function bR(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function r1(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}let vR=0,Nn=class Qd{constructor(e,n,r,o){this.name=e,this.set=n,this.base=r,this.modified=o,this.id=vR++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Qd&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let o=new Qd(r,[],null,[]);if(o.set.push(o),n)for(let i of n.set)o.set.push(i);return o}static defineModifier(e){let n=new Ka(e);return r=>r.modified.indexOf(n)>-1?r:Ka.get(r.base||r,r.modified.concat(n).sort((o,i)=>o.id-i.id))}},xR=0;class Ka{constructor(e){this.name=e,this.instances=[],this.id=xR++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&wR(n,a.modified));if(r)return r;let o=[],i=new Nn(e.name,o,e,n);for(let a of n)a.instances.push(i);let s=yR(n);for(let a of e.set)if(!a.modified.length)for(let l of s)o.push(Ka.get(a,l));return i}}function wR(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function yR(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,o=e.length;r<o;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Cb(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let o of n.split(" "))if(o){let i=[],s=2,a=o;for(let h=0;;){if(a=="..."&&h>0&&h+3==o.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+o);if(i.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==o.length)break;let m=o[h++];if(h==o.length&&m=="!"){s=0;break}if(m!="/")throw new RangeError("Invalid path: "+o);a=o.slice(h)}let l=i.length-1,c=i[l];if(!c)throw new RangeError("Invalid path: "+o);let d=new Ga(r,s,l>0?i.slice(0,l):null);e[c]=d.sort(e[c])}}return $b.add(e)}const $b=new we;class Ga{constructor(e,n,r,o){this.tags=e,this.mode=n,this.context=r,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Ga.empty=new Ga([],2,null);function Sb(t,e){let n=Object.create(null);for(let i of t)if(!Array.isArray(i.tag))n[i.tag.id]=i.class;else for(let s of i.tag)n[s.id]=i.class;let{scope:r,all:o=null}=e||{};return{style:i=>{let s=o;for(let a of i)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function CR(t,e){let n=null;for(let r of t){let o=r.style(e);o&&(n=n?n+" "+o:o)}return n}function $R(t,e,n,r=0,o=t.length){let i=new SR(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,o,"",i.highlighters),i.flush(o)}class SR{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,o,i){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(i=this.highlighters.filter(m=>!m.scope||m.scope(s)));let c=o,d=AR(e)||Ga.empty,h=CR(i,d.tags);if(h&&(c&&(c+=" "),c+=h,d.mode==1&&(o+=(o?" ":"")+h)),this.startSpan(Math.max(n,a),c),d.opaque)return;let f=e.tree&&e.tree.prop(we.mounted);if(f&&f.overlay){let m=e.node.enter(f.overlay[0].from+a,1),p=this.highlighters.filter(v=>!v.scope||v.scope(f.tree.type)),b=e.firstChild();for(let v=0,x=a;;v++){let y=v<f.overlay.length?f.overlay[v]:null,$=y?y.from+a:l,S=Math.max(n,x),A=Math.min(r,$);if(S<A&&b)for(;e.from<A&&(this.highlightRange(e,S,A,o,i),this.startSpan(Math.min(A,e.to),c),!(e.to>=$||!e.nextSibling())););if(!y||$>r)break;x=y.to+a,x>n&&(this.highlightRange(m.cursor(),Math.max(n,y.from+a),Math.min(r,x),"",p),this.startSpan(Math.min(r,x),c))}b&&e.parent()}else if(e.firstChild()){f&&(o="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,o,i),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function AR(t){let e=t.type.prop($b);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Y=Nn.define,Us=Y(),er=Y(),o1=Y(er),i1=Y(er),tr=Y(),Ks=Y(tr),Hc=Y(tr),cn=Y(),kr=Y(cn),sn=Y(),an=Y(),Zd=Y(),ui=Y(Zd),Gs=Y(),N={comment:Us,lineComment:Y(Us),blockComment:Y(Us),docComment:Y(Us),name:er,variableName:Y(er),typeName:o1,tagName:Y(o1),propertyName:i1,attributeName:Y(i1),className:Y(er),labelName:Y(er),namespace:Y(er),macroName:Y(er),literal:tr,string:Ks,docString:Y(Ks),character:Y(Ks),attributeValue:Y(Ks),number:Hc,integer:Y(Hc),float:Y(Hc),bool:Y(tr),regexp:Y(tr),escape:Y(tr),color:Y(tr),url:Y(tr),keyword:sn,self:Y(sn),null:Y(sn),atom:Y(sn),unit:Y(sn),modifier:Y(sn),operatorKeyword:Y(sn),controlKeyword:Y(sn),definitionKeyword:Y(sn),moduleKeyword:Y(sn),operator:an,derefOperator:Y(an),arithmeticOperator:Y(an),logicOperator:Y(an),bitwiseOperator:Y(an),compareOperator:Y(an),updateOperator:Y(an),definitionOperator:Y(an),typeOperator:Y(an),controlOperator:Y(an),punctuation:Zd,separator:Y(Zd),bracket:ui,angleBracket:Y(ui),squareBracket:Y(ui),paren:Y(ui),brace:Y(ui),content:cn,heading:kr,heading1:Y(kr),heading2:Y(kr),heading3:Y(kr),heading4:Y(kr),heading5:Y(kr),heading6:Y(kr),contentSeparator:Y(cn),list:Y(cn),quote:Y(cn),emphasis:Y(cn),strong:Y(cn),link:Y(cn),monospace:Y(cn),strikethrough:Y(cn),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:Gs,documentMeta:Y(Gs),annotation:Y(Gs),processingInstruction:Y(Gs),definition:Nn.defineModifier("definition"),constant:Nn.defineModifier("constant"),function:Nn.defineModifier("function"),standard:Nn.defineModifier("standard"),local:Nn.defineModifier("local"),special:Nn.defineModifier("special")};for(let t in N){let e=N[t];e instanceof Nn&&(e.name=t)}Sb([{tag:N.link,class:"tok-link"},{tag:N.heading,class:"tok-heading"},{tag:N.emphasis,class:"tok-emphasis"},{tag:N.strong,class:"tok-strong"},{tag:N.keyword,class:"tok-keyword"},{tag:N.atom,class:"tok-atom"},{tag:N.bool,class:"tok-bool"},{tag:N.url,class:"tok-url"},{tag:N.labelName,class:"tok-labelName"},{tag:N.inserted,class:"tok-inserted"},{tag:N.deleted,class:"tok-deleted"},{tag:N.literal,class:"tok-literal"},{tag:N.string,class:"tok-string"},{tag:N.number,class:"tok-number"},{tag:[N.regexp,N.escape,N.special(N.string)],class:"tok-string2"},{tag:N.variableName,class:"tok-variableName"},{tag:N.local(N.variableName),class:"tok-variableName tok-local"},{tag:N.definition(N.variableName),class:"tok-variableName tok-definition"},{tag:N.special(N.variableName),class:"tok-variableName2"},{tag:N.definition(N.propertyName),class:"tok-propertyName tok-definition"},{tag:N.typeName,class:"tok-typeName"},{tag:N.namespace,class:"tok-namespace"},{tag:N.className,class:"tok-className"},{tag:N.macroName,class:"tok-macroName"},{tag:N.propertyName,class:"tok-propertyName"},{tag:N.operator,class:"tok-operator"},{tag:N.comment,class:"tok-comment"},{tag:N.meta,class:"tok-meta"},{tag:N.invalid,class:"tok-invalid"},{tag:N.punctuation,class:"tok-punctuation"}]);const kR=Cb({String:N.string,Number:N.number,"True False":N.bool,PropertyName:N.propertyName,Null:N.null,", :":N.separator,"[ ]":N.squareBracket,"{ }":N.brace}),TR=Ua.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[kR],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Jd=[],Ab=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?Ab:Jd).push(n=n+t[e])})();function RR(t){if(t<768)return!1;for(let e=0,n=Jd.length;;){let r=e+n>>1;if(t<Jd[r])n=r;else if(t>=Ab[r])e=r+1;else return!0;if(e==n)return!1}}function s1(t){return t>=127462&&t<=127487}const a1=8205;function MR(t,e,n=!0,r=!0){return(n?kb:ER)(t,e,r)}function kb(t,e,n){if(e==t.length)return e;e&&Tb(t.charCodeAt(e))&&Rb(t.charCodeAt(e-1))&&e--;let r=Pc(t,e);for(e+=l1(r);e<t.length;){let o=Pc(t,e);if(r==a1||o==a1||n&&RR(o))e+=l1(o),r=o;else if(s1(o)){let i=0,s=e-2;for(;s>=0&&s1(Pc(t,s));)i++,s-=2;if(i%2==0)break;e+=2}else break}return e}function ER(t,e,n){for(;e>0;){let r=kb(t,e-2,n);if(r<e)return r;e--}return 0}function Pc(t,e){let n=t.charCodeAt(e);if(!Rb(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Tb(r)?(n-55296<<10)+(r-56320)+65536:n}function Tb(t){return t>=56320&&t<57344}function Rb(t){return t>=55296&&t<56320}function l1(t){return t<65536?1:2}class ke{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Vo(this,e,n);let o=[];return this.decompose(0,e,o,2),r.length&&r.decompose(0,r.length,o,3),this.decompose(n,this.length,o,1),dn.from(o,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Vo(this,e,n);let r=[];return this.decompose(e,n,r,0),dn.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),o=new Ri(this),i=new Ri(e);for(let s=n,a=n;;){if(o.next(s),i.next(s),s=0,o.lineBreak!=i.lineBreak||o.done!=i.done||o.value!=i.value)return!1;if(a+=o.value.length,o.done||a>=r)return!0}}iter(e=1){return new Ri(this,e)}iterRange(e,n=this.length){return new Mb(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let o=this.line(e).from;r=this.iterRange(o,Math.max(o,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Eb(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ke.empty:e.length<=32?new He(e):dn.from(He.split(e,[]))}}class He extends ke{constructor(e,n=IR(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,o){for(let i=0;;i++){let s=this.text[i],a=o+s.length;if((n?r:a)>=e)return new jR(o,a,r,s);o=a+1,r++}}decompose(e,n,r,o){let i=e<=0&&n>=this.length?this:new He(c1(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(o&1){let s=r.pop(),a=ya(i.text,s.text.slice(),0,i.length);if(a.length<=32)r.push(new He(a,s.length+i.length));else{let l=a.length>>1;r.push(new He(a.slice(0,l)),new He(a.slice(l)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof He))return super.replace(e,n,r);[e,n]=Vo(this,e,n);let o=ya(this.text,ya(r.text,c1(this.text,0,e)),n),i=this.length+r.length-(n-e);return o.length<=32?new He(o,i):dn.from(He.split(o,[]),i)}sliceString(e,n=this.length,r=`
|
|
54
54
|
`){[e,n]=Vo(this,e,n);let o="";for(let i=0,s=0;i<=n&&s<this.text.length;s++){let a=this.text[s],l=i+a.length;i>e&&s&&(o+=r),e<l&&n>i&&(o+=a.slice(Math.max(0,e-i),n-i)),i=l+1}return o}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],o=-1;for(let i of e)r.push(i),o+=i.length+1,r.length==32&&(n.push(new He(r,o)),r=[],o=-1);return o>-1&&n.push(new He(r,o)),n}}class dn extends ke{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,o){for(let i=0;;i++){let s=this.children[i],a=o+s.length,l=r+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,r,o);o=a+1,r=l+1}}decompose(e,n,r,o){for(let i=0,s=0;s<=n&&i<this.children.length;i++){let a=this.children[i],l=s+a.length;if(e<=l&&n>=s){let c=o&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?r.push(a):a.decompose(e-s,n-s,r,c)}s=l+1}}replace(e,n,r){if([e,n]=Vo(this,e,n),r.lines<this.lines)for(let o=0,i=0;o<this.children.length;o++){let s=this.children[o],a=i+s.length;if(e>=i&&n<=a){let l=s.replace(e-i,n-i,r),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let d=this.children.slice();return d[o]=l,new dn(d,this.length-(n-e)+r.length)}return super.replace(i,a,l)}i=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
55
|
-
`){[e,n]=Vo(this,e,n);let o="";for(let i=0,s=0;i<this.children.length&&s<=n;i++){let a=this.children[i],l=s+a.length;s>e&&i&&(o+=r),e<l&&n>s&&(o+=a.sliceString(e-s,n-s,r)),s=l+1}return o}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof dn))return 0;let r=0,[o,i,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=n,i+=n){if(o==s||i==a)return r;let l=this.children[o],c=e.children[i];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,o)=>r+o.length+1,-1)){let r=0;for(let m of e)r+=m.lines;if(r<32){let m=[];for(let
|
|
56
|
-
`,this;e--}else if(o instanceof He){let l=o.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=o.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof He?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Mb{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Ri(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*n,this.value=o.length<=r?o:n<0?o.slice(o.length-r):o.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Eb{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:o}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ke.prototype[Symbol.iterator]=function(){return this.iter()},Ri.prototype[Symbol.iterator]=Mb.prototype[Symbol.iterator]=Eb.prototype[Symbol.iterator]=function(){return this});class jR{constructor(e,n,r,o){this.from=e,this.to=n,this.number=r,this.text=o}get length(){return this.to-this.from}}function Vo(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function st(t,e,n=!0,r=!0){return MR(t,e,n,r)}function DR(t){return t>=56320&&t<57344}function OR(t){return t>=55296&&t<56320}function xt(t,e){let n=t.charCodeAt(e);if(!OR(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return DR(r)?(n-55296<<10)+(r-56320)+65536:n}function bf(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function un(t){return t<65536?1:2}const eu=/\r\n?|\n/;var gt=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(gt||(gt={}));class vn{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,o=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];s<0?(e(r,o,i),o+=i):o+=s,r+=i}}iterChangedRanges(e,n=!1){tu(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],o=this.sections[n++];o<0?e.push(r,o):e.push(o,r)}return new vn(e)}composeDesc(e){return this.empty?e:e.empty?this:Ib(this,e)}mapDesc(e,n=!1){return e.empty?this:nu(this,e,n)}mapPos(e,n=-1,r=gt.Simple){let o=0,i=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=o+a;if(l<0){if(c>e)return i+(e-o);i+=a}else{if(r!=gt.Simple&&c>=e&&(r==gt.TrackDel&&o<e&&c>e||r==gt.TrackBefore&&o<e||r==gt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!a)return e==o||n<0?i:i+l;i+=l}o=c}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return i}touchesRange(e,n=e){for(let r=0,o=0;r<this.sections.length&&o<=n;){let i=this.sections[r++],s=this.sections[r++],a=o+i;if(s>=0&&o<=n&&a>=e)return o<e&&a>n?"cover":!0;o=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],o=this.sections[n++];e+=(e?" ":"")+r+(o>=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new vn(e)}static create(e){return new vn(e)}}class Ye extends vn{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return tu(this,(n,r,o,i,s)=>e=e.replace(o,o+(r-n),s),!1),e}mapDesc(e,n=!1){return nu(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let o=0,i=0;o<n.length;o+=2){let s=n[o],a=n[o+1];if(a>=0){n[o]=a,n[o+1]=s;let l=o>>1;for(;r.length<l;)r.push(ke.empty);r.push(s?e.slice(i,i+s):ke.empty)}i+=s}return new Ye(n,r)}compose(e){return this.empty?e:e.empty?this:Ib(this,e,!0)}map(e,n=!1){return e.empty?this:nu(this,e,n,!0)}iterChanges(e,n=!1){tu(this,e,n)}get desc(){return vn.create(this.sections)}filter(e){let n=[],r=[],o=[],i=new zi(this);e:for(let s=0,a=0;;){let l=s==e.length?1e9:e[s++];for(;a<l||a==l&&i.len==0;){if(i.done)break e;let d=Math.min(i.len,l-a);ct(o,d,-1);let h=i.ins==-1?-1:i.off==0?i.ins:0;ct(n,d,h),h>0&&or(r,n,i.text),i.forward(d),a+=d}let c=e[s++];for(;a<c;){if(i.done)break e;let d=Math.min(i.len,c-a);ct(n,d,-1),ct(o,d,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(d),a+=d}}return{changes:new Ye(n,r),filtered:vn.create(o)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],o=this.sections[n+1];o<0?e.push(r):o==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let o=[],i=[],s=0,a=null;function l(d=!1){if(!d&&!o.length)return;s<n&&ct(o,n-s,-1);let h=new Ye(o,i);a=a?a.compose(h.map(a)):h,o=[],i=[],s=0}function c(d){if(Array.isArray(d))for(let h of d)c(h);else if(d instanceof Ye){if(d.length!=n)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${n})`);l(),a=a?a.compose(d.map(a)):d}else{let{from:h,to:f=h,insert:m}=d;if(h>f||h<0||f>n)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${n})`);let b=m?typeof m=="string"?ke.of(m.split(r||eu)):m:ke.empty,p=b.length;if(h==f&&p==0)return;h<s&&l(),h>s&&ct(o,h-s,-1),ct(o,f-h,p),or(i,o,b),s=f}}return c(e),l(!a),a}static empty(e){return new Ye(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let o=0;o<e.length;o++){let i=e[o];if(typeof i=="number")n.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length<o;)r.push(ke.empty);r[o]=ke.of(i.slice(1)),n.push(i[0],r[o].length)}}}return new Ye(n,r)}static createSet(e,n){return new Ye(e,n)}}function ct(t,e,n,r=!1){if(e==0&&n<=0)return;let o=t.length-2;o>=0&&n<=0&&n==t[o+1]?t[o]+=e:o>=0&&e==0&&t[o]==0?t[o+1]+=n:r?(t[o]+=e,t[o+1]+=n):t.push(e,n)}function or(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(ke.empty);t.push(n)}}function tu(t,e,n){let r=t.inserted;for(let o=0,i=0,s=0;s<t.sections.length;){let a=t.sections[s++],l=t.sections[s++];if(l<0)o+=a,i+=a;else{let c=o,d=i,h=ke.empty;for(;c+=a,d+=l,l&&r&&(h=h.append(r[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(o,c,i,d,h),o=c,i=d}}}function nu(t,e,n,r=!1){let o=[],i=r?[]:null,s=new zi(t),a=new zi(e);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);ct(o,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(ct(o,a.ins,-1);c;){let d=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=d&&(ct(o,0,s.ins),i&&or(i,o,s.text),l=s.i),s.forward(d),c-=d}a.next()}else if(s.ins>=0){let c=0,d=s.len;for(;d;)if(a.ins==-1){let h=Math.min(d,a.len);c+=h,d-=h,a.forward(h)}else if(a.ins==0&&a.len<d)d-=a.len,a.next();else break;ct(o,c,l<s.i?s.ins:0),i&&l<s.i&&or(i,o,s.text),l=s.i,s.forward(s.len-d)}else{if(s.done&&a.done)return i?Ye.createSet(o,i):vn.create(o);throw new Error("Mismatched change set lengths")}}}function Ib(t,e,n=!1){let r=[],o=n?[]:null,i=new zi(t),s=new zi(e);for(let a=!1;;){if(i.done&&s.done)return o?Ye.createSet(r,o):vn.create(r);if(i.ins==0)ct(r,i.len,0,a),i.next();else if(s.len==0&&!s.done)ct(r,0,s.ins,a),o&&or(o,r,s.text),s.next();else{if(i.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(i.len2,s.len),c=r.length;if(i.ins==-1){let d=s.ins==-1?-1:s.off?0:s.ins;ct(r,l,d,a),o&&d&&or(o,r,s.text)}else s.ins==-1?(ct(r,i.off?0:i.len,l,a),o&&or(o,r,i.textBit(l))):(ct(r,i.off?0:i.len,s.off?0:s.ins,a),o&&!s.off&&or(o,r,s.text));a=(i.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>c),i.forward2(l),s.forward(l)}}}}class zi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?ke.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?ke.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Er{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,o;return this.empty?r=o=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),r==this.from&&o==this.to?this:new Er(r,o,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return H.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return H.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return H.range(e.anchor,e.head)}static create(e,n,r){return new Er(e,n,r)}}class H{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:H.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new H([this.main],0)}addRange(e,n=!0){return H.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,H.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new H(e.ranges.map(n=>Er.fromJSON(n)),e.main)}static single(e,n=e){return new H([H.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,o=0;o<e.length;o++){let i=e[o];if(i.empty?i.from<=r:i.from<r)return H.normalized(e.slice(),n);r=i.to}return new H(e,n)}static cursor(e,n=0,r,o){return Er.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(o??16777215)<<6)}static range(e,n,r,o){let i=(r??16777215)<<6|(o==null?7:Math.min(6,o));return n<e?Er.create(n,e,48|i):Er.create(e,n,(n>e?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((o,i)=>o.from-i.from),n=e.indexOf(r);for(let o=1;o<e.length;o++){let i=e[o],s=e[o-1];if(i.empty?i.from<=s.to:i.from<s.to){let a=s.from,l=Math.max(i.to,s.to);o<=n&&n--,e.splice(--o,2,i.anchor>i.head?H.range(l,a):H.range(a,l))}}return new H(e,n)}}function jb(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let vf=0;class ne{constructor(e,n,r,o,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=o,this.id=vf++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new ne(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:xf),!!e.static,e.enables)}of(e){return new Ca([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ca(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ca(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function xf(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ca{constructor(e,n,r,o){this.dependencies=e,this.facet=n,this.type=r,this.value=o,this.id=vf++}dynamicSlot(e){var n;let r=this.value,o=this.facet.compareInput,i=this.id,s=e[i]>>1,a=this.type==2,l=!1,c=!1,d=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:((n=e[h.id])!==null&&n!==void 0?n:1)&1||d.push(e[h.id]);return{create(h){return h.values[s]=r(h),1},update(h,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||ru(h,d)){let m=r(h);if(a?!d1(m,h.values[s],o):!o(m,h.values[s]))return h.values[s]=m,1}return 0},reconfigure:(h,f)=>{let m,b=f.config.address[i];if(b!=null){let p=Xa(f,b);if(this.dependencies.every(v=>v instanceof ne?f.facet(v)===h.facet(v):v instanceof tt?f.field(v,!1)==h.field(v,!1):!0)||(a?d1(m=r(h),p,o):o(m=r(h),p)))return h.values[s]=p,0}else m=r(h);return h.values[s]=m,1}}}}function d1(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function ru(t,e){let n=!1;for(let r of e)Mi(t,r)&1&&(n=!0);return n}function LR(t,e,n){let r=n.map(l=>t[l.id]),o=n.map(l=>l.type),i=r.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let d=0;d<r.length;d++){let h=Xa(l,r[d]);if(o[d]==2)for(let f of h)c.push(f);else c.push(h)}return e.combine(c)}return{create(l){for(let c of r)Mi(l,c);return l.values[s]=a(l),1},update(l,c){if(!ru(l,i))return 0;let d=a(l);return e.compare(d,l.values[s])?0:(l.values[s]=d,1)},reconfigure(l,c){let d=ru(l,r),h=c.config.facets[e.id],f=c.facet(e);if(h&&!d&&xf(n,h))return l.values[s]=f,0;let m=a(l);return e.compare(m,f)?(l.values[s]=f,0):(l.values[s]=m,1)}}}const Ys=ne.define({static:!0});class tt{constructor(e,n,r,o,i){this.id=e,this.createF=n,this.updateF=r,this.compareF=o,this.spec=i,this.provides=void 0}static define(e){let n=new tt(vf++,e.create,e.update,e.compare||((r,o)=>r===o),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Ys).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,o)=>{let i=r.values[n],s=this.updateF(i,o);return this.compareF(i,s)?0:(r.values[n]=s,1)},reconfigure:(r,o)=>{let i=r.facet(Ys),s=o.facet(Ys),a;return(a=i.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):o.config.address[this.id]!=null?(r.values[n]=o.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Ys.of({field:this,create:e})]}get extension(){return this}}const Rr={lowest:4,low:3,default:2,high:1,highest:0};function hi(t){return e=>new Db(e,t)}const to={highest:hi(Rr.highest),high:hi(Rr.high),default:hi(Rr.default),low:hi(Rr.low),lowest:hi(Rr.lowest)};class Db{constructor(e,n){this.inner=e,this.prec=n}}class Ul{of(e){return new ou(this,e)}reconfigure(e){return Ul.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ou{constructor(e,n){this.compartment=e,this.inner=n}}class Ya{constructor(e,n,r,o,i,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=o,this.staticValues=i,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let o=[],i=Object.create(null),s=new Map;for(let f of NR(e,n,s))f instanceof tt?o.push(f):(i[f.facet.id]||(i[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of o)a[f.id]=c.length<<1,c.push(m=>f.slot(m));let d=r?.config.facets;for(let f in i){let m=i[f],b=m[0].facet,p=d&&d[f]||[];if(m.every(v=>v.type==0))if(a[b.id]=l.length<<1|1,xf(p,m))l.push(r.facet(b));else{let v=b.combine(m.map(x=>x.value));l.push(r&&b.compare(v,r.facet(b))?r.facet(b):v)}else{for(let v of m)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(x=>v.dynamicSlot(x)));a[b.id]=c.length<<1,c.push(v=>LR(v,b,m))}}let h=c.map(f=>f(a));return new Ya(e,s,h,a,l,i)}}function NR(t,e,n){let r=[[],[],[],[],[]],o=new Map;function i(s,a){let l=o.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof ou&&n.delete(s.compartment)}if(o.set(s,a),Array.isArray(s))for(let c of s)i(c,a);else if(s instanceof ou){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),i(c,a)}else if(s instanceof Db)i(s.inner,s.prec);else if(s instanceof tt)r[a].push(s),s.provides&&i(s.provides,a);else if(s instanceof Ca)r[a].push(s),s.facet.extensions&&i(s.facet.extensions,Rr.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(c,a)}}return i(t,Rr.default),r.reduce((s,a)=>s.concat(a))}function Mi(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let o=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|o}function Xa(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Ob=ne.define(),iu=ne.define({combine:t=>t.some(e=>e),static:!0}),Lb=ne.define({combine:t=>t.length?t[0]:void 0,static:!0}),Nb=ne.define(),Bb=ne.define(),Fb=ne.define(),Vb=ne.define({combine:t=>t.length?t[0]:!1});class Mn{constructor(e,n){this.type=e,this.value=n}static define(){return new BR}}class BR{of(e){return new Mn(this,e)}}class FR{constructor(e){this.map=e}of(e){return new me(this,e)}}class me{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new me(this.type,n)}is(e){return this.type==e}static define(e={}){return new FR(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let o of e){let i=o.map(n);i&&r.push(i)}return r}}me.reconfigure=me.define();me.appendConfig=me.define();class Xe{constructor(e,n,r,o,i,s){this.startState=e,this.changes=n,this.selection=r,this.effects=o,this.annotations=i,this.scrollIntoView=s,this._doc=null,this._state=null,r&&jb(r,n.newLength),i.some(a=>a.type==Xe.time)||(this.annotations=i.concat(Xe.time.of(Date.now())))}static create(e,n,r,o,i,s){return new Xe(e,n,r,o,i,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Xe.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Xe.time=Mn.define();Xe.userEvent=Mn.define();Xe.addToHistory=Mn.define();Xe.remote=Mn.define();function VR(t,e){let n=[];for(let r=0,o=0;;){let i,s;if(r<t.length&&(o==e.length||e[o]>=t[r]))i=t[r++],s=t[r++];else if(o<e.length)i=e[o++],s=e[o++];else return n;!n.length||n[n.length-1]<i?n.push(i,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function _b(t,e,n){var r;let o,i,s;return n?(o=e.changes,i=Ye.empty(e.changes.length),s=t.changes.compose(e.changes)):(o=e.changes.map(t.changes),i=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(o)),{changes:s,selection:e.selection?e.selection.map(i):(r=t.selection)===null||r===void 0?void 0:r.map(o),effects:me.mapEffects(t.effects,o).concat(me.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function su(t,e,n){let r=e.selection,o=Ao(e.annotations);return e.userEvent&&(o=o.concat(Xe.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ye?e.changes:Ye.of(e.changes||[],n,t.facet(Lb)),selection:r&&(r instanceof H?r:H.single(r.anchor,r.head)),effects:Ao(e.effects),annotations:o,scrollIntoView:!!e.scrollIntoView}}function zb(t,e,n){let r=su(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(n=!1);let s=!!e[i].sequential;r=_b(r,su(t,e[i],s?r.changes.newLength:t.doc.length),s)}let o=Xe.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return zR(n?_R(o):o)}function _R(t){let e=t.startState,n=!0;for(let o of e.facet(Nb)){let i=o(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:VR(n,i))}if(n!==!0){let o,i;if(n===!1)i=t.changes.invertedDesc,o=Ye.empty(e.doc.length);else{let s=t.changes.filter(n);o=s.changes,i=s.filtered.mapDesc(s.changes).invertedDesc}t=Xe.create(e,o,t.selection&&t.selection.map(i),me.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let r=e.facet(Bb);for(let o=r.length-1;o>=0;o--){let i=r[o](t);i instanceof Xe?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof Xe?t=i[0]:t=zb(e,Ao(i),!1)}return t}function zR(t){let e=t.startState,n=e.facet(Fb),r=t;for(let o=n.length-1;o>=0;o--){let i=n[o](t);i&&Object.keys(i).length&&(r=_b(r,su(e,i,t.changes.newLength),!0))}return r==t?t:Xe.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const HR=[];function Ao(t){return t==null?HR:Array.isArray(t)?t:[t]}var Le=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Le||(Le={}));const PR=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let au;try{au=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function WR(t){if(au)return au.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||PR.test(n)))return!0}return!1}function qR(t){return e=>{if(!/\S/.test(e))return Le.Space;if(WR(e))return Le.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Le.Word;return Le.Other}}class $e{constructor(e,n,r,o,i,s){this.config=e,this.doc=n,this.selection=r,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=i,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Mi(this,a<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Mi(this,r),Xa(this,r)}update(...e){return zb(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:o}=n;for(let a of e.effects)a.is(Ul.reconfigure)?(n&&(o=new Map,n.compartments.forEach((l,c)=>o.set(c,l)),n=null),o.set(a.value.compartment,a.value.extension)):a.is(me.reconfigure)?(n=null,r=a.value):a.is(me.appendConfig)&&(n=null,r=Ao(r).concat(a.value));let i;n?i=e.startState.values.slice():(n=Ya.resolve(r,o,this),i=new $e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(iu)?e.newSelection:e.newSelection.asSingle();new $e(n,e.newDoc,s,i,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:H.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),o=this.changes(r.changes),i=[r.range],s=Ao(r.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),d=c.map(o);for(let f=0;f<a;f++)i[f]=i[f].map(d);let h=o.mapDesc(c,!0);i.push(l.range.map(h)),o=o.compose(d),s=me.mapEffects(s,d).concat(me.mapEffects(Ao(l.effects),h))}return{changes:o,selection:H.create(i,n.mainIndex),effects:s}}changes(e=[]){return e instanceof Ye?e:Ye.of(e,this.doc.length,this.facet($e.lineSeparator))}toText(e){return ke.of(e.split(this.facet($e.lineSeparator)||eu))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Mi(this,n),Xa(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let o=e[r];o instanceof tt&&this.config.address[o.id]!=null&&(n[r]=o.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let o=[];if(r){for(let i in r)if(Object.prototype.hasOwnProperty.call(e,i)){let s=r[i],a=e[i];o.push(s.init(l=>s.spec.fromJSON(a,l)))}}return $e.create({doc:e.doc,selection:H.fromJSON(e.selection),extensions:n.extensions?o.concat([n.extensions]):o})}static create(e={}){let n=Ya.resolve(e.extensions||[],new Map),r=e.doc instanceof ke?e.doc:ke.of((e.doc||"").split(n.staticFacet($e.lineSeparator)||eu)),o=e.selection?e.selection instanceof H?e.selection:H.single(e.selection.anchor,e.selection.head):H.single(0);return jb(o,r.length),n.staticFacet(iu)||(o=o.asSingle()),new $e(n,r,o,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet($e.tabSize)}get lineBreak(){return this.facet($e.lineSeparator)||`
|
|
57
|
-
`}get readOnly(){return this.facet(Vb)}phrase(e,...n){for(let r of this.facet($e.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,o)=>{if(o=="$")return"$";let i=+(o||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let o=[];for(let i of this.facet(Ob))for(let s of i(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&o.push(s[e]);return o}charCategorizer(e){return qR(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:o}=this.doc.lineAt(e),i=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=st(n,s,!1);if(i(n.slice(l,s))!=Le.Word)break;s=l}for(;a<o;){let l=st(n,a);if(i(n.slice(a,l))!=Le.Word)break;a=l}return s==a?null:H.range(s+r,a+r)}}$e.allowMultipleSelections=iu;$e.tabSize=ne.define({combine:t=>t.length?t[0]:4});$e.lineSeparator=Lb;$e.readOnly=Vb;$e.phrases=ne.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(o=>t[o]==e[o])}});$e.languageData=Ob;$e.changeFilter=Nb;$e.transactionFilter=Bb;$e.transactionExtender=Fb;Ul.reconfigure=me.define();function En(t,e,n={}){let r={};for(let o of t)for(let i of Object.keys(o)){let s=o[i],a=r[i];if(a===void 0)r[i]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](a,s);else throw new Error("Config merge conflict for field "+i)}for(let o in e)r[o]===void 0&&(r[o]=e[o]);return r}class Hr{eq(e){return this==e}range(e,n=e){return Hi.create(e,n,this)}}Hr.prototype.startSide=Hr.prototype.endSide=0;Hr.prototype.point=!1;Hr.prototype.mapMode=gt.TrackDel;class Hi{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new Hi(e,n,r)}}function lu(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class wf{constructor(e,n,r,o){this.from=e,this.to=n,this.value=r,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,o=0){let i=r?this.to:this.from;for(let s=o,a=i.length;;){if(s==a)return s;let l=s+a>>1,c=i[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,o){for(let i=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,i);i<s;i++)if(o(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,n){let r=[],o=[],i=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],d=this.from[l]+e,h=this.to[l]+e,f,m;if(d==h){let b=n.mapPos(d,c.startSide,c.mapMode);if(b==null||(f=m=b,c.startSide!=c.endSide&&(m=n.mapPos(d,c.endSide),m<f)))continue}else if(f=n.mapPos(d,c.startSide),m=n.mapPos(h,c.endSide),f>m||f==m&&c.startSide>0&&c.endSide<=0)continue;(m-f||c.endSide-c.startSide)<0||(s<0&&(s=f),c.point&&(a=Math.max(a,m-f)),r.push(c),o.push(f-s),i.push(m-s))}return{mapped:r.length?new wf(o,i,r,a):null,pos:s}}}class Ae{constructor(e,n,r,o){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=o}static create(e,n,r,o){return new Ae(e,n,r,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:o=0,filterTo:i=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(lu)),this.isEmpty)return n.length?Ae.of(n):this;let a=new Hb(this,null,-1).goto(0),l=0,c=[],d=new qn;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let h=n[l++];d.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||o>this.chunkEnd(a.chunkIndex)||i<this.chunkPos[a.chunkIndex])&&d.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||o>a.to||i<a.from||s(a.from,a.to,a.value))&&(d.addInner(a.from,a.to,a.value)||c.push(Hi.create(a.from,a.to,a.value))),a.next());return d.finishInner(this.nextLayer.isEmpty&&!c.length?Ae.empty:this.nextLayer.update({add:c,filter:s,filterFrom:o,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],o=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],c=e.touchesRange(a,a+l.length);if(c===!1)o=Math.max(o,l.maxPoint),n.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:d,pos:h}=l.map(a,e);d&&(o=Math.max(o,d.maxPoint),n.push(d),r.push(h))}}let i=this.nextLayer.map(e);return n.length==0?i:new Ae(r,n,i||Ae.empty,o)}between(e,n,r){if(!this.isEmpty){for(let o=0;o<this.chunk.length;o++){let i=this.chunkPos[o],s=this.chunk[o];if(n>=i&&e<=i+s.length&&s.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Pi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Pi.from(e).goto(n)}static compare(e,n,r,o,i=-1){let s=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=i),a=n.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=i),l=u1(s,a,r),c=new fi(s,l,i),d=new fi(a,l,i);r.iterGaps((h,f,m)=>h1(c,h,d,f,m,o)),r.empty&&r.length==0&&h1(c,0,d,0,0,o)}static eq(e,n,r=0,o){o==null&&(o=999999999);let i=e.filter(d=>!d.isEmpty&&n.indexOf(d)<0),s=n.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(i.length!=s.length)return!1;if(!i.length)return!0;let a=u1(i,s),l=new fi(i,a,0).goto(r),c=new fi(s,a,0).goto(r);for(;;){if(l.to!=c.to||!cu(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>o)return!0;l.next(),c.next()}}static spans(e,n,r,o,i=-1){let s=new fi(e,null,i).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let d=s.activeForPoint(s.to),h=s.pointFrom<n?d.length+1:s.point.startSide<0?d.length:Math.min(d.length,l);o.point(a,c,s.point,d,h,s.pointRank),l=Math.min(s.openEnd(c),d.length)}else c>a&&(o.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new qn;for(let o of e instanceof Hi?[e]:n?UR(e):e)r.add(o.from,o.to,o.value);return r.finish()}static join(e){if(!e.length)return Ae.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let o=e[r];o!=Ae.empty;o=o.nextLayer)n=new Ae(o.chunkPos,o.chunk,n,Math.max(o.maxPoint,n.maxPoint));return n}}Ae.empty=new Ae([],[],null,-1);function UR(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(lu(e,r)>0)return t.slice().sort(lu);e=r}return t}Ae.empty.nextLayer=Ae.empty;class qn{finishChunk(e){this.chunks.push(new wf(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new qn)).add(e,n,r)}addInner(e,n,r){let o=e-this.lastTo||r.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return o<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Ae.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Ae.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function u1(t,e,n){let r=new Map;for(let i of t)for(let s=0;s<i.chunk.length;s++)i.chunk[s].maxPoint<=0&&r.set(i.chunk[s],i.chunkPos[s]);let o=new Set;for(let i of e)for(let s=0;s<i.chunk.length;s++){let a=r.get(i.chunk[s]);a!=null&&(n?n.mapPos(a):a)==i.chunkPos[s]&&!n?.touchesRange(a,a+i.chunk[s].length)&&o.add(i.chunk[s])}return o}class Hb{constructor(e,n,r,o=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=o}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let o=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(o)||this.layer.chunkEnd(this.chunkIndex)<e||o.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let o=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<o)&&this.setRangeIndex(o)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Pi{constructor(e){this.heap=e}static from(e,n=null,r=-1){let o=[];for(let i=0;i<e.length;i++)for(let s=e[i];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&o.push(new Hb(s,n,r,i));return o.length==1?o[0]:new Pi(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Wc(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Wc(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Wc(this.heap,0)}}}function Wc(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let o=t[r];if(r+1<t.length&&o.compare(t[r+1])>=0&&(o=t[r+1],r++),n.compare(o)<0)break;t[r]=n,t[e]=o,e=r}}class fi{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pi.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Xs(this.active,e),Xs(this.activeTo,e),Xs(this.activeRank,e),this.minActive=f1(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:o,rank:i}=this.cursor;for(;n<this.activeRank.length&&(i-this.activeRank[n]||o-this.activeTo[n])>0;)n++;Qs(this.active,n,r),Qs(this.activeTo,n,o),Qs(this.activeRank,n,i),e&&Qs(e,n,this.cursor.from),this.minActive=f1(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),r&&Xs(r,o)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let o=r.length-1;o>=0&&r[o]<e;o--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function h1(t,e,n,r,o,i){t.goto(e),n.goto(r);let s=r+o,a=r,l=r-e;for(;;){let c=t.to+l-n.to,d=c||t.endSide-n.endSide,h=d<0?t.to+l:n.to,f=Math.min(h,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&cu(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(a,f,t.point,n.point):f>a&&!cu(t.active,n.active)&&i.compareRange(a,f,t.active,n.active),h>s)break;(c||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(h),a=h,d<=0&&t.next(),d>=0&&n.next()}}function cu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Xs(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Qs(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function f1(t,e){let n=-1,r=1e9;for(let o=0;o<e.length;o++)(e[o]-r||t[o].endSide-t[n].endSide)<0&&(n=o,r=e[o]);return n}function ri(t,e,n=t.length){let r=0;for(let o=0;o<n&&o<t.length;)t.charCodeAt(o)==9?(r+=e-r%e,o++):(r++,o=st(t,o));return r}function du(t,e,n,r){for(let o=0,i=0;;){if(i>=e)return o;if(o==t.length)break;i+=t.charCodeAt(o)==9?n-i%n:1,o=st(t,o)}return r===!0?-1:t.length}const uu="ͼ",m1=typeof Symbol>"u"?"__"+uu:Symbol.for(uu),hu=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),g1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class fr{constructor(e,n){this.rules=[];let{finish:r}=n||{};function o(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function i(s,a,l,c){let d=[],h=/^@(\w+)\b/.exec(s[0]),f=h&&h[1]=="keyframes";if(h&&a==null)return l.push(s[0]+";");for(let m in a){let b=a[m];if(/&/.test(m))i(m.split(/,\s*/).map(p=>s.map(v=>p.replace(/&/,v))).reduce((p,v)=>p.concat(v)),b,l);else if(b&&typeof b=="object"){if(!h)throw new RangeError("The value of a property ("+m+") should be a primitive value.");i(o(m),b,d,f)}else b!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+b+";")}(d.length||f)&&l.push((r&&!h&&!c?s.map(r):s).join(", ")+" {"+d.join(" ")+"}")}for(let s in e)i(o(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
|
55
|
+
`){[e,n]=Vo(this,e,n);let o="";for(let i=0,s=0;i<this.children.length&&s<=n;i++){let a=this.children[i],l=s+a.length;s>e&&i&&(o+=r),e<l&&n>s&&(o+=a.sliceString(e-s,n-s,r)),s=l+1}return o}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof dn))return 0;let r=0,[o,i,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=n,i+=n){if(o==s||i==a)return r;let l=this.children[o],c=e.children[i];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,o)=>r+o.length+1,-1)){let r=0;for(let m of e)r+=m.lines;if(r<32){let m=[];for(let p of e)p.flatten(m);return new He(m,n)}let o=Math.max(32,r>>5),i=o<<1,s=o>>1,a=[],l=0,c=-1,d=[];function h(m){let p;if(m.lines>i&&m instanceof dn)for(let b of m.children)h(b);else m.lines>s&&(l>s||!l)?(f(),a.push(m)):m instanceof He&&l&&(p=d[d.length-1])instanceof He&&m.lines+p.lines<=32?(l+=m.lines,c+=m.length+1,d[d.length-1]=new He(p.text.concat(m.text),p.length+1+m.length)):(l+m.lines>o&&f(),l+=m.lines,c+=m.length+1,d.push(m))}function f(){l!=0&&(a.push(d.length==1?d[0]:dn.from(d,c)),c=-1,l=d.length=0)}for(let m of e)h(m);return f(),a.length==1?a[0]:new dn(a,n)}}ke.empty=new He([""],0);function IR(t){let e=-1;for(let n of t)e+=n.length+1;return e}function ya(t,e,n=0,r=1e9){for(let o=0,i=0,s=!0;i<t.length&&o<=r;i++){let a=t[i],l=o+a.length;l>=n&&(l>r&&(a=a.slice(0,r-o)),o<n&&(a=a.slice(n-o)),s?(e[e.length-1]+=a,s=!1):e.push(a)),o=l+1}return e}function c1(t,e,n){return ya(t,[""],e,n)}class Ri{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof He?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,o=this.nodes[r],i=this.offsets[r],s=i>>1,a=o instanceof He?o.text.length:o.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
56
|
+
`,this;e--}else if(o instanceof He){let l=o.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=o.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof He?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Mb{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Ri(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*n,this.value=o.length<=r?o:n<0?o.slice(o.length-r):o.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Eb{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:o}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ke.prototype[Symbol.iterator]=function(){return this.iter()},Ri.prototype[Symbol.iterator]=Mb.prototype[Symbol.iterator]=Eb.prototype[Symbol.iterator]=function(){return this});class jR{constructor(e,n,r,o){this.from=e,this.to=n,this.number=r,this.text=o}get length(){return this.to-this.from}}function Vo(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function st(t,e,n=!0,r=!0){return MR(t,e,n,r)}function DR(t){return t>=56320&&t<57344}function OR(t){return t>=55296&&t<56320}function xt(t,e){let n=t.charCodeAt(e);if(!OR(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return DR(r)?(n-55296<<10)+(r-56320)+65536:n}function bf(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function un(t){return t<65536?1:2}const eu=/\r\n?|\n/;var gt=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(gt||(gt={}));class vn{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,o=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];s<0?(e(r,o,i),o+=i):o+=s,r+=i}}iterChangedRanges(e,n=!1){tu(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],o=this.sections[n++];o<0?e.push(r,o):e.push(o,r)}return new vn(e)}composeDesc(e){return this.empty?e:e.empty?this:Ib(this,e)}mapDesc(e,n=!1){return e.empty?this:nu(this,e,n)}mapPos(e,n=-1,r=gt.Simple){let o=0,i=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=o+a;if(l<0){if(c>e)return i+(e-o);i+=a}else{if(r!=gt.Simple&&c>=e&&(r==gt.TrackDel&&o<e&&c>e||r==gt.TrackBefore&&o<e||r==gt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!a)return e==o||n<0?i:i+l;i+=l}o=c}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return i}touchesRange(e,n=e){for(let r=0,o=0;r<this.sections.length&&o<=n;){let i=this.sections[r++],s=this.sections[r++],a=o+i;if(s>=0&&o<=n&&a>=e)return o<e&&a>n?"cover":!0;o=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],o=this.sections[n++];e+=(e?" ":"")+r+(o>=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new vn(e)}static create(e){return new vn(e)}}class Ye extends vn{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return tu(this,(n,r,o,i,s)=>e=e.replace(o,o+(r-n),s),!1),e}mapDesc(e,n=!1){return nu(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let o=0,i=0;o<n.length;o+=2){let s=n[o],a=n[o+1];if(a>=0){n[o]=a,n[o+1]=s;let l=o>>1;for(;r.length<l;)r.push(ke.empty);r.push(s?e.slice(i,i+s):ke.empty)}i+=s}return new Ye(n,r)}compose(e){return this.empty?e:e.empty?this:Ib(this,e,!0)}map(e,n=!1){return e.empty?this:nu(this,e,n,!0)}iterChanges(e,n=!1){tu(this,e,n)}get desc(){return vn.create(this.sections)}filter(e){let n=[],r=[],o=[],i=new zi(this);e:for(let s=0,a=0;;){let l=s==e.length?1e9:e[s++];for(;a<l||a==l&&i.len==0;){if(i.done)break e;let d=Math.min(i.len,l-a);ct(o,d,-1);let h=i.ins==-1?-1:i.off==0?i.ins:0;ct(n,d,h),h>0&&or(r,n,i.text),i.forward(d),a+=d}let c=e[s++];for(;a<c;){if(i.done)break e;let d=Math.min(i.len,c-a);ct(n,d,-1),ct(o,d,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(d),a+=d}}return{changes:new Ye(n,r),filtered:vn.create(o)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],o=this.sections[n+1];o<0?e.push(r):o==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let o=[],i=[],s=0,a=null;function l(d=!1){if(!d&&!o.length)return;s<n&&ct(o,n-s,-1);let h=new Ye(o,i);a=a?a.compose(h.map(a)):h,o=[],i=[],s=0}function c(d){if(Array.isArray(d))for(let h of d)c(h);else if(d instanceof Ye){if(d.length!=n)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${n})`);l(),a=a?a.compose(d.map(a)):d}else{let{from:h,to:f=h,insert:m}=d;if(h>f||h<0||f>n)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${n})`);let p=m?typeof m=="string"?ke.of(m.split(r||eu)):m:ke.empty,b=p.length;if(h==f&&b==0)return;h<s&&l(),h>s&&ct(o,h-s,-1),ct(o,f-h,b),or(i,o,p),s=f}}return c(e),l(!a),a}static empty(e){return new Ye(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let o=0;o<e.length;o++){let i=e[o];if(typeof i=="number")n.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length<o;)r.push(ke.empty);r[o]=ke.of(i.slice(1)),n.push(i[0],r[o].length)}}}return new Ye(n,r)}static createSet(e,n){return new Ye(e,n)}}function ct(t,e,n,r=!1){if(e==0&&n<=0)return;let o=t.length-2;o>=0&&n<=0&&n==t[o+1]?t[o]+=e:o>=0&&e==0&&t[o]==0?t[o+1]+=n:r?(t[o]+=e,t[o+1]+=n):t.push(e,n)}function or(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(ke.empty);t.push(n)}}function tu(t,e,n){let r=t.inserted;for(let o=0,i=0,s=0;s<t.sections.length;){let a=t.sections[s++],l=t.sections[s++];if(l<0)o+=a,i+=a;else{let c=o,d=i,h=ke.empty;for(;c+=a,d+=l,l&&r&&(h=h.append(r[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(o,c,i,d,h),o=c,i=d}}}function nu(t,e,n,r=!1){let o=[],i=r?[]:null,s=new zi(t),a=new zi(e);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);ct(o,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(ct(o,a.ins,-1);c;){let d=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=d&&(ct(o,0,s.ins),i&&or(i,o,s.text),l=s.i),s.forward(d),c-=d}a.next()}else if(s.ins>=0){let c=0,d=s.len;for(;d;)if(a.ins==-1){let h=Math.min(d,a.len);c+=h,d-=h,a.forward(h)}else if(a.ins==0&&a.len<d)d-=a.len,a.next();else break;ct(o,c,l<s.i?s.ins:0),i&&l<s.i&&or(i,o,s.text),l=s.i,s.forward(s.len-d)}else{if(s.done&&a.done)return i?Ye.createSet(o,i):vn.create(o);throw new Error("Mismatched change set lengths")}}}function Ib(t,e,n=!1){let r=[],o=n?[]:null,i=new zi(t),s=new zi(e);for(let a=!1;;){if(i.done&&s.done)return o?Ye.createSet(r,o):vn.create(r);if(i.ins==0)ct(r,i.len,0,a),i.next();else if(s.len==0&&!s.done)ct(r,0,s.ins,a),o&&or(o,r,s.text),s.next();else{if(i.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(i.len2,s.len),c=r.length;if(i.ins==-1){let d=s.ins==-1?-1:s.off?0:s.ins;ct(r,l,d,a),o&&d&&or(o,r,s.text)}else s.ins==-1?(ct(r,i.off?0:i.len,l,a),o&&or(o,r,i.textBit(l))):(ct(r,i.off?0:i.len,s.off?0:s.ins,a),o&&!s.off&&or(o,r,s.text));a=(i.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>c),i.forward2(l),s.forward(l)}}}}class zi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?ke.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?ke.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Er{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,o;return this.empty?r=o=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),r==this.from&&o==this.to?this:new Er(r,o,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return H.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return H.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return H.range(e.anchor,e.head)}static create(e,n,r){return new Er(e,n,r)}}class H{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:H.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new H([this.main],0)}addRange(e,n=!0){return H.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,H.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new H(e.ranges.map(n=>Er.fromJSON(n)),e.main)}static single(e,n=e){return new H([H.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,o=0;o<e.length;o++){let i=e[o];if(i.empty?i.from<=r:i.from<r)return H.normalized(e.slice(),n);r=i.to}return new H(e,n)}static cursor(e,n=0,r,o){return Er.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(o??16777215)<<6)}static range(e,n,r,o){let i=(r??16777215)<<6|(o==null?7:Math.min(6,o));return n<e?Er.create(n,e,48|i):Er.create(e,n,(n>e?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((o,i)=>o.from-i.from),n=e.indexOf(r);for(let o=1;o<e.length;o++){let i=e[o],s=e[o-1];if(i.empty?i.from<=s.to:i.from<s.to){let a=s.from,l=Math.max(i.to,s.to);o<=n&&n--,e.splice(--o,2,i.anchor>i.head?H.range(l,a):H.range(a,l))}}return new H(e,n)}}function jb(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let vf=0;class ne{constructor(e,n,r,o,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=o,this.id=vf++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new ne(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:xf),!!e.static,e.enables)}of(e){return new Ca([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ca(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ca(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function xf(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ca{constructor(e,n,r,o){this.dependencies=e,this.facet=n,this.type=r,this.value=o,this.id=vf++}dynamicSlot(e){var n;let r=this.value,o=this.facet.compareInput,i=this.id,s=e[i]>>1,a=this.type==2,l=!1,c=!1,d=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:((n=e[h.id])!==null&&n!==void 0?n:1)&1||d.push(e[h.id]);return{create(h){return h.values[s]=r(h),1},update(h,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||ru(h,d)){let m=r(h);if(a?!d1(m,h.values[s],o):!o(m,h.values[s]))return h.values[s]=m,1}return 0},reconfigure:(h,f)=>{let m,p=f.config.address[i];if(p!=null){let b=Xa(f,p);if(this.dependencies.every(v=>v instanceof ne?f.facet(v)===h.facet(v):v instanceof tt?f.field(v,!1)==h.field(v,!1):!0)||(a?d1(m=r(h),b,o):o(m=r(h),b)))return h.values[s]=b,0}else m=r(h);return h.values[s]=m,1}}}}function d1(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function ru(t,e){let n=!1;for(let r of e)Mi(t,r)&1&&(n=!0);return n}function LR(t,e,n){let r=n.map(l=>t[l.id]),o=n.map(l=>l.type),i=r.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let d=0;d<r.length;d++){let h=Xa(l,r[d]);if(o[d]==2)for(let f of h)c.push(f);else c.push(h)}return e.combine(c)}return{create(l){for(let c of r)Mi(l,c);return l.values[s]=a(l),1},update(l,c){if(!ru(l,i))return 0;let d=a(l);return e.compare(d,l.values[s])?0:(l.values[s]=d,1)},reconfigure(l,c){let d=ru(l,r),h=c.config.facets[e.id],f=c.facet(e);if(h&&!d&&xf(n,h))return l.values[s]=f,0;let m=a(l);return e.compare(m,f)?(l.values[s]=f,0):(l.values[s]=m,1)}}}const Ys=ne.define({static:!0});class tt{constructor(e,n,r,o,i){this.id=e,this.createF=n,this.updateF=r,this.compareF=o,this.spec=i,this.provides=void 0}static define(e){let n=new tt(vf++,e.create,e.update,e.compare||((r,o)=>r===o),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Ys).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,o)=>{let i=r.values[n],s=this.updateF(i,o);return this.compareF(i,s)?0:(r.values[n]=s,1)},reconfigure:(r,o)=>{let i=r.facet(Ys),s=o.facet(Ys),a;return(a=i.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):o.config.address[this.id]!=null?(r.values[n]=o.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Ys.of({field:this,create:e})]}get extension(){return this}}const Rr={lowest:4,low:3,default:2,high:1,highest:0};function hi(t){return e=>new Db(e,t)}const to={highest:hi(Rr.highest),high:hi(Rr.high),default:hi(Rr.default),low:hi(Rr.low),lowest:hi(Rr.lowest)};class Db{constructor(e,n){this.inner=e,this.prec=n}}class Ul{of(e){return new ou(this,e)}reconfigure(e){return Ul.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ou{constructor(e,n){this.compartment=e,this.inner=n}}class Ya{constructor(e,n,r,o,i,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=o,this.staticValues=i,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let o=[],i=Object.create(null),s=new Map;for(let f of NR(e,n,s))f instanceof tt?o.push(f):(i[f.facet.id]||(i[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of o)a[f.id]=c.length<<1,c.push(m=>f.slot(m));let d=r?.config.facets;for(let f in i){let m=i[f],p=m[0].facet,b=d&&d[f]||[];if(m.every(v=>v.type==0))if(a[p.id]=l.length<<1|1,xf(b,m))l.push(r.facet(p));else{let v=p.combine(m.map(x=>x.value));l.push(r&&p.compare(v,r.facet(p))?r.facet(p):v)}else{for(let v of m)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(x=>v.dynamicSlot(x)));a[p.id]=c.length<<1,c.push(v=>LR(v,p,m))}}let h=c.map(f=>f(a));return new Ya(e,s,h,a,l,i)}}function NR(t,e,n){let r=[[],[],[],[],[]],o=new Map;function i(s,a){let l=o.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof ou&&n.delete(s.compartment)}if(o.set(s,a),Array.isArray(s))for(let c of s)i(c,a);else if(s instanceof ou){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),i(c,a)}else if(s instanceof Db)i(s.inner,s.prec);else if(s instanceof tt)r[a].push(s),s.provides&&i(s.provides,a);else if(s instanceof Ca)r[a].push(s),s.facet.extensions&&i(s.facet.extensions,Rr.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(c,a)}}return i(t,Rr.default),r.reduce((s,a)=>s.concat(a))}function Mi(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let o=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|o}function Xa(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Ob=ne.define(),iu=ne.define({combine:t=>t.some(e=>e),static:!0}),Lb=ne.define({combine:t=>t.length?t[0]:void 0,static:!0}),Nb=ne.define(),Bb=ne.define(),Fb=ne.define(),Vb=ne.define({combine:t=>t.length?t[0]:!1});class Mn{constructor(e,n){this.type=e,this.value=n}static define(){return new BR}}class BR{of(e){return new Mn(this,e)}}class FR{constructor(e){this.map=e}of(e){return new me(this,e)}}class me{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new me(this.type,n)}is(e){return this.type==e}static define(e={}){return new FR(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let o of e){let i=o.map(n);i&&r.push(i)}return r}}me.reconfigure=me.define();me.appendConfig=me.define();class Xe{constructor(e,n,r,o,i,s){this.startState=e,this.changes=n,this.selection=r,this.effects=o,this.annotations=i,this.scrollIntoView=s,this._doc=null,this._state=null,r&&jb(r,n.newLength),i.some(a=>a.type==Xe.time)||(this.annotations=i.concat(Xe.time.of(Date.now())))}static create(e,n,r,o,i,s){return new Xe(e,n,r,o,i,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Xe.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Xe.time=Mn.define();Xe.userEvent=Mn.define();Xe.addToHistory=Mn.define();Xe.remote=Mn.define();function VR(t,e){let n=[];for(let r=0,o=0;;){let i,s;if(r<t.length&&(o==e.length||e[o]>=t[r]))i=t[r++],s=t[r++];else if(o<e.length)i=e[o++],s=e[o++];else return n;!n.length||n[n.length-1]<i?n.push(i,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function _b(t,e,n){var r;let o,i,s;return n?(o=e.changes,i=Ye.empty(e.changes.length),s=t.changes.compose(e.changes)):(o=e.changes.map(t.changes),i=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(o)),{changes:s,selection:e.selection?e.selection.map(i):(r=t.selection)===null||r===void 0?void 0:r.map(o),effects:me.mapEffects(t.effects,o).concat(me.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function su(t,e,n){let r=e.selection,o=Ao(e.annotations);return e.userEvent&&(o=o.concat(Xe.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ye?e.changes:Ye.of(e.changes||[],n,t.facet(Lb)),selection:r&&(r instanceof H?r:H.single(r.anchor,r.head)),effects:Ao(e.effects),annotations:o,scrollIntoView:!!e.scrollIntoView}}function zb(t,e,n){let r=su(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(n=!1);let s=!!e[i].sequential;r=_b(r,su(t,e[i],s?r.changes.newLength:t.doc.length),s)}let o=Xe.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return zR(n?_R(o):o)}function _R(t){let e=t.startState,n=!0;for(let o of e.facet(Nb)){let i=o(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:VR(n,i))}if(n!==!0){let o,i;if(n===!1)i=t.changes.invertedDesc,o=Ye.empty(e.doc.length);else{let s=t.changes.filter(n);o=s.changes,i=s.filtered.mapDesc(s.changes).invertedDesc}t=Xe.create(e,o,t.selection&&t.selection.map(i),me.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let r=e.facet(Bb);for(let o=r.length-1;o>=0;o--){let i=r[o](t);i instanceof Xe?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof Xe?t=i[0]:t=zb(e,Ao(i),!1)}return t}function zR(t){let e=t.startState,n=e.facet(Fb),r=t;for(let o=n.length-1;o>=0;o--){let i=n[o](t);i&&Object.keys(i).length&&(r=_b(r,su(e,i,t.changes.newLength),!0))}return r==t?t:Xe.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const HR=[];function Ao(t){return t==null?HR:Array.isArray(t)?t:[t]}var Le=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Le||(Le={}));const PR=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let au;try{au=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function WR(t){if(au)return au.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||PR.test(n)))return!0}return!1}function qR(t){return e=>{if(!/\S/.test(e))return Le.Space;if(WR(e))return Le.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Le.Word;return Le.Other}}class $e{constructor(e,n,r,o,i,s){this.config=e,this.doc=n,this.selection=r,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=i,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Mi(this,a<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Mi(this,r),Xa(this,r)}update(...e){return zb(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:o}=n;for(let a of e.effects)a.is(Ul.reconfigure)?(n&&(o=new Map,n.compartments.forEach((l,c)=>o.set(c,l)),n=null),o.set(a.value.compartment,a.value.extension)):a.is(me.reconfigure)?(n=null,r=a.value):a.is(me.appendConfig)&&(n=null,r=Ao(r).concat(a.value));let i;n?i=e.startState.values.slice():(n=Ya.resolve(r,o,this),i=new $e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(iu)?e.newSelection:e.newSelection.asSingle();new $e(n,e.newDoc,s,i,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:H.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),o=this.changes(r.changes),i=[r.range],s=Ao(r.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),d=c.map(o);for(let f=0;f<a;f++)i[f]=i[f].map(d);let h=o.mapDesc(c,!0);i.push(l.range.map(h)),o=o.compose(d),s=me.mapEffects(s,d).concat(me.mapEffects(Ao(l.effects),h))}return{changes:o,selection:H.create(i,n.mainIndex),effects:s}}changes(e=[]){return e instanceof Ye?e:Ye.of(e,this.doc.length,this.facet($e.lineSeparator))}toText(e){return ke.of(e.split(this.facet($e.lineSeparator)||eu))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Mi(this,n),Xa(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let o=e[r];o instanceof tt&&this.config.address[o.id]!=null&&(n[r]=o.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let o=[];if(r){for(let i in r)if(Object.prototype.hasOwnProperty.call(e,i)){let s=r[i],a=e[i];o.push(s.init(l=>s.spec.fromJSON(a,l)))}}return $e.create({doc:e.doc,selection:H.fromJSON(e.selection),extensions:n.extensions?o.concat([n.extensions]):o})}static create(e={}){let n=Ya.resolve(e.extensions||[],new Map),r=e.doc instanceof ke?e.doc:ke.of((e.doc||"").split(n.staticFacet($e.lineSeparator)||eu)),o=e.selection?e.selection instanceof H?e.selection:H.single(e.selection.anchor,e.selection.head):H.single(0);return jb(o,r.length),n.staticFacet(iu)||(o=o.asSingle()),new $e(n,r,o,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet($e.tabSize)}get lineBreak(){return this.facet($e.lineSeparator)||`
|
|
57
|
+
`}get readOnly(){return this.facet(Vb)}phrase(e,...n){for(let r of this.facet($e.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,o)=>{if(o=="$")return"$";let i=+(o||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let o=[];for(let i of this.facet(Ob))for(let s of i(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&o.push(s[e]);return o}charCategorizer(e){return qR(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:o}=this.doc.lineAt(e),i=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=st(n,s,!1);if(i(n.slice(l,s))!=Le.Word)break;s=l}for(;a<o;){let l=st(n,a);if(i(n.slice(a,l))!=Le.Word)break;a=l}return s==a?null:H.range(s+r,a+r)}}$e.allowMultipleSelections=iu;$e.tabSize=ne.define({combine:t=>t.length?t[0]:4});$e.lineSeparator=Lb;$e.readOnly=Vb;$e.phrases=ne.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(o=>t[o]==e[o])}});$e.languageData=Ob;$e.changeFilter=Nb;$e.transactionFilter=Bb;$e.transactionExtender=Fb;Ul.reconfigure=me.define();function En(t,e,n={}){let r={};for(let o of t)for(let i of Object.keys(o)){let s=o[i],a=r[i];if(a===void 0)r[i]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](a,s);else throw new Error("Config merge conflict for field "+i)}for(let o in e)r[o]===void 0&&(r[o]=e[o]);return r}class Hr{eq(e){return this==e}range(e,n=e){return Hi.create(e,n,this)}}Hr.prototype.startSide=Hr.prototype.endSide=0;Hr.prototype.point=!1;Hr.prototype.mapMode=gt.TrackDel;class Hi{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new Hi(e,n,r)}}function lu(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class wf{constructor(e,n,r,o){this.from=e,this.to=n,this.value=r,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,o=0){let i=r?this.to:this.from;for(let s=o,a=i.length;;){if(s==a)return s;let l=s+a>>1,c=i[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,o){for(let i=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,i);i<s;i++)if(o(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,n){let r=[],o=[],i=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],d=this.from[l]+e,h=this.to[l]+e,f,m;if(d==h){let p=n.mapPos(d,c.startSide,c.mapMode);if(p==null||(f=m=p,c.startSide!=c.endSide&&(m=n.mapPos(d,c.endSide),m<f)))continue}else if(f=n.mapPos(d,c.startSide),m=n.mapPos(h,c.endSide),f>m||f==m&&c.startSide>0&&c.endSide<=0)continue;(m-f||c.endSide-c.startSide)<0||(s<0&&(s=f),c.point&&(a=Math.max(a,m-f)),r.push(c),o.push(f-s),i.push(m-s))}return{mapped:r.length?new wf(o,i,r,a):null,pos:s}}}class Ae{constructor(e,n,r,o){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=o}static create(e,n,r,o){return new Ae(e,n,r,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:o=0,filterTo:i=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(lu)),this.isEmpty)return n.length?Ae.of(n):this;let a=new Hb(this,null,-1).goto(0),l=0,c=[],d=new qn;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let h=n[l++];d.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||o>this.chunkEnd(a.chunkIndex)||i<this.chunkPos[a.chunkIndex])&&d.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||o>a.to||i<a.from||s(a.from,a.to,a.value))&&(d.addInner(a.from,a.to,a.value)||c.push(Hi.create(a.from,a.to,a.value))),a.next());return d.finishInner(this.nextLayer.isEmpty&&!c.length?Ae.empty:this.nextLayer.update({add:c,filter:s,filterFrom:o,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],o=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],c=e.touchesRange(a,a+l.length);if(c===!1)o=Math.max(o,l.maxPoint),n.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:d,pos:h}=l.map(a,e);d&&(o=Math.max(o,d.maxPoint),n.push(d),r.push(h))}}let i=this.nextLayer.map(e);return n.length==0?i:new Ae(r,n,i||Ae.empty,o)}between(e,n,r){if(!this.isEmpty){for(let o=0;o<this.chunk.length;o++){let i=this.chunkPos[o],s=this.chunk[o];if(n>=i&&e<=i+s.length&&s.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Pi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Pi.from(e).goto(n)}static compare(e,n,r,o,i=-1){let s=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=i),a=n.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=i),l=u1(s,a,r),c=new fi(s,l,i),d=new fi(a,l,i);r.iterGaps((h,f,m)=>h1(c,h,d,f,m,o)),r.empty&&r.length==0&&h1(c,0,d,0,0,o)}static eq(e,n,r=0,o){o==null&&(o=999999999);let i=e.filter(d=>!d.isEmpty&&n.indexOf(d)<0),s=n.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(i.length!=s.length)return!1;if(!i.length)return!0;let a=u1(i,s),l=new fi(i,a,0).goto(r),c=new fi(s,a,0).goto(r);for(;;){if(l.to!=c.to||!cu(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>o)return!0;l.next(),c.next()}}static spans(e,n,r,o,i=-1){let s=new fi(e,null,i).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let d=s.activeForPoint(s.to),h=s.pointFrom<n?d.length+1:s.point.startSide<0?d.length:Math.min(d.length,l);o.point(a,c,s.point,d,h,s.pointRank),l=Math.min(s.openEnd(c),d.length)}else c>a&&(o.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new qn;for(let o of e instanceof Hi?[e]:n?UR(e):e)r.add(o.from,o.to,o.value);return r.finish()}static join(e){if(!e.length)return Ae.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let o=e[r];o!=Ae.empty;o=o.nextLayer)n=new Ae(o.chunkPos,o.chunk,n,Math.max(o.maxPoint,n.maxPoint));return n}}Ae.empty=new Ae([],[],null,-1);function UR(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(lu(e,r)>0)return t.slice().sort(lu);e=r}return t}Ae.empty.nextLayer=Ae.empty;class qn{finishChunk(e){this.chunks.push(new wf(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new qn)).add(e,n,r)}addInner(e,n,r){let o=e-this.lastTo||r.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return o<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Ae.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Ae.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function u1(t,e,n){let r=new Map;for(let i of t)for(let s=0;s<i.chunk.length;s++)i.chunk[s].maxPoint<=0&&r.set(i.chunk[s],i.chunkPos[s]);let o=new Set;for(let i of e)for(let s=0;s<i.chunk.length;s++){let a=r.get(i.chunk[s]);a!=null&&(n?n.mapPos(a):a)==i.chunkPos[s]&&!n?.touchesRange(a,a+i.chunk[s].length)&&o.add(i.chunk[s])}return o}class Hb{constructor(e,n,r,o=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=o}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let o=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(o)||this.layer.chunkEnd(this.chunkIndex)<e||o.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let o=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<o)&&this.setRangeIndex(o)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Pi{constructor(e){this.heap=e}static from(e,n=null,r=-1){let o=[];for(let i=0;i<e.length;i++)for(let s=e[i];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&o.push(new Hb(s,n,r,i));return o.length==1?o[0]:new Pi(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Wc(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Wc(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Wc(this.heap,0)}}}function Wc(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let o=t[r];if(r+1<t.length&&o.compare(t[r+1])>=0&&(o=t[r+1],r++),n.compare(o)<0)break;t[r]=n,t[e]=o,e=r}}class fi{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pi.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Xs(this.active,e),Xs(this.activeTo,e),Xs(this.activeRank,e),this.minActive=f1(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:o,rank:i}=this.cursor;for(;n<this.activeRank.length&&(i-this.activeRank[n]||o-this.activeTo[n])>0;)n++;Qs(this.active,n,r),Qs(this.activeTo,n,o),Qs(this.activeRank,n,i),e&&Qs(e,n,this.cursor.from),this.minActive=f1(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),r&&Xs(r,o)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let o=r.length-1;o>=0&&r[o]<e;o--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function h1(t,e,n,r,o,i){t.goto(e),n.goto(r);let s=r+o,a=r,l=r-e;for(;;){let c=t.to+l-n.to,d=c||t.endSide-n.endSide,h=d<0?t.to+l:n.to,f=Math.min(h,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&cu(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(a,f,t.point,n.point):f>a&&!cu(t.active,n.active)&&i.compareRange(a,f,t.active,n.active),h>s)break;(c||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(h),a=h,d<=0&&t.next(),d>=0&&n.next()}}function cu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Xs(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Qs(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function f1(t,e){let n=-1,r=1e9;for(let o=0;o<e.length;o++)(e[o]-r||t[o].endSide-t[n].endSide)<0&&(n=o,r=e[o]);return n}function ri(t,e,n=t.length){let r=0;for(let o=0;o<n&&o<t.length;)t.charCodeAt(o)==9?(r+=e-r%e,o++):(r++,o=st(t,o));return r}function du(t,e,n,r){for(let o=0,i=0;;){if(i>=e)return o;if(o==t.length)break;i+=t.charCodeAt(o)==9?n-i%n:1,o=st(t,o)}return r===!0?-1:t.length}const uu="ͼ",m1=typeof Symbol>"u"?"__"+uu:Symbol.for(uu),hu=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),g1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class fr{constructor(e,n){this.rules=[];let{finish:r}=n||{};function o(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function i(s,a,l,c){let d=[],h=/^@(\w+)\b/.exec(s[0]),f=h&&h[1]=="keyframes";if(h&&a==null)return l.push(s[0]+";");for(let m in a){let p=a[m];if(/&/.test(m))i(m.split(/,\s*/).map(b=>s.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),p,l);else if(p&&typeof p=="object"){if(!h)throw new RangeError("The value of a property ("+m+") should be a primitive value.");i(o(m),p,d,f)}else p!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+p+";")}(d.length||f)&&l.push((r&&!h&&!c?s.map(r):s).join(", ")+" {"+d.join(" ")+"}")}for(let s in e)i(o(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
|
58
58
|
`)}static newName(){let e=g1[m1]||1;return g1[m1]=e+1,uu+e.toString(36)}static mount(e,n,r){let o=e[hu],i=r&&r.nonce;o?i&&o.setNonce(i):o=new KR(e,i),o.mount(Array.isArray(n)?n:[n],e)}}let p1=new Map;class KR{constructor(e,n){let r=e.ownerDocument||e,o=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let i=p1.get(r);if(i)return e[hu]=i;this.sheet=new o.CSSStyleSheet,p1.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[hu]=this}mount(e,n){let r=this.sheet,o=0,i=0;for(let s=0;s<e.length;s++){let a=e[s],l=this.modules.indexOf(a);if(l<i&&l>-1&&(this.modules.splice(l,1),i--,l=-1),l==-1){if(this.modules.splice(i++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],o++)}else{for(;i<l;)o+=this.modules[i++].rules.length;o+=a.rules.length,i++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
|
59
|
-
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var mr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Wi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},GR=typeof navigator<"u"&&/Mac/.test(navigator.platform),YR=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ot=0;ot<10;ot++)mr[48+ot]=mr[96+ot]=String(ot);for(var ot=1;ot<=24;ot++)mr[ot+111]="F"+ot;for(var ot=65;ot<=90;ot++)mr[ot]=String.fromCharCode(ot+32),Wi[ot]=String.fromCharCode(ot);for(var qc in mr)Wi.hasOwnProperty(qc)||(Wi[qc]=mr[qc]);function XR(t){var e=GR&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||YR&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Wi:mr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Me(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];typeof o=="string"?t.setAttribute(r,o):o!=null&&(t[r]=o)}e++}for(;e<arguments.length;e++)Pb(t,arguments[e]);return t}function Pb(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)Pb(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}function qi(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function fu(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function $a(t,e){if(!e.anchorNode)return!1;try{return fu(t,e.anchorNode)}catch{return!1}}function _o(t){return t.nodeType==3?Wr(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Ei(t,e,n,r){return n?b1(t,e,n,r,-1)||b1(t,e,n,r,1):!1}function Pr(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Qa(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function b1(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:$n(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Pr(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=o<0?$n(t):0}else return!1}}function $n(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ms(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function QR(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Wb(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function ZR(t,e,n,r,o,i,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let d=t,h=!1;d&&!h;)if(d.nodeType==1){let f,m=d==l.body,b=1,p=1;if(m)f=QR(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(h=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let y=d.getBoundingClientRect();({scaleX:b,scaleY:p}=Wb(d,y)),f={left:y.left,right:y.left+d.clientWidth*b,top:y.top,bottom:y.top+d.clientHeight*p}}let v=0,x=0;if(o=="nearest")e.top<f.top?(x=e.top-(f.top+s),n>0&&e.bottom>f.bottom+x&&(x=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(x=e.bottom-f.bottom+s,n<0&&e.top-x<f.top&&(x=e.top-(f.top+s)));else{let y=e.bottom-e.top,$=f.bottom-f.top;x=(o=="center"&&y<=$?e.top+y/2-$/2:o=="start"||o=="center"&&n<0?e.top-s:e.bottom-$+s)-f.top}if(r=="nearest"?e.left<f.left?(v=e.left-(f.left+i),n>0&&e.right>f.right+v&&(v=e.right-f.right+i)):e.right>f.right&&(v=e.right-f.right+i,n<0&&e.left<f.left+v&&(v=e.left-(f.left+i))):v=(r=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:r=="start"==a?e.left-i:e.right-(f.right-f.left)+i)-f.left,v||x)if(m)c.scrollBy(v,x);else{let y=0,$=0;if(x){let S=d.scrollTop;d.scrollTop+=x/p,$=(d.scrollTop-S)*p}if(v){let S=d.scrollLeft;d.scrollLeft+=v/b,y=(d.scrollLeft-S)*b}e={left:e.left-y,top:e.top-$,right:e.right-y,bottom:e.bottom-$},y&&Math.abs(y-v)<1&&(r="nearest"),$&&Math.abs($-x)<1&&(o="nearest")}if(m)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function JR(t){let e=t.ownerDocument,n,r;for(let o=t.parentNode;o&&!(o==e.body||n&&r);)if(o.nodeType==1)!r&&o.scrollHeight>o.clientHeight&&(r=o),!n&&o.scrollWidth>o.clientWidth&&(n=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:n,y:r}}class eM{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?$n(n):0),r,Math.min(e.focusOffset,r?$n(r):0))}set(e,n,r,o){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=o}}let ho=null;function qb(t){if(t.setActive)return t.setActive();if(ho)return t.focus(ho);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ho==null?{get preventScroll(){return ho={preventScroll:!0},!0}}:void 0),!ho){ho=!1;for(let n=0;n<e.length;){let r=e[n++],o=e[n++],i=e[n++];r.scrollTop!=o&&(r.scrollTop=o),r.scrollLeft!=i&&(r.scrollLeft=i)}}}let v1;function Wr(t,e,n=e){let r=v1||(v1=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function ko(t,e,n,r){let o={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=r);let i=new KeyboardEvent("keydown",o);i.synthetic=!0,t.dispatchEvent(i);let s=new KeyboardEvent("keyup",o);return s.synthetic=!0,t.dispatchEvent(s),i.defaultPrevented||s.defaultPrevented}function tM(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Ub(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function nM(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,$n(n));;)if(r){if(n.nodeType!=1)return!1;let o=n.childNodes[r-1];o.contentEditable=="false"?r--:(n=o,r=$n(n))}else{if(n==t)return!0;r=Pr(n),n=n.parentNode}}function Kb(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Gb(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=$n(n)}else if(n.parentNode&&!Qa(n))r=Pr(n),n=n.parentNode;else return null}}function Yb(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Qa(n))r=Pr(n)+1,n=n.parentNode;else return null}}class dt{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new dt(e.parentNode,Pr(e),n)}static after(e,n){return new dt(e.parentNode,Pr(e)+1,n)}}const yf=[];class Ie{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,o=null,i;for(let s of this.children){if(s.flags&7){if(!s.dom&&(i=o?o.nextSibling:r.firstChild)){let a=Ie.get(i);(!a||!a.parent&&a.canReuseDOM(s))&&s.reuseDOM(i)}s.sync(e,n),s.flags&=-8}if(i=o?o.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&i!=s.dom&&(n.written=!0),s.dom.parentNode==r)for(;i&&i!=s.dom;)i=x1(i);else r.insertBefore(s.dom,i);o=s.dom}for(i=o?o.nextSibling:r.firstChild,i&&n&&n.node==r&&(n.written=!0);i;)i=x1(i)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let o=$n(e)==0?0:n==0?-1:1;for(;;){let i=e.parentNode;if(i==this.dom)break;o==0&&i.firstChild!=i.lastChild&&(e==i.firstChild?o=-1:o=1),e=i}o<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!Ie.get(r);)r=r.nextSibling;if(!r)return this.length;for(let o=0,i=0;;o++){let s=this.children[o];if(s.dom==r)return i;i+=s.length+s.breakAfter}}domBoundsAround(e,n,r=0){let o=-1,i=-1,s=-1,a=-1;for(let l=0,c=r,d=r;l<this.children.length;l++){let h=this.children[l],f=c+h.length;if(c<e&&f>n)return h.domBoundsAround(e,n,c);if(f>=e&&o==-1&&(o=l,i=c),c>n&&h.dom.parentNode==this.dom){s=l,a=d;break}d=f,c=f+h.breakAfter}return{from:i,to:a<0?r+this.length:a,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s<this.children.length&&s>=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=yf){this.markDirty();for(let o=e;o<n;o++){let i=this.children[o];i.parent==this&&r.indexOf(i)<0&&i.destroy()}r.length<250?this.children.splice(e,n-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(n));for(let o=0;o<r.length;o++)r[o].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Xb(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,o,i,s){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}Ie.prototype.breakAfter=0;function x1(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Xb{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Qb(t,e,n,r,o,i,s,a,l){let{children:c}=t,d=c.length?c[e]:null,h=i.length?i[i.length-1]:null,f=h?h.breakAfter:s;if(!(e==r&&d&&!s&&!f&&i.length<2&&d.merge(n,o,i.length?h:null,n==0,a,l))){if(r<c.length){let m=c[r];m&&(o<m.length||m.breakAfter&&h?.breakAfter)?(e==r&&(m=m.split(o),o=0),!f&&h&&m.merge(0,o,h,!0,0,l)?i[i.length-1]=m:((o||m.children.length&&!m.children[0].length)&&m.merge(0,o,null,!1,0,l),i.push(m))):m?.breakAfter&&(h?h.breakAfter=1:s=1),r++}for(d&&(d.breakAfter=s,n>0&&(!s&&i.length&&d.merge(n,d.length,i[0],!1,a,0)?d.breakAfter=i.shift().breakAfter:(n<d.length||d.children.length&&d.children[d.children.length-1].length==0)&&d.merge(n,d.length,null,!1,a,0),e++));e<r&&i.length;)if(c[r-1].become(i[i.length-1]))r--,i.pop(),l=i.length?0:a;else if(c[e].become(i[0]))e++,i.shift(),a=i.length?0:l;else break;!i.length&&e&&r<c.length&&!c[e-1].breakAfter&&c[r].merge(0,0,c[e-1],!1,a,l)&&e--,(e<r||i.length)&&t.replaceChildren(e,r,i)}}function Zb(t,e,n,r,o,i){let s=t.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:d}=s.findPos(e,-1),h=e-n;for(let f of r)h+=f.length;t.length+=h,Qb(t,c,d,a,l,r,0,o,i)}let wt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},mu=typeof document<"u"?document:{documentElement:{style:{}}};const gu=/Edge\/(\d+)/.exec(wt.userAgent),Jb=/MSIE \d/.test(wt.userAgent),pu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wt.userAgent),Kl=!!(Jb||pu||gu),w1=!Kl&&/gecko\/(\d+)/i.test(wt.userAgent),Uc=!Kl&&/Chrome\/(\d+)/.exec(wt.userAgent),rM="webkitFontSmoothing"in mu.documentElement.style,e5=!Kl&&/Apple Computer/.test(wt.vendor),y1=e5&&(/Mobile\/\w+/.test(wt.userAgent)||wt.maxTouchPoints>2);var te={mac:y1||/Mac/.test(wt.platform),windows:/Win/.test(wt.platform),linux:/Linux|X11/.test(wt.platform),ie:Kl,ie_version:Jb?mu.documentMode||6:pu?+pu[1]:gu?+gu[1]:0,gecko:w1,gecko_version:w1?+(/Firefox\/(\d+)/.exec(wt.userAgent)||[0,0])[1]:0,chrome:!!Uc,chrome_version:Uc?+Uc[1]:0,ios:y1,android:/Android\b/.test(wt.userAgent),safari:e5,webkit_version:rM?+(/\bAppleWebKit\/(\d+)/.exec(wt.userAgent)||[0,0])[1]:0,tabSize:mu.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const oM=256;class Zt extends Ie{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Zt)||this.length-(n-e)+r.length>oM||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Zt(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new dt(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return iM(this.dom,e,n)}}class Un extends Ie{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let o of n)o.setParent(this)}setAttrs(e){if(Ub(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,o,i,s){return r&&(!(r instanceof Un&&r.mark.eq(this.mark))||e&&i<=0||n<this.length&&s<=0)?!1:(Zb(this,e,n,r?r.children.slice():[],i-1,s-1),this.markDirty(),!0)}split(e){let n=[],r=0,o=-1,i=0;for(let a of this.children){let l=r+a.length;l>e&&n.push(r<e?a.split(e-r):a),o<0&&r>=e&&(o=i),r=l,i++}let s=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new Un(this.mark,n,s)}domAtPos(e){return t5(this,e)}coordsAt(e,n){return r5(this,e,n)}}function iM(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let o=e,i=e,s=0;e==0&&n<0||e==r&&n>=0?te.chrome||te.gecko||(e?(o--,s=1):i<r&&(i++,s=-1)):n<0?o--:i<r&&i++;let a=Wr(t,o,i).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return te.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?ms(l,s<0):l||null}class ir extends Ie{static create(e,n,r){return new ir(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=ir.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,o,i,s){return r&&(!(r instanceof ir)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof ir&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return ke.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,o=this.posAtStart;return r?r.slice(o,o+this.length):ke.empty}domAtPos(e){return(this.length?e==0:this.side>0)?dt.before(this.dom):dt.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let o=this.dom.getClientRects(),i=null;if(!o.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?o.length-1:0;i=o[a],!(e>0?a==0:a==o.length-1||i.top<i.bottom);a+=s?-1:1);return ms(i,!s)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class zo extends Ie{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof zo&&e.side==this.side}split(){return new zo(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?dt.before(this.dom):dt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ke.empty}get isHidden(){return!0}}Zt.prototype.children=ir.prototype.children=zo.prototype.children=yf;function t5(t,e){let n=t.dom,{children:r}=t,o=0;for(let i=0;o<r.length;o++){let s=r[o],a=i+s.length;if(!(a==i&&s.getSide()<=0)){if(e>i&&e<a&&s.dom.parentNode==n)return s.domAtPos(e-i);if(e<=i)break;i=a}}for(let i=o;i>0;i--){let s=r[i-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let i=o;i<r.length;i++){let s=r[i];if(s.dom.parentNode==n)return s.domAtPos(0)}return new dt(n,0)}function n5(t,e,n){let r,{children:o}=t;n>0&&e instanceof Un&&o.length&&(r=o[o.length-1])instanceof Un&&r.mark.eq(e.mark)?n5(r,e.children[0],n-1):(o.push(e),e.setParent(t)),t.length+=e.length}function r5(t,e,n){let r=null,o=-1,i=null,s=-1;function a(c,d){for(let h=0,f=0;h<c.children.length&&f<=d;h++){let m=c.children[h],b=f+m.length;b>=d&&(m.children.length?a(m,d-f):(!i||i.isHidden&&(n>0||aM(i,m)))&&(b>d||f==b&&m.getSide()>0)?(i=m,s=d-f):(f<d||f==b&&m.getSide()<0&&!m.isHidden)&&(r=m,o=d-f)),f=b}}a(t,e);let l=(n<0?r:i)||r||i;return l?l.coordsAt(Math.max(0,l==r?o:s),n):sM(t)}function sM(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=_o(e);return n[n.length-1]||null}function aM(t,e){let n=t.coordsAt(0,1),r=e.coordsAt(0,1);return n&&r&&r.top<n.bottom}function bu(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const C1=Object.create(null);function Za(t,e,n){if(t==e)return!0;t||(t=C1),e||(e=C1);let r=Object.keys(t),o=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=o.length-(n&&o.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(o.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function vu(t,e,n){let r=!1;if(e)for(let o in e)n&&o in n||(r=!0,o=="style"?t.style.cssText="":t.removeAttribute(o));if(n)for(let o in n)e&&e[o]==n[o]||(r=!0,o=="style"?t.style.cssText=n[o]:t.setAttribute(o,n[o]));return r}function lM(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Qn{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var pt=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(pt||(pt={}));class ae extends Hr{constructor(e,n,r,o){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=o}get heightRelevant(){return!1}static mark(e){return new gs(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new gr(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,o;if(e.isBlockGap)r=-5e8,o=4e8;else{let{start:i,end:s}=o5(e,n);r=(i?n?-3e8:-1:5e8)-1,o=(s?n?2e8:1:-6e8)+1}return new gr(e,r,o,n,e.widget||null,!0)}static line(e){return new ps(e)}static set(e,n=!1){return Ae.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ae.none=Ae.empty;class gs extends ae{constructor(e){let{start:n,end:r}=o5(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof gs&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Za(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}gs.prototype.point=!1;class ps extends ae{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ps&&this.spec.class==e.spec.class&&Za(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}ps.prototype.mapMode=gt.TrackBefore;ps.prototype.point=!0;class gr extends ae{constructor(e,n,r,o,i,s){super(n,r,i,e),this.block=o,this.isReplace=s,this.mapMode=o?n<=0?gt.TrackBefore:gt.TrackAfter:gt.TrackDel}get type(){return this.startSide!=this.endSide?pt.WidgetRange:this.startSide<=0?pt.WidgetBefore:pt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof gr&&cM(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}gr.prototype.point=!0;function o5(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function cM(t,e){return t==e||!!(t&&e&&t.compare(e))}function Sa(t,e,n,r=0){let o=n.length-1;o>=0&&n[o]+r>=t?n[o]=Math.max(n[o],e):n.push(t,e)}class Ue extends Ie{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,o,i,s){if(r){if(!(r instanceof Ue))return!1;this.dom||r.transferDOM(this)}return o&&this.setDeco(r?r.attrs:null),Zb(this,e,n,r?r.children.slice():[],i,s),!0}split(e){let n=new Ue;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:o}=this.childPos(e);o&&(n.append(this.children[r].split(o),0),this.children[r].merge(o,this.children[r].length,null,!1,0,0),r++);for(let i=r;i<this.children.length;i++)n.append(this.children[i],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Za(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){n5(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=bu(n,this.attrs||{})),r&&(this.attrs=bu({class:r},this.attrs||{}))}domAtPos(e){return t5(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(Ub(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(vu(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let o=this.dom.lastChild;for(;o&&Ie.get(o)instanceof Un;)o=o.lastChild;if(!o||!this.length||o.nodeName!="BR"&&((r=Ie.get(o))===null||r===void 0?void 0:r.isEditable)==!1&&(!te.ios||!this.children.some(i=>i instanceof Zt))){let i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Zt)||/[^ -~]/.test(r.text))return null;let o=_o(r.dom);if(o.length!=1)return null;e+=o[0].width,n=o[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=r5(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:o}=this.parent.view.viewState,i=r.bottom-r.top;if(Math.abs(i-o.lineHeight)<2&&o.textHeight<i){let s=(i-o.textHeight)/2;return{top:r.top+s,bottom:r.bottom-s,left:r.left,right:r.left}}}return r}become(e){return e instanceof Ue&&this.children.length==0&&e.children.length==0&&Za(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,n){for(let r=0,o=0;r<e.children.length;r++){let i=e.children[r],s=o+i.length;if(s>=n){if(i instanceof Ue)return i;if(s>n)break}o=s+i.breakAfter}return null}}class zn extends Ie{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,o,i,s){return r&&(!(r instanceof zn)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?dt.before(this.dom):dt.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new zn(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return yf}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):ke.empty}domBoundsAround(){return null}become(e){return e instanceof zn&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);return r||(this.widget instanceof xu?null:ms(this.dom.getBoundingClientRect(),this.length?e==0:n<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class xu extends Qn{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Ii{constructor(e,n,r,o){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=o,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof zn&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ue),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Zs(new zo(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof zn)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=i,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(Zs(new Zt(this.text.slice(this.textOff,this.textOff+o)),n),r),this.atCursorPos=!0,this.textOff+=o,e-=o,r=0}}span(e,n,r,o){this.buildText(n-e,r,o),this.pos=n,this.openStart<0&&(this.openStart=o)}point(e,n,r,o,i,s){if(this.disallowBlockEffectsFor[s]&&r instanceof gr){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof gr)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new zn(r.widget||Ho.block,a,r));else{let l=ir.create(r.widget||Ho.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&i<=o.length&&(e<n||r.startSide>0),d=!l.isEditable&&(e<n||i>o.length||r.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(o),c&&(h.append(Zs(new zo(1),o),i),i=o.length+Math.max(0,i-o.length)),h.append(Zs(l,o),i),this.atCursorPos=d,this.pendingBuffer=d?e<n||i>o.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,o,i){let s=new Ii(e,n,r,i);return s.openEnd=Ae.spans(o,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function Zs(t,e){for(let n of e)t=new Un(n,[t],t.length);return t}class Ho extends Qn{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ho.inline=new Ho("span");Ho.block=new Ho("div");var Oe=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(Oe||(Oe={}));const qr=Oe.LTR,Cf=Oe.RTL;function i5(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const dM=i5("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),uM=i5("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),wu=Object.create(null),ln=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);wu[e]=n,wu[n]=-e}function s5(t){return t<=247?dM[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?uM[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const hM=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class sr{get dir(){return this.level%2?Cf:qr}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,o){let i=-1;for(let s=0;s<e.length;s++){let a=e[s];if(a.from<=n&&a.to>=n){if(a.level==r)return s;(i<0||(o!=0?o<0?a.from<n:a.to>n:e[i].level>a.level))&&(i=s)}}if(i<0)throw new RangeError("Index out of range");return i}}function a5(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!a5(r.inner,o.inner))return!1}return!0}const Ee=[];function fM(t,e,n,r,o){for(let i=0;i<=r.length;i++){let s=i?r[i-1].to:e,a=i<r.length?r[i].from:n,l=i?256:o;for(let c=s,d=l,h=l;c<a;c++){let f=s5(t.charCodeAt(c));f==512?f=d:f==8&&h==4&&(f=16),Ee[c]=f==4?2:f,f&7&&(h=f),d=f}for(let c=s,d=l,h=l;c<a;c++){let f=Ee[c];if(f==128)c<a-1&&d==Ee[c+1]&&d&24?f=Ee[c]=d:Ee[c]=256;else if(f==64){let m=c+1;for(;m<a&&Ee[m]==64;)m++;let b=c&&d==8||m<n&&Ee[m]==8?h==1?1:8:256;for(let p=c;p<m;p++)Ee[p]=b;c=m-1}else f==8&&h==1&&(Ee[c]=1);d=f,f&7&&(h=f)}}}function mM(t,e,n,r,o){let i=o==1?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let c=s?r[s-1].to:e,d=s<r.length?r[s].from:n;for(let h=c,f,m,b;h<d;h++)if(m=wu[f=t.charCodeAt(h)])if(m<0){for(let p=a-3;p>=0;p-=3)if(ln[p+1]==-m){let v=ln[p+2],x=v&2?o:v&4?v&1?i:o:0;x&&(Ee[h]=Ee[ln[p]]=x),a=p;break}}else{if(ln.length==189)break;ln[a++]=h,ln[a++]=f,ln[a++]=l}else if((b=Ee[h])==2||b==1){let p=b==o;l=p?0:1;for(let v=a-3;v>=0;v-=3){let x=ln[v+2];if(x&2)break;if(p)ln[v+2]|=2;else{if(x&4)break;ln[v+2]|=4}}}}}function gM(t,e,n,r){for(let o=0,i=r;o<=n.length;o++){let s=o?n[o-1].to:t,a=o<n.length?n[o].from:e;for(let l=s;l<a;){let c=Ee[l];if(c==256){let d=l+1;for(;;)if(d==a){if(o==n.length)break;d=n[o++].to,a=o<n.length?n[o].from:e}else if(Ee[d]==256)d++;else break;let h=i==1,f=(d<e?Ee[d]:r)==1,m=h==f?h?1:2:r;for(let b=d,p=o,v=p?n[p-1].to:t;b>l;)b==v&&(b=n[--p].from,v=p?n[p-1].to:t),Ee[--b]=m;l=d}else i=c,l++}}}function yu(t,e,n,r,o,i,s){let a=r%2?2:1;if(r%2==o%2)for(let l=e,c=0;l<n;){let d=!0,h=!1;if(c==i.length||l<i[c].from){let p=Ee[l];p!=a&&(d=!1,h=p==16)}let f=!d&&a==1?[]:null,m=d?r:r+1,b=l;e:for(;;)if(c<i.length&&b==i[c].from){if(h)break e;let p=i[c];if(!d)for(let v=p.to,x=c+1;;){if(v==n)break e;if(x<i.length&&i[x].from==v)v=i[x++].to;else{if(Ee[v]==a)break e;break}}if(c++,f)f.push(p);else{p.from>l&&s.push(new sr(l,p.from,m));let v=p.direction==qr!=!(m%2);Cu(t,v?r+1:r,o,p.inner,p.from,p.to,s),l=p.to}b=p.to}else{if(b==n||(d?Ee[b]!=a:Ee[b]==a))break;b++}f?yu(t,l,b,r+1,o,f,s):l<b&&s.push(new sr(l,b,m)),l=b}else for(let l=n,c=i.length;l>e;){let d=!0,h=!1;if(!c||l>i[c-1].to){let p=Ee[l-1];p!=a&&(d=!1,h=p==16)}let f=!d&&a==1?[]:null,m=d?r:r+1,b=l;e:for(;;)if(c&&b==i[c-1].to){if(h)break e;let p=i[--c];if(!d)for(let v=p.from,x=c;;){if(v==e)break e;if(x&&i[x-1].to==v)v=i[--x].from;else{if(Ee[v-1]==a)break e;break}}if(f)f.push(p);else{p.to<l&&s.push(new sr(p.to,l,m));let v=p.direction==qr!=!(m%2);Cu(t,v?r+1:r,o,p.inner,p.from,p.to,s),l=p.from}b=p.from}else{if(b==e||(d?Ee[b-1]!=a:Ee[b-1]==a))break;b--}f?yu(t,b,l,r+1,o,f,s):b<l&&s.push(new sr(b,l,m)),l=b}}function Cu(t,e,n,r,o,i,s){let a=e%2?2:1;fM(t,o,i,r,a),mM(t,o,i,r,a),gM(o,i,r,a),yu(t,o,i,e,n,r,s)}function pM(t,e,n){if(!t)return[new sr(0,0,e==Cf?1:0)];if(e==qr&&!n.length&&!hM.test(t))return l5(t.length);if(n.length)for(;t.length>Ee.length;)Ee[Ee.length]=256;let r=[],o=e==qr?0:1;return Cu(t,o,o,n,0,t.length,r),r}function l5(t){return[new sr(0,t,0)]}let c5="";function bM(t,e,n,r,o){var i;let s=r.head-t.from,a=sr.find(e,s,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),l=e[a],c=l.side(o,n);if(s==c){let f=a+=o?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],s=l.side(!o,n),c=l.side(o,n)}let d=st(t.text,s,l.forward(o,n));(d<l.from||d>l.to)&&(d=c),c5=t.text.slice(Math.min(s,d),Math.max(s,d));let h=a==(o?e.length-1:0)?null:e[a+(o?1:-1)];return h&&d==c&&h.level+(o?0:1)<l.level?H.cursor(h.side(!o,n)+t.from,h.forward(o,n)?1:-1,h.level):H.cursor(d+t.from,l.forward(o,n)?-1:1,l.level)}function vM(t,e,n){for(let r=e;r<n;r++){let o=s5(t.charCodeAt(r));if(o==1)return qr;if(o==2||o==4)return Cf}return qr}const d5=ne.define(),u5=ne.define(),h5=ne.define(),f5=ne.define(),$u=ne.define(),m5=ne.define(),g5=ne.define(),$f=ne.define(),Sf=ne.define(),p5=ne.define({combine:t=>t.some(e=>e)}),b5=ne.define({combine:t=>t.some(e=>e)}),v5=ne.define();class To{constructor(e,n="nearest",r="nearest",o=5,i=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=o,this.xMargin=i,this.isSnapshot=s}map(e){return e.empty?this:new To(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new To(H.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Js=me.define({map:(t,e)=>t.map(e)}),x5=me.define();function Ct(t,e,n){let r=t.facet(f5);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Fn=ne.define({combine:t=>t.length?t[0]:!0});let xM=0;const go=ne.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class We{constructor(e,n,r,o,i){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=o,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(go.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(go.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:o,provide:i,decorations:s}=n||{};return new We(xM++,e,r,o,a=>{let l=[];return s&&l.push(Ui.of(c=>{let d=c.plugin(a);return d?s(d):ae.none})),i&&l.push(i(a)),l})}static fromClass(e,n){return We.define((r,o)=>new e(r,o),n)}}class Kc{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Ct(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Ct(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Ct(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const w5=ne.define(),Af=ne.define(),Ui=ne.define(),y5=ne.define(),kf=ne.define(),C5=ne.define();function $1(t,e){let n=t.state.facet(C5);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),o=[];return Ae.spans(r,e.from,e.to,{point(){},span(i,s,a,l){let c=i-e.from,d=s-e.from,h=o;for(let f=a.length-1;f>=0;f--,l--){let m=a[f].spec.bidiIsolate,b;if(m==null&&(m=vM(e.text,c,d)),l>0&&h.length&&(b=h[h.length-1]).to==c&&b.direction==m)b.to=d,h=b.inner;else{let p={from:c,to:d,direction:m,inner:[]};h.push(p),h=p.inner}}}}),o}const $5=ne.define();function Tf(t){let e=0,n=0,r=0,o=0;for(let i of t.state.facet($5)){let s=i(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(o=Math.max(o,s.bottom)))}return{left:e,right:n,top:r,bottom:o}}const $i=ne.define();class Vt{constructor(e,n,r,o){this.fromA=e,this.toA=n,this.fromB=r,this.toB=o}join(e){return new Vt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let o=e[n-1];if(!(o.fromA>r.toA)){if(o.toA<r.fromA)break;r=r.join(o),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let o=0,i=0,s=0,a=0;;o++){let l=o==e.length?null:e[o],c=s-a,d=l?l.fromB:1e9;for(;i<n.length&&n[i]<d;){let h=n[i],f=n[i+1],m=Math.max(a,h),b=Math.min(d,f);if(m<=b&&new Vt(m+c,b+c,m,b).addToSet(r),f>d)break;i+=2}if(!l)return r;new Vt(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class Ja{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Ye.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let o=[];this.changes.iterChangedRanges((i,s,a,l)=>o.push(new Vt(i,s,a,l))),this.changedRanges=o}static create(e,n,r){return new Ja(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class S1 extends Ie{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=ae.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Ue],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Vt(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:d})=>d<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let o=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?o=this.domChanged.newSel.head:!kM(e.changes,this.hasComposition)&&!e.selectionSet&&(o=e.state.selection.main.head));let i=o>-1?yM(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:d}=this.hasComposition;r=new Vt(c,d,e.changes.mapPos(c,-1),e.changes.mapPos(d,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(te.ie||te.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=SM(s,a,e.changes);return r=Vt.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:o}=this.view;o.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=te.chrome||te.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||o.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.children)s instanceof zn&&s.widget instanceof xu&&i.push(s.dom);o.updateGaps(i)}updateChildren(e,n,r){let o=r?r.range.addToSet(e.slice()):e,i=this.childCursor(n);for(let s=o.length-1;;s--){let a=s>=0?o[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:d,toB:h}=a,f,m,b,p;if(r&&r.range.fromB<h&&r.range.toB>d){let S=Ii.build(this.view.state.doc,d,r.range.fromB,this.decorations,this.dynamicDecorationMap),A=Ii.build(this.view.state.doc,r.range.toB,h,this.decorations,this.dynamicDecorationMap);m=S.breakAtStart,b=S.openStart,p=A.openEnd;let k=this.compositionView(r);A.breakAtStart?k.breakAfter=1:A.content.length&&k.merge(k.length,k.length,A.content[0],!1,A.openStart,0)&&(k.breakAfter=A.content[0].breakAfter,A.content.shift()),S.content.length&&k.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),f=S.content.concat(k).concat(A.content)}else({content:f,breakAtStart:m,openStart:b,openEnd:p}=Ii.build(this.view.state.doc,d,h,this.decorations,this.dynamicDecorationMap));let{i:v,off:x}=i.findPos(c,1),{i:y,off:$}=i.findPos(l,-1);Qb(this,y,$,v,x,f,m,b,p)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(x5)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Zt(e.text.nodeValue);n.flags|=8;for(let{deco:o}of e.marks)n=new Un(o,[n],n.length);let r=new Ue;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Ie.get(i);a&&a!=s&&(a.dom=null),s.setDOM(i)},r=this.childPos(e.range.fromB,1),o=this.children[r.i];n(e.line,o);for(let i=e.marks.length-1;i>=-1;i--)r=o.childPos(r.off,1),o=o.children[r.i],n(i>=0?e.marks[i].node:e.text,o)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,o=r==this.dom,i=!o&&!(this.view.state.facet(Fn)||this.dom.tabIndex>-1)&&$a(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(o||n||i))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(te.gecko&&a.empty&&!this.hasComposition&&wM(l)){let h=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(h,l.node.childNodes[l.offset]||null)),l=c=new dt(h,0),s=!0}let d=this.view.observer.selectionRange;(s||!d.focusNode||(!Ei(l.node,l.offset,d.anchorNode,d.anchorOffset)||!Ei(c.node,c.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,a))&&(this.view.observer.ignore(()=>{te.android&&te.chrome&&this.dom.contains(d.focusNode)&&AM(d.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=qi(this.view.root);if(h)if(a.empty){if(te.gecko){let f=CM(l.node,l.offset);if(f&&f!=3){let m=(f==1?Gb:Yb)(l.node,l.offset);m&&(l=new dt(m.node,m.offset))}}h.collapse(l.node,l.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(l.node,l.offset);try{h.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(f)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new dt(d.anchorNode,d.anchorOffset),this.impreciseHead=c.precise?null:new dt(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Ei(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=qi(e.root),{anchorNode:o,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=Ue.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let d=this.domAtPos(n.head+n.assoc);r.collapse(d.node,d.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=n.from&&r.collapse(o,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let o=e.offset;!r&&o<n.childNodes.length;o++){let i=Ie.get(n.childNodes[o]);i instanceof Ue&&(r=i.domAtPos(0))}for(let o=e.offset-1;!r&&o>=0;o--){let i=Ie.get(n.childNodes[o]);i instanceof Ue&&(r=i.domAtPos(i.length))}return r?new dt(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Ie.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let o=this.children[n];if(r<o.length||o instanceof Ue)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,o=0;for(let i=this.length,s=this.children.length-1;s>=0;s--){let a=this.children[s],l=i-a.breakAfter,c=l-a.length;if(l<e)break;if(c<=e&&(c<e||a.covers(-1))&&(l>e||a.covers(1))&&(!r||a instanceof Ue&&!(r instanceof Ue&&n>=0)))r=a,o=c;else if(r&&c==e&&l==e&&a instanceof zn&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(r=null)}i=c}return r?r.coordsAt(e-o,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),o=this.children[n];if(!(o instanceof Ue))return null;for(;o.children.length;){let{i:a,off:l}=o.childPos(r,1);for(;;a++){if(a==o.children.length)return null;if((o=o.children[a]).length)break}r=l}if(!(o instanceof Zt))return null;let i=st(o.text,r);if(i==r)return null;let s=Wr(o.dom,r,i).getClientRects();for(let a=0;a<s.length;a++){let l=s[a];if(a==s.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:o}=e,i=this.view.contentDOM.clientWidth,s=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Oe.LTR;for(let c=0,d=0;d<this.children.length;d++){let h=this.children[d],f=c+h.length;if(f>o)break;if(c>=r){let m=h.dom.getBoundingClientRect();if(n.push(m.height),s){let b=h.dom.lastChild,p=b?_o(b):[];if(p.length){let v=p[p.length-1],x=l?v.right-m.left:m.right-v.left;x>a&&(a=x,this.minWidth=i,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+h.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Oe.RTL:Oe.LTR}measureTextSize(){for(let i of this.children)if(i instanceof Ue){let s=i.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,o;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=_o(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,o=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:o}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new Xb(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,o=0;;o++){let i=o==n.viewports.length?null:n.viewports[o],s=i?i.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(ae.replace({widget:new xu(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!i)break;r=i.to+1}return ae.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Ui).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,o=this.view.state.facet(y5).map((i,s)=>{let a=typeof i=="function";return a&&(r=!0),a?i(this.view):i});for(o.length&&(this.dynamicDecorationMap[e++]=r,n.push(Ae.join(o))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(v5))try{if(c(this.view,e.range,e))return!0}catch(d){Ct(this.view.state,d,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),o;if(!r)return;!n.empty&&(o=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,o.left),top:Math.min(r.top,o.top),right:Math.max(r.right,o.right),bottom:Math.max(r.bottom,o.bottom)});let i=Tf(this.view),s={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;ZR(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Oe.LTR)}}function wM(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function S5(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=Gb(n.focusNode,n.focusOffset),o=Yb(n.focusNode,n.focusOffset),i=r||o;if(o&&r&&o.node!=r.node){let a=Ie.get(o.node);if(!a||a instanceof Zt&&a.text!=o.node.nodeValue)i=o;else if(t.docView.lastCompositionAfterCursor){let l=Ie.get(r.node);!l||l instanceof Zt&&l.text!=r.node.nodeValue||(i=o)}}if(t.docView.lastCompositionAfterCursor=i!=r,!i)return null;let s=e-i.offset;return{from:s,to:s+i.node.nodeValue.length,node:i.node}}function yM(t,e,n){let r=S5(t,n);if(!r)return null;let{node:o,from:i,to:s}=r,a=o.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc,c=new Vt(l.mapPos(i),l.mapPos(s),i,s),d=[];for(let h=o.parentNode;;h=h.parentNode){let f=Ie.get(h);if(f instanceof Un)d.push({node:h,deco:f.mark});else{if(f instanceof Ue||h.nodeName=="DIV"&&h.parentNode==t.contentDOM)return{range:c,text:o,marks:d,line:h};if(h!=t.contentDOM)d.push({node:h,deco:new gs({inclusive:!0,attributes:lM(h),tagName:h.tagName.toLowerCase()})});else return null}}}function CM(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let $M=class{constructor(){this.changes=[]}compareRange(e,n){Sa(e,n,this.changes)}comparePoint(e,n){Sa(e,n,this.changes)}boundChange(e){Sa(e,e,this.changes)}};function SM(t,e,n){let r=new $M;return Ae.compare(t,e,n,r),r.changes}function AM(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function kM(t,e){let n=!1;return e&&t.iterChangedRanges((r,o)=>{r<e.to&&o>e.from&&(n=!0)}),n}function TM(t,e,n=1){let r=t.charCategorizer(e),o=t.doc.lineAt(e),i=e-o.from;if(o.length==0)return H.cursor(e);i==0?n=1:i==o.length&&(n=-1);let s=i,a=i;n<0?s=st(o.text,i,!1):a=st(o.text,i);let l=r(o.text.slice(s,a));for(;s>0;){let c=st(o.text,s,!1);if(r(o.text.slice(c,s))!=l)break;s=c}for(;a<o.length;){let c=st(o.text,a);if(r(o.text.slice(a,c))!=l)break;a=c}return H.range(s+o.from,a+o.from)}function RM(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function MM(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Gc(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function A1(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function k1(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Su(t,e,n){let r,o,i,s,a=!1,l,c,d,h;for(let b=t.firstChild;b;b=b.nextSibling){let p=_o(b);for(let v=0;v<p.length;v++){let x=p[v];o&&Gc(o,x)&&(x=A1(k1(x,o.bottom),o.top));let y=RM(e,x),$=MM(n,x);if(y==0&&$==0)return b.nodeType==3?T1(b,e,n):Su(b,e,n);(!r||s>$||s==$&&i>y)&&(r=b,o=x,i=y,s=$,a=y?e<x.left?v>0:v<p.length-1:!0),y==0?n>x.bottom&&(!d||d.bottom<x.bottom)?(l=b,d=x):n<x.top&&(!h||h.top>x.top)&&(c=b,h=x):d&&Gc(d,x)?d=k1(d,x.bottom):h&&Gc(h,x)&&(h=A1(h,x.top))}}if(d&&d.bottom>=n?(r=l,o=d):h&&h.top<=n&&(r=c,o=h),!r)return{node:t,offset:0};let f=Math.max(o.left,Math.min(o.right,e));if(r.nodeType==3)return T1(r,f,n);if(a&&r.contentEditable!="false")return Su(r,f,n);let m=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(o.left+o.right)/2?1:0);return{node:t,offset:m}}function T1(t,e,n){let r=t.nodeValue.length,o=-1,i=1e9,s=0;for(let a=0;a<r;a++){let l=Wr(t,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(d.top==d.bottom)continue;s||(s=e-d.left);let h=(d.top>n?d.top-n:n-d.bottom)-1;if(d.left-1<=e&&d.right+1>=e&&h<i){let f=e>=(d.left+d.right)/2,m=f;if((te.chrome||te.gecko)&&Wr(t,a).getBoundingClientRect().left==d.right&&(m=!f),h<=0)return{node:t,offset:a+(m?1:0)};o=a+(m?1:0),i=h}}}return{node:t,offset:o>-1?o:s>0?t.nodeValue.length:0}}function A5(t,e,n,r=-1){var o,i;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:d,y:h}=e,f=h-a;if(f<0)return 0;if(f>c)return t.state.doc.length;for(let S=t.viewState.heightOracle.textHeight/2,A=!1;l=t.elementAtHeight(f),l.type!=pt.Text;)for(;f=r>0?l.bottom+S:l.top-S,!(f>=0&&f<=c);){if(A)return n?null:0;A=!0,r=-r}h=a+f;let m=l.from;if(m<t.viewport.from)return t.viewport.from==0?0:n?null:R1(t,s,l,d,h);if(m>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:R1(t,s,l,d,h);let b=t.dom.ownerDocument,p=t.root.elementFromPoint?t.root:b,v=p.elementFromPoint(d,h);v&&!t.contentDOM.contains(v)&&(v=null),v||(d=Math.max(s.left+1,Math.min(s.right-1,d)),v=p.elementFromPoint(d,h),v&&!t.contentDOM.contains(v)&&(v=null));let x,y=-1;if(v&&((o=t.docView.nearest(v))===null||o===void 0?void 0:o.isEditable)!=!1){if(b.caretPositionFromPoint){let S=b.caretPositionFromPoint(d,h);S&&({offsetNode:x,offset:y}=S)}else if(b.caretRangeFromPoint){let S=b.caretRangeFromPoint(d,h);S&&({startContainer:x,startOffset:y}=S,(!t.contentDOM.contains(x)||te.safari&&EM(x,y,d)||te.chrome&&IM(x,y,d))&&(x=void 0))}x&&(y=Math.min($n(x),y))}if(!x||!t.docView.dom.contains(x)){let S=Ue.find(t.docView,m);if(!S)return f>l.top+l.height/2?l.to:l.from;({node:x,offset:y}=Su(S.dom,d,h))}let $=t.docView.nearest(x);if(!$)return null;if($.isWidget&&((i=$.dom)===null||i===void 0?void 0:i.nodeType)==1){let S=$.dom.getBoundingClientRect();return e.y<S.top||e.y<=S.bottom&&e.x<=(S.left+S.right)/2?$.posAtStart:$.posAtEnd}else return $.localPosFromDOM(x,y)+$.posAtStart}function R1(t,e,n,r,o){let i=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((o-n.top-(t.defaultLineHeight-a)*.5)/a);i+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+du(s,i,t.state.tabSize)}function EM(t,e,n){let r,o=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let i=o.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let s=o.parentNode;if(!s||s.nodeName=="DIV")break;o=s}}return Wr(t,r-1,r).getBoundingClientRect().right>n}function IM(t,e,n){if(e!=0)return!1;for(let o=t;;){let i=o.parentNode;if(!i||i.nodeType!=1||i.firstChild!=o)return!1;if(i.classList.contains("cm-line"))break;o=i}let r=t.nodeType==1?t.getBoundingClientRect():Wr(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Au(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let o;for(let i of r.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!o||i.type==pt.Text&&(o.type!=i.type||(n<0?i.from<e:i.to>e)))&&(o=i)}}return o||r}return r}function jM(t,e,n,r){let o=Au(t,e.head,e.assoc||-1),i=!r||o.type!=pt.Text||!(t.lineWrapping||o.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head);if(i){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(o.from),l=t.posAtCoords({x:n==(a==Oe.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(l!=null)return H.cursor(l,n?-1:1)}return H.cursor(n?o.to:o.from,n?-1:1)}function M1(t,e,n,r){let o=t.state.doc.lineAt(e.head),i=t.bidiSpans(o),s=t.textDirectionAt(o.from);for(let a=e,l=null;;){let c=bM(o,i,s,a,n),d=c5;if(!c){if(o.number==(n?t.state.doc.lines:1))return a;d=`
|
|
60
|
-
`,o=t.state.doc.line(o.number+(n?1:-1)),i=t.bidiSpans(o),c=t.visualLineSide(o,!n)}if(l){if(!l(d))return a}else{if(!r)return c;l=r(d)}a=c}}function DM(t,e,n){let r=t.state.charCategorizer(e),o=r(n);return i=>{let s=r(i);return o==Le.Space&&(o=s),o==s}}function OM(t,e,n,r){let o=e.head,i=n?1:-1;if(o==(n?t.state.doc.length:0))return H.cursor(o,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(o,e.assoc||-1),d=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=i<0?c.top:c.bottom;else{let m=t.viewState.lineBlockAt(o);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(o-m.from))),a=(i<0?m.top:m.bottom)+d}let h=l.left+s,f=r??t.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let
|
|
61
|
-
`&&t.lineWrapping&&(r&&(r=H.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:ke.of([" "])}),n)return Rf(t,n,r,i);if(r&&!r.main.eq(o)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function Rf(t,e,n,r=-1){if(te.ios&&t.inputState.flushIOSKey(e))return!0;let o=t.state.selection.main;if(te.android&&(e.to==o.to&&(e.from==o.from||e.from==o.from-1&&t.state.sliceDoc(e.from,o.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ko(t.contentDOM,"Enter",13)||(e.from==o.from-1&&e.to==o.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>o.head)&&ko(t.contentDOM,"Backspace",8)||e.from==o.from&&e.to==o.to+1&&e.insert.length==0&&ko(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=FM(t,e,n));return t.state.facet(m5).some(l=>l(t,e.from,e.to,i,a))||t.dispatch(a()),!0}function FM(t,e,n){let r,o=t.state,i=o.selection.main;if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=i.from<e.from?o.sliceDoc(i.from,e.from):"",l=i.to>e.to?o.sliceDoc(e.to,i.to):"";r=o.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=o.changes(e),l=n&&n.main.to<=a.newLength?n.main:void 0;if(o.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=i.to&&e.to>=i.to-10){let c=t.state.sliceDoc(e.from,e.to),d,h=n&&S5(t,n.main.head);if(h){let b=e.insert.length-(e.to-e.from);d={from:h.from,to:h.to-b}}else d=t.state.doc.lineAt(i.head);let f=i.to-e.to,m=i.to-i.from;r=o.changeByRange(b=>{if(b.from==i.from&&b.to==i.to)return{changes:a,range:l||b.map(a)};let p=b.to-f,v=p-c.length;if(b.to-b.from!=m||t.state.sliceDoc(v,p)!=c||b.to>=d.from&&b.from<=d.to)return{range:b};let x=o.changes({from:v,to:p,insert:e.insert}),y=b.to-i.to;return{changes:x,range:l?H.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):b.map(x)}})}else r={changes:a,selection:l&&o.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),o.update(r,{userEvent:s,scrollIntoView:!0})}function VM(t,e,n,r){let o=Math.min(t.length,e.length),i=0;for(;i<o&&t.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==o&&t.length==e.length)return null;let s=t.length,a=e.length;for(;s>0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s<i&&t.length<e.length){let l=n<=i&&n>=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a<i){let l=n<=i&&n>=a?i-n:0;i-=l,s=i+(s-a),a=i}return{from:i,toA:s,toB:a}}function _M(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new E1(n,r)),(o!=n||i!=r)&&e.push(new E1(o,i))),e}function zM(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?H.single(n+e,r+e):null}class HM{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,te.safari&&e.contentDOM.addEventListener("input",()=>null),te.gecko&&oE(e.contentDOM.ownerDocument)}handleEvent(e){!XM(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let o of r.observers)o(this.view,n);for(let o of r.handlers){if(n.defaultPrevented)break;if(o(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=PM(e),r=this.handlers,o=this.view.contentDOM;for(let i in n)if(i!="scroll"){let s=!n[i].handlers.length,a=r[i];a&&s!=!a.handlers.length&&(o.removeEventListener(i,this.handleEvent),a=null),a||o.addEventListener(i,this.handleEvent,{passive:s})}for(let i in r)i!="scroll"&&!n[i]&&o.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&R5.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),te.android&&te.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return te.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=T5.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||WM.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ko(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:te.safari&&!te.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function I1(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(o){Ct(n.state,o)}}}function PM(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let o=r.spec,i=o&&o.plugin.domEventHandlers,s=o&&o.plugin.domEventObservers;if(i)for(let a in i){let l=i[a];l&&n(a).handlers.push(I1(r.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(I1(r.value,l))}}for(let r in Jt)n(r).handlers.push(Jt[r]);for(let r in _t)n(r).observers.push(_t[r]);return e}const T5=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],WM="dthko",R5=[16,17,18,20,91,92,224,225],ea=6;function ta(t){return Math.max(0,t)*.7+8}function qM(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class UM{constructor(e,n,r,o){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=JR(e.contentDOM),this.atoms=e.state.facet(kf).map(s=>s(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet($e.allowMultipleSelections)&&KM(e,n),this.dragging=YM(e,n)&&I5(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&qM(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,o=0,i=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:o,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Tf(this.view);e.clientX-l.left<=o+ea?n=-ta(o-e.clientX):e.clientX+l.right>=s-ea&&(n=ta(e.clientX-s)),e.clientY-l.top<=i+ea?r=-ta(i-e.clientY):e.clientY+l.bottom>=a-ea&&(r=ta(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;r<e.ranges.length;r++){let o=e.ranges[r],i=null;if(o.empty){let s=Aa(this.atoms,o.from,0);s!=o.from&&(i=H.cursor(s,-1))}else{let s=Aa(this.atoms,o.from,-1),a=Aa(this.atoms,o.to,1);(s!=o.from||a!=o.to)&&(i=H.range(o.from==o.anchor?s:a,o.from==o.head?s:a))}i&&(n||(n=e.ranges.slice()),n[r]=i)}return n?H.create(n,e.mainIndex):e}select(e){let{view:n}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function KM(t,e){let n=t.state.facet(d5);return n.length?n[0](e):te.mac?e.metaKey:e.ctrlKey}function GM(t,e){let n=t.state.facet(u5);return n.length?n[0](e):te.mac?!e.altKey:!e.ctrlKey}function YM(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=qi(t.root);if(!r||r.rangeCount==0)return!0;let o=r.getRangeAt(0).getClientRects();for(let i=0;i<o.length;i++){let s=o[i];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function XM(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Ie.get(n))&&r.ignoreEvent(e))return!1;return!0}const Jt=Object.create(null),_t=Object.create(null),M5=te.ie&&te.ie_version<15||te.ios&&te.webkit_version<604;function QM(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),E5(t,n.value)},50)}function Gl(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function E5(t,e){e=Gl(t.state,$f,e);let{state:n}=t,r,o=1,i=n.toText(e),s=i.lines==n.selection.ranges.length;if(ku!=null&&n.selection.ranges.every(l=>l.empty)&&ku==i.toString()){let l=-1;r=n.changeByRange(c=>{let d=n.doc.lineAt(c.from);if(d.from==l)return{range:c};l=d.from;let h=n.toText((s?i.line(o++).text:e)+n.lineBreak);return{changes:{from:d.from,insert:h},range:H.cursor(c.from+h.length)}})}else s?r=n.changeByRange(l=>{let c=i.line(o++);return{changes:{from:l.from,to:l.to,insert:c.text},range:H.cursor(l.from+c.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}_t.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Jt.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);_t.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};_t.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Jt.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(h5))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=eE(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new UM(t,e,n,r)),r&&t.observer.ignore(()=>{qb(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let o=t.inputState.mouseSelection;if(o)return o.start(e),o.dragging===!1}return!1};function j1(t,e,n,r){if(r==1)return H.cursor(e,n);if(r==2)return TM(t.state,e,n);{let o=Ue.find(t.docView,e),i=t.state.doc.lineAt(o?o.posAtEnd:e),s=o?o.posAtStart:i.from,a=o?o.posAtEnd:i.to;return a<t.state.doc.length&&a==i.to&&a++,H.range(s,a)}}let D1=(t,e,n)=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function ZM(t,e,n,r){let o=Ue.find(t.docView,e);if(!o)return 1;let i=e-o.posAtStart;if(i==0)return 1;if(i==o.length)return-1;let s=o.coordsAt(i,-1);if(s&&D1(n,r,s))return-1;let a=o.coordsAt(i,1);return a&&D1(n,r,a)?1:s&&s.bottom>=r?-1:1}function O1(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:ZM(t,n,e.clientX,e.clientY)}}const JM=te.ie&&te.ie_version<=11;let L1=null,N1=0,B1=0;function I5(t){if(!JM)return t.detail;let e=L1,n=B1;return L1=t,B1=Date.now(),N1=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(N1+1)%3:1}function eE(t,e){let n=O1(t,e),r=I5(e),o=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),o=o.map(i.changes))},get(i,s,a){let l=O1(t,i),c,d=j1(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let h=j1(t,n.pos,n.bias,r),f=Math.min(h.from,d.from),m=Math.max(h.to,d.to);d=f<d.from?H.range(f,m):H.range(m,f)}return s?o.replaceRange(o.main.extend(d.from,d.to)):a&&r==1&&o.ranges.length>1&&(c=tE(o,l.pos))?c:a?o.addRange(d):H.create([d])}}}function tE(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:o}=t.ranges[n];if(r<=e&&o>=e)return H.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Jt.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let o=t.docView.nearest(e.target);if(o&&o.isWidget){let i=o.posAtStart,s=i+o.length;(i>=n.to||s<=n.from)&&(n=H.range(i,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Gl(t.state,Sf,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Jt.dragend=t=>(t.inputState.draggedContent=null,!1);function F1(t,e,n,r){if(n=Gl(t.state,$f,n),!n)return;let o=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,s=r&&i&&GM(t,e)?{from:i.from,to:i.to}:null,a={from:o,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(o,-1),head:l.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Jt.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),o=0,i=()=>{++o==n.length&&F1(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=i,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),i()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return F1(t,e,r,!0),!0}return!1};Jt.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=M5?null:e.clipboardData;return n?(E5(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(QM(t),!1)};function nE(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function rE(t){let e=[],n=[],r=!1;for(let o of t.selection.ranges)o.empty||(e.push(t.sliceDoc(o.from,o.to)),n.push(o));if(!e.length){let o=-1;for(let{from:i}of t.selection.ranges){let s=t.doc.lineAt(i);s.number>o&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),o=s.number}r=!0}return{text:Gl(t,Sf,e.join(t.lineBreak)),ranges:n,linewise:r}}let ku=null;Jt.copy=Jt.cut=(t,e)=>{let{text:n,ranges:r,linewise:o}=rE(t.state);if(!n&&!o)return!1;ku=o?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=M5?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(nE(t,n),!1)};const j5=Mn.define();function D5(t,e){let n=[];for(let r of t.facet(g5)){let o=r(t,e);o&&n.push(o)}return n.length?t.update({effects:n,annotations:j5.of(!0)}):null}function O5(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=D5(t.state,e);n?t.dispatch(n):t.update([])}},10)}_t.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),O5(t)};_t.blur=t=>{t.observer.clearSelectionRange(),O5(t)};_t.compositionstart=_t.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};_t.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,te.chrome&&te.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};_t.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Jt.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(i&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return Rf(t,{from:l,to:c,insert:t.state.toText(i)},null),!0}}let o;if(te.chrome&&te.android&&(o=T5.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(o.key,o.keyCode),o.key=="Backspace"||o.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return te.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),te.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>_t.compositionend(t,e),20),!1};const V1=new Set;function oE(t){V1.has(t)||(V1.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const _1=["pre-wrap","normal","pre-line","break-spaces"];let Po=!1;function z1(){Po=!1}class iE{constructor(e){this.lineWrapping=e,this.doc=ke.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let o=e[r];o<0?r++:this.heightSamples[Math.floor(o*10)]||(n=!0,this.heightSamples[Math.floor(o*10)]=!0)}return n}refresh(e,n,r,o,i,s){let a=_1.indexOf(e)>-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=o,this.lineLength=i,l){this.heightSamples={};for(let c=0;c<s.length;c++){let d=s[c];d<0?c++:this.heightSamples[Math.floor(d*10)]=!0}}return l}}class sE{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class hn{constructor(e,n,r,o,i){this.from=e,this.length=n,this.top=r,this.height=o,this._content=i}get type(){return typeof this._content=="number"?pt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof gr?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new hn(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var De=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(De||(De={}));const ka=.001;class bt{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ka&&(Po=!0),this.height=e)}replace(e,n,r){return bt.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,o){let i=this,s=r.doc;for(let a=o.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:d,toB:h}=o[a],f=i.lineAt(l,De.ByPosNoHeight,r.setDoc(n),0,0),m=f.to>=c?f:i.lineAt(c,De.ByPosNoHeight,r,0,0);for(h+=m.to-c,c=m.to;a>0&&f.from<=o[a-1].toA;)l=o[a-1].fromA,d=o[a-1].fromB,a--,l<f.from&&(f=i.lineAt(l,De.ByPosNoHeight,r,0,0));d+=f.from-l,l=f.from;let b=Mf.build(r.setDoc(s),e,d,h);i=el(i,i.replace(l,c,b))}return i.updateHeight(r,0)}static empty(){return new jt(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,o=0,i=0;for(;;)if(n==r)if(o>i*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,o-=a.size}else if(i>o*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,i-=a.size}else break;else if(o<i){let a=e[n++];a&&(o+=a.size)}else{let a=e[--r];a&&(i+=a.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,r++),new aE(bt.of(e.slice(0,n)),s,bt.of(e.slice(r)))}}function el(t,e){return t==e?t:(t.constructor!=e.constructor&&(Po=!0),e)}bt.prototype.size=1;class L5 extends bt{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,o){return new hn(o,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,o,i){return this.blockAt(0,r,o,i)}forEachLine(e,n,r,o,i,s){e<=i+this.length&&n>=i&&s(this.blockAt(0,r,o,i))}updateHeight(e,n=0,r=!1,o){return o&&o.from<=n&&o.more&&this.setHeight(o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class jt extends L5{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,o){return new hn(o,this.length,r,this.height,this.breaks)}replace(e,n,r){let o=r[0];return r.length==1&&(o instanceof jt||o instanceof rt&&o.flags&4)&&Math.abs(this.length-o.length)<10?(o instanceof rt?o=new jt(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):bt.of(r)}updateHeight(e,n=0,r=!1,o){return o&&o.from<=n&&o.more?this.setHeight(o.heights[o.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class rt extends bt{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,o=e.doc.lineAt(n+this.length).number,i=o-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*i);s=l/i,this.length>i+1&&(a=(this.height-l)/(this.length-i-1))}else s=this.height/i;return{firstLine:r,lastLine:o,perLine:s,perChar:a}}blockAt(e,n,r,o){let{firstLine:i,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,o);if(n.lineWrapping){let c=o+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),d=n.doc.lineAt(c),h=a+d.length*l,f=Math.max(r,e-h/2);return new hn(d.from,d.length,f,h,0)}else{let c=Math.max(0,Math.min(s-i,Math.floor((e-r)/a))),{from:d,length:h}=n.doc.line(i+c);return new hn(d,h,r+a*c,a,0)}}lineAt(e,n,r,o,i){if(n==De.ByHeight)return this.blockAt(e,r,o,i);if(n==De.ByPosNoHeight){let{from:m,to:b}=r.doc.lineAt(e);return new hn(m,b-m,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(r,i),c=r.doc.lineAt(e),d=a+c.length*l,h=c.number-s,f=o+a*h+l*(c.from-i-h);return new hn(c.from,c.length,Math.max(o,Math.min(f,o+this.height-d)),d,0)}forEachLine(e,n,r,o,i,s){e=Math.max(e,i),n=Math.min(n,i+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,i);for(let d=e,h=o;d<=n;){let f=r.doc.lineAt(d);if(d==e){let b=f.number-a;h+=l*b+c*(e-i-b)}let m=l+c*f.length;s(new hn(f.from,f.length,h,m,0)),h+=m,d=f.to+1}}replace(e,n,r){let o=this.length-n;if(o>0){let i=r[r.length-1];i instanceof rt?r[r.length-1]=new rt(i.length+o):r.push(null,new rt(o-1))}if(e>0){let i=r[0];i instanceof rt?r[0]=new rt(e+i.length):r.unshift(new rt(e-1),null)}return bt.of(r)}decomposeLeft(e,n){n.push(new rt(e-1),null)}decomposeRight(e,n){n.push(null,new rt(this.length-e-1))}updateHeight(e,n=0,r=!1,o){let i=n+this.length;if(o&&o.from<=n+this.length&&o.more){let s=[],a=Math.max(n,o.from),l=-1;for(o.from>n&&s.push(new rt(o.from-n-1).updateHeight(e,n));a<=i&&o.more;){let d=e.doc.lineAt(a).length;s.length&&s.push(null);let h=o.heights[o.index++];l==-1?l=h:Math.abs(h-l)>=ka&&(l=-2);let f=new jt(d,h);f.outdated=!1,s.push(f),a+=d+1}a<=i&&s.push(null,new rt(i-a).updateHeight(e,a));let c=bt.of(s);return(l<0||Math.abs(c.height-this.height)>=ka||Math.abs(l-this.heightMetrics(e,n).perLine)>=ka)&&(Po=!0),el(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class aE extends bt{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,o){let i=r+this.left.height;return e<i?this.left.blockAt(e,n,r,o):this.right.blockAt(e,n,i,o+this.left.length+this.break)}lineAt(e,n,r,o,i){let s=o+this.left.height,a=i+this.left.length+this.break,l=n==De.ByHeight?e<s:e<a,c=l?this.left.lineAt(e,n,r,o,i):this.right.lineAt(e,n,r,s,a);if(this.break||(l?c.to<a:c.from>a))return c;let d=n==De.ByPosNoHeight?De.ByPosNoHeight:De.ByPos;return l?c.join(this.right.lineAt(a,d,r,s,a)):this.left.lineAt(a,d,r,o,i).join(c)}forEachLine(e,n,r,o,i,s){let a=o+this.left.height,l=i+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,r,o,i,s),n>=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,De.ByPos,r,o,i);e<c.from&&this.left.forEachLine(e,c.from-1,r,o,i,s),c.to>=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(e,n,r){let o=this.left.length+this.break;if(n<o)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-o,n-o,r));let i=[];e>0&&this.decomposeLeft(e,i);let s=i.length;for(let a of r)i.push(a);if(e>0&&H1(i,s-1),n<this.length){let a=i.length;this.decomposeRight(n,i),H1(i,a)}return bt.of(i)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,o=r+this.break;if(e>=o)return this.right.decomposeRight(e-o,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<o&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?bt.of(this.break?[e,null,n]:[e,n]):(this.left=el(this.left,e),this.right=el(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,o){let{left:i,right:s}=this,a=n+i.length+this.break,l=null;return o&&o.from<=n+i.length&&o.more?l=i=i.updateHeight(e,n,r,o):i.updateHeight(e,n,r),o&&o.from<=a+s.length&&o.more?l=s=s.updateHeight(e,a,r,o):s.updateHeight(e,a,r),l?this.balanced(i,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function H1(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof rt&&(r=t[e+1])instanceof rt&&t.splice(e-1,3,new rt(n.length+1+r.length))}const lE=5;class Mf{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),o=this.nodes[this.nodes.length-1];o instanceof jt?o.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new jt(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let o=r.widget?r.widget.estimatedHeight:0,i=r.widget?r.widget.lineBreaks:0;o<0&&(o=this.oracle.lineHeight);let s=n-e;r.block?this.addBlock(new L5(s,o,r)):(s||i||o>=lE)&&this.addLineDeco(o,i,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new jt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new rt(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof jt)return e;let n=new jt(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let o=this.ensureLine();o.length+=r,o.collapsed+=r,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof jt)&&!this.isCovered?this.nodes.push(new jt(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let o of this.nodes)o instanceof jt&&o.updateHeight(this.oracle,r),r+=o?o.length:1;return this.nodes}static build(e,n,r,o){let i=new Mf(r,e);return Ae.spans(n,r,o,i,0),i.finish(r)}}function cE(t,e,n){let r=new dE;return Ae.compare(t,e,n,r,0),r.changes}class dE{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,o){(e<n||r&&r.heightRelevant||o&&o.heightRelevant)&&Sa(e,n,this.changes,5)}}function uE(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,o=r.defaultView||window,i=Math.max(0,n.left),s=Math.min(o.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(o.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let d=c,h=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&h.overflow!="visible"){let f=d.getBoundingClientRect();i=Math.max(i,f.left),s=Math.min(s,f.right),a=Math.max(a,f.top),l=Math.min(c==t.parentNode?o.innerHeight:l,f.bottom)}c=h.position=="absolute"||h.position=="fixed"?d.offsetParent:d.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:i-n.left,right:Math.max(i,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function hE(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function fE(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Xc{constructor(e,n,r,o){this.from=e,this.to=n,this.size=r,this.displaySize=o}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],i=n[r];if(o.from!=i.from||o.to!=i.to||o.size!=i.size)return!1}return!0}draw(e,n){return ae.replace({widget:new mE(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class mE extends Qn{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class P1{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=W1,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Oe.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(Af).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new iE(n),this.stateDeco=e.facet(Ui).filter(r=>typeof r!="function"),this.heightMap=bt.empty().applyChanges(this.stateDeco,ke.empty,this.heightOracle.setDoc(e.doc),[new Vt(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ae.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let o=r?n.head:n.anchor;if(!e.some(({from:i,to:s})=>o>=i&&o<=s)){let{from:i,to:s}=this.lineBlockAt(o);e.push(new na(i,s))}}return this.viewports=e.sort((r,o)=>r.from-o.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?W1:new Ef(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ai(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Ui).filter(d=>typeof d!="function");let o=e.changedRanges,i=Vt.extendWithRanges(o,cE(r,this.stateDeco,e?e.changes:Ye.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);z1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=s||Po)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(b5)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),o=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Oe.RTL:Oe.LTR;let s=this.heightOracle.mustRefreshForWrapping(i),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,d=0;if(a.width&&a.height){let{scaleX:S,scaleY:A}=Wb(n,a);(S>.005&&Math.abs(this.scaleX-S)>.005||A>.005&&Math.abs(this.scaleY-A)>.005)&&(this.scaleX=S,this.scaleY=A,c|=16,s=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=Kb(e.scrollDOM);let b=(this.printing?fE:uE)(n,this.paddingTop),p=b.top-this.pixelViewport.top,v=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(l=!0)),!this.inView&&!this.scrollTarget&&!hE(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(S)&&(s=!0),s||o.lineWrapping&&Math.abs(y-this.contentDOMWidth)>o.charWidth){let{lineHeight:A,charWidth:k,textHeight:T}=e.docView.measureTextSize();s=A>0&&o.refresh(i,A,k,T,Math.max(5,y/k),S),s&&(e.docView.minWidth=0,c|=16)}p>0&&v>0?d=Math.max(p,v):p<0&&v<0&&(d=Math.min(p,v)),z1();for(let A of this.viewports){let k=A.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(A);this.heightMap=(s?bt.empty().applyChanges(this.stateDeco,ke.empty,this.heightOracle,[new Vt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,s,new sE(A.from,k))}Po&&(c|=2)}let $=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return $&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),c|=this.updateForViewport()),(c&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,i=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new na(o.lineAt(s-r*1e3,De.ByHeight,i,0,0).from,o.lineAt(a+(1-r)*1e3,De.ByHeight,i,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=o.lineAt(c,De.ByPos,i,0,0),f;n.y=="center"?f=(h.top+h.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&c<l.from?f=h.top:f=h.bottom-d,l=new na(o.lineAt(f-1e3/2,De.ByHeight,i,0,0).from,o.lineAt(f+d+1e3/2,De.ByHeight,i,0,0).to)}}return l}mapViewport(e,n){let r=n.mapPos(e.from,-1),o=n.mapPos(e.to,1);return new na(this.heightMap.lineAt(r,De.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(o,De.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:o}=this.heightMap.lineAt(e,De.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,De.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(e==0||o<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||i>=a+Math.max(10,Math.min(r,250)))&&o>s-2*1e3&&i<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let o of e)n.touchesRange(o.from,o.to)||r.push(new Xc(n.mapPos(o.from),n.mapPos(o.to),o.size,o.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,o=r?1e4:2e3,i=o>>1,s=o<<1;if(this.defaultTextDirection!=Oe.LTR&&!r)return[];let a=[],l=(d,h,f,m)=>{if(h-d<i)return;let b=this.state.selection.main,p=[b.from];b.empty||p.push(b.to);for(let x of p)if(x>d&&x<h){l(d,x-10,f,m),l(x+10,h,f,m);return}let v=pE(e,x=>x.from>=f.from&&x.to<=f.to&&Math.abs(x.from-d)<i&&Math.abs(x.to-h)<i&&!p.some(y=>x.from<y&&x.to>y));if(!v){if(h<f.to&&n&&r&&n.visibleRanges.some($=>$.from<=h&&$.to>=h)){let $=n.moveToLineBoundary(H.cursor(h),!1,!0).head;$>d&&(h=$)}let x=this.gapSize(f,d,h,m),y=r||x<2e6?x:2e6;v=new Xc(d,h,x,y)}a.push(v)},c=d=>{if(d.length<s||d.type!=pt.Text)return;let h=gE(d.from,d.to,this.stateDeco);if(h.total<s)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,m,b;if(r){let p=o/this.heightOracle.lineLength*this.heightOracle.lineHeight,v,x;if(f!=null){let y=oa(h,f),$=((this.visibleBottom-this.visibleTop)/2+p)/d.height;v=y-$,x=y+$}else v=(this.visibleTop-d.top-p)/d.height,x=(this.visibleBottom-d.top+p)/d.height;m=ra(h,v),b=ra(h,x)}else{let p=h.total*this.heightOracle.charWidth,v=o*this.heightOracle.charWidth,x=0;if(p>2e6)for(let k of e)k.from>=d.from&&k.from<d.to&&k.size!=k.displaySize&&k.from*this.heightOracle.charWidth+x<this.pixelViewport.left&&(x=k.size-k.displaySize);let y=this.pixelViewport.left+x,$=this.pixelViewport.right+x,S,A;if(f!=null){let k=oa(h,f),T=(($-y)/2+v)/p;S=k-T,A=k+T}else S=(y-v)/p,A=($+v)/p;m=ra(h,S),b=ra(h,A)}m>d.from&&l(d.from,m,d,h),b<d.to&&l(b,d.to,d,h)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(c):c(d);return a}gapSize(e,n,r,o){let i=oa(o,r)-oa(o,n);return this.heightOracle.lineWrapping?e.height*i:o.total*this.heightOracle.charWidth*i}updateLineGaps(e){Xc.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ae.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Ae.spans(n,this.viewport.from,this.viewport.to,{span(i,s){r.push({from:i,to:s})},point(){}},20);let o=0;if(r.length!=this.visibleRanges.length)o=12;else for(let i=0;i<r.length&&!(o&8);i++){let s=this.visibleRanges[i],a=r[i];(s.from!=a.from||s.to!=a.to)&&(o|=4,e&&e.mapPos(s.from,-1)==a.from&&e.mapPos(s.to,1)==a.to||(o|=8))}return this.visibleRanges=r,o}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Ai(this.heightMap.lineAt(e,De.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Ai(this.heightMap.lineAt(this.scaler.fromDOM(e),De.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Ai(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let na=class{constructor(e,n){this.from=e,this.to=n}};function gE(t,e,n){let r=[],o=t,i=0;return Ae.spans(n,t,e,{span(){},point(s,a){s>o&&(r.push({from:o,to:s}),i+=s-o),o=a}},20),o<e&&(r.push({from:o,to:e}),i+=e-o),{total:i,ranges:r}}function ra({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let o=0;;o++){let{from:i,to:s}=e[o],a=s-i;if(r<=a)return i+r;r-=a}}function oa(t,e){let n=0;for(let{from:r,to:o}of t.ranges){if(e<=o){n+=e-r;break}n+=o-r}return n/t.total}function pE(t,e){for(let n of t)if(e(n))return n}const W1={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Ef{constructor(e,n,r){let o=0,i=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,De.ByPos,e,0,0).top,d=n.lineAt(l,De.ByPos,e,0,0).bottom;return o+=d-c,{from:a,to:l,top:c,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(n.height-o);for(let a of this.viewports)a.domTop=s+(a.top-i)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(e){for(let n=0,r=0,o=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.top)return o+(e-r)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);r=i.bottom,o=i.domBottom}}fromDOM(e){for(let n=0,r=0,o=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.domTop)return r+(e-o)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);r=i.bottom,o=i.domBottom}}eq(e){return e instanceof Ef?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Ai(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new hn(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(o=>Ai(o,e)):t._content)}const ia=ne.define({combine:t=>t.join(" ")}),Tu=ne.define({combine:t=>t.indexOf(!0)>-1}),Ru=fr.newName(),N5=fr.newName(),B5=fr.newName(),F5={"&light":"."+N5,"&dark":"."+B5};function Mu(t,e,n){return new fr(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,o=>{if(o=="&")return t;if(!n||!n[o])throw new RangeError(`Unsupported selector: ${o}`);return n[o]}):t+" "+r}})}const bE=Mu("."+Ru,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},F5),vE={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Qc=te.ie&&te.ie_version<=11;class xE{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new eM,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(te.ie&&te.ie_version<=11||te.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&te.android&&e.constructor.EDIT_CONTEXT!==!1&&!(te.chrome&&te.chrome_version<126)&&(this.editContext=new yE(e),e.state.facet(Fn)&&(e.contentDOM.editContext=this.editContext.editContext)),Qc&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,o=this.selectionRange;if(r.state.facet(Fn)?r.root.activeElement!=this.dom:!$a(this.dom,o))return;let i=o.anchorNode&&r.docView.nearest(o.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(te.ie&&te.ie_version<=11||te.android&&te.chrome)&&!r.state.selection.main.empty&&o.focusNode&&Ei(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=qi(e.root);if(!n)return!1;let r=te.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&wE(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let o=$a(this.dom,r);return o&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&nM(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),o&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,vE),Qc&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Qc&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let o=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&ko(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(o)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,o=!1;for(let i of e){let s=this.readMutation(i);s&&(s.typeOver&&(o=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:o}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),o=this.selectionChanged&&$a(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new BM(this.view,e,n,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,o=k5(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),o}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=q1(n,e.previousSibling||e.target.previousSibling,-1),o=q1(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:o?n.posBefore(o):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Fn)!=e.state.facet(Fn)&&(e.view.contentDOM.editContext=e.state.facet(Fn)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function q1(t,e,n){for(;e;){let r=Ie.get(e);if(r&&r.parent==t)return r;let o=e.parentNode;e=o!=t.dom?o:n>0?e.nextSibling:e.previousSibling}return null}function U1(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return Ei(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function wE(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return U1(t,o)}let n=null;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?U1(t,n):null}class yE{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let o=e.state.selection.main,{anchor:i,head:s}=o,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c={from:a,to:l,insert:ke.of(r.text.split(`
|
|
62
|
-
`))};if(c.from==this.from&&i<this.from?c.from=i:c.to==this.to&&i>this.to&&(c.to=i),c.from==c.to&&!c.insert.length){let d=H.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));d.main.eq(o)||e.dispatch({selection:d,userEvent:"select"});return}if((te.mac||te.android)&&c.from==s-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:a,to:l,insert:ke.of([r.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let d=this.to-this.from+(c.to-c.from+c.insert.length);Rf(e,c,H.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=r=>{let o=[],i=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s<a;s++){let l=e.coordsForChar(s);i=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||i||new DOMRect,o.push(i)}n.updateCharacterBounds(r.rangeStart,o)},this.handlers.textformatupdate=r=>{let o=[];for(let i of r.getTextFormats()){let s=i.underlineStyle,a=i.underlineThickness;if(s!="None"&&a!="None"){let l=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);if(l<c){let d=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;o.push(ae.mark({attributes:{style:d}}).range(l,c))}}}e.dispatch({effects:x5.of(ae.set(o))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let o=qi(r.root);o&&o.rangeCount&&this.editContext.updateSelectionBounds(o.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,o=this.pendingContextChange;return e.changes.iterChanges((i,s,a,l,c)=>{if(r)return;let d=c.length-(s-i);if(o&&s>=o.to)if(o.from==i&&o.to==s&&o.insert.eq(c)){o=this.pendingContextChange=null,n+=d,this.to+=d;return}else o=null,this.revertPending(e.state);if(i+=n,s+=n,s<=this.from)this.from+=d,this.to+=d;else if(i<this.to){if(i<this.from||s>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(s),c.toString()),this.to+=d}n+=d}),o&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(o=>!o.isUserEvent("input.type")&&o.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),o=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=o)&&this.editContext.updateSelection(r,o)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Q{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(o=>o.forEach(i=>r(i,this)))||(o=>this.update(o)),this.dispatch=this.dispatch.bind(this),this._root=e.root||tM(e.parent)||document,this.viewState=new P1(e.state||$e.create(e)),e.scrollTo&&e.scrollTo.is(Js)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(go).map(o=>new Kc(o));for(let o of this.plugins)o.update(this);this.observer=new xE(this),this.inputState=new HM(this),this.inputState.ensureHandlers(this.plugins),this.docView=new S1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Xe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,o,i=this.state;for(let f of e){if(f.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=f.state}if(this.destroyed){this.viewState.state=i;return}let s=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(j5))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=D5(i,s),l||(a=1));let c=this.observer.delayedAndroidKey,d=null;if(c?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(d=null)):this.observer.clear(),i.facet($e.phrases)!=this.state.facet($e.phrases))return this.setState(i);o=Ja.create(this,i,e),o.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:m}=f.state.selection;h=new To(m.empty?m:H.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of f.effects)m.is(Js)&&(h=m.value.clip(this.state))}this.viewState.update(o,h),this.bidiCache=tl.update(this.bidiCache,o.changes),o.empty||(this.updatePlugins(o),this.inputState.update(o)),n=this.docView.update(o),this.state.facet($i)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(o.startState.facet(ia)!=o.state.facet(ia)&&(this.viewState.mustMeasureContent=!0),(n||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!o.empty)for(let f of this.state.facet($u))try{f(o)}catch(m){Ct(this.state,m,"update listener")}(l||d)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),d&&!k5(this,d)&&c.force&&ko(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new P1(e),this.plugins=e.facet(go).map(r=>new Kc(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new S1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(go),r=e.state.facet(go);if(n!=r){let o=[];for(let i of r){let s=n.indexOf(i);if(s<0)o.push(new Kc(i));else{let a=this.plugins[s];a.mustUpdate=e,o.push(a)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o<this.plugins.length;o++)this.plugins[o].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Ct(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,o=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:s}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(Kb(r))i=-1,s=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(o);i=m.from,s=m.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let d=c.map(m=>{try{return m.read(this)}catch(b){return Ct(this.state,b),K1}}),h=Ja.create(this,this.state,[]),f=!1;h.flags|=l,n?n.flags|=l:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let m=0;m<c.length;m++)if(d[m]!=K1)try{let b=c[m];b.write&&b.write(d[m],this)}catch(b){Ct(this.state,b)}if(f&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let b=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-s;if(b>1||b<-1){o=o+b,r.scrollTop=o/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet($u))a(n)}get themeClasses(){return Ru+" "+(this.state.facet(Tu)?B5:N5)+" "+this.state.facet(ia)}updateAttrs(){let e=G1(this,w5,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Fn)?"true":"false",class:"cm-content",style:`${te.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),G1(this,Af,n);let r=this.observer.ignore(()=>{let o=vu(this.contentDOM,this.contentAttrs,n),i=vu(this.dom,this.editorAttrs,e);return o||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let o of r.effects)if(o.is(Q.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=o.value}}mountStyles(){this.styleModules=this.state.facet($i);let e=this.state.facet(Q.cspNonce);fr.mount(this.root,this.styleModules.concat(bE).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return Yc(this,e,M1(this,e,n,r))}moveByGroup(e,n){return Yc(this,e,M1(this,e,n,r=>DM(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),o=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return H.cursor(i.side(n,o)+e.from,i.forward(!n,o)?1:-1)}moveToLineBoundary(e,n,r=!0){return jM(this,e,n,r)}moveVertically(e,n,r){return Yc(this,e,OM(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),A5(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let o=this.state.doc.lineAt(e),i=this.bidiSpans(o),s=i[sr.find(i,e-o.from,-1,n)];return ms(r,s.dir==Oe.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(p5)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>CE)return l5(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||a5(i.isolates,r=$1(this,e))))return i.order;r||(r=$1(this,e));let o=pM(e.text,n,r);return this.bidiCache.push(new tl(e.from,e.to,n,r,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||te.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{qb(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Js.of(new To(typeof e=="number"?H.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Js.of(new To(H.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return We.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return We.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=fr.newName(),o=[ia.of(r),$i.of(Mu(`.${r}`,e))];return n&&n.dark&&o.push(Tu.of(!0)),o}static baseTheme(e){return to.lowest($i.of(Mu("."+Ru,e,F5)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),o=r&&Ie.get(r)||Ie.get(e);return((n=o?.rootView)===null||n===void 0?void 0:n.view)||null}}Q.styleModule=$i;Q.inputHandler=m5;Q.clipboardInputFilter=$f;Q.clipboardOutputFilter=Sf;Q.scrollHandler=v5;Q.focusChangeEffect=g5;Q.perLineTextDirection=p5;Q.exceptionSink=f5;Q.updateListener=$u;Q.editable=Fn;Q.mouseSelectionStyle=h5;Q.dragMovesSelection=u5;Q.clickAddsSelectionRange=d5;Q.decorations=Ui;Q.outerDecorations=y5;Q.atomicRanges=kf;Q.bidiIsolatedRanges=C5;Q.scrollMargins=$5;Q.darkTheme=Tu;Q.cspNonce=ne.define({combine:t=>t.length?t[0]:""});Q.contentAttributes=Af;Q.editorAttributes=w5;Q.lineWrapping=Q.contentAttributes.of({class:"cm-lineWrapping"});Q.announce=me.define();const CE=4096,K1={};class tl{constructor(e,n,r,o,i,s){this.from=e,this.to=n,this.dir=r,this.isolates=o,this.fresh=i,this.order=s}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],o=e.length?e[e.length-1].dir:Oe.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let s=e[i];s.dir==o&&!n.touchesRange(s.from,s.to)&&r.push(new tl(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function G1(t,e,n){for(let r=t.state.facet(e),o=r.length-1;o>=0;o--){let i=r[o],s=typeof i=="function"?i(t):i;s&&bu(s,n)}return n}const $E=te.mac?"mac":te.windows?"win":te.linux?"linux":"key";function SE(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let o,i,s,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))o=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return o&&(r="Alt-"+r),i&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function sa(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const AE=to.default(Q.domEventHandlers({keydown(t,e){return _5(V5(e.state),t,e,"editor")}})),Yl=ne.define({enables:AE}),Y1=new WeakMap;function V5(t){let e=t.facet(Yl),n=Y1.get(e);return n||Y1.set(e,n=RE(e.reduce((r,o)=>r.concat(o),[]))),n}function kE(t,e,n){return _5(V5(t.state),e,t,n)}let nr=null;const TE=4e3;function RE(t,e=$E){let n=Object.create(null),r=Object.create(null),o=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},i=(s,a,l,c,d)=>{var h,f;let m=n[s]||(n[s]=Object.create(null)),b=a.split(/ (?!$)/).map(x=>SE(x,e));for(let x=1;x<b.length;x++){let y=b.slice(0,x).join(" ");o(y,!0),m[y]||(m[y]={preventDefault:!0,stopPropagation:!1,run:[$=>{let S=nr={view:$,prefix:y,scope:s};return setTimeout(()=>{nr==S&&(nr=null)},TE),!0}]})}let p=b.join(" ");o(p,!1);let v=m[p]||(m[p]={preventDefault:!1,stopPropagation:!1,run:((f=(h=m._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&v.run.push(l),c&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let d=n[c]||(n[c]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=s;for(let f in d)d[f].run.push(m=>h(m,Eu))}let l=s[e]||s.key;if(l)for(let c of a)i(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&i(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let Eu=null;function _5(t,e,n,r){Eu=e;let o=XR(e),i=xt(o,0),s=un(i)==o.length&&o!=" ",a="",l=!1,c=!1,d=!1;nr&&nr.view==n&&nr.scope==r&&(a=nr.prefix+" ",R5.indexOf(e.keyCode)<0&&(c=!0,nr=null));let h=new Set,f=v=>{if(v){for(let x of v.run)if(!h.has(x)&&(h.add(x),x(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),c=!0)}return!1},m=t[r],b,p;return m&&(f(m[a+sa(o,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(te.windows&&e.ctrlKey&&e.altKey)&&!(te.mac&&e.altKey&&!e.ctrlKey)&&(b=mr[e.keyCode])&&b!=o?(f(m[a+sa(b,e,!0)])||e.shiftKey&&(p=Wi[e.keyCode])!=o&&p!=b&&f(m[a+sa(p,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(m[a+sa(o,e,!0)])&&(l=!0),!l&&f(m._any)&&(l=!0)),c&&(l=!0),l&&d&&e.stopPropagation(),Eu=null,l}class bs{constructor(e,n,r,o,i){this.className=e,this.left=n,this.top=r,this.width=o,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let o=e.coordsAtPos(r.head,r.assoc||1);if(!o)return[];let i=z5(e);return[new bs(n,o.left-i.left,o.top-i.top,null,o.bottom-o.top)]}else return ME(e,n,r)}}function z5(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Oe.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function X1(t,e,n,r){let o=t.coordsAtPos(e,n*2);if(!o)return r;let i=t.dom.getBoundingClientRect(),s=(o.top+o.bottom)/2,a=t.posAtCoords({x:i.left+1,y:s}),l=t.posAtCoords({x:i.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function ME(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),o=Math.min(n.to,t.viewport.to),i=t.textDirection==Oe.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=z5(t),c=s.querySelector(".cm-line"),d=c&&window.getComputedStyle(c),h=a.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),f=a.right-(d?parseInt(d.paddingRight):0),m=Au(t,r,1),b=Au(t,o,-1),p=m.type==pt.Text?m:null,v=b.type==pt.Text?b:null;if(p&&(t.lineWrapping||m.widgetLineBreaks)&&(p=X1(t,r,1,p)),v&&(t.lineWrapping||b.widgetLineBreaks)&&(v=X1(t,o,-1,v)),p&&v&&p.from==v.from&&p.to==v.to)return y($(n.from,n.to,p));{let A=p?$(n.from,null,p):S(m,!1),k=v?$(null,n.to,v):S(b,!0),T=[];return(p||m).to<(v||b).from-(p&&v?1:0)||m.widgetLineBreaks>1&&A.bottom+t.defaultLineHeight/2<k.top?T.push(x(h,A.bottom,f,k.top)):A.bottom<k.top&&t.elementAtHeight((A.bottom+k.top)/2).type==pt.Text&&(A.bottom=k.top=(A.bottom+k.top)/2),y(A).concat(T).concat(y(k))}function x(A,k,T,I){return new bs(e,A-l.left,k-l.top,T-A,I-k)}function y({top:A,bottom:k,horizontal:T}){let I=[];for(let E=0;E<T.length;E+=2)I.push(x(T[E],A,T[E+1],k));return I}function $(A,k,T){let I=1e9,E=-1e9,j=[];function L(V,W,G,P,_){let O=t.coordsAtPos(V,V==T.to?-2:2),X=t.coordsAtPos(G,G==T.from?2:-2);!O||!X||(I=Math.min(O.top,X.top,I),E=Math.max(O.bottom,X.bottom,E),_==Oe.LTR?j.push(i&&W?h:O.left,i&&P?f:X.right):j.push(!i&&P?h:X.left,!i&&W?f:O.right))}let D=A??T.from,z=k??T.to;for(let V of t.visibleRanges)if(V.to>D&&V.from<z)for(let W=Math.max(V.from,D),G=Math.min(V.to,z);;){let P=t.state.doc.lineAt(W);for(let _ of t.bidiSpans(P)){let O=_.from+P.from,X=_.to+P.from;if(O>=G)break;X>W&&L(Math.max(O,W),A==null&&O<=D,Math.min(X,G),k==null&&X>=z,_.dir)}if(W=P.to+1,W>=G)break}return j.length==0&&L(D,A==null,z,k==null,t.textDirection),{top:I,bottom:E,horizontal:j}}function S(A,k){let T=a.top+(k?A.top:A.bottom);return{top:T,bottom:T,horizontal:[]}}}function EE(t,e){return t.constructor==e.constructor&&t.eq(e)}class IE{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Ta)!=e.state.facet(Ta)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Ta);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!EE(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let o of e)o.update&&n&&o.constructor&&this.drawn[r].constructor&&o.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(o.draw(),n);for(;n;){let o=n.nextSibling;n.remove(),n=o}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ta=ne.define();function H5(t){return[We.define(e=>new IE(e,t)),Ta.of(t)]}const Ki=ne.define({combine(t){return En(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function jE(t={}){return[Ki.of(t),DE,OE,LE,b5.of(!0)]}function P5(t){return t.startState.facet(Ki)!=t.state.facet(Ki)}const DE=H5({above:!0,markers(t){let{state:e}=t,n=e.facet(Ki),r=[];for(let o of e.selection.ranges){let i=o==e.selection.main;if(o.empty||n.drawRangeCursor){let s=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=o.empty?o:H.cursor(o.head,o.head>o.anchor?-1:1);for(let l of bs.forRange(t,s,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=P5(t);return n&&Q1(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Q1(e.state,t)},class:"cm-cursorLayer"});function Q1(t,e){e.style.animationDuration=t.facet(Ki).cursorBlinkRate+"ms"}const OE=H5({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:bs.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||P5(t)},class:"cm-selectionLayer"}),LE=to.highest(Q.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),W5=me.define({map(t,e){return t==null?null:e.mapPos(t)}}),ki=tt.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(W5)?r.value:n,t)}}),NE=We.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(ki);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(ki)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(ki),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(ki)!=t&&this.view.dispatch({effects:W5.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function BE(){return[ki,NE]}function Z1(t,e,n,r,o){e.lastIndex=0;for(let i=t.iterRange(n,r),s=n,a;!i.next().done;s+=i.value.length)if(!i.lineBreak)for(;a=e.exec(i.value);)o(s+a.index,a)}function FE(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:o,to:i}of n)o=Math.max(t.state.doc.lineAt(o).from,o-e),i=Math.min(t.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=o?r[r.length-1].to=i:r.push({from:o,to:i});return r}class VE{constructor(e){const{regexp:n,decoration:r,decorate:o,boundary:i,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,o)this.addMatch=(a,l,c,d)=>o(d,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,d)=>{let h=r(a,l,c);h&&d(c,c+a[0].length,h)};else if(r)this.addMatch=(a,l,c,d)=>d(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=s}createDeco(e){let n=new qn,r=n.add.bind(n);for(let{from:o,to:i}of FE(e,this.maxLength))Z1(e.state.doc,this.regexp,o,i,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,o=-1;return e.docChanged&&e.changes.iterChanges((i,s,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),o=Math.max(l,o))}),e.viewportMoved||o-r>1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,n.map(e.changes),r,o):n}updateRange(e,n,r,o){for(let i of e.visibleRanges){let s=Math.max(i.from,r),a=Math.min(i.to,o);if(a>=s){let l=e.state.doc.lineAt(s),c=l.to<a?e.state.doc.lineAt(a):l,d=Math.max(i.from,l.from),h=Math.min(i.to,c.to);if(this.boundary){for(;s>l.from;s--)if(this.boundary.test(l.text[s-1-l.from])){d=s;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let f=[],m,b=(p,v,x)=>f.push(x.range(p,v));if(l==c)for(this.regexp.lastIndex=d-l.from;(m=this.regexp.exec(l.text))&&m.index<h-l.from;)this.addMatch(m,e,m.index+l.from,b);else Z1(e.state.doc,this.regexp,d,h,(p,v)=>this.addMatch(v,e,p,b));n=n.update({filterFrom:d,filterTo:h,filter:(p,v)=>p<d||v>h,add:f})}}return n}}const Iu=/x/.unicode!=null?"gu":"g",_E=new RegExp(`[\0-\b
|
|
63
|
-
--\u2028\u2029\uFEFF-]`,Iu),zE={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Zc=null;function HE(){var t;if(Zc==null&&typeof document<"u"&&document.body){let e=document.body.style;Zc=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Zc||!1}const Ra=ne.define({combine(t){let e=En(t,{render:null,specialChars:_E,addSpecialChars:null});return(e.replaceTabs=!HE())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Iu)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Iu)),e}});function PE(t={}){return[Ra.of(t),WE()]}let J1=null;function WE(){return J1||(J1=We.fromClass(class{constructor(t){this.view=t,this.decorations=ae.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Ra)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new VE({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:o}=n.state,i=xt(e[0],0);if(i==9){let s=o.lineAt(r),a=n.state.tabSize,l=ri(s.text,a,r-s.from);return ae.replace({widget:new GE((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=ae.replace({widget:new KE(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Ra);t.startState.facet(Ra)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const qE="•";function UE(t){return t>=32?qE:t==10?"":String.fromCharCode(9216+t)}class KE extends Qn{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=UE(this.code),r=e.state.phrase("Control character")+" "+(zE[this.code]||"0x"+this.code.toString(16)),o=this.options.render&&this.options.render(this.code,r,n);if(o)return o;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class GE extends Qn{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function YE(){return QE}const XE=ae.line({class:"cm-activeLine"}),QE=We.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let o=t.lineBlockAt(r.head);o.from>e&&(n.push(XE.range(o.from)),e=o.from)}return ae.set(n)}},{decorations:t=>t.decorations});class ZE extends Qn{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?_o(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),o=ms(n[0],r.direction!="rtl"),i=parseInt(r.lineHeight);return o.bottom-o.top>i*1.5?{left:o.left,right:o.right,top:o.top,bottom:o.top+i}:o}ignoreEvent(){return!1}}function JE(t){let e=We.fromClass(class{constructor(n){this.view=n,this.placeholder=t?ae.set([ae.widget({widget:new ZE(t),side:1}).range(0)]):ae.none}get decorations(){return this.view.state.doc.length?ae.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Q.contentAttributes.of({"aria-placeholder":t})]:e}const ju=2e3;function eI(t,e,n){let r=Math.min(e.line,n.line),o=Math.max(e.line,n.line),i=[];if(e.off>ju||n.off>ju||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=o;l++){let c=t.doc.line(l);c.length<=a&&i.push(H.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=o;l++){let c=t.doc.line(l),d=du(c.text,s,t.tabSize,!0);if(d<0)i.push(H.cursor(c.to));else{let h=du(c.text,a,t.tabSize);i.push(H.range(c.from+d,c.from+h))}}}return i}function tI(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function em(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),o=n-r.from,i=o>ju?-1:o==r.length?tI(t,e.clientX):ri(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:o}}function nI(t,e){let n=em(t,e),r=t.state.selection;return n?{update(o){if(o.docChanged){let i=o.changes.mapPos(o.startState.doc.line(n.line).from),s=o.state.doc.lineAt(i);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(o.changes)}},get(o,i,s){let a=em(t,o);if(!a)return r;let l=eI(t.state,n,a);return l.length?s?H.create(l.concat(r.ranges)):H.create(l):r}}:null}function rI(t){let e=n=>n.altKey&&n.button==0;return Q.mouseSelectionStyle.of((n,r)=>e(r)?nI(n,r):null)}const oI={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},iI={style:"cursor: crosshair"};function sI(t={}){let[e,n]=oI[t.key||"Alt"],r=We.fromClass(class{constructor(o){this.view=o,this.isDown=!1}set(o){this.isDown!=o&&(this.isDown=o,this.view.update([]))}},{eventObservers:{keydown(o){this.set(o.keyCode==e||n(o))},keyup(o){(o.keyCode==e||!n(o))&&this.set(!1)},mousemove(o){this.set(n(o))}}});return[r,Q.contentAttributes.of(o=>{var i;return!((i=o.plugin(r))===null||i===void 0)&&i.isDown?iI:null})]}const mi="-10000px";class q5{constructor(e,n,r,o){this.facet=n,this.createTooltipView=r,this.removeTooltipView=o,this.input=e.state.facet(n),this.tooltips=this.input.filter(s=>s);let i=null;this.tooltipViews=this.tooltips.map(s=>i=r(s,i))}update(e,n){var r;let o=e.state.facet(this.facet),i=o.filter(l=>l);if(o===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=n?[]:null;for(let l=0;l<i.length;l++){let c=i[l],d=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==c.create&&(d=h)}if(d<0)s[l]=this.createTooltipView(c,l?s[l-1]:null),a&&(a[l]=!!c.above);else{let h=s[l]=this.tooltipViews[d];a&&(a[l]=n[d]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)s.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,c)=>n[c]=l),n.length=a.length),this.input=o,this.tooltips=i,this.tooltipViews=s,!0}}function aI(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Jc=ne.define({combine:t=>{var e,n,r;return{position:te.ios?"absolute":((e=t.find(o=>o.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(o=>o.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(o=>o.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||aI}}}),tm=new WeakMap,If=We.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Jc);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new q5(t,jf,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Jc);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let o of this.manager.tooltipViews)o.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let o of this.manager.tooltipViews)this.container.appendChild(o.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let o=document.createElement("div");o.className="cm-tooltip-arrow",n.dom.appendChild(o)}return n.dom.style.position=this.position,n.dom.style.top=mi,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(te.gecko)n=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==mi&&i.style.left=="0px"){let s=i.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),o=Tf(this.view);return{visible:{left:r.left+o.left,top:r.top+o.top,right:r.right-o.right,bottom:r.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Jc).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:o,scaleY:i}=t,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:d}=c,h=t.pos[a],f=t.size[a];if(!h||l.clip!==!1&&(h.bottom<=Math.max(n.top,r.top)||h.top>=Math.min(n.bottom,r.bottom)||h.right<Math.max(n.left,r.left)-.1||h.left>Math.min(n.right,r.right)+.1)){d.style.top=mi;continue}let m=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,b=m?7:0,p=f.right-f.left,v=(e=tm.get(c))!==null&&e!==void 0?e:f.bottom-f.top,x=c.offset||cI,y=this.view.textDirection==Oe.LTR,$=f.width>r.right-r.left?y?r.left:r.right-f.width:y?Math.max(r.left,Math.min(h.left-(m?14:0)+x.x,r.right-p)):Math.min(Math.max(r.left,h.left-p+(m?14:0)-x.x),r.right-p),S=this.above[a];!l.strictSide&&(S?h.top-v-b-x.y<r.top:h.bottom+v+b+x.y>r.bottom)&&S==r.bottom-h.bottom>h.top-r.top&&(S=this.above[a]=!S);let A=(S?h.top-r.top:r.bottom-h.bottom)-b;if(A<v&&c.resize!==!1){if(A<this.view.defaultLineHeight){d.style.top=mi;continue}tm.set(c,v),d.style.height=(v=A)/i+"px"}else d.style.height&&(d.style.height="");let k=S?h.top-v-b-x.y:h.bottom+b+x.y,T=$+p;if(c.overlap!==!0)for(let I of s)I.left<T&&I.right>$&&I.top<k+v&&I.bottom>k&&(k=S?I.top-v-2-b:I.bottom+b+2);if(this.position=="absolute"?(d.style.top=(k-t.parent.top)/i+"px",nm(d,($-t.parent.left)/o)):(d.style.top=k/i+"px",nm(d,$/o)),m){let I=h.left+(y?x.x:-x.x)-($+14-7);m.style.left=I/o+"px"}c.overlap!==!0&&s.push({left:$,top:k,right:T,bottom:k+v}),d.classList.toggle("cm-tooltip-above",S),d.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=mi}},{eventObservers:{scroll(){this.maybeMeasure()}}});function nm(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const lI=Q.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),cI={x:0,y:0},jf=ne.define({enables:[If,lI]}),nl=ne.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Xl{static create(e){return new Xl(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new q5(e,nl,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let o=r[e];if(o!==void 0){if(n===void 0)n=o;else if(n!==o)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const dI=jf.compute([nl],t=>{let e=t.facet(nl);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:Xl.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class uI{constructor(e,n,r,o,i){this.view=e,this.source=n,this.field=r,this.setHover=o,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let o,i=1;if(r instanceof ir)o=r.posAtStart;else{if(o=e.posAtCoords(n),o==null)return;let a=e.coordsAtPos(o);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-e.defaultCharacterWidth||n.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(o)).find(d=>d.from<=o&&d.to>=o),c=l&&l.dir==Oe.RTL?-1:1;i=n.x<a.left?-c:c}let s=this.source(e,o,i);if(s?.then){let a=this.pending={pos:o};s.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Ct(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(If),n=e?e.manager.tooltips.findIndex(r=>r.create==Xl.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:o,tooltip:i}=this;if(o.length&&i&&!hI(i.dom,e)||this.pending){let{pos:s}=o[0]||this.pending,a=(r=(n=o[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!fI(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const aa=4;function hI(t,e){let{left:n,right:r,top:o,bottom:i}=t.getBoundingClientRect(),s;if(s=t.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();o=Math.min(a.top,o),i=Math.max(a.bottom,i)}return e.clientX>=n-aa&&e.clientX<=r+aa&&e.clientY>=o-aa&&e.clientY<=i+aa}function fI(t,e,n,r,o,i){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.right<r||s.top>o||Math.min(s.bottom,a)<o)return!1;let l=t.posAtCoords({x:r,y:o},!1);return l>=e&&l<=n}function mI(t,e={}){let n=me.define(),r=tt.define({create(){return[]},update(o,i){if(o.length&&(e.hideOnChange&&(i.docChanged||i.selection)?o=[]:e.hideOn&&(o=o.filter(s=>!e.hideOn(i,s))),i.docChanged)){let s=[];for(let a of o){let l=i.changes.mapPos(a.pos,-1,gt.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=i.changes.mapPos(c.end)),s.push(c)}}o=s}for(let s of i.effects)s.is(n)&&(o=s.value),s.is(gI)&&(o=[]);return o},provide:o=>nl.from(o)});return{active:r,extension:[r,We.define(o=>new uI(o,t,r,n,e.hoverTime||300)),dI]}}function U5(t,e){let n=t.plugin(If);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const gI=me.define(),rm=ne.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Gi(t,e){let n=t.plugin(K5),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const K5=We.fromClass(class{constructor(t){this.input=t.state.facet(Yi),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(rm);this.top=new la(t,!0,e.topContainer),this.bottom=new la(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(rm);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new la(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new la(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Yi);if(n!=this.input){let r=n.filter(l=>l),o=[],i=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),d;c<0?(d=l(t.view),a.push(d)):(d=this.panels[c],d.update&&d.update(t)),o.push(d),(d.top?i:s).push(d)}this.specs=r,this.panels=o,this.top.sync(i),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Q.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class la{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=om(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=om(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function om(t){let e=t.nextSibling;return t.remove(),e}const Yi=ne.define({enables:K5});class Kn extends Hr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Kn.prototype.elementClass="";Kn.prototype.toDOM=void 0;Kn.prototype.mapMode=gt.TrackBefore;Kn.prototype.startSide=Kn.prototype.endSide=-1;Kn.prototype.point=!0;const Ma=ne.define(),pI=ne.define(),bI={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ae.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},ji=ne.define();function vI(t){return[G5(),ji.of({...bI,...t})]}const im=ne.define({combine:t=>t.some(e=>e)});function G5(t){return[xI]}const xI=We.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ji).map(e=>new am(t,e)),this.fixed=!t.state.facet(im);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(im)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ae.iter(this.view.state.facet(Ma),this.view.viewport.from),r=[],o=this.gutters.map(i=>new wI(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let s=!0;for(let a of i.type)if(a.type==pt.Text&&s){Du(n,r,a.from);for(let l of o)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of o)l.widget(this.view,a)}else if(i.type==pt.Text){Du(n,r,i.from);for(let s of o)s.line(this.view,i,r)}else if(i.widget)for(let s of o)s.widget(this.view,i);for(let i of o)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(ji),n=t.state.facet(ji),r=t.docChanged||t.heightChanged||t.viewportChanged||!Ae.eq(t.startState.facet(Ma),t.state.facet(Ma),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let o of this.gutters)o.update(t)&&(r=!0);else{r=!0;let o=[];for(let i of n){let s=e.indexOf(i);s<0?o.push(new am(this.view,i)):(this.gutters[s].update(t),o.push(this.gutters[s]))}for(let i of this.gutters)i.dom.remove(),o.indexOf(i)<0&&i.destroy();for(let i of o)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=o}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Q.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,o=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Oe.LTR?{left:r,right:o}:{right:r,left:o}})});function sm(t){return Array.isArray(t)?t:[t]}function Du(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class wI{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Ae.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:o}=this,i=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==o.elements.length){let a=new Y5(e,s,i,r);o.elements.push(a),o.dom.appendChild(a.dom)}else o.elements[this.i].update(e,s,i,r);this.height=n.bottom,this.i++}line(e,n,r){let o=[];Du(this.cursor,o,n.from),r.length&&(o=o.concat(r));let i=this.gutter.config.lineMarker(e,n,o);i&&o.unshift(i);let s=this.gutter;o.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,o)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),o=r?[r]:null;for(let i of e.state.facet(pI)){let s=i(e,n.widget,n);s&&(o||(o=[])).push(s)}o&&this.addElement(e,n,o)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class am{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,o=>{let i=o.target,s;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let l=i.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=o.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,o)&&o.preventDefault()});this.markers=sm(n.markers(e)),n.initialSpacer&&(this.spacer=new Y5(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=sm(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let o=this.config.updateSpacer(this.spacer.markers[0],e);o!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[o])}let r=e.view.viewport;return!Ae.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Y5{constructor(e,n,r,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,o)}update(e,n,r,o){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),yI(this.markers,o)||this.setMarkers(e,o)}setMarkers(e,n){let r="cm-gutterElement",o=this.dom.firstChild;for(let i=0,s=0;;){let a=s,l=i<n.length?n[i++]:null,c=!1;if(l){let d=l.elementClass;d&&(r+=" "+d);for(let h=s;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;s<a;){let d=this.markers[s++];if(d.toDOM){d.destroy(o);let h=o.nextSibling;o.remove(),o=h}}if(!l)break;l.toDOM&&(c?o=o.nextSibling:this.dom.insertBefore(l.toDOM(e),o)),c&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function yI(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const CI=ne.define(),$I=ne.define(),po=ne.define({combine(t){return En(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let o in n){let i=r[o],s=n[o];r[o]=i?(a,l,c)=>i(a,l,c)||s(a,l,c):s}return r}})}});class ed extends Kn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function td(t,e){return t.state.facet(po).formatNumber(e,t.state)}const SI=ji.compute([po],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(CI)},lineMarker(e,n,r){return r.some(o=>o.toDOM)?null:new ed(td(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let o of e.state.facet($I)){let i=o(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(po)!=e.state.facet(po),initialSpacer(e){return new ed(td(e,lm(e.state.doc.lines)))},updateSpacer(e,n){let r=td(n.view,lm(n.view.state.doc.lines));return r==e.number?e:new ed(r)},domEventHandlers:t.facet(po).domEventHandlers,side:"before"}));function AI(t={}){return[po.of(t),G5(),SI]}function lm(t){let e=9;for(;e<t;)e=e*10+9;return e}const kI=new class extends Kn{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},TI=Ma.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head).from;o>n&&(n=o,e.push(kI.range(o)))}return Ae.of(e)});function RI(){return TI}var nd;const bo=new we;function MI(t){return ne.define({combine:t?e=>e.concat(t):void 0})}const EI=new we;class Gt{constructor(e,n,r=[],o=""){this.data=e,this.name=o,$e.prototype.hasOwnProperty("tree")||Object.defineProperty($e.prototype,"tree",{get(){return ht(this)}}),this.parser=n,this.extension=[pr.of(this),$e.languageData.of((i,s,a)=>{let l=cm(i,s,a),c=l.type.prop(bo);if(!c)return[];let d=i.facet(c),h=l.type.prop(EI);if(h){let f=l.resolve(s-l.from,a);for(let m of h)if(m.test(f,i)){let b=i.facet(m.facet);return m.type=="replace"?b:b.concat(d)}}return d})].concat(r)}isActiveAt(e,n,r=-1){return cm(e,n,r).type.prop(bo)==this.data}findRegions(e){let n=e.facet(pr);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],o=(i,s)=>{if(i.prop(bo)==this.data){r.push({from:s,to:s+i.length});return}let a=i.prop(we.mounted);if(a){if(a.tree.prop(bo)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+i.length});return}else if(a.overlay){let l=r.length;if(o(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<i.children.length;l++){let c=i.children[l];c instanceof Ge&&o(c,i.positions[l]+s)}};return o(ht(e),0),r}get allowsNesting(){return!0}}Gt.setState=me.define();function cm(t,e,n){let r=t.facet(pr),o=ht(t).topNode;if(!r||r.allowsNesting)for(let i=o;i;i=i.enter(e,n,Ze.ExcludeBuffers))i.type.isTop&&(o=i);return o}class rl extends Gt{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=MI(e.languageData);return new rl(n,e.parser.configure({props:[bo.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new rl(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ht(t){let e=t.field(Gt.state,!1);return e?e.tree:Ge.empty}class II{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let gi=null;class ol{constructor(e,n,r=[],o,i,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=o,this.treeLen=i,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new ol(e,n,[],Ge.empty,0,r,[],null)}startParse(){return this.parser.startParse(new II(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ge.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let o=Date.now()+e;e=()=>Date.now()>o}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let o=this.parse.advance();if(o)if(this.fragments=this.withoutTempSkipped(Or.addTree(o,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=o,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Or.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=gi;gi=this;try{return e()}finally{gi=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=dm(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:o,treeLen:i,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,d,h,f)=>l.push({fromA:c,toA:d,fromB:h,toB:f})),r=Or.applyChanges(r,l),o=Ge.empty,i=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);d<h&&a.push({from:d,to:h})}}}return new ol(this.parser,n,r,o,i,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:o,to:i}=this.skipped[r];o<e.to&&i>e.from&&(this.fragments=dm(this.fragments,o,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends yb{createParse(n,r,o){let i=o[0].from,s=o[o.length-1].to;return{parsedPos:i,advance(){let l=gi;if(l){for(let c of o)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new Ge(St.none,[],[],s-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return gi}}function dm(t,e,n){return Or.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Wo{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Wo(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=ol.create(e.facet(pr).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Wo(r)}}Gt.state=tt.define({create:Wo.init,update(t,e){for(let n of e.effects)if(n.is(Gt.setState))return n.value;return e.startState.facet(pr)!=e.state.facet(pr)?Wo.init(e.state):t.apply(e)}});let X5=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(X5=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const rd=typeof navigator<"u"&&(!((nd=navigator.scheduling)===null||nd===void 0)&&nd.isInputPending)?()=>navigator.scheduling.isInputPending():null,jI=We.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Gt.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Gt.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=X5(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:o}}=this.view,i=r.field(Gt.state);if(i.tree==i.context.tree&&i.context.isDone(o+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!rd?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<o&&r.doc.length>o+1e3,l=i.context.work(()=>rd&&rd()||Date.now()>s,o+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Gt.setState.of(new Wo(i.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ct(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),pr=ne.define({combine(t){return t.length?t[0]:null},enables:t=>[Gt.state,jI,Q.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class DI{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const OI=ne.define(),Ql=ne.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function il(t){let e=t.facet(Ql);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Xi(t,e){let n="",r=t.tabSize,o=t.facet(Ql)[0];if(o==" "){for(;e>=r;)n+=" ",e-=r;o=" "}for(let i=0;i<e;i++)n+=o;return n}function Df(t,e){t instanceof $e&&(t=new Zl(t));for(let r of t.state.facet(OI)){let o=r(t,e);if(o!==void 0)return o}let n=ht(t.state);return n.length>=e?LI(t,n,e):null}class Zl{constructor(e,n={}){this.state=e,this.options=n,this.unit=il(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:i}=this.options;return o!=null&&o>=r.from&&o<=r.to?i&&o==e?{text:"",from:e}:(n<0?o<e:o<=e)?{text:r.text.slice(o-r.from),from:o}:{text:r.text.slice(0,o-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:o}=this.lineAt(e,n);return r.slice(e-o,Math.min(r.length,e+100-o))}column(e,n=1){let{text:r,from:o}=this.lineAt(e,n),i=this.countColumn(r,e-o),s=this.options.overrideIndentation?this.options.overrideIndentation(o):-1;return s>-1&&(i+=s-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return ri(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:o}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let s=i(o);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Q5=new we;function LI(t,e,n){let r=e.resolveStack(n),o=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(o!=r.node){let i=[];for(let s=o;s&&!(s.from<r.node.from||s.to>r.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)i.push(s);for(let s=i.length-1;s>=0;s--)r={node:i[s],next:r}}return Z5(r,t,n)}function Z5(t,e,n){for(let r=t;r;r=r.next){let o=BI(r.node);if(o)return o(Of.create(e,n,r))}return 0}function NI(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function BI(t){let e=t.type.prop(Q5);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(we.closedBy))){let o=t.lastChild,i=o&&r.indexOf(o.name)>-1;return s=>zI(s,!0,1,void 0,i&&!NI(s)?o.from:void 0)}return t.parent==null?FI:null}function FI(){return 0}class Of extends Zl{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Of(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(VI(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Z5(this.context.next,this.base,this.pos)}}function VI(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function _I(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let o=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),s=o==null||o<=i.from?i.to:Math.min(i.to,o);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function zI(t,e,n,r,o){let i=t.textAfter,s=i.match(/^\s*/)[0].length,a=r&&i.slice(s,s+r.length)==r||o==t.pos+s,l=_I(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function um({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const HI=200;function PI(){return $e.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,o=n.lineAt(r);if(r>o.from+HI)return t;let i=n.sliceString(o.from,r);if(!e.some(c=>c.test(i)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let d=s.doc.lineAt(c);if(d.from==a)continue;a=d.from;let h=Df(s,d.from);if(h==null)continue;let f=/^\s*/.exec(d.text)[0],m=Xi(s,h);f!=m&&l.push({from:d.from,to:d.from+f.length,insert:m})}return l.length?[t,{changes:l,sequential:!0}]:t})}const WI=ne.define(),J5=new we;function qI(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function UI(t,e,n){let r=ht(t);if(r.length<n)return null;let o=r.resolveStack(n,1),i=null;for(let s=o;s;s=s.next){let a=s.node;if(a.to<=n||a.from>n)continue;if(i&&a.from<e)break;let l=a.type.prop(J5);if(l&&(a.to<r.length-50||r.length==t.doc.length||!KI(a))){let c=l(a,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(i=c)}}return i}function KI(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function sl(t,e,n){for(let r of t.facet(WI)){let o=r(t,e,n);if(o)return o}return UI(t,e,n)}function ev(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Jl=me.define({map:ev}),vs=me.define({map:ev});function tv(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const Ur=tt.define({create(){return ae.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=hm(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Jl)&&!GI(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(ov),o=r?ae.replace({widget:new tj(r(e.state,n.value))}):fm;t=t.update({add:[o.range(n.value.from,n.value.to)]})}else n.is(vs)&&(t=t.update({filter:(r,o)=>n.value.from!=r||n.value.to!=o,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=hm(t,e.selection.main.head)),t},provide:t=>Q.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,o)=>{n.push(r,o)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],o=t[n++];if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid JSON for fold state");e.push(fm.range(r,o))}return ae.set(e,!0)}});function hm(t,e,n=e){let r=!1;return t.between(e,n,(o,i)=>{o<n&&i>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(o,i)=>o>=n||i<=e}):t}function al(t,e,n){var r;let o=null;return(r=t.field(Ur,!1))===null||r===void 0||r.between(e,n,(i,s)=>{(!o||o.from>i)&&(o={from:i,to:s})}),o}function GI(t,e,n){let r=!1;return t.between(e,e,(o,i)=>{o==e&&i==n&&(r=!0)}),r}function nv(t,e){return t.field(Ur,!1)?e:e.concat(me.appendConfig.of(iv()))}const YI=t=>{for(let e of tv(t)){let n=sl(t.state,e.from,e.to);if(n)return t.dispatch({effects:nv(t.state,[Jl.of(n),rv(t,n)])}),!0}return!1},XI=t=>{if(!t.state.field(Ur,!1))return!1;let e=[];for(let n of tv(t)){let r=al(t.state,n.from,n.to);r&&e.push(vs.of(r),rv(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function rv(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,o=t.state.doc.lineAt(e.to).number;return Q.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${o}.`)}const QI=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let o=t.lineBlockAt(r),i=sl(e,o.from,o.to);i&&n.push(Jl.of(i)),r=(i?t.lineBlockAt(i.to):o).to+1}return n.length&&t.dispatch({effects:nv(t.state,n)}),!!n.length},ZI=t=>{let e=t.state.field(Ur,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,o)=>{n.push(vs.of({from:r,to:o}))}),t.dispatch({effects:n}),!0},JI=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:YI},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:XI},{key:"Ctrl-Alt-[",run:QI},{key:"Ctrl-Alt-]",run:ZI}],ej={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ov=ne.define({combine(t){return En(t,ej)}});function iv(t){return[Ur,oj]}function sv(t,e){let{state:n}=t,r=n.facet(ov),o=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=al(t.state,a.from,a.to);l&&t.dispatch({effects:vs.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,o,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=o,i}const fm=ae.replace({widget:new class extends Qn{toDOM(t){return sv(t,null)}}});class tj extends Qn{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return sv(e,this.value)}}const nj={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class od extends Kn{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function rj(t={}){let e={...nj,...t},n=new od(e,!0),r=new od(e,!1),o=We.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(pr)!=s.state.facet(pr)||s.startState.field(Ur,!1)!=s.state.field(Ur,!1)||ht(s.startState)!=ht(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new qn;for(let l of s.viewportLineBlocks){let c=al(s.state,l.from,l.to)?r:sl(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:i}=e;return[o,vI({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(o))===null||a===void 0?void 0:a.markers)||Ae.empty},initialSpacer(){return new od(e,!1)},domEventHandlers:{...i,click:(s,a,l)=>{if(i.click&&i.click(s,a,l))return!0;let c=al(s.state,a.from,a.to);if(c)return s.dispatch({effects:vs.of(c)}),!0;let d=sl(s.state,a.from,a.to);return d?(s.dispatch({effects:Jl.of(d)}),!0):!1}}}),iv()]}const oj=Q.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class xs{constructor(e,n){this.specs=e;let r;function o(a){let l=fr.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const i=typeof n.all=="string"?n.all:n.all?o(n.all):void 0,s=n.scope;this.scope=s instanceof Gt?a=>a.prop(bo)==s.data:s?a=>a==s:void 0,this.style=Sb(e.map(a=>({tag:a.tag,class:a.class||o(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=r?new fr(r):null,this.themeType=n.themeType}static define(e,n){return new xs(e,n||{})}}const Ou=ne.define(),av=ne.define({combine(t){return t.length?[t[0]]:null}});function id(t){let e=t.facet(Ou);return e.length?e:t.facet(av)}function lv(t,e){let n=[sj],r;return t instanceof xs&&(t.module&&n.push(Q.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(av.of(t)):r?n.push(Ou.computeN([Q.darkTheme],o=>o.facet(Q.darkTheme)==(r=="dark")?[t]:[])):n.push(Ou.of(t)),n}class ij{constructor(e){this.markCache=Object.create(null),this.tree=ht(e.state),this.decorations=this.buildDeco(e,id(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ht(e.state),r=id(e.state),o=r!=id(e.startState),{viewport:i}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<i.to&&!o&&n.type==this.tree.type&&s>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||o)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return ae.none;let r=new qn;for(let{from:o,to:i}of e.visibleRanges)$R(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=ae.mark({class:l})))},o,i);return r.finish()}}const sj=to.high(We.fromClass(ij,{decorations:t=>t.decorations})),aj=xs.define([{tag:N.meta,color:"#404740"},{tag:N.link,textDecoration:"underline"},{tag:N.heading,textDecoration:"underline",fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strong,fontWeight:"bold"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.keyword,color:"#708"},{tag:[N.atom,N.bool,N.url,N.contentSeparator,N.labelName],color:"#219"},{tag:[N.literal,N.inserted],color:"#164"},{tag:[N.string,N.deleted],color:"#a11"},{tag:[N.regexp,N.escape,N.special(N.string)],color:"#e40"},{tag:N.definition(N.variableName),color:"#00f"},{tag:N.local(N.variableName),color:"#30a"},{tag:[N.typeName,N.namespace],color:"#085"},{tag:N.className,color:"#167"},{tag:[N.special(N.variableName),N.macroName],color:"#256"},{tag:N.definition(N.propertyName),color:"#00c"},{tag:N.comment,color:"#940"},{tag:N.invalid,color:"#f00"}]),lj=Q.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),cv=1e4,dv="()[]{}",uv=ne.define({combine(t){return En(t,{afterCursor:!0,brackets:dv,maxScanDistance:cv,renderMatch:uj})}}),cj=ae.mark({class:"cm-matchingBracket"}),dj=ae.mark({class:"cm-nonmatchingBracket"});function uj(t){let e=[],n=t.matched?cj:dj;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const hj=tt.define({create(){return ae.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(uv);for(let o of e.state.selection.ranges){if(!o.empty)continue;let i=mn(e.state,o.head,-1,r)||o.head>0&&mn(e.state,o.head-1,1,r)||r.afterCursor&&(mn(e.state,o.head,1,r)||o.head<e.state.doc.length&&mn(e.state,o.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,e.state)))}return ae.set(n,!0)},provide:t=>Q.decorations.from(t)}),fj=[hj,lj];function mj(t={}){return[uv.of(t),fj]}const gj=new we;function Lu(t,e,n){let r=t.prop(e<0?we.openedBy:we.closedBy);if(r)return r;if(t.name.length==1){let o=n.indexOf(t.name);if(o>-1&&o%2==(e<0?1:0))return[n[o+e]]}return null}function Nu(t){let e=t.type.prop(gj);return e?e(t.node):t}function mn(t,e,n,r={}){let o=r.maxScanDistance||cv,i=r.brackets||dv,s=ht(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Lu(l.type,n,i);if(c&&l.from<l.to){let d=Nu(l);if(d&&(n>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return pj(t,e,n,l,d,c,i)}}return bj(t,e,n,s,a.type,o,i)}function pj(t,e,n,r,o,i,s){let a=r.parent,l={from:o.from,to:o.to},c=0,d=a?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(c==0&&i.indexOf(d.type.name)>-1&&d.from<d.to){let h=Nu(d);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(Lu(d.type,n,s))c++;else if(Lu(d.type,-n,s)){if(c==0){let h=Nu(d);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(n<0?d.prevSibling():d.nextSibling());return{start:l,matched:!1}}function bj(t,e,n,r,o,i,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),h=0;for(let f=0;!d.next().done&&f<=i;){let m=d.value;n<0&&(f+=m.length);let b=e+f*n;for(let p=n>0?0:m.length-1,v=n>0?m.length:-1;p!=v;p+=n){let x=s.indexOf(m[p]);if(!(x<0||r.resolveInner(b+p,1).type!=o))if(x%2==0==n>0)h++;else{if(h==1)return{start:c,end:{from:b+p,to:b+p+1},matched:x>>1==l>>1};h--}}n>0&&(f+=m.length)}return d.done?{start:c,matched:!1}:null}const vj=Object.create(null),mm=[St.none],gm=[],pm=Object.create(null),xj=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])xj[t]=wj(vj,e);function sd(t,e){gm.indexOf(t)>-1||(gm.push(t),console.warn(e))}function wj(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let d=t[c]||N[c];d?typeof d=="function"?l.length?l=l.map(d):sd(c,`Modifier ${c} used at start of tag`):l.length?sd(c,`Tag ${c} used as modifier`):l=Array.isArray(d)?d:[d]:sd(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),o=r+" "+n.map(a=>a.id),i=pm[o];if(i)return i.id;let s=pm[o]=St.define({id:mm.length,name:r,props:[Cb({[r]:n})]});return mm.push(s),s.id}Oe.RTL,Oe.LTR;const yj=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=Cj(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function Cj(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const $j=rl.define({name:"json",parser:TR.configure({props:[Q5.add({Object:um({except:/^\s*\}/}),Array:um({except:/^\s*\]/})}),J5.add({"Object Array":qI})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Sj(){return new DI($j)}function Aj(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}const kj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Nf(t.state,n.from);return r.line?Tj(t):r.block?Mj(t):!1};function Lf(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=t(e,n);return o?(r(n.update(o)),!0):!1}}const Tj=Lf(jj,0),Rj=Lf(hv,0),Mj=Lf((t,e)=>hv(t,e,Ij(e)),0);function Nf(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const pi=50;function Ej(t,{open:e,close:n},r,o){let i=t.sliceDoc(r-pi,r),s=t.sliceDoc(o,o+pi),a=/\s*$/.exec(i)[0].length,l=/^\s*/.exec(s)[0].length,c=i.length-a;if(i.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:o+l,margin:l&&1}};let d,h;o-r<=2*pi?d=h=t.sliceDoc(r,o):(d=t.sliceDoc(r,r+pi),h=t.sliceDoc(o-pi,o));let f=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(h)[0].length,b=h.length-m-n.length;return d.slice(f,f+e.length)==e&&h.slice(b,b+n.length)==n?{open:{pos:r+f+e.length,margin:/\s/.test(d.charAt(f+e.length))?1:0},close:{pos:o-m-n.length,margin:/\s/.test(h.charAt(b-1))?1:0}}:null}function Ij(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),o=n.to<=r.to?r:t.doc.lineAt(n.to);o.from>r.from&&o.from==n.to&&(o=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=o.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return e}function hv(t,e,n=e.selection.ranges){let r=n.map(i=>Nf(e,i.from).block);if(!r.every(i=>i))return null;let o=n.map((i,s)=>Ej(e,r[s],i.from,i.to));if(t!=2&&!o.every(i=>i))return{changes:e.changes(n.map((i,s)=>o[s]?[]:[{from:i.from,insert:r[s].open+" "},{from:i.to,insert:" "+r[s].close}]))};if(t!=1&&o.some(i=>i)){let i=[];for(let s=0,a;s<o.length;s++)if(a=o[s]){let l=r[s],{open:c,close:d}=a;i.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:i}}return null}function jj(t,e,n=e.selection.ranges){let r=[],o=-1;for(let{from:i,to:s}of n){let a=r.length,l=1e9,c=Nf(e,i).line;if(c){for(let d=i;d<=s;){let h=e.doc.lineAt(d);if(h.from>o&&(i==s||s>h.from)){o=h.from;let f=/^\s*/.exec(h.text)[0].length,m=f==h.length,b=h.text.slice(f,f+c.length)==c?f:-1;f<h.text.length&&f<l&&(l=f),r.push({line:h,comment:b,token:c,indent:f,empty:m,single:!1})}d=h.to+1}if(l<1e9)for(let d=a;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=l);r.length==a+1&&(r[a].single=!0)}}if(t!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:a,token:l,indent:c,empty:d,single:h}of r)(h||!d)&&i.push({from:a.from+c,insert:l+" "});let s=e.changes(i);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,d=c+l.length;s.text[d-s.from]==" "&&d++,i.push({from:c,to:d})}return{changes:i}}return null}const Bu=Mn.define(),Dj=Mn.define(),Oj=ne.define(),fv=ne.define({combine(t){return En(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,o)=>e(r,o)||n(r,o)})}}),mv=tt.define({create(){return gn.empty},update(t,e){let n=e.state.facet(fv),r=e.annotation(Bu);if(r){let l=$t.fromTransaction(e,r.selection),c=r.side,d=c==0?t.undone:t.done;return l?d=ll(d,d.length,n.minDepth,l):d=bv(d,e.startState.selection),new gn(c==0?r.rest:d,c==0?d:r.rest)}let o=e.annotation(Dj);if((o=="full"||o=="before")&&(t=t.isolate()),e.annotation(Xe.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=$t.fromTransaction(e),s=e.annotation(Xe.time),a=e.annotation(Xe.userEvent);return i?t=t.addChanges(i,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(o=="full"||o=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new gn(t.done.map($t.fromJSON),t.undone.map($t.fromJSON))}});function Lj(t={}){return[mv,fv.of(t),Q.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?gv:e.inputType=="historyRedo"?Fu:null;return r?(e.preventDefault(),r(n)):!1}})]}function ec(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let o=n.field(mv,!1);if(!o)return!1;let i=o.pop(t,n,e);return i?(r(i),!0):!1}}const gv=ec(0,!1),Fu=ec(1,!1),Nj=ec(0,!0),Bj=ec(1,!0);class $t{constructor(e,n,r,o,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=o,this.selectionsAfter=i}setSelAfter(e){return new $t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(e){return new $t(e.changes&&Ye.fromJSON(e.changes),[],e.mapped&&vn.fromJSON(e.mapped),e.startSelection&&H.fromJSON(e.startSelection),e.selectionsAfter.map(H.fromJSON))}static fromTransaction(e,n){let r=Nt;for(let o of e.startState.facet(Oj)){let i=o(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new $t(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Nt)}static selection(e){return new $t(void 0,Nt,void 0,void 0,e)}}function ll(t,e,n,r){let o=e+1>n+20?e-n-1:0,i=t.slice(o,e);return i.push(r),i}function Fj(t,e){let n=[],r=!1;return t.iterChangedRanges((o,i)=>n.push(o,i)),e.iterChangedRanges((o,i,s,a)=>{for(let l=0;l<n.length;){let c=n[l++],d=n[l++];a>=c&&s<=d&&(r=!0)}}),r}function Vj(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function pv(t,e){return t.length?e.length?t.concat(e):t:e}const Nt=[],_j=200;function bv(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-_j));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),ll(t,t.length-1,1e9,n.setSelAfter(r)))}else return[$t.selection([e])]}function zj(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function ad(t,e){if(!t.length)return t;let n=t.length,r=Nt;for(;n;){let o=Hj(t[n-1],e,r);if(o.changes&&!o.changes.empty||o.effects.length){let i=t.slice(0,n);return i[n-1]=o,i}else e=o.mapped,n--,r=o.selectionsAfter}return r.length?[$t.selection(r)]:Nt}function Hj(t,e,n){let r=pv(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Nt,n);if(!t.changes)return $t.selection(r);let o=t.changes.map(e),i=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(i):i;return new $t(o,me.mapEffects(t.effects,e),s,t.startSelection.map(i),r)}const Pj=/^(input\.type|delete)($|\.)/;class gn{constructor(e,n,r=0,o=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=o}isolate(){return this.prevTime?new gn(this.done,this.undone):this}addChanges(e,n,r,o,i){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||Pj.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<o.newGroupDelay&&o.joinToEvent(i,Fj(a.changes,e.changes))||r=="input.type.compose")?s=ll(s,s.length-1,o.minDepth,new $t(e.changes.compose(a.changes),pv(me.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Nt)):s=ll(s,s.length,o.minDepth,e),new gn(s,Nt,n,r)}addSelection(e,n,r,o){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Nt;return i.length>0&&n-this.prevTime<o&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Vj(i[i.length-1],e)?this:new gn(bv(this.done,e),this.undone,n,r)}addMapping(e){return new gn(ad(this.done,e),ad(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let o=e==0?this.done:this.undone;if(o.length==0)return null;let i=o[o.length-1],s=i.selectionsAfter[0]||n.selection;if(r&&i.selectionsAfter.length)return n.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Bu.of({side:e,rest:zj(o),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=o.length==1?Nt:o.slice(0,o.length-1);return i.mapped&&(a=ad(a,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Bu.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}gn.empty=new gn(Nt,Nt);const Wj=[{key:"Mod-z",run:gv,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Fu,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Fu,preventDefault:!0},{key:"Mod-u",run:Nj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Bj,preventDefault:!0}];function oi(t,e){return H.create(t.ranges.map(e),t.mainIndex)}function In(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function rn({state:t,dispatch:e},n){let r=oi(t.selection,n);return r.eq(t.selection,!0)?!1:(e(In(t,r)),!0)}function tc(t,e){return H.cursor(e?t.to:t.from)}function vv(t,e){return rn(t,n=>n.empty?t.moveByChar(n,e):tc(n,e))}function ft(t){return t.textDirectionAt(t.state.selection.main.head)==Oe.LTR}const xv=t=>vv(t,!ft(t)),wv=t=>vv(t,ft(t));function yv(t,e){return rn(t,n=>n.empty?t.moveByGroup(n,e):tc(n,e))}const qj=t=>yv(t,!ft(t)),Uj=t=>yv(t,ft(t));function Kj(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function nc(t,e,n){let r=ht(t).resolveInner(e.head),o=n?we.closedBy:we.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;Kj(t,c,o)?r=c:l=n?c.to:c.from}let i=r.type.prop(o),s,a;return i&&(s=n?mn(t,r.from,1):mn(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,H.cursor(a,n?-1:1)}const Gj=t=>rn(t,e=>nc(t.state,e,!ft(t))),Yj=t=>rn(t,e=>nc(t.state,e,ft(t)));function Cv(t,e){return rn(t,n=>{if(!n.empty)return tc(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const $v=t=>Cv(t,!1),Sv=t=>Cv(t,!0);function Av(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,o;if(e){for(let i of t.state.facet(Q.scrollMargins)){let s=i(t);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}o=t.scrollDOM.clientHeight-n-r}else o=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,o-5)}}function kv(t,e){let n=Av(t),{state:r}=t,o=oi(r.selection,s=>s.empty?t.moveVertically(s,e,n.height):tc(s,e));if(o.eq(r.selection))return!1;let i;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<c&&(i=Q.scrollIntoView(o.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(In(r,o),{effects:i}),!0}const bm=t=>kv(t,!1),Vu=t=>kv(t,!0);function yr(t,e,n){let r=t.lineBlockAt(e.head),o=t.moveToLineBoundary(e,n);if(o.head==e.head&&o.head!=(n?r.to:r.from)&&(o=t.moveToLineBoundary(e,n,!1)),!n&&o.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(o=H.cursor(r.from+i))}return o}const Xj=t=>rn(t,e=>yr(t,e,!0)),Qj=t=>rn(t,e=>yr(t,e,!1)),Zj=t=>rn(t,e=>yr(t,e,!ft(t))),Jj=t=>rn(t,e=>yr(t,e,ft(t))),eD=t=>rn(t,e=>H.cursor(t.lineBlockAt(e.head).from,1)),tD=t=>rn(t,e=>H.cursor(t.lineBlockAt(e.head).to,-1));function nD(t,e,n){let r=!1,o=oi(t.selection,i=>{let s=mn(t,i.head,-1)||mn(t,i.head,1)||i.head>0&&mn(t,i.head-1,1)||i.head<t.doc.length&&mn(t,i.head+1,-1);if(!s||!s.end)return i;r=!0;let a=s.start.from==i.head?s.end.to:s.end.from;return H.cursor(a)});return r?(e(In(t,o)),!0):!1}const rD=({state:t,dispatch:e})=>nD(t,e);function zt(t,e){let n=oi(t.state.selection,r=>{let o=e(r);return H.range(r.anchor,o.head,o.goalColumn,o.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(In(t.state,n)),!0)}function Tv(t,e){return zt(t,n=>t.moveByChar(n,e))}const Rv=t=>Tv(t,!ft(t)),Mv=t=>Tv(t,ft(t));function Ev(t,e){return zt(t,n=>t.moveByGroup(n,e))}const oD=t=>Ev(t,!ft(t)),iD=t=>Ev(t,ft(t)),sD=t=>zt(t,e=>nc(t.state,e,!ft(t))),aD=t=>zt(t,e=>nc(t.state,e,ft(t)));function Iv(t,e){return zt(t,n=>t.moveVertically(n,e))}const jv=t=>Iv(t,!1),Dv=t=>Iv(t,!0);function Ov(t,e){return zt(t,n=>t.moveVertically(n,e,Av(t).height))}const vm=t=>Ov(t,!1),xm=t=>Ov(t,!0),lD=t=>zt(t,e=>yr(t,e,!0)),cD=t=>zt(t,e=>yr(t,e,!1)),dD=t=>zt(t,e=>yr(t,e,!ft(t))),uD=t=>zt(t,e=>yr(t,e,ft(t))),hD=t=>zt(t,e=>H.cursor(t.lineBlockAt(e.head).from)),fD=t=>zt(t,e=>H.cursor(t.lineBlockAt(e.head).to)),wm=({state:t,dispatch:e})=>(e(In(t,{anchor:0})),!0),ym=({state:t,dispatch:e})=>(e(In(t,{anchor:t.doc.length})),!0),Cm=({state:t,dispatch:e})=>(e(In(t,{anchor:t.selection.main.anchor,head:0})),!0),$m=({state:t,dispatch:e})=>(e(In(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),mD=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),gD=({state:t,dispatch:e})=>{let n=rc(t).map(({from:r,to:o})=>H.range(r,Math.min(o+1,t.doc.length)));return e(t.update({selection:H.create(n),userEvent:"select"})),!0},pD=({state:t,dispatch:e})=>{let n=oi(t.selection,r=>{let o=ht(t),i=o.resolveStack(r.from,1);if(r.empty){let s=o.resolveStack(r.from,-1);s.node.from>=i.node.from&&s.node.to<=i.node.to&&(i=s)}for(let s=i;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return H.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(In(t,n)),!0)},bD=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=H.create([n.main]):n.main.empty||(r=H.create([H.cursor(n.main.head)])),r?(e(In(t,r)),!0):!1};function ws(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,o=r.changeByRange(i=>{let{from:s,to:a}=i;if(s==a){let l=e(i);l<s?(n="delete.backward",l=ca(t,l,!1)):l>s&&(n="delete.forward",l=ca(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=ca(t,s,!1),a=ca(t,a,!0);return s==a?{range:i}:{changes:{from:s,to:a},range:H.cursor(s,s<i.head?-1:1)}});return o.changes.empty?!1:(t.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Q.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function ca(t,e,n){if(t instanceof Q)for(let r of t.state.facet(Q.atomicRanges).map(o=>o(t)))r.between(e,e,(o,i)=>{o<e&&i>e&&(e=n?i:o)});return e}const Lv=(t,e,n)=>ws(t,r=>{let o=r.from,{state:i}=t,s=i.doc.lineAt(o),a,l;if(n&&!e&&o>s.from&&o<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,o-s.from))){if(a[a.length-1]==" ")return o-1;let c=ri(a,i.tabSize),d=c%il(i)||il(i);for(let h=0;h<d&&a[a.length-1-h]==" ";h++)o--;l=o}else l=st(s.text,o-s.from,e,e)+s.from,l==o&&s.number!=(e?i.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,o-s.from))&&(l=st(s.text,l-s.from,!1,!1)+s.from);return l}),_u=t=>Lv(t,!1,!0),Nv=t=>Lv(t,!0,!1),Bv=(t,e)=>ws(t,n=>{let r=n.head,{state:o}=t,i=o.doc.lineAt(r),s=o.charCategorizer(r);for(let a=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?o.doc.lines:1)&&(r+=e?1:-1);break}let l=st(i.text,r-i.from,e)+i.from,c=i.text.slice(Math.min(r,l)-i.from,Math.max(r,l)-i.from),d=s(c);if(a!=null&&d!=a)break;(c!=" "||r!=n.head)&&(a=d),r=l}return r}),Fv=t=>Bv(t,!1),vD=t=>Bv(t,!0),xD=t=>ws(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),wD=t=>ws(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),yD=t=>ws(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),CD=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ke.of(["",""])},range:H.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},$D=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let o=r.from,i=t.doc.lineAt(o),s=o==i.from?o-1:st(i.text,o-i.from,!1)+i.from,a=o==i.to?o+1:st(i.text,o-i.from,!0)+i.from;return{changes:{from:s,to:a,insert:t.doc.slice(o,a).append(t.doc.slice(s,o))},range:H.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function rc(t){let e=[],n=-1;for(let r of t.selection.ranges){let o=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=o.number){let s=e[e.length-1];s.to=i.to,s.ranges.push(r)}else e.push({from:o.from,to:i.to,ranges:[r]});n=i.number+1}return e}function Vv(t,e,n){if(t.readOnly)return!1;let r=[],o=[];for(let i of rc(t)){if(n?i.to==t.doc.length:i.from==0)continue;let s=t.doc.lineAt(n?i.to+1:i.from-1),a=s.length+1;if(n){r.push({from:i.to,to:s.to},{from:i.from,insert:s.text+t.lineBreak});for(let l of i.ranges)o.push(H.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:i.from},{from:i.to,insert:t.lineBreak+s.text});for(let l of i.ranges)o.push(H.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:H.create(o,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const SD=({state:t,dispatch:e})=>Vv(t,e,!1),AD=({state:t,dispatch:e})=>Vv(t,e,!0);function _v(t,e,n){if(t.readOnly)return!1;let r=[];for(let o of rc(t))n?r.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):r.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const kD=({state:t,dispatch:e})=>_v(t,e,!1),TD=({state:t,dispatch:e})=>_v(t,e,!0),RD=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(rc(e).map(({from:o,to:i})=>(o>0?o--:i<e.doc.length&&i++,{from:o,to:i}))),r=oi(e.selection,o=>{let i;if(t.lineWrapping){let s=t.lineBlockAt(o.head),a=t.coordsAtPos(o.head,o.assoc||1);a&&(i=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(o,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function MD(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ht(t).resolveInner(e),r=n.childBefore(e),o=n.childAfter(e),i;return r&&o&&r.to<=e&&o.from>=e&&(i=r.type.prop(we.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}const Sm=zv(!1),ED=zv(!0);function zv(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(o=>{let{from:i,to:s}=o,a=e.doc.lineAt(i),l=!t&&i==s&&MD(e,i);t&&(i=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new Zl(e,{simulateBreak:i,simulateDoubleBreak:!!l}),d=Df(c,i);for(d==null&&(d=ri(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:i,to:s}=l:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let h=["",Xi(e,d)];return l&&h.push(Xi(e,c.lineIndent(a.from,-1))),{changes:{from:i,to:s,insert:ke.of(h)},range:H.cursor(i+1+h[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Bf(t,e){let n=-1;return t.changeByRange(r=>{let o=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,o,r),n=a.number),s=a.to+1}let i=t.changes(o);return{changes:o,range:H.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const ID=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Zl(t,{overrideIndentation:i=>{let s=n[i];return s??-1}}),o=Bf(t,(i,s,a)=>{let l=Df(r,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let c=/^\s*/.exec(i.text)[0],d=Xi(t,l);(c!=d||a.from<i.from+c.length)&&(n[i.from]=l,s.push({from:i.from,to:i.from+c.length,insert:d}))});return o.changes.empty||e(t.update(o,{userEvent:"indent"})),!0},Hv=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Bf(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Ql)})}),{userEvent:"input.indent"})),!0),Pv=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Bf(t,(n,r)=>{let o=/^\s*/.exec(n.text)[0];if(!o)return;let i=ri(o,t.tabSize),s=0,a=Xi(t,Math.max(0,i-il(t)));for(;s<o.length&&s<a.length&&o.charCodeAt(s)==a.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+o.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),jD=t=>(t.setTabFocusMode(),!0),DD=[{key:"Ctrl-b",run:xv,shift:Rv,preventDefault:!0},{key:"Ctrl-f",run:wv,shift:Mv},{key:"Ctrl-p",run:$v,shift:jv},{key:"Ctrl-n",run:Sv,shift:Dv},{key:"Ctrl-a",run:eD,shift:hD},{key:"Ctrl-e",run:tD,shift:fD},{key:"Ctrl-d",run:Nv},{key:"Ctrl-h",run:_u},{key:"Ctrl-k",run:xD},{key:"Ctrl-Alt-h",run:Fv},{key:"Ctrl-o",run:CD},{key:"Ctrl-t",run:$D},{key:"Ctrl-v",run:Vu}],OD=[{key:"ArrowLeft",run:xv,shift:Rv,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qj,shift:oD,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Zj,shift:dD,preventDefault:!0},{key:"ArrowRight",run:wv,shift:Mv,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Uj,shift:iD,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Jj,shift:uD,preventDefault:!0},{key:"ArrowUp",run:$v,shift:jv,preventDefault:!0},{mac:"Cmd-ArrowUp",run:wm,shift:Cm},{mac:"Ctrl-ArrowUp",run:bm,shift:vm},{key:"ArrowDown",run:Sv,shift:Dv,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ym,shift:$m},{mac:"Ctrl-ArrowDown",run:Vu,shift:xm},{key:"PageUp",run:bm,shift:vm},{key:"PageDown",run:Vu,shift:xm},{key:"Home",run:Qj,shift:cD,preventDefault:!0},{key:"Mod-Home",run:wm,shift:Cm},{key:"End",run:Xj,shift:lD,preventDefault:!0},{key:"Mod-End",run:ym,shift:$m},{key:"Enter",run:Sm,shift:Sm},{key:"Mod-a",run:mD},{key:"Backspace",run:_u,shift:_u},{key:"Delete",run:Nv},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Fv},{key:"Mod-Delete",mac:"Alt-Delete",run:vD},{mac:"Mod-Backspace",run:wD},{mac:"Mod-Delete",run:yD}].concat(DD.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),LD=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Gj,shift:sD},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Yj,shift:aD},{key:"Alt-ArrowUp",run:SD},{key:"Shift-Alt-ArrowUp",run:kD},{key:"Alt-ArrowDown",run:AD},{key:"Shift-Alt-ArrowDown",run:TD},{key:"Escape",run:bD},{key:"Mod-Enter",run:ED},{key:"Alt-l",mac:"Ctrl-l",run:gD},{key:"Mod-i",run:pD,preventDefault:!0},{key:"Mod-[",run:Pv},{key:"Mod-]",run:Hv},{key:"Mod-Alt-\\",run:ID},{key:"Shift-Mod-k",run:RD},{key:"Shift-Mod-\\",run:rD},{key:"Mod-/",run:kj},{key:"Alt-A",run:Rj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:jD}].concat(OD),ND={key:"Tab",run:Hv,shift:Pv},Am=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class qo{constructor(e,n,r=0,o=e.length,i,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,o),this.bufferStart=r,this.normalize=i?a=>i(Am(a)):Am,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return xt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=bf(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=un(e);let o=this.normalize(n);if(o.length)for(let i=0,s=r;;i++){let a=o.charCodeAt(i),l=this.match(a,s,this.bufferPos+this.bufferStart);if(i==o.length-1){if(l)return this.value=l,this;break}s==r&&i<n.length&&n.charCodeAt(i)==a&&s++}}}match(e,n,r){let o=null;for(let i=0;i<this.matches.length;i+=2){let s=this.matches[i],a=!1;this.query.charCodeAt(s)==e&&(s==this.query.length-1?o={from:this.matches[i+1],to:r}:(this.matches[i]++,a=!0)),a||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?o={from:n,to:r}:this.matches.push(1,n)),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(qo.prototype[Symbol.iterator]=function(){return this});const Wv={from:-1,to:-1,match:/.*/.exec("")},Ff="gm"+(/x/.unicode==null?"":"u");class qv{constructor(e,n,r,o=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=Wv,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Uv(e,n,r,o,i);this.re=new RegExp(n,Ff+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let s=e.lineAt(o);this.curLineStart=s.from,this.matchPos=cl(e,o),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,o=r+n[0].length;if(this.matchPos=cl(this.text,o+(r==o?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<o||r>this.value.to)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const ld=new WeakMap;class Ro{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let o=ld.get(e);if(!o||o.from>=r||o.to<=n){let a=new Ro(n,e.sliceString(n,r));return ld.set(e,a),a}if(o.from==n&&o.to==r)return o;let{text:i,from:s}=o;return s>n&&(i=e.sliceString(n,s)+i,s=n),o.to<r&&(i+=e.sliceString(o.to,r)),ld.set(e,new Ro(s,i)),new Ro(n,i.slice(n-s,r-s))}}class Uv{constructor(e,n,r,o,i){this.text=e,this.to=i,this.done=!1,this.value=Wv,this.matchPos=cl(e,o),this.re=new RegExp(n,Ff+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Ro.get(e,o,this.chunkEnd(o+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,o=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,match:n},this.matchPos=cl(this.text,o+(r==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ro.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(qv.prototype[Symbol.iterator]=Uv.prototype[Symbol.iterator]=function(){return this});function BD(t){try{return new RegExp(t,Ff),!0}catch{return!1}}function cl(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function zu(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Me("input",{class:"cm-textfield",name:"line",value:e}),r=Me("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:Di.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),o())},onsubmit:i=>{i.preventDefault(),o()}},Me("label",t.state.phrase("Go to line"),": ",n)," ",Me("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),Me("button",{name:"close",onclick:()=>{t.dispatch({effects:Di.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function o(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,d,h]=i,f=d?+d.slice(1):0,m=c?+c:a.number;if(c&&h){let v=m/100;l&&(v=v*(l=="-"?-1:1)+a.number/s.doc.lines),m=Math.round(s.doc.lines*v)}else c&&l&&(m=m*(l=="-"?-1:1)+a.number);let b=s.doc.line(Math.max(1,Math.min(s.doc.lines,m))),p=H.cursor(b.from+Math.max(0,Math.min(f,b.length)));t.dispatch({effects:[Di.of(!1),Q.scrollIntoView(p.from,{y:"center"})],selection:p}),t.focus()}return{dom:r}}const Di=me.define(),km=tt.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(Di)&&(t=n.value);return t},provide:t=>Yi.from(t,e=>e?zu:null)}),FD=t=>{let e=Gi(t,zu);if(!e){let n=[Di.of(!0)];t.state.field(km,!1)==null&&n.push(me.appendConfig.of([km,VD])),t.dispatch({effects:n}),e=Gi(t,zu)}return e&&e.dom.querySelector("input").select(),!0},VD=Q.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),_D={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zD=ne.define({combine(t){return En(t,_D,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function HD(t){return[KD,UD]}const PD=ae.mark({class:"cm-selectionMatch"}),WD=ae.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Tm(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Le.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Le.Word)}function qD(t,e,n,r){return t(e.sliceDoc(n,n+1))==Le.Word&&t(e.sliceDoc(r-1,r))==Le.Word}const UD=We.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(zD),{state:n}=t,r=n.selection;if(r.ranges.length>1)return ae.none;let o=r.main,i,s=null;if(o.empty){if(!e.highlightWordAroundCursor)return ae.none;let l=n.wordAt(o.head);if(!l)return ae.none;s=n.charCategorizer(o.head),i=n.sliceDoc(l.from,l.to)}else{let l=o.to-o.from;if(l<e.minSelectionLength||l>200)return ae.none;if(e.wholeWords){if(i=n.sliceDoc(o.from,o.to),s=n.charCategorizer(o.head),!(Tm(s,n,o.from,o.to)&&qD(s,n,o.from,o.to)))return ae.none}else if(i=n.sliceDoc(o.from,o.to),!i)return ae.none}let a=[];for(let l of t.visibleRanges){let c=new qo(n.doc,i,l.from,l.to);for(;!c.next().done;){let{from:d,to:h}=c.value;if((!s||Tm(s,n,d,h))&&(o.empty&&d<=o.from&&h>=o.to?a.push(WD.range(d,h)):(d>=o.to||h<=o.from)&&a.push(PD.range(d,h)),a.length>e.maxMatches))return ae.none}}return ae.set(a)}},{decorations:t=>t.decorations}),KD=Q.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GD=({state:t,dispatch:e})=>{let{selection:n}=t,r=H.create(n.ranges.map(o=>t.wordAt(o.head)||H.cursor(o.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function YD(t,e){let{main:n,ranges:r}=t.selection,o=t.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let s=!1,a=new qo(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new qo(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(i){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const XD=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return GD({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let o=YD(t,r);return o?(e(t.update({selection:t.selection.addRange(H.range(o.from,o.to),!1),effects:Q.scrollIntoView(o.to)})),!0):!1},ii=ne.define({combine(t){return En(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new lO(e),scrollToMatch:e=>Q.scrollIntoView(e)})}});class Kv{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||BD(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
64
|
-
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new eO(this):new ZD(this)}getCursor(e,n=0,r){let o=e.doc?e:$e.create({doc:e});return r==null&&(r=o.doc.length),this.regexp?mo(this,o,n,r):fo(this,o,n,r)}}class Gv{constructor(e){this.spec=e}}function fo(t,e,n,r){return new qo(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:o=>o.toLowerCase(),t.wholeWord?QD(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function QD(t,e){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=t.sliceString(i,Math.min(t.length,r+2))),(e(dl(o,n-i))!=Le.Word||e(ul(o,n-i))!=Le.Word)&&(e(ul(o,r-i))!=Le.Word||e(dl(o,r-i))!=Le.Word))}class ZD extends Gv{constructor(e){super(e)}nextMatch(e,n,r){let o=fo(this.spec,e,r,e.doc.length).nextOverlapping();if(o.done){let i=Math.min(e.doc.length,n+this.spec.unquoted.length);o=fo(this.spec,e,0,i).nextOverlapping()}return o.done||o.value.from==n&&o.value.to==r?null:o.value}prevMatchInRange(e,n,r){for(let o=r;;){let i=Math.max(n,o-1e4-this.spec.unquoted.length),s=fo(this.spec,e,i,o),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(i==n)return null;o-=1e4}}prevMatch(e,n,r){let o=this.prevMatchInRange(e,0,n);return o||(o=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),o&&(o.from!=n||o.to!=r)?o:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=fo(this.spec,e,0,e.doc.length),o=[];for(;!r.next().done;){if(o.length>=n)return null;o.push(r.value)}return o}highlight(e,n,r,o){let i=fo(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}function mo(t,e,n,r){return new qv(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?JD(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function dl(t,e){return t.slice(st(t,e,!1),e)}function ul(t,e){return t.slice(e,st(t,e))}function JD(t){return(e,n,r)=>!r[0].length||(t(dl(r.input,r.index))!=Le.Word||t(ul(r.input,r.index))!=Le.Word)&&(t(ul(r.input,r.index+r[0].length))!=Le.Word||t(dl(r.input,r.index+r[0].length))!=Le.Word)}class eO extends Gv{nextMatch(e,n,r){let o=mo(this.spec,e,r,e.doc.length).next();return o.done&&(o=mo(this.spec,e,0,n).next()),o.done?null:o.value}prevMatchInRange(e,n,r){for(let o=1;;o++){let i=Math.max(n,r-o*1e4),s=mo(this.spec,e,i,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(i==n||a.from>i+10))return a;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let o=r.length;o>0;o--){let i=+r.slice(0,o);if(i>0&&i<e.match.length)return e.match[i]+r.slice(o)}return n})}matchAll(e,n){let r=mo(this.spec,e,0,e.doc.length),o=[];for(;!r.next().done;){if(o.length>=n)return null;o.push(r.value)}return o}highlight(e,n,r,o){let i=mo(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}const Qi=me.define(),Vf=me.define(),ar=tt.define({create(t){return new cd(Hu(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Qi)?t=new cd(n.value.create(),t.panel):n.is(Vf)&&(t=new cd(t.query,n.value?_f:null));return t},provide:t=>Yi.from(t,e=>e.panel)});class cd{constructor(e,n){this.query=e,this.panel=n}}const tO=ae.mark({class:"cm-searchMatch"}),nO=ae.mark({class:"cm-searchMatch cm-searchMatch-selected"}),rO=We.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ar))}update(t){let e=t.state.field(ar);(e!=t.startState.field(ar)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ae.none;let{view:n}=this,r=new qn;for(let o=0,i=n.visibleRanges,s=i.length;o<s;o++){let{from:a,to:l}=i[o];for(;o<s-1&&l>i[o+1].from-2*250;)l=i[++o].to;t.highlight(n.state,a,l,(c,d)=>{let h=n.state.selection.ranges.some(f=>f.from==c&&f.to==d);r.add(c,d,h?nO:tO)})}return r.finish()}},{decorations:t=>t.decorations});function ys(t){return e=>{let n=e.state.field(ar,!1);return n&&n.query.spec.valid?t(e,n):Qv(e)}}const hl=ys((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let o=H.single(r.from,r.to),i=t.state.facet(ii);return t.dispatch({selection:o,effects:[zf(t,r),i.scrollToMatch(o.main,t)],userEvent:"select.search"}),Xv(t),!0}),fl=ys((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,o=e.prevMatch(n,r,r);if(!o)return!1;let i=H.single(o.from,o.to),s=t.state.facet(ii);return t.dispatch({selection:i,effects:[zf(t,o),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),Xv(t),!0}),oO=ys((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:H.create(n.map(r=>H.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),iO=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],s=0;for(let a=new qo(t.doc,t.sliceDoc(r,o));!a.next().done;){if(i.length>1e3)return!1;a.value.from==r&&(s=i.length),i.push(H.range(a.value.from,a.value.to))}return e(t.update({selection:H.create(i,s),userEvent:"select.search.matches"})),!0},Rm=ys((t,{query:e})=>{let{state:n}=t,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let s=i,a=[],l,c,d=[];s.from==r&&s.to==o&&(c=n.toText(e.getReplacement(s)),a.push({from:s.from,to:s.to,insert:c}),s=e.nextMatch(n,s.from,s.to),d.push(Q.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let h=t.state.changes(a);return s&&(l=H.single(s.from,s.to).map(h),d.push(zf(t,s)),d.push(n.facet(ii).scrollToMatch(l.main,t))),t.dispatch({changes:h,selection:l,effects:d,userEvent:"input.replace"}),!0}),sO=ys((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(o=>{let{from:i,to:s}=o;return{from:i,to:s,insert:e.getReplacement(o)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Q.announce.of(r),userEvent:"input.replace.all"}),!0});function _f(t){return t.state.facet(ii).createPanel(t)}function Hu(t,e){var n,r,o,i,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(ii);return new Kv({search:((n=e?.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(o=e?.literal)!==null&&o!==void 0?o:c.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:c.regexp,wholeWord:(s=e?.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function Yv(t){let e=Gi(t,_f);return e&&e.dom.querySelector("[main-field]")}function Xv(t){let e=Yv(t);e&&e==t.root.activeElement&&e.select()}const Qv=t=>{let e=t.state.field(ar,!1);if(e&&e.panel){let n=Yv(t);if(n&&n!=t.root.activeElement){let r=Hu(t.state,e.query.spec);r.valid&&t.dispatch({effects:Qi.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[Vf.of(!0),e?Qi.of(Hu(t.state,e.query.spec)):me.appendConfig.of(dO)]});return!0},Zv=t=>{let e=t.state.field(ar,!1);if(!e||!e.panel)return!1;let n=Gi(t,_f);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Vf.of(!1)}),!0},aO=[{key:"Mod-f",run:Qv,scope:"editor search-panel"},{key:"F3",run:hl,shift:fl,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:hl,shift:fl,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Zv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:iO},{key:"Mod-Alt-g",run:FD},{key:"Mod-d",run:XD,preventDefault:!0}];class lO{constructor(e){this.view=e;let n=this.query=e.state.field(ar).query.spec;this.commit=this.commit.bind(this),this.searchField=Me("input",{value:n.search,placeholder:Et(e,"Find"),"aria-label":Et(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Me("input",{value:n.replace,placeholder:Et(e,"Replace"),"aria-label":Et(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Me("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Me("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Me("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(o,i,s){return Me("button",{class:"cm-button",name:o,onclick:i,type:"button"},s)}this.dom=Me("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,r("next",()=>hl(e),[Et(e,"next")]),r("prev",()=>fl(e),[Et(e,"previous")]),r("select",()=>oO(e),[Et(e,"all")]),Me("label",null,[this.caseField,Et(e,"match case")]),Me("label",null,[this.reField,Et(e,"regexp")]),Me("label",null,[this.wordField,Et(e,"by word")]),...e.state.readOnly?[]:[Me("br"),this.replaceField,r("replace",()=>Rm(e),[Et(e,"replace")]),r("replaceAll",()=>sO(e),[Et(e,"replace all")])],Me("button",{name:"close",onclick:()=>Zv(e),"aria-label":Et(e,"close"),type:"button"},["×"])])}commit(){let e=new Kv({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Qi.of(e)}))}keydown(e){kE(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?fl:hl)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Rm(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Qi)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ii).top}}function Et(t,e){return t.state.phrase(e)}const da=30,ua=/[\s\.,:;?!]/;function zf(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),o=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-da),s=Math.min(o,n+da),a=t.state.sliceDoc(i,s);if(i!=r.from){for(let l=0;l<da;l++)if(!ua.test(a[l+1])&&ua.test(a[l])){a=a.slice(l);break}}if(s!=o){for(let l=a.length-1;l>a.length-da;l--)if(!ua.test(a[l-1])&&ua.test(a[l])){a=a.slice(0,l);break}}return Q.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const cO=Q.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),dO=[ar,to.low(rO),cO];class Jv{constructor(e,n,r,o){this.state=e,this.pos=n,this.explicit=r,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ht(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),o=n.text.slice(r-n.from,this.pos-n.from),i=o.search(ex(e,!1));return i<0?null:{from:r+i,to:this.pos,text:o.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function Mm(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function uO(t){let e=Object.create(null),n=Object.create(null);for(let{label:o}of t){e[o[0]]=!0;for(let i=1;i<o.length;i++)n[o[i]]=!0}let r=Mm(e)+Mm(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function hO(t){let e=t.map(o=>typeof o=="string"?{label:o}:o),[n,r]=e.every(o=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:uO(e);return o=>{let i=o.matchBefore(r);return i||o.explicit?{from:i?i.from:o.pos,options:e,validFor:n}:null}}let Em=class{constructor(e,n,r,o){this.completion=e,this.source=n,this.match=r,this.score=o}};function Lr(t){return t.selection.main.from}function ex(t,e){var n;let{source:r}=t,o=e&&r[0]!="^",i=r[r.length-1]!="$";return!o&&!i?t:new RegExp(`${o?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const tx=Mn.define();function fO(t,e,n,r){let{main:o}=t.selection,i=n-o.from,s=r-o.from;return Object.assign(Object.assign({},t.changeByRange(a=>{if(a!=o&&n!=r&&t.sliceDoc(a.from+i,a.from+s)!=t.sliceDoc(n,r))return{range:a};let l=t.toText(e);return{changes:{from:a.from+i,to:r==o.from?a.to:a.from+s,insert:l},range:H.cursor(a.from+i+l.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Im=new WeakMap;function mO(t){if(!Array.isArray(t))return t;let e=Im.get(t);return e||Im.set(t,e=hO(t)),e}const ml=me.define(),Zi=me.define();class gO{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=xt(e,n),o=un(r);this.chars.push(r);let i=e.slice(n,n+o),s=i.toUpperCase();this.folded.push(xt(s==i?i.toLowerCase():s,0)),n+=o}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:o,precise:i,byWord:s}=this;if(n.length==1){let y=xt(e,0),$=un(y),S=$==e.length?0:-100;if(y!=n[0])if(y==r[0])S+=-200;else return null;return this.ret(S,[0,$])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(a<0){for(let y=0,$=Math.min(e.length,200);y<$&&c<l;){let S=xt(e,y);(S==n[c]||S==r[c])&&(o[c++]=y),y+=un(S)}if(c<l)return null}let d=0,h=0,f=!1,m=0,b=-1,p=-1,v=/[a-z]/.test(e),x=!0;for(let y=0,$=Math.min(e.length,200),S=0;y<$&&h<l;){let A=xt(e,y);a<0&&(d<l&&A==n[d]&&(i[d++]=y),m<l&&(A==n[m]||A==r[m]?(m==0&&(b=y),p=y+1,m++):m=0));let k,T=A<255?A>=48&&A<=57||A>=97&&A<=122?2:A>=65&&A<=90?1:0:(k=bf(A))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!y||T==1&&v||S==0&&T!=0)&&(n[h]==A||r[h]==A&&(f=!0)?s[h++]=y:s.length&&(x=!1)),S=T,y+=un(A)}return h==l&&s[0]==0&&x?this.result(-100+(f?-200:0),s,e):m==l&&b==0?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):m==l?this.ret(-900-e.length,[b,p]):h==l?this.result(-100+(f?-200:0)+-700+(x?0:-1100),s,e):n.length==2?null:this.result((o[0]?-700:0)+-200+-1100,o,e)}result(e,n,r){let o=[],i=0;for(let s of n){let a=s+(this.astral?un(xt(r,s)):1);i&&o[i-1]==s?o[i-1]=a:(o[i++]=s,o[i++]=a)}return this.ret(e-r.length,o)}}class pO{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Je=ne.define({combine(t){return En(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:bO,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>jm(e(r),n(r)),optionClass:(e,n)=>r=>jm(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function jm(t,e){return t?e?t+" "+e:t:e}function bO(t,e,n,r,o,i){let s=t.textDirection==Oe.RTL,a=s,l=!1,c="top",d,h,f=e.left-o.left,m=o.right-e.right,b=r.right-r.left,p=r.bottom-r.top;if(a&&f<Math.min(b,m)?a=!1:!a&&m<Math.min(b,f)&&(a=!0),b<=(a?f:m))d=Math.max(o.top,Math.min(n.top,o.bottom-p))-e.top,h=Math.min(400,a?f:m);else{l=!0,h=Math.min(400,(s?e.right:o.right-e.left)-30);let y=o.bottom-e.bottom;y>=p||y>e.top?d=n.bottom-e.top:(c="bottom",d=e.bottom-n.top)}let v=(e.bottom-e.top)/i.offsetHeight,x=(e.right-e.left)/i.offsetWidth;return{style:`${c}: ${d/v}px; max-width: ${h/x}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function vO(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(o=>"cm-completionIcon-"+o)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,o,i){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;c<i.length;){let d=i[c++],h=i[c++];d>l&&s.appendChild(document.createTextNode(a.slice(l,d)));let f=s.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(a.slice(d,h))),f.className="cm-completionMatchedText",l=h}return l<a.length&&s.appendChild(document.createTextNode(a.slice(l))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function dd(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let o=Math.floor(e/n);return{from:o*n,to:(o+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class xO{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let o=e.state.field(n),{options:i,selected:s}=o.open,a=e.state.facet(Je);this.optionContent=vO(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=dd(i.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let d=l.target,h;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(h=/-(\d+)$/.exec(d.id))&&+h[1]<c.length){this.applyCompletion(e,c[+h[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Je).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Zi.of(null)})}),this.showOptions(i,o.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=o){let{options:i,selected:s,disabled:a}=r.open;(!o.open||o.open.options!=i)&&(this.range=dd(i.length,s,e.state.facet(Je).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),a!=((n=o.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=dd(n.options.length,n.selected,this.view.state.facet(Je).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:o}=r;if(!o)return;let i=typeof o=="string"?document.createTextNode(o):o(r);if(!i)return;"then"in i?i.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>Ct(this.view.state,s,"completion info")):this.addInfoPane(i,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:o,destroy:i}=e;r.appendChild(o),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,o=this.range.from;r;r=r.nextSibling,o++)r.nodeName!="LI"||!r.id?o--:o==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&yO(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),i=this.space;if(!i){let s=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return o.top>Math.min(i.bottom,n.bottom)-10||o.bottom<Math.max(i.top,n.top)+10?null:this.view.state.facet(Je).positionInfo(this.view,n,o,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const o=document.createElement("ul");o.id=n,o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-label",this.view.state.phrase("Completions")),o.addEventListener("mousedown",s=>{s.target==o&&s.preventDefault()});let i=null;for(let s=r.from;s<r.to;s++){let{completion:a,match:l}=e[s],{section:c}=a;if(c){let f=typeof c=="string"?c:c.name;if(f!=i&&(s>r.from||r.from==0))if(i=f,typeof c!="string"&&c.header)o.appendChild(c.header(c));else{let m=o.appendChild(document.createElement("completion-section"));m.textContent=f}}const d=o.appendChild(document.createElement("li"));d.id=n+"-"+s,d.setAttribute("role","option");let h=this.optionClass(a);h&&(d.className=h);for(let f of this.optionContent){let m=f(a,this.view.state,this.view,l);m&&d.appendChild(m)}}return r.from&&o.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&o.classList.add("cm-completionListIncompleteBottom"),o}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function wO(t,e){return n=>new xO(n,t,e)}function yO(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/o:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/o)}function Dm(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function CO(t,e){let n=[],r=null,o=c=>{n.push(c);let{section:d}=c.completion;if(d){r||(r=[]);let h=typeof d=="string"?d:d.name;r.some(f=>f.name==h)||r.push(typeof d=="string"?{name:h}:d)}},i=e.facet(Je);for(let c of t)if(c.hasResult()){let d=c.result.getMatch;if(c.result.filter===!1)for(let h of c.result.options)o(new Em(h,c.source,d?d(h):[],1e9-n.length));else{let h=e.sliceDoc(c.from,c.to),f,m=i.filterStrict?new pO(h):new gO(h);for(let b of c.result.options)if(f=m.match(b.label)){let p=b.displayLabel?d?d(b,f.matched):[]:f.matched;o(new Em(b,c.source,p,f.score+(b.boost||0)))}}}if(r){let c=Object.create(null),d=0,h=(f,m)=>{var b,p;return((b=f.rank)!==null&&b!==void 0?b:1e9)-((p=m.rank)!==null&&p!==void 0?p:1e9)||(f.name<m.name?-1:1)};for(let f of r.sort(h))d-=1e5,c[f.name]=d;for(let f of n){let{section:m}=f.completion;m&&(f.score+=c[typeof m=="string"?m:m.name])}}let s=[],a=null,l=i.compareCompletions;for(let c of n.sort((d,h)=>h.score-d.score||l(d.completion,h.completion))){let d=c.completion;!a||a.label!=d.label||a.detail!=d.detail||a.type!=null&&d.type!=null&&a.type!=d.type||a.apply!=d.apply||a.boost!=d.boost?s.push(c):Dm(c.completion)>Dm(a)&&(s[s.length-1]=c),a=c.completion}return s}class vo{constructor(e,n,r,o,i,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=o,this.selected=i,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new vo(this.options,Om(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,o,i,s){if(o&&!s&&e.some(c=>c.isPending))return o.setDisabled();let a=CO(e,n);if(!a.length)return o&&e.some(c=>c.isPending)?o.setDisabled():null;let l=n.facet(Je).selectOnOpen?0:-1;if(o&&o.selected!=l&&o.selected!=-1){let c=o.options[o.selected].completion;for(let d=0;d<a.length;d++)if(a[d].completion==c){l=d;break}}return new vo(a,Om(r,l),{pos:e.reduce((c,d)=>d.hasResult()?Math.min(c,d.from):c,1e8),create:RO,above:i.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new vo(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new vo(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class gl{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new gl(kO,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Je),i=(r.override||n.languageDataAt("autocomplete",Lr(n)).map(mO)).map(l=>(this.active.find(d=>d.source==l)||new Bt(l,this.active.some(d=>d.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((l,c)=>l==this.active[c])&&(i=this.active);let s=this.open,a=e.effects.some(l=>l.is(Hf));s&&e.docChanged&&(s=s.map(e.changes)),e.selection||i.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!$O(i,this.active)||a?s=vo.build(i,n,this.id,s,r,a):s&&s.disabled&&!i.some(l=>l.isPending)&&(s=null),!s&&i.every(l=>!l.isPending)&&i.some(l=>l.hasResult())&&(i=i.map(l=>l.hasResult()?new Bt(l.source,0):l));for(let l of e.effects)l.is(rx)&&(s=s&&s.setSelected(l.value,this.id));return i==this.active&&s==this.open?this:new gl(i,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?SO:AO}}function $O(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let o=n==t.length,i=r==e.length;if(o||i)return o==i;if(t[n++].result!=e[r++].result)return!1}}const SO={"aria-autocomplete":"list"},AO={};function Om(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const kO=[];function nx(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(tx);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Bt{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=nx(e,n),o=this;(r&8||r&16&&this.touches(e))&&(o=new Bt(o.source,0)),r&4&&o.state==0&&(o=new Bt(this.source,1)),o=o.updateFor(e,r);for(let i of e.effects)if(i.is(ml))o=new Bt(o.source,1,i.value);else if(i.is(Zi))o=new Bt(o.source,0);else if(i.is(Hf))for(let s of i.value)s.source==o.source&&(o=s);return o}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Lr(e.state))}}class Mo extends Bt{constructor(e,n,r,o,i,s){super(e,3,n),this.limit=r,this.result=o,this.from=i,this.to=s}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let i=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=Lr(e.state);if(a>s||!o||n&2&&(Lr(e.startState)==this.from||a<this.limit))return new Bt(this.source,n&4?1:0);let l=e.changes.mapPos(this.limit);return TO(o.validFor,e.state,i,s)?new Mo(this.source,this.explicit,l,o,i,s):o.update&&(o=o.update(o,i,s,new Jv(e.state,a,!1)))?new Mo(this.source,this.explicit,l,o,o.from,(r=o.to)!==null&&r!==void 0?r:Lr(e.state)):new Bt(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Mo(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Bt(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function TO(t,e,n,r){if(!t)return!1;let o=e.sliceDoc(n,r);return typeof t=="function"?t(o,n,r,e):ex(t,!0).test(o)}const Hf=me.define({map(t,e){return t.map(n=>n.map(e))}}),rx=me.define(),yt=tt.define({create(){return gl.start()},update(t,e){return t.update(e)},provide:t=>[jf.from(t,e=>e.tooltip),Q.contentAttributes.from(t,e=>e.attrs)]});function Pf(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(yt).active.find(o=>o.source==e.source);return r instanceof Mo?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},fO(t.state,n,r.from,r.to)),{annotations:tx.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const RO=wO(yt,Pf);function ha(t,e="option"){return n=>{let r=n.state.field(yt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Je).interactionDelay)return!1;let o=1,i;e=="page"&&(i=U5(n,r.open.tooltip))&&(o=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+o*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:rx.of(a)}),!0}}const MO=t=>{let e=t.state.field(yt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Je).interactionDelay?!1:Pf(t,e.open.options[e.open.selected])},Lm=t=>t.state.field(yt,!1)?(t.dispatch({effects:ml.of(!0)}),!0):!1,EO=t=>{let e=t.state.field(yt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:Zi.of(null)}),!0)};class IO{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const jO=50,DO=1e3,OO=We.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(yt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(yt),n=t.state.facet(Je);if(!t.selectionSet&&!t.docChanged&&t.startState.field(yt)==e)return;let r=t.transactions.some(i=>{let s=nx(i,n);return s&8||(i.selection||i.docChanged)&&!(s&3)});for(let i=0;i<this.running.length;i++){let s=this.running[i];if(r||s.context.abortOnDocChange&&t.docChanged||s.updates.length+t.transactions.length>jO&&Date.now()-s.time>DO){for(let a of s.context.abortListeners)try{a()}catch(l){Ct(this.view.state,l)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(s=>s.is(ml)))&&(this.pendingStart=!0);let o=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),o):-1,this.composing!=0)for(let i of t.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(yt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Je).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=Lr(e),r=new Jv(e,n,t.explicit,this.view),o=new IO(t,r);this.running.push(o),Promise.resolve(t.source(r)).then(i=>{o.context.aborted||(o.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:Zi.of(null)}),Ct(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Je).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Je),r=this.view.state.field(yt);for(let o=0;o<this.running.length;o++){let i=this.running[o];if(i.done===void 0)continue;if(this.running.splice(o--,1),i.done){let a=Lr(i.updates.length?i.updates[0].startState:this.view.state),l=Math.min(a,i.done.from+(i.active.explicit?0:1)),c=new Mo(i.active.source,i.active.explicit,l,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:a);for(let d of i.updates)c=c.update(d,n);if(c.hasResult()){e.push(c);continue}}let s=r.active.find(a=>a.source==i.active.source);if(s&&s.isPending)if(i.done==null){let a=new Bt(i.active.source,0);for(let l of i.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(s)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Hf.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(yt,!1);if(e&&e.tooltip&&this.view.state.facet(Je).closeOnBlur){let n=e.open&&U5(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Zi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ml.of(!1)}),20),this.composing=0}}}),LO=typeof navigator=="object"&&/Win/.test(navigator.platform),NO=to.highest(Q.domEventHandlers({keydown(t,e){let n=e.state.field(yt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(LO&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],o=n.active.find(s=>s.source==r.source),i=r.completion.commitCharacters||o.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&Pf(e,r),!1}})),BO=Q.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Ji={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ir=me.define({map(t,e){let n=e.mapPos(t,-1,gt.TrackAfter);return n??void 0}}),Wf=new class extends Hr{};Wf.startSide=1;Wf.endSide=-1;const ox=tt.define({create(){return Ae.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Ir)&&(t=t.update({add:[Wf.range(n.value,n.value+1)]}));return t}});function FO(){return[_O,ox]}const ud="()[]{}<>«»»«[]{}";function ix(t){for(let e=0;e<ud.length;e+=2)if(ud.charCodeAt(e)==t)return ud.charAt(e+1);return bf(t<128?t:t+1)}function sx(t,e){return t.languageDataAt("closeBrackets",e)[0]||Ji}const VO=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),_O=Q.inputHandler.of((t,e,n,r)=>{if((VO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let o=t.state.selection.main;if(r.length>2||r.length==2&&un(xt(r,0))==1||e!=o.from||n!=o.to)return!1;let i=PO(t.state,r);return i?(t.dispatch(i),!0):!1}),zO=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=sx(t,t.selection.main.head).brackets||Ji.brackets,o=null,i=t.changeByRange(s=>{if(s.empty){let a=WO(t.doc,s.head);for(let l of r)if(l==a&&oc(t.doc,s.head)==ix(xt(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:H.cursor(s.head-l.length)}}return{range:o=s}});return o||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!o},HO=[{key:"Backspace",run:zO}];function PO(t,e){let n=sx(t,t.selection.main.head),r=n.brackets||Ji.brackets;for(let o of r){let i=ix(xt(o,0));if(e==o)return i==o?KO(t,o,r.indexOf(o+o+o)>-1,n):qO(t,o,i,n.before||Ji.before);if(e==i&&ax(t,t.selection.main.from))return UO(t,o,i)}return null}function ax(t,e){let n=!1;return t.field(ox).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function oc(t,e){let n=t.sliceString(e,e+2);return n.slice(0,un(xt(n,0)))}function WO(t,e){let n=t.sliceString(e-2,e);return un(xt(n,0))==n.length?n:n.slice(1)}function qO(t,e,n,r){let o=null,i=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:Ir.of(s.to+e.length),range:H.range(s.anchor+e.length,s.head+e.length)};let a=oc(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:Ir.of(s.head+e.length),range:H.cursor(s.head+e.length)}:{range:o=s}});return o?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function UO(t,e,n){let r=null,o=t.changeByRange(i=>i.empty&&oc(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:H.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function KO(t,e,n,r){let o=r.stringPrefixes||Ji.stringPrefixes,i=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Ir.of(a.to+e.length),range:H.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=oc(t.doc,l),d;if(c==e){if(Nm(t,l))return{changes:{insert:e+e,from:l},effects:Ir.of(l+e.length),range:H.cursor(l+e.length)};if(ax(t,l)){let f=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:H.cursor(l+f.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(d=Bm(t,l-2*e.length,o))>-1&&Nm(t,d))return{changes:{insert:e+e+e+e,from:l},effects:Ir.of(l+e.length),range:H.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=Le.Word&&Bm(t,l,o)>-1&&!GO(t,l,e,o))return{changes:{insert:e+e,from:l},effects:Ir.of(l+e.length),range:H.cursor(l+e.length)}}return{range:i=a}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Nm(t,e){let n=ht(t).resolveInner(e+1);return n.parent&&n.from==e}function GO(t,e,n,r){let o=ht(t).resolveInner(e,-1),i=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(o.from,Math.min(o.to,o.from+n.length+i)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let d=o.firstChild;for(;d&&d.from==o.from&&d.to-d.from>n.length+l;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let c=o.to==e&&o.parent;if(!c)break;o=c}return!1}function Bm(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Le.Word)return e;for(let o of n){let i=e-o.length;if(t.sliceDoc(i,e)==o&&r(t.sliceDoc(i-1,i))!=Le.Word)return i}return-1}function YO(t={}){return[NO,yt,Je.of(t),OO,XO,BO]}const lx=[{key:"Ctrl-Space",run:Lm},{mac:"Alt-`",run:Lm},{key:"Escape",run:EO},{key:"ArrowDown",run:ha(!0)},{key:"ArrowUp",run:ha(!1)},{key:"PageDown",run:ha(!0,"page")},{key:"PageUp",run:ha(!1,"page")},{key:"Enter",run:MO}],XO=to.highest(Yl.computeN([Je],t=>t.facet(Je).defaultKeymap?[lx]:[]));class Fm{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Mr{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let o=r.facet(es).markerFilter;o&&(e=o(e,r));let i=e.slice().sort((d,h)=>d.from-h.from||d.to-h.to),s=new qn,a=[],l=0;for(let d=0;;){let h=d==i.length?null:i[d];if(!h&&!a.length)break;let f,m;for(a.length?(f=l,m=a.reduce((p,v)=>Math.min(p,v.to),h&&h.from>f?h.from:1e8)):(f=h.from,m=h.to,a.push(h),d++);d<i.length;){let p=i[d];if(p.from==f&&(p.to>p.from||p.to==f))a.push(p),d++,m=Math.min(p.to,m);else{m=Math.min(p.from,m);break}}let b=cL(a);if(a.some(p=>p.from==p.to||p.from==p.to-1&&r.doc.lineAt(p.from).to==p.from))s.add(f,f,ae.widget({widget:new iL(b),diagnostics:a.slice()}));else{let p=a.reduce((v,x)=>x.markClass?v+" "+x.markClass:v,"");s.add(f,m,ae.mark({class:"cm-lintRange cm-lintRange-"+b+p,diagnostics:a.slice(),inclusiveEnd:a.some(v=>v.to>m)}))}l=m;for(let p=0;p<a.length;p++)a[p].to<=l&&a.splice(p--,1)}let c=s.finish();return new Mr(c,n,Uo(c))}}function Uo(t,e=null,n=0){let r=null;return t.between(n,1e9,(o,i,{spec:s})=>{if(!(e&&s.diagnostics.indexOf(e)<0))if(!r)r=new Fm(o,i,e||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new Fm(r.from,i,r.diagnostic)}}),r}function QO(t,e){let n=e.pos,r=e.end||n,o=t.state.facet(es).hideOn(t,n,r);if(o!=null)return o;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(cx))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function ZO(t,e){return t.field(Ot,!1)?e:e.concat(me.appendConfig.of(dL))}const cx=me.define(),qf=me.define(),dx=me.define(),Ot=tt.define({create(){return new Mr(ae.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,o=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=Uo(n,t.selected.diagnostic,i)||Uo(n,null,i)}!n.size&&o&&e.state.facet(es).autoPanel&&(o=null),t=new Mr(n,o,r)}for(let n of e.effects)if(n.is(cx)){let r=e.state.facet(es).autoPanel?n.value.length?ts.open:null:t.panel;t=Mr.init(n.value,r,e.state)}else n.is(qf)?t=new Mr(t.diagnostics,n.value?ts.open:null,t.selected):n.is(dx)&&(t=new Mr(t.diagnostics,t.panel,n.value));return t},provide:t=>[Yi.from(t,e=>e.panel),Q.decorations.from(t,e=>e.diagnostics)]}),JO=ae.mark({class:"cm-lintRange cm-lintRange-active"});function eL(t,e,n){let{diagnostics:r}=t.state.field(Ot),o,i=-1,s=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:d})=>{if(e>=l&&e<=c&&(l==c||(e>l||n>0)&&(e<c||n<0)))return o=d.diagnostics,i=l,s=c,!1});let a=t.state.facet(es).tooltipFilter;return o&&a&&(o=a(o,t.state)),o?{pos:i,end:s,above:t.state.doc.lineAt(i).to<s,create(){return{dom:tL(t,o)}}}:null}function tL(t,e){return Me("ul",{class:"cm-tooltip-lint"},e.map(n=>hx(t,n,!1)))}const nL=t=>{let e=t.state.field(Ot,!1);(!e||!e.panel)&&t.dispatch({effects:ZO(t.state,[qf.of(!0)])});let n=Gi(t,ts.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Vm=t=>{let e=t.state.field(Ot,!1);return!e||!e.panel?!1:(t.dispatch({effects:qf.of(!1)}),!0)},rL=t=>{let e=t.state.field(Ot,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},oL=[{key:"Mod-Shift-m",run:nL,preventDefault:!0},{key:"F8",run:rL}],es=ne.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},En(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function ux(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let o=n[r];if(/[a-zA-Z]/.test(o)&&!e.some(i=>i.toLowerCase()==o.toLowerCase())){e.push(o);continue e}}e.push("")}return e}function hx(t,e,n){var r;let o=n?ux(e.actions):[];return Me("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Me("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,s)=>{let a=!1,l=f=>{if(f.preventDefault(),a)return;a=!0;let m=Uo(t.state.field(Ot).diagnostics,e);m&&i.apply(t,m.from,m.to)},{name:c}=i,d=o[s]?c.indexOf(o[s]):-1,h=d<0?c:[c.slice(0,d),Me("u",c.slice(d,d+1)),c.slice(d+1)];return Me("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${d<0?"":` (access key "${o[s]})"`}.`},h)}),e.source&&Me("div",{class:"cm-diagnosticSource"},e.source))}class iL extends Qn{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Me("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class _m{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=hx(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ts{constructor(e){this.view=e,this.items=[];let n=o=>{if(o.keyCode==27)Vm(this.view),this.view.focus();else if(o.keyCode==38||o.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(o.keyCode==40||o.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(o.keyCode==36)this.moveSelection(0);else if(o.keyCode==35)this.moveSelection(this.items.length-1);else if(o.keyCode==13)this.view.focus();else if(o.keyCode>=65&&o.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],s=ux(i.actions);for(let a=0;a<s.length;a++)if(s[a].toUpperCase().charCodeAt(0)==o.keyCode){let l=Uo(this.view.state.field(Ot).diagnostics,i);l&&i.actions[a].apply(e,l.from,l.to)}}else return;o.preventDefault()},r=o=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(o.target)&&this.moveSelection(i)};this.list=Me("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Me("div",{class:"cm-panel-lint"},this.list,Me("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Vm(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ot).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(Ot),r=0,o=!1,i=null,s=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let d of c.diagnostics){if(s.has(d))continue;s.add(d);let h=-1,f;for(let m=r;m<this.items.length;m++)if(this.items[m].diagnostic==d){h=m;break}h<0?(f=new _m(this.view,d),this.items.splice(r,0,f),o=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),o=!0)),n&&f.diagnostic==n.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),i=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();this.items.length==0&&(this.items.push(new _m(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Ot),r=Uo(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:dx.of(r)})}static open(e){return new ts(e)}}function sL(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function fa(t){return sL(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const aL=Q.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:fa("#d11")},".cm-lintRange-warning":{backgroundImage:fa("orange")},".cm-lintRange-info":{backgroundImage:fa("#999")},".cm-lintRange-hint":{backgroundImage:fa("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function lL(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function cL(t){let e="hint",n=1;for(let r of t){let o=lL(r.severity);o>n&&(n=o,e=r.severity)}return e}const dL=[Ot,Q.decorations.compute([Ot],t=>{let{selected:e,panel:n}=t.field(Ot);return!e||!n||e.from==e.to?ae.none:ae.set([JO.range(e.from,e.to)])}),mI(eL,{hideOn:QO}),aL];var zm=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(HO)),e.defaultKeymap!==!1&&(r=r.concat(LD)),e.searchKeymap!==!1&&(r=r.concat(aO)),e.historyKeymap!==!1&&(r=r.concat(Wj)),e.foldKeymap!==!1&&(r=r.concat(JI)),e.completionKeymap!==!1&&(r=r.concat(lx)),e.lintKeymap!==!1&&(r=r.concat(oL));var o=[];return e.lineNumbers!==!1&&o.push(AI()),e.highlightActiveLineGutter!==!1&&o.push(RI()),e.highlightSpecialChars!==!1&&o.push(PE()),e.history!==!1&&o.push(Lj()),e.foldGutter!==!1&&o.push(rj()),e.drawSelection!==!1&&o.push(jE()),e.dropCursor!==!1&&o.push(BE()),e.allowMultipleSelections!==!1&&o.push($e.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(PI()),e.syntaxHighlighting!==!1&&o.push(lv(aj,{fallback:!0})),e.bracketMatching!==!1&&o.push(mj()),e.closeBrackets!==!1&&o.push(FO()),e.autocompletion!==!1&&o.push(YO()),e.rectangularSelection!==!1&&o.push(rI()),n!==!1&&o.push(sI()),e.highlightActiveLine!==!1&&o.push(YE()),e.highlightSelectionMatches!==!1&&o.push(HD()),e.tabSize&&typeof e.tabSize=="number"&&o.push(Ql.of(" ".repeat(e.tabSize))),o.concat([Yl.of(r.flat())]).filter(Boolean)};const uL="#e5c07b",Hm="#e06c75",hL="#56b6c2",fL="#ffffff",Ea="#abb2bf",Pu="#7d8799",mL="#61afef",gL="#98c379",Pm="#d19a66",pL="#c678dd",bL="#21252b",Wm="#2c313a",qm="#282c34",hd="#353a42",vL="#3E4451",Um="#528bff",xL=Q.theme({"&":{color:Ea,backgroundColor:qm},".cm-content":{caretColor:Um},".cm-cursor, .cm-dropCursor":{borderLeftColor:Um},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:vL},".cm-panels":{backgroundColor:bL,color:Ea},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:qm,color:Pu,border:"none"},".cm-activeLineGutter":{backgroundColor:Wm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:hd},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:hd,borderBottomColor:hd},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Wm,color:Ea}}},{dark:!0}),wL=xs.define([{tag:N.keyword,color:pL},{tag:[N.name,N.deleted,N.character,N.propertyName,N.macroName],color:Hm},{tag:[N.function(N.variableName),N.labelName],color:mL},{tag:[N.color,N.constant(N.name),N.standard(N.name)],color:Pm},{tag:[N.definition(N.name),N.separator],color:Ea},{tag:[N.typeName,N.className,N.number,N.changed,N.annotation,N.modifier,N.self,N.namespace],color:uL},{tag:[N.operator,N.operatorKeyword,N.url,N.escape,N.regexp,N.link,N.special(N.string)],color:hL},{tag:[N.meta,N.comment],color:Pu},{tag:N.strong,fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.link,color:Pu,textDecoration:"underline"},{tag:N.heading,fontWeight:"bold",color:Hm},{tag:[N.atom,N.bool,N.special(N.variableName)],color:Pm},{tag:[N.processingInstruction,N.string,N.inserted],color:gL},{tag:N.invalid,color:fL}]),yL=[xL,lv(wL)];var CL=Q.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$L=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:o=!1,theme:i="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(Yl.of([ND])),a&&(typeof a=="boolean"?l.unshift(zm()):l.unshift(zm(a))),s&&l.unshift(JE(s)),i){case"light":l.push(CL);break;case"dark":l.push(yL);break;case"none":break;default:l.push(i);break}return r===!1&&l.push(Q.editable.of(!1)),o&&l.push($e.readOnly.of(!0)),[...l]},SL=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),Km=Mn.define(),AL=[];function fx(t){var{value:e,selection:n,onChange:r,onStatistics:o,onCreateEditor:i,onUpdate:s,extensions:a=AL,autoFocus:l,theme:c="light",height:d=null,minHeight:h=null,maxHeight:f=null,width:m=null,minWidth:b=null,maxWidth:p=null,placeholder:v="",editable:x=!0,readOnly:y=!1,indentWithTab:$=!0,basicSetup:S=!0,root:A,initialState:k}=t,[T,I]=g.useState(),[E,j]=g.useState(),[L,D]=g.useState(),z=Q.theme({"&":{height:d,minHeight:h,maxHeight:f,width:m,minWidth:b,maxWidth:p},"& .cm-scroller":{height:"100% !important"}}),V=Q.updateListener.of(P=>{if(P.docChanged&&typeof r=="function"&&!P.transactions.some(X=>X.annotation(Km))){var _=P.state.doc,O=_.toString();r(O,P)}o&&o(SL(P))}),W=$L({theme:c,editable:x,readOnly:y,placeholder:v,indentWithTab:$,basicSetup:S}),G=[V,z,...W];return s&&typeof s=="function"&&G.push(Q.updateListener.of(s)),G=G.concat(a),g.useEffect(()=>{if(T&&!L){var P={doc:e,selection:n,extensions:G},_=k?$e.fromJSON(k.json,P,k.fields):$e.create(P);if(D(_),!E){var O=new Q({state:_,parent:T,root:A});j(O),i&&i(O,_)}}return()=>{E&&(D(void 0),j(void 0))}},[T,L]),g.useEffect(()=>I(t.container),[t.container]),g.useEffect(()=>()=>{E&&(E.destroy(),j(void 0))},[E]),g.useEffect(()=>{l&&E&&E.focus()},[l,E]),g.useEffect(()=>{E&&E.dispatch({effects:me.reconfigure.of(G)})},[c,a,d,h,f,m,b,p,v,x,y,$,S,r,s]),g.useEffect(()=>{if(e!==void 0){var P=E?E.state.doc.toString():"";E&&e!==P&&E.dispatch({changes:{from:0,to:P.length,insert:e||""},annotations:[Km.of(!0)]})}},[e,E]),{state:L,setState:D,view:E,setView:j,container:T,setContainer:I}}var kL=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],TL=g.forwardRef((t,e)=>{var{className:n,value:r="",selection:o,extensions:i=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:d,theme:h="light",height:f,minHeight:m,maxHeight:b,width:p,minWidth:v,maxWidth:x,basicSetup:y,placeholder:$,indentWithTab:S,editable:A,readOnly:k,root:T,initialState:I}=t,E=Aj(t,kL),j=g.useRef(null),{state:L,view:D,container:z}=fx({container:j.current,root:T,value:r,autoFocus:d,theme:h,height:f,minHeight:m,maxHeight:b,width:p,minWidth:v,maxWidth:x,basicSetup:y,placeholder:$,indentWithTab:S,editable:A,readOnly:k,selection:o,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:i,initialState:I});if(g.useImperativeHandle(e,()=>({editor:j.current,state:L,view:D}),[j,z,L,D]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var V=typeof h=="string"?"cm-theme-"+h:"cm-theme";return u.jsx("div",F({ref:j,className:""+V+(n?" "+n:"")},E))});TL.displayName="CodeMirror";let fd=new Map,Wu=!1;try{Wu=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let pl=!1;try{pl=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const mx={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class gx{format(e){let n="";if(!Wu&&this.options.signDisplay!=null?n=ML(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!pl){var r;let{unit:o,unitDisplay:i="short",locale:s}=this.resolvedOptions();if(!o)return n;let a=(r=mx[o])===null||r===void 0?void 0:r[i];n+=a[s]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(e),o=this.numberFormatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Wu&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!pl&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=RL(e,n),this.options=n}}function RL(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!pl){var r;let{unit:s,unitDisplay:a="short"}=e;if(!s)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=mx[s])===null||r===void 0)&&r[a]))throw new Error(`Unsupported unit ${s} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let o=t+(e?Object.entries(e).sort((s,a)=>s[0]<a[0]?-1:1).join():"");if(fd.has(o))return fd.get(o);let i=new Intl.NumberFormat(t,e);return fd.set(o,i),i}function ML(t,e,n){if(e==="auto")return t.format(n);if(e==="never")return t.format(Math.abs(n));{let r=!1;if(e==="always"?r=n>0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let o=t.format(-n),i=t.format(n),s=o.replace(i,"").replace(/\u200e|\u061C/,"");return[...s].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),o.replace(i,"!!!").replace(s,"+").replace("!!!",i)}else return t.format(n)}}const EL=new RegExp("^.*\\(.*\\).*$"),IL=["latn","arab","hanidec"];class px{parse(e){return md(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,r){return md(this.locale,this.options,e).isValidPartialNumber(e,n,r)}getNumberingSystem(e){return md(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const Gm=new Map;function md(t,e,n){let r=Ym(t,e);if(!t.includes("-nu-")&&!r.isValidPartialNumber(n)){for(let o of IL)if(o!==r.options.numberingSystem){let i=Ym(t+(t.includes("-u-")?"-nu-":"-u-nu-")+o,e);if(i.isValidPartialNumber(n))return i}}return r}function Ym(t,e){let n=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():""),r=Gm.get(n);return r||(r=new jL(t,e),Gm.set(n,r)),r}class jL{parse(e){let n=this.sanitize(e);if(this.symbols.group&&(n=ma(n,this.symbols.group,"")),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,"-")),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let s=n.indexOf("-");n=n.replace("-","");let a=n.indexOf(".");a===-1&&(a=n.length),n=n.replace(".",""),a-2===0?n=`0.${n}`:a-2===-1?n=`0.0${n}`:a-2===-2?n="0.00":n=`${n.slice(0,a-2)}.${n.slice(a-2)}`,s>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style==="percent"){var o,i;let s={...this.options,style:"decimal",minimumFractionDigits:Math.min(((o=this.options.minimumFractionDigits)!==null&&o!==void 0?o:0)+2,20),maximumFractionDigits:Math.min(((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)+2,20)};return new px(this.locale,s).parse(new gx(this.locale,s).format(r))}return this.options.currencySign==="accounting"&&EL.test(e)&&(r=-1*r),r}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=ma(e,".",this.symbols.group))),this.options.locale==="fr-FR"&&(e=ma(e,"."," ")),e}isValidPartialNumber(e,n=-1/0,r=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&r>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=ma(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=OL(e,this.formatter,this.options,n);var r,o;this.options.style==="percent"&&(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)>18||((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const Xm=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),DL=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function OL(t,e,n,r){var o,i,s,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21}),c=l.formatToParts(-10000.111),d=l.formatToParts(10000.111),h=DL.map(j=>l.formatToParts(j));var f;let m=(f=(o=c.find(j=>j.type==="minusSign"))===null||o===void 0?void 0:o.value)!==null&&f!==void 0?f:"-",b=(i=d.find(j=>j.type==="plusSign"))===null||i===void 0?void 0:i.value;!b&&(r?.signDisplay==="exceptZero"||r?.signDisplay==="always")&&(b="+");let v=(s=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(j=>j.type==="decimal"))===null||s===void 0?void 0:s.value,x=(a=c.find(j=>j.type==="group"))===null||a===void 0?void 0:a.value,y=c.filter(j=>!Xm.has(j.type)).map(j=>Qm(j.value)),$=h.flatMap(j=>j.filter(L=>!Xm.has(L.type)).map(L=>Qm(L.value))),S=[...new Set([...y,...$])].sort((j,L)=>L.length-j.length),A=S.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${S.join("|")}|[\\p{White_Space}]`,"gu"),k=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),T=new Map(k.map((j,L)=>[j,L])),I=new RegExp(`[${k.join("")}]`,"g");return{minusSign:m,plusSign:b,decimal:v,group:x,literals:A,numeral:I,index:j=>String(T.get(j))}}function ma(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function Qm(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const bx="Popover",[vx,IW]=qe(bx,[br]),xx=br(),[jW,si]=vx(bx),LL="PopoverTrigger",NL=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=si(LL,n),i=xx(n),s=le(e,o.triggerRef),a=g.createElement(ie.button,F({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Cx(o.open)},r,{ref:s,onClick:U(t.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:g.createElement(as,F({asChild:!0},i),a)}),wx="PopoverPortal",[BL,FL]=vx(wx,{forceMount:void 0}),VL=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=si(wx,e);return g.createElement(BL,{scope:e,forceMount:n},g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},r)))},ns="PopoverContent",_L=g.forwardRef((t,e)=>{const n=FL(ns,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=si(ns,t.__scopePopover);return g.createElement(Qe,{present:r||i.open},i.modal?g.createElement(zL,F({},o,{ref:e})):g.createElement(HL,F({},o,{ref:e})))}),zL=g.forwardRef((t,e)=>{const n=si(ns,t.__scopePopover),r=g.useRef(null),o=le(e,r),i=g.useRef(!1);return g.useEffect(()=>{const s=r.current;if(s)return af(s)},[]),g.createElement(_l,{as:yn,allowPinchZoom:!0},g.createElement(yx,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:U(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:U(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),HL=g.forwardRef((t,e)=>{const n=si(ns,t.__scopePopover),r=g.useRef(!1),o=g.useRef(!1);return g.createElement(yx,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),yx=g.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...h}=t,f=si(ns,n),m=xx(n);return Jo(),g.createElement(ei,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},g.createElement(Xr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},g.createElement(ls,F({"data-state":Cx(f.open),role:"dialog",id:f.contentId},m,h,{ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function Cx(t){return t?"open":"closed"}const PL=NL,WL=VL,qL=_L,$x="Progress",ic=100,[UL,DW]=qe($x),[KL,GL]=UL($x),Sx=g.forwardRef((t,e)=>{const{__scopeProgress:n,value:r,max:o,getValueLabel:i=QL,...s}=t,a=qu(o)?o:ic,l=kx(r,a)?r:null,c=bl(l)?i(l,a):void 0;return g.createElement(KL,{scope:n,value:l,max:a},g.createElement(ie.div,F({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":bl(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":Ax(l,a),"data-value":l??void 0,"data-max":a},s,{ref:e})))});Sx.propTypes={max(t,e,n){const r=t[e],o=String(r);return r&&!qu(r)?new Error(ZL(o,n)):null},value(t,e,n){const r=t[e],o=String(r),i=qu(t.max)?t.max:ic;return r!=null&&!kx(r,i)?new Error(JL(o,n)):null}};const YL="ProgressIndicator",XL=g.forwardRef((t,e)=>{var n;const{__scopeProgress:r,...o}=t,i=GL(YL,r);return g.createElement(ie.div,F({"data-state":Ax(i.value,i.max),"data-value":(n=i.value)!==null&&n!==void 0?n:void 0,"data-max":i.max},o,{ref:e}))});function QL(t,e){return`${Math.round(t/e*100)}%`}function Ax(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function bl(t){return typeof t=="number"}function qu(t){return bl(t)&&!isNaN(t)&&t>0}function kx(t,e){return bl(t)&&!isNaN(t)&&t<=e&&t>=0}function ZL(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ic}\`.`}function JL(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
|
|
59
|
+
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var mr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Wi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},GR=typeof navigator<"u"&&/Mac/.test(navigator.platform),YR=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ot=0;ot<10;ot++)mr[48+ot]=mr[96+ot]=String(ot);for(var ot=1;ot<=24;ot++)mr[ot+111]="F"+ot;for(var ot=65;ot<=90;ot++)mr[ot]=String.fromCharCode(ot+32),Wi[ot]=String.fromCharCode(ot);for(var qc in mr)Wi.hasOwnProperty(qc)||(Wi[qc]=mr[qc]);function XR(t){var e=GR&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||YR&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Wi:mr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Me(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];typeof o=="string"?t.setAttribute(r,o):o!=null&&(t[r]=o)}e++}for(;e<arguments.length;e++)Pb(t,arguments[e]);return t}function Pb(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)Pb(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}function qi(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function fu(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function $a(t,e){if(!e.anchorNode)return!1;try{return fu(t,e.anchorNode)}catch{return!1}}function _o(t){return t.nodeType==3?Wr(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Ei(t,e,n,r){return n?b1(t,e,n,r,-1)||b1(t,e,n,r,1):!1}function Pr(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Qa(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function b1(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:$n(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Pr(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=o<0?$n(t):0}else return!1}}function $n(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ms(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function QR(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Wb(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function ZR(t,e,n,r,o,i,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let d=t,h=!1;d&&!h;)if(d.nodeType==1){let f,m=d==l.body,p=1,b=1;if(m)f=QR(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(h=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let y=d.getBoundingClientRect();({scaleX:p,scaleY:b}=Wb(d,y)),f={left:y.left,right:y.left+d.clientWidth*p,top:y.top,bottom:y.top+d.clientHeight*b}}let v=0,x=0;if(o=="nearest")e.top<f.top?(x=e.top-(f.top+s),n>0&&e.bottom>f.bottom+x&&(x=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(x=e.bottom-f.bottom+s,n<0&&e.top-x<f.top&&(x=e.top-(f.top+s)));else{let y=e.bottom-e.top,$=f.bottom-f.top;x=(o=="center"&&y<=$?e.top+y/2-$/2:o=="start"||o=="center"&&n<0?e.top-s:e.bottom-$+s)-f.top}if(r=="nearest"?e.left<f.left?(v=e.left-(f.left+i),n>0&&e.right>f.right+v&&(v=e.right-f.right+i)):e.right>f.right&&(v=e.right-f.right+i,n<0&&e.left<f.left+v&&(v=e.left-(f.left+i))):v=(r=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:r=="start"==a?e.left-i:e.right-(f.right-f.left)+i)-f.left,v||x)if(m)c.scrollBy(v,x);else{let y=0,$=0;if(x){let S=d.scrollTop;d.scrollTop+=x/b,$=(d.scrollTop-S)*b}if(v){let S=d.scrollLeft;d.scrollLeft+=v/p,y=(d.scrollLeft-S)*p}e={left:e.left-y,top:e.top-$,right:e.right-y,bottom:e.bottom-$},y&&Math.abs(y-v)<1&&(r="nearest"),$&&Math.abs($-x)<1&&(o="nearest")}if(m)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function JR(t){let e=t.ownerDocument,n,r;for(let o=t.parentNode;o&&!(o==e.body||n&&r);)if(o.nodeType==1)!r&&o.scrollHeight>o.clientHeight&&(r=o),!n&&o.scrollWidth>o.clientWidth&&(n=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:n,y:r}}class eM{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?$n(n):0),r,Math.min(e.focusOffset,r?$n(r):0))}set(e,n,r,o){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=o}}let ho=null;function qb(t){if(t.setActive)return t.setActive();if(ho)return t.focus(ho);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ho==null?{get preventScroll(){return ho={preventScroll:!0},!0}}:void 0),!ho){ho=!1;for(let n=0;n<e.length;){let r=e[n++],o=e[n++],i=e[n++];r.scrollTop!=o&&(r.scrollTop=o),r.scrollLeft!=i&&(r.scrollLeft=i)}}}let v1;function Wr(t,e,n=e){let r=v1||(v1=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function ko(t,e,n,r){let o={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=r);let i=new KeyboardEvent("keydown",o);i.synthetic=!0,t.dispatchEvent(i);let s=new KeyboardEvent("keyup",o);return s.synthetic=!0,t.dispatchEvent(s),i.defaultPrevented||s.defaultPrevented}function tM(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Ub(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function nM(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,$n(n));;)if(r){if(n.nodeType!=1)return!1;let o=n.childNodes[r-1];o.contentEditable=="false"?r--:(n=o,r=$n(n))}else{if(n==t)return!0;r=Pr(n),n=n.parentNode}}function Kb(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Gb(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=$n(n)}else if(n.parentNode&&!Qa(n))r=Pr(n),n=n.parentNode;else return null}}function Yb(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Qa(n))r=Pr(n)+1,n=n.parentNode;else return null}}class dt{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new dt(e.parentNode,Pr(e),n)}static after(e,n){return new dt(e.parentNode,Pr(e)+1,n)}}const yf=[];class Ie{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,o=null,i;for(let s of this.children){if(s.flags&7){if(!s.dom&&(i=o?o.nextSibling:r.firstChild)){let a=Ie.get(i);(!a||!a.parent&&a.canReuseDOM(s))&&s.reuseDOM(i)}s.sync(e,n),s.flags&=-8}if(i=o?o.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&i!=s.dom&&(n.written=!0),s.dom.parentNode==r)for(;i&&i!=s.dom;)i=x1(i);else r.insertBefore(s.dom,i);o=s.dom}for(i=o?o.nextSibling:r.firstChild,i&&n&&n.node==r&&(n.written=!0);i;)i=x1(i)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let o=$n(e)==0?0:n==0?-1:1;for(;;){let i=e.parentNode;if(i==this.dom)break;o==0&&i.firstChild!=i.lastChild&&(e==i.firstChild?o=-1:o=1),e=i}o<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!Ie.get(r);)r=r.nextSibling;if(!r)return this.length;for(let o=0,i=0;;o++){let s=this.children[o];if(s.dom==r)return i;i+=s.length+s.breakAfter}}domBoundsAround(e,n,r=0){let o=-1,i=-1,s=-1,a=-1;for(let l=0,c=r,d=r;l<this.children.length;l++){let h=this.children[l],f=c+h.length;if(c<e&&f>n)return h.domBoundsAround(e,n,c);if(f>=e&&o==-1&&(o=l,i=c),c>n&&h.dom.parentNode==this.dom){s=l,a=d;break}d=f,c=f+h.breakAfter}return{from:i,to:a<0?r+this.length:a,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s<this.children.length&&s>=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=yf){this.markDirty();for(let o=e;o<n;o++){let i=this.children[o];i.parent==this&&r.indexOf(i)<0&&i.destroy()}r.length<250?this.children.splice(e,n-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(n));for(let o=0;o<r.length;o++)r[o].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Xb(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,o,i,s){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}Ie.prototype.breakAfter=0;function x1(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Xb{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Qb(t,e,n,r,o,i,s,a,l){let{children:c}=t,d=c.length?c[e]:null,h=i.length?i[i.length-1]:null,f=h?h.breakAfter:s;if(!(e==r&&d&&!s&&!f&&i.length<2&&d.merge(n,o,i.length?h:null,n==0,a,l))){if(r<c.length){let m=c[r];m&&(o<m.length||m.breakAfter&&h?.breakAfter)?(e==r&&(m=m.split(o),o=0),!f&&h&&m.merge(0,o,h,!0,0,l)?i[i.length-1]=m:((o||m.children.length&&!m.children[0].length)&&m.merge(0,o,null,!1,0,l),i.push(m))):m?.breakAfter&&(h?h.breakAfter=1:s=1),r++}for(d&&(d.breakAfter=s,n>0&&(!s&&i.length&&d.merge(n,d.length,i[0],!1,a,0)?d.breakAfter=i.shift().breakAfter:(n<d.length||d.children.length&&d.children[d.children.length-1].length==0)&&d.merge(n,d.length,null,!1,a,0),e++));e<r&&i.length;)if(c[r-1].become(i[i.length-1]))r--,i.pop(),l=i.length?0:a;else if(c[e].become(i[0]))e++,i.shift(),a=i.length?0:l;else break;!i.length&&e&&r<c.length&&!c[e-1].breakAfter&&c[r].merge(0,0,c[e-1],!1,a,l)&&e--,(e<r||i.length)&&t.replaceChildren(e,r,i)}}function Zb(t,e,n,r,o,i){let s=t.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:d}=s.findPos(e,-1),h=e-n;for(let f of r)h+=f.length;t.length+=h,Qb(t,c,d,a,l,r,0,o,i)}let wt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},mu=typeof document<"u"?document:{documentElement:{style:{}}};const gu=/Edge\/(\d+)/.exec(wt.userAgent),Jb=/MSIE \d/.test(wt.userAgent),pu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wt.userAgent),Kl=!!(Jb||pu||gu),w1=!Kl&&/gecko\/(\d+)/i.test(wt.userAgent),Uc=!Kl&&/Chrome\/(\d+)/.exec(wt.userAgent),rM="webkitFontSmoothing"in mu.documentElement.style,e5=!Kl&&/Apple Computer/.test(wt.vendor),y1=e5&&(/Mobile\/\w+/.test(wt.userAgent)||wt.maxTouchPoints>2);var te={mac:y1||/Mac/.test(wt.platform),windows:/Win/.test(wt.platform),linux:/Linux|X11/.test(wt.platform),ie:Kl,ie_version:Jb?mu.documentMode||6:pu?+pu[1]:gu?+gu[1]:0,gecko:w1,gecko_version:w1?+(/Firefox\/(\d+)/.exec(wt.userAgent)||[0,0])[1]:0,chrome:!!Uc,chrome_version:Uc?+Uc[1]:0,ios:y1,android:/Android\b/.test(wt.userAgent),safari:e5,webkit_version:rM?+(/\bAppleWebKit\/(\d+)/.exec(wt.userAgent)||[0,0])[1]:0,tabSize:mu.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const oM=256;class Zt extends Ie{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Zt)||this.length-(n-e)+r.length>oM||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Zt(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new dt(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return iM(this.dom,e,n)}}class Un extends Ie{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let o of n)o.setParent(this)}setAttrs(e){if(Ub(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,o,i,s){return r&&(!(r instanceof Un&&r.mark.eq(this.mark))||e&&i<=0||n<this.length&&s<=0)?!1:(Zb(this,e,n,r?r.children.slice():[],i-1,s-1),this.markDirty(),!0)}split(e){let n=[],r=0,o=-1,i=0;for(let a of this.children){let l=r+a.length;l>e&&n.push(r<e?a.split(e-r):a),o<0&&r>=e&&(o=i),r=l,i++}let s=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new Un(this.mark,n,s)}domAtPos(e){return t5(this,e)}coordsAt(e,n){return r5(this,e,n)}}function iM(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let o=e,i=e,s=0;e==0&&n<0||e==r&&n>=0?te.chrome||te.gecko||(e?(o--,s=1):i<r&&(i++,s=-1)):n<0?o--:i<r&&i++;let a=Wr(t,o,i).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return te.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?ms(l,s<0):l||null}class ir extends Ie{static create(e,n,r){return new ir(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=ir.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,o,i,s){return r&&(!(r instanceof ir)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof ir&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return ke.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,o=this.posAtStart;return r?r.slice(o,o+this.length):ke.empty}domAtPos(e){return(this.length?e==0:this.side>0)?dt.before(this.dom):dt.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let o=this.dom.getClientRects(),i=null;if(!o.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?o.length-1:0;i=o[a],!(e>0?a==0:a==o.length-1||i.top<i.bottom);a+=s?-1:1);return ms(i,!s)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class zo extends Ie{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof zo&&e.side==this.side}split(){return new zo(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?dt.before(this.dom):dt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ke.empty}get isHidden(){return!0}}Zt.prototype.children=ir.prototype.children=zo.prototype.children=yf;function t5(t,e){let n=t.dom,{children:r}=t,o=0;for(let i=0;o<r.length;o++){let s=r[o],a=i+s.length;if(!(a==i&&s.getSide()<=0)){if(e>i&&e<a&&s.dom.parentNode==n)return s.domAtPos(e-i);if(e<=i)break;i=a}}for(let i=o;i>0;i--){let s=r[i-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let i=o;i<r.length;i++){let s=r[i];if(s.dom.parentNode==n)return s.domAtPos(0)}return new dt(n,0)}function n5(t,e,n){let r,{children:o}=t;n>0&&e instanceof Un&&o.length&&(r=o[o.length-1])instanceof Un&&r.mark.eq(e.mark)?n5(r,e.children[0],n-1):(o.push(e),e.setParent(t)),t.length+=e.length}function r5(t,e,n){let r=null,o=-1,i=null,s=-1;function a(c,d){for(let h=0,f=0;h<c.children.length&&f<=d;h++){let m=c.children[h],p=f+m.length;p>=d&&(m.children.length?a(m,d-f):(!i||i.isHidden&&(n>0||aM(i,m)))&&(p>d||f==p&&m.getSide()>0)?(i=m,s=d-f):(f<d||f==p&&m.getSide()<0&&!m.isHidden)&&(r=m,o=d-f)),f=p}}a(t,e);let l=(n<0?r:i)||r||i;return l?l.coordsAt(Math.max(0,l==r?o:s),n):sM(t)}function sM(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=_o(e);return n[n.length-1]||null}function aM(t,e){let n=t.coordsAt(0,1),r=e.coordsAt(0,1);return n&&r&&r.top<n.bottom}function bu(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const C1=Object.create(null);function Za(t,e,n){if(t==e)return!0;t||(t=C1),e||(e=C1);let r=Object.keys(t),o=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=o.length-(n&&o.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(o.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function vu(t,e,n){let r=!1;if(e)for(let o in e)n&&o in n||(r=!0,o=="style"?t.style.cssText="":t.removeAttribute(o));if(n)for(let o in n)e&&e[o]==n[o]||(r=!0,o=="style"?t.style.cssText=n[o]:t.setAttribute(o,n[o]));return r}function lM(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Qn{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var pt=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(pt||(pt={}));class ae extends Hr{constructor(e,n,r,o){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=o}get heightRelevant(){return!1}static mark(e){return new gs(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new gr(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,o;if(e.isBlockGap)r=-5e8,o=4e8;else{let{start:i,end:s}=o5(e,n);r=(i?n?-3e8:-1:5e8)-1,o=(s?n?2e8:1:-6e8)+1}return new gr(e,r,o,n,e.widget||null,!0)}static line(e){return new ps(e)}static set(e,n=!1){return Ae.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ae.none=Ae.empty;class gs extends ae{constructor(e){let{start:n,end:r}=o5(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof gs&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Za(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}gs.prototype.point=!1;class ps extends ae{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ps&&this.spec.class==e.spec.class&&Za(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}ps.prototype.mapMode=gt.TrackBefore;ps.prototype.point=!0;class gr extends ae{constructor(e,n,r,o,i,s){super(n,r,i,e),this.block=o,this.isReplace=s,this.mapMode=o?n<=0?gt.TrackBefore:gt.TrackAfter:gt.TrackDel}get type(){return this.startSide!=this.endSide?pt.WidgetRange:this.startSide<=0?pt.WidgetBefore:pt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof gr&&cM(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}gr.prototype.point=!0;function o5(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function cM(t,e){return t==e||!!(t&&e&&t.compare(e))}function Sa(t,e,n,r=0){let o=n.length-1;o>=0&&n[o]+r>=t?n[o]=Math.max(n[o],e):n.push(t,e)}class Ue extends Ie{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,o,i,s){if(r){if(!(r instanceof Ue))return!1;this.dom||r.transferDOM(this)}return o&&this.setDeco(r?r.attrs:null),Zb(this,e,n,r?r.children.slice():[],i,s),!0}split(e){let n=new Ue;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:o}=this.childPos(e);o&&(n.append(this.children[r].split(o),0),this.children[r].merge(o,this.children[r].length,null,!1,0,0),r++);for(let i=r;i<this.children.length;i++)n.append(this.children[i],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Za(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){n5(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=bu(n,this.attrs||{})),r&&(this.attrs=bu({class:r},this.attrs||{}))}domAtPos(e){return t5(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(Ub(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(vu(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let o=this.dom.lastChild;for(;o&&Ie.get(o)instanceof Un;)o=o.lastChild;if(!o||!this.length||o.nodeName!="BR"&&((r=Ie.get(o))===null||r===void 0?void 0:r.isEditable)==!1&&(!te.ios||!this.children.some(i=>i instanceof Zt))){let i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Zt)||/[^ -~]/.test(r.text))return null;let o=_o(r.dom);if(o.length!=1)return null;e+=o[0].width,n=o[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=r5(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:o}=this.parent.view.viewState,i=r.bottom-r.top;if(Math.abs(i-o.lineHeight)<2&&o.textHeight<i){let s=(i-o.textHeight)/2;return{top:r.top+s,bottom:r.bottom-s,left:r.left,right:r.left}}}return r}become(e){return e instanceof Ue&&this.children.length==0&&e.children.length==0&&Za(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,n){for(let r=0,o=0;r<e.children.length;r++){let i=e.children[r],s=o+i.length;if(s>=n){if(i instanceof Ue)return i;if(s>n)break}o=s+i.breakAfter}return null}}class zn extends Ie{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,o,i,s){return r&&(!(r instanceof zn)||!this.widget.compare(r.widget)||e>0&&i<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?dt.before(this.dom):dt.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new zn(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return yf}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):ke.empty}domBoundsAround(){return null}become(e){return e instanceof zn&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);return r||(this.widget instanceof xu?null:ms(this.dom.getBoundingClientRect(),this.length?e==0:n<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class xu extends Qn{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Ii{constructor(e,n,r,o){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=o,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof zn&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ue),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Zs(new zo(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof zn)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=i,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(Zs(new Zt(this.text.slice(this.textOff,this.textOff+o)),n),r),this.atCursorPos=!0,this.textOff+=o,e-=o,r=0}}span(e,n,r,o){this.buildText(n-e,r,o),this.pos=n,this.openStart<0&&(this.openStart=o)}point(e,n,r,o,i,s){if(this.disallowBlockEffectsFor[s]&&r instanceof gr){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof gr)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new zn(r.widget||Ho.block,a,r));else{let l=ir.create(r.widget||Ho.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&i<=o.length&&(e<n||r.startSide>0),d=!l.isEditable&&(e<n||i>o.length||r.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(o),c&&(h.append(Zs(new zo(1),o),i),i=o.length+Math.max(0,i-o.length)),h.append(Zs(l,o),i),this.atCursorPos=d,this.pendingBuffer=d?e<n||i>o.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,o,i){let s=new Ii(e,n,r,i);return s.openEnd=Ae.spans(o,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function Zs(t,e){for(let n of e)t=new Un(n,[t],t.length);return t}class Ho extends Qn{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ho.inline=new Ho("span");Ho.block=new Ho("div");var Oe=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(Oe||(Oe={}));const qr=Oe.LTR,Cf=Oe.RTL;function i5(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const dM=i5("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),uM=i5("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),wu=Object.create(null),ln=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);wu[e]=n,wu[n]=-e}function s5(t){return t<=247?dM[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?uM[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const hM=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class sr{get dir(){return this.level%2?Cf:qr}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,o){let i=-1;for(let s=0;s<e.length;s++){let a=e[s];if(a.from<=n&&a.to>=n){if(a.level==r)return s;(i<0||(o!=0?o<0?a.from<n:a.to>n:e[i].level>a.level))&&(i=s)}}if(i<0)throw new RangeError("Index out of range");return i}}function a5(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],o=e[n];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!a5(r.inner,o.inner))return!1}return!0}const Ee=[];function fM(t,e,n,r,o){for(let i=0;i<=r.length;i++){let s=i?r[i-1].to:e,a=i<r.length?r[i].from:n,l=i?256:o;for(let c=s,d=l,h=l;c<a;c++){let f=s5(t.charCodeAt(c));f==512?f=d:f==8&&h==4&&(f=16),Ee[c]=f==4?2:f,f&7&&(h=f),d=f}for(let c=s,d=l,h=l;c<a;c++){let f=Ee[c];if(f==128)c<a-1&&d==Ee[c+1]&&d&24?f=Ee[c]=d:Ee[c]=256;else if(f==64){let m=c+1;for(;m<a&&Ee[m]==64;)m++;let p=c&&d==8||m<n&&Ee[m]==8?h==1?1:8:256;for(let b=c;b<m;b++)Ee[b]=p;c=m-1}else f==8&&h==1&&(Ee[c]=1);d=f,f&7&&(h=f)}}}function mM(t,e,n,r,o){let i=o==1?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let c=s?r[s-1].to:e,d=s<r.length?r[s].from:n;for(let h=c,f,m,p;h<d;h++)if(m=wu[f=t.charCodeAt(h)])if(m<0){for(let b=a-3;b>=0;b-=3)if(ln[b+1]==-m){let v=ln[b+2],x=v&2?o:v&4?v&1?i:o:0;x&&(Ee[h]=Ee[ln[b]]=x),a=b;break}}else{if(ln.length==189)break;ln[a++]=h,ln[a++]=f,ln[a++]=l}else if((p=Ee[h])==2||p==1){let b=p==o;l=b?0:1;for(let v=a-3;v>=0;v-=3){let x=ln[v+2];if(x&2)break;if(b)ln[v+2]|=2;else{if(x&4)break;ln[v+2]|=4}}}}}function gM(t,e,n,r){for(let o=0,i=r;o<=n.length;o++){let s=o?n[o-1].to:t,a=o<n.length?n[o].from:e;for(let l=s;l<a;){let c=Ee[l];if(c==256){let d=l+1;for(;;)if(d==a){if(o==n.length)break;d=n[o++].to,a=o<n.length?n[o].from:e}else if(Ee[d]==256)d++;else break;let h=i==1,f=(d<e?Ee[d]:r)==1,m=h==f?h?1:2:r;for(let p=d,b=o,v=b?n[b-1].to:t;p>l;)p==v&&(p=n[--b].from,v=b?n[b-1].to:t),Ee[--p]=m;l=d}else i=c,l++}}}function yu(t,e,n,r,o,i,s){let a=r%2?2:1;if(r%2==o%2)for(let l=e,c=0;l<n;){let d=!0,h=!1;if(c==i.length||l<i[c].from){let b=Ee[l];b!=a&&(d=!1,h=b==16)}let f=!d&&a==1?[]:null,m=d?r:r+1,p=l;e:for(;;)if(c<i.length&&p==i[c].from){if(h)break e;let b=i[c];if(!d)for(let v=b.to,x=c+1;;){if(v==n)break e;if(x<i.length&&i[x].from==v)v=i[x++].to;else{if(Ee[v]==a)break e;break}}if(c++,f)f.push(b);else{b.from>l&&s.push(new sr(l,b.from,m));let v=b.direction==qr!=!(m%2);Cu(t,v?r+1:r,o,b.inner,b.from,b.to,s),l=b.to}p=b.to}else{if(p==n||(d?Ee[p]!=a:Ee[p]==a))break;p++}f?yu(t,l,p,r+1,o,f,s):l<p&&s.push(new sr(l,p,m)),l=p}else for(let l=n,c=i.length;l>e;){let d=!0,h=!1;if(!c||l>i[c-1].to){let b=Ee[l-1];b!=a&&(d=!1,h=b==16)}let f=!d&&a==1?[]:null,m=d?r:r+1,p=l;e:for(;;)if(c&&p==i[c-1].to){if(h)break e;let b=i[--c];if(!d)for(let v=b.from,x=c;;){if(v==e)break e;if(x&&i[x-1].to==v)v=i[--x].from;else{if(Ee[v-1]==a)break e;break}}if(f)f.push(b);else{b.to<l&&s.push(new sr(b.to,l,m));let v=b.direction==qr!=!(m%2);Cu(t,v?r+1:r,o,b.inner,b.from,b.to,s),l=b.from}p=b.from}else{if(p==e||(d?Ee[p-1]!=a:Ee[p-1]==a))break;p--}f?yu(t,p,l,r+1,o,f,s):p<l&&s.push(new sr(p,l,m)),l=p}}function Cu(t,e,n,r,o,i,s){let a=e%2?2:1;fM(t,o,i,r,a),mM(t,o,i,r,a),gM(o,i,r,a),yu(t,o,i,e,n,r,s)}function pM(t,e,n){if(!t)return[new sr(0,0,e==Cf?1:0)];if(e==qr&&!n.length&&!hM.test(t))return l5(t.length);if(n.length)for(;t.length>Ee.length;)Ee[Ee.length]=256;let r=[],o=e==qr?0:1;return Cu(t,o,o,n,0,t.length,r),r}function l5(t){return[new sr(0,t,0)]}let c5="";function bM(t,e,n,r,o){var i;let s=r.head-t.from,a=sr.find(e,s,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),l=e[a],c=l.side(o,n);if(s==c){let f=a+=o?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],s=l.side(!o,n),c=l.side(o,n)}let d=st(t.text,s,l.forward(o,n));(d<l.from||d>l.to)&&(d=c),c5=t.text.slice(Math.min(s,d),Math.max(s,d));let h=a==(o?e.length-1:0)?null:e[a+(o?1:-1)];return h&&d==c&&h.level+(o?0:1)<l.level?H.cursor(h.side(!o,n)+t.from,h.forward(o,n)?1:-1,h.level):H.cursor(d+t.from,l.forward(o,n)?-1:1,l.level)}function vM(t,e,n){for(let r=e;r<n;r++){let o=s5(t.charCodeAt(r));if(o==1)return qr;if(o==2||o==4)return Cf}return qr}const d5=ne.define(),u5=ne.define(),h5=ne.define(),f5=ne.define(),$u=ne.define(),m5=ne.define(),g5=ne.define(),$f=ne.define(),Sf=ne.define(),p5=ne.define({combine:t=>t.some(e=>e)}),b5=ne.define({combine:t=>t.some(e=>e)}),v5=ne.define();class To{constructor(e,n="nearest",r="nearest",o=5,i=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=o,this.xMargin=i,this.isSnapshot=s}map(e){return e.empty?this:new To(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new To(H.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Js=me.define({map:(t,e)=>t.map(e)}),x5=me.define();function Ct(t,e,n){let r=t.facet(f5);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Fn=ne.define({combine:t=>t.length?t[0]:!0});let xM=0;const go=ne.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class We{constructor(e,n,r,o,i){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=o,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(go.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(go.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:o,provide:i,decorations:s}=n||{};return new We(xM++,e,r,o,a=>{let l=[];return s&&l.push(Ui.of(c=>{let d=c.plugin(a);return d?s(d):ae.none})),i&&l.push(i(a)),l})}static fromClass(e,n){return We.define((r,o)=>new e(r,o),n)}}class Kc{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Ct(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Ct(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Ct(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const w5=ne.define(),Af=ne.define(),Ui=ne.define(),y5=ne.define(),kf=ne.define(),C5=ne.define();function $1(t,e){let n=t.state.facet(C5);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),o=[];return Ae.spans(r,e.from,e.to,{point(){},span(i,s,a,l){let c=i-e.from,d=s-e.from,h=o;for(let f=a.length-1;f>=0;f--,l--){let m=a[f].spec.bidiIsolate,p;if(m==null&&(m=vM(e.text,c,d)),l>0&&h.length&&(p=h[h.length-1]).to==c&&p.direction==m)p.to=d,h=p.inner;else{let b={from:c,to:d,direction:m,inner:[]};h.push(b),h=b.inner}}}}),o}const $5=ne.define();function Tf(t){let e=0,n=0,r=0,o=0;for(let i of t.state.facet($5)){let s=i(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(o=Math.max(o,s.bottom)))}return{left:e,right:n,top:r,bottom:o}}const $i=ne.define();class Vt{constructor(e,n,r,o){this.fromA=e,this.toA=n,this.fromB=r,this.toB=o}join(e){return new Vt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let o=e[n-1];if(!(o.fromA>r.toA)){if(o.toA<r.fromA)break;r=r.join(o),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let o=0,i=0,s=0,a=0;;o++){let l=o==e.length?null:e[o],c=s-a,d=l?l.fromB:1e9;for(;i<n.length&&n[i]<d;){let h=n[i],f=n[i+1],m=Math.max(a,h),p=Math.min(d,f);if(m<=p&&new Vt(m+c,p+c,m,p).addToSet(r),f>d)break;i+=2}if(!l)return r;new Vt(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class Ja{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Ye.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let o=[];this.changes.iterChangedRanges((i,s,a,l)=>o.push(new Vt(i,s,a,l))),this.changedRanges=o}static create(e,n,r){return new Ja(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class S1 extends Ie{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=ae.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Ue],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Vt(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:d})=>d<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let o=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?o=this.domChanged.newSel.head:!kM(e.changes,this.hasComposition)&&!e.selectionSet&&(o=e.state.selection.main.head));let i=o>-1?yM(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:d}=this.hasComposition;r=new Vt(c,d,e.changes.mapPos(c,-1),e.changes.mapPos(d,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(te.ie||te.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=SM(s,a,e.changes);return r=Vt.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:o}=this.view;o.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=te.chrome||te.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||o.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.children)s instanceof zn&&s.widget instanceof xu&&i.push(s.dom);o.updateGaps(i)}updateChildren(e,n,r){let o=r?r.range.addToSet(e.slice()):e,i=this.childCursor(n);for(let s=o.length-1;;s--){let a=s>=0?o[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:d,toB:h}=a,f,m,p,b;if(r&&r.range.fromB<h&&r.range.toB>d){let S=Ii.build(this.view.state.doc,d,r.range.fromB,this.decorations,this.dynamicDecorationMap),A=Ii.build(this.view.state.doc,r.range.toB,h,this.decorations,this.dynamicDecorationMap);m=S.breakAtStart,p=S.openStart,b=A.openEnd;let k=this.compositionView(r);A.breakAtStart?k.breakAfter=1:A.content.length&&k.merge(k.length,k.length,A.content[0],!1,A.openStart,0)&&(k.breakAfter=A.content[0].breakAfter,A.content.shift()),S.content.length&&k.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),f=S.content.concat(k).concat(A.content)}else({content:f,breakAtStart:m,openStart:p,openEnd:b}=Ii.build(this.view.state.doc,d,h,this.decorations,this.dynamicDecorationMap));let{i:v,off:x}=i.findPos(c,1),{i:y,off:$}=i.findPos(l,-1);Qb(this,y,$,v,x,f,m,p,b)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(x5)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Zt(e.text.nodeValue);n.flags|=8;for(let{deco:o}of e.marks)n=new Un(o,[n],n.length);let r=new Ue;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Ie.get(i);a&&a!=s&&(a.dom=null),s.setDOM(i)},r=this.childPos(e.range.fromB,1),o=this.children[r.i];n(e.line,o);for(let i=e.marks.length-1;i>=-1;i--)r=o.childPos(r.off,1),o=o.children[r.i],n(i>=0?e.marks[i].node:e.text,o)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,o=r==this.dom,i=!o&&!(this.view.state.facet(Fn)||this.dom.tabIndex>-1)&&$a(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(o||n||i))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(te.gecko&&a.empty&&!this.hasComposition&&wM(l)){let h=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(h,l.node.childNodes[l.offset]||null)),l=c=new dt(h,0),s=!0}let d=this.view.observer.selectionRange;(s||!d.focusNode||(!Ei(l.node,l.offset,d.anchorNode,d.anchorOffset)||!Ei(c.node,c.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,a))&&(this.view.observer.ignore(()=>{te.android&&te.chrome&&this.dom.contains(d.focusNode)&&AM(d.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=qi(this.view.root);if(h)if(a.empty){if(te.gecko){let f=CM(l.node,l.offset);if(f&&f!=3){let m=(f==1?Gb:Yb)(l.node,l.offset);m&&(l=new dt(m.node,m.offset))}}h.collapse(l.node,l.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(l.node,l.offset);try{h.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(f)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new dt(d.anchorNode,d.anchorOffset),this.impreciseHead=c.precise?null:new dt(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Ei(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=qi(e.root),{anchorNode:o,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=Ue.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let d=this.domAtPos(n.head+n.assoc);r.collapse(d.node,d.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=n.from&&r.collapse(o,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let o=e.offset;!r&&o<n.childNodes.length;o++){let i=Ie.get(n.childNodes[o]);i instanceof Ue&&(r=i.domAtPos(0))}for(let o=e.offset-1;!r&&o>=0;o--){let i=Ie.get(n.childNodes[o]);i instanceof Ue&&(r=i.domAtPos(i.length))}return r?new dt(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Ie.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let o=this.children[n];if(r<o.length||o instanceof Ue)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,o=0;for(let i=this.length,s=this.children.length-1;s>=0;s--){let a=this.children[s],l=i-a.breakAfter,c=l-a.length;if(l<e)break;if(c<=e&&(c<e||a.covers(-1))&&(l>e||a.covers(1))&&(!r||a instanceof Ue&&!(r instanceof Ue&&n>=0)))r=a,o=c;else if(r&&c==e&&l==e&&a instanceof zn&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(r=null)}i=c}return r?r.coordsAt(e-o,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),o=this.children[n];if(!(o instanceof Ue))return null;for(;o.children.length;){let{i:a,off:l}=o.childPos(r,1);for(;;a++){if(a==o.children.length)return null;if((o=o.children[a]).length)break}r=l}if(!(o instanceof Zt))return null;let i=st(o.text,r);if(i==r)return null;let s=Wr(o.dom,r,i).getClientRects();for(let a=0;a<s.length;a++){let l=s[a];if(a==s.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:o}=e,i=this.view.contentDOM.clientWidth,s=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Oe.LTR;for(let c=0,d=0;d<this.children.length;d++){let h=this.children[d],f=c+h.length;if(f>o)break;if(c>=r){let m=h.dom.getBoundingClientRect();if(n.push(m.height),s){let p=h.dom.lastChild,b=p?_o(p):[];if(b.length){let v=b[b.length-1],x=l?v.right-m.left:m.right-v.left;x>a&&(a=x,this.minWidth=i,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+h.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Oe.RTL:Oe.LTR}measureTextSize(){for(let i of this.children)if(i instanceof Ue){let s=i.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,o;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=_o(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,o=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:o}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new Xb(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,o=0;;o++){let i=o==n.viewports.length?null:n.viewports[o],s=i?i.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(ae.replace({widget:new xu(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!i)break;r=i.to+1}return ae.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Ui).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,o=this.view.state.facet(y5).map((i,s)=>{let a=typeof i=="function";return a&&(r=!0),a?i(this.view):i});for(o.length&&(this.dynamicDecorationMap[e++]=r,n.push(Ae.join(o))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(v5))try{if(c(this.view,e.range,e))return!0}catch(d){Ct(this.view.state,d,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),o;if(!r)return;!n.empty&&(o=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,o.left),top:Math.min(r.top,o.top),right:Math.max(r.right,o.right),bottom:Math.max(r.bottom,o.bottom)});let i=Tf(this.view),s={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;ZR(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Oe.LTR)}}function wM(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function S5(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=Gb(n.focusNode,n.focusOffset),o=Yb(n.focusNode,n.focusOffset),i=r||o;if(o&&r&&o.node!=r.node){let a=Ie.get(o.node);if(!a||a instanceof Zt&&a.text!=o.node.nodeValue)i=o;else if(t.docView.lastCompositionAfterCursor){let l=Ie.get(r.node);!l||l instanceof Zt&&l.text!=r.node.nodeValue||(i=o)}}if(t.docView.lastCompositionAfterCursor=i!=r,!i)return null;let s=e-i.offset;return{from:s,to:s+i.node.nodeValue.length,node:i.node}}function yM(t,e,n){let r=S5(t,n);if(!r)return null;let{node:o,from:i,to:s}=r,a=o.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc,c=new Vt(l.mapPos(i),l.mapPos(s),i,s),d=[];for(let h=o.parentNode;;h=h.parentNode){let f=Ie.get(h);if(f instanceof Un)d.push({node:h,deco:f.mark});else{if(f instanceof Ue||h.nodeName=="DIV"&&h.parentNode==t.contentDOM)return{range:c,text:o,marks:d,line:h};if(h!=t.contentDOM)d.push({node:h,deco:new gs({inclusive:!0,attributes:lM(h),tagName:h.tagName.toLowerCase()})});else return null}}}function CM(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let $M=class{constructor(){this.changes=[]}compareRange(e,n){Sa(e,n,this.changes)}comparePoint(e,n){Sa(e,n,this.changes)}boundChange(e){Sa(e,e,this.changes)}};function SM(t,e,n){let r=new $M;return Ae.compare(t,e,n,r),r.changes}function AM(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function kM(t,e){let n=!1;return e&&t.iterChangedRanges((r,o)=>{r<e.to&&o>e.from&&(n=!0)}),n}function TM(t,e,n=1){let r=t.charCategorizer(e),o=t.doc.lineAt(e),i=e-o.from;if(o.length==0)return H.cursor(e);i==0?n=1:i==o.length&&(n=-1);let s=i,a=i;n<0?s=st(o.text,i,!1):a=st(o.text,i);let l=r(o.text.slice(s,a));for(;s>0;){let c=st(o.text,s,!1);if(r(o.text.slice(c,s))!=l)break;s=c}for(;a<o.length;){let c=st(o.text,a);if(r(o.text.slice(a,c))!=l)break;a=c}return H.range(s+o.from,a+o.from)}function RM(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function MM(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Gc(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function A1(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function k1(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Su(t,e,n){let r,o,i,s,a=!1,l,c,d,h;for(let p=t.firstChild;p;p=p.nextSibling){let b=_o(p);for(let v=0;v<b.length;v++){let x=b[v];o&&Gc(o,x)&&(x=A1(k1(x,o.bottom),o.top));let y=RM(e,x),$=MM(n,x);if(y==0&&$==0)return p.nodeType==3?T1(p,e,n):Su(p,e,n);(!r||s>$||s==$&&i>y)&&(r=p,o=x,i=y,s=$,a=y?e<x.left?v>0:v<b.length-1:!0),y==0?n>x.bottom&&(!d||d.bottom<x.bottom)?(l=p,d=x):n<x.top&&(!h||h.top>x.top)&&(c=p,h=x):d&&Gc(d,x)?d=k1(d,x.bottom):h&&Gc(h,x)&&(h=A1(h,x.top))}}if(d&&d.bottom>=n?(r=l,o=d):h&&h.top<=n&&(r=c,o=h),!r)return{node:t,offset:0};let f=Math.max(o.left,Math.min(o.right,e));if(r.nodeType==3)return T1(r,f,n);if(a&&r.contentEditable!="false")return Su(r,f,n);let m=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(o.left+o.right)/2?1:0);return{node:t,offset:m}}function T1(t,e,n){let r=t.nodeValue.length,o=-1,i=1e9,s=0;for(let a=0;a<r;a++){let l=Wr(t,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(d.top==d.bottom)continue;s||(s=e-d.left);let h=(d.top>n?d.top-n:n-d.bottom)-1;if(d.left-1<=e&&d.right+1>=e&&h<i){let f=e>=(d.left+d.right)/2,m=f;if((te.chrome||te.gecko)&&Wr(t,a).getBoundingClientRect().left==d.right&&(m=!f),h<=0)return{node:t,offset:a+(m?1:0)};o=a+(m?1:0),i=h}}}return{node:t,offset:o>-1?o:s>0?t.nodeValue.length:0}}function A5(t,e,n,r=-1){var o,i;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:d,y:h}=e,f=h-a;if(f<0)return 0;if(f>c)return t.state.doc.length;for(let S=t.viewState.heightOracle.textHeight/2,A=!1;l=t.elementAtHeight(f),l.type!=pt.Text;)for(;f=r>0?l.bottom+S:l.top-S,!(f>=0&&f<=c);){if(A)return n?null:0;A=!0,r=-r}h=a+f;let m=l.from;if(m<t.viewport.from)return t.viewport.from==0?0:n?null:R1(t,s,l,d,h);if(m>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:R1(t,s,l,d,h);let p=t.dom.ownerDocument,b=t.root.elementFromPoint?t.root:p,v=b.elementFromPoint(d,h);v&&!t.contentDOM.contains(v)&&(v=null),v||(d=Math.max(s.left+1,Math.min(s.right-1,d)),v=b.elementFromPoint(d,h),v&&!t.contentDOM.contains(v)&&(v=null));let x,y=-1;if(v&&((o=t.docView.nearest(v))===null||o===void 0?void 0:o.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(d,h);S&&({offsetNode:x,offset:y}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(d,h);S&&({startContainer:x,startOffset:y}=S,(!t.contentDOM.contains(x)||te.safari&&EM(x,y,d)||te.chrome&&IM(x,y,d))&&(x=void 0))}x&&(y=Math.min($n(x),y))}if(!x||!t.docView.dom.contains(x)){let S=Ue.find(t.docView,m);if(!S)return f>l.top+l.height/2?l.to:l.from;({node:x,offset:y}=Su(S.dom,d,h))}let $=t.docView.nearest(x);if(!$)return null;if($.isWidget&&((i=$.dom)===null||i===void 0?void 0:i.nodeType)==1){let S=$.dom.getBoundingClientRect();return e.y<S.top||e.y<=S.bottom&&e.x<=(S.left+S.right)/2?$.posAtStart:$.posAtEnd}else return $.localPosFromDOM(x,y)+$.posAtStart}function R1(t,e,n,r,o){let i=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((o-n.top-(t.defaultLineHeight-a)*.5)/a);i+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+du(s,i,t.state.tabSize)}function EM(t,e,n){let r,o=t;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(;;){let i=o.nextSibling;if(i){if(i.nodeName=="BR")break;return!1}else{let s=o.parentNode;if(!s||s.nodeName=="DIV")break;o=s}}return Wr(t,r-1,r).getBoundingClientRect().right>n}function IM(t,e,n){if(e!=0)return!1;for(let o=t;;){let i=o.parentNode;if(!i||i.nodeType!=1||i.firstChild!=o)return!1;if(i.classList.contains("cm-line"))break;o=i}let r=t.nodeType==1?t.getBoundingClientRect():Wr(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Au(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let o;for(let i of r.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!o||i.type==pt.Text&&(o.type!=i.type||(n<0?i.from<e:i.to>e)))&&(o=i)}}return o||r}return r}function jM(t,e,n,r){let o=Au(t,e.head,e.assoc||-1),i=!r||o.type!=pt.Text||!(t.lineWrapping||o.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head);if(i){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(o.from),l=t.posAtCoords({x:n==(a==Oe.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(l!=null)return H.cursor(l,n?-1:1)}return H.cursor(n?o.to:o.from,n?-1:1)}function M1(t,e,n,r){let o=t.state.doc.lineAt(e.head),i=t.bidiSpans(o),s=t.textDirectionAt(o.from);for(let a=e,l=null;;){let c=bM(o,i,s,a,n),d=c5;if(!c){if(o.number==(n?t.state.doc.lines:1))return a;d=`
|
|
60
|
+
`,o=t.state.doc.line(o.number+(n?1:-1)),i=t.bidiSpans(o),c=t.visualLineSide(o,!n)}if(l){if(!l(d))return a}else{if(!r)return c;l=r(d)}a=c}}function DM(t,e,n){let r=t.state.charCategorizer(e),o=r(n);return i=>{let s=r(i);return o==Le.Space&&(o=s),o==s}}function OM(t,e,n,r){let o=e.head,i=n?1:-1;if(o==(n?t.state.doc.length:0))return H.cursor(o,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(o,e.assoc||-1),d=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=i<0?c.top:c.bottom;else{let m=t.viewState.lineBlockAt(o);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(o-m.from))),a=(i<0?m.top:m.bottom)+d}let h=l.left+s,f=r??t.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let p=a+(f+m)*i,b=A5(t,{x:h,y:p},!1,i);if(p<l.top||p>l.bottom||(i<0?b<o:b>o)){let v=t.docView.coordsForChar(b),x=!v||p<v.top?-1:1;return H.cursor(b,x,void 0,s)}}}function Aa(t,e,n){for(;;){let r=0;for(let o of t)o.between(e-1,e+1,(i,s,a)=>{if(e>i&&e<s){let l=r||n||(e-i<s-e?-1:1);e=l<0?i:s,r=l}});if(!r)return e}}function Yc(t,e,n){let r=Aa(t.state.facet(kf).map(o=>o(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:H.cursor(r,r<n.from?1:-1)}const Si="";class LM{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet($e.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Si}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let o=e;;){this.findPointBefore(r,o);let i=this.text.length;this.readNode(o);let s=o.nextSibling;if(s==n)break;let a=Ie.get(o),l=Ie.get(s);(a&&l?a.breakAfter:(a?a.breakAfter:Qa(o))||Qa(s)&&(o.nodeName!="BR"||o.cmIgnore)&&this.text.length>i)&&this.lineBreak(),o=s}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,s=1,a;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=o.exec(n))&&(i=a.index,s=a[0].length),this.append(n.slice(r,i<0?n.length:i)),i<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=i+s}}readNode(e){if(e.cmIgnore)return;let n=Ie.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let o=r.iter();!o.next().done;)o.lineBreak?this.lineBreak():this.append(o.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(NM(e,r.node,r.offset)?n:0))}}function NM(t,e,n){for(;;){if(!e||n<$n(e))return!1;if(e==t)return!0;n=Pr(e)+1,e=e.parentNode}}class E1{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class BM{constructor(e,n,r,o){this.typeOver=o,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:i,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=i||s?[]:_M(e),l=new LM(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=zM(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=i&&i.node==a.focusNode&&i.offset==a.focusOffset||!fu(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!fu(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),d=e.viewport;if((te.ios||te.chrome)&&e.state.selection.main.empty&&l!=c&&(d.from>0||d.to<e.state.doc.length)){let h=Math.min(l,c),f=Math.max(l,c),m=d.from-h,p=d.to-f;(m==0||m==1||h==0)&&(p==0||p==-1||f==e.state.doc.length)&&(l=0,c=e.state.doc.length)}this.newSel=H.single(c,l)}}}function k5(t,e){let n,{newSel:r}=e,o=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=o.from,c=null;(i===8||te.android&&e.text.length<a-s)&&(l=o.to,c="end");let d=VM(t.state.doc.sliceString(s,a,Si),e.text,l-s,c);d&&(te.chrome&&i==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Si+Si&&d.toB--,n={from:s+d.from,to:s+d.toA,insert:ke.of(e.text.slice(d.from,d.toB).split(Si))})}else r&&(!t.hasFocus&&t.state.facet(Fn)||r.main.eq(o))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!o.empty&&r&&r.main.empty?n={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,o.to)}:(te.mac||te.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=H.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:ke.of([n.insert.toString().replace("."," ")])}):n&&n.from>=o.from&&n.to<=o.to&&(n.from!=o.from||n.to!=o.to)&&o.to-o.from-(n.to-n.from)<=4?n={from:o.from,to:o.to,insert:t.state.doc.slice(o.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,o.to))}:te.chrome&&n&&n.from==n.to&&n.from==o.head&&n.insert.toString()==`
|
|
61
|
+
`&&t.lineWrapping&&(r&&(r=H.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:ke.of([" "])}),n)return Rf(t,n,r,i);if(r&&!r.main.eq(o)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function Rf(t,e,n,r=-1){if(te.ios&&t.inputState.flushIOSKey(e))return!0;let o=t.state.selection.main;if(te.android&&(e.to==o.to&&(e.from==o.from||e.from==o.from-1&&t.state.sliceDoc(e.from,o.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ko(t.contentDOM,"Enter",13)||(e.from==o.from-1&&e.to==o.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>o.head)&&ko(t.contentDOM,"Backspace",8)||e.from==o.from&&e.to==o.to+1&&e.insert.length==0&&ko(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=FM(t,e,n));return t.state.facet(m5).some(l=>l(t,e.from,e.to,i,a))||t.dispatch(a()),!0}function FM(t,e,n){let r,o=t.state,i=o.selection.main;if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=i.from<e.from?o.sliceDoc(i.from,e.from):"",l=i.to>e.to?o.sliceDoc(e.to,i.to):"";r=o.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=o.changes(e),l=n&&n.main.to<=a.newLength?n.main:void 0;if(o.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=i.to&&e.to>=i.to-10){let c=t.state.sliceDoc(e.from,e.to),d,h=n&&S5(t,n.main.head);if(h){let p=e.insert.length-(e.to-e.from);d={from:h.from,to:h.to-p}}else d=t.state.doc.lineAt(i.head);let f=i.to-e.to,m=i.to-i.from;r=o.changeByRange(p=>{if(p.from==i.from&&p.to==i.to)return{changes:a,range:l||p.map(a)};let b=p.to-f,v=b-c.length;if(p.to-p.from!=m||t.state.sliceDoc(v,b)!=c||p.to>=d.from&&p.from<=d.to)return{range:p};let x=o.changes({from:v,to:b,insert:e.insert}),y=p.to-i.to;return{changes:x,range:l?H.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(x)}})}else r={changes:a,selection:l&&o.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),o.update(r,{userEvent:s,scrollIntoView:!0})}function VM(t,e,n,r){let o=Math.min(t.length,e.length),i=0;for(;i<o&&t.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==o&&t.length==e.length)return null;let s=t.length,a=e.length;for(;s>0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s<i&&t.length<e.length){let l=n<=i&&n>=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a<i){let l=n<=i&&n>=a?i-n:0;i-=l,s=i+(s-a),a=i}return{from:i,toA:s,toB:a}}function _M(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new E1(n,r)),(o!=n||i!=r)&&e.push(new E1(o,i))),e}function zM(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?H.single(n+e,r+e):null}class HM{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,te.safari&&e.contentDOM.addEventListener("input",()=>null),te.gecko&&oE(e.contentDOM.ownerDocument)}handleEvent(e){!XM(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let o of r.observers)o(this.view,n);for(let o of r.handlers){if(n.defaultPrevented)break;if(o(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=PM(e),r=this.handlers,o=this.view.contentDOM;for(let i in n)if(i!="scroll"){let s=!n[i].handlers.length,a=r[i];a&&s!=!a.handlers.length&&(o.removeEventListener(i,this.handleEvent),a=null),a||o.addEventListener(i,this.handleEvent,{passive:s})}for(let i in r)i!="scroll"&&!n[i]&&o.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&R5.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),te.android&&te.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return te.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=T5.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||WM.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ko(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:te.safari&&!te.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function I1(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(o){Ct(n.state,o)}}}function PM(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let o=r.spec,i=o&&o.plugin.domEventHandlers,s=o&&o.plugin.domEventObservers;if(i)for(let a in i){let l=i[a];l&&n(a).handlers.push(I1(r.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(I1(r.value,l))}}for(let r in Jt)n(r).handlers.push(Jt[r]);for(let r in _t)n(r).observers.push(_t[r]);return e}const T5=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],WM="dthko",R5=[16,17,18,20,91,92,224,225],ea=6;function ta(t){return Math.max(0,t)*.7+8}function qM(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class UM{constructor(e,n,r,o){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=JR(e.contentDOM),this.atoms=e.state.facet(kf).map(s=>s(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet($e.allowMultipleSelections)&&KM(e,n),this.dragging=YM(e,n)&&I5(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&qM(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,o=0,i=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:o,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Tf(this.view);e.clientX-l.left<=o+ea?n=-ta(o-e.clientX):e.clientX+l.right>=s-ea&&(n=ta(e.clientX-s)),e.clientY-l.top<=i+ea?r=-ta(i-e.clientY):e.clientY+l.bottom>=a-ea&&(r=ta(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;r<e.ranges.length;r++){let o=e.ranges[r],i=null;if(o.empty){let s=Aa(this.atoms,o.from,0);s!=o.from&&(i=H.cursor(s,-1))}else{let s=Aa(this.atoms,o.from,-1),a=Aa(this.atoms,o.to,1);(s!=o.from||a!=o.to)&&(i=H.range(o.from==o.anchor?s:a,o.from==o.head?s:a))}i&&(n||(n=e.ranges.slice()),n[r]=i)}return n?H.create(n,e.mainIndex):e}select(e){let{view:n}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function KM(t,e){let n=t.state.facet(d5);return n.length?n[0](e):te.mac?e.metaKey:e.ctrlKey}function GM(t,e){let n=t.state.facet(u5);return n.length?n[0](e):te.mac?!e.altKey:!e.ctrlKey}function YM(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=qi(t.root);if(!r||r.rangeCount==0)return!0;let o=r.getRangeAt(0).getClientRects();for(let i=0;i<o.length;i++){let s=o[i];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function XM(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Ie.get(n))&&r.ignoreEvent(e))return!1;return!0}const Jt=Object.create(null),_t=Object.create(null),M5=te.ie&&te.ie_version<15||te.ios&&te.webkit_version<604;function QM(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),E5(t,n.value)},50)}function Gl(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function E5(t,e){e=Gl(t.state,$f,e);let{state:n}=t,r,o=1,i=n.toText(e),s=i.lines==n.selection.ranges.length;if(ku!=null&&n.selection.ranges.every(l=>l.empty)&&ku==i.toString()){let l=-1;r=n.changeByRange(c=>{let d=n.doc.lineAt(c.from);if(d.from==l)return{range:c};l=d.from;let h=n.toText((s?i.line(o++).text:e)+n.lineBreak);return{changes:{from:d.from,insert:h},range:H.cursor(c.from+h.length)}})}else s?r=n.changeByRange(l=>{let c=i.line(o++);return{changes:{from:l.from,to:l.to,insert:c.text},range:H.cursor(l.from+c.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}_t.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Jt.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);_t.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};_t.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Jt.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(h5))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=eE(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new UM(t,e,n,r)),r&&t.observer.ignore(()=>{qb(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let o=t.inputState.mouseSelection;if(o)return o.start(e),o.dragging===!1}return!1};function j1(t,e,n,r){if(r==1)return H.cursor(e,n);if(r==2)return TM(t.state,e,n);{let o=Ue.find(t.docView,e),i=t.state.doc.lineAt(o?o.posAtEnd:e),s=o?o.posAtStart:i.from,a=o?o.posAtEnd:i.to;return a<t.state.doc.length&&a==i.to&&a++,H.range(s,a)}}let D1=(t,e,n)=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function ZM(t,e,n,r){let o=Ue.find(t.docView,e);if(!o)return 1;let i=e-o.posAtStart;if(i==0)return 1;if(i==o.length)return-1;let s=o.coordsAt(i,-1);if(s&&D1(n,r,s))return-1;let a=o.coordsAt(i,1);return a&&D1(n,r,a)?1:s&&s.bottom>=r?-1:1}function O1(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:ZM(t,n,e.clientX,e.clientY)}}const JM=te.ie&&te.ie_version<=11;let L1=null,N1=0,B1=0;function I5(t){if(!JM)return t.detail;let e=L1,n=B1;return L1=t,B1=Date.now(),N1=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(N1+1)%3:1}function eE(t,e){let n=O1(t,e),r=I5(e),o=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),o=o.map(i.changes))},get(i,s,a){let l=O1(t,i),c,d=j1(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let h=j1(t,n.pos,n.bias,r),f=Math.min(h.from,d.from),m=Math.max(h.to,d.to);d=f<d.from?H.range(f,m):H.range(m,f)}return s?o.replaceRange(o.main.extend(d.from,d.to)):a&&r==1&&o.ranges.length>1&&(c=tE(o,l.pos))?c:a?o.addRange(d):H.create([d])}}}function tE(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:o}=t.ranges[n];if(r<=e&&o>=e)return H.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Jt.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let o=t.docView.nearest(e.target);if(o&&o.isWidget){let i=o.posAtStart,s=i+o.length;(i>=n.to||s<=n.from)&&(n=H.range(i,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Gl(t.state,Sf,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Jt.dragend=t=>(t.inputState.draggedContent=null,!1);function F1(t,e,n,r){if(n=Gl(t.state,$f,n),!n)return;let o=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,s=r&&i&&GM(t,e)?{from:i.from,to:i.to}:null,a={from:o,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(o,-1),head:l.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Jt.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),o=0,i=()=>{++o==n.length&&F1(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=i,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),i()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return F1(t,e,r,!0),!0}return!1};Jt.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=M5?null:e.clipboardData;return n?(E5(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(QM(t),!1)};function nE(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function rE(t){let e=[],n=[],r=!1;for(let o of t.selection.ranges)o.empty||(e.push(t.sliceDoc(o.from,o.to)),n.push(o));if(!e.length){let o=-1;for(let{from:i}of t.selection.ranges){let s=t.doc.lineAt(i);s.number>o&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),o=s.number}r=!0}return{text:Gl(t,Sf,e.join(t.lineBreak)),ranges:n,linewise:r}}let ku=null;Jt.copy=Jt.cut=(t,e)=>{let{text:n,ranges:r,linewise:o}=rE(t.state);if(!n&&!o)return!1;ku=o?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=M5?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(nE(t,n),!1)};const j5=Mn.define();function D5(t,e){let n=[];for(let r of t.facet(g5)){let o=r(t,e);o&&n.push(o)}return n.length?t.update({effects:n,annotations:j5.of(!0)}):null}function O5(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=D5(t.state,e);n?t.dispatch(n):t.update([])}},10)}_t.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),O5(t)};_t.blur=t=>{t.observer.clearSelectionRange(),O5(t)};_t.compositionstart=_t.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};_t.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,te.chrome&&te.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};_t.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Jt.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(i&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return Rf(t,{from:l,to:c,insert:t.state.toText(i)},null),!0}}let o;if(te.chrome&&te.android&&(o=T5.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(o.key,o.keyCode),o.key=="Backspace"||o.key=="Delete")){let i=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return te.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),te.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>_t.compositionend(t,e),20),!1};const V1=new Set;function oE(t){V1.has(t)||(V1.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const _1=["pre-wrap","normal","pre-line","break-spaces"];let Po=!1;function z1(){Po=!1}class iE{constructor(e){this.lineWrapping=e,this.doc=ke.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let o=e[r];o<0?r++:this.heightSamples[Math.floor(o*10)]||(n=!0,this.heightSamples[Math.floor(o*10)]=!0)}return n}refresh(e,n,r,o,i,s){let a=_1.indexOf(e)>-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=o,this.lineLength=i,l){this.heightSamples={};for(let c=0;c<s.length;c++){let d=s[c];d<0?c++:this.heightSamples[Math.floor(d*10)]=!0}}return l}}class sE{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class hn{constructor(e,n,r,o,i){this.from=e,this.length=n,this.top=r,this.height=o,this._content=i}get type(){return typeof this._content=="number"?pt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof gr?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new hn(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var De=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(De||(De={}));const ka=.001;class bt{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ka&&(Po=!0),this.height=e)}replace(e,n,r){return bt.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,o){let i=this,s=r.doc;for(let a=o.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:d,toB:h}=o[a],f=i.lineAt(l,De.ByPosNoHeight,r.setDoc(n),0,0),m=f.to>=c?f:i.lineAt(c,De.ByPosNoHeight,r,0,0);for(h+=m.to-c,c=m.to;a>0&&f.from<=o[a-1].toA;)l=o[a-1].fromA,d=o[a-1].fromB,a--,l<f.from&&(f=i.lineAt(l,De.ByPosNoHeight,r,0,0));d+=f.from-l,l=f.from;let p=Mf.build(r.setDoc(s),e,d,h);i=el(i,i.replace(l,c,p))}return i.updateHeight(r,0)}static empty(){return new jt(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,o=0,i=0;for(;;)if(n==r)if(o>i*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,o-=a.size}else if(i>o*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,i-=a.size}else break;else if(o<i){let a=e[n++];a&&(o+=a.size)}else{let a=e[--r];a&&(i+=a.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,r++),new aE(bt.of(e.slice(0,n)),s,bt.of(e.slice(r)))}}function el(t,e){return t==e?t:(t.constructor!=e.constructor&&(Po=!0),e)}bt.prototype.size=1;class L5 extends bt{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,o){return new hn(o,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,o,i){return this.blockAt(0,r,o,i)}forEachLine(e,n,r,o,i,s){e<=i+this.length&&n>=i&&s(this.blockAt(0,r,o,i))}updateHeight(e,n=0,r=!1,o){return o&&o.from<=n&&o.more&&this.setHeight(o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class jt extends L5{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,o){return new hn(o,this.length,r,this.height,this.breaks)}replace(e,n,r){let o=r[0];return r.length==1&&(o instanceof jt||o instanceof rt&&o.flags&4)&&Math.abs(this.length-o.length)<10?(o instanceof rt?o=new jt(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):bt.of(r)}updateHeight(e,n=0,r=!1,o){return o&&o.from<=n&&o.more?this.setHeight(o.heights[o.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class rt extends bt{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,o=e.doc.lineAt(n+this.length).number,i=o-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*i);s=l/i,this.length>i+1&&(a=(this.height-l)/(this.length-i-1))}else s=this.height/i;return{firstLine:r,lastLine:o,perLine:s,perChar:a}}blockAt(e,n,r,o){let{firstLine:i,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,o);if(n.lineWrapping){let c=o+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),d=n.doc.lineAt(c),h=a+d.length*l,f=Math.max(r,e-h/2);return new hn(d.from,d.length,f,h,0)}else{let c=Math.max(0,Math.min(s-i,Math.floor((e-r)/a))),{from:d,length:h}=n.doc.line(i+c);return new hn(d,h,r+a*c,a,0)}}lineAt(e,n,r,o,i){if(n==De.ByHeight)return this.blockAt(e,r,o,i);if(n==De.ByPosNoHeight){let{from:m,to:p}=r.doc.lineAt(e);return new hn(m,p-m,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(r,i),c=r.doc.lineAt(e),d=a+c.length*l,h=c.number-s,f=o+a*h+l*(c.from-i-h);return new hn(c.from,c.length,Math.max(o,Math.min(f,o+this.height-d)),d,0)}forEachLine(e,n,r,o,i,s){e=Math.max(e,i),n=Math.min(n,i+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,i);for(let d=e,h=o;d<=n;){let f=r.doc.lineAt(d);if(d==e){let p=f.number-a;h+=l*p+c*(e-i-p)}let m=l+c*f.length;s(new hn(f.from,f.length,h,m,0)),h+=m,d=f.to+1}}replace(e,n,r){let o=this.length-n;if(o>0){let i=r[r.length-1];i instanceof rt?r[r.length-1]=new rt(i.length+o):r.push(null,new rt(o-1))}if(e>0){let i=r[0];i instanceof rt?r[0]=new rt(e+i.length):r.unshift(new rt(e-1),null)}return bt.of(r)}decomposeLeft(e,n){n.push(new rt(e-1),null)}decomposeRight(e,n){n.push(null,new rt(this.length-e-1))}updateHeight(e,n=0,r=!1,o){let i=n+this.length;if(o&&o.from<=n+this.length&&o.more){let s=[],a=Math.max(n,o.from),l=-1;for(o.from>n&&s.push(new rt(o.from-n-1).updateHeight(e,n));a<=i&&o.more;){let d=e.doc.lineAt(a).length;s.length&&s.push(null);let h=o.heights[o.index++];l==-1?l=h:Math.abs(h-l)>=ka&&(l=-2);let f=new jt(d,h);f.outdated=!1,s.push(f),a+=d+1}a<=i&&s.push(null,new rt(i-a).updateHeight(e,a));let c=bt.of(s);return(l<0||Math.abs(c.height-this.height)>=ka||Math.abs(l-this.heightMetrics(e,n).perLine)>=ka)&&(Po=!0),el(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class aE extends bt{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,o){let i=r+this.left.height;return e<i?this.left.blockAt(e,n,r,o):this.right.blockAt(e,n,i,o+this.left.length+this.break)}lineAt(e,n,r,o,i){let s=o+this.left.height,a=i+this.left.length+this.break,l=n==De.ByHeight?e<s:e<a,c=l?this.left.lineAt(e,n,r,o,i):this.right.lineAt(e,n,r,s,a);if(this.break||(l?c.to<a:c.from>a))return c;let d=n==De.ByPosNoHeight?De.ByPosNoHeight:De.ByPos;return l?c.join(this.right.lineAt(a,d,r,s,a)):this.left.lineAt(a,d,r,o,i).join(c)}forEachLine(e,n,r,o,i,s){let a=o+this.left.height,l=i+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,r,o,i,s),n>=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,De.ByPos,r,o,i);e<c.from&&this.left.forEachLine(e,c.from-1,r,o,i,s),c.to>=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(e,n,r){let o=this.left.length+this.break;if(n<o)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-o,n-o,r));let i=[];e>0&&this.decomposeLeft(e,i);let s=i.length;for(let a of r)i.push(a);if(e>0&&H1(i,s-1),n<this.length){let a=i.length;this.decomposeRight(n,i),H1(i,a)}return bt.of(i)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,o=r+this.break;if(e>=o)return this.right.decomposeRight(e-o,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<o&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?bt.of(this.break?[e,null,n]:[e,n]):(this.left=el(this.left,e),this.right=el(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,o){let{left:i,right:s}=this,a=n+i.length+this.break,l=null;return o&&o.from<=n+i.length&&o.more?l=i=i.updateHeight(e,n,r,o):i.updateHeight(e,n,r),o&&o.from<=a+s.length&&o.more?l=s=s.updateHeight(e,a,r,o):s.updateHeight(e,a,r),l?this.balanced(i,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function H1(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof rt&&(r=t[e+1])instanceof rt&&t.splice(e-1,3,new rt(n.length+1+r.length))}const lE=5;class Mf{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),o=this.nodes[this.nodes.length-1];o instanceof jt?o.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new jt(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let o=r.widget?r.widget.estimatedHeight:0,i=r.widget?r.widget.lineBreaks:0;o<0&&(o=this.oracle.lineHeight);let s=n-e;r.block?this.addBlock(new L5(s,o,r)):(s||i||o>=lE)&&this.addLineDeco(o,i,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new jt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new rt(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof jt)return e;let n=new jt(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let o=this.ensureLine();o.length+=r,o.collapsed+=r,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof jt)&&!this.isCovered?this.nodes.push(new jt(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let o of this.nodes)o instanceof jt&&o.updateHeight(this.oracle,r),r+=o?o.length:1;return this.nodes}static build(e,n,r,o){let i=new Mf(r,e);return Ae.spans(n,r,o,i,0),i.finish(r)}}function cE(t,e,n){let r=new dE;return Ae.compare(t,e,n,r,0),r.changes}class dE{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,o){(e<n||r&&r.heightRelevant||o&&o.heightRelevant)&&Sa(e,n,this.changes,5)}}function uE(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,o=r.defaultView||window,i=Math.max(0,n.left),s=Math.min(o.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(o.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let d=c,h=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&h.overflow!="visible"){let f=d.getBoundingClientRect();i=Math.max(i,f.left),s=Math.min(s,f.right),a=Math.max(a,f.top),l=Math.min(c==t.parentNode?o.innerHeight:l,f.bottom)}c=h.position=="absolute"||h.position=="fixed"?d.offsetParent:d.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:i-n.left,right:Math.max(i,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function hE(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function fE(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Xc{constructor(e,n,r,o){this.from=e,this.to=n,this.size=r,this.displaySize=o}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],i=n[r];if(o.from!=i.from||o.to!=i.to||o.size!=i.size)return!1}return!0}draw(e,n){return ae.replace({widget:new mE(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class mE extends Qn{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class P1{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=W1,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Oe.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(Af).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new iE(n),this.stateDeco=e.facet(Ui).filter(r=>typeof r!="function"),this.heightMap=bt.empty().applyChanges(this.stateDeco,ke.empty,this.heightOracle.setDoc(e.doc),[new Vt(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ae.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let o=r?n.head:n.anchor;if(!e.some(({from:i,to:s})=>o>=i&&o<=s)){let{from:i,to:s}=this.lineBlockAt(o);e.push(new na(i,s))}}return this.viewports=e.sort((r,o)=>r.from-o.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?W1:new Ef(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ai(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Ui).filter(d=>typeof d!="function");let o=e.changedRanges,i=Vt.extendWithRanges(o,cE(r,this.stateDeco,e?e.changes:Ye.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);z1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=s||Po)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(b5)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),o=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Oe.RTL:Oe.LTR;let s=this.heightOracle.mustRefreshForWrapping(i),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,d=0;if(a.width&&a.height){let{scaleX:S,scaleY:A}=Wb(n,a);(S>.005&&Math.abs(this.scaleX-S)>.005||A>.005&&Math.abs(this.scaleY-A)>.005)&&(this.scaleX=S,this.scaleY=A,c|=16,s=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=Kb(e.scrollDOM);let p=(this.printing?fE:uE)(n,this.paddingTop),b=p.top-this.pixelViewport.top,v=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(l=!0)),!this.inView&&!this.scrollTarget&&!hE(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(S)&&(s=!0),s||o.lineWrapping&&Math.abs(y-this.contentDOMWidth)>o.charWidth){let{lineHeight:A,charWidth:k,textHeight:T}=e.docView.measureTextSize();s=A>0&&o.refresh(i,A,k,T,Math.max(5,y/k),S),s&&(e.docView.minWidth=0,c|=16)}b>0&&v>0?d=Math.max(b,v):b<0&&v<0&&(d=Math.min(b,v)),z1();for(let A of this.viewports){let k=A.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(A);this.heightMap=(s?bt.empty().applyChanges(this.stateDeco,ke.empty,this.heightOracle,[new Vt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,s,new sE(A.from,k))}Po&&(c|=2)}let $=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return $&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),c|=this.updateForViewport()),(c&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,i=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new na(o.lineAt(s-r*1e3,De.ByHeight,i,0,0).from,o.lineAt(a+(1-r)*1e3,De.ByHeight,i,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=o.lineAt(c,De.ByPos,i,0,0),f;n.y=="center"?f=(h.top+h.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&c<l.from?f=h.top:f=h.bottom-d,l=new na(o.lineAt(f-1e3/2,De.ByHeight,i,0,0).from,o.lineAt(f+d+1e3/2,De.ByHeight,i,0,0).to)}}return l}mapViewport(e,n){let r=n.mapPos(e.from,-1),o=n.mapPos(e.to,1);return new na(this.heightMap.lineAt(r,De.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(o,De.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:o}=this.heightMap.lineAt(e,De.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,De.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(e==0||o<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||i>=a+Math.max(10,Math.min(r,250)))&&o>s-2*1e3&&i<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let o of e)n.touchesRange(o.from,o.to)||r.push(new Xc(n.mapPos(o.from),n.mapPos(o.to),o.size,o.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,o=r?1e4:2e3,i=o>>1,s=o<<1;if(this.defaultTextDirection!=Oe.LTR&&!r)return[];let a=[],l=(d,h,f,m)=>{if(h-d<i)return;let p=this.state.selection.main,b=[p.from];p.empty||b.push(p.to);for(let x of b)if(x>d&&x<h){l(d,x-10,f,m),l(x+10,h,f,m);return}let v=pE(e,x=>x.from>=f.from&&x.to<=f.to&&Math.abs(x.from-d)<i&&Math.abs(x.to-h)<i&&!b.some(y=>x.from<y&&x.to>y));if(!v){if(h<f.to&&n&&r&&n.visibleRanges.some($=>$.from<=h&&$.to>=h)){let $=n.moveToLineBoundary(H.cursor(h),!1,!0).head;$>d&&(h=$)}let x=this.gapSize(f,d,h,m),y=r||x<2e6?x:2e6;v=new Xc(d,h,x,y)}a.push(v)},c=d=>{if(d.length<s||d.type!=pt.Text)return;let h=gE(d.from,d.to,this.stateDeco);if(h.total<s)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,m,p;if(r){let b=o/this.heightOracle.lineLength*this.heightOracle.lineHeight,v,x;if(f!=null){let y=oa(h,f),$=((this.visibleBottom-this.visibleTop)/2+b)/d.height;v=y-$,x=y+$}else v=(this.visibleTop-d.top-b)/d.height,x=(this.visibleBottom-d.top+b)/d.height;m=ra(h,v),p=ra(h,x)}else{let b=h.total*this.heightOracle.charWidth,v=o*this.heightOracle.charWidth,x=0;if(b>2e6)for(let k of e)k.from>=d.from&&k.from<d.to&&k.size!=k.displaySize&&k.from*this.heightOracle.charWidth+x<this.pixelViewport.left&&(x=k.size-k.displaySize);let y=this.pixelViewport.left+x,$=this.pixelViewport.right+x,S,A;if(f!=null){let k=oa(h,f),T=(($-y)/2+v)/b;S=k-T,A=k+T}else S=(y-v)/b,A=($+v)/b;m=ra(h,S),p=ra(h,A)}m>d.from&&l(d.from,m,d,h),p<d.to&&l(p,d.to,d,h)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(c):c(d);return a}gapSize(e,n,r,o){let i=oa(o,r)-oa(o,n);return this.heightOracle.lineWrapping?e.height*i:o.total*this.heightOracle.charWidth*i}updateLineGaps(e){Xc.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ae.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Ae.spans(n,this.viewport.from,this.viewport.to,{span(i,s){r.push({from:i,to:s})},point(){}},20);let o=0;if(r.length!=this.visibleRanges.length)o=12;else for(let i=0;i<r.length&&!(o&8);i++){let s=this.visibleRanges[i],a=r[i];(s.from!=a.from||s.to!=a.to)&&(o|=4,e&&e.mapPos(s.from,-1)==a.from&&e.mapPos(s.to,1)==a.to||(o|=8))}return this.visibleRanges=r,o}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Ai(this.heightMap.lineAt(e,De.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Ai(this.heightMap.lineAt(this.scaler.fromDOM(e),De.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Ai(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let na=class{constructor(e,n){this.from=e,this.to=n}};function gE(t,e,n){let r=[],o=t,i=0;return Ae.spans(n,t,e,{span(){},point(s,a){s>o&&(r.push({from:o,to:s}),i+=s-o),o=a}},20),o<e&&(r.push({from:o,to:e}),i+=e-o),{total:i,ranges:r}}function ra({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let o=0;;o++){let{from:i,to:s}=e[o],a=s-i;if(r<=a)return i+r;r-=a}}function oa(t,e){let n=0;for(let{from:r,to:o}of t.ranges){if(e<=o){n+=e-r;break}n+=o-r}return n/t.total}function pE(t,e){for(let n of t)if(e(n))return n}const W1={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Ef{constructor(e,n,r){let o=0,i=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,De.ByPos,e,0,0).top,d=n.lineAt(l,De.ByPos,e,0,0).bottom;return o+=d-c,{from:a,to:l,top:c,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(n.height-o);for(let a of this.viewports)a.domTop=s+(a.top-i)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(e){for(let n=0,r=0,o=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.top)return o+(e-r)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);r=i.bottom,o=i.domBottom}}fromDOM(e){for(let n=0,r=0,o=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.domTop)return r+(e-o)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);r=i.bottom,o=i.domBottom}}eq(e){return e instanceof Ef?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Ai(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new hn(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(o=>Ai(o,e)):t._content)}const ia=ne.define({combine:t=>t.join(" ")}),Tu=ne.define({combine:t=>t.indexOf(!0)>-1}),Ru=fr.newName(),N5=fr.newName(),B5=fr.newName(),F5={"&light":"."+N5,"&dark":"."+B5};function Mu(t,e,n){return new fr(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,o=>{if(o=="&")return t;if(!n||!n[o])throw new RangeError(`Unsupported selector: ${o}`);return n[o]}):t+" "+r}})}const bE=Mu("."+Ru,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},F5),vE={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Qc=te.ie&&te.ie_version<=11;class xE{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new eM,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(te.ie&&te.ie_version<=11||te.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&te.android&&e.constructor.EDIT_CONTEXT!==!1&&!(te.chrome&&te.chrome_version<126)&&(this.editContext=new yE(e),e.state.facet(Fn)&&(e.contentDOM.editContext=this.editContext.editContext)),Qc&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,o=this.selectionRange;if(r.state.facet(Fn)?r.root.activeElement!=this.dom:!$a(this.dom,o))return;let i=o.anchorNode&&r.docView.nearest(o.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(te.ie&&te.ie_version<=11||te.android&&te.chrome)&&!r.state.selection.main.empty&&o.focusNode&&Ei(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=qi(e.root);if(!n)return!1;let r=te.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&wE(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let o=$a(this.dom,r);return o&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&nM(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),o&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,vE),Qc&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Qc&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let o=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&ko(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(o)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,o=!1;for(let i of e){let s=this.readMutation(i);s&&(s.typeOver&&(o=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:o}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),o=this.selectionChanged&&$a(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new BM(this.view,e,n,r);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,o=k5(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),o}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=q1(n,e.previousSibling||e.target.previousSibling,-1),o=q1(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:o?n.posBefore(o):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Fn)!=e.state.facet(Fn)&&(e.view.contentDOM.editContext=e.state.facet(Fn)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function q1(t,e,n){for(;e;){let r=Ie.get(e);if(r&&r.parent==t)return r;let o=e.parentNode;e=o!=t.dom?o:n>0?e.nextSibling:e.previousSibling}return null}function U1(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return Ei(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function wE(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return U1(t,o)}let n=null;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?U1(t,n):null}class yE{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let o=e.state.selection.main,{anchor:i,head:s}=o,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c={from:a,to:l,insert:ke.of(r.text.split(`
|
|
62
|
+
`))};if(c.from==this.from&&i<this.from?c.from=i:c.to==this.to&&i>this.to&&(c.to=i),c.from==c.to&&!c.insert.length){let d=H.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));d.main.eq(o)||e.dispatch({selection:d,userEvent:"select"});return}if((te.mac||te.android)&&c.from==s-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:a,to:l,insert:ke.of([r.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let d=this.to-this.from+(c.to-c.from+c.insert.length);Rf(e,c,H.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=r=>{let o=[],i=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s<a;s++){let l=e.coordsForChar(s);i=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||i||new DOMRect,o.push(i)}n.updateCharacterBounds(r.rangeStart,o)},this.handlers.textformatupdate=r=>{let o=[];for(let i of r.getTextFormats()){let s=i.underlineStyle,a=i.underlineThickness;if(s!="None"&&a!="None"){let l=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);if(l<c){let d=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;o.push(ae.mark({attributes:{style:d}}).range(l,c))}}}e.dispatch({effects:x5.of(ae.set(o))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let o=qi(r.root);o&&o.rangeCount&&this.editContext.updateSelectionBounds(o.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,o=this.pendingContextChange;return e.changes.iterChanges((i,s,a,l,c)=>{if(r)return;let d=c.length-(s-i);if(o&&s>=o.to)if(o.from==i&&o.to==s&&o.insert.eq(c)){o=this.pendingContextChange=null,n+=d,this.to+=d;return}else o=null,this.revertPending(e.state);if(i+=n,s+=n,s<=this.from)this.from+=d,this.to+=d;else if(i<this.to){if(i<this.from||s>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(s),c.toString()),this.to+=d}n+=d}),o&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(o=>!o.isUserEvent("input.type")&&o.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),o=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=o)&&this.editContext.updateSelection(r,o)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Q{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(o=>o.forEach(i=>r(i,this)))||(o=>this.update(o)),this.dispatch=this.dispatch.bind(this),this._root=e.root||tM(e.parent)||document,this.viewState=new P1(e.state||$e.create(e)),e.scrollTo&&e.scrollTo.is(Js)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(go).map(o=>new Kc(o));for(let o of this.plugins)o.update(this);this.observer=new xE(this),this.inputState=new HM(this),this.inputState.ensureHandlers(this.plugins),this.docView=new S1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Xe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,o,i=this.state;for(let f of e){if(f.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=f.state}if(this.destroyed){this.viewState.state=i;return}let s=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(j5))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=D5(i,s),l||(a=1));let c=this.observer.delayedAndroidKey,d=null;if(c?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(d=null)):this.observer.clear(),i.facet($e.phrases)!=this.state.facet($e.phrases))return this.setState(i);o=Ja.create(this,i,e),o.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:m}=f.state.selection;h=new To(m.empty?m:H.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of f.effects)m.is(Js)&&(h=m.value.clip(this.state))}this.viewState.update(o,h),this.bidiCache=tl.update(this.bidiCache,o.changes),o.empty||(this.updatePlugins(o),this.inputState.update(o)),n=this.docView.update(o),this.state.facet($i)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(o.startState.facet(ia)!=o.state.facet(ia)&&(this.viewState.mustMeasureContent=!0),(n||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!o.empty)for(let f of this.state.facet($u))try{f(o)}catch(m){Ct(this.state,m,"update listener")}(l||d)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),d&&!k5(this,d)&&c.force&&ko(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new P1(e),this.plugins=e.facet(go).map(r=>new Kc(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new S1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(go),r=e.state.facet(go);if(n!=r){let o=[];for(let i of r){let s=n.indexOf(i);if(s<0)o.push(new Kc(i));else{let a=this.plugins[s];a.mustUpdate=e,o.push(a)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o<this.plugins.length;o++)this.plugins[o].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Ct(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,o=r.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:s}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(Kb(r))i=-1,s=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(o);i=m.from,s=m.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let d=c.map(m=>{try{return m.read(this)}catch(p){return Ct(this.state,p),K1}}),h=Ja.create(this,this.state,[]),f=!1;h.flags|=l,n?n.flags|=l:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let m=0;m<c.length;m++)if(d[m]!=K1)try{let p=c[m];p.write&&p.write(d[m],this)}catch(p){Ct(this.state,p)}if(f&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let p=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-s;if(p>1||p<-1){o=o+p,r.scrollTop=o/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet($u))a(n)}get themeClasses(){return Ru+" "+(this.state.facet(Tu)?B5:N5)+" "+this.state.facet(ia)}updateAttrs(){let e=G1(this,w5,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Fn)?"true":"false",class:"cm-content",style:`${te.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),G1(this,Af,n);let r=this.observer.ignore(()=>{let o=vu(this.contentDOM,this.contentAttrs,n),i=vu(this.dom,this.editorAttrs,e);return o||i});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let o of r.effects)if(o.is(Q.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=o.value}}mountStyles(){this.styleModules=this.state.facet($i);let e=this.state.facet(Q.cspNonce);fr.mount(this.root,this.styleModules.concat(bE).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return Yc(this,e,M1(this,e,n,r))}moveByGroup(e,n){return Yc(this,e,M1(this,e,n,r=>DM(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),o=this.textDirectionAt(e.from),i=r[n?r.length-1:0];return H.cursor(i.side(n,o)+e.from,i.forward(!n,o)?1:-1)}moveToLineBoundary(e,n,r=!0){return jM(this,e,n,r)}moveVertically(e,n,r){return Yc(this,e,OM(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),A5(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let o=this.state.doc.lineAt(e),i=this.bidiSpans(o),s=i[sr.find(i,e-o.from,-1,n)];return ms(r,s.dir==Oe.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(p5)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>CE)return l5(e.length);let n=this.textDirectionAt(e.from),r;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||a5(i.isolates,r=$1(this,e))))return i.order;r||(r=$1(this,e));let o=pM(e.text,n,r);return this.bidiCache.push(new tl(e.from,e.to,n,r,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||te.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{qb(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Js.of(new To(typeof e=="number"?H.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Js.of(new To(H.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return We.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return We.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=fr.newName(),o=[ia.of(r),$i.of(Mu(`.${r}`,e))];return n&&n.dark&&o.push(Tu.of(!0)),o}static baseTheme(e){return to.lowest($i.of(Mu("."+Ru,e,F5)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),o=r&&Ie.get(r)||Ie.get(e);return((n=o?.rootView)===null||n===void 0?void 0:n.view)||null}}Q.styleModule=$i;Q.inputHandler=m5;Q.clipboardInputFilter=$f;Q.clipboardOutputFilter=Sf;Q.scrollHandler=v5;Q.focusChangeEffect=g5;Q.perLineTextDirection=p5;Q.exceptionSink=f5;Q.updateListener=$u;Q.editable=Fn;Q.mouseSelectionStyle=h5;Q.dragMovesSelection=u5;Q.clickAddsSelectionRange=d5;Q.decorations=Ui;Q.outerDecorations=y5;Q.atomicRanges=kf;Q.bidiIsolatedRanges=C5;Q.scrollMargins=$5;Q.darkTheme=Tu;Q.cspNonce=ne.define({combine:t=>t.length?t[0]:""});Q.contentAttributes=Af;Q.editorAttributes=w5;Q.lineWrapping=Q.contentAttributes.of({class:"cm-lineWrapping"});Q.announce=me.define();const CE=4096,K1={};class tl{constructor(e,n,r,o,i,s){this.from=e,this.to=n,this.dir=r,this.isolates=o,this.fresh=i,this.order=s}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let r=[],o=e.length?e[e.length-1].dir:Oe.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let s=e[i];s.dir==o&&!n.touchesRange(s.from,s.to)&&r.push(new tl(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function G1(t,e,n){for(let r=t.state.facet(e),o=r.length-1;o>=0;o--){let i=r[o],s=typeof i=="function"?i(t):i;s&&bu(s,n)}return n}const $E=te.mac?"mac":te.windows?"win":te.linux?"linux":"key";function SE(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let o,i,s,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))o=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return o&&(r="Alt-"+r),i&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function sa(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const AE=to.default(Q.domEventHandlers({keydown(t,e){return _5(V5(e.state),t,e,"editor")}})),Yl=ne.define({enables:AE}),Y1=new WeakMap;function V5(t){let e=t.facet(Yl),n=Y1.get(e);return n||Y1.set(e,n=RE(e.reduce((r,o)=>r.concat(o),[]))),n}function kE(t,e,n){return _5(V5(t.state),e,t,n)}let nr=null;const TE=4e3;function RE(t,e=$E){let n=Object.create(null),r=Object.create(null),o=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},i=(s,a,l,c,d)=>{var h,f;let m=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(x=>SE(x,e));for(let x=1;x<p.length;x++){let y=p.slice(0,x).join(" ");o(y,!0),m[y]||(m[y]={preventDefault:!0,stopPropagation:!1,run:[$=>{let S=nr={view:$,prefix:y,scope:s};return setTimeout(()=>{nr==S&&(nr=null)},TE),!0}]})}let b=p.join(" ");o(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((f=(h=m._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&v.run.push(l),c&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let d=n[c]||(n[c]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=s;for(let f in d)d[f].run.push(m=>h(m,Eu))}let l=s[e]||s.key;if(l)for(let c of a)i(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&i(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let Eu=null;function _5(t,e,n,r){Eu=e;let o=XR(e),i=xt(o,0),s=un(i)==o.length&&o!=" ",a="",l=!1,c=!1,d=!1;nr&&nr.view==n&&nr.scope==r&&(a=nr.prefix+" ",R5.indexOf(e.keyCode)<0&&(c=!0,nr=null));let h=new Set,f=v=>{if(v){for(let x of v.run)if(!h.has(x)&&(h.add(x),x(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),c=!0)}return!1},m=t[r],p,b;return m&&(f(m[a+sa(o,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(te.windows&&e.ctrlKey&&e.altKey)&&!(te.mac&&e.altKey&&!e.ctrlKey)&&(p=mr[e.keyCode])&&p!=o?(f(m[a+sa(p,e,!0)])||e.shiftKey&&(b=Wi[e.keyCode])!=o&&b!=p&&f(m[a+sa(b,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(m[a+sa(o,e,!0)])&&(l=!0),!l&&f(m._any)&&(l=!0)),c&&(l=!0),l&&d&&e.stopPropagation(),Eu=null,l}class bs{constructor(e,n,r,o,i){this.className=e,this.left=n,this.top=r,this.width=o,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let o=e.coordsAtPos(r.head,r.assoc||1);if(!o)return[];let i=z5(e);return[new bs(n,o.left-i.left,o.top-i.top,null,o.bottom-o.top)]}else return ME(e,n,r)}}function z5(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Oe.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function X1(t,e,n,r){let o=t.coordsAtPos(e,n*2);if(!o)return r;let i=t.dom.getBoundingClientRect(),s=(o.top+o.bottom)/2,a=t.posAtCoords({x:i.left+1,y:s}),l=t.posAtCoords({x:i.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function ME(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),o=Math.min(n.to,t.viewport.to),i=t.textDirection==Oe.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=z5(t),c=s.querySelector(".cm-line"),d=c&&window.getComputedStyle(c),h=a.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),f=a.right-(d?parseInt(d.paddingRight):0),m=Au(t,r,1),p=Au(t,o,-1),b=m.type==pt.Text?m:null,v=p.type==pt.Text?p:null;if(b&&(t.lineWrapping||m.widgetLineBreaks)&&(b=X1(t,r,1,b)),v&&(t.lineWrapping||p.widgetLineBreaks)&&(v=X1(t,o,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return y($(n.from,n.to,b));{let A=b?$(n.from,null,b):S(m,!1),k=v?$(null,n.to,v):S(p,!0),T=[];return(b||m).to<(v||p).from-(b&&v?1:0)||m.widgetLineBreaks>1&&A.bottom+t.defaultLineHeight/2<k.top?T.push(x(h,A.bottom,f,k.top)):A.bottom<k.top&&t.elementAtHeight((A.bottom+k.top)/2).type==pt.Text&&(A.bottom=k.top=(A.bottom+k.top)/2),y(A).concat(T).concat(y(k))}function x(A,k,T,I){return new bs(e,A-l.left,k-l.top,T-A,I-k)}function y({top:A,bottom:k,horizontal:T}){let I=[];for(let E=0;E<T.length;E+=2)I.push(x(T[E],A,T[E+1],k));return I}function $(A,k,T){let I=1e9,E=-1e9,j=[];function L(V,W,G,P,_){let O=t.coordsAtPos(V,V==T.to?-2:2),X=t.coordsAtPos(G,G==T.from?2:-2);!O||!X||(I=Math.min(O.top,X.top,I),E=Math.max(O.bottom,X.bottom,E),_==Oe.LTR?j.push(i&&W?h:O.left,i&&P?f:X.right):j.push(!i&&P?h:X.left,!i&&W?f:O.right))}let D=A??T.from,z=k??T.to;for(let V of t.visibleRanges)if(V.to>D&&V.from<z)for(let W=Math.max(V.from,D),G=Math.min(V.to,z);;){let P=t.state.doc.lineAt(W);for(let _ of t.bidiSpans(P)){let O=_.from+P.from,X=_.to+P.from;if(O>=G)break;X>W&&L(Math.max(O,W),A==null&&O<=D,Math.min(X,G),k==null&&X>=z,_.dir)}if(W=P.to+1,W>=G)break}return j.length==0&&L(D,A==null,z,k==null,t.textDirection),{top:I,bottom:E,horizontal:j}}function S(A,k){let T=a.top+(k?A.top:A.bottom);return{top:T,bottom:T,horizontal:[]}}}function EE(t,e){return t.constructor==e.constructor&&t.eq(e)}class IE{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Ta)!=e.state.facet(Ta)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Ta);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!EE(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let o of e)o.update&&n&&o.constructor&&this.drawn[r].constructor&&o.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(o.draw(),n);for(;n;){let o=n.nextSibling;n.remove(),n=o}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ta=ne.define();function H5(t){return[We.define(e=>new IE(e,t)),Ta.of(t)]}const Ki=ne.define({combine(t){return En(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function jE(t={}){return[Ki.of(t),DE,OE,LE,b5.of(!0)]}function P5(t){return t.startState.facet(Ki)!=t.state.facet(Ki)}const DE=H5({above:!0,markers(t){let{state:e}=t,n=e.facet(Ki),r=[];for(let o of e.selection.ranges){let i=o==e.selection.main;if(o.empty||n.drawRangeCursor){let s=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=o.empty?o:H.cursor(o.head,o.head>o.anchor?-1:1);for(let l of bs.forRange(t,s,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=P5(t);return n&&Q1(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Q1(e.state,t)},class:"cm-cursorLayer"});function Q1(t,e){e.style.animationDuration=t.facet(Ki).cursorBlinkRate+"ms"}const OE=H5({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:bs.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||P5(t)},class:"cm-selectionLayer"}),LE=to.highest(Q.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),W5=me.define({map(t,e){return t==null?null:e.mapPos(t)}}),ki=tt.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(W5)?r.value:n,t)}}),NE=We.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(ki);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(ki)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(ki),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(ki)!=t&&this.view.dispatch({effects:W5.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function BE(){return[ki,NE]}function Z1(t,e,n,r,o){e.lastIndex=0;for(let i=t.iterRange(n,r),s=n,a;!i.next().done;s+=i.value.length)if(!i.lineBreak)for(;a=e.exec(i.value);)o(s+a.index,a)}function FE(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:o,to:i}of n)o=Math.max(t.state.doc.lineAt(o).from,o-e),i=Math.min(t.state.doc.lineAt(i).to,i+e),r.length&&r[r.length-1].to>=o?r[r.length-1].to=i:r.push({from:o,to:i});return r}class VE{constructor(e){const{regexp:n,decoration:r,decorate:o,boundary:i,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,o)this.addMatch=(a,l,c,d)=>o(d,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,d)=>{let h=r(a,l,c);h&&d(c,c+a[0].length,h)};else if(r)this.addMatch=(a,l,c,d)=>d(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=s}createDeco(e){let n=new qn,r=n.add.bind(n);for(let{from:o,to:i}of FE(e,this.maxLength))Z1(e.state.doc,this.regexp,o,i,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,o=-1;return e.docChanged&&e.changes.iterChanges((i,s,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),o=Math.max(l,o))}),e.viewportMoved||o-r>1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,n.map(e.changes),r,o):n}updateRange(e,n,r,o){for(let i of e.visibleRanges){let s=Math.max(i.from,r),a=Math.min(i.to,o);if(a>=s){let l=e.state.doc.lineAt(s),c=l.to<a?e.state.doc.lineAt(a):l,d=Math.max(i.from,l.from),h=Math.min(i.to,c.to);if(this.boundary){for(;s>l.from;s--)if(this.boundary.test(l.text[s-1-l.from])){d=s;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let f=[],m,p=(b,v,x)=>f.push(x.range(b,v));if(l==c)for(this.regexp.lastIndex=d-l.from;(m=this.regexp.exec(l.text))&&m.index<h-l.from;)this.addMatch(m,e,m.index+l.from,p);else Z1(e.state.doc,this.regexp,d,h,(b,v)=>this.addMatch(v,e,b,p));n=n.update({filterFrom:d,filterTo:h,filter:(b,v)=>b<d||v>h,add:f})}}return n}}const Iu=/x/.unicode!=null?"gu":"g",_E=new RegExp(`[\0-\b
|
|
63
|
+
--\u2028\u2029\uFEFF-]`,Iu),zE={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Zc=null;function HE(){var t;if(Zc==null&&typeof document<"u"&&document.body){let e=document.body.style;Zc=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Zc||!1}const Ra=ne.define({combine(t){let e=En(t,{render:null,specialChars:_E,addSpecialChars:null});return(e.replaceTabs=!HE())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Iu)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Iu)),e}});function PE(t={}){return[Ra.of(t),WE()]}let J1=null;function WE(){return J1||(J1=We.fromClass(class{constructor(t){this.view=t,this.decorations=ae.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Ra)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new VE({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:o}=n.state,i=xt(e[0],0);if(i==9){let s=o.lineAt(r),a=n.state.tabSize,l=ri(s.text,a,r-s.from);return ae.replace({widget:new GE((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=ae.replace({widget:new KE(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Ra);t.startState.facet(Ra)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const qE="•";function UE(t){return t>=32?qE:t==10?"":String.fromCharCode(9216+t)}class KE extends Qn{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=UE(this.code),r=e.state.phrase("Control character")+" "+(zE[this.code]||"0x"+this.code.toString(16)),o=this.options.render&&this.options.render(this.code,r,n);if(o)return o;let i=document.createElement("span");return i.textContent=n,i.title=r,i.setAttribute("aria-label",r),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class GE extends Qn{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function YE(){return QE}const XE=ae.line({class:"cm-activeLine"}),QE=We.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let o=t.lineBlockAt(r.head);o.from>e&&(n.push(XE.range(o.from)),e=o.from)}return ae.set(n)}},{decorations:t=>t.decorations});class ZE extends Qn{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?_o(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),o=ms(n[0],r.direction!="rtl"),i=parseInt(r.lineHeight);return o.bottom-o.top>i*1.5?{left:o.left,right:o.right,top:o.top,bottom:o.top+i}:o}ignoreEvent(){return!1}}function JE(t){let e=We.fromClass(class{constructor(n){this.view=n,this.placeholder=t?ae.set([ae.widget({widget:new ZE(t),side:1}).range(0)]):ae.none}get decorations(){return this.view.state.doc.length?ae.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Q.contentAttributes.of({"aria-placeholder":t})]:e}const ju=2e3;function eI(t,e,n){let r=Math.min(e.line,n.line),o=Math.max(e.line,n.line),i=[];if(e.off>ju||n.off>ju||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=o;l++){let c=t.doc.line(l);c.length<=a&&i.push(H.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=o;l++){let c=t.doc.line(l),d=du(c.text,s,t.tabSize,!0);if(d<0)i.push(H.cursor(c.to));else{let h=du(c.text,a,t.tabSize);i.push(H.range(c.from+d,c.from+h))}}}return i}function tI(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function em(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),o=n-r.from,i=o>ju?-1:o==r.length?tI(t,e.clientX):ri(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:o}}function nI(t,e){let n=em(t,e),r=t.state.selection;return n?{update(o){if(o.docChanged){let i=o.changes.mapPos(o.startState.doc.line(n.line).from),s=o.state.doc.lineAt(i);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(o.changes)}},get(o,i,s){let a=em(t,o);if(!a)return r;let l=eI(t.state,n,a);return l.length?s?H.create(l.concat(r.ranges)):H.create(l):r}}:null}function rI(t){let e=n=>n.altKey&&n.button==0;return Q.mouseSelectionStyle.of((n,r)=>e(r)?nI(n,r):null)}const oI={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},iI={style:"cursor: crosshair"};function sI(t={}){let[e,n]=oI[t.key||"Alt"],r=We.fromClass(class{constructor(o){this.view=o,this.isDown=!1}set(o){this.isDown!=o&&(this.isDown=o,this.view.update([]))}},{eventObservers:{keydown(o){this.set(o.keyCode==e||n(o))},keyup(o){(o.keyCode==e||!n(o))&&this.set(!1)},mousemove(o){this.set(n(o))}}});return[r,Q.contentAttributes.of(o=>{var i;return!((i=o.plugin(r))===null||i===void 0)&&i.isDown?iI:null})]}const mi="-10000px";class q5{constructor(e,n,r,o){this.facet=n,this.createTooltipView=r,this.removeTooltipView=o,this.input=e.state.facet(n),this.tooltips=this.input.filter(s=>s);let i=null;this.tooltipViews=this.tooltips.map(s=>i=r(s,i))}update(e,n){var r;let o=e.state.facet(this.facet),i=o.filter(l=>l);if(o===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=n?[]:null;for(let l=0;l<i.length;l++){let c=i[l],d=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==c.create&&(d=h)}if(d<0)s[l]=this.createTooltipView(c,l?s[l-1]:null),a&&(a[l]=!!c.above);else{let h=s[l]=this.tooltipViews[d];a&&(a[l]=n[d]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)s.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,c)=>n[c]=l),n.length=a.length),this.input=o,this.tooltips=i,this.tooltipViews=s,!0}}function aI(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Jc=ne.define({combine:t=>{var e,n,r;return{position:te.ios?"absolute":((e=t.find(o=>o.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(o=>o.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(o=>o.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||aI}}}),tm=new WeakMap,If=We.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Jc);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new q5(t,jf,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Jc);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let o of this.manager.tooltipViews)o.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let o of this.manager.tooltipViews)this.container.appendChild(o.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let o=document.createElement("div");o.className="cm-tooltip-arrow",n.dom.appendChild(o)}return n.dom.style.position=this.position,n.dom.style.top=mi,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(te.gecko)n=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==mi&&i.style.left=="0px"){let s=i.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(n||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),o=Tf(this.view);return{visible:{left:r.left+o.left,top:r.top+o.top,right:r.right-o.right,bottom:r.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((i,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Jc).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:o,scaleY:i}=t,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:d}=c,h=t.pos[a],f=t.size[a];if(!h||l.clip!==!1&&(h.bottom<=Math.max(n.top,r.top)||h.top>=Math.min(n.bottom,r.bottom)||h.right<Math.max(n.left,r.left)-.1||h.left>Math.min(n.right,r.right)+.1)){d.style.top=mi;continue}let m=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=m?7:0,b=f.right-f.left,v=(e=tm.get(c))!==null&&e!==void 0?e:f.bottom-f.top,x=c.offset||cI,y=this.view.textDirection==Oe.LTR,$=f.width>r.right-r.left?y?r.left:r.right-f.width:y?Math.max(r.left,Math.min(h.left-(m?14:0)+x.x,r.right-b)):Math.min(Math.max(r.left,h.left-b+(m?14:0)-x.x),r.right-b),S=this.above[a];!l.strictSide&&(S?h.top-v-p-x.y<r.top:h.bottom+v+p+x.y>r.bottom)&&S==r.bottom-h.bottom>h.top-r.top&&(S=this.above[a]=!S);let A=(S?h.top-r.top:r.bottom-h.bottom)-p;if(A<v&&c.resize!==!1){if(A<this.view.defaultLineHeight){d.style.top=mi;continue}tm.set(c,v),d.style.height=(v=A)/i+"px"}else d.style.height&&(d.style.height="");let k=S?h.top-v-p-x.y:h.bottom+p+x.y,T=$+b;if(c.overlap!==!0)for(let I of s)I.left<T&&I.right>$&&I.top<k+v&&I.bottom>k&&(k=S?I.top-v-2-p:I.bottom+p+2);if(this.position=="absolute"?(d.style.top=(k-t.parent.top)/i+"px",nm(d,($-t.parent.left)/o)):(d.style.top=k/i+"px",nm(d,$/o)),m){let I=h.left+(y?x.x:-x.x)-($+14-7);m.style.left=I/o+"px"}c.overlap!==!0&&s.push({left:$,top:k,right:T,bottom:k+v}),d.classList.toggle("cm-tooltip-above",S),d.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=mi}},{eventObservers:{scroll(){this.maybeMeasure()}}});function nm(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const lI=Q.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),cI={x:0,y:0},jf=ne.define({enables:[If,lI]}),nl=ne.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Xl{static create(e){return new Xl(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new q5(e,nl,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let o=r[e];if(o!==void 0){if(n===void 0)n=o;else if(n!==o)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const dI=jf.compute([nl],t=>{let e=t.facet(nl);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:Xl.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class uI{constructor(e,n,r,o,i){this.view=e,this.source=n,this.field=r,this.setHover=o,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let o,i=1;if(r instanceof ir)o=r.posAtStart;else{if(o=e.posAtCoords(n),o==null)return;let a=e.coordsAtPos(o);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-e.defaultCharacterWidth||n.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(o)).find(d=>d.from<=o&&d.to>=o),c=l&&l.dir==Oe.RTL?-1:1;i=n.x<a.left?-c:c}let s=this.source(e,o,i);if(s?.then){let a=this.pending={pos:o};s.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Ct(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(If),n=e?e.manager.tooltips.findIndex(r=>r.create==Xl.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:o,tooltip:i}=this;if(o.length&&i&&!hI(i.dom,e)||this.pending){let{pos:s}=o[0]||this.pending,a=(r=(n=o[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!fI(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const aa=4;function hI(t,e){let{left:n,right:r,top:o,bottom:i}=t.getBoundingClientRect(),s;if(s=t.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();o=Math.min(a.top,o),i=Math.max(a.bottom,i)}return e.clientX>=n-aa&&e.clientX<=r+aa&&e.clientY>=o-aa&&e.clientY<=i+aa}function fI(t,e,n,r,o,i){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.right<r||s.top>o||Math.min(s.bottom,a)<o)return!1;let l=t.posAtCoords({x:r,y:o},!1);return l>=e&&l<=n}function mI(t,e={}){let n=me.define(),r=tt.define({create(){return[]},update(o,i){if(o.length&&(e.hideOnChange&&(i.docChanged||i.selection)?o=[]:e.hideOn&&(o=o.filter(s=>!e.hideOn(i,s))),i.docChanged)){let s=[];for(let a of o){let l=i.changes.mapPos(a.pos,-1,gt.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=i.changes.mapPos(c.end)),s.push(c)}}o=s}for(let s of i.effects)s.is(n)&&(o=s.value),s.is(gI)&&(o=[]);return o},provide:o=>nl.from(o)});return{active:r,extension:[r,We.define(o=>new uI(o,t,r,n,e.hoverTime||300)),dI]}}function U5(t,e){let n=t.plugin(If);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const gI=me.define(),rm=ne.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Gi(t,e){let n=t.plugin(K5),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const K5=We.fromClass(class{constructor(t){this.input=t.state.facet(Yi),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(rm);this.top=new la(t,!0,e.topContainer),this.bottom=new la(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(rm);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new la(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new la(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Yi);if(n!=this.input){let r=n.filter(l=>l),o=[],i=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),d;c<0?(d=l(t.view),a.push(d)):(d=this.panels[c],d.update&&d.update(t)),o.push(d),(d.top?i:s).push(d)}this.specs=r,this.panels=o,this.top.sync(i),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Q.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class la{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=om(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=om(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function om(t){let e=t.nextSibling;return t.remove(),e}const Yi=ne.define({enables:K5});class Kn extends Hr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Kn.prototype.elementClass="";Kn.prototype.toDOM=void 0;Kn.prototype.mapMode=gt.TrackBefore;Kn.prototype.startSide=Kn.prototype.endSide=-1;Kn.prototype.point=!0;const Ma=ne.define(),pI=ne.define(),bI={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ae.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},ji=ne.define();function vI(t){return[G5(),ji.of({...bI,...t})]}const im=ne.define({combine:t=>t.some(e=>e)});function G5(t){return[xI]}const xI=We.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ji).map(e=>new am(t,e)),this.fixed=!t.state.facet(im);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(im)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Ae.iter(this.view.state.facet(Ma),this.view.viewport.from),r=[],o=this.gutters.map(i=>new wI(i,this.view.viewport,-this.view.documentPadding.top));for(let i of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(i.type)){let s=!0;for(let a of i.type)if(a.type==pt.Text&&s){Du(n,r,a.from);for(let l of o)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of o)l.widget(this.view,a)}else if(i.type==pt.Text){Du(n,r,i.from);for(let s of o)s.line(this.view,i,r)}else if(i.widget)for(let s of o)s.widget(this.view,i);for(let i of o)i.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(ji),n=t.state.facet(ji),r=t.docChanged||t.heightChanged||t.viewportChanged||!Ae.eq(t.startState.facet(Ma),t.state.facet(Ma),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let o of this.gutters)o.update(t)&&(r=!0);else{r=!0;let o=[];for(let i of n){let s=e.indexOf(i);s<0?o.push(new am(this.view,i)):(this.gutters[s].update(t),o.push(this.gutters[s]))}for(let i of this.gutters)i.dom.remove(),o.indexOf(i)<0&&i.destroy();for(let i of o)i.config.side=="after"?this.getDOMAfter().appendChild(i.dom):this.dom.appendChild(i.dom);this.gutters=o}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Q.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,o=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Oe.LTR?{left:r,right:o}:{right:r,left:o}})});function sm(t){return Array.isArray(t)?t:[t]}function Du(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class wI{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Ae.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:o}=this,i=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==o.elements.length){let a=new Y5(e,s,i,r);o.elements.push(a),o.dom.appendChild(a.dom)}else o.elements[this.i].update(e,s,i,r);this.height=n.bottom,this.i++}line(e,n,r){let o=[];Du(this.cursor,o,n.from),r.length&&(o=o.concat(r));let i=this.gutter.config.lineMarker(e,n,o);i&&o.unshift(i);let s=this.gutter;o.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,o)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),o=r?[r]:null;for(let i of e.state.facet(pI)){let s=i(e,n.widget,n);s&&(o||(o=[])).push(s)}o&&this.addElement(e,n,o)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class am{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,o=>{let i=o.target,s;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let l=i.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=o.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,o)&&o.preventDefault()});this.markers=sm(n.markers(e)),n.initialSpacer&&(this.spacer=new Y5(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=sm(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let o=this.config.updateSpacer(this.spacer.markers[0],e);o!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[o])}let r=e.view.viewport;return!Ae.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Y5{constructor(e,n,r,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,o)}update(e,n,r,o){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),yI(this.markers,o)||this.setMarkers(e,o)}setMarkers(e,n){let r="cm-gutterElement",o=this.dom.firstChild;for(let i=0,s=0;;){let a=s,l=i<n.length?n[i++]:null,c=!1;if(l){let d=l.elementClass;d&&(r+=" "+d);for(let h=s;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;s<a;){let d=this.markers[s++];if(d.toDOM){d.destroy(o);let h=o.nextSibling;o.remove(),o=h}}if(!l)break;l.toDOM&&(c?o=o.nextSibling:this.dom.insertBefore(l.toDOM(e),o)),c&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function yI(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const CI=ne.define(),$I=ne.define(),po=ne.define({combine(t){return En(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let o in n){let i=r[o],s=n[o];r[o]=i?(a,l,c)=>i(a,l,c)||s(a,l,c):s}return r}})}});class ed extends Kn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function td(t,e){return t.state.facet(po).formatNumber(e,t.state)}const SI=ji.compute([po],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(CI)},lineMarker(e,n,r){return r.some(o=>o.toDOM)?null:new ed(td(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let o of e.state.facet($I)){let i=o(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(po)!=e.state.facet(po),initialSpacer(e){return new ed(td(e,lm(e.state.doc.lines)))},updateSpacer(e,n){let r=td(n.view,lm(n.view.state.doc.lines));return r==e.number?e:new ed(r)},domEventHandlers:t.facet(po).domEventHandlers,side:"before"}));function AI(t={}){return[po.of(t),G5(),SI]}function lm(t){let e=9;for(;e<t;)e=e*10+9;return e}const kI=new class extends Kn{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},TI=Ma.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head).from;o>n&&(n=o,e.push(kI.range(o)))}return Ae.of(e)});function RI(){return TI}var nd;const bo=new we;function MI(t){return ne.define({combine:t?e=>e.concat(t):void 0})}const EI=new we;class Gt{constructor(e,n,r=[],o=""){this.data=e,this.name=o,$e.prototype.hasOwnProperty("tree")||Object.defineProperty($e.prototype,"tree",{get(){return ht(this)}}),this.parser=n,this.extension=[pr.of(this),$e.languageData.of((i,s,a)=>{let l=cm(i,s,a),c=l.type.prop(bo);if(!c)return[];let d=i.facet(c),h=l.type.prop(EI);if(h){let f=l.resolve(s-l.from,a);for(let m of h)if(m.test(f,i)){let p=i.facet(m.facet);return m.type=="replace"?p:p.concat(d)}}return d})].concat(r)}isActiveAt(e,n,r=-1){return cm(e,n,r).type.prop(bo)==this.data}findRegions(e){let n=e.facet(pr);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],o=(i,s)=>{if(i.prop(bo)==this.data){r.push({from:s,to:s+i.length});return}let a=i.prop(we.mounted);if(a){if(a.tree.prop(bo)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+i.length});return}else if(a.overlay){let l=r.length;if(o(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<i.children.length;l++){let c=i.children[l];c instanceof Ge&&o(c,i.positions[l]+s)}};return o(ht(e),0),r}get allowsNesting(){return!0}}Gt.setState=me.define();function cm(t,e,n){let r=t.facet(pr),o=ht(t).topNode;if(!r||r.allowsNesting)for(let i=o;i;i=i.enter(e,n,Ze.ExcludeBuffers))i.type.isTop&&(o=i);return o}class rl extends Gt{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=MI(e.languageData);return new rl(n,e.parser.configure({props:[bo.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new rl(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ht(t){let e=t.field(Gt.state,!1);return e?e.tree:Ge.empty}class II{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let gi=null;class ol{constructor(e,n,r=[],o,i,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=o,this.treeLen=i,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new ol(e,n,[],Ge.empty,0,r,[],null)}startParse(){return this.parser.startParse(new II(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ge.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let o=Date.now()+e;e=()=>Date.now()>o}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let o=this.parse.advance();if(o)if(this.fragments=this.withoutTempSkipped(Or.addTree(o,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=o,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Or.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=gi;gi=this;try{return e()}finally{gi=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=dm(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:o,treeLen:i,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,d,h,f)=>l.push({fromA:c,toA:d,fromB:h,toB:f})),r=Or.applyChanges(r,l),o=Ge.empty,i=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);d<h&&a.push({from:d,to:h})}}}return new ol(this.parser,n,r,o,i,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:o,to:i}=this.skipped[r];o<e.to&&i>e.from&&(this.fragments=dm(this.fragments,o,i),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends yb{createParse(n,r,o){let i=o[0].from,s=o[o.length-1].to;return{parsedPos:i,advance(){let l=gi;if(l){for(let c of o)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new Ge(St.none,[],[],s-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return gi}}function dm(t,e,n){return Or.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Wo{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Wo(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=ol.create(e.facet(pr).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Wo(r)}}Gt.state=tt.define({create:Wo.init,update(t,e){for(let n of e.effects)if(n.is(Gt.setState))return n.value;return e.startState.facet(pr)!=e.state.facet(pr)?Wo.init(e.state):t.apply(e)}});let X5=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(X5=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const rd=typeof navigator<"u"&&(!((nd=navigator.scheduling)===null||nd===void 0)&&nd.isInputPending)?()=>navigator.scheduling.isInputPending():null,jI=We.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Gt.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Gt.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=X5(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:o}}=this.view,i=r.field(Gt.state);if(i.tree==i.context.tree&&i.context.isDone(o+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!rd?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<o&&r.doc.length>o+1e3,l=i.context.work(()=>rd&&rd()||Date.now()>s,o+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Gt.setState.of(new Wo(i.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ct(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),pr=ne.define({combine(t){return t.length?t[0]:null},enables:t=>[Gt.state,jI,Q.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class DI{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const OI=ne.define(),Ql=ne.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function il(t){let e=t.facet(Ql);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Xi(t,e){let n="",r=t.tabSize,o=t.facet(Ql)[0];if(o==" "){for(;e>=r;)n+=" ",e-=r;o=" "}for(let i=0;i<e;i++)n+=o;return n}function Df(t,e){t instanceof $e&&(t=new Zl(t));for(let r of t.state.facet(OI)){let o=r(t,e);if(o!==void 0)return o}let n=ht(t.state);return n.length>=e?LI(t,n,e):null}class Zl{constructor(e,n={}){this.state=e,this.options=n,this.unit=il(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:i}=this.options;return o!=null&&o>=r.from&&o<=r.to?i&&o==e?{text:"",from:e}:(n<0?o<e:o<=e)?{text:r.text.slice(o-r.from),from:o}:{text:r.text.slice(0,o-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:o}=this.lineAt(e,n);return r.slice(e-o,Math.min(r.length,e+100-o))}column(e,n=1){let{text:r,from:o}=this.lineAt(e,n),i=this.countColumn(r,e-o),s=this.options.overrideIndentation?this.options.overrideIndentation(o):-1;return s>-1&&(i+=s-this.countColumn(r,r.search(/\S|$/))),i}countColumn(e,n=e.length){return ri(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:o}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let s=i(o);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Q5=new we;function LI(t,e,n){let r=e.resolveStack(n),o=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(o!=r.node){let i=[];for(let s=o;s&&!(s.from<r.node.from||s.to>r.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)i.push(s);for(let s=i.length-1;s>=0;s--)r={node:i[s],next:r}}return Z5(r,t,n)}function Z5(t,e,n){for(let r=t;r;r=r.next){let o=BI(r.node);if(o)return o(Of.create(e,n,r))}return 0}function NI(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function BI(t){let e=t.type.prop(Q5);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(we.closedBy))){let o=t.lastChild,i=o&&r.indexOf(o.name)>-1;return s=>zI(s,!0,1,void 0,i&&!NI(s)?o.from:void 0)}return t.parent==null?FI:null}function FI(){return 0}class Of extends Zl{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Of(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(VI(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Z5(this.context.next,this.base,this.pos)}}function VI(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function _I(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let o=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),s=o==null||o<=i.from?i.to:Math.min(i.to,o);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function zI(t,e,n,r,o){let i=t.textAfter,s=i.match(/^\s*/)[0].length,a=r&&i.slice(s,s+r.length)==r||o==t.pos+s,l=_I(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function um({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const HI=200;function PI(){return $e.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,o=n.lineAt(r);if(r>o.from+HI)return t;let i=n.sliceString(o.from,r);if(!e.some(c=>c.test(i)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let d=s.doc.lineAt(c);if(d.from==a)continue;a=d.from;let h=Df(s,d.from);if(h==null)continue;let f=/^\s*/.exec(d.text)[0],m=Xi(s,h);f!=m&&l.push({from:d.from,to:d.from+f.length,insert:m})}return l.length?[t,{changes:l,sequential:!0}]:t})}const WI=ne.define(),J5=new we;function qI(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function UI(t,e,n){let r=ht(t);if(r.length<n)return null;let o=r.resolveStack(n,1),i=null;for(let s=o;s;s=s.next){let a=s.node;if(a.to<=n||a.from>n)continue;if(i&&a.from<e)break;let l=a.type.prop(J5);if(l&&(a.to<r.length-50||r.length==t.doc.length||!KI(a))){let c=l(a,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(i=c)}}return i}function KI(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function sl(t,e,n){for(let r of t.facet(WI)){let o=r(t,e,n);if(o)return o}return UI(t,e,n)}function ev(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Jl=me.define({map:ev}),vs=me.define({map:ev});function tv(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const Ur=tt.define({create(){return ae.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=hm(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(Jl)&&!GI(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(ov),o=r?ae.replace({widget:new tj(r(e.state,n.value))}):fm;t=t.update({add:[o.range(n.value.from,n.value.to)]})}else n.is(vs)&&(t=t.update({filter:(r,o)=>n.value.from!=r||n.value.to!=o,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=hm(t,e.selection.main.head)),t},provide:t=>Q.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,o)=>{n.push(r,o)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],o=t[n++];if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid JSON for fold state");e.push(fm.range(r,o))}return ae.set(e,!0)}});function hm(t,e,n=e){let r=!1;return t.between(e,n,(o,i)=>{o<n&&i>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(o,i)=>o>=n||i<=e}):t}function al(t,e,n){var r;let o=null;return(r=t.field(Ur,!1))===null||r===void 0||r.between(e,n,(i,s)=>{(!o||o.from>i)&&(o={from:i,to:s})}),o}function GI(t,e,n){let r=!1;return t.between(e,e,(o,i)=>{o==e&&i==n&&(r=!0)}),r}function nv(t,e){return t.field(Ur,!1)?e:e.concat(me.appendConfig.of(iv()))}const YI=t=>{for(let e of tv(t)){let n=sl(t.state,e.from,e.to);if(n)return t.dispatch({effects:nv(t.state,[Jl.of(n),rv(t,n)])}),!0}return!1},XI=t=>{if(!t.state.field(Ur,!1))return!1;let e=[];for(let n of tv(t)){let r=al(t.state,n.from,n.to);r&&e.push(vs.of(r),rv(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function rv(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,o=t.state.doc.lineAt(e.to).number;return Q.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${o}.`)}const QI=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let o=t.lineBlockAt(r),i=sl(e,o.from,o.to);i&&n.push(Jl.of(i)),r=(i?t.lineBlockAt(i.to):o).to+1}return n.length&&t.dispatch({effects:nv(t.state,n)}),!!n.length},ZI=t=>{let e=t.state.field(Ur,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,o)=>{n.push(vs.of({from:r,to:o}))}),t.dispatch({effects:n}),!0},JI=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:YI},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:XI},{key:"Ctrl-Alt-[",run:QI},{key:"Ctrl-Alt-]",run:ZI}],ej={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ov=ne.define({combine(t){return En(t,ej)}});function iv(t){return[Ur,oj]}function sv(t,e){let{state:n}=t,r=n.facet(ov),o=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=al(t.state,a.from,a.to);l&&t.dispatch({effects:vs.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,o,e);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=o,i}const fm=ae.replace({widget:new class extends Qn{toDOM(t){return sv(t,null)}}});class tj extends Qn{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return sv(e,this.value)}}const nj={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class od extends Kn{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function rj(t={}){let e={...nj,...t},n=new od(e,!0),r=new od(e,!1),o=We.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(pr)!=s.state.facet(pr)||s.startState.field(Ur,!1)!=s.state.field(Ur,!1)||ht(s.startState)!=ht(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new qn;for(let l of s.viewportLineBlocks){let c=al(s.state,l.from,l.to)?r:sl(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:i}=e;return[o,vI({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(o))===null||a===void 0?void 0:a.markers)||Ae.empty},initialSpacer(){return new od(e,!1)},domEventHandlers:{...i,click:(s,a,l)=>{if(i.click&&i.click(s,a,l))return!0;let c=al(s.state,a.from,a.to);if(c)return s.dispatch({effects:vs.of(c)}),!0;let d=sl(s.state,a.from,a.to);return d?(s.dispatch({effects:Jl.of(d)}),!0):!1}}}),iv()]}const oj=Q.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class xs{constructor(e,n){this.specs=e;let r;function o(a){let l=fr.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const i=typeof n.all=="string"?n.all:n.all?o(n.all):void 0,s=n.scope;this.scope=s instanceof Gt?a=>a.prop(bo)==s.data:s?a=>a==s:void 0,this.style=Sb(e.map(a=>({tag:a.tag,class:a.class||o(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=r?new fr(r):null,this.themeType=n.themeType}static define(e,n){return new xs(e,n||{})}}const Ou=ne.define(),av=ne.define({combine(t){return t.length?[t[0]]:null}});function id(t){let e=t.facet(Ou);return e.length?e:t.facet(av)}function lv(t,e){let n=[sj],r;return t instanceof xs&&(t.module&&n.push(Q.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(av.of(t)):r?n.push(Ou.computeN([Q.darkTheme],o=>o.facet(Q.darkTheme)==(r=="dark")?[t]:[])):n.push(Ou.of(t)),n}class ij{constructor(e){this.markCache=Object.create(null),this.tree=ht(e.state),this.decorations=this.buildDeco(e,id(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ht(e.state),r=id(e.state),o=r!=id(e.startState),{viewport:i}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<i.to&&!o&&n.type==this.tree.type&&s>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||o)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return ae.none;let r=new qn;for(let{from:o,to:i}of e.visibleRanges)$R(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=ae.mark({class:l})))},o,i);return r.finish()}}const sj=to.high(We.fromClass(ij,{decorations:t=>t.decorations})),aj=xs.define([{tag:N.meta,color:"#404740"},{tag:N.link,textDecoration:"underline"},{tag:N.heading,textDecoration:"underline",fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strong,fontWeight:"bold"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.keyword,color:"#708"},{tag:[N.atom,N.bool,N.url,N.contentSeparator,N.labelName],color:"#219"},{tag:[N.literal,N.inserted],color:"#164"},{tag:[N.string,N.deleted],color:"#a11"},{tag:[N.regexp,N.escape,N.special(N.string)],color:"#e40"},{tag:N.definition(N.variableName),color:"#00f"},{tag:N.local(N.variableName),color:"#30a"},{tag:[N.typeName,N.namespace],color:"#085"},{tag:N.className,color:"#167"},{tag:[N.special(N.variableName),N.macroName],color:"#256"},{tag:N.definition(N.propertyName),color:"#00c"},{tag:N.comment,color:"#940"},{tag:N.invalid,color:"#f00"}]),lj=Q.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),cv=1e4,dv="()[]{}",uv=ne.define({combine(t){return En(t,{afterCursor:!0,brackets:dv,maxScanDistance:cv,renderMatch:uj})}}),cj=ae.mark({class:"cm-matchingBracket"}),dj=ae.mark({class:"cm-nonmatchingBracket"});function uj(t){let e=[],n=t.matched?cj:dj;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const hj=tt.define({create(){return ae.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(uv);for(let o of e.state.selection.ranges){if(!o.empty)continue;let i=mn(e.state,o.head,-1,r)||o.head>0&&mn(e.state,o.head-1,1,r)||r.afterCursor&&(mn(e.state,o.head,1,r)||o.head<e.state.doc.length&&mn(e.state,o.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,e.state)))}return ae.set(n,!0)},provide:t=>Q.decorations.from(t)}),fj=[hj,lj];function mj(t={}){return[uv.of(t),fj]}const gj=new we;function Lu(t,e,n){let r=t.prop(e<0?we.openedBy:we.closedBy);if(r)return r;if(t.name.length==1){let o=n.indexOf(t.name);if(o>-1&&o%2==(e<0?1:0))return[n[o+e]]}return null}function Nu(t){let e=t.type.prop(gj);return e?e(t.node):t}function mn(t,e,n,r={}){let o=r.maxScanDistance||cv,i=r.brackets||dv,s=ht(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Lu(l.type,n,i);if(c&&l.from<l.to){let d=Nu(l);if(d&&(n>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return pj(t,e,n,l,d,c,i)}}return bj(t,e,n,s,a.type,o,i)}function pj(t,e,n,r,o,i,s){let a=r.parent,l={from:o.from,to:o.to},c=0,d=a?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(c==0&&i.indexOf(d.type.name)>-1&&d.from<d.to){let h=Nu(d);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(Lu(d.type,n,s))c++;else if(Lu(d.type,-n,s)){if(c==0){let h=Nu(d);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(n<0?d.prevSibling():d.nextSibling());return{start:l,matched:!1}}function bj(t,e,n,r,o,i,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),h=0;for(let f=0;!d.next().done&&f<=i;){let m=d.value;n<0&&(f+=m.length);let p=e+f*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let x=s.indexOf(m[b]);if(!(x<0||r.resolveInner(p+b,1).type!=o))if(x%2==0==n>0)h++;else{if(h==1)return{start:c,end:{from:p+b,to:p+b+1},matched:x>>1==l>>1};h--}}n>0&&(f+=m.length)}return d.done?{start:c,matched:!1}:null}const vj=Object.create(null),mm=[St.none],gm=[],pm=Object.create(null),xj=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])xj[t]=wj(vj,e);function sd(t,e){gm.indexOf(t)>-1||(gm.push(t),console.warn(e))}function wj(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let d=t[c]||N[c];d?typeof d=="function"?l.length?l=l.map(d):sd(c,`Modifier ${c} used at start of tag`):l.length?sd(c,`Tag ${c} used as modifier`):l=Array.isArray(d)?d:[d]:sd(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),o=r+" "+n.map(a=>a.id),i=pm[o];if(i)return i.id;let s=pm[o]=St.define({id:mm.length,name:r,props:[Cb({[r]:n})]});return mm.push(s),s.id}Oe.RTL,Oe.LTR;const yj=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=Cj(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function Cj(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const $j=rl.define({name:"json",parser:TR.configure({props:[Q5.add({Object:um({except:/^\s*\}/}),Array:um({except:/^\s*\]/})}),J5.add({"Object Array":qI})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Sj(){return new DI($j)}function Aj(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}const kj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Nf(t.state,n.from);return r.line?Tj(t):r.block?Mj(t):!1};function Lf(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=t(e,n);return o?(r(n.update(o)),!0):!1}}const Tj=Lf(jj,0),Rj=Lf(hv,0),Mj=Lf((t,e)=>hv(t,e,Ij(e)),0);function Nf(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const pi=50;function Ej(t,{open:e,close:n},r,o){let i=t.sliceDoc(r-pi,r),s=t.sliceDoc(o,o+pi),a=/\s*$/.exec(i)[0].length,l=/^\s*/.exec(s)[0].length,c=i.length-a;if(i.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:o+l,margin:l&&1}};let d,h;o-r<=2*pi?d=h=t.sliceDoc(r,o):(d=t.sliceDoc(r,r+pi),h=t.sliceDoc(o-pi,o));let f=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(h)[0].length,p=h.length-m-n.length;return d.slice(f,f+e.length)==e&&h.slice(p,p+n.length)==n?{open:{pos:r+f+e.length,margin:/\s/.test(d.charAt(f+e.length))?1:0},close:{pos:o-m-n.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function Ij(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),o=n.to<=r.to?r:t.doc.lineAt(n.to);o.from>r.from&&o.from==n.to&&(o=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>r.from?e[i].to=o.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return e}function hv(t,e,n=e.selection.ranges){let r=n.map(i=>Nf(e,i.from).block);if(!r.every(i=>i))return null;let o=n.map((i,s)=>Ej(e,r[s],i.from,i.to));if(t!=2&&!o.every(i=>i))return{changes:e.changes(n.map((i,s)=>o[s]?[]:[{from:i.from,insert:r[s].open+" "},{from:i.to,insert:" "+r[s].close}]))};if(t!=1&&o.some(i=>i)){let i=[];for(let s=0,a;s<o.length;s++)if(a=o[s]){let l=r[s],{open:c,close:d}=a;i.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:i}}return null}function jj(t,e,n=e.selection.ranges){let r=[],o=-1;for(let{from:i,to:s}of n){let a=r.length,l=1e9,c=Nf(e,i).line;if(c){for(let d=i;d<=s;){let h=e.doc.lineAt(d);if(h.from>o&&(i==s||s>h.from)){o=h.from;let f=/^\s*/.exec(h.text)[0].length,m=f==h.length,p=h.text.slice(f,f+c.length)==c?f:-1;f<h.text.length&&f<l&&(l=f),r.push({line:h,comment:p,token:c,indent:f,empty:m,single:!1})}d=h.to+1}if(l<1e9)for(let d=a;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=l);r.length==a+1&&(r[a].single=!0)}}if(t!=2&&r.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:a,token:l,indent:c,empty:d,single:h}of r)(h||!d)&&i.push({from:a.from+c,insert:l+" "});let s=e.changes(i);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(i=>i.comment>=0)){let i=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,d=c+l.length;s.text[d-s.from]==" "&&d++,i.push({from:c,to:d})}return{changes:i}}return null}const Bu=Mn.define(),Dj=Mn.define(),Oj=ne.define(),fv=ne.define({combine(t){return En(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,o)=>e(r,o)||n(r,o)})}}),mv=tt.define({create(){return gn.empty},update(t,e){let n=e.state.facet(fv),r=e.annotation(Bu);if(r){let l=$t.fromTransaction(e,r.selection),c=r.side,d=c==0?t.undone:t.done;return l?d=ll(d,d.length,n.minDepth,l):d=bv(d,e.startState.selection),new gn(c==0?r.rest:d,c==0?d:r.rest)}let o=e.annotation(Dj);if((o=="full"||o=="before")&&(t=t.isolate()),e.annotation(Xe.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=$t.fromTransaction(e),s=e.annotation(Xe.time),a=e.annotation(Xe.userEvent);return i?t=t.addChanges(i,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(o=="full"||o=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new gn(t.done.map($t.fromJSON),t.undone.map($t.fromJSON))}});function Lj(t={}){return[mv,fv.of(t),Q.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?gv:e.inputType=="historyRedo"?Fu:null;return r?(e.preventDefault(),r(n)):!1}})]}function ec(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let o=n.field(mv,!1);if(!o)return!1;let i=o.pop(t,n,e);return i?(r(i),!0):!1}}const gv=ec(0,!1),Fu=ec(1,!1),Nj=ec(0,!0),Bj=ec(1,!0);class $t{constructor(e,n,r,o,i){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=o,this.selectionsAfter=i}setSelAfter(e){return new $t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(e){return new $t(e.changes&&Ye.fromJSON(e.changes),[],e.mapped&&vn.fromJSON(e.mapped),e.startSelection&&H.fromJSON(e.startSelection),e.selectionsAfter.map(H.fromJSON))}static fromTransaction(e,n){let r=Nt;for(let o of e.startState.facet(Oj)){let i=o(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new $t(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Nt)}static selection(e){return new $t(void 0,Nt,void 0,void 0,e)}}function ll(t,e,n,r){let o=e+1>n+20?e-n-1:0,i=t.slice(o,e);return i.push(r),i}function Fj(t,e){let n=[],r=!1;return t.iterChangedRanges((o,i)=>n.push(o,i)),e.iterChangedRanges((o,i,s,a)=>{for(let l=0;l<n.length;){let c=n[l++],d=n[l++];a>=c&&s<=d&&(r=!0)}}),r}function Vj(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function pv(t,e){return t.length?e.length?t.concat(e):t:e}const Nt=[],_j=200;function bv(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-_j));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),ll(t,t.length-1,1e9,n.setSelAfter(r)))}else return[$t.selection([e])]}function zj(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function ad(t,e){if(!t.length)return t;let n=t.length,r=Nt;for(;n;){let o=Hj(t[n-1],e,r);if(o.changes&&!o.changes.empty||o.effects.length){let i=t.slice(0,n);return i[n-1]=o,i}else e=o.mapped,n--,r=o.selectionsAfter}return r.length?[$t.selection(r)]:Nt}function Hj(t,e,n){let r=pv(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Nt,n);if(!t.changes)return $t.selection(r);let o=t.changes.map(e),i=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(i):i;return new $t(o,me.mapEffects(t.effects,e),s,t.startSelection.map(i),r)}const Pj=/^(input\.type|delete)($|\.)/;class gn{constructor(e,n,r=0,o=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=o}isolate(){return this.prevTime?new gn(this.done,this.undone):this}addChanges(e,n,r,o,i){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||Pj.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<o.newGroupDelay&&o.joinToEvent(i,Fj(a.changes,e.changes))||r=="input.type.compose")?s=ll(s,s.length-1,o.minDepth,new $t(e.changes.compose(a.changes),pv(me.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Nt)):s=ll(s,s.length,o.minDepth,e),new gn(s,Nt,n,r)}addSelection(e,n,r,o){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Nt;return i.length>0&&n-this.prevTime<o&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Vj(i[i.length-1],e)?this:new gn(bv(this.done,e),this.undone,n,r)}addMapping(e){return new gn(ad(this.done,e),ad(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let o=e==0?this.done:this.undone;if(o.length==0)return null;let i=o[o.length-1],s=i.selectionsAfter[0]||n.selection;if(r&&i.selectionsAfter.length)return n.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Bu.of({side:e,rest:zj(o),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=o.length==1?Nt:o.slice(0,o.length-1);return i.mapped&&(a=ad(a,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Bu.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}gn.empty=new gn(Nt,Nt);const Wj=[{key:"Mod-z",run:gv,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Fu,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Fu,preventDefault:!0},{key:"Mod-u",run:Nj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Bj,preventDefault:!0}];function oi(t,e){return H.create(t.ranges.map(e),t.mainIndex)}function In(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function rn({state:t,dispatch:e},n){let r=oi(t.selection,n);return r.eq(t.selection,!0)?!1:(e(In(t,r)),!0)}function tc(t,e){return H.cursor(e?t.to:t.from)}function vv(t,e){return rn(t,n=>n.empty?t.moveByChar(n,e):tc(n,e))}function ft(t){return t.textDirectionAt(t.state.selection.main.head)==Oe.LTR}const xv=t=>vv(t,!ft(t)),wv=t=>vv(t,ft(t));function yv(t,e){return rn(t,n=>n.empty?t.moveByGroup(n,e):tc(n,e))}const qj=t=>yv(t,!ft(t)),Uj=t=>yv(t,ft(t));function Kj(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function nc(t,e,n){let r=ht(t).resolveInner(e.head),o=n?we.closedBy:we.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;Kj(t,c,o)?r=c:l=n?c.to:c.from}let i=r.type.prop(o),s,a;return i&&(s=n?mn(t,r.from,1):mn(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,H.cursor(a,n?-1:1)}const Gj=t=>rn(t,e=>nc(t.state,e,!ft(t))),Yj=t=>rn(t,e=>nc(t.state,e,ft(t)));function Cv(t,e){return rn(t,n=>{if(!n.empty)return tc(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const $v=t=>Cv(t,!1),Sv=t=>Cv(t,!0);function Av(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,o;if(e){for(let i of t.state.facet(Q.scrollMargins)){let s=i(t);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}o=t.scrollDOM.clientHeight-n-r}else o=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,o-5)}}function kv(t,e){let n=Av(t),{state:r}=t,o=oi(r.selection,s=>s.empty?t.moveVertically(s,e,n.height):tc(s,e));if(o.eq(r.selection))return!1;let i;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<c&&(i=Q.scrollIntoView(o.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(In(r,o),{effects:i}),!0}const bm=t=>kv(t,!1),Vu=t=>kv(t,!0);function yr(t,e,n){let r=t.lineBlockAt(e.head),o=t.moveToLineBoundary(e,n);if(o.head==e.head&&o.head!=(n?r.to:r.from)&&(o=t.moveToLineBoundary(e,n,!1)),!n&&o.head==r.from&&r.length){let i=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&e.head!=r.from+i&&(o=H.cursor(r.from+i))}return o}const Xj=t=>rn(t,e=>yr(t,e,!0)),Qj=t=>rn(t,e=>yr(t,e,!1)),Zj=t=>rn(t,e=>yr(t,e,!ft(t))),Jj=t=>rn(t,e=>yr(t,e,ft(t))),eD=t=>rn(t,e=>H.cursor(t.lineBlockAt(e.head).from,1)),tD=t=>rn(t,e=>H.cursor(t.lineBlockAt(e.head).to,-1));function nD(t,e,n){let r=!1,o=oi(t.selection,i=>{let s=mn(t,i.head,-1)||mn(t,i.head,1)||i.head>0&&mn(t,i.head-1,1)||i.head<t.doc.length&&mn(t,i.head+1,-1);if(!s||!s.end)return i;r=!0;let a=s.start.from==i.head?s.end.to:s.end.from;return H.cursor(a)});return r?(e(In(t,o)),!0):!1}const rD=({state:t,dispatch:e})=>nD(t,e);function zt(t,e){let n=oi(t.state.selection,r=>{let o=e(r);return H.range(r.anchor,o.head,o.goalColumn,o.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(In(t.state,n)),!0)}function Tv(t,e){return zt(t,n=>t.moveByChar(n,e))}const Rv=t=>Tv(t,!ft(t)),Mv=t=>Tv(t,ft(t));function Ev(t,e){return zt(t,n=>t.moveByGroup(n,e))}const oD=t=>Ev(t,!ft(t)),iD=t=>Ev(t,ft(t)),sD=t=>zt(t,e=>nc(t.state,e,!ft(t))),aD=t=>zt(t,e=>nc(t.state,e,ft(t)));function Iv(t,e){return zt(t,n=>t.moveVertically(n,e))}const jv=t=>Iv(t,!1),Dv=t=>Iv(t,!0);function Ov(t,e){return zt(t,n=>t.moveVertically(n,e,Av(t).height))}const vm=t=>Ov(t,!1),xm=t=>Ov(t,!0),lD=t=>zt(t,e=>yr(t,e,!0)),cD=t=>zt(t,e=>yr(t,e,!1)),dD=t=>zt(t,e=>yr(t,e,!ft(t))),uD=t=>zt(t,e=>yr(t,e,ft(t))),hD=t=>zt(t,e=>H.cursor(t.lineBlockAt(e.head).from)),fD=t=>zt(t,e=>H.cursor(t.lineBlockAt(e.head).to)),wm=({state:t,dispatch:e})=>(e(In(t,{anchor:0})),!0),ym=({state:t,dispatch:e})=>(e(In(t,{anchor:t.doc.length})),!0),Cm=({state:t,dispatch:e})=>(e(In(t,{anchor:t.selection.main.anchor,head:0})),!0),$m=({state:t,dispatch:e})=>(e(In(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),mD=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),gD=({state:t,dispatch:e})=>{let n=rc(t).map(({from:r,to:o})=>H.range(r,Math.min(o+1,t.doc.length)));return e(t.update({selection:H.create(n),userEvent:"select"})),!0},pD=({state:t,dispatch:e})=>{let n=oi(t.selection,r=>{let o=ht(t),i=o.resolveStack(r.from,1);if(r.empty){let s=o.resolveStack(r.from,-1);s.node.from>=i.node.from&&s.node.to<=i.node.to&&(i=s)}for(let s=i;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return H.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(In(t,n)),!0)},bD=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=H.create([n.main]):n.main.empty||(r=H.create([H.cursor(n.main.head)])),r?(e(In(t,r)),!0):!1};function ws(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,o=r.changeByRange(i=>{let{from:s,to:a}=i;if(s==a){let l=e(i);l<s?(n="delete.backward",l=ca(t,l,!1)):l>s&&(n="delete.forward",l=ca(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=ca(t,s,!1),a=ca(t,a,!0);return s==a?{range:i}:{changes:{from:s,to:a},range:H.cursor(s,s<i.head?-1:1)}});return o.changes.empty?!1:(t.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Q.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function ca(t,e,n){if(t instanceof Q)for(let r of t.state.facet(Q.atomicRanges).map(o=>o(t)))r.between(e,e,(o,i)=>{o<e&&i>e&&(e=n?i:o)});return e}const Lv=(t,e,n)=>ws(t,r=>{let o=r.from,{state:i}=t,s=i.doc.lineAt(o),a,l;if(n&&!e&&o>s.from&&o<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,o-s.from))){if(a[a.length-1]==" ")return o-1;let c=ri(a,i.tabSize),d=c%il(i)||il(i);for(let h=0;h<d&&a[a.length-1-h]==" ";h++)o--;l=o}else l=st(s.text,o-s.from,e,e)+s.from,l==o&&s.number!=(e?i.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,o-s.from))&&(l=st(s.text,l-s.from,!1,!1)+s.from);return l}),_u=t=>Lv(t,!1,!0),Nv=t=>Lv(t,!0,!1),Bv=(t,e)=>ws(t,n=>{let r=n.head,{state:o}=t,i=o.doc.lineAt(r),s=o.charCategorizer(r);for(let a=null;;){if(r==(e?i.to:i.from)){r==n.head&&i.number!=(e?o.doc.lines:1)&&(r+=e?1:-1);break}let l=st(i.text,r-i.from,e)+i.from,c=i.text.slice(Math.min(r,l)-i.from,Math.max(r,l)-i.from),d=s(c);if(a!=null&&d!=a)break;(c!=" "||r!=n.head)&&(a=d),r=l}return r}),Fv=t=>Bv(t,!1),vD=t=>Bv(t,!0),xD=t=>ws(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),wD=t=>ws(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),yD=t=>ws(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),CD=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ke.of(["",""])},range:H.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},$D=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let o=r.from,i=t.doc.lineAt(o),s=o==i.from?o-1:st(i.text,o-i.from,!1)+i.from,a=o==i.to?o+1:st(i.text,o-i.from,!0)+i.from;return{changes:{from:s,to:a,insert:t.doc.slice(o,a).append(t.doc.slice(s,o))},range:H.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function rc(t){let e=[],n=-1;for(let r of t.selection.ranges){let o=t.doc.lineAt(r.from),i=t.doc.lineAt(r.to);if(!r.empty&&r.to==i.from&&(i=t.doc.lineAt(r.to-1)),n>=o.number){let s=e[e.length-1];s.to=i.to,s.ranges.push(r)}else e.push({from:o.from,to:i.to,ranges:[r]});n=i.number+1}return e}function Vv(t,e,n){if(t.readOnly)return!1;let r=[],o=[];for(let i of rc(t)){if(n?i.to==t.doc.length:i.from==0)continue;let s=t.doc.lineAt(n?i.to+1:i.from-1),a=s.length+1;if(n){r.push({from:i.to,to:s.to},{from:i.from,insert:s.text+t.lineBreak});for(let l of i.ranges)o.push(H.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:i.from},{from:i.to,insert:t.lineBreak+s.text});for(let l of i.ranges)o.push(H.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:H.create(o,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const SD=({state:t,dispatch:e})=>Vv(t,e,!1),AD=({state:t,dispatch:e})=>Vv(t,e,!0);function _v(t,e,n){if(t.readOnly)return!1;let r=[];for(let o of rc(t))n?r.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):r.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const kD=({state:t,dispatch:e})=>_v(t,e,!1),TD=({state:t,dispatch:e})=>_v(t,e,!0),RD=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(rc(e).map(({from:o,to:i})=>(o>0?o--:i<e.doc.length&&i++,{from:o,to:i}))),r=oi(e.selection,o=>{let i;if(t.lineWrapping){let s=t.lineBlockAt(o.head),a=t.coordsAtPos(o.head,o.assoc||1);a&&(i=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(o,!0,i)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function MD(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ht(t).resolveInner(e),r=n.childBefore(e),o=n.childAfter(e),i;return r&&o&&r.to<=e&&o.from>=e&&(i=r.type.prop(we.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}const Sm=zv(!1),ED=zv(!0);function zv(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(o=>{let{from:i,to:s}=o,a=e.doc.lineAt(i),l=!t&&i==s&&MD(e,i);t&&(i=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new Zl(e,{simulateBreak:i,simulateDoubleBreak:!!l}),d=Df(c,i);for(d==null&&(d=ri(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:i,to:s}=l:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let h=["",Xi(e,d)];return l&&h.push(Xi(e,c.lineIndent(a.from,-1))),{changes:{from:i,to:s,insert:ke.of(h)},range:H.cursor(i+1+h[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Bf(t,e){let n=-1;return t.changeByRange(r=>{let o=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,o,r),n=a.number),s=a.to+1}let i=t.changes(o);return{changes:o,range:H.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const ID=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Zl(t,{overrideIndentation:i=>{let s=n[i];return s??-1}}),o=Bf(t,(i,s,a)=>{let l=Df(r,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let c=/^\s*/.exec(i.text)[0],d=Xi(t,l);(c!=d||a.from<i.from+c.length)&&(n[i.from]=l,s.push({from:i.from,to:i.from+c.length,insert:d}))});return o.changes.empty||e(t.update(o,{userEvent:"indent"})),!0},Hv=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Bf(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Ql)})}),{userEvent:"input.indent"})),!0),Pv=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Bf(t,(n,r)=>{let o=/^\s*/.exec(n.text)[0];if(!o)return;let i=ri(o,t.tabSize),s=0,a=Xi(t,Math.max(0,i-il(t)));for(;s<o.length&&s<a.length&&o.charCodeAt(s)==a.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+o.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),jD=t=>(t.setTabFocusMode(),!0),DD=[{key:"Ctrl-b",run:xv,shift:Rv,preventDefault:!0},{key:"Ctrl-f",run:wv,shift:Mv},{key:"Ctrl-p",run:$v,shift:jv},{key:"Ctrl-n",run:Sv,shift:Dv},{key:"Ctrl-a",run:eD,shift:hD},{key:"Ctrl-e",run:tD,shift:fD},{key:"Ctrl-d",run:Nv},{key:"Ctrl-h",run:_u},{key:"Ctrl-k",run:xD},{key:"Ctrl-Alt-h",run:Fv},{key:"Ctrl-o",run:CD},{key:"Ctrl-t",run:$D},{key:"Ctrl-v",run:Vu}],OD=[{key:"ArrowLeft",run:xv,shift:Rv,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qj,shift:oD,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Zj,shift:dD,preventDefault:!0},{key:"ArrowRight",run:wv,shift:Mv,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Uj,shift:iD,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Jj,shift:uD,preventDefault:!0},{key:"ArrowUp",run:$v,shift:jv,preventDefault:!0},{mac:"Cmd-ArrowUp",run:wm,shift:Cm},{mac:"Ctrl-ArrowUp",run:bm,shift:vm},{key:"ArrowDown",run:Sv,shift:Dv,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ym,shift:$m},{mac:"Ctrl-ArrowDown",run:Vu,shift:xm},{key:"PageUp",run:bm,shift:vm},{key:"PageDown",run:Vu,shift:xm},{key:"Home",run:Qj,shift:cD,preventDefault:!0},{key:"Mod-Home",run:wm,shift:Cm},{key:"End",run:Xj,shift:lD,preventDefault:!0},{key:"Mod-End",run:ym,shift:$m},{key:"Enter",run:Sm,shift:Sm},{key:"Mod-a",run:mD},{key:"Backspace",run:_u,shift:_u},{key:"Delete",run:Nv},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Fv},{key:"Mod-Delete",mac:"Alt-Delete",run:vD},{mac:"Mod-Backspace",run:wD},{mac:"Mod-Delete",run:yD}].concat(DD.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),LD=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Gj,shift:sD},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Yj,shift:aD},{key:"Alt-ArrowUp",run:SD},{key:"Shift-Alt-ArrowUp",run:kD},{key:"Alt-ArrowDown",run:AD},{key:"Shift-Alt-ArrowDown",run:TD},{key:"Escape",run:bD},{key:"Mod-Enter",run:ED},{key:"Alt-l",mac:"Ctrl-l",run:gD},{key:"Mod-i",run:pD,preventDefault:!0},{key:"Mod-[",run:Pv},{key:"Mod-]",run:Hv},{key:"Mod-Alt-\\",run:ID},{key:"Shift-Mod-k",run:RD},{key:"Shift-Mod-\\",run:rD},{key:"Mod-/",run:kj},{key:"Alt-A",run:Rj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:jD}].concat(OD),ND={key:"Tab",run:Hv,shift:Pv},Am=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class qo{constructor(e,n,r=0,o=e.length,i,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,o),this.bufferStart=r,this.normalize=i?a=>i(Am(a)):Am,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return xt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=bf(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=un(e);let o=this.normalize(n);if(o.length)for(let i=0,s=r;;i++){let a=o.charCodeAt(i),l=this.match(a,s,this.bufferPos+this.bufferStart);if(i==o.length-1){if(l)return this.value=l,this;break}s==r&&i<n.length&&n.charCodeAt(i)==a&&s++}}}match(e,n,r){let o=null;for(let i=0;i<this.matches.length;i+=2){let s=this.matches[i],a=!1;this.query.charCodeAt(s)==e&&(s==this.query.length-1?o={from:this.matches[i+1],to:r}:(this.matches[i]++,a=!0)),a||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?o={from:n,to:r}:this.matches.push(1,n)),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(qo.prototype[Symbol.iterator]=function(){return this});const Wv={from:-1,to:-1,match:/.*/.exec("")},Ff="gm"+(/x/.unicode==null?"":"u");class qv{constructor(e,n,r,o=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=Wv,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Uv(e,n,r,o,i);this.re=new RegExp(n,Ff+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let s=e.lineAt(o);this.curLineStart=s.from,this.matchPos=cl(e,o),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,o=r+n[0].length;if(this.matchPos=cl(this.text,o+(r==o?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<o||r>this.value.to)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const ld=new WeakMap;class Ro{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let o=ld.get(e);if(!o||o.from>=r||o.to<=n){let a=new Ro(n,e.sliceString(n,r));return ld.set(e,a),a}if(o.from==n&&o.to==r)return o;let{text:i,from:s}=o;return s>n&&(i=e.sliceString(n,s)+i,s=n),o.to<r&&(i+=e.sliceString(o.to,r)),ld.set(e,new Ro(s,i)),new Ro(n,i.slice(n-s,r-s))}}class Uv{constructor(e,n,r,o,i){this.text=e,this.to=i,this.done=!1,this.value=Wv,this.matchPos=cl(e,o),this.re=new RegExp(n,Ff+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Ro.get(e,o,this.chunkEnd(o+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,o=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,match:n},this.matchPos=cl(this.text,o+(r==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ro.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(qv.prototype[Symbol.iterator]=Uv.prototype[Symbol.iterator]=function(){return this});function BD(t){try{return new RegExp(t,Ff),!0}catch{return!1}}function cl(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function zu(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Me("input",{class:"cm-textfield",name:"line",value:e}),r=Me("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:Di.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),o())},onsubmit:i=>{i.preventDefault(),o()}},Me("label",t.state.phrase("Go to line"),": ",n)," ",Me("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),Me("button",{name:"close",onclick:()=>{t.dispatch({effects:Di.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function o(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!i)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,d,h]=i,f=d?+d.slice(1):0,m=c?+c:a.number;if(c&&h){let v=m/100;l&&(v=v*(l=="-"?-1:1)+a.number/s.doc.lines),m=Math.round(s.doc.lines*v)}else c&&l&&(m=m*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,m))),b=H.cursor(p.from+Math.max(0,Math.min(f,p.length)));t.dispatch({effects:[Di.of(!1),Q.scrollIntoView(b.from,{y:"center"})],selection:b}),t.focus()}return{dom:r}}const Di=me.define(),km=tt.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(Di)&&(t=n.value);return t},provide:t=>Yi.from(t,e=>e?zu:null)}),FD=t=>{let e=Gi(t,zu);if(!e){let n=[Di.of(!0)];t.state.field(km,!1)==null&&n.push(me.appendConfig.of([km,VD])),t.dispatch({effects:n}),e=Gi(t,zu)}return e&&e.dom.querySelector("input").select(),!0},VD=Q.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),_D={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zD=ne.define({combine(t){return En(t,_D,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function HD(t){return[KD,UD]}const PD=ae.mark({class:"cm-selectionMatch"}),WD=ae.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Tm(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Le.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Le.Word)}function qD(t,e,n,r){return t(e.sliceDoc(n,n+1))==Le.Word&&t(e.sliceDoc(r-1,r))==Le.Word}const UD=We.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(zD),{state:n}=t,r=n.selection;if(r.ranges.length>1)return ae.none;let o=r.main,i,s=null;if(o.empty){if(!e.highlightWordAroundCursor)return ae.none;let l=n.wordAt(o.head);if(!l)return ae.none;s=n.charCategorizer(o.head),i=n.sliceDoc(l.from,l.to)}else{let l=o.to-o.from;if(l<e.minSelectionLength||l>200)return ae.none;if(e.wholeWords){if(i=n.sliceDoc(o.from,o.to),s=n.charCategorizer(o.head),!(Tm(s,n,o.from,o.to)&&qD(s,n,o.from,o.to)))return ae.none}else if(i=n.sliceDoc(o.from,o.to),!i)return ae.none}let a=[];for(let l of t.visibleRanges){let c=new qo(n.doc,i,l.from,l.to);for(;!c.next().done;){let{from:d,to:h}=c.value;if((!s||Tm(s,n,d,h))&&(o.empty&&d<=o.from&&h>=o.to?a.push(WD.range(d,h)):(d>=o.to||h<=o.from)&&a.push(PD.range(d,h)),a.length>e.maxMatches))return ae.none}}return ae.set(a)}},{decorations:t=>t.decorations}),KD=Q.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GD=({state:t,dispatch:e})=>{let{selection:n}=t,r=H.create(n.ranges.map(o=>t.wordAt(o.head)||H.cursor(o.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function YD(t,e){let{main:n,ranges:r}=t.selection,o=t.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let s=!1,a=new qo(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new qo(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(i){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const XD=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return GD({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=r))return!1;let o=YD(t,r);return o?(e(t.update({selection:t.selection.addRange(H.range(o.from,o.to),!1),effects:Q.scrollIntoView(o.to)})),!0):!1},ii=ne.define({combine(t){return En(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new lO(e),scrollToMatch:e=>Q.scrollIntoView(e)})}});class Kv{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||BD(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
64
|
+
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new eO(this):new ZD(this)}getCursor(e,n=0,r){let o=e.doc?e:$e.create({doc:e});return r==null&&(r=o.doc.length),this.regexp?mo(this,o,n,r):fo(this,o,n,r)}}class Gv{constructor(e){this.spec=e}}function fo(t,e,n,r){return new qo(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:o=>o.toLowerCase(),t.wholeWord?QD(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function QD(t,e){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=t.sliceString(i,Math.min(t.length,r+2))),(e(dl(o,n-i))!=Le.Word||e(ul(o,n-i))!=Le.Word)&&(e(ul(o,r-i))!=Le.Word||e(dl(o,r-i))!=Le.Word))}class ZD extends Gv{constructor(e){super(e)}nextMatch(e,n,r){let o=fo(this.spec,e,r,e.doc.length).nextOverlapping();if(o.done){let i=Math.min(e.doc.length,n+this.spec.unquoted.length);o=fo(this.spec,e,0,i).nextOverlapping()}return o.done||o.value.from==n&&o.value.to==r?null:o.value}prevMatchInRange(e,n,r){for(let o=r;;){let i=Math.max(n,o-1e4-this.spec.unquoted.length),s=fo(this.spec,e,i,o),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(i==n)return null;o-=1e4}}prevMatch(e,n,r){let o=this.prevMatchInRange(e,0,n);return o||(o=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),o&&(o.from!=n||o.to!=r)?o:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=fo(this.spec,e,0,e.doc.length),o=[];for(;!r.next().done;){if(o.length>=n)return null;o.push(r.value)}return o}highlight(e,n,r,o){let i=fo(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}function mo(t,e,n,r){return new qv(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?JD(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function dl(t,e){return t.slice(st(t,e,!1),e)}function ul(t,e){return t.slice(e,st(t,e))}function JD(t){return(e,n,r)=>!r[0].length||(t(dl(r.input,r.index))!=Le.Word||t(ul(r.input,r.index))!=Le.Word)&&(t(ul(r.input,r.index+r[0].length))!=Le.Word||t(dl(r.input,r.index+r[0].length))!=Le.Word)}class eO extends Gv{nextMatch(e,n,r){let o=mo(this.spec,e,r,e.doc.length).next();return o.done&&(o=mo(this.spec,e,0,n).next()),o.done?null:o.value}prevMatchInRange(e,n,r){for(let o=1;;o++){let i=Math.max(n,r-o*1e4),s=mo(this.spec,e,i,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(i==n||a.from>i+10))return a;if(i==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let o=r.length;o>0;o--){let i=+r.slice(0,o);if(i>0&&i<e.match.length)return e.match[i]+r.slice(o)}return n})}matchAll(e,n){let r=mo(this.spec,e,0,e.doc.length),o=[];for(;!r.next().done;){if(o.length>=n)return null;o.push(r.value)}return o}highlight(e,n,r,o){let i=mo(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}const Qi=me.define(),Vf=me.define(),ar=tt.define({create(t){return new cd(Hu(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Qi)?t=new cd(n.value.create(),t.panel):n.is(Vf)&&(t=new cd(t.query,n.value?_f:null));return t},provide:t=>Yi.from(t,e=>e.panel)});class cd{constructor(e,n){this.query=e,this.panel=n}}const tO=ae.mark({class:"cm-searchMatch"}),nO=ae.mark({class:"cm-searchMatch cm-searchMatch-selected"}),rO=We.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ar))}update(t){let e=t.state.field(ar);(e!=t.startState.field(ar)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ae.none;let{view:n}=this,r=new qn;for(let o=0,i=n.visibleRanges,s=i.length;o<s;o++){let{from:a,to:l}=i[o];for(;o<s-1&&l>i[o+1].from-2*250;)l=i[++o].to;t.highlight(n.state,a,l,(c,d)=>{let h=n.state.selection.ranges.some(f=>f.from==c&&f.to==d);r.add(c,d,h?nO:tO)})}return r.finish()}},{decorations:t=>t.decorations});function ys(t){return e=>{let n=e.state.field(ar,!1);return n&&n.query.spec.valid?t(e,n):Qv(e)}}const hl=ys((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let o=H.single(r.from,r.to),i=t.state.facet(ii);return t.dispatch({selection:o,effects:[zf(t,r),i.scrollToMatch(o.main,t)],userEvent:"select.search"}),Xv(t),!0}),fl=ys((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,o=e.prevMatch(n,r,r);if(!o)return!1;let i=H.single(o.from,o.to),s=t.state.facet(ii);return t.dispatch({selection:i,effects:[zf(t,o),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),Xv(t),!0}),oO=ys((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:H.create(n.map(r=>H.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),iO=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],s=0;for(let a=new qo(t.doc,t.sliceDoc(r,o));!a.next().done;){if(i.length>1e3)return!1;a.value.from==r&&(s=i.length),i.push(H.range(a.value.from,a.value.to))}return e(t.update({selection:H.create(i,s),userEvent:"select.search.matches"})),!0},Rm=ys((t,{query:e})=>{let{state:n}=t,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=e.nextMatch(n,r,r);if(!i)return!1;let s=i,a=[],l,c,d=[];s.from==r&&s.to==o&&(c=n.toText(e.getReplacement(s)),a.push({from:s.from,to:s.to,insert:c}),s=e.nextMatch(n,s.from,s.to),d.push(Q.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let h=t.state.changes(a);return s&&(l=H.single(s.from,s.to).map(h),d.push(zf(t,s)),d.push(n.facet(ii).scrollToMatch(l.main,t))),t.dispatch({changes:h,selection:l,effects:d,userEvent:"input.replace"}),!0}),sO=ys((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(o=>{let{from:i,to:s}=o;return{from:i,to:s,insert:e.getReplacement(o)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Q.announce.of(r),userEvent:"input.replace.all"}),!0});function _f(t){return t.state.facet(ii).createPanel(t)}function Hu(t,e){var n,r,o,i,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(ii);return new Kv({search:((n=e?.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(o=e?.literal)!==null&&o!==void 0?o:c.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:c.regexp,wholeWord:(s=e?.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function Yv(t){let e=Gi(t,_f);return e&&e.dom.querySelector("[main-field]")}function Xv(t){let e=Yv(t);e&&e==t.root.activeElement&&e.select()}const Qv=t=>{let e=t.state.field(ar,!1);if(e&&e.panel){let n=Yv(t);if(n&&n!=t.root.activeElement){let r=Hu(t.state,e.query.spec);r.valid&&t.dispatch({effects:Qi.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[Vf.of(!0),e?Qi.of(Hu(t.state,e.query.spec)):me.appendConfig.of(dO)]});return!0},Zv=t=>{let e=t.state.field(ar,!1);if(!e||!e.panel)return!1;let n=Gi(t,_f);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Vf.of(!1)}),!0},aO=[{key:"Mod-f",run:Qv,scope:"editor search-panel"},{key:"F3",run:hl,shift:fl,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:hl,shift:fl,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Zv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:iO},{key:"Mod-Alt-g",run:FD},{key:"Mod-d",run:XD,preventDefault:!0}];class lO{constructor(e){this.view=e;let n=this.query=e.state.field(ar).query.spec;this.commit=this.commit.bind(this),this.searchField=Me("input",{value:n.search,placeholder:Et(e,"Find"),"aria-label":Et(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Me("input",{value:n.replace,placeholder:Et(e,"Replace"),"aria-label":Et(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Me("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Me("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Me("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(o,i,s){return Me("button",{class:"cm-button",name:o,onclick:i,type:"button"},s)}this.dom=Me("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,r("next",()=>hl(e),[Et(e,"next")]),r("prev",()=>fl(e),[Et(e,"previous")]),r("select",()=>oO(e),[Et(e,"all")]),Me("label",null,[this.caseField,Et(e,"match case")]),Me("label",null,[this.reField,Et(e,"regexp")]),Me("label",null,[this.wordField,Et(e,"by word")]),...e.state.readOnly?[]:[Me("br"),this.replaceField,r("replace",()=>Rm(e),[Et(e,"replace")]),r("replaceAll",()=>sO(e),[Et(e,"replace all")])],Me("button",{name:"close",onclick:()=>Zv(e),"aria-label":Et(e,"close"),type:"button"},["×"])])}commit(){let e=new Kv({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Qi.of(e)}))}keydown(e){kE(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?fl:hl)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Rm(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Qi)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ii).top}}function Et(t,e){return t.state.phrase(e)}const da=30,ua=/[\s\.,:;?!]/;function zf(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),o=t.state.doc.lineAt(n).to,i=Math.max(r.from,e-da),s=Math.min(o,n+da),a=t.state.sliceDoc(i,s);if(i!=r.from){for(let l=0;l<da;l++)if(!ua.test(a[l+1])&&ua.test(a[l])){a=a.slice(l);break}}if(s!=o){for(let l=a.length-1;l>a.length-da;l--)if(!ua.test(a[l-1])&&ua.test(a[l])){a=a.slice(0,l);break}}return Q.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const cO=Q.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),dO=[ar,to.low(rO),cO];class Jv{constructor(e,n,r,o){this.state=e,this.pos=n,this.explicit=r,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ht(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),o=n.text.slice(r-n.from,this.pos-n.from),i=o.search(ex(e,!1));return i<0?null:{from:r+i,to:this.pos,text:o.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function Mm(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function uO(t){let e=Object.create(null),n=Object.create(null);for(let{label:o}of t){e[o[0]]=!0;for(let i=1;i<o.length;i++)n[o[i]]=!0}let r=Mm(e)+Mm(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function hO(t){let e=t.map(o=>typeof o=="string"?{label:o}:o),[n,r]=e.every(o=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:uO(e);return o=>{let i=o.matchBefore(r);return i||o.explicit?{from:i?i.from:o.pos,options:e,validFor:n}:null}}let Em=class{constructor(e,n,r,o){this.completion=e,this.source=n,this.match=r,this.score=o}};function Lr(t){return t.selection.main.from}function ex(t,e){var n;let{source:r}=t,o=e&&r[0]!="^",i=r[r.length-1]!="$";return!o&&!i?t:new RegExp(`${o?"^":""}(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const tx=Mn.define();function fO(t,e,n,r){let{main:o}=t.selection,i=n-o.from,s=r-o.from;return Object.assign(Object.assign({},t.changeByRange(a=>{if(a!=o&&n!=r&&t.sliceDoc(a.from+i,a.from+s)!=t.sliceDoc(n,r))return{range:a};let l=t.toText(e);return{changes:{from:a.from+i,to:r==o.from?a.to:a.from+s,insert:l},range:H.cursor(a.from+i+l.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Im=new WeakMap;function mO(t){if(!Array.isArray(t))return t;let e=Im.get(t);return e||Im.set(t,e=hO(t)),e}const ml=me.define(),Zi=me.define();class gO{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=xt(e,n),o=un(r);this.chars.push(r);let i=e.slice(n,n+o),s=i.toUpperCase();this.folded.push(xt(s==i?i.toLowerCase():s,0)),n+=o}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:o,precise:i,byWord:s}=this;if(n.length==1){let y=xt(e,0),$=un(y),S=$==e.length?0:-100;if(y!=n[0])if(y==r[0])S+=-200;else return null;return this.ret(S,[0,$])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(a<0){for(let y=0,$=Math.min(e.length,200);y<$&&c<l;){let S=xt(e,y);(S==n[c]||S==r[c])&&(o[c++]=y),y+=un(S)}if(c<l)return null}let d=0,h=0,f=!1,m=0,p=-1,b=-1,v=/[a-z]/.test(e),x=!0;for(let y=0,$=Math.min(e.length,200),S=0;y<$&&h<l;){let A=xt(e,y);a<0&&(d<l&&A==n[d]&&(i[d++]=y),m<l&&(A==n[m]||A==r[m]?(m==0&&(p=y),b=y+1,m++):m=0));let k,T=A<255?A>=48&&A<=57||A>=97&&A<=122?2:A>=65&&A<=90?1:0:(k=bf(A))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!y||T==1&&v||S==0&&T!=0)&&(n[h]==A||r[h]==A&&(f=!0)?s[h++]=y:s.length&&(x=!1)),S=T,y+=un(A)}return h==l&&s[0]==0&&x?this.result(-100+(f?-200:0),s,e):m==l&&p==0?this.ret(-200-e.length+(b==e.length?0:-100),[0,b]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):m==l?this.ret(-900-e.length,[p,b]):h==l?this.result(-100+(f?-200:0)+-700+(x?0:-1100),s,e):n.length==2?null:this.result((o[0]?-700:0)+-200+-1100,o,e)}result(e,n,r){let o=[],i=0;for(let s of n){let a=s+(this.astral?un(xt(r,s)):1);i&&o[i-1]==s?o[i-1]=a:(o[i++]=s,o[i++]=a)}return this.ret(e-r.length,o)}}class pO{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Je=ne.define({combine(t){return En(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:bO,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>jm(e(r),n(r)),optionClass:(e,n)=>r=>jm(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function jm(t,e){return t?e?t+" "+e:t:e}function bO(t,e,n,r,o,i){let s=t.textDirection==Oe.RTL,a=s,l=!1,c="top",d,h,f=e.left-o.left,m=o.right-e.right,p=r.right-r.left,b=r.bottom-r.top;if(a&&f<Math.min(p,m)?a=!1:!a&&m<Math.min(p,f)&&(a=!0),p<=(a?f:m))d=Math.max(o.top,Math.min(n.top,o.bottom-b))-e.top,h=Math.min(400,a?f:m);else{l=!0,h=Math.min(400,(s?e.right:o.right-e.left)-30);let y=o.bottom-e.bottom;y>=b||y>e.top?d=n.bottom-e.top:(c="bottom",d=e.bottom-n.top)}let v=(e.bottom-e.top)/i.offsetHeight,x=(e.right-e.left)/i.offsetWidth;return{style:`${c}: ${d/v}px; max-width: ${h/x}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function vO(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(o=>"cm-completionIcon-"+o)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,o,i){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;c<i.length;){let d=i[c++],h=i[c++];d>l&&s.appendChild(document.createTextNode(a.slice(l,d)));let f=s.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(a.slice(d,h))),f.className="cm-completionMatchedText",l=h}return l<a.length&&s.appendChild(document.createTextNode(a.slice(l))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function dd(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let o=Math.floor(e/n);return{from:o*n,to:(o+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class xO{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let o=e.state.field(n),{options:i,selected:s}=o.open,a=e.state.facet(Je);this.optionContent=vO(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=dd(i.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let d=l.target,h;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(h=/-(\d+)$/.exec(d.id))&&+h[1]<c.length){this.applyCompletion(e,c[+h[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Je).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Zi.of(null)})}),this.showOptions(i,o.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=o){let{options:i,selected:s,disabled:a}=r.open;(!o.open||o.open.options!=i)&&(this.range=dd(i.length,s,e.state.facet(Je).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),a!=((n=o.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=dd(n.options.length,n.selected,this.view.state.facet(Je).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:o}=r;if(!o)return;let i=typeof o=="string"?document.createTextNode(o):o(r);if(!i)return;"then"in i?i.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>Ct(this.view.state,s,"completion info")):this.addInfoPane(i,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:o,destroy:i}=e;r.appendChild(o),this.infoDestroy=i||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,o=this.range.from;r;r=r.nextSibling,o++)r.nodeName!="LI"||!r.id?o--:o==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&yO(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),i=this.space;if(!i){let s=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return o.top>Math.min(i.bottom,n.bottom)-10||o.bottom<Math.max(i.top,n.top)+10?null:this.view.state.facet(Je).positionInfo(this.view,n,o,r,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const o=document.createElement("ul");o.id=n,o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-label",this.view.state.phrase("Completions")),o.addEventListener("mousedown",s=>{s.target==o&&s.preventDefault()});let i=null;for(let s=r.from;s<r.to;s++){let{completion:a,match:l}=e[s],{section:c}=a;if(c){let f=typeof c=="string"?c:c.name;if(f!=i&&(s>r.from||r.from==0))if(i=f,typeof c!="string"&&c.header)o.appendChild(c.header(c));else{let m=o.appendChild(document.createElement("completion-section"));m.textContent=f}}const d=o.appendChild(document.createElement("li"));d.id=n+"-"+s,d.setAttribute("role","option");let h=this.optionClass(a);h&&(d.className=h);for(let f of this.optionContent){let m=f(a,this.view.state,this.view,l);m&&d.appendChild(m)}}return r.from&&o.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&o.classList.add("cm-completionListIncompleteBottom"),o}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function wO(t,e){return n=>new xO(n,t,e)}function yO(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/o:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/o)}function Dm(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function CO(t,e){let n=[],r=null,o=c=>{n.push(c);let{section:d}=c.completion;if(d){r||(r=[]);let h=typeof d=="string"?d:d.name;r.some(f=>f.name==h)||r.push(typeof d=="string"?{name:h}:d)}},i=e.facet(Je);for(let c of t)if(c.hasResult()){let d=c.result.getMatch;if(c.result.filter===!1)for(let h of c.result.options)o(new Em(h,c.source,d?d(h):[],1e9-n.length));else{let h=e.sliceDoc(c.from,c.to),f,m=i.filterStrict?new pO(h):new gO(h);for(let p of c.result.options)if(f=m.match(p.label)){let b=p.displayLabel?d?d(p,f.matched):[]:f.matched;o(new Em(p,c.source,b,f.score+(p.boost||0)))}}}if(r){let c=Object.create(null),d=0,h=(f,m)=>{var p,b;return((p=f.rank)!==null&&p!==void 0?p:1e9)-((b=m.rank)!==null&&b!==void 0?b:1e9)||(f.name<m.name?-1:1)};for(let f of r.sort(h))d-=1e5,c[f.name]=d;for(let f of n){let{section:m}=f.completion;m&&(f.score+=c[typeof m=="string"?m:m.name])}}let s=[],a=null,l=i.compareCompletions;for(let c of n.sort((d,h)=>h.score-d.score||l(d.completion,h.completion))){let d=c.completion;!a||a.label!=d.label||a.detail!=d.detail||a.type!=null&&d.type!=null&&a.type!=d.type||a.apply!=d.apply||a.boost!=d.boost?s.push(c):Dm(c.completion)>Dm(a)&&(s[s.length-1]=c),a=c.completion}return s}class vo{constructor(e,n,r,o,i,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=o,this.selected=i,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new vo(this.options,Om(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,o,i,s){if(o&&!s&&e.some(c=>c.isPending))return o.setDisabled();let a=CO(e,n);if(!a.length)return o&&e.some(c=>c.isPending)?o.setDisabled():null;let l=n.facet(Je).selectOnOpen?0:-1;if(o&&o.selected!=l&&o.selected!=-1){let c=o.options[o.selected].completion;for(let d=0;d<a.length;d++)if(a[d].completion==c){l=d;break}}return new vo(a,Om(r,l),{pos:e.reduce((c,d)=>d.hasResult()?Math.min(c,d.from):c,1e8),create:RO,above:i.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new vo(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new vo(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class gl{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new gl(kO,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Je),i=(r.override||n.languageDataAt("autocomplete",Lr(n)).map(mO)).map(l=>(this.active.find(d=>d.source==l)||new Bt(l,this.active.some(d=>d.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((l,c)=>l==this.active[c])&&(i=this.active);let s=this.open,a=e.effects.some(l=>l.is(Hf));s&&e.docChanged&&(s=s.map(e.changes)),e.selection||i.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!$O(i,this.active)||a?s=vo.build(i,n,this.id,s,r,a):s&&s.disabled&&!i.some(l=>l.isPending)&&(s=null),!s&&i.every(l=>!l.isPending)&&i.some(l=>l.hasResult())&&(i=i.map(l=>l.hasResult()?new Bt(l.source,0):l));for(let l of e.effects)l.is(rx)&&(s=s&&s.setSelected(l.value,this.id));return i==this.active&&s==this.open?this:new gl(i,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?SO:AO}}function $O(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let o=n==t.length,i=r==e.length;if(o||i)return o==i;if(t[n++].result!=e[r++].result)return!1}}const SO={"aria-autocomplete":"list"},AO={};function Om(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const kO=[];function nx(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(tx);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Bt{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=nx(e,n),o=this;(r&8||r&16&&this.touches(e))&&(o=new Bt(o.source,0)),r&4&&o.state==0&&(o=new Bt(this.source,1)),o=o.updateFor(e,r);for(let i of e.effects)if(i.is(ml))o=new Bt(o.source,1,i.value);else if(i.is(Zi))o=new Bt(o.source,0);else if(i.is(Hf))for(let s of i.value)s.source==o.source&&(o=s);return o}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Lr(e.state))}}class Mo extends Bt{constructor(e,n,r,o,i,s){super(e,3,n),this.limit=r,this.result=o,this.from=i,this.to=s}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let i=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=Lr(e.state);if(a>s||!o||n&2&&(Lr(e.startState)==this.from||a<this.limit))return new Bt(this.source,n&4?1:0);let l=e.changes.mapPos(this.limit);return TO(o.validFor,e.state,i,s)?new Mo(this.source,this.explicit,l,o,i,s):o.update&&(o=o.update(o,i,s,new Jv(e.state,a,!1)))?new Mo(this.source,this.explicit,l,o,o.from,(r=o.to)!==null&&r!==void 0?r:Lr(e.state)):new Bt(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Mo(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Bt(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function TO(t,e,n,r){if(!t)return!1;let o=e.sliceDoc(n,r);return typeof t=="function"?t(o,n,r,e):ex(t,!0).test(o)}const Hf=me.define({map(t,e){return t.map(n=>n.map(e))}}),rx=me.define(),yt=tt.define({create(){return gl.start()},update(t,e){return t.update(e)},provide:t=>[jf.from(t,e=>e.tooltip),Q.contentAttributes.from(t,e=>e.attrs)]});function Pf(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(yt).active.find(o=>o.source==e.source);return r instanceof Mo?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},fO(t.state,n,r.from,r.to)),{annotations:tx.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const RO=wO(yt,Pf);function ha(t,e="option"){return n=>{let r=n.state.field(yt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Je).interactionDelay)return!1;let o=1,i;e=="page"&&(i=U5(n,r.open.tooltip))&&(o=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+o*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:rx.of(a)}),!0}}const MO=t=>{let e=t.state.field(yt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Je).interactionDelay?!1:Pf(t,e.open.options[e.open.selected])},Lm=t=>t.state.field(yt,!1)?(t.dispatch({effects:ml.of(!0)}),!0):!1,EO=t=>{let e=t.state.field(yt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:Zi.of(null)}),!0)};class IO{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const jO=50,DO=1e3,OO=We.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(yt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(yt),n=t.state.facet(Je);if(!t.selectionSet&&!t.docChanged&&t.startState.field(yt)==e)return;let r=t.transactions.some(i=>{let s=nx(i,n);return s&8||(i.selection||i.docChanged)&&!(s&3)});for(let i=0;i<this.running.length;i++){let s=this.running[i];if(r||s.context.abortOnDocChange&&t.docChanged||s.updates.length+t.transactions.length>jO&&Date.now()-s.time>DO){for(let a of s.context.abortListeners)try{a()}catch(l){Ct(this.view.state,l)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(s=>s.is(ml)))&&(this.pendingStart=!0);let o=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.isPending&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),o):-1,this.composing!=0)for(let i of t.transactions)i.isUserEvent("input.type")?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(yt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Je).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=Lr(e),r=new Jv(e,n,t.explicit,this.view),o=new IO(t,r);this.running.push(o),Promise.resolve(t.source(r)).then(i=>{o.context.aborted||(o.done=i||null,this.scheduleAccept())},i=>{this.view.dispatch({effects:Zi.of(null)}),Ct(this.view.state,i)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Je).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Je),r=this.view.state.field(yt);for(let o=0;o<this.running.length;o++){let i=this.running[o];if(i.done===void 0)continue;if(this.running.splice(o--,1),i.done){let a=Lr(i.updates.length?i.updates[0].startState:this.view.state),l=Math.min(a,i.done.from+(i.active.explicit?0:1)),c=new Mo(i.active.source,i.active.explicit,l,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:a);for(let d of i.updates)c=c.update(d,n);if(c.hasResult()){e.push(c);continue}}let s=r.active.find(a=>a.source==i.active.source);if(s&&s.isPending)if(i.done==null){let a=new Bt(i.active.source,0);for(let l of i.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(s)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Hf.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(yt,!1);if(e&&e.tooltip&&this.view.state.facet(Je).closeOnBlur){let n=e.open&&U5(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Zi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ml.of(!1)}),20),this.composing=0}}}),LO=typeof navigator=="object"&&/Win/.test(navigator.platform),NO=to.highest(Q.domEventHandlers({keydown(t,e){let n=e.state.field(yt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(LO&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],o=n.active.find(s=>s.source==r.source),i=r.completion.commitCharacters||o.result.commitCharacters;return i&&i.indexOf(t.key)>-1&&Pf(e,r),!1}})),BO=Q.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Ji={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ir=me.define({map(t,e){let n=e.mapPos(t,-1,gt.TrackAfter);return n??void 0}}),Wf=new class extends Hr{};Wf.startSide=1;Wf.endSide=-1;const ox=tt.define({create(){return Ae.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Ir)&&(t=t.update({add:[Wf.range(n.value,n.value+1)]}));return t}});function FO(){return[_O,ox]}const ud="()[]{}<>«»»«[]{}";function ix(t){for(let e=0;e<ud.length;e+=2)if(ud.charCodeAt(e)==t)return ud.charAt(e+1);return bf(t<128?t:t+1)}function sx(t,e){return t.languageDataAt("closeBrackets",e)[0]||Ji}const VO=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),_O=Q.inputHandler.of((t,e,n,r)=>{if((VO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let o=t.state.selection.main;if(r.length>2||r.length==2&&un(xt(r,0))==1||e!=o.from||n!=o.to)return!1;let i=PO(t.state,r);return i?(t.dispatch(i),!0):!1}),zO=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=sx(t,t.selection.main.head).brackets||Ji.brackets,o=null,i=t.changeByRange(s=>{if(s.empty){let a=WO(t.doc,s.head);for(let l of r)if(l==a&&oc(t.doc,s.head)==ix(xt(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:H.cursor(s.head-l.length)}}return{range:o=s}});return o||e(t.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!o},HO=[{key:"Backspace",run:zO}];function PO(t,e){let n=sx(t,t.selection.main.head),r=n.brackets||Ji.brackets;for(let o of r){let i=ix(xt(o,0));if(e==o)return i==o?KO(t,o,r.indexOf(o+o+o)>-1,n):qO(t,o,i,n.before||Ji.before);if(e==i&&ax(t,t.selection.main.from))return UO(t,o,i)}return null}function ax(t,e){let n=!1;return t.field(ox).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function oc(t,e){let n=t.sliceString(e,e+2);return n.slice(0,un(xt(n,0)))}function WO(t,e){let n=t.sliceString(e-2,e);return un(xt(n,0))==n.length?n:n.slice(1)}function qO(t,e,n,r){let o=null,i=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:Ir.of(s.to+e.length),range:H.range(s.anchor+e.length,s.head+e.length)};let a=oc(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:Ir.of(s.head+e.length),range:H.cursor(s.head+e.length)}:{range:o=s}});return o?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function UO(t,e,n){let r=null,o=t.changeByRange(i=>i.empty&&oc(t.doc,i.head)==n?{changes:{from:i.head,to:i.head+n.length,insert:n},range:H.cursor(i.head+n.length)}:r={range:i});return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function KO(t,e,n,r){let o=r.stringPrefixes||Ji.stringPrefixes,i=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Ir.of(a.to+e.length),range:H.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=oc(t.doc,l),d;if(c==e){if(Nm(t,l))return{changes:{insert:e+e,from:l},effects:Ir.of(l+e.length),range:H.cursor(l+e.length)};if(ax(t,l)){let f=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:H.cursor(l+f.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(d=Bm(t,l-2*e.length,o))>-1&&Nm(t,d))return{changes:{insert:e+e+e+e,from:l},effects:Ir.of(l+e.length),range:H.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=Le.Word&&Bm(t,l,o)>-1&&!GO(t,l,e,o))return{changes:{insert:e+e,from:l},effects:Ir.of(l+e.length),range:H.cursor(l+e.length)}}return{range:i=a}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Nm(t,e){let n=ht(t).resolveInner(e+1);return n.parent&&n.from==e}function GO(t,e,n,r){let o=ht(t).resolveInner(e,-1),i=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(o.from,Math.min(o.to,o.from+n.length+i)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let d=o.firstChild;for(;d&&d.from==o.from&&d.to-d.from>n.length+l;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let c=o.to==e&&o.parent;if(!c)break;o=c}return!1}function Bm(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Le.Word)return e;for(let o of n){let i=e-o.length;if(t.sliceDoc(i,e)==o&&r(t.sliceDoc(i-1,i))!=Le.Word)return i}return-1}function YO(t={}){return[NO,yt,Je.of(t),OO,XO,BO]}const lx=[{key:"Ctrl-Space",run:Lm},{mac:"Alt-`",run:Lm},{key:"Escape",run:EO},{key:"ArrowDown",run:ha(!0)},{key:"ArrowUp",run:ha(!1)},{key:"PageDown",run:ha(!0,"page")},{key:"PageUp",run:ha(!1,"page")},{key:"Enter",run:MO}],XO=to.highest(Yl.computeN([Je],t=>t.facet(Je).defaultKeymap?[lx]:[]));class Fm{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Mr{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let o=r.facet(es).markerFilter;o&&(e=o(e,r));let i=e.slice().sort((d,h)=>d.from-h.from||d.to-h.to),s=new qn,a=[],l=0;for(let d=0;;){let h=d==i.length?null:i[d];if(!h&&!a.length)break;let f,m;for(a.length?(f=l,m=a.reduce((b,v)=>Math.min(b,v.to),h&&h.from>f?h.from:1e8)):(f=h.from,m=h.to,a.push(h),d++);d<i.length;){let b=i[d];if(b.from==f&&(b.to>b.from||b.to==f))a.push(b),d++,m=Math.min(b.to,m);else{m=Math.min(b.from,m);break}}let p=cL(a);if(a.some(b=>b.from==b.to||b.from==b.to-1&&r.doc.lineAt(b.from).to==b.from))s.add(f,f,ae.widget({widget:new iL(p),diagnostics:a.slice()}));else{let b=a.reduce((v,x)=>x.markClass?v+" "+x.markClass:v,"");s.add(f,m,ae.mark({class:"cm-lintRange cm-lintRange-"+p+b,diagnostics:a.slice(),inclusiveEnd:a.some(v=>v.to>m)}))}l=m;for(let b=0;b<a.length;b++)a[b].to<=l&&a.splice(b--,1)}let c=s.finish();return new Mr(c,n,Uo(c))}}function Uo(t,e=null,n=0){let r=null;return t.between(n,1e9,(o,i,{spec:s})=>{if(!(e&&s.diagnostics.indexOf(e)<0))if(!r)r=new Fm(o,i,e||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new Fm(r.from,i,r.diagnostic)}}),r}function QO(t,e){let n=e.pos,r=e.end||n,o=t.state.facet(es).hideOn(t,n,r);if(o!=null)return o;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(cx))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function ZO(t,e){return t.field(Ot,!1)?e:e.concat(me.appendConfig.of(dL))}const cx=me.define(),qf=me.define(),dx=me.define(),Ot=tt.define({create(){return new Mr(ae.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,o=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=Uo(n,t.selected.diagnostic,i)||Uo(n,null,i)}!n.size&&o&&e.state.facet(es).autoPanel&&(o=null),t=new Mr(n,o,r)}for(let n of e.effects)if(n.is(cx)){let r=e.state.facet(es).autoPanel?n.value.length?ts.open:null:t.panel;t=Mr.init(n.value,r,e.state)}else n.is(qf)?t=new Mr(t.diagnostics,n.value?ts.open:null,t.selected):n.is(dx)&&(t=new Mr(t.diagnostics,t.panel,n.value));return t},provide:t=>[Yi.from(t,e=>e.panel),Q.decorations.from(t,e=>e.diagnostics)]}),JO=ae.mark({class:"cm-lintRange cm-lintRange-active"});function eL(t,e,n){let{diagnostics:r}=t.state.field(Ot),o,i=-1,s=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:d})=>{if(e>=l&&e<=c&&(l==c||(e>l||n>0)&&(e<c||n<0)))return o=d.diagnostics,i=l,s=c,!1});let a=t.state.facet(es).tooltipFilter;return o&&a&&(o=a(o,t.state)),o?{pos:i,end:s,above:t.state.doc.lineAt(i).to<s,create(){return{dom:tL(t,o)}}}:null}function tL(t,e){return Me("ul",{class:"cm-tooltip-lint"},e.map(n=>hx(t,n,!1)))}const nL=t=>{let e=t.state.field(Ot,!1);(!e||!e.panel)&&t.dispatch({effects:ZO(t.state,[qf.of(!0)])});let n=Gi(t,ts.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Vm=t=>{let e=t.state.field(Ot,!1);return!e||!e.panel?!1:(t.dispatch({effects:qf.of(!1)}),!0)},rL=t=>{let e=t.state.field(Ot,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},oL=[{key:"Mod-Shift-m",run:nL,preventDefault:!0},{key:"F8",run:rL}],es=ne.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},En(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function ux(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let o=n[r];if(/[a-zA-Z]/.test(o)&&!e.some(i=>i.toLowerCase()==o.toLowerCase())){e.push(o);continue e}}e.push("")}return e}function hx(t,e,n){var r;let o=n?ux(e.actions):[];return Me("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Me("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((i,s)=>{let a=!1,l=f=>{if(f.preventDefault(),a)return;a=!0;let m=Uo(t.state.field(Ot).diagnostics,e);m&&i.apply(t,m.from,m.to)},{name:c}=i,d=o[s]?c.indexOf(o[s]):-1,h=d<0?c:[c.slice(0,d),Me("u",c.slice(d,d+1)),c.slice(d+1)];return Me("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${d<0?"":` (access key "${o[s]})"`}.`},h)}),e.source&&Me("div",{class:"cm-diagnosticSource"},e.source))}class iL extends Qn{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Me("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class _m{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=hx(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ts{constructor(e){this.view=e,this.items=[];let n=o=>{if(o.keyCode==27)Vm(this.view),this.view.focus();else if(o.keyCode==38||o.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(o.keyCode==40||o.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(o.keyCode==36)this.moveSelection(0);else if(o.keyCode==35)this.moveSelection(this.items.length-1);else if(o.keyCode==13)this.view.focus();else if(o.keyCode>=65&&o.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],s=ux(i.actions);for(let a=0;a<s.length;a++)if(s[a].toUpperCase().charCodeAt(0)==o.keyCode){let l=Uo(this.view.state.field(Ot).diagnostics,i);l&&i.actions[a].apply(e,l.from,l.to)}}else return;o.preventDefault()},r=o=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(o.target)&&this.moveSelection(i)};this.list=Me("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Me("div",{class:"cm-panel-lint"},this.list,Me("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Vm(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ot).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(Ot),r=0,o=!1,i=null,s=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let d of c.diagnostics){if(s.has(d))continue;s.add(d);let h=-1,f;for(let m=r;m<this.items.length;m++)if(this.items[m].diagnostic==d){h=m;break}h<0?(f=new _m(this.view,d),this.items.splice(r,0,f),o=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),o=!0)),n&&f.diagnostic==n.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),i=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();this.items.length==0&&(this.items.push(new _m(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Ot),r=Uo(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:dx.of(r)})}static open(e){return new ts(e)}}function sL(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function fa(t){return sL(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const aL=Q.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:fa("#d11")},".cm-lintRange-warning":{backgroundImage:fa("orange")},".cm-lintRange-info":{backgroundImage:fa("#999")},".cm-lintRange-hint":{backgroundImage:fa("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function lL(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function cL(t){let e="hint",n=1;for(let r of t){let o=lL(r.severity);o>n&&(n=o,e=r.severity)}return e}const dL=[Ot,Q.decorations.compute([Ot],t=>{let{selected:e,panel:n}=t.field(Ot);return!e||!n||e.from==e.to?ae.none:ae.set([JO.range(e.from,e.to)])}),mI(eL,{hideOn:QO}),aL];var zm=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(HO)),e.defaultKeymap!==!1&&(r=r.concat(LD)),e.searchKeymap!==!1&&(r=r.concat(aO)),e.historyKeymap!==!1&&(r=r.concat(Wj)),e.foldKeymap!==!1&&(r=r.concat(JI)),e.completionKeymap!==!1&&(r=r.concat(lx)),e.lintKeymap!==!1&&(r=r.concat(oL));var o=[];return e.lineNumbers!==!1&&o.push(AI()),e.highlightActiveLineGutter!==!1&&o.push(RI()),e.highlightSpecialChars!==!1&&o.push(PE()),e.history!==!1&&o.push(Lj()),e.foldGutter!==!1&&o.push(rj()),e.drawSelection!==!1&&o.push(jE()),e.dropCursor!==!1&&o.push(BE()),e.allowMultipleSelections!==!1&&o.push($e.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(PI()),e.syntaxHighlighting!==!1&&o.push(lv(aj,{fallback:!0})),e.bracketMatching!==!1&&o.push(mj()),e.closeBrackets!==!1&&o.push(FO()),e.autocompletion!==!1&&o.push(YO()),e.rectangularSelection!==!1&&o.push(rI()),n!==!1&&o.push(sI()),e.highlightActiveLine!==!1&&o.push(YE()),e.highlightSelectionMatches!==!1&&o.push(HD()),e.tabSize&&typeof e.tabSize=="number"&&o.push(Ql.of(" ".repeat(e.tabSize))),o.concat([Yl.of(r.flat())]).filter(Boolean)};const uL="#e5c07b",Hm="#e06c75",hL="#56b6c2",fL="#ffffff",Ea="#abb2bf",Pu="#7d8799",mL="#61afef",gL="#98c379",Pm="#d19a66",pL="#c678dd",bL="#21252b",Wm="#2c313a",qm="#282c34",hd="#353a42",vL="#3E4451",Um="#528bff",xL=Q.theme({"&":{color:Ea,backgroundColor:qm},".cm-content":{caretColor:Um},".cm-cursor, .cm-dropCursor":{borderLeftColor:Um},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:vL},".cm-panels":{backgroundColor:bL,color:Ea},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:qm,color:Pu,border:"none"},".cm-activeLineGutter":{backgroundColor:Wm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:hd},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:hd,borderBottomColor:hd},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Wm,color:Ea}}},{dark:!0}),wL=xs.define([{tag:N.keyword,color:pL},{tag:[N.name,N.deleted,N.character,N.propertyName,N.macroName],color:Hm},{tag:[N.function(N.variableName),N.labelName],color:mL},{tag:[N.color,N.constant(N.name),N.standard(N.name)],color:Pm},{tag:[N.definition(N.name),N.separator],color:Ea},{tag:[N.typeName,N.className,N.number,N.changed,N.annotation,N.modifier,N.self,N.namespace],color:uL},{tag:[N.operator,N.operatorKeyword,N.url,N.escape,N.regexp,N.link,N.special(N.string)],color:hL},{tag:[N.meta,N.comment],color:Pu},{tag:N.strong,fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.link,color:Pu,textDecoration:"underline"},{tag:N.heading,fontWeight:"bold",color:Hm},{tag:[N.atom,N.bool,N.special(N.variableName)],color:Pm},{tag:[N.processingInstruction,N.string,N.inserted],color:gL},{tag:N.invalid,color:fL}]),yL=[xL,lv(wL)];var CL=Q.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$L=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:o=!1,theme:i="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(Yl.of([ND])),a&&(typeof a=="boolean"?l.unshift(zm()):l.unshift(zm(a))),s&&l.unshift(JE(s)),i){case"light":l.push(CL);break;case"dark":l.push(yL);break;case"none":break;default:l.push(i);break}return r===!1&&l.push(Q.editable.of(!1)),o&&l.push($e.readOnly.of(!0)),[...l]},SL=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),Km=Mn.define(),AL=[];function fx(t){var{value:e,selection:n,onChange:r,onStatistics:o,onCreateEditor:i,onUpdate:s,extensions:a=AL,autoFocus:l,theme:c="light",height:d=null,minHeight:h=null,maxHeight:f=null,width:m=null,minWidth:p=null,maxWidth:b=null,placeholder:v="",editable:x=!0,readOnly:y=!1,indentWithTab:$=!0,basicSetup:S=!0,root:A,initialState:k}=t,[T,I]=g.useState(),[E,j]=g.useState(),[L,D]=g.useState(),z=Q.theme({"&":{height:d,minHeight:h,maxHeight:f,width:m,minWidth:p,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),V=Q.updateListener.of(P=>{if(P.docChanged&&typeof r=="function"&&!P.transactions.some(X=>X.annotation(Km))){var _=P.state.doc,O=_.toString();r(O,P)}o&&o(SL(P))}),W=$L({theme:c,editable:x,readOnly:y,placeholder:v,indentWithTab:$,basicSetup:S}),G=[V,z,...W];return s&&typeof s=="function"&&G.push(Q.updateListener.of(s)),G=G.concat(a),g.useEffect(()=>{if(T&&!L){var P={doc:e,selection:n,extensions:G},_=k?$e.fromJSON(k.json,P,k.fields):$e.create(P);if(D(_),!E){var O=new Q({state:_,parent:T,root:A});j(O),i&&i(O,_)}}return()=>{E&&(D(void 0),j(void 0))}},[T,L]),g.useEffect(()=>I(t.container),[t.container]),g.useEffect(()=>()=>{E&&(E.destroy(),j(void 0))},[E]),g.useEffect(()=>{l&&E&&E.focus()},[l,E]),g.useEffect(()=>{E&&E.dispatch({effects:me.reconfigure.of(G)})},[c,a,d,h,f,m,p,b,v,x,y,$,S,r,s]),g.useEffect(()=>{if(e!==void 0){var P=E?E.state.doc.toString():"";E&&e!==P&&E.dispatch({changes:{from:0,to:P.length,insert:e||""},annotations:[Km.of(!0)]})}},[e,E]),{state:L,setState:D,view:E,setView:j,container:T,setContainer:I}}var kL=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],TL=g.forwardRef((t,e)=>{var{className:n,value:r="",selection:o,extensions:i=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:d,theme:h="light",height:f,minHeight:m,maxHeight:p,width:b,minWidth:v,maxWidth:x,basicSetup:y,placeholder:$,indentWithTab:S,editable:A,readOnly:k,root:T,initialState:I}=t,E=Aj(t,kL),j=g.useRef(null),{state:L,view:D,container:z}=fx({container:j.current,root:T,value:r,autoFocus:d,theme:h,height:f,minHeight:m,maxHeight:p,width:b,minWidth:v,maxWidth:x,basicSetup:y,placeholder:$,indentWithTab:S,editable:A,readOnly:k,selection:o,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:i,initialState:I});if(g.useImperativeHandle(e,()=>({editor:j.current,state:L,view:D}),[j,z,L,D]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var V=typeof h=="string"?"cm-theme-"+h:"cm-theme";return u.jsx("div",F({ref:j,className:""+V+(n?" "+n:"")},E))});TL.displayName="CodeMirror";let fd=new Map,Wu=!1;try{Wu=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let pl=!1;try{pl=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const mx={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class gx{format(e){let n="";if(!Wu&&this.options.signDisplay!=null?n=ML(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!pl){var r;let{unit:o,unitDisplay:i="short",locale:s}=this.resolvedOptions();if(!o)return n;let a=(r=mx[o])===null||r===void 0?void 0:r[i];n+=a[s]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(e),o=this.numberFormatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Wu&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!pl&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=RL(e,n),this.options=n}}function RL(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!pl){var r;let{unit:s,unitDisplay:a="short"}=e;if(!s)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=mx[s])===null||r===void 0)&&r[a]))throw new Error(`Unsupported unit ${s} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let o=t+(e?Object.entries(e).sort((s,a)=>s[0]<a[0]?-1:1).join():"");if(fd.has(o))return fd.get(o);let i=new Intl.NumberFormat(t,e);return fd.set(o,i),i}function ML(t,e,n){if(e==="auto")return t.format(n);if(e==="never")return t.format(Math.abs(n));{let r=!1;if(e==="always"?r=n>0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let o=t.format(-n),i=t.format(n),s=o.replace(i,"").replace(/\u200e|\u061C/,"");return[...s].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),o.replace(i,"!!!").replace(s,"+").replace("!!!",i)}else return t.format(n)}}const EL=new RegExp("^.*\\(.*\\).*$"),IL=["latn","arab","hanidec"];class px{parse(e){return md(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,r){return md(this.locale,this.options,e).isValidPartialNumber(e,n,r)}getNumberingSystem(e){return md(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const Gm=new Map;function md(t,e,n){let r=Ym(t,e);if(!t.includes("-nu-")&&!r.isValidPartialNumber(n)){for(let o of IL)if(o!==r.options.numberingSystem){let i=Ym(t+(t.includes("-u-")?"-nu-":"-u-nu-")+o,e);if(i.isValidPartialNumber(n))return i}}return r}function Ym(t,e){let n=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():""),r=Gm.get(n);return r||(r=new jL(t,e),Gm.set(n,r)),r}class jL{parse(e){let n=this.sanitize(e);if(this.symbols.group&&(n=ma(n,this.symbols.group,"")),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,"-")),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let s=n.indexOf("-");n=n.replace("-","");let a=n.indexOf(".");a===-1&&(a=n.length),n=n.replace(".",""),a-2===0?n=`0.${n}`:a-2===-1?n=`0.0${n}`:a-2===-2?n="0.00":n=`${n.slice(0,a-2)}.${n.slice(a-2)}`,s>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style==="percent"){var o,i;let s={...this.options,style:"decimal",minimumFractionDigits:Math.min(((o=this.options.minimumFractionDigits)!==null&&o!==void 0?o:0)+2,20),maximumFractionDigits:Math.min(((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)+2,20)};return new px(this.locale,s).parse(new gx(this.locale,s).format(r))}return this.options.currencySign==="accounting"&&EL.test(e)&&(r=-1*r),r}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=ma(e,".",this.symbols.group))),this.options.locale==="fr-FR"&&(e=ma(e,"."," ")),e}isValidPartialNumber(e,n=-1/0,r=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&r>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=ma(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=OL(e,this.formatter,this.options,n);var r,o;this.options.style==="percent"&&(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)>18||((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const Xm=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),DL=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function OL(t,e,n,r){var o,i,s,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21}),c=l.formatToParts(-10000.111),d=l.formatToParts(10000.111),h=DL.map(j=>l.formatToParts(j));var f;let m=(f=(o=c.find(j=>j.type==="minusSign"))===null||o===void 0?void 0:o.value)!==null&&f!==void 0?f:"-",p=(i=d.find(j=>j.type==="plusSign"))===null||i===void 0?void 0:i.value;!p&&(r?.signDisplay==="exceptZero"||r?.signDisplay==="always")&&(p="+");let v=(s=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(j=>j.type==="decimal"))===null||s===void 0?void 0:s.value,x=(a=c.find(j=>j.type==="group"))===null||a===void 0?void 0:a.value,y=c.filter(j=>!Xm.has(j.type)).map(j=>Qm(j.value)),$=h.flatMap(j=>j.filter(L=>!Xm.has(L.type)).map(L=>Qm(L.value))),S=[...new Set([...y,...$])].sort((j,L)=>L.length-j.length),A=S.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${S.join("|")}|[\\p{White_Space}]`,"gu"),k=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),T=new Map(k.map((j,L)=>[j,L])),I=new RegExp(`[${k.join("")}]`,"g");return{minusSign:m,plusSign:p,decimal:v,group:x,literals:A,numeral:I,index:j=>String(T.get(j))}}function ma(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function Qm(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const bx="Popover",[vx,IW]=qe(bx,[br]),xx=br(),[jW,si]=vx(bx),LL="PopoverTrigger",NL=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=si(LL,n),i=xx(n),s=le(e,o.triggerRef),a=g.createElement(ie.button,F({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Cx(o.open)},r,{ref:s,onClick:U(t.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:g.createElement(as,F({asChild:!0},i),a)}),wx="PopoverPortal",[BL,FL]=vx(wx,{forceMount:void 0}),VL=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=si(wx,e);return g.createElement(BL,{scope:e,forceMount:n},g.createElement(Qe,{present:n||i.open},g.createElement(Zo,{asChild:!0,container:o},r)))},ns="PopoverContent",_L=g.forwardRef((t,e)=>{const n=FL(ns,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=si(ns,t.__scopePopover);return g.createElement(Qe,{present:r||i.open},i.modal?g.createElement(zL,F({},o,{ref:e})):g.createElement(HL,F({},o,{ref:e})))}),zL=g.forwardRef((t,e)=>{const n=si(ns,t.__scopePopover),r=g.useRef(null),o=le(e,r),i=g.useRef(!1);return g.useEffect(()=>{const s=r.current;if(s)return af(s)},[]),g.createElement(_l,{as:yn,allowPinchZoom:!0},g.createElement(yx,F({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:U(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:U(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:U(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),HL=g.forwardRef((t,e)=>{const n=si(ns,t.__scopePopover),r=g.useRef(!1),o=g.useRef(!1);return g.createElement(yx,F({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),yx=g.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...h}=t,f=si(ns,n),m=xx(n);return Jo(),g.createElement(ei,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},g.createElement(Xr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},g.createElement(ls,F({"data-state":Cx(f.open),role:"dialog",id:f.contentId},m,h,{ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function Cx(t){return t?"open":"closed"}const PL=NL,WL=VL,qL=_L,$x="Progress",ic=100,[UL,DW]=qe($x),[KL,GL]=UL($x),Sx=g.forwardRef((t,e)=>{const{__scopeProgress:n,value:r,max:o,getValueLabel:i=QL,...s}=t,a=qu(o)?o:ic,l=kx(r,a)?r:null,c=bl(l)?i(l,a):void 0;return g.createElement(KL,{scope:n,value:l,max:a},g.createElement(ie.div,F({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":bl(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":Ax(l,a),"data-value":l??void 0,"data-max":a},s,{ref:e})))});Sx.propTypes={max(t,e,n){const r=t[e],o=String(r);return r&&!qu(r)?new Error(ZL(o,n)):null},value(t,e,n){const r=t[e],o=String(r),i=qu(t.max)?t.max:ic;return r!=null&&!kx(r,i)?new Error(JL(o,n)):null}};const YL="ProgressIndicator",XL=g.forwardRef((t,e)=>{var n;const{__scopeProgress:r,...o}=t,i=GL(YL,r);return g.createElement(ie.div,F({"data-state":Ax(i.value,i.max),"data-value":(n=i.value)!==null&&n!==void 0?n:void 0,"data-max":i.max},o,{ref:e}))});function QL(t,e){return`${Math.round(t/e*100)}%`}function Ax(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function bl(t){return typeof t=="number"}function qu(t){return bl(t)&&!isNaN(t)&&t>0}function kx(t,e){return bl(t)&&!isNaN(t)&&t<=e&&t>=0}function ZL(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ic}\`.`}function JL(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
|
|
65
65
|
- a positive number
|
|
66
66
|
- less than the value passed to \`max\` (or ${ic} if no \`max\` prop is set)
|
|
67
67
|
- \`null\` if the progress is indeterminate.
|
|
68
68
|
|
|
69
|
-
Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(Tx),iN=g.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=t,[d,h]=g.useState(null),f=le(e,
|
|
69
|
+
Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(Tx),iN=g.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=t,[d,h]=g.useState(null),f=le(e,b=>h(b)),m=g.useRef(!1),p=d?!!d.closest("form"):!0;return g.createElement(rN,{scope:n,checked:o,disabled:s},g.createElement(ie.button,F({type:"button",role:"radio","aria-checked":o,"data-state":Mx(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:f,onClick:U(t.onClick,b=>{o||l?.(),p&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})),p&&g.createElement(lN,{control:d,bubbles:!m.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),sN="RadioIndicator",aN=g.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...o}=t,i=oN(sN,n);return g.createElement(Qe,{present:r||i.checked},g.createElement(ie.span,F({"data-state":Mx(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:e})))}),lN=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=g.useRef(null),s=Dl(n),a=kl(e);return g.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const f=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(f)}},[s,n,r]),g.createElement("input",F({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Mx(t){return t?"checked":"unchecked"}const cN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ex="RadioGroup",[dN,OW]=qe(Ex,[ni,Rx]),Ix=ni(),jx=Rx(),[uN,hN]=dN(Ex),fN=g.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:h,...f}=t,m=Ix(n),p=Qr(c),[b,v]=it({prop:i,defaultProp:o,onChange:h});return g.createElement(uN,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:v},g.createElement(of,F({asChild:!0},m,{orientation:l,dir:p,loop:d}),g.createElement(ie.div,F({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:p},f,{ref:e}))))}),mN="RadioGroupItem",gN=g.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...o}=t,i=hN(mN,n),s=i.disabled||r,a=Ix(n),l=jx(n),c=g.useRef(null),d=le(e,c),h=i.value===o.value,f=g.useRef(!1);return g.useEffect(()=>{const m=b=>{cN.includes(b.key)&&(f.current=!0)},p=()=>f.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",p)}},[]),g.createElement(sf,F({asChild:!0},a,{focusable:!s,active:h}),g.createElement(iN,F({disabled:s,required:i.required,checked:h},l,o,{name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:U(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:U(o.onFocus,()=>{var m;f.current&&((m=c.current)===null||m===void 0||m.click())})})))}),pN=g.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,o=jx(n);return g.createElement(aN,F({},o,r,{ref:e}))}),bN=fN,vN=gN,xN=pN,Dx="Switch",[wN,LW]=qe(Dx),[yN,CN]=wN(Dx),$N=g.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=t,[h,f]=g.useState(null),m=le(e,y=>f(y)),p=g.useRef(!1),b=h?!!h.closest("form"):!0,[v=!1,x]=it({prop:o,defaultProp:i,onChange:c});return g.createElement(yN,{scope:n,checked:v,disabled:a},g.createElement(ie.button,F({type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":Ox(v),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:m,onClick:U(t.onClick,y=>{x($=>!$),b&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),b&&g.createElement(kN,{control:h,bubbles:!p.current,name:r,value:l,checked:v,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),SN="SwitchThumb",AN=g.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,o=CN(SN,n);return g.createElement(ie.span,F({"data-state":Ox(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:e}))}),kN=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=g.useRef(null),s=Dl(n),a=kl(e);return g.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const f=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(f)}},[s,n,r]),g.createElement("input",F({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Ox(t){return t?"checked":"unchecked"}const TN=$N,RN=AN,Lx="Tabs",[MN,NW]=qe(Lx,[ni]),Nx=ni(),[EN,Uf]=MN(Lx),IN=g.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=t,d=Qr(a),[h,f]=it({prop:r,onChange:o,defaultProp:i});return g.createElement(EN,{scope:n,baseId:at(),value:h,onValueChange:f,orientation:s,dir:d,activationMode:l},g.createElement(ie.div,F({dir:d,"data-orientation":s},c,{ref:e})))}),jN="TabsList",DN=g.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,i=Uf(jN,n),s=Nx(n);return g.createElement(of,F({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),g.createElement(ie.div,F({role:"tablist","aria-orientation":i.orientation},o,{ref:e})))}),ON="TabsTrigger",LN=g.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=t,s=Uf(ON,n),a=Nx(n),l=Bx(s.baseId,r),c=Fx(s.baseId,r),d=r===s.value;return g.createElement(sf,F({asChild:!0},a,{focusable:!o,active:d}),g.createElement(ie.button,F({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:e,onMouseDown:U(t.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:U(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:U(t.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})))}),NN="TabsContent",BN=g.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=t,a=Uf(NN,n),l=Bx(a.baseId,r),c=Fx(a.baseId,r),d=r===a.value,h=g.useRef(d);return g.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),g.createElement(Qe,{present:o||d},({present:f})=>g.createElement(ie.div,F({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0},s,{ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0}}),f&&i))});function Bx(t,e){return`${t}-trigger-${e}`}function Fx(t,e){return`${t}-content-${e}`}const FN=IN,VN=DN,_N=LN,zN=BN,Cs=(t,e)=>{const n=w.createContext(e),r=i=>{const{children:s,...a}=i,l=w.useMemo(()=>a,Object.values(a));return u.jsx(n.Provider,{value:l,children:s})};function o(i){const s=w.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 HN(t,e){return typeof t=="string"?!1:e in t}function Ia(t,e,n){return t&&e&&HN(t,e)?t[e]:n}const Zm={padding:["padding-block-start","padding-inline-end","padding-block-end","padding-inline-start"],paddingTop:"padding-block-start",paddingRight:"padding-inline-end",paddingBottom:"padding-block-end",paddingLeft:"padding-inline-start",margin:["margin-block-start","margin-inline-end","margin-block-end","margin-inline-start"],marginLeft:"margin-inline-start",marginRight:"margin-inline-end",marginTop:"margin-block-start",marginBottom:"margin-block-end",borderRadius:"border-radius",borderStyle:"border-style",borderWidth:"border-width",borderColor:"border-color",fontSize:"font-size",fontWeight:"font-weight",lineHeight:"line-height",zIndex:"z-index",boxShadow:"box-shadow",pointerEvents:"pointer-events",textAlign:"text-align",textTransform:"text-transform",textDecoration:"text-decoration",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexBasis:"flex-basis",minWidth:"min-width",maxWidth:"max-width",minHeight:"min-height",maxHeight:"max-height",flexDirection:"flex-direction",flexWrap:"flex-wrap",justifyContent:"justify-content",alignItems:"align-items"},PN=t=>{const[e,n,r,o]=t,i=n??e;return[e,i,r??e,o??i]};function WN(t,e){switch(t){case"gap":case"padding":case"margin":case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":case"marginTop":case"marginLeft":case"marginRight":case"marginBottom":case"left":case"right":case"top":case"bottom":case"width":case"maxWidth":case"minWidth":case"height":case"maxHeight":case"minHeight":case"borderRadius":case"borderWidth":return e.spaces;case"color":case"background":case"borderColor":return e.colors;case"fontSize":return e.fontSizes;case"fontWeight":return e.fontWeights;case"lineHeight":return e.lineHeights;case"zIndex":return e.zIndices;case"boxShadow":return e.shadows;default:return null}}const sc=(t,e)=>{const n=Object.entries(t).reduce((r,o)=>{const[i,s]=o,a=WN(i,e),l=Object.prototype.hasOwnProperty.call(Zm,i)?Zm[i]:i;return l&&(s||s===0)&&(typeof s=="object"&&!Array.isArray(s)?Object.entries(s).forEach(([c,d])=>{r[c]={...r[c],...Jm(l,d,a)}}):r.initial={...r.initial,...Jm(l,s,a)}),r},{initial:{},small:{},medium:{},large:{}});return Object.entries(n).reduce((r,[o,i])=>{if(i&&Object.keys(i).length>0){const s=Object.entries(i).reduce((a,[l,c])=>(a.push(`${l}: ${c};`),a),[]).join(`
|
|
70
70
|
`);o==="initial"?r.push(s):r.push(`${e.breakpoints[o]}{ ${s} }`)}return r},[]).join(`
|
|
71
|
-
`)},Jm=(t,e,n)=>{if(Array.isArray(t)&&Array.isArray(e)){const r=PN(e);return t.reduce((o,i,s)=>(o[i]=Ia(n,r[s],r[s]),o),{})}else return Array.isArray(t)&&!Array.isArray(e)?t.reduce((r,o)=>(r[o]=Ia(n,e,e),r),{}):!Array.isArray(t)&&!Array.isArray(e)?{[t]:Ia(n,e,e)}:(console.warn("You've passed an array of values to a property that does not support it. Please check the property and value you're passing."),{})},vt=w.forwardRef,Z=vt((t,e)=>{const{background:n,basis:r,borderColor:o,color:i,flex:s,fontSize:a,grow:l,hasRadius:c,padding:d,paddingBottom:h,paddingLeft:f,paddingRight:m,paddingTop:
|
|
71
|
+
`)},Jm=(t,e,n)=>{if(Array.isArray(t)&&Array.isArray(e)){const r=PN(e);return t.reduce((o,i,s)=>(o[i]=Ia(n,r[s],r[s]),o),{})}else return Array.isArray(t)&&!Array.isArray(e)?t.reduce((r,o)=>(r[o]=Ia(n,e,e),r),{}):!Array.isArray(t)&&!Array.isArray(e)?{[t]:Ia(n,e,e)}:(console.warn("You've passed an array of values to a property that does not support it. Please check the property and value you're passing."),{})},vt=w.forwardRef,Z=vt((t,e)=>{const{background:n,basis:r,borderColor:o,color:i,flex:s,fontSize:a,grow:l,hasRadius:c,padding:d,paddingBottom:h,paddingLeft:f,paddingRight:m,paddingTop:p,margin:b,marginLeft:v,marginBottom:x,marginRight:y,marginTop:$,shadow:S,shrink:A,lineHeight:k,fontWeight:T,width:I,minWidth:E,maxWidth:j,height:L,minHeight:D,maxHeight:z,top:V,left:W,bottom:G,right:P,borderRadius:_,borderStyle:O,borderWidth:X,tag:J,pointerEvents:fe,display:se,position:pe,zIndex:be,overflow:Se,cursor:re,transition:xe,transform:ge,animation:ve,textAlign:he,textTransform:ce,...je}=t,Te=J||"div",ye={$background:n,$basis:r,$borderColor:o,$color:i,$flex:s,$fontSize:a,$grow:l,$hasRadius:c,$padding:d,$paddingBottom:h,$paddingLeft:f,$paddingRight:m,$paddingTop:p,$margin:b,$marginLeft:v,$marginBottom:x,$marginRight:y,$marginTop:$,$shadow:S,$shrink:A,$lineHeight:k,$fontWeight:T,$width:I,$minWidth:E,$maxWidth:j,$height:L,$minHeight:D,$maxHeight:z,$top:V,$left:W,$bottom:G,$right:P,$borderRadius:_,$borderStyle:O,$borderWidth:X,$pointerEvents:fe,$display:se,$position:pe,$zIndex:be,$overflow:Se,$cursor:re,$transition:xe,$transform:ge,$animation:ve,$textAlign:he,$textTransform:ce};return u.jsx(qN,{as:Te,ref:e,...ye,...je})}),qN=C.styled.div`
|
|
72
72
|
${({theme:t,...e})=>sc({padding:e.$padding,paddingTop:e.$paddingTop,paddingBottom:e.$paddingBottom,paddingLeft:e.$paddingLeft,paddingRight:e.$paddingRight,margin:e.$margin,marginTop:e.$marginTop,marginBottom:e.$marginBottom,marginLeft:e.$marginLeft,marginRight:e.$marginRight,top:e.$top,left:e.$left,bottom:e.$bottom,right:e.$right,width:e.$width,minWidth:e.$minWidth,maxWidth:e.$maxWidth,height:e.$height,minHeight:e.$minHeight,maxHeight:e.$maxHeight,color:e.$color,background:e.$background,fontSize:e.$fontSize,fontWeight:e.$fontWeight,lineHeight:e.$lineHeight,borderRadius:e.$hasRadius?t.borderRadius:e.$borderRadius,borderStyle:e.$borderColor&&!e.$borderStyle?"solid":e.$borderStyle,borderWidth:e.$borderColor&&!e.$borderWidth?"1px":e.$borderWidth,borderColor:e.$borderColor,zIndex:e.$zIndex,boxShadow:e.$shadow,display:e.$display,pointerEvents:e.$pointerEvents,cursor:e.$cursor,textAlign:e.$textAlign,textTransform:e.$textTransform,transition:e.$transition,transform:e.$transform,animation:e.$animation,position:e.$position,overflow:e.$overflow,flex:e.$flex,flexShrink:e.$shrink,flexGrow:e.$grow,flexBasis:e.$basis},t)};
|
|
73
73
|
`,q=vt((t,e)=>{const{className:n,alignItems:r,direction:o,inline:i,gap:s,justifyContent:a,wrap:l,...c}=t,d={$alignItems:r,$direction:o,$gap:s,$justifyContent:a,$wrap:l,$inline:i};return u.jsx(UN,{className:n,ref:e,...d,...c})}),UN=C.styled(Z)`
|
|
74
74
|
${({theme:t,$display:e="flex",$alignItems:n="center",$direction:r="row",...o})=>sc({gap:o.$gap,alignItems:n,justifyContent:o.$justifyContent,flexWrap:o.$wrap,flexDirection:r,display:o.$inline?"inline-flex":e},t)};
|
|
@@ -436,7 +436,7 @@ Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(
|
|
|
436
436
|
to {
|
|
437
437
|
opacity: 0;
|
|
438
438
|
}
|
|
439
|
-
`},rs=32,tg=2;w.forwardRef(({onLoadingStatusChange:t,delayMs:e=600,src:n,alt:r,fallback:o,preview:i=!1,...s},a)=>{const[l,c]=xn({onChange:t}),[d,h]=w.useState(!1),f=i&&l==="loaded",m=
|
|
439
|
+
`},rs=32,tg=2;w.forwardRef(({onLoadingStatusChange:t,delayMs:e=600,src:n,alt:r,fallback:o,preview:i=!1,...s},a)=>{const[l,c]=xn({onChange:t}),[d,h]=w.useState(!1),f=i&&l==="loaded",m=p=>{f&&h(p)};return u.jsxs(pp,{onOpenChange:m,children:[u.jsx(bp,{asChild:!0,children:u.jsxs(Yu,{ref:a,...s,children:[f?u.jsx(CB,{width:"100%",height:"100%",position:"absolute",background:"neutral0",zIndex:"overlay",style:{opacity:d?.4:0}}):null,u.jsx($B,{src:n,alt:r,onLoadingStatusChange:c}),u.jsx(W9,{delayMs:e,children:u.jsx(K,{fontWeight:"bold",textTransform:"uppercase",children:o})})]})}),f?u.jsx(vp,{children:u.jsx(SB,{side:"top",sideOffset:4,children:u.jsx(AB,{src:n,alt:r})})}):null]})});const qx=C.css`
|
|
440
440
|
display: inline-flex;
|
|
441
441
|
align-items: center;
|
|
442
442
|
justify-content: center;
|
|
@@ -780,7 +780,7 @@ Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(
|
|
|
780
780
|
&[data-state='open'] {
|
|
781
781
|
background-color: ${({theme:t})=>t.colors.primary100};
|
|
782
782
|
}
|
|
783
|
-
`;w.forwardRef((t,e)=>u.jsx(_2,{children:u.jsx(yk,{sideOffset:8,asChild:!0,children:u.jsx(ow,{ref:e,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",overflow:"auto",...t})})}));const eF=UB,tF=KB,nF=GB,rF=w.forwardRef(({children:t,onOpen:e,onClose:n,popoverPlacement:r,onReachEnd:o,...i},s)=>{const a=w.useRef(null),l=At(s,a),c=w.useRef(null),[d,h]=w.useState(!1),f=v=>{o&&o(v)},m=v=>{v&&typeof e=="function"?e():!v&&typeof n=="function"&&n(),h(v)},
|
|
783
|
+
`;w.forwardRef((t,e)=>u.jsx(_2,{children:u.jsx(yk,{sideOffset:8,asChild:!0,children:u.jsx(ow,{ref:e,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",overflow:"auto",...t})})}));const eF=UB,tF=KB,nF=GB,rF=w.forwardRef(({children:t,onOpen:e,onClose:n,popoverPlacement:r,onReachEnd:o,...i},s)=>{const a=w.useRef(null),l=At(s,a),c=w.useRef(null),[d,h]=w.useState(!1),f=v=>{o&&o(v)},m=v=>{v&&typeof e=="function"?e():!v&&typeof n=="function"&&n(),h(v)},p=on(),b=`intersection-${Go(p)}`;return Ss(c,f,{selectorToWatch:`#${b}`,skipWhen:!d}),u.jsxs(eF,{onOpenChange:m,children:[u.jsx(tF,{ref:l,...i,children:i.label}),u.jsx(nF,{ref:c,intersectionId:b,popoverPlacement:r,children:t})]})}),oF=C.styled(rF)`
|
|
784
784
|
padding: ${({theme:t})=>`${t.spaces[1]} ${t.spaces[2]}`};
|
|
785
785
|
height: unset;
|
|
786
786
|
|
|
@@ -881,7 +881,7 @@ Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(
|
|
|
881
881
|
&:hover svg path {
|
|
882
882
|
fill: ${({theme:t})=>t.colors.neutral900};
|
|
883
883
|
}
|
|
884
|
-
`,gF=w.forwardRef(({actions:t,children:e,label:n,nextLabel:r,onNext:o,onPrevious:i,previousLabel:s,secondaryLabel:a,selectedSlide:l,...c},d)=>{const h=w.useRef(null),f=w.useRef(null),m=w.Children.map(e,(
|
|
884
|
+
`,gF=w.forwardRef(({actions:t,children:e,label:n,nextLabel:r,onNext:o,onPrevious:i,previousLabel:s,secondaryLabel:a,selectedSlide:l,...c},d)=>{const h=w.useRef(null),f=w.useRef(null),m=w.Children.map(e,(b,v)=>w.cloneElement(b,{selected:v===l})),p=b=>{switch(b.key){case lt.RIGHT:{b.preventDefault(),f?.current&&f.current.focus(),o&&o();break}case lt.LEFT:{b.preventDefault(),h?.current&&h.current.focus(),i&&i();break}}};return u.jsx(Z,{ref:d,...c,onKeyDown:p,children:u.jsxs(Z,{padding:2,borderColor:"neutral200",hasRadius:!0,background:"neutral100",children:[u.jsxs(fF,{tag:"section","aria-roledescription":"carousel","aria-label":n,display:"grid",position:"relative",children:[m&&m.length>1&&u.jsxs(u.Fragment,{children:[u.jsx(og,{tag:"button",onClick:i,$area:"startAction",ref:h,type:"button",children:u.jsx(Ko,{label:s,children:u.jsx(f2,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})}),u.jsx(og,{tag:"button",onClick:o,$area:"endAction",ref:f,type:"button",children:u.jsx(Ko,{label:r,children:u.jsx(Jh,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})})]}),u.jsx(mF,{"aria-live":"polite",paddingLeft:2,paddingRight:2,width:"100%",overflow:"hidden",children:m}),t]}),a&&u.jsx(Z,{paddingTop:2,paddingLeft:4,paddingRight:4,children:u.jsx(Qf,{label:a,children:u.jsx(q,{justifyContent:"center",children:u.jsx(K,{variant:"pi",textColor:"neutral600",ellipsis:!0,children:a})})})})]})})}),pF={accordions:{S:"4.8rem",M:"8.8rem"},button:{S:"3.2rem",M:"3.6rem",L:"4rem"}},bF={sizes:pF,zIndices:{navigation:100,overlay:300,modal:310,dialog:320,popover:500,notification:700,tooltip:1e3},spaces:["0px","4px","8px","12px","16px","20px","24px","32px","40px","48px","56px","64px"],borderRadius:"4px",breakpoints:{initial:"@media(min-width: 0px)",small:"@media(min-width: 520px)",medium:"@media(min-width: 768px)",large:"@media(min-width: 1080px)"},fontSizes:["1.1rem","1.2rem","1.4rem","1.6rem","1.8rem","3.2rem"],lineHeights:[1.14,1.22,1.25,1.33,1.43,1.45,1.5],fontWeights:{regular:400,semiBold:500,bold:600},transitions:yB,motion:{easings:Ku,timings:Gu}},vF={color:{alternative100:"#f6ecfc",alternative200:"#e0c1f4",alternative500:"#ac73e6",alternative600:"#9736e8",alternative700:"#8312d1",buttonNeutral0:"#ffffff",buttonPrimary500:"#7b79ff",buttonPrimary600:"#4945ff",danger100:"#fcecea",danger200:"#f5c0b8",danger500:"#ee5e52",danger600:"#d02b20",danger700:"#b72b1a",neutral0:"#ffffff",neutral100:"#f6f6f9",neutral1000:"#181826",neutral150:"#eaeaef",neutral200:"#dcdce4",neutral300:"#c0c0cf",neutral400:"#a5a5ba",neutral500:"#8e8ea9",neutral600:"#666687",neutral700:"#4a4a6a",neutral800:"#32324d",neutral900:"#212134",primary100:"#f0f0ff",primary200:"#d9d8ff",primary500:"#7b79ff",primary600:"#4945ff",primary700:"#271fe0",secondary100:"#eaf5ff",secondary200:"#b8e1ff",secondary500:"#66b7f1",secondary600:"#0c75af",secondary700:"#006096",success100:"#eafbe7",success200:"#c6f0c2",success500:"#5cb176",success600:"#328048",success700:"#2f6846",warning100:"#fdf4dc",warning200:"#fae7b9",warning500:"#f29d41",warning600:"#d9822f",warning700:"#be5d01"}},xF={shadow:{filterShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)",focus:"inset 2px 0px 0px rgb(39, 31, 224), inset 0px 2px 0px rgb(39, 31, 224), inset -2px 0px 0px rgb(39, 31, 224), inset 0px -2px 0px rgb(39, 31, 224)",focusShadow:"0px 0px 6px rgba(76, 191, 255, 0.75)",popupShadow:"0px 2px 15px rgba(33, 33, 52, 0.1)",tableShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)"}},wF={colors:vF.color,shadows:xF.shadow,...bF},$r=(t="&")=>({theme:e,$hasError:n=!1})=>C.css`
|
|
885
885
|
outline: none;
|
|
886
886
|
box-shadow: none;
|
|
887
887
|
transition-property: border-color, box-shadow, fill;
|
|
@@ -896,7 +896,7 @@ Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(
|
|
|
896
896
|
`,$F=C.styled(q)`
|
|
897
897
|
line-height: 0;
|
|
898
898
|
color: ${({theme:t})=>t.colors.neutral500};
|
|
899
|
-
`,dc=w.forwardRef(({endAction:t,startAction:e,disabled:n=!1,onChange:r,hasError:o,required:i,className:s,size:a="M",...l},c)=>{const{id:d,error:h,hint:f,name:m,required:
|
|
899
|
+
`,dc=w.forwardRef(({endAction:t,startAction:e,disabled:n=!1,onChange:r,hasError:o,required:i,className:s,size:a="M",...l},c)=>{const{id:d,error:h,hint:f,name:m,required:p}=kt("Input");let b;h?b=`${d}-error`:f&&(b=`${d}-hint`);const v=!!h,x=w.useRef(null),y=w.useRef(null),$=At(y,c),S=A=>{!n&&r&&r(A)};return w.useLayoutEffect(()=>{if(x.current&&y.current){const A=x.current.offsetWidth,k=y.current;if(k){const T=A+8+16;k.style.paddingRight=`${T}px`}}},[t]),u.jsxs(kF,{gap:2,justifyContent:"space-between",$hasError:v||o,$disabled:n,$size:a,$hasLeftAction:!!e,$hasRightAction:!!t,className:s,children:[e,u.jsx(SF,{id:d,name:m,ref:$,$size:a,"aria-describedby":b,"aria-invalid":v||o,"aria-disabled":n,disabled:n,"data-disabled":n?"":void 0,onChange:S,"aria-required":p||i,$hasLeftAction:!!e,$hasRightAction:!!t,...l}),t&&u.jsx(AF,{ref:x,children:t})]})}),SF=C.styled.input`
|
|
900
900
|
border: none;
|
|
901
901
|
border-radius: ${({theme:t})=>t.borderRadius};
|
|
902
902
|
cursor: ${t=>t["aria-disabled"]?"not-allowed":void 0};
|
|
@@ -953,7 +953,7 @@ Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(
|
|
|
953
953
|
`,lw=()=>{const{id:t,hint:e,error:n}=kt("Hint");return!e||n?null:u.jsx(K,{variant:"pi",tag:"p",id:`${t}-hint`,textColor:"neutral600",children:e})},cw=()=>{const{id:t,error:e}=kt("Error");return!e||typeof e!="string"?null:u.jsx(K,{variant:"pi",tag:"p",id:`${t}-error`,textColor:"danger600","data-strapi-field-error":!0,children:e})},TF=w.forwardRef(({label:t,children:e,...n},r)=>u.jsx(RF,{justifyContent:"unset",background:"transparent",borderStyle:"none",...n,type:"button",tag:"button",ref:r,children:u.jsx(Ko,{label:t,children:e})})),RF=C.styled(q)`
|
|
954
954
|
font-size: 1.6rem;
|
|
955
955
|
padding: 0;
|
|
956
|
-
`,MF=Object.freeze(Object.defineProperty({__proto__:null,Action:TF,Error:cw,Hint:lw,Input:dc,Label:Zf,Root:Gr,useField:kt},Symbol.toStringTag,{value:"Module"}));w.forwardRef(({actions:t,children:e,error:n,hint:r,label:o,labelAction:i,nextLabel:s,onNext:a,onPrevious:l,previousLabel:c,required:d,secondaryLabel:h,selectedSlide:f,id:m,...
|
|
956
|
+
`,MF=Object.freeze(Object.defineProperty({__proto__:null,Action:TF,Error:cw,Hint:lw,Input:dc,Label:Zf,Root:Gr,useField:kt},Symbol.toStringTag,{value:"Module"}));w.forwardRef(({actions:t,children:e,error:n,hint:r,label:o,labelAction:i,nextLabel:s,onNext:a,onPrevious:l,previousLabel:c,required:d,secondaryLabel:h,selectedSlide:f,id:m,...p},b)=>{const v=on(m);return u.jsx(Gr,{hint:r,error:n,id:v,required:d,children:u.jsxs(q,{direction:"column",alignItems:"stretch",gap:1,children:[o&&u.jsx(Zf,{action:i,children:o}),u.jsx(gF,{ref:b,actions:t,label:o,nextLabel:s,onNext:a,onPrevious:l,previousLabel:c,secondaryLabel:h,selectedSlide:f,id:v,...p,children:e}),u.jsx(lw,{}),u.jsx(cw,{})]})})});C.styled(Z)`
|
|
957
957
|
${Vx}
|
|
958
958
|
`;C.styled(q)`
|
|
959
959
|
display: ${({$selected:t})=>t?"flex":"none"};
|
|
@@ -1010,7 +1010,7 @@ Defaulting to \`null\`.`}const eN=Sx,tN=XL,Tx="Radio",[nN,Rx]=qe(Tx),[rN,oN]=nN(
|
|
|
1010
1010
|
animation: ${DF} 1s infinite linear;
|
|
1011
1011
|
will-change: transform;
|
|
1012
1012
|
${({$small:t,theme:e})=>t&&`width: ${e.spaces[6]}; height: ${e.spaces[6]};`}
|
|
1013
|
-
`,dw=w.forwardRef(({allowCustomValue:t,autocomplete:e,children:n,className:r,clearLabel:o="Clear",creatable:i=!1,creatableDisabled:s=!1,creatableStartIcon:a,createMessage:l=se=>`Create "${se}"`,defaultFilterValue:c,defaultTextValue:d,defaultOpen:h=!1,open:f,onOpenChange:m,disabled:
|
|
1013
|
+
`,dw=w.forwardRef(({allowCustomValue:t,autocomplete:e,children:n,className:r,clearLabel:o="Clear",creatable:i=!1,creatableDisabled:s=!1,creatableStartIcon:a,createMessage:l=se=>`Create "${se}"`,defaultFilterValue:c,defaultTextValue:d,defaultOpen:h=!1,open:f,onOpenChange:m,disabled:p=!1,hasError:b,id:v,filterValue:x,hasMoreItems:y=!1,isPrintableCharacter:$,loading:S=!1,loadingMessage:A="Loading content...",name:k,noOptionsMessage:T=()=>"No results found",onChange:I,onClear:E,onCreateOption:j,onFilterValueChange:L,onInputChange:D,onTextValueChange:z,onLoadMore:V,placeholder:W="Select or enter a value",required:G=!1,size:P="M",startIcon:_,textValue:O,value:X,...J},fe)=>{const[se,pe]=xn({prop:f,defaultProp:h,onChange:m}),[be,Se]=xn({prop:O,defaultProp:t&&!d?X:d,onChange:z}),[re,xe]=xn({prop:x,defaultProp:c,onChange:L}),ge=w.useRef(null),ve=w.useRef(null),he=At(ve,fe),ce=w.useRef(null),je=Rt=>{E&&!p&&(Se(""),xe(""),E(Rt),ve.current.focus())},Te=Rt=>{pe(Rt)},ye=Rt=>{Se(Rt)},nt=Rt=>{xe(Rt)},mt=Rt=>{D&&D(Rt)},no=Rt=>{I&&I(Rt)},Ar=Rt=>{V&&y&&!S&&V(Rt)},ci=()=>{j&&be&&i!=="visible"?j(be):j&&i==="visible"&&(j(),pe(!1))},Zn=on(),c0=`intersection-${Go(Zn)}`;Ss(ge,Ar,{selectorToWatch:`#${c0}`,skipWhen:!se});const{error:bc,...Rs}=kt("Combobox"),iy=!!bc||b,vc=Rs.id??v,sy=Rs.name??k,ay=Rs.required||G;let xc;return bc?xc=`${vc}-error`:Rs.hint&&(xc=`${vc}-hint`),u.jsxs(Kt.Root,{autocomplete:e||(i===!0?"list":"both"),onOpenChange:Te,open:se,onTextValueChange:ye,textValue:be,allowCustomValue:!!i||t,disabled:p,required:ay,value:X,onValueChange:no,filterValue:re,onFilterValueChange:nt,isPrintableCharacter:$,visible:i==="visible",children:[u.jsxs(LF,{$hasError:iy,$size:P,className:r,children:[u.jsxs(q,{flex:"1",tag:"span",gap:3,children:[_?u.jsx(q,{flex:"0 0 1.6rem",tag:"span","aria-hidden":!0,children:_}):null,u.jsx(NF,{placeholder:W,id:vc,"aria-invalid":!!bc,onChange:mt,ref:he,name:sy,"aria-describedby":xc,...J})]}),u.jsxs(q,{tag:"span",gap:3,children:[be&&E?u.jsx(ut,{size:"XS",variant:"ghost",onClick:je,"aria-disabled":p,"aria-label":o,label:o,ref:ce,children:u.jsx(Zr,{})}):null,u.jsx(BF,{children:u.jsx(ur,{fill:"neutral500"})})]})]}),u.jsx(Kt.Portal,{children:u.jsx(FF,{sideOffset:4,children:u.jsxs(Kt.Viewport,{ref:ge,children:[u.jsxs(_F,{children:[n,i!==!0&&!S?u.jsx(Kt.NoValueFound,{asChild:!0,children:u.jsx(Xu,{$hasHover:!1,children:u.jsx(K,{children:T(be??"")})})}):null,S?u.jsx(q,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:u.jsx(xl,{small:!0,children:A})}):null,u.jsx(Z,{id:c0,width:"100%",height:"1px"})]}),i?u.jsx(VF,{onPointerUp:ci,onClick:ci,disabled:s,asChild:!0,children:u.jsx(Xu,{children:u.jsxs(q,{gap:2,children:[a&&u.jsx(Z,{tag:"span","aria-hidden":!0,display:"inline-flex",children:a}),u.jsx(K,{children:l(be??"")})]})})}):null]})})})]})}),LF=C.styled(Kt.Trigger)`
|
|
1014
1014
|
position: relative;
|
|
1015
1015
|
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
1016
1016
|
border-radius: ${({theme:t})=>t.borderRadius};
|
|
@@ -1325,7 +1325,7 @@ ${C.css`
|
|
|
1325
1325
|
transition: none !important;
|
|
1326
1326
|
animation: none !important;
|
|
1327
1327
|
}
|
|
1328
|
-
`)),document.head.appendChild(o),window.getComputedStyle(o).opacity,document.head.removeChild(o)},[n]),u.jsx(nV,{locale:e,children:u.jsxs(C.ThemeProvider,{theme:n,children:[u.jsx(J6,{...r,children:t}),u.jsx(eV,{}),u.jsx(tV,{})]})})),rV=a3,pw=w.forwardRef(({container:t=globalThis?.document?.body,...e},n)=>t?is.createPortal(u.jsx(Z,{ref:n,...e}),t):null);pw.displayName="Portal";const oV=w.forwardRef(({onClear:t,clearLabel:e="Clear",startIcon:n,disabled:r,hasError:o,children:i,id:s,size:a="M",withTags:l,...c},d)=>{const h=w.useRef(null),f=
|
|
1328
|
+
`)),document.head.appendChild(o),window.getComputedStyle(o).opacity,document.head.removeChild(o)},[n]),u.jsx(nV,{locale:e,children:u.jsxs(C.ThemeProvider,{theme:n,children:[u.jsx(J6,{...r,children:t}),u.jsx(eV,{}),u.jsx(tV,{})]})})),rV=a3,pw=w.forwardRef(({container:t=globalThis?.document?.body,...e},n)=>t?is.createPortal(u.jsx(Z,{ref:n,...e}),t):null);pw.displayName="Portal";const oV=w.forwardRef(({onClear:t,clearLabel:e="Clear",startIcon:n,disabled:r,hasError:o,children:i,id:s,size:a="M",withTags:l,...c},d)=>{const h=w.useRef(null),f=b=>{t&&!r&&(t(b),h.current.focus())},{labelNode:m}=kt("SelectTrigger"),p=At(h,d);return u.jsx(tn.Trigger,{asChild:!0,children:u.jsxs(iV,{"aria-disabled":r,$hasError:o,ref:p,alignItems:"center",justifyContent:"space-between",position:"relative",overflow:"hidden",hasRadius:!0,background:r?"neutral150":"neutral0",gap:4,cursor:"default","aria-labelledby":m?`${s}-label`:void 0,$size:a,$withTags:l,...c,children:[u.jsxs(q,{flex:"1",tag:"span",gap:3,children:[n&&u.jsx(q,{tag:"span","aria-hidden":!0,children:n}),i]}),u.jsxs(q,{tag:"span",gap:3,children:[t?u.jsx(ut,{size:"XS",variant:"ghost",onClick:f,"aria-disabled":r,"aria-label":e,label:e,children:u.jsx(Zr,{})}):null,u.jsx(sV,{children:u.jsx(ur,{})})]})]})})}),iV=C.styled(q)`
|
|
1329
1329
|
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
1330
1330
|
${t=>{switch(t.$size){case"S":return C.css`
|
|
1331
1331
|
padding-block: ${t.theme.spaces[1]};
|
|
@@ -1417,7 +1417,7 @@ ${C.css`
|
|
|
1417
1417
|
background-color: ${({theme:t})=>t.colors.primary100};
|
|
1418
1418
|
cursor: pointer;
|
|
1419
1419
|
}
|
|
1420
|
-
`,bw=tn.Root,vw=oV,xw=aV,ww=tn.Portal,yw=dV,Cw=hV,Jf=fV,$w=tn.ItemIndicator,Sw=tn.ItemText,pV=tn.Group,Sn=w.forwardRef(({children:t,clearLabel:e="Clear",customizeContent:n,disabled:r,hasError:o,id:i,name:s,onChange:a,onClear:l,onCloseAutoFocus:c,onReachEnd:d,placeholder:h,required:f,size:m,startIcon:
|
|
1420
|
+
`,bw=tn.Root,vw=oV,xw=aV,ww=tn.Portal,yw=dV,Cw=hV,Jf=fV,$w=tn.ItemIndicator,Sw=tn.ItemText,pV=tn.Group,Sn=w.forwardRef(({children:t,clearLabel:e="Clear",customizeContent:n,disabled:r,hasError:o,id:i,name:s,onChange:a,onClear:l,onCloseAutoFocus:c,onReachEnd:d,placeholder:h,required:f,size:m,startIcon:p,value:b,...v},x)=>{const[y,$]=w.useState(),[S,A]=w.useState(!1),k=J=>{A(J)},T=J=>{l&&l(J),a||$("")},I=J=>{a?a(typeof b=="number"?Number(J):J):$(J)},E=w.useRef(null),j=on(),L=`intersection-${Go(j)}`;Ss(E,J=>{d&&d(J)},{selectorToWatch:`#${L}`,skipWhen:!S});const{error:z,required:V,...W}=kt("SingleSelect"),G=!!z||o,P=W.id??i,_=W.name??s;let O;z?O=`${P}-error`:W.hint&&(O=`${P}-hint`);const X=(typeof b<"u"&&b!==null?b.toString():y)??"";return u.jsxs(bw,{onOpenChange:k,disabled:r,required:V??f,onValueChange:I,value:X,...v,children:[u.jsx(vw,{ref:x,id:P,name:_,startIcon:p,hasError:G,disabled:r,clearLabel:e,onClear:X&&l?T:void 0,"aria-label":v["aria-label"],"aria-describedby":O??v["aria-describedby"],size:m,children:u.jsx(xw,{placeholder:h,textColor:X?"neutral800":"neutral600",children:X&&n?n(X):void 0})}),u.jsx(ww,{children:u.jsx(yw,{position:"popper",sideOffset:4,onCloseAutoFocus:c,children:u.jsxs(Cw,{ref:E,children:[t,u.jsx(Z,{id:L,width:"100%",height:"1px"})]})})})]})}),An=w.forwardRef(({value:t,startIcon:e,children:n,...r},o)=>u.jsxs(Jf,{ref:o,value:t.toString(),...r,children:[e&&u.jsx(q,{tag:"span","aria-hidden":!0,children:e}),u.jsx(K,{lineHeight:"20px",width:"100%",children:u.jsx(Sw,{children:n})})]})),bV=200,lg=15,[vV,ai]=Cs("DatePicker"),xV=w.forwardRef(({calendarLabel:t,className:e,initialDate:n,locale:r,maxDate:o,minDate:i,monthSelectLabel:s="Month",onChange:a,value:l,yearSelectLabel:c="Year",hasError:d,id:h,name:f,disabled:m=!1,required:p=!1,onClear:b,clearLabel:v="Clear",size:x="M",...y},$)=>{const S=Do(),A=hc("DatePicker"),k=r??A.locale,T=Hn(k,{day:"2-digit",month:"2-digit",year:"numeric"}),[I,E]=w.useState(!1),[j,L]=w.useState(null),[D,z]=w.useState(null),[V,W]=w.useState(null),[G,P]=w.useState(),[_,O]=xn({defaultProp:n?Tr(n):void 0,prop:l?Tr(l):void 0,onChange(ye){a&&a(ye?.toDate(S))}}),[X,J]=w.useMemo(()=>{const ye=n?Tr(n):th("UTC"),nt=i?Tr(i):ye.set({day:1,month:1,year:ye.year-bV});let mt=o?Tr(o):ye.set({day:31,month:12,year:ye.year+lg});return mt.compare(nt)<0&&(mt=nt.set({day:31,month:12,year:nt.year+lg})),[nt,mt]},[i,o,n]),[fe,se]=w.useState(wV({currentValue:_,minDate:X,maxDate:J})),pe=on(),be=w.useRef(null),Se=ye=>{b&&!m&&(P(""),O(void 0),b(ye),D?.focus())},re=w.useCallback(ye=>{ye&&_&&se(_),E(ye)},[_]);Kr(()=>{if(l){const ye=Tr(l);P(T.format(ye.toDate(S))),se(ye)}else P("")},[l,T,S]),Kr(()=>{if(n&&G===void 0){const ye=Tr(n);P(T.format(ye.toDate(S)))}},[n,G,T,S]);const{error:xe,...ge}=kt("Combobox"),ve=!!xe||d,he=ge.id??h,ce=ge.name??f,je=ge.required||p;let Te;return xe?Te=`${he}-error`:ge.hint&&(Te=`${he}-hint`),u.jsxs(vV,{calendarDate:fe,content:V,contentId:pe,disabled:m,locale:k,minDate:X,maxDate:J,open:I,onCalendarDateChange:se,onContentChange:W,onOpenChange:re,onTextInputChange:z,onTextValueChange:P,onTriggerChange:L,onValueChange:O,onClear:b,required:je,textInput:D,textValue:G,timeZone:S,trigger:j,value:_,children:[u.jsxs(CV,{className:e,hasError:ve,size:x,children:[u.jsx(U$,{fill:"neutral500","aria-hidden":!0}),u.jsx(AV,{ref:$,"aria-describedby":Te,id:he,name:ce,...y}),G&&b?u.jsx(ut,{size:"XS",variant:"ghost",onClick:Se,"aria-disabled":m,"aria-label":v,label:v,ref:be,children:u.jsx(Zr,{})}):null]}),u.jsx(pw,{children:u.jsx(MV,{label:t,children:u.jsx(OV,{monthSelectLabel:s,yearSelectLabel:c})})})]})}),cg=t=>!!t.match(/^[^a-zA-Z]*$/),wV=({currentValue:t,minDate:e,maxDate:n})=>{const r=th("UTC");return t||(Sd(e,r)===e&&Ad(n,r)===n?r:Sd(e,r)===r?e:Ad(n,r)===r?n:r)},yV="DatePickerTrigger",CV=w.forwardRef(({hasError:t,size:e,...n},r)=>{const o=ai(yV),i=At(r,a=>o.onTriggerChange(a)),s=()=>{o.disabled||o.onOpenChange(!0)};return u.jsx(ei,{asChild:!0,trapped:o.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:a=>{document.getSelection()?.empty(),a.preventDefault()},children:u.jsx($V,{ref:i,$hasError:t,$size:e,$hasOnClear:!!o.onClear,...n,hasRadius:!0,gap:3,overflow:"hidden",background:o.disabled?"neutral150":"neutral0",onClick:jr(n.onClick,()=>{o.textInput?.focus()}),onPointerDown:jr(n.onPointerDown,a=>{const l=a.target;l.hasPointerCapture(a.pointerId)&&l.releasePointerCapture(a.pointerId),(l.closest("button")??l.closest("div"))===a.currentTarget&&a.button===0&&a.ctrlKey===!1&&(s(),o.textInput?.focus())})})})}),$V=C.styled(q)`
|
|
1421
1421
|
min-width: ${({$hasOnClear:t})=>t?"160px":"130px"};
|
|
1422
1422
|
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
1423
1423
|
${t=>{switch(t.$size){case"S":return C.css`
|
|
@@ -1444,7 +1444,7 @@ ${C.css`
|
|
|
1444
1444
|
}
|
|
1445
1445
|
|
|
1446
1446
|
${({theme:t,$hasError:e})=>$r()({theme:t,$hasError:e})};
|
|
1447
|
-
`,SV="DatePickerTextInput",AV=w.forwardRef(({placeholder:t,...e},n)=>{const r=ai(SV),{onTextValueChange:o,textValue:i,onTextInputChange:s,onOpenChange:a,disabled:l,locale:c}=r,d=At(n,x=>s(x)),h=()=>{l||a(!0)},f=Hn(c,{year:"numeric",month:"2-digit",day:"2-digit"}),[m,b
|
|
1447
|
+
`,SV="DatePickerTextInput",AV=w.forwardRef(({placeholder:t,...e},n)=>{const r=ai(SV),{onTextValueChange:o,textValue:i,onTextInputChange:s,onOpenChange:a,disabled:l,locale:c}=r,d=At(n,x=>s(x)),h=()=>{l||a(!0)},f=Hn(c,{year:"numeric",month:"2-digit",day:"2-digit"}),[m,p,b]=w.useMemo(()=>{const x=f.formatToParts(new Date),y=x.filter(A=>A.type==="year"||A.type==="month"||A.type==="day"),$=y.map(A=>{switch(A.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";default:return""}}),S=x.find(A=>A.type==="literal")?.value??"";return[$,S,y]},[f]),v=m.map(x=>`\\d{${x.length}}`).join(`\\${p}`);return u.jsx(TV,{role:"combobox",type:"text",inputMode:"numeric",ref:d,"aria-autocomplete":"none","aria-controls":r.contentId,"aria-disabled":r.disabled,"aria-expanded":r.open,"aria-required":r.required,"aria-haspopup":"dialog","data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,pattern:v,placeholder:t??m.join(p),...e,value:i??"",onBlur:jr(e.onBlur,()=>{if(!r.textValue){r.onValueChange(void 0);return}r.onTextValueChange(f.format(r.calendarDate.toDate(r.timeZone))),r.onValueChange(r.calendarDate)}),onChange:jr(e.onChange,x=>{if(cg(x.target.value)){const y=x.target.value.split(p),[$,S,A]=b.map((z,V)=>{const W=y[V];return{...z,value:W}}).sort((z,V)=>z.type==="year"?1:V.type==="year"?-1:z.type==="month"?1:V.type==="month"?-1:0).map(z=>z.value),k=r.calendarDate.year;let T=r.calendarDate.year;if(A){const z=A.length===1?`0${A}`:A;T=A.length<3?Number(`${k}`.slice(0,4-z.length)+z):Number(z)}A&&A.length<3&&T>r.maxDate.year&&(T-=100);const I=r.calendarDate.set({year:T}),E=I.calendar.getMonthsInYear(I),j=I.set({month:S&&Number(S)<=E?Number(S):void 0}),L=j.calendar.getDaysInMonth(j),D=j.set({day:$&&Number($)<=L?Number($):void 0});r.onCalendarDateChange(kV(D,r.minDate,r.maxDate)),r.onTextValueChange(x.target.value)}}),onKeyDown:jr(e.onKeyDown,x=>{if(!r.open&&(cg(x.key)||["ArrowDown","Backspace"].includes(x.key)))h();else if(["Tab"].includes(x.key)&&r.open)x.preventDefault();else if(["Escape"].includes(x.key))r.open?r.onOpenChange(!1):(r.onValueChange(void 0),r.onTextValueChange("")),x.preventDefault();else if(r.open&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(x.key))switch(x.preventDefault(),x.key){case"ArrowDown":{const y=r.calendarDate.add({weeks:1});if(r.maxDate&&y.compare(r.maxDate)>0)return;r.onCalendarDateChange(y);return}case"ArrowRight":{const y=r.calendarDate.add({days:1});if(r.maxDate&&y.compare(r.maxDate)>0)return;r.onCalendarDateChange(y);return}case"ArrowUp":{const y=r.calendarDate.subtract({weeks:1});if(r.minDate&&y.compare(r.minDate)<0)return;r.onCalendarDateChange(y);return}case"ArrowLeft":{const y=r.calendarDate.subtract({days:1});if(r.minDate&&y.compare(r.minDate)<0)return;r.onCalendarDateChange(y)}}else r.open&&["Enter"].includes(x.key)&&(x.preventDefault(),o(f.format(r.calendarDate.toDate(r.timeZone))),r.onValueChange(r.calendarDate),r.onOpenChange(!1))})})});function kV(t,e,n){return e&&(t=Ad(t,e)),n&&(t=Sd(t,n)),t}const TV=C.styled.input`
|
|
1448
1448
|
width: 100%;
|
|
1449
1449
|
font-size: 1.4rem;
|
|
1450
1450
|
line-height: 2.2rem;
|
|
@@ -1484,7 +1484,7 @@ ${C.css`
|
|
|
1484
1484
|
}
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
|
-
`,DV="DatePickerCalendar",OV=w.forwardRef(({monthSelectLabel:t,yearSelectLabel:e,...n},r)=>{const{locale:o,timeZone:i,minDate:s,maxDate:a,calendarDate:l,onCalendarDateChange:c}=ai(DV),d=wy(l),h=w.useMemo(()=>{const $=s.year,S=a.year;return[...Array(S-$+1).keys()].map(A=>($+A).toString())},[s,a]),f=Hn(o,{month:"long"}),m=w.useMemo(()=>[...Array(l.calendar.getMonthsInYear(l)).keys()].map($=>f.format(l.set({month:$+1}).toDate(i))),[l,f,i]),
|
|
1487
|
+
`,DV="DatePickerCalendar",OV=w.forwardRef(({monthSelectLabel:t,yearSelectLabel:e,...n},r)=>{const{locale:o,timeZone:i,minDate:s,maxDate:a,calendarDate:l,onCalendarDateChange:c}=ai(DV),d=wy(l),h=w.useMemo(()=>{const $=s.year,S=a.year;return[...Array(S-$+1).keys()].map(A=>($+A).toString())},[s,a]),f=Hn(o,{month:"long"}),m=w.useMemo(()=>[...Array(l.calendar.getMonthsInYear(l)).keys()].map($=>f.format(l.set({month:$+1}).toDate(i))),[l,f,i]),p=Hn(o,{weekday:"short"}),b=w.useMemo(()=>{const $=Eg(th(i),o);return[...new Array(7).keys()].map(S=>{const k=$.add({days:S}).toDate(i);return p.format(k)})},[i,o,p]),v=$=>{if(typeof $=="number")return;const S=l.set({month:m.indexOf($)+1});c(S)},x=$=>{if(typeof $=="number")return;const S=l.set({year:parseInt($,10)});c(S)},y=LV(d,o);return u.jsxs(q,{ref:r,direction:"column",alignItems:"stretch",padding:4,...n,children:[u.jsxs(NV,{justifyContent:"flex-start",paddingBottom:4,paddingLeft:2,paddingRight:2,gap:2,children:[u.jsx(Gr,{children:u.jsx(Sn,{"aria-label":t,value:m[l.month-1],onChange:v,children:m.map($=>u.jsx(An,{value:$,children:$},$))})}),u.jsx(Gr,{children:u.jsx(Sn,{value:l.year.toString(),"aria-label":e,onChange:x,children:h.map($=>u.jsx(An,{value:$,children:$},$))})})]}),u.jsxs("table",{role:"grid",children:[u.jsx("thead",{"aria-hidden":!0,children:u.jsx("tr",{"aria-rowindex":0,children:b.map(($,S)=>u.jsx(BV,{"aria-colindex":S,children:$},$))})}),u.jsx("tbody",{children:[...new Array(6).keys()].map($=>u.jsx("tr",{"aria-rowindex":$+2,children:y($).map((S,A)=>S?u.jsx(_V,{"aria-colindex":A+1,date:S,startDate:d,disabled:s.compare(S)>0||S.compare(a)>0},S.toString()):u.jsx(Aw,{"aria-colindex":A+1},A+1))},$))})]})]})}),LV=(t,e)=>n=>{let r=t.add({weeks:n});const o=[];r=Eg(r,e);const i=Rg(r,e);for(let s=0;s<i;s++)o.push(null);for(;o.length<7;){o.push(r);const s=r.add({days:1});if(Tg(r,s))break;r=s}for(;o.length<7;)o.push(null);return o},NV=C.styled(q)`
|
|
1488
1488
|
div[role='combobox'] {
|
|
1489
1489
|
border: 1px solid transparent;
|
|
1490
1490
|
background: transparent;
|
|
@@ -1501,7 +1501,7 @@ ${C.css`
|
|
|
1501
1501
|
`,BV=w.forwardRef(({children:t,...e},n)=>u.jsx(FV,{tag:"th",role:"gridcell",ref:n,...e,height:"2.4rem",width:"3.2rem",children:u.jsx(K,{variant:"pi",fontWeight:"bold",color:"neutral800",children:t.slice(0,2)})})),FV=C.styled(Z)`
|
|
1502
1502
|
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1503
1503
|
text-transform: capitalize;
|
|
1504
|
-
`,VV="DatePickerCalendarCell",_V=w.forwardRef(({date:t,startDate:e,disabled:n,...r},o)=>{const{timeZone:i,locale:s,calendarDate:a,onValueChange:l,onOpenChange:c,onTextValueChange:d,onCalendarDateChange:h}=ai(VV),f=Tg(a,t),m=Hn(s,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),
|
|
1504
|
+
`,VV="DatePickerCalendarCell",_V=w.forwardRef(({date:t,startDate:e,disabled:n,...r},o)=>{const{timeZone:i,locale:s,calendarDate:a,onValueChange:l,onOpenChange:c,onTextValueChange:d,onCalendarDateChange:h}=ai(VV),f=Tg(a,t),m=Hn(s,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),p=w.useMemo(()=>m.format(t.toDate(i)),[m,t,i]),b=Hn(s,{day:"numeric",calendar:t.calendar.identifier}),v=w.useMemo(()=>b.formatToParts(t.toDate(i)).find(A=>A.type==="day").value,[b,t,i]),x=Hn(s,{day:"2-digit",month:"2-digit",year:"numeric"}),y=yy(e),$=t.compare(e)<0||t.compare(y)>0;let S="neutral900";return f?S="primary600":$&&(S="neutral600"),u.jsx(Aw,{tag:"td",role:"gridcell",ref:o,"aria-selected":f,...r,hasRadius:!0,"aria-label":p,tabIndex:f?0:-1,background:f?"primary100":"neutral0",cursor:"pointer",onPointerDown:jr(r.onPointerDown,A=>{A.preventDefault(),h(t),l(t),d(x.format(t.toDate(i))),c(!1)}),"aria-disabled":n,children:u.jsx(K,{variant:"pi",textColor:S,children:v})})}),Aw=C.styled(Z)`
|
|
1505
1505
|
text-align: center;
|
|
1506
1506
|
padding: 0.7rem;
|
|
1507
1507
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
@@ -1519,7 +1519,7 @@ ${C.css`
|
|
|
1519
1519
|
}
|
|
1520
1520
|
`,Tr=t=>{const e=t.toISOString(),n=zg(e,"UTC");return Og(n)},pd=t=>!!t.match(/^[^a-zA-Z]*$/);function zV(t=""){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const HV=en.default(dw)`
|
|
1521
1521
|
min-width: ${({onClear:t})=>t?"160px":"130px"};
|
|
1522
|
-
`,PV=w.forwardRef(({step:t=15,value:e,defaultValue:n,onChange:r,...o},i)=>{const s=hc("TimePicker"),[a,l]=w.useState(""),[c,d]=xn({prop:e,defaultProp:n,onChange:r}),h=Hn(s.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),f=w.useMemo(()=>{const S=h.formatToParts(new Date),{value:A}=S.find(k=>k.type==="literal");return A},[h]),m=w.useMemo(()=>{const S=60/t;return[...Array(24).keys()].flatMap(A=>[...Array(S).keys()].map(k=>h.format(new Date(0,0,0,A,k*t))))},[t,h]),
|
|
1522
|
+
`,PV=w.forwardRef(({step:t=15,value:e,defaultValue:n,onChange:r,...o},i)=>{const s=hc("TimePicker"),[a,l]=w.useState(""),[c,d]=xn({prop:e,defaultProp:n,onChange:r}),h=Hn(s.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),f=w.useMemo(()=>{const S=h.formatToParts(new Date),{value:A}=S.find(k=>k.type==="literal");return A},[h]),m=w.useMemo(()=>{const S=60/t;return[...Array(24).keys()].flatMap(A=>[...Array(S).keys()].map(k=>h.format(new Date(0,0,0,A,k*t))))},[t,h]),p=S=>{(!S||pd(S))&&l(S)},b=S=>{const[A,k]=S.split(f);if(!A&&!k)return;const T=Number(A??"0"),I=Number(k??"0");if(!(T>23||I>59))return h.format(new Date(0,0,0,T,I))},v=S=>{const A=b(S.target.value);A?(l(A),d(A)):l(c)},x=S=>{if(typeof S<"u"){const A=b(S);d(A)}else d(S)};w.useEffect(()=>{const S=typeof e>"u"?"":e;pd(S)&&l(S)},[e,l]);const $=`\\d{2}${zV(f)}\\d{2}`;return u.jsx(HV,{...o,ref:i,value:c,onChange:x,isPrintableCharacter:pd,allowCustomValue:!0,placeholder:`--${f}--`,autocomplete:"none",startIcon:u.jsx(v8,{fill:"neutral500"}),inputMode:"numeric",pattern:$,textValue:a,onTextValueChange:p,onBlur:v,children:m.map(S=>u.jsx(uw,{value:S,children:S},S))})});w.forwardRef(({clearLabel:t="clear",dateLabel:e="Choose date",timeLabel:n="Choose time",disabled:r=!1,hasError:o,onChange:i,onClear:s,required:a=!1,step:l,value:c,initialDate:d,size:h,...f},m)=>{const p=w.useRef(null),[b,v]=xn({defaultProp:d?xi(d,!1):void 0,prop:c?xi(c,!1):c??void 0,onChange(z){i&&i(z?.toDate(Do()))}}),x=hc("DateTimePicker"),y=Hn(x.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),$=b?y.format(b.toDate(Do())):"",S=z=>{let V=z?xi(z):void 0;if(!(V&&b&&V.compare(b)===0)){if($&&V){const[W,G]=$.split(":");V=V.set({hour:parseInt(W,10),minute:parseInt(G,10)})}v(V)}},A=z=>{if(!z)return;const[V,W]=z.split(":"),G=b?b.set({hour:parseInt(V,10),minute:parseInt(W,10)}):xi(new Date).set({hour:parseInt(V,10),minute:parseInt(W,10)});v(G)},k=z=>{v(void 0),s&&s(z)},T=()=>{const z=b?b.set({hour:0,minute:0}):xi(new Date);v(z)},I=At(p,m),{error:E,id:j,labelNode:L}=kt("DateTimePicker"),D=!!E||o;return u.jsxs(q,{"aria-labelledby":L?`${j}-label`:void 0,role:"group",flex:"1",gap:1,wrap:"wrap",children:[u.jsx(Gr,{flex:"1",children:u.jsx(xV,{...f,size:h,value:b?.toDate("UTC"),onChange:S,required:a,onClear:s?k:void 0,clearLabel:`${t} date`,disabled:r,ref:I,"aria-label":e})}),u.jsx(Gr,{flex:"1",children:u.jsx(PV,{size:h,hasError:D,value:$,onChange:A,onClear:s&&$!==void 0&&$!=="00:00"?T:void 0,clearLabel:`${t} time`,required:a,disabled:r,step:l,"aria-label":n})})]})});const xi=(t,e=!0)=>{const n=t.toISOString();let r=Ny(n);return e&&(r=r.set({hour:0,minute:0})),Fr(r)},Yo=w.forwardRef((t,e)=>u.jsx(WV,{ref:e,background:"neutral150",...t,"data-orientation":"horizontal",role:"separator",tag:"div"})),WV=C.styled(Z)`
|
|
1523
1523
|
height: 1px;
|
|
1524
1524
|
border: none;
|
|
1525
1525
|
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
@@ -1528,7 +1528,7 @@ ${C.css`
|
|
|
1528
1528
|
svg {
|
|
1529
1529
|
height: 8.8rem;
|
|
1530
1530
|
}
|
|
1531
|
-
`;w.forwardRef(({icon:t,content:e,action:n,hasRadius:r=!0,shadow:o="tableShadow"},i)=>u.jsxs(q,{ref:i,alignItems:"center",direction:"column",padding:11,background:"neutral0",hasRadius:r,shadow:o,children:[t?u.jsx(qV,{paddingBottom:6,"aria-hidden":!0,children:t}):null,u.jsx(Z,{paddingBottom:4,children:u.jsx(K,{variant:"delta",tag:"p",textAlign:"center",textColor:"neutral600",children:e})}),n]}));const kw=me.define(),Tw=me.define(),UV=ae.mark({attributes:{style:"background-color: yellow; color: black"}}),KV=tt.define({create(){return ae.none},update(t,e){return t=t.map(e.changes),e.effects.forEach(n=>{n.is(kw)?t=t.update({add:n.value,sort:!0}):n.is(Tw)&&(t=t.update({filter:n.value}))}),t},provide:t=>Q.decorations.from(t)});w.forwardRef(({hasError:t,required:e,id:n,value:r="",disabled:o=!1,onChange:i=()=>null,...s},a)=>{const l=w.useRef(),c=w.useRef(),d=w.useRef(),{error:h,...f}=kt("JsonInput"),m=!!h||t,
|
|
1531
|
+
`;w.forwardRef(({icon:t,content:e,action:n,hasRadius:r=!0,shadow:o="tableShadow"},i)=>u.jsxs(q,{ref:i,alignItems:"center",direction:"column",padding:11,background:"neutral0",hasRadius:r,shadow:o,children:[t?u.jsx(qV,{paddingBottom:6,"aria-hidden":!0,children:t}):null,u.jsx(Z,{paddingBottom:4,children:u.jsx(K,{variant:"delta",tag:"p",textAlign:"center",textColor:"neutral600",children:e})}),n]}));const kw=me.define(),Tw=me.define(),UV=ae.mark({attributes:{style:"background-color: yellow; color: black"}}),KV=tt.define({create(){return ae.none},update(t,e){return t=t.map(e.changes),e.effects.forEach(n=>{n.is(kw)?t=t.update({add:n.value,sort:!0}):n.is(Tw)&&(t=t.update({filter:n.value}))}),t},provide:t=>Q.decorations.from(t)});w.forwardRef(({hasError:t,required:e,id:n,value:r="",disabled:o=!1,onChange:i=()=>null,...s},a)=>{const l=w.useRef(),c=w.useRef(),d=w.useRef(),{error:h,...f}=kt("JsonInput"),m=!!h||t,p=f.id??n,b=f.required||e;let v;h?v=`${p}-error`:f.hint&&(v=`${p}-hint`);const x=E=>{const j=c.current?.doc;if(j){const{text:L,to:D}=j.line(E),z=D-L.trimStart().length;D>z&&d.current?.dispatch({effects:kw.of([UV.range(z,D)])})}},y=()=>{const E=c.current?.doc;if(E){const j=E.length||0;d.current?.dispatch({effects:Tw.of((L,D)=>D<=0||L>=j)})}},$=({state:E,view:j})=>{d.current=j,c.current=E,y();const D=yj()(j);D.length&&x(E.doc.lineAt(D[0].from).number)},S=(E,j)=>{$(j),i(E)},A=(E,j)=>{d.current=E,c.current=j,$({view:E,state:j})},{setContainer:k,view:T}=fx({value:r,onCreateEditor:A,container:l.current,editable:!o,extensions:[Sj(),KV],onChange:S,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),I=At(l,k);return w.useImperativeHandle(a,()=>({...T?.dom,focus(){T&&T.focus()},scrollIntoView(E){T&&T.dom.scrollIntoView(E)}}),[T]),u.jsx(GV,{ref:I,$disabled:o,$hasError:m,alignItems:"stretch",fontSize:2,hasRadius:!0,"aria-required":b,id:p,"aria-describedby":v,...s})});const GV=C.styled(q)`
|
|
1532
1532
|
line-height: ${({theme:t})=>t.lineHeights[2]};
|
|
1533
1533
|
|
|
1534
1534
|
.cm-editor {
|
|
@@ -1642,7 +1642,7 @@ ${C.css`
|
|
|
1642
1642
|
`,i_=w.forwardRef((t,e)=>u.jsx(s_,{ref:e,padding:4,paddingLeft:5,paddingRight:5,background:"neutral100",justifyContent:"space-between",...t,tag:"footer"})),s_=C.styled(q)`
|
|
1643
1643
|
border-top: solid 1px ${t=>t.theme.colors.neutral150};
|
|
1644
1644
|
flex: 1;
|
|
1645
|
-
`,et=Object.freeze(Object.defineProperty({__proto__:null,Body:r_,Close:Rw,Content:QV,Footer:i_,Header:e_,Root:YV,Title:n_,Trigger:XV},Symbol.toStringTag,{value:"Module"})),a_="",l_=w.forwardRef(({startAction:t,locale:e,onValueChange:n,value:r,step:o=1,disabled:i=!1,...s},a)=>{const l=hc("NumberInput"),c=e||l.locale,d=w.useRef(new px(c,{style:"decimal"})),h=w.useRef(new gx(c,{maximumFractionDigits:20})),[f,m]=c_({prop(k){const T=String(r);return isNaN(Number(T))||T!==k&&k!==""?k:h.current.format(Number(r))},defaultProp:a_,onChange(k){const T=d.current.parse(k??"");n(isNaN(T)?void 0:T)}}),
|
|
1645
|
+
`,et=Object.freeze(Object.defineProperty({__proto__:null,Body:r_,Close:Rw,Content:QV,Footer:i_,Header:e_,Root:YV,Title:n_,Trigger:XV},Symbol.toStringTag,{value:"Module"})),a_="",l_=w.forwardRef(({startAction:t,locale:e,onValueChange:n,value:r,step:o=1,disabled:i=!1,...s},a)=>{const l=hc("NumberInput"),c=e||l.locale,d=w.useRef(new px(c,{style:"decimal"})),h=w.useRef(new gx(c,{maximumFractionDigits:20})),[f,m]=c_({prop(k){const T=String(r);return isNaN(Number(T))||T!==k&&k!==""?k:h.current.format(Number(r))},defaultProp:a_,onChange(k){const T=d.current.parse(k??"");n(isNaN(T)?void 0:T)}}),p=k=>{m(String(k))},b=({target:{value:k}})=>{d.current.isValidPartialNumber(k)&&p(k)},x=(k=>{const T=k.toString();return T.includes(".")?T.split(".")[1].length:0})(o),y=()=>{if(!f){p(o);return}const k=d.current.parse(f),T=isNaN(k)?o:k+o,I=parseFloat(T.toFixed(x));p(h.current.format(I))},$=()=>{if(!f){p(-o);return}const k=d.current.parse(f),T=isNaN(k)?-o:k-o,I=parseFloat(T.toFixed(x));p(h.current.format(I))},S=k=>{if(!i)switch(k.key){case lt.DOWN:{k.preventDefault(),$();break}case lt.UP:{k.preventDefault(),y();break}}},A=()=>{if(f){const k=d.current.parse(f),T=isNaN(k)?"":h.current.format(k);p(T)}};return u.jsx(dc,{ref:a,startAction:t,disabled:i,type:"text",inputMode:"decimal",onChange:b,onKeyDown:S,onBlur:A,value:f,endAction:u.jsxs(q,{direction:"column",children:[u.jsx(dg,{disabled:i,"aria-hidden":!0,$reverse:!0,onClick:y,tabIndex:-1,type:"button","data-testid":"ArrowUp",children:u.jsx(ur,{fill:"neutral500"})}),u.jsx(dg,{disabled:i,"aria-hidden":!0,onClick:$,tabIndex:-1,type:"button","data-testid":"ArrowDown",children:u.jsx(ur,{fill:"neutral500"})})]}),...s})}),dg=C.styled.button`
|
|
1646
1646
|
display: flex;
|
|
1647
1647
|
justify-content: center;
|
|
1648
1648
|
align-items: center;
|
|
@@ -1806,7 +1806,7 @@ ${C.css`
|
|
|
1806
1806
|
border-radius: 50%;
|
|
1807
1807
|
background: ${t=>t.theme.colors.primary600};
|
|
1808
1808
|
}
|
|
1809
|
-
`,x_=t=>{const e=t.querySelector('[tabindex="0"]');e&&e.focus()},Iw=w.createContext({rowIndex:0,colIndex:0,setTableValues(){throw new Error("setTableValues must be initialized via the RawTableContext.Provider")}}),w_=()=>w.useContext(Iw),y_=w.forwardRef(({colCount:t,rowCount:e,jumpStep:n=3,initialCol:r=0,initialRow:o=0,...i},s)=>{const a=w.useRef(null),l=w.useRef(!1),c=At(a,s),[d,h]=w.useState(o),[f,m]=w.useState(r),
|
|
1809
|
+
`,x_=t=>{const e=t.querySelector('[tabindex="0"]');e&&e.focus()},Iw=w.createContext({rowIndex:0,colIndex:0,setTableValues(){throw new Error("setTableValues must be initialized via the RawTableContext.Provider")}}),w_=()=>w.useContext(Iw),y_=w.forwardRef(({colCount:t,rowCount:e,jumpStep:n=3,initialCol:r=0,initialRow:o=0,...i},s)=>{const a=w.useRef(null),l=w.useRef(!1),c=At(a,s),[d,h]=w.useState(o),[f,m]=w.useState(r),p=w.useCallback(({colIndex:x,rowIndex:y})=>{m(x),h(y)},[]);w.useEffect(()=>{l.current&&x_(a.current),l.current||(l.current=!0)},[f,d]);const b=x=>{switch(x.key){case lt.RIGHT:{x.preventDefault(),m(y=>y<t-1?y+1:y);break}case lt.LEFT:{x.preventDefault(),m(y=>y>0?y-1:y);break}case lt.UP:{x.preventDefault(),h(y=>y>0?y-1:y);break}case lt.DOWN:{x.preventDefault(),h(y=>y<e-1?y+1:y);break}case lt.HOME:{x.preventDefault(),x.ctrlKey&&h(0),m(0);break}case lt.END:{x.preventDefault(),x.ctrlKey&&h(e-1),m(t-1);break}case lt.PAGE_DOWN:{x.preventDefault(),h(y=>y+n<e?y+n:e-1);break}case lt.PAGE_UP:{x.preventDefault(),h(y=>y-n>0?y-n:0);break}}},v=w.useMemo(()=>({rowIndex:d,colIndex:f,setTableValues:p}),[f,d,p]);return u.jsx(Iw.Provider,{value:v,children:u.jsx("table",{role:"grid",ref:c,"aria-rowcount":e,"aria-colcount":t,onKeyDown:b,...i})})}),wi=(t,e)=>[...t.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(o=>!o.hasAttribute("disabled")),bd=t=>t.filter(e=>e.tagName==="INPUT"?e.type!=="checkbox"&&e.type!=="radio":!1),jw=w.forwardRef(({coords:t={col:0,row:0},tag:e="td",...n},r)=>{const o=w.useRef(null),i=At(r,o),{rowIndex:s,colIndex:a,setTableValues:l}=w_(),[c,d]=w.useState(!1),h=p=>{const b=wi(o.current);if(b.length===0||b.length===1&&bd(b).length===0)return;if(b.length>1&&!b.find(x=>x.tagName!=="BUTTON")){p.preventDefault();const x=b.findIndex(y=>y===document.activeElement);if(p.key===lt.RIGHT){const y=b[x+1];y&&(p.stopPropagation(),y.focus())}else if(p.key===lt.LEFT){const y=b[x-1];y&&(p.stopPropagation(),y.focus())}return}const v=p.key===lt.ENTER;if(v&&!c)d(!0);else if((p.key===lt.ESCAPE||v)&&c){if(v&&document.activeElement?.tagName==="A")return;d(!1),o.current.focus()}else c&&p.stopPropagation()},f=s===t.row-1&&a===t.col-1;Kr(()=>{const p=wi(o.current);p.length===0||p.length===1&&bd(p).length!==0||p.length>1&&p.find(b=>b.tagName!=="BUTTON")?(o.current.setAttribute("tabIndex",!c&&f?"0":"-1"),p.forEach((b,v)=>{b.setAttribute("tabIndex",c?"0":"-1"),c&&v===0&&b.focus()})):p.forEach(b=>{b.setAttribute("tabIndex",f?"0":"-1")})},[c,f]);const m=w.useCallback(()=>{const p=wi(o.current);p.length>=1&&(bd(p).length!==0||!p.find(b=>b.tagName!=="BUTTON"))&&d(!0),l({rowIndex:t.row-1,colIndex:t.col-1})},[t,l]);return Kr(()=>{const p=o.current;return wi(p).forEach(v=>{v.addEventListener("focus",m)}),()=>{wi(p).forEach(x=>{x.removeEventListener("focus",m)})}},[m]),u.jsx(Z,{role:"gridcell",tag:e,ref:i,onKeyDown:h,...n})}),C_=t=>u.jsx(jw,{...t,tag:"th"}),$_=({children:t,...e})=>{const n=w.Children.toArray(t).map(r=>w.isValidElement(r)?w.cloneElement(r,{"aria-rowindex":1}):r);return u.jsx("thead",{...e,children:n})},S_=({children:t,...e})=>{const n=w.Children.toArray(t).map((r,o)=>w.isValidElement(r)?w.cloneElement(r,{"aria-rowindex":o+2}):r);return u.jsx("tbody",{...e,children:n})},A_=({children:t,...e})=>{const n=w.Children.toArray(t).map((r,o)=>w.isValidElement(r)?w.cloneElement(r,{"aria-colindex":o+1,coords:{col:o+1,row:e["aria-rowindex"]}}):r);return u.jsx(Z,{tag:"tr",...e,children:n})},k_=C.styled(Zr)`
|
|
1810
1810
|
font-size: 0.5rem;
|
|
1811
1811
|
path {
|
|
1812
1812
|
fill: ${({theme:t})=>t.colors.neutral500};
|
|
@@ -1858,7 +1858,7 @@ ${C.css`
|
|
|
1858
1858
|
color: inherit;
|
|
1859
1859
|
border-right: 1px solid ${({theme:t,$disabled:e})=>e?t.colors.neutral300:t.colors.primary200};
|
|
1860
1860
|
padding-right: ${({theme:t})=>t.spaces[2]};
|
|
1861
|
-
`,Eo=w.forwardRef(({children:t,clearLabel:e="Clear",customizeContent:n,disabled:r,hasError:o,id:i,name:s,onChange:a,onClear:l,onCloseAutoFocus:c,onReachEnd:d,placeholder:h,required:f,size:m,startIcon:
|
|
1861
|
+
`,Eo=w.forwardRef(({children:t,clearLabel:e="Clear",customizeContent:n,disabled:r,hasError:o,id:i,name:s,onChange:a,onClear:l,onCloseAutoFocus:c,onReachEnd:d,placeholder:h,required:f,size:m,startIcon:p,value:b,withTags:v,...x},y)=>{const $=w.useRef(null),[S,A]=w.useState(),[k,T]=w.useState(!1),I=se=>{a?a(se):A(se)},E=se=>()=>{const pe=Array.isArray(b)?b.filter(be=>be!==se):(S??[]).filter(be=>be!==se);a?a(pe):A(pe)},j=se=>{T(se)},L=on(),D=`intersection-${Go(L)}`;Ss($,se=>{d&&d(se)},{selectorToWatch:`#${D}`,skipWhen:!k});const V=typeof b<"u"&&b!==null?b:S,W=se=>se&&typeof se=="object"&&se.value?u.jsx(Ow,{tabIndex:-1,disabled:r,icon:u.jsx(Zr,{width:`${14/16}rem`,height:`${14/16}rem`}),onClick:E(se.value),children:se.textValue},se.value):null,{error:G,...P}=kt("MultiSelect"),_=!!G||o,O=P.id??i,X=P.name??s,J=P.required??f;let fe;return G?fe=`${O}-error`:P.hint&&(fe=`${O}-hint`),u.jsxs(bw,{onOpenChange:j,disabled:r,required:J,onValueChange:I,value:V,...x,multi:!0,children:[u.jsx(vw,{ref:y,id:O,name:X,"aria-label":x["aria-label"],"aria-describedby":fe??x["aria-describedby"],startIcon:p,hasError:_,disabled:r,clearLabel:e,onClear:V?.length?l:void 0,withTags:!!(v&&(V?.length??!1)),size:m,children:u.jsx(xw,{placeholder:h,textColor:V?.length?"neutral800":"neutral600",children:V?.length?v?W:n?n(V):void 0:void 0})}),u.jsx(ww,{children:u.jsx(yw,{position:"popper",sideOffset:4,onCloseAutoFocus:c,children:u.jsxs(Cw,{ref:$,children:[t,u.jsx(Z,{id:D,width:"100%",height:"1px"})]})})})]})}),Nr=w.forwardRef(({value:t,children:e,startIcon:n,...r},o)=>u.jsxs(Jf,{ref:o,value:t.toString(),...r,children:[n&&u.jsx(Z,{tag:"span","aria-hidden":!0,children:n}),u.jsx($w,{children:({isSelected:i,isIntermediate:s})=>u.jsx(os,{checked:s?"indeterminate":i})}),u.jsx(K,{children:u.jsx(Sw,{children:e})})]}));w.forwardRef(({children:t,label:e,startIcon:n,values:r=[],...o},i)=>u.jsxs(pV,{ref:i,children:[u.jsxs(Jf,{value:r,...o,children:[n&&u.jsx(Z,{tag:"span","aria-hidden":!0,children:n}),u.jsx($w,{children:({isSelected:s,isIntermediate:a})=>u.jsx(os,{checked:a?"indeterminate":s})}),u.jsx(K,{children:e})]}),t]}));C.styled(Nr)`
|
|
1862
1862
|
padding-left: ${({theme:t})=>t.spaces[7]};
|
|
1863
1863
|
`;const j_="23.2rem";w.forwardRef(({...t},e)=>u.jsx(D_,{ref:e,...t,tag:"nav"}));const D_=C.styled(Z)`
|
|
1864
1864
|
width: ${j_};
|
|
@@ -2167,7 +2167,7 @@ ${C.css`
|
|
|
2167
2167
|
&:disabled {
|
|
2168
2168
|
cursor: not-allowed;
|
|
2169
2169
|
}
|
|
2170
|
-
`,wn=w.forwardRef(({offLabel:t,onLabel:e,disabled:n,hasError:r,required:o,id:i,name:s,checked:a,onChange:l,...c},d)=>{const[h=!1,f]=xn({prop:a}),m=h!==null&&!h,{error:b
|
|
2170
|
+
`,wn=w.forwardRef(({offLabel:t,onLabel:e,disabled:n,hasError:r,required:o,id:i,name:s,checked:a,onChange:l,...c},d)=>{const[h=!1,f]=xn({prop:a}),m=h!==null&&!h,{error:p,...b}=kt("Toggle"),v=!!p||r,x=b.id??i,y=b.name??s,$=b.required||o;let S;return p?S=`${x}-error`:b.hint&&(S=`${x}-hint`),u.jsxs(sz,{position:"relative",hasRadius:!0,padding:1,background:n?"neutral150":"neutral100",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral200",wrap:"wrap",cursor:n?"not-allowed":"pointer",$hasError:v,children:[u.jsx(ug,{hasRadius:!0,flex:"1 1 50%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,justifyContent:"center",background:n&&m?"neutral200":m?"neutral0":"transparent",borderColor:n&&m?"neutral300":m?"neutral200":n?"neutral150":"neutral100",children:u.jsx(K,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:n?"neutral700":m?"danger700":"neutral600",children:t})}),u.jsx(ug,{hasRadius:!0,flex:"1 1 50%",paddingLeft:3,paddingRight:3,justifyContent:"center",background:n&&h?"neutral200":h?"neutral0":"transparent",borderColor:n&&h?"neutral300":h?"neutral200":n?"neutral150":"neutral100",children:u.jsx(K,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:n?"neutral700":h?"primary600":"neutral600",children:e})}),u.jsx(az,{...c,id:x,name:y,ref:d,onChange:A=>{f(A.currentTarget.checked),l?.(A)},type:"checkbox","aria-required":$,disabled:n,"aria-disabled":n,checked:!!h,"aria-describedby":S})]})}),sz=C.styled(q)`
|
|
2171
2171
|
${$r()}
|
|
2172
2172
|
`,ug=C.styled(q)`
|
|
2173
2173
|
padding-block: 0.6rem;
|
|
@@ -2198,7 +2198,7 @@ ${C.css`
|
|
|
2198
2198
|
${({theme:t})=>t.breakpoints.large} {
|
|
2199
2199
|
grid-column: span ${({$col:t,$m:e,$s:n,$xs:r})=>t??e??n??r??12};
|
|
2200
2200
|
}
|
|
2201
|
-
`,ee=Object.freeze(Object.defineProperty({__proto__:null,Item:dz,Root:lz},Symbol.toStringTag,{value:"Module"})),hg={en:()=>Promise.resolve().then(()=>require("../_chunks/en-DO98mdcm.js")),fr:()=>Promise.resolve().then(()=>require("../_chunks/fr-CjFMUCWK.js")),ca:()=>Promise.resolve().then(()=>require("../_chunks/ca-BQn7S09g.js"))},Zu=t=>`${Ht}.${t}`,R=(t,e)=>({id:Zu(t),defaultMessage:e??Zu(t)}),n0=B.z.object({name:B.z.string({required_error:"requiredError"}).nonempty("requiredError").refine(t=>!t.includes(" "),{message:"noSpaceError"}),label:B.z.string({required_error:"requiredError"}).nonempty("requiredError"),description:B.z.string().optional(),placeholder:B.z.string().optional(),required:B.z.boolean().optional(),enabled:B.z.boolean().optional()}),hz=n0.extend({type:B.z.literal("select"),multi:B.z.boolean(),options:B.z.array(B.z.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),fz=n0.extend({type:B.z.enum(["boolean","string"]),multi:B.z.literal(!1).optional(),options:B.z.array(B.z.string()).max(0).optional()}),mz=n0.extend({type:B.z.literal("media"),multi:B.z.literal(!1).optional(),options:B.z.array(B.z.string()).max(0).optional()}),zw=B.z.discriminatedUnion("type",[fz,mz,hz]),gz=B.z.union([B.z.literal("audience"),zw]),pz=B.z.object({additionalFields:B.z.array(gz),allowedLevels:B.z.number(),availableAudience:B.z.object({id:B.z.number(),documentId:B.z.string(),name:B.z.string(),key:B.z.string()}).array(),contentTypes:B.z.array(B.z.string()),defaultContentType:B.z.string().optional(),contentTypesNameFields:B.z.record(B.z.string(),B.z.array(B.z.string())),contentTypesPopulate:B.z.record(B.z.string(),B.z.array(B.z.string())),gql:B.z.object({navigationItemRelated:B.z.array(B.z.string())}),pathDefaultFields:B.z.record(B.z.string(),B.z.any()),cascadeMenuAttached:B.z.boolean(),preferCustomContentTypes:B.z.boolean(),isCacheEnabled:B.z.boolean().optional(),isCachePluginEnabled:B.z.boolean().optional()}),bz=B.z.object({uid:B.z.string(),isDisplayed:B.z.boolean(),apiID:B.z.string(),kind:B.z.enum(["collectionType","singleType"]),info:B.z.object({singularName:B.z.string(),pluralName:B.z.string(),displayName:B.z.string(),description:B.z.string().optional()}),attributes:B.z.record(B.z.string(),B.z.unknown())}),vz=M.object({id:M.number(),documentId:M.string(),name:M.string(),key:M.string()}),Hw=M.enum(["INTERNAL","EXTERNAL","WRAPPER"]),xz=M.object({id:M.number(),documentId:M.string(),title:M.string(),type:Hw,path:M.string().or(M.null()).optional(),externalPath:M.string().or(M.null()).optional(),uiRouterKey:M.string(),menuAttached:M.boolean(),order:M.number().int(),collapsed:M.boolean(),autoSync:M.boolean().or(M.null()).optional(),related:M.object({documentId:M.string().optional(),__type:M.string()}).catchall(M.unknown()).nullish(),additionalFields:M.record(M.string(),M.unknown()).or(M.null()).optional(),audience:M.array(vz).or(M.null()).optional(),viewId:M.number().optional(),viewParentId:M.number().optional(),structureId:M.string().optional(),removed:M.boolean().optional(),isSearchActive:M.boolean().optional(),updated:M.boolean().optional()}),Pw=xz.extend({items:M.lazy(()=>Pw.array().or(M.null())).optional()}),fg=M.object({id:M.number(),documentId:M.string(),name:M.string(),slug:M.string(),locale:M.string(),visible:M.boolean(),items:M.array(Pw)}),r0=M.object({name:M.string({required_error:"requiredError"}).nonempty("requiredError").refine(t=>!t.includes(" "),{message:"noSpaceError"}),label:M.string({required_error:"requiredError"}).nonempty("requiredError"),description:M.string().optional(),placeholder:M.string().optional(),required:M.boolean().optional(),enabled:M.boolean().optional()}),wz=r0.extend({type:M.literal("select"),multi:M.boolean(),options:M.array(M.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),yz=r0.extend({type:M.enum(["boolean","string"]),multi:M.literal(!1).optional(),options:M.array(M.string()).max(0).optional()}),Cz=r0.extend({type:M.literal("media"),multi:M.literal(!1).optional(),options:M.array(M.string()).max(0).optional()}),$z=M.discriminatedUnion("type",[yz,Cz,wz]),Sz=M.union([M.literal("audience"),$z]),Az=M.object({uid:M.string(),name:M.string(),draftAndPublish:M.boolean(),isSingle:M.boolean(),description:M.string(),collectionName:M.string(),contentTypeName:M.string(),label:M.string(),labelSingular:M.string(),endpoint:M.string(),available:M.boolean(),visible:M.boolean()}),kz=M.object({additionalFields:M.array(Sz),allowedLevels:M.number(),availableAudience:M.object({id:M.number(),documentId:M.string(),name:M.string(),key:M.string()}).array(),contentTypes:M.array(M.string()),defaultContentType:M.string().optional(),contentTypesNameFields:M.record(M.string(),M.array(M.string())),contentTypesPopulate:M.record(M.string(),M.array(M.string())),gql:M.object({navigationItemRelated:M.array(M.string())}),pathDefaultFields:M.record(M.string(),M.string().array()),cascadeMenuAttached:M.boolean(),preferCustomContentTypes:M.boolean(),allowedContentTypes:M.string().array(),restrictedContentTypes:M.string().array(),isCacheEnabled:M.boolean().optional(),isCachePluginEnabled:M.boolean().optional()}),mg=kz.omit({contentTypes:!0}).extend({contentTypes:Az.array()}),Tz=M.object({defaultLocale:M.string(),restLocale:M.string().array()}),Rz=M.enum(["collectionType","singleType"]),Mz=M.object({singularName:M.string(),pluralName:M.string(),displayName:M.string(),description:M.string().optional(),name:M.string().optional()}),Ww=M.object({required:M.boolean().optional(),max:M.number().optional(),min:M.number().optional(),minLength:M.number().optional(),maxLength:M.number().optional(),private:M.boolean().optional(),configurable:M.boolean().optional(),default:M.any().optional()}),Ez=M.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),Iz=Ww.extend({type:Ez}),jz=Ww.extend({type:M.literal("enumeration"),enum:M.string().array()}),Dz=M.object({type:M.literal("component"),component:M.string(),repeatable:M.boolean().optional()}),Oz=M.object({type:M.literal("dynamiczone"),components:M.string().array()}),Lz=M.object({media:M.literal("media"),allowedTypes:M.enum(["images","videos","audios","files"]).array(),required:M.boolean().optional()}),Nz=M.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),Bz=M.object({type:M.literal("relation"),relation:Nz,target:M.string(),mappedBy:M.string().optional(),inversedBy:M.string().optional()}),Fz=M.record(M.string(),M.union([Iz,jz,Dz,Oz,Bz,Lz])),Vz=M.object({kind:Rz,collectionName:M.string(),info:Mz,options:M.object({draftAndPublish:M.boolean().optional(),hidden:M.boolean().optional(),templateName:M.string().optional()}).optional(),attributes:Fz,actions:M.record(M.string(),M.any()).optional(),lifecycles:M.record(M.string(),M.any()).optional(),uid:M.string(),apiName:M.string().optional(),associations:M.object({model:M.string(),alias:M.string()}).array().optional(),modelName:M.string().optional(),plugin:M.string().optional(),pluginOptions:M.record(M.string(),M.any()).optional(),isSingle:M.boolean().optional()});Vz.pick({info:!0,kind:!0,attributes:!0,options:!0});const _z=M.object({id:M.number(),documentId:M.string(),locale:M.string().or(M.null()).optional()}).and(M.record(M.string(),M.any())),zz=M.object({slug:M.string()}),Hz=M.object({externalPath:M.string().or(M.null()).optional(),path:M.string().or(M.null()).optional(),related:M.object({documentId:M.string().optional(),__type:M.string()}).catchall(M.unknown()).nullish(),title:M.string(),type:Hw,uiRouterKey:M.string()}),Ne="navigation",Fe=oe.once(t=>({getIndexPrefix(){return[Ne]},readAll(){return t.get(`/${Ne}`).then(({data:e})=>fg.array().parse(e))},readAllIndex(){return[Ne,"navigations"]},delete(e){return t.del(`/${Ne}/${e}`)},create(e){return t.post(`/${Ne}/`,e)},update(e){return t.put(`/${Ne}/${e.documentId}`,e).then(({data:n})=>n).then(fg.parse)},purge({documentId:e,withLangVersions:n}){return t.del(`/${Ne}/cache/purge/${e??""}?clearLocalisations=${!!n}`)},slugify(e){const n=new URLSearchParams;return n.append("q",e),t.get(`/${Ne}/slug?${n.toString()}`).then(({data:r})=>zz.parse(r)).then(({slug:r})=>r)},readConfig(){return t.get(`/${Ne}/config`).then(({data:e})=>mg.parse(e))},readConfigIndex(){return[Ne,"config"]},healthCheck(){return t.get("/_health")},healthCheckIndex(){return["health"]},readNavigationItemFromLocale({source:e,structureId:n,target:r,documentId:o}){return t.get(`/${Ne}/i18n/item/read/${o}/${e}/${r}?path=${n}`)},updateConfig(e){return t.put(`/${Ne}/config`,e).then(()=>{})},restart(){return t.get(`/${Ne}/settings/restart`).then(()=>{})},restoreConfig(){return t.del(`/${Ne}/config`).then(()=>{})},readSettingsConfig(){return t.get(`/${Ne}/settings/config`).then(({data:e})=>{const n=mg.parse(e);return{...n,contentTypes:n.contentTypes.map(({uid:r})=>r)}})},readSettingsConfigIndex(){return[Ne,"config"]},readContentType(){return t.get("/content-manager/content-types").then(({data:e})=>bz.array().parse(e.data))},readContentTypeIndex(){return[Ne,"content-manager","content-types"]},readContentTypeItems({uid:e,locale:n,query:r}){const o=new URLSearchParams;return r&&o.append("_q",r),n&&o.append("locale",n),t.get(`/${Ne}/content-type-items/${e}?${o.toString()}`).then(({data:i})=>_z.array().parse(i))},readContentTypeItemsIndex({uid:e,locale:n,query:r}){return[Ne,"content-manager","content-type-items",e,n,r]},readLocale(){return t.get(`/${Ne}/settings/locale`).then(e=>Tz.parse(e.data))},readLocaleIndex(){return[Ne,"locale"]},copyNavigationLocale({documentId:e,source:n,target:r}){return t.put(`/${Ne}/i18n/copy/${e}/${n}/${r}`)},copyNavigationItemLocale({source:e,structureId:n="",target:r}){return t.get(`/${Ne}/i18n/item/read/${e}/${r}?path=${n}`).then(o=>Hz.parse(o.data))}})),fc=t=>({...t,viewId:Math.floor(Math.random()*152e4),items:t.items?.map(fc)}),o0=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readLocaleIndex(),queryFn:e.readLocale,staleTime:1/0})},qw=t=>{const e=de.getFetchClient(),n=Fe(e);return Re.useQuery({queryKey:n.readContentTypeItemsIndex(t),queryFn:()=>n.readContentTypeItems(t),staleTime:1e3*60*3,enabled:!!t.uid})},Pz=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readContentTypeIndex(),queryFn:()=>e.readContentType(),staleTime:1e3*60*3})},Wz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>{n.resetQueries({queryKey:e.readAllIndex()})}},qz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>{n.resetQueries({queryKey:e.readContentTypeIndex()})}},Uz=t=>{const e=de.getFetchClient(),n=Fe(e),r=Re.useQueryClient();return()=>{r.invalidateQueries({queryKey:n.readContentTypeItemsIndex(t)})}},Kz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>{n.invalidateQueries({queryKey:e.readAllIndex()})}},Gz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>n.invalidateQueries({queryKey:e.readLocaleIndex()})},i0=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readAllIndex(),queryFn(){return e.readAll().then(n=>n.map(r=>({...r,items:r.items.map(fc)})))},staleTime:1e3*60*5})},Yz=()=>{const t=Re.useQueryClient(),e=de.getFetchClient(),n=Fe(e);return g.useCallback(()=>{t.invalidateQueries({queryKey:n.getIndexPrefix()})},[t,e,n])},Xz=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return Promise.all(n.map(e.delete))}})},Qz=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn:e.copyNavigationItemLocale})},Zz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return Re.useMutation({mutationFn:e.copyNavigationLocale,onSuccess(){n.invalidateQueries({queryKey:e.readAllIndex()})}})},Jz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return Re.useMutation({mutationFn:e.create,onSuccess(){n.invalidateQueries({queryKey:e.readAllIndex()})}})},Uw=({onError:t,onSuccess:e})=>{const n=de.getFetchClient(),r=Fe(n),o=Re.useQueryClient();return Re.useMutation({mutationFn:r.update,onSuccess(i){o.invalidateQueries({queryKey:r.readAllIndex()}),e?.(i)},onError:t})},Kw=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return n?.length?Promise.all(n.map(r=>e.purge({documentId:r,withLangVersions:!0}))):e.purge({})}})},Tt=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readConfigIndex(),queryFn:e.readConfig})},eH=u.jsx(x2,{}),mc=({isVisible:t=!1,isActionAsync:e=!1,children:n,onConfirm:r,onCancel:o,header:i,labelCancel:s,labelConfirm:a,iconConfirm:l,mainIcon:c=eH})=>{const{formatMessage:d}=ue.useIntl();return t?u.jsx(vi.Root,{open:t,onOpenChange:h=>{!h&&t&&o?.(void 0)},title:i||d(R("components.confirmation.dialog.header","Confirmation")),children:u.jsxs(vi.Content,{children:[u.jsx(vi.Body,{icon:c,children:u.jsx(q,{justifyContent:"center",children:u.jsx(K,{id:"dialog-confirm-description",children:n||d(R("components.confirmation.dialog.description"))})})}),u.jsxs(vi.Footer,{children:[u.jsx(vi.Cancel,{children:u.jsx(ze,{fullWidth:!0,onClick:o,variant:"tertiary",disabled:e,children:s||d(R("components.confirmation.dialog.button.cancel","Cancel"))})}),u.jsx(ze,{fullWidth:!0,onClick:r,variant:"danger-light",startIcon:l||u.jsx(fs,{}),disabled:e,children:a||d(R("components.confirmation.dialog.button.confirm","Confirm"))})]})]})}):null},gg=u.jsx(u.Fragment,{}),tH=({onConfirm:t,onCancel:e})=>{const{formatMessage:n}=ue.useIntl();return u.jsx(mc,{isVisible:!0,header:n(R("pages.view.actions.i18nCopyItems.confirmation.header")),labelConfirm:n(R("pages.view.actions.i18nCopyItems.confirmation.confirm")),iconConfirm:gg,mainIcon:gg,onConfirm:t,onCancel:e,children:n(R("pages.view.actions.i18nCopyItems.confirmation.content"))})},nH=t=>{const[e,n]=g.useState(!1),[r,o]=g.useState(void 0),i=g.useCallback(()=>{n(!1)},[n]),s=g.useCallback(()=>{r&&(t(r),n(!1))},[t,r]),a=g.useMemo(()=>e?u.jsx(tH,{onConfirm:s,onCancel:i}):null,[e,s,i]);return g.useMemo(()=>({setI18nCopyModalOpened:n,setI18nCopySourceLocale:o,i18nCopyItemsModal:a,i18nCopySourceLocale:r}),[o,n,a,r])},rH=()=>{const t=Gz(),e=Kz();g.useEffect(()=>{t(),e()},[])},oH=({cancel:t,perform:e,trigger:n})=>{const r={};return{perform:o=>{const i=o??r.value;i&&e(i)},trigger:o=>{r.value=o,n()},cancel:t}},iH=(t,e)=>{const n=o0(),[r,o]=g.useState(),[i,s]=g.useState(!1),a=g.useMemo(()=>oH({perform:c=>{o(c),s(!1),e(!1)},trigger:()=>s(!0),cancel:()=>s(!1)}),[o,s]),l=g.useMemo(()=>(n.data?[n.data.defaultLocale,...n.data.restLocale]:[]).filter(c=>c!==r),[n.data,r]);return g.useEffect(()=>{!r&&n.data?.defaultLocale&&(o(n.data?.defaultLocale),e(!1))},[t,r,n.data?.defaultLocale]),{localeData:n.data,currentLocale:r,isChangeLanguageVisible:i,changeCurrentLocaleAction:a,availableLocales:l}},sH=t=>{const[e,n]=g.useState(),[r,o]=g.useState(!1),i=g.useCallback((c,d={})=>{n(d),o(c)},[o]),s=g.useCallback(()=>{i(!1)},[i]),a=g.useCallback((c,d,h=!0,f="",m=!0,b="0",p=0)=>{t&&(c.preventDefault(),c.stopPropagation(),i(!0,{viewParentId:d,isMenuAllowedLevel:h,levelPath:f,parentAttachedToMenu:m,structureId:b,viewId:void 0,order:p+1}))},[i,t]),l=g.useCallback(({item:c,levelPath:d="",parentAttachedToMenu:h=!0})=>{i(!0,{...c,levelPath:d,parentAttachedToMenu:h})},[i]);return{activeNavigationItem:e,addNewNavigationItem:a,editNavigationItem:l,closeNavigationItemPopup:s,isItemPopupVisible:r}},Gw=(t,e,n)=>{const r=t.reduce((o,i)=>{const s=i.items?.length?Gw(i.items??[],e):[];return e(i)?[i,...s,...o]:[...s,...o]},[]);if(n!==void 0){const o=n%r.length;return r.map((i,s)=>o===s?{...i,isSearchActive:!0}:i)}return r},aH=t=>{const[{value:e,index:n},r]=g.useState({value:"",index:0}),o=oe.isEmpty(e),i=(e||"").toLowerCase(),s=o?[]:Gw(t?.items.map(a=>({...a}))??[],a=>(a?.title||"").toLowerCase().includes(i),i?n:void 0);return{searchValue:e,setSearchValue:r,isSearchEmpty:o,filteredList:s}},vd=t=>`plugin::navigation.${t}`,xd={read:"read",update:"update",settings:"settings"},Br={access:[{action:vd(xd.read),subject:null}],update:[{action:vd(xd.update),subject:null}],settings:[{action:vd(xd.settings),subject:null}]},lH=()=>{const t=g.useMemo(()=>({access:Br.access||Br.update,update:Br.update}),[]),{isLoading:e,allowedActions:{canUpdate:n,canAccess:r}}=de.useRBAC(t);return{canAccess:r,canUpdate:n,isLoadingForPermissions:e}},yi=(t=[])=>oe.orderBy(t,["order"],["asc"]).map((e,n)=>{const r=n+1;return{...e,order:r,updated:e.updated||r!==e.order}}),ga=(t,e)=>t.type==="INTERNAL"?{type:"INTERNAL",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,path:t.path,title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[],autoSync:t.autoSync,items:t.items?.length?Io(t,t.items,e):t.items,related:{__type:t.relatedType,documentId:t.related},viewId:t.viewId,viewParentId:t.viewParentId,structureId:t.structureId,removed:t.removed,updated:t.updated}:t.type==="EXTERNAL"?{type:"EXTERNAL",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,autoSync:t.autoSync,items:t.items?.length?Io(t,t.items,e):t.items,path:"",viewId:t.viewId,structureId:t.structureId,viewParentId:t.viewParentId,removed:t.removed,updated:t.updated,externalPath:t.externalPath??"",audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[]}:{type:"WRAPPER",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,path:t.path??"",title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[],autoSync:t.autoSync,items:t.items?.length?Io(t,t.items,e):t.items,viewId:t.viewId,viewParentId:t.viewParentId,structureId:t.structureId,removed:t.removed,updated:t.updated},Io=(t,e=[],n)=>{if(!t.viewParentId){if(t.viewId){const o=e.map(i=>i.viewId===t.viewId?ga(t,n):{...i,items:i.items?.length?Io(t,i.items,n):i.items});return yi(o)}return[...yi([...e,ga({...t,viewId:Date.now()},n)])]}const r=e.map(o=>{const i=o.items||[];if(t.viewParentId===o.viewId){if(!t.viewId)return{...o,items:[...yi([...i,ga({...t,viewId:Date.now()},n)])]};const s=i.map(a=>a.viewId===t.viewId?ga(t,n):a);return{...o,items:yi(s)}}return{...o,items:o.items?.length?Io(t,o.items,n):o.items}});return yi(r)},gc=(t,e)=>{const n=e?.contentTypes??[],r=e?.contentTypesNameFields??{},o=r.default??[],{__collectionUid:i}=t,s=n.find(({uid:d})=>d===i);if(s?.isSingle)return s.labelSingular;const a=[...o,...o.map(d=>oe.capitalize(d))],l=oe.get(r,`${s?s.uid:i}`,a),c=(oe.isEmpty(l)?a:l).map(d=>t[d]).filter(d=>d);return oe.first(c)||""},cH=({relatedRef:t,relatedType:e={},type:n,isCollection:r})=>r?e.available||t.available:n==="INTERNAL"&&(t?"publishedAt"in t:!1)?oe.get(t,"publishedAt",!0):!0,lr=(t,e=!1)=>{const{__type:n,documentId:r}=t.type==="INTERNAL"&&t.related?t.related:{__type:"",documentId:""};return t.type==="INTERNAL"?{type:"INTERNAL",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},path:t.path??"",relatedType:n,related:r,title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,externalPath:void 0,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(o=>lr(o))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive}:t.type==="EXTERNAL"?{type:"EXTERNAL",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,externalPath:t.externalPath,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(o=>lr(o))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive}:{type:"WRAPPER",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(o=>lr(o))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive,path:t.path??""}},Yw=t=>t.find(({isPending:e})=>e),xo=(t,e)=>t.collapsed!==e?{...t,collapsed:e,updated:!0,items:t.items?.map(n=>xo(n,e))}:{...t,items:t.items?.map(n=>xo(n,e))},li=({start:t,end:e})=>u.jsxs(et.Footer,{children:[u.jsx(et.Close,{children:pg(t)}),pg(e)]}),pg=t=>t?u.jsx(ze,{onClick:t.onClick,variant:t.variant,disabled:t.disabled,children:t.children}):null,dH=({alreadyUsedNames:t})=>B.z.object({name:B.z.string().min(2).and(B.z.string().refine(e=>!t.includes(e),"Name already used")),visible:B.z.boolean()}),Xw=({navigation:t,onChange:e,alreadyUsedNames:n=[],isLoading:r})=>{const[o,i]=g.useState({}),[s,a]=g.useState(),{formatMessage:l}=ue.useIntl(),{name:c,visible:d}=o,h=(b,p,v)=>{if(v){let x=b,y=p;if(oe.isObject(b)){const{name:$,value:S}=b.target;x=$,y=oe.isNil(y)?S:y}return oe.isString(x)&&f(x,y),v(b,y)}},f=(b,p)=>{i(oe.set({...o},b,p))},m=b=>{const p=oe.get(s,b);if(p)return p};return g.useEffect(()=>{t&&(t.name?i({...t}):(i({name:"New navigation",visible:!0}),e({name:"New navigation",visible:!0,disabled:!0})))},[]),g.useEffect(()=>{if(`${c}-${d}`!=`${t.name}-${t.visible}`){const{error:b}=dH({alreadyUsedNames:n}).safeParse(o);e({...t,name:c,visible:d,disabled:!oe.isEmpty(b?.issues)}),a(b?b.issues.reduce((p,v)=>({...p,[v.path.join(".")]:v.message}),{}):void 0)}},[c,d]),u.jsx(de.Form,{width:"auto",height:"auto",method:"POST",initialValues:o,children:({values:b,onChange:p})=>u.jsxs(ee.Root,{gap:5,children:[u.jsx(ee.Item,{col:6,children:u.jsx(Ce.Field,{name:"name",label:l(R("popup.navigation.form.name.label","Name")),error:m("name"),children:u.jsx(pn,{name:"name",type:"string",placeholder:l(R("popup.navigation.form.name.placeholder","Navigations's name")),onChange:(v,x)=>h(v,x,p),value:b.name,disabled:r})})}),u.jsx(ee.Item,{col:6,children:u.jsx(Ce.Field,{name:"visible",label:l(R("popup.navigation.form.visible.label","Visibility")),error:m("visible"),children:u.jsx(wn,{name:"visible",checked:b.visible,onChange:v=>h(v,!b.visible,p),onLabel:l(R("popup.navigation.form.visible.toggle.visible")),offLabel:l(R("popup.navigation.form.visible.toggle.hidden")),disabled:r,width:"100%"})})})]})})},uH={name:"",items:[],visible:!1},hH=({setState:t,current:e,isLoading:n,alreadyUsedNames:r})=>{const o=g.useCallback(({disabled:i,...s})=>{t({view:"CREATE",current:s,alreadyUsedNames:r,disabled:i})},[t]);return u.jsx(Xw,{alreadyUsedNames:r,navigation:e,onChange:o,isLoading:n})},fH=({onSubmit:t,onReset:e,disabled:n,isLoading:r})=>{const{formatMessage:o}=ue.useIntl();return u.jsx(li,{start:{children:o(R("popup.item.form.button.cancel")),variant:"tertiary",disabled:r,onClick:e},end:{children:o(R("popup.navigation.manage.button.save")),variant:"default",disabled:r||n,onClick:t}})},mH=u.jsx(ef,{}),gH=u.jsx(nf,{}),bg=u.jsx(a7,{}),pH=({navigations:t,selected:e,setState:n})=>{const r=Tt(),o=!!e.length,{formatMessage:i}=ue.useIntl(),s=o0(),a=g.useCallback(()=>n({navigations:t,selected:o?[]:t.map(v=>v),view:"LIST"}),[n,t,o]),l=g.useMemo(()=>new Set(e.map(ja.prop("documentId"))),[e]),c=(v,x)=>()=>{n({navigations:t,selected:x?e.filter(({documentId:y})=>y!==v.documentId):e.concat([v]),view:"LIST"})},d=v=>()=>{n({view:"EDIT",current:v,navigation:v,alreadyUsedNames:t.reduce((x,{name:y})=>y!==v.name?x.concat([y]):x,[])})},h=v=>()=>{n({view:"DELETE",navigations:v})},f=v=>()=>{n({view:"CACHE_PURGE",navigations:v})},m=g.useCallback(h(e),[h]),b=g.useCallback(f(e),[f]),p=v=>[v].concat(t.filter(x=>x.documentId===v.documentId&&x.locale!==v.locale));return u.jsxs(u.Fragment,{children:[u.jsx(ee.Root,{children:u.jsx(ee.Item,{col:12,paddingBottom:3,children:o?u.jsxs(q,{direction:"row",gap:1,children:[u.jsx(Z,{paddingRight:3,children:i(R("popup.navigation.manage.table.hasSelected"),{count:e.length})}),u.jsx(ze,{onClick:m,variant:"tertiary",children:i(R("popup.navigation.manage.button.delete"))}),r.data?.isCacheEnabled?u.jsx(ze,{onClick:b,variant:"tertiary",children:i(R("popup.navigation.manage.button.purge"))}):null]}):null})}),u.jsxs(Bw,{rowCount:t.length,colCount:6,children:[u.jsx(Vw,{children:u.jsxs(wl,{children:[u.jsx(Pt,{children:u.jsx(os,{onCheckedChange:a,check:o})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.id"))})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.name"))})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.locale"))})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.visibility"))})}),u.jsx(Pt,{children:r.data?.isCacheEnabled?u.jsx(q,{direction:"row",children:u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:f([]),label:i(R("popup.navigation.manage.button.purge")),noBorder:!0,children:bg})})}):null})]})}),u.jsx(Fw,{children:t.filter(({locale:v})=>v===s.data?.defaultLocale).map(v=>u.jsxs(wl,{children:[u.jsx(Wt,{children:u.jsx(os,{onCheckedChange:c(v,l.has(v.documentId)),checked:l.has(v.documentId)})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:v.documentId})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:v.name})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:p(v).map(ja.prop("locale")).join(", ")})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:v.visible?i(R("popup.navigation.manage.navigation.visible")):i(R("popup.navigation.manage.navigation.hidden"))})}),u.jsx(Wt,{children:u.jsxs(q,{width:"100%",direction:"row",alignItems:"center",justifyContent:"flex-end",children:[u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:d(v),label:i(R("popup.navigation.manage.button.edit")),noBorder:!0,children:mH})}),u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:h([v]),label:i(R("popup.navigation.manage.button.delete")),noBorder:!0,children:gH})}),r.data?.isCacheEnabled?u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:f([v]),label:i(R("popup.navigation.manage.button.purge")),noBorder:!0,children:bg})}):null]})})]},v.documentId))})]})]})},bH=({onClose:t,state:e,setState:n,navigations:r,isLoading:o})=>{const{formatMessage:i}=ue.useIntl();return u.jsx(li,{start:{onClick:t,variant:"tertiary",disabled:o,children:i(R("popup.item.form.button.cancel"))},end:{onClick:()=>n({view:"CREATE",alreadyUsedNames:r.map(({name:s})=>s),current:uH}),variant:"default",disabled:o,children:i(R("popup.navigation.manage.button.create"))}})},vH=({navigations:t})=>{const{formatMessage:e}=ue.useIntl();return u.jsxs(ee.Root,{children:[u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(q,{children:u.jsx(K,{variant:"beta",children:e(R("popup.navigation.manage.delete.header"))})})}),u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(K,{variant:"omega",fontWeight:"semiBold",children:wH(t)})})]})},xH=({state:t,onSubmit:e,onReset:n,isLoading:r})=>{const{formatMessage:o}=ue.useIntl();return u.jsx(li,{start:{children:o(R("popup.item.form.button.cancel")),disabled:r,onClick:n,variant:"tertiary"},end:{children:o(R("popup.navigation.manage.button.delete")),disabled:r,onClick:e,variant:"danger"}})},wH=t=>t.map(ja.prop("name")).join(", "),yH=({errors:t})=>{const{formatMessage:e}=ue.useIntl(),{toggleNotification:n}=de.useNotification();return g.useEffect(()=>{t.map(r=>{n({type:"warning",message:e({id:"",defaultMessage:r.message})}),console.error(r)})},[]),u.jsx(ee.Root,{children:u.jsx(ee.Item,{col:12,children:e(R("popup.navigation.manage.error.message"))})})},CH=({onReset:t})=>{const{formatMessage:e}=ue.useIntl();return u.jsx(li,{end:{children:e(R("popup.navigation.manage.button.goBack")),onClick:t,variant:"secondary"}})},$H=({alreadyUsedNames:t,current:e,isLoading:n,navigation:r,setState:o})=>{const i=g.useMemo(()=>e??r,[e]),s=g.useCallback(({disabled:a,...l})=>{o({view:"EDIT",alreadyUsedNames:t,current:l,disabled:a,navigation:r})},[o,r,t]);return u.jsx(Xw,{navigation:i,onChange:s,isLoading:n,alreadyUsedNames:t})},SH=({onSubmit:t,onReset:e,disabled:n,isLoading:r})=>{const{formatMessage:o}=ue.useIntl();return u.jsx(li,{start:{children:o(R("popup.item.form.button.cancel")),disabled:r,onClick:e,variant:"tertiary"},end:{children:o(R("popup.navigation.manage.button.save")),disabled:r||n,onClick:t,variant:"secondary"}})},AH=({navigations:t})=>{const{formatMessage:e}=ue.useIntl();return u.jsxs(ee.Root,{children:[u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(q,{children:u.jsx(K,{variant:"beta",children:e(R("popup.navigation.manage.purge.header"))})})}),u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(K,{variant:"omega",fontWeight:"semiBold",children:TH(t)})})]})},kH=({onSubmit:t,onReset:e,isLoading:n})=>{const{formatMessage:r}=ue.useIntl();return u.jsx(li,{start:{children:r(R("popup.item.form.button.cancel")),disabled:n,onClick:e,variant:"tertiary"},end:{children:r(R("popup.navigation.manage.footer.button.purge")),disabled:n,onClick:t,variant:"danger"}})},TH=t=>t.map(ja.prop("name")).join(", "),RH=({initialState:t,isOpened:e,onClose:n})=>{const{formatMessage:r}=ue.useIntl(),[o,i]=g.useState(t),{toggleNotification:s}=de.useNotification(),a=Yz(),l=Xz(),c=Jz(),d=Uw({}),h=Kw(),f=i0(),m=o0(),b=g.useMemo(()=>oe.sortBy(f.data??[],"id"),[f.data]),p=Yw([l,f,c,d,h,m]),v=g.useCallback(()=>i({view:"INITIAL"}),[i]),x=g.useCallback(async()=>{const A=o.view==="DELETE"?()=>{l.mutate(o.navigations.reduce((k,T)=>(T.documentId&&k.push(T.documentId),k),[]),{onSuccess:a})}:o.view==="EDIT"?()=>{d.mutate(o.current,{onSuccess(){a(),s({type:"success",message:r(R("notification.navigation.submit"))})},onError(k){console.warn(k),s({type:"warning",message:r(R("notification.navigation.error"),{errorTitles:""})})}})}:o.view==="CREATE"&&o.current?()=>{c.mutate(o.current,{onSuccess(){a(),s({type:"success",message:r(R("notification.navigation.submit"))})},onError(k){console.warn(k),s({type:"warning",message:r(R("notification.navigation.error"),{errorTitles:""})})}})}:o.view==="CACHE_PURGE"?()=>{h.mutate(o.navigations.reduce((k,T)=>(T.documentId&&k.push(T.documentId),k),[]),{onSuccess:a})}:()=>{};try{A(),i({view:"INITIAL"})}catch(k){i({view:"ERROR",errors:k instanceof Error?[k]:[]})}},[o,i,a,c,h,d,l,s,r,R]);g.useEffect(()=>{(o.view==="INITIAL"||o.view==="LIST")&&i({view:"LIST",navigations:b,selected:[]})},[o.view,b]);const y=MH(o,r,!!p),$=EH(o,i,!!p),S=IH({state:o,setState:i,onClose:n,onSubmit:x,onReset:v,navigations:b,isLoading:!!p});return u.jsx(et.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:A=>{A||n?.()},open:e,children:u.jsxs(et.Content,{children:[u.jsx(et.Header,{children:u.jsx(K,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",children:y})}),u.jsx(et.Body,{children:$}),S]})})},MH=(t,e,n)=>{switch(t.view){case"LIST":case"CREATE":case"ERROR":case"CACHE_PURGE":case"DELETE":return u.jsxs(q,{direction:"row",children:[n?u.jsx(xl,{small:!0}):null,e(R(`popup.navigation.manage.header.${t.view}`))]});case"EDIT":return u.jsxs(q,{direction:"row",children:[n?u.jsx(xl,{small:!0}):null,e(R("popup.navigation.manage.header.EDIT"),{name:t.navigation.name})]});case"INITIAL":return null;default:return s0(t)}},EH=(t,e,n)=>{const r={setState:e,isLoading:n};switch(t.view){case"LIST":return u.jsx(pH,{...t,...r});case"EDIT":return u.jsx($H,{...t,...r});case"CREATE":return u.jsx(hH,{...t,...r});case"DELETE":return u.jsx(vH,{...t,...r});case"CACHE_PURGE":return u.jsx(AH,{...t,...r});case"INITIAL":return u.jsx(xl,{small:!0});case"ERROR":return u.jsx(yH,{...t,...r});default:return s0(t)}},IH=t=>{switch(t.state.view){case"LIST":return u.jsx(bH,{...t});case"CREATE":return u.jsx(fH,{...t,disabled:t.state.disabled});case"EDIT":return u.jsx(SH,{...t,disabled:t.state.disabled});case"DELETE":return u.jsx(xH,{...t});case"CACHE_PURGE":return u.jsx(kH,{...t});case"ERROR":return u.jsx(CH,{...t});case"INITIAL":return null;default:return s0(t.state)}},s0=t=>(console.warn(`Unknown state "${t?.view}". (${JSON.stringify(t)})`),null),jH=()=>{const[t,e]=g.useState(!1),n=g.useCallback(()=>e(!0),[e]),r=g.useCallback(()=>e(!1),[e]),o=g.useMemo(()=>t?u.jsx(RH,{initialState:{view:"INITIAL"},isOpened:!0,onClose:r}):null,[t,r]);return g.useMemo(()=>({navigationManagerModal:o,openNavigationManagerModal:n,closeNavigationManagerModal:r}),[o,n,r])},vg=u.jsx(fs,{}),DH=({activeNavigation:t,availableNavigations:e,structureHasErrors:n,structureHasChanged:r,isSaving:o,handleChangeSelection:i,handleLocalizationSelection:s,handleSave:a,handleCachePurge:l,permissions:c={},locale:d,currentLocale:h})=>{const{formatMessage:f}=ue.useIntl(),{openNavigationManagerModal:m,navigationManagerModal:b}=jH(),p=!!d.restLocale,{canUpdate:v}=c,x=Tt();return u.jsx(u.Fragment,{children:u.jsx(de.Layouts.Header,{title:f(R("header.title","UI Navigation")),subtitle:f(R("header.description")),primaryAction:u.jsxs(q,{direction:"row",size:2,children:[u.jsx(Z,{children:u.jsxs(ee.Root,{gap:4,style:x.data?.isCacheEnabled?{display:"flex"}:void 0,children:[p?null:u.jsx(ee.Item,{col:2}),v&&u.jsx(ee.Item,{col:3,children:u.jsx(ze,{onClick:m,startIcon:null,type:"button",variant:"secondary",fullWidth:!0,size:"S",children:f(R("header.action.manage"))})}),u.jsx(ee.Item,{col:v?4:10,children:u.jsx(MF.Root,{width:"100%",children:u.jsx(Sn,{type:"select",placeholder:"Change navigation",name:"navigationSelect",onChange:y=>{const $=e.find(({documentId:S})=>y===S);$&&i($)},value:t?.documentId,size:"S",style:null,children:e.filter(({locale:y})=>y===h).map(({documentId:y,name:$})=>u.jsx(An,{value:y,children:$},y))})})}),p?u.jsx(ee.Item,{col:2,children:u.jsx(Sn,{type:"select",placeholder:f(R("pages.main.header.localization.select.placeholder")),name:"navigationLocalizationSelect",onChange:s,value:h,size:"S",children:[d.defaultLocale,...d.restLocale].map(y=>u.jsx(An,{value:y,children:y},y))})}):null,v&&u.jsx(ee.Item,{col:3,children:u.jsx(ze,{onClick:a,startIcon:vg,disabled:n||!r||o,type:"submit",fullWidth:!0,size:"S",children:f(R("submit.cta.save"))})}),x.data?.isCacheEnabled&&u.jsx(ee.Item,{col:3,children:u.jsx(ze,{onClick:l,startIcon:vg,variant:"danger",type:"submit",fullWidth:!0,size:"S",children:f(R("submit.cta.cache.purge"))})})]})}),v&&b]}),secondaryAction:u.jsx(Ow,{icon:u.jsx(g2,{"aria-hidden":!0}),children:t?f(R("header.meta"),{id:t?.documentId,key:t?.slug}):null})})})},xg=u.jsx(u.Fragment,{}),OH=({onConfirm:t,onCancel:e})=>{const{formatMessage:n}=ue.useIntl();return u.jsx(mc,{isVisible:!0,header:n(R("pages.view.actions.changeLanguage.confirmation.header")),labelConfirm:n(R("pages.view.actions.changeLanguage.confirmation.confirm")),iconConfirm:xg,mainIcon:xg,onConfirm:t,onCancel:e,children:n(R("pages.view.actions.changeLanguage.confirmation.content"))})},LH=({startActions:t,endActions:e})=>u.jsxs(q,{justifyContent:"space-between",width:"100%",children:[u.jsx(q,{alignItems:"space-between",children:t}),u.jsx(q,{alignItems:"space-between",children:e})]}),NH=en.default.div`
|
|
2201
|
+
`,ee=Object.freeze(Object.defineProperty({__proto__:null,Item:dz,Root:lz},Symbol.toStringTag,{value:"Module"})),hg={en:()=>Promise.resolve().then(()=>require("../_chunks/en-DO98mdcm.js")),fr:()=>Promise.resolve().then(()=>require("../_chunks/fr-CjFMUCWK.js")),ca:()=>Promise.resolve().then(()=>require("../_chunks/ca-BQn7S09g.js"))},Zu=t=>`${Ht}.${t}`,R=(t,e)=>({id:Zu(t),defaultMessage:e??Zu(t)}),n0=B.z.object({name:B.z.string({required_error:"requiredError"}).nonempty("requiredError").refine(t=>!t.includes(" "),{message:"noSpaceError"}),label:B.z.string({required_error:"requiredError"}).nonempty("requiredError"),description:B.z.string().optional(),placeholder:B.z.string().optional(),required:B.z.boolean().optional(),enabled:B.z.boolean().optional()}),hz=n0.extend({type:B.z.literal("select"),multi:B.z.boolean(),options:B.z.array(B.z.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),fz=n0.extend({type:B.z.enum(["boolean","string"]),multi:B.z.literal(!1).optional(),options:B.z.array(B.z.string()).max(0).optional()}),mz=n0.extend({type:B.z.literal("media"),multi:B.z.literal(!1).optional(),options:B.z.array(B.z.string()).max(0).optional()}),zw=B.z.discriminatedUnion("type",[fz,mz,hz]),gz=B.z.union([B.z.literal("audience"),zw]),pz=B.z.object({additionalFields:B.z.array(gz),allowedLevels:B.z.number(),availableAudience:B.z.object({id:B.z.number(),documentId:B.z.string(),name:B.z.string(),key:B.z.string()}).array(),contentTypes:B.z.array(B.z.string()),defaultContentType:B.z.string().optional(),contentTypesNameFields:B.z.record(B.z.string(),B.z.array(B.z.string())),contentTypesPopulate:B.z.record(B.z.string(),B.z.array(B.z.string())),gql:B.z.object({navigationItemRelated:B.z.array(B.z.string())}),pathDefaultFields:B.z.record(B.z.string(),B.z.any()),cascadeMenuAttached:B.z.boolean(),preferCustomContentTypes:B.z.boolean(),isCacheEnabled:B.z.boolean().optional(),isCachePluginEnabled:B.z.boolean().optional()}),bz=B.z.object({uid:B.z.string(),isDisplayed:B.z.boolean(),apiID:B.z.string(),kind:B.z.enum(["collectionType","singleType"]),info:B.z.object({singularName:B.z.string(),pluralName:B.z.string(),displayName:B.z.string(),description:B.z.string().optional()}),attributes:B.z.record(B.z.string(),B.z.unknown())}),vz=M.object({id:M.number(),documentId:M.string(),name:M.string(),key:M.string()}),Hw=M.enum(["INTERNAL","EXTERNAL","WRAPPER"]),xz=M.object({id:M.number(),documentId:M.string(),title:M.string(),type:Hw,path:M.string().or(M.null()).optional(),externalPath:M.string().or(M.null()).optional(),uiRouterKey:M.string(),menuAttached:M.boolean(),order:M.number().int(),collapsed:M.boolean(),autoSync:M.boolean().or(M.null()).optional(),related:M.object({documentId:M.string().optional(),__type:M.string()}).catchall(M.unknown()).nullish(),additionalFields:M.record(M.string(),M.unknown()).or(M.null()).optional(),audience:M.array(vz).or(M.null()).optional(),viewId:M.number().optional(),viewParentId:M.number().optional(),structureId:M.string().optional(),removed:M.boolean().optional(),isSearchActive:M.boolean().optional(),updated:M.boolean().optional()}),Pw=xz.extend({items:M.lazy(()=>Pw.array().or(M.null())).optional()}),fg=M.object({id:M.number(),documentId:M.string(),name:M.string(),slug:M.string(),locale:M.string(),visible:M.boolean(),items:M.array(Pw)}),r0=M.object({name:M.string({required_error:"requiredError"}).nonempty("requiredError").refine(t=>!t.includes(" "),{message:"noSpaceError"}),label:M.string({required_error:"requiredError"}).nonempty("requiredError"),description:M.string().optional(),placeholder:M.string().optional(),required:M.boolean().optional(),enabled:M.boolean().optional()}),wz=r0.extend({type:M.literal("select"),multi:M.boolean(),options:M.array(M.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),yz=r0.extend({type:M.enum(["boolean","string"]),multi:M.literal(!1).optional(),options:M.array(M.string()).max(0).optional()}),Cz=r0.extend({type:M.literal("media"),multi:M.literal(!1).optional(),options:M.array(M.string()).max(0).optional()}),$z=M.discriminatedUnion("type",[yz,Cz,wz]),Sz=M.union([M.literal("audience"),$z]),Az=M.object({uid:M.string(),name:M.string(),draftAndPublish:M.boolean(),isSingle:M.boolean(),description:M.string(),collectionName:M.string(),contentTypeName:M.string(),label:M.string(),labelSingular:M.string(),endpoint:M.string(),available:M.boolean(),visible:M.boolean()}),kz=M.object({additionalFields:M.array(Sz),allowedLevels:M.number(),availableAudience:M.object({id:M.number(),documentId:M.string(),name:M.string(),key:M.string()}).array(),contentTypes:M.array(M.string()),defaultContentType:M.string().optional(),contentTypesNameFields:M.record(M.string(),M.array(M.string())),contentTypesPopulate:M.record(M.string(),M.array(M.string())),gql:M.object({navigationItemRelated:M.array(M.string())}),pathDefaultFields:M.record(M.string(),M.string().array()),cascadeMenuAttached:M.boolean(),preferCustomContentTypes:M.boolean(),allowedContentTypes:M.string().array(),restrictedContentTypes:M.string().array(),isCacheEnabled:M.boolean().optional(),isCachePluginEnabled:M.boolean().optional()}),mg=kz.omit({contentTypes:!0}).extend({contentTypes:Az.array()}),Tz=M.object({defaultLocale:M.string(),restLocale:M.string().array()}),Rz=M.enum(["collectionType","singleType"]),Mz=M.object({singularName:M.string(),pluralName:M.string(),displayName:M.string(),description:M.string().optional(),name:M.string().optional()}),Ww=M.object({required:M.boolean().optional(),max:M.number().optional(),min:M.number().optional(),minLength:M.number().optional(),maxLength:M.number().optional(),private:M.boolean().optional(),configurable:M.boolean().optional(),default:M.any().optional()}),Ez=M.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),Iz=Ww.extend({type:Ez}),jz=Ww.extend({type:M.literal("enumeration"),enum:M.string().array()}),Dz=M.object({type:M.literal("component"),component:M.string(),repeatable:M.boolean().optional()}),Oz=M.object({type:M.literal("dynamiczone"),components:M.string().array()}),Lz=M.object({media:M.literal("media"),allowedTypes:M.enum(["images","videos","audios","files"]).array(),required:M.boolean().optional()}),Nz=M.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),Bz=M.object({type:M.literal("relation"),relation:Nz,target:M.string(),mappedBy:M.string().optional(),inversedBy:M.string().optional()}),Fz=M.record(M.string(),M.union([Iz,jz,Dz,Oz,Bz,Lz])),Vz=M.object({kind:Rz,collectionName:M.string(),info:Mz,options:M.object({draftAndPublish:M.boolean().optional(),hidden:M.boolean().optional(),templateName:M.string().optional()}).optional(),attributes:Fz,actions:M.record(M.string(),M.any()).optional(),lifecycles:M.record(M.string(),M.any()).optional(),uid:M.string(),apiName:M.string().optional(),associations:M.object({model:M.string(),alias:M.string()}).array().optional(),modelName:M.string().optional(),plugin:M.string().optional(),pluginOptions:M.record(M.string(),M.any()).optional(),isSingle:M.boolean().optional()});Vz.pick({info:!0,kind:!0,attributes:!0,options:!0});const _z=M.object({id:M.number(),documentId:M.string(),locale:M.string().or(M.null()).optional()}).and(M.record(M.string(),M.any())),zz=M.object({slug:M.string()}),Hz=M.object({externalPath:M.string().or(M.null()).optional(),path:M.string().or(M.null()).optional(),related:M.object({documentId:M.string().optional(),__type:M.string()}).catchall(M.unknown()).nullish(),title:M.string(),type:Hw,uiRouterKey:M.string()}),Ne="navigation",Fe=oe.once(t=>({getIndexPrefix(){return[Ne]},readAll(){return t.get(`/${Ne}`).then(({data:e})=>fg.array().parse(e))},readAllIndex(){return[Ne,"navigations"]},delete(e){return t.del(`/${Ne}/${e}`)},create(e){return t.post(`/${Ne}/`,e)},update(e){return t.put(`/${Ne}/${e.documentId}`,e).then(({data:n})=>n).then(fg.parse)},purge({documentId:e,withLangVersions:n}){return t.del(`/${Ne}/cache/purge/${e??""}?clearLocalisations=${!!n}`)},slugify(e){const n=new URLSearchParams;return n.append("q",e),t.get(`/${Ne}/slug?${n.toString()}`).then(({data:r})=>zz.parse(r)).then(({slug:r})=>r)},readConfig(){return t.get(`/${Ne}/config`).then(({data:e})=>mg.parse(e))},readConfigIndex(){return[Ne,"config"]},healthCheck(){return t.get("/_health")},healthCheckIndex(){return["health"]},readNavigationItemFromLocale({source:e,structureId:n,target:r,documentId:o}){return t.get(`/${Ne}/i18n/item/read/${o}/${e}/${r}?path=${n}`)},updateConfig(e){return t.put(`/${Ne}/config`,e).then(()=>{})},restart(){return t.get(`/${Ne}/settings/restart`).then(()=>{})},restoreConfig(){return t.del(`/${Ne}/config`).then(()=>{})},readSettingsConfig(){return t.get(`/${Ne}/settings/config`).then(({data:e})=>{const n=mg.parse(e);return{...n,contentTypes:n.contentTypes.map(({uid:r})=>r)}})},readSettingsConfigIndex(){return[Ne,"config"]},readContentType(){return t.get("/content-manager/content-types").then(({data:e})=>bz.array().parse(e.data))},readContentTypeIndex(){return[Ne,"content-manager","content-types"]},readContentTypeItems({uid:e,locale:n,query:r}){const o=new URLSearchParams;return r&&o.append("_q",r),n&&o.append("locale",n),t.get(`/${Ne}/content-type-items/${e}?${o.toString()}`).then(({data:i})=>_z.array().parse(i))},readContentTypeItemsIndex({uid:e,locale:n,query:r}){return[Ne,"content-manager","content-type-items",e,n,r]},readLocale(){return t.get(`/${Ne}/settings/locale`).then(e=>Tz.parse(e.data))},readLocaleIndex(){return[Ne,"locale"]},copyNavigationLocale({documentId:e,source:n,target:r}){return t.put(`/${Ne}/i18n/copy/${e}/${n}/${r}`)},copyNavigationItemLocale({source:e,structureId:n="",target:r}){return t.get(`/${Ne}/i18n/item/read/${e}/${r}?path=${n}`).then(o=>Hz.parse(o.data))}})),fc=t=>({...t,viewId:Math.floor(Math.random()*152e4),items:t.items?.map(fc)}),o0=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readLocaleIndex(),queryFn:e.readLocale,staleTime:1/0})},qw=t=>{const e=de.getFetchClient(),n=Fe(e);return Re.useQuery({queryKey:n.readContentTypeItemsIndex(t),queryFn:()=>n.readContentTypeItems(t),staleTime:1e3*60*3,enabled:!!t.uid})},Pz=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readContentTypeIndex(),queryFn:()=>e.readContentType(),staleTime:1e3*60*3})},Wz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>{n.resetQueries({queryKey:e.readAllIndex()})}},qz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>{n.resetQueries({queryKey:e.readContentTypeIndex()})}},Uz=t=>{const e=de.getFetchClient(),n=Fe(e),r=Re.useQueryClient();return()=>{r.invalidateQueries({queryKey:n.readContentTypeItemsIndex(t)})}},Kz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>{n.invalidateQueries({queryKey:e.readAllIndex()})}},Gz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return()=>n.invalidateQueries({queryKey:e.readLocaleIndex()})},i0=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readAllIndex(),queryFn(){return e.readAll().then(n=>n.map(r=>({...r,items:r.items.map(fc)})))},staleTime:1e3*60*5})},Yz=()=>{const t=Re.useQueryClient(),e=de.getFetchClient(),n=Fe(e);return g.useCallback(()=>{t.invalidateQueries({queryKey:n.getIndexPrefix()})},[t,e,n])},Xz=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return Promise.all(n.map(e.delete))}})},Qz=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn:e.copyNavigationItemLocale})},Zz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return Re.useMutation({mutationFn:e.copyNavigationLocale,onSuccess(){n.invalidateQueries({queryKey:e.readAllIndex()})}})},Jz=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQueryClient();return Re.useMutation({mutationFn:e.create,onSuccess(){n.invalidateQueries({queryKey:e.readAllIndex()})}})},Uw=({onError:t,onSuccess:e})=>{const n=de.getFetchClient(),r=Fe(n),o=Re.useQueryClient();return Re.useMutation({mutationFn:r.update,onSuccess(i){o.invalidateQueries({queryKey:r.readAllIndex()}),e?.(i)},onError:t})},Kw=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return n?.length?Promise.all(n.map(r=>e.purge({documentId:r,withLangVersions:!0}))):e.purge({})}})},Tt=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readConfigIndex(),queryFn:e.readConfig})},eH=u.jsx(x2,{}),mc=({isVisible:t=!1,isActionAsync:e=!1,children:n,onConfirm:r,onCancel:o,header:i,labelCancel:s,labelConfirm:a,iconConfirm:l,mainIcon:c=eH})=>{const{formatMessage:d}=ue.useIntl();return t?u.jsx(vi.Root,{open:t,onOpenChange:h=>{!h&&t&&o?.(void 0)},title:i||d(R("components.confirmation.dialog.header","Confirmation")),children:u.jsxs(vi.Content,{children:[u.jsx(vi.Body,{icon:c,children:u.jsx(q,{justifyContent:"center",children:u.jsx(K,{id:"dialog-confirm-description",children:n||d(R("components.confirmation.dialog.description"))})})}),u.jsxs(vi.Footer,{children:[u.jsx(vi.Cancel,{children:u.jsx(ze,{fullWidth:!0,onClick:o,variant:"tertiary",disabled:e,children:s||d(R("components.confirmation.dialog.button.cancel","Cancel"))})}),u.jsx(ze,{fullWidth:!0,onClick:r,variant:"danger-light",startIcon:l||u.jsx(fs,{}),disabled:e,children:a||d(R("components.confirmation.dialog.button.confirm","Confirm"))})]})]})}):null},gg=u.jsx(u.Fragment,{}),tH=({onConfirm:t,onCancel:e})=>{const{formatMessage:n}=ue.useIntl();return u.jsx(mc,{isVisible:!0,header:n(R("pages.view.actions.i18nCopyItems.confirmation.header")),labelConfirm:n(R("pages.view.actions.i18nCopyItems.confirmation.confirm")),iconConfirm:gg,mainIcon:gg,onConfirm:t,onCancel:e,children:n(R("pages.view.actions.i18nCopyItems.confirmation.content"))})},nH=t=>{const[e,n]=g.useState(!1),[r,o]=g.useState(void 0),i=g.useCallback(()=>{n(!1)},[n]),s=g.useCallback(()=>{r&&(t(r),n(!1))},[t,r]),a=g.useMemo(()=>e?u.jsx(tH,{onConfirm:s,onCancel:i}):null,[e,s,i]);return g.useMemo(()=>({setI18nCopyModalOpened:n,setI18nCopySourceLocale:o,i18nCopyItemsModal:a,i18nCopySourceLocale:r}),[o,n,a,r])},rH=()=>{const t=Gz(),e=Kz();g.useEffect(()=>{t(),e()},[])},oH=({cancel:t,perform:e,trigger:n})=>{const r={};return{perform:o=>{const i=o??r.value;i&&e(i)},trigger:o=>{r.value=o,n()},cancel:t}},iH=(t,e)=>{const n=o0(),[r,o]=g.useState(),[i,s]=g.useState(!1),a=g.useMemo(()=>oH({perform:c=>{o(c),s(!1),e(!1)},trigger:()=>s(!0),cancel:()=>s(!1)}),[o,s]),l=g.useMemo(()=>(n.data?[n.data.defaultLocale,...n.data.restLocale]:[]).filter(c=>c!==r),[n.data,r]);return g.useEffect(()=>{!r&&n.data?.defaultLocale&&(o(n.data?.defaultLocale),e(!1))},[t,r,n.data?.defaultLocale]),{localeData:n.data,currentLocale:r,isChangeLanguageVisible:i,changeCurrentLocaleAction:a,availableLocales:l}},sH=t=>{const[e,n]=g.useState(),[r,o]=g.useState(!1),i=g.useCallback((c,d={})=>{n(d),o(c)},[o]),s=g.useCallback(()=>{i(!1)},[i]),a=g.useCallback((c,d,h=!0,f="",m=!0,p="0",b=0)=>{t&&(c.preventDefault(),c.stopPropagation(),i(!0,{viewParentId:d,isMenuAllowedLevel:h,levelPath:f,parentAttachedToMenu:m,structureId:p,viewId:void 0,order:b+1}))},[i,t]),l=g.useCallback(({item:c,levelPath:d="",parentAttachedToMenu:h=!0})=>{i(!0,{...c,levelPath:d,parentAttachedToMenu:h})},[i]);return{activeNavigationItem:e,addNewNavigationItem:a,editNavigationItem:l,closeNavigationItemPopup:s,isItemPopupVisible:r}},Gw=(t,e,n)=>{const r=t.reduce((o,i)=>{const s=i.items?.length?Gw(i.items??[],e):[];return e(i)?[i,...s,...o]:[...s,...o]},[]);if(n!==void 0){const o=n%r.length;return r.map((i,s)=>o===s?{...i,isSearchActive:!0}:i)}return r},aH=t=>{const[{value:e,index:n},r]=g.useState({value:"",index:0}),o=oe.isEmpty(e),i=(e||"").toLowerCase(),s=o?[]:Gw(t?.items.map(a=>({...a}))??[],a=>(a?.title||"").toLowerCase().includes(i),i?n:void 0);return{searchValue:e,setSearchValue:r,isSearchEmpty:o,filteredList:s}},vd=t=>`plugin::navigation.${t}`,xd={read:"read",update:"update",settings:"settings"},Br={access:[{action:vd(xd.read),subject:null}],update:[{action:vd(xd.update),subject:null}],settings:[{action:vd(xd.settings),subject:null}]},lH=()=>{const t=g.useMemo(()=>({access:Br.access||Br.update,update:Br.update}),[]),{isLoading:e,allowedActions:{canUpdate:n,canAccess:r}}=de.useRBAC(t);return{canAccess:r,canUpdate:n,isLoadingForPermissions:e}},yi=(t=[])=>oe.orderBy(t,["order"],["asc"]).map((e,n)=>{const r=n+1;return{...e,order:r,updated:e.updated||r!==e.order}}),ga=(t,e)=>t.type==="INTERNAL"?{type:"INTERNAL",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,path:t.path,title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[],autoSync:t.autoSync,items:t.items?.length?Io(t,t.items,e):t.items,related:{__type:t.relatedType,documentId:t.related},viewId:t.viewId,viewParentId:t.viewParentId,structureId:t.structureId,removed:t.removed,updated:t.updated}:t.type==="EXTERNAL"?{type:"EXTERNAL",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,autoSync:t.autoSync,items:t.items?.length?Io(t,t.items,e):t.items,path:"",viewId:t.viewId,structureId:t.structureId,viewParentId:t.viewParentId,removed:t.removed,updated:t.updated,externalPath:t.externalPath??"",audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[]}:{type:"WRAPPER",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,path:t.path??"",title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[],autoSync:t.autoSync,items:t.items?.length?Io(t,t.items,e):t.items,viewId:t.viewId,viewParentId:t.viewParentId,structureId:t.structureId,removed:t.removed,updated:t.updated},Io=(t,e=[],n)=>{if(!t.viewParentId){if(t.viewId){const o=e.map(i=>i.viewId===t.viewId?ga(t,n):{...i,items:i.items?.length?Io(t,i.items,n):i.items});return yi(o)}return[...yi([...e,ga({...t,viewId:Date.now()},n)])]}const r=e.map(o=>{const i=o.items||[];if(t.viewParentId===o.viewId){if(!t.viewId)return{...o,items:[...yi([...i,ga({...t,viewId:Date.now()},n)])]};const s=i.map(a=>a.viewId===t.viewId?ga(t,n):a);return{...o,items:yi(s)}}return{...o,items:o.items?.length?Io(t,o.items,n):o.items}});return yi(r)},gc=(t,e)=>{const n=e?.contentTypes??[],r=e?.contentTypesNameFields??{},o=r.default??[],{__collectionUid:i}=t,s=n.find(({uid:d})=>d===i);if(s?.isSingle)return s.labelSingular;const a=[...o,...o.map(d=>oe.capitalize(d))],l=oe.get(r,`${s?s.uid:i}`,a),c=(oe.isEmpty(l)?a:l).map(d=>t[d]).filter(d=>d);return oe.first(c)||""},cH=({relatedRef:t,relatedType:e={},type:n,isCollection:r})=>r?e.available||t.available:n==="INTERNAL"&&(t?"publishedAt"in t:!1)?oe.get(t,"publishedAt",!0):!0,lr=(t,e=!1)=>{const{__type:n,documentId:r}=t.type==="INTERNAL"&&t.related?t.related:{__type:"",documentId:""};return t.type==="INTERNAL"?{type:"INTERNAL",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},path:t.path??"",relatedType:n,related:r,title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,externalPath:void 0,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(o=>lr(o))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive}:t.type==="EXTERNAL"?{type:"EXTERNAL",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,externalPath:t.externalPath,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(o=>lr(o))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive}:{type:"WRAPPER",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(o=>lr(o))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive,path:t.path??""}},Yw=t=>t.find(({isPending:e})=>e),xo=(t,e)=>t.collapsed!==e?{...t,collapsed:e,updated:!0,items:t.items?.map(n=>xo(n,e))}:{...t,items:t.items?.map(n=>xo(n,e))},li=({start:t,end:e})=>u.jsxs(et.Footer,{children:[u.jsx(et.Close,{children:pg(t)}),pg(e)]}),pg=t=>t?u.jsx(ze,{onClick:t.onClick,variant:t.variant,disabled:t.disabled,children:t.children}):null,dH=({alreadyUsedNames:t})=>B.z.object({name:B.z.string().min(2).and(B.z.string().refine(e=>!t.includes(e),"Name already used")),visible:B.z.boolean()}),Xw=({navigation:t,onChange:e,alreadyUsedNames:n=[],isLoading:r})=>{const[o,i]=g.useState({}),[s,a]=g.useState(),{formatMessage:l}=ue.useIntl(),{name:c,visible:d}=o,h=(p,b,v)=>{if(v){let x=p,y=b;if(oe.isObject(p)){const{name:$,value:S}=p.target;x=$,y=oe.isNil(y)?S:y}return oe.isString(x)&&f(x,y),v(p,y)}},f=(p,b)=>{i(oe.set({...o},p,b))},m=p=>{const b=oe.get(s,p);if(b)return b};return g.useEffect(()=>{t&&(t.name?i({...t}):(i({name:"New navigation",visible:!0}),e({name:"New navigation",visible:!0,disabled:!0})))},[]),g.useEffect(()=>{if(`${c}-${d}`!=`${t.name}-${t.visible}`){const{error:p}=dH({alreadyUsedNames:n}).safeParse(o);e({...t,name:c,visible:d,disabled:!oe.isEmpty(p?.issues)}),a(p?p.issues.reduce((b,v)=>({...b,[v.path.join(".")]:v.message}),{}):void 0)}},[c,d]),u.jsx(de.Form,{width:"auto",height:"auto",method:"POST",initialValues:o,children:({values:p,onChange:b})=>u.jsxs(ee.Root,{gap:5,children:[u.jsx(ee.Item,{col:6,children:u.jsx(Ce.Field,{name:"name",label:l(R("popup.navigation.form.name.label","Name")),error:m("name"),children:u.jsx(pn,{name:"name",type:"string",placeholder:l(R("popup.navigation.form.name.placeholder","Navigations's name")),onChange:(v,x)=>h(v,x,b),value:p.name,disabled:r})})}),u.jsx(ee.Item,{col:6,children:u.jsx(Ce.Field,{name:"visible",label:l(R("popup.navigation.form.visible.label","Visibility")),error:m("visible"),children:u.jsx(wn,{name:"visible",checked:p.visible,onChange:v=>h(v,!p.visible,b),onLabel:l(R("popup.navigation.form.visible.toggle.visible")),offLabel:l(R("popup.navigation.form.visible.toggle.hidden")),disabled:r,width:"100%"})})})]})})},uH={name:"",items:[],visible:!1},hH=({setState:t,current:e,isLoading:n,alreadyUsedNames:r})=>{const o=g.useCallback(({disabled:i,...s})=>{t({view:"CREATE",current:s,alreadyUsedNames:r,disabled:i})},[t]);return u.jsx(Xw,{alreadyUsedNames:r,navigation:e,onChange:o,isLoading:n})},fH=({onSubmit:t,onReset:e,disabled:n,isLoading:r})=>{const{formatMessage:o}=ue.useIntl();return u.jsx(li,{start:{children:o(R("popup.item.form.button.cancel")),variant:"tertiary",disabled:r,onClick:e},end:{children:o(R("popup.navigation.manage.button.save")),variant:"default",disabled:r||n,onClick:t}})},mH=u.jsx(ef,{}),gH=u.jsx(nf,{}),bg=u.jsx(a7,{}),pH=({navigations:t,selected:e,setState:n})=>{const r=Tt(),o=!!e.length,{formatMessage:i}=ue.useIntl(),s=o0(),a=g.useCallback(()=>n({navigations:t,selected:o?[]:t.map(v=>v),view:"LIST"}),[n,t,o]),l=g.useMemo(()=>new Set(e.map(ja.prop("documentId"))),[e]),c=(v,x)=>()=>{n({navigations:t,selected:x?e.filter(({documentId:y})=>y!==v.documentId):e.concat([v]),view:"LIST"})},d=v=>()=>{n({view:"EDIT",current:v,navigation:v,alreadyUsedNames:t.reduce((x,{name:y})=>y!==v.name?x.concat([y]):x,[])})},h=v=>()=>{n({view:"DELETE",navigations:v})},f=v=>()=>{n({view:"CACHE_PURGE",navigations:v})},m=g.useCallback(h(e),[h]),p=g.useCallback(f(e),[f]),b=v=>[v].concat(t.filter(x=>x.documentId===v.documentId&&x.locale!==v.locale));return u.jsxs(u.Fragment,{children:[u.jsx(ee.Root,{children:u.jsx(ee.Item,{col:12,paddingBottom:3,children:o?u.jsxs(q,{direction:"row",gap:1,children:[u.jsx(Z,{paddingRight:3,children:i(R("popup.navigation.manage.table.hasSelected"),{count:e.length})}),u.jsx(ze,{onClick:m,variant:"tertiary",children:i(R("popup.navigation.manage.button.delete"))}),r.data?.isCacheEnabled?u.jsx(ze,{onClick:p,variant:"tertiary",children:i(R("popup.navigation.manage.button.purge"))}):null]}):null})}),u.jsxs(Bw,{rowCount:t.length,colCount:6,children:[u.jsx(Vw,{children:u.jsxs(wl,{children:[u.jsx(Pt,{children:u.jsx(os,{onCheckedChange:a,check:o})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.id"))})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.name"))})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.locale"))})}),u.jsx(Pt,{children:u.jsx(K,{textColor:"neutral800",children:i(R("popup.navigation.manage.table.visibility"))})}),u.jsx(Pt,{children:r.data?.isCacheEnabled?u.jsx(q,{direction:"row",children:u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:f([]),label:i(R("popup.navigation.manage.button.purge")),noBorder:!0,children:bg})})}):null})]})}),u.jsx(Fw,{children:t.filter(({locale:v})=>v===s.data?.defaultLocale).map(v=>u.jsxs(wl,{children:[u.jsx(Wt,{children:u.jsx(os,{onCheckedChange:c(v,l.has(v.documentId)),checked:l.has(v.documentId)})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:v.documentId})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:v.name})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:b(v).map(ja.prop("locale")).join(", ")})}),u.jsx(Wt,{children:u.jsx(K,{textColor:"neutral800",children:v.visible?i(R("popup.navigation.manage.navigation.visible")):i(R("popup.navigation.manage.navigation.hidden"))})}),u.jsx(Wt,{children:u.jsxs(q,{width:"100%",direction:"row",alignItems:"center",justifyContent:"flex-end",children:[u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:d(v),label:i(R("popup.navigation.manage.button.edit")),noBorder:!0,children:mH})}),u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:h([v]),label:i(R("popup.navigation.manage.button.delete")),noBorder:!0,children:gH})}),r.data?.isCacheEnabled?u.jsx(Z,{paddingLeft:1,children:u.jsx(ut,{onClick:f([v]),label:i(R("popup.navigation.manage.button.purge")),noBorder:!0,children:bg})}):null]})})]},v.documentId))})]})]})},bH=({onClose:t,state:e,setState:n,navigations:r,isLoading:o})=>{const{formatMessage:i}=ue.useIntl();return u.jsx(li,{start:{onClick:t,variant:"tertiary",disabled:o,children:i(R("popup.item.form.button.cancel"))},end:{onClick:()=>n({view:"CREATE",alreadyUsedNames:r.map(({name:s})=>s),current:uH}),variant:"default",disabled:o,children:i(R("popup.navigation.manage.button.create"))}})},vH=({navigations:t})=>{const{formatMessage:e}=ue.useIntl();return u.jsxs(ee.Root,{children:[u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(q,{children:u.jsx(K,{variant:"beta",children:e(R("popup.navigation.manage.delete.header"))})})}),u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(K,{variant:"omega",fontWeight:"semiBold",children:wH(t)})})]})},xH=({state:t,onSubmit:e,onReset:n,isLoading:r})=>{const{formatMessage:o}=ue.useIntl();return u.jsx(li,{start:{children:o(R("popup.item.form.button.cancel")),disabled:r,onClick:n,variant:"tertiary"},end:{children:o(R("popup.navigation.manage.button.delete")),disabled:r,onClick:e,variant:"danger"}})},wH=t=>t.map(ja.prop("name")).join(", "),yH=({errors:t})=>{const{formatMessage:e}=ue.useIntl(),{toggleNotification:n}=de.useNotification();return g.useEffect(()=>{t.map(r=>{n({type:"warning",message:e({id:"",defaultMessage:r.message})}),console.error(r)})},[]),u.jsx(ee.Root,{children:u.jsx(ee.Item,{col:12,children:e(R("popup.navigation.manage.error.message"))})})},CH=({onReset:t})=>{const{formatMessage:e}=ue.useIntl();return u.jsx(li,{end:{children:e(R("popup.navigation.manage.button.goBack")),onClick:t,variant:"secondary"}})},$H=({alreadyUsedNames:t,current:e,isLoading:n,navigation:r,setState:o})=>{const i=g.useMemo(()=>e??r,[e]),s=g.useCallback(({disabled:a,...l})=>{o({view:"EDIT",alreadyUsedNames:t,current:l,disabled:a,navigation:r})},[o,r,t]);return u.jsx(Xw,{navigation:i,onChange:s,isLoading:n,alreadyUsedNames:t})},SH=({onSubmit:t,onReset:e,disabled:n,isLoading:r})=>{const{formatMessage:o}=ue.useIntl();return u.jsx(li,{start:{children:o(R("popup.item.form.button.cancel")),disabled:r,onClick:e,variant:"tertiary"},end:{children:o(R("popup.navigation.manage.button.save")),disabled:r||n,onClick:t,variant:"secondary"}})},AH=({navigations:t})=>{const{formatMessage:e}=ue.useIntl();return u.jsxs(ee.Root,{children:[u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(q,{children:u.jsx(K,{variant:"beta",children:e(R("popup.navigation.manage.purge.header"))})})}),u.jsx(ee.Item,{col:12,paddingBottom:1,children:u.jsx(K,{variant:"omega",fontWeight:"semiBold",children:TH(t)})})]})},kH=({onSubmit:t,onReset:e,isLoading:n})=>{const{formatMessage:r}=ue.useIntl();return u.jsx(li,{start:{children:r(R("popup.item.form.button.cancel")),disabled:n,onClick:e,variant:"tertiary"},end:{children:r(R("popup.navigation.manage.footer.button.purge")),disabled:n,onClick:t,variant:"danger"}})},TH=t=>t.map(ja.prop("name")).join(", "),RH=({initialState:t,isOpened:e,onClose:n})=>{const{formatMessage:r}=ue.useIntl(),[o,i]=g.useState(t),{toggleNotification:s}=de.useNotification(),a=Yz(),l=Xz(),c=Jz(),d=Uw({}),h=Kw(),f=i0(),m=o0(),p=g.useMemo(()=>oe.sortBy(f.data??[],"id"),[f.data]),b=Yw([l,f,c,d,h,m]),v=g.useCallback(()=>i({view:"INITIAL"}),[i]),x=g.useCallback(async()=>{const A=o.view==="DELETE"?()=>{l.mutate(o.navigations.reduce((k,T)=>(T.documentId&&k.push(T.documentId),k),[]),{onSuccess:a})}:o.view==="EDIT"?()=>{d.mutate(o.current,{onSuccess(){a(),s({type:"success",message:r(R("notification.navigation.submit"))})},onError(k){console.warn(k),s({type:"warning",message:r(R("notification.navigation.error"),{errorTitles:""})})}})}:o.view==="CREATE"&&o.current?()=>{c.mutate(o.current,{onSuccess(){a(),s({type:"success",message:r(R("notification.navigation.submit"))})},onError(k){console.warn(k),s({type:"warning",message:r(R("notification.navigation.error"),{errorTitles:""})})}})}:o.view==="CACHE_PURGE"?()=>{h.mutate(o.navigations.reduce((k,T)=>(T.documentId&&k.push(T.documentId),k),[]),{onSuccess:a})}:()=>{};try{A(),i({view:"INITIAL"})}catch(k){i({view:"ERROR",errors:k instanceof Error?[k]:[]})}},[o,i,a,c,h,d,l,s,r,R]);g.useEffect(()=>{(o.view==="INITIAL"||o.view==="LIST")&&i({view:"LIST",navigations:p,selected:[]})},[o.view,p]);const y=MH(o,r,!!b),$=EH(o,i,!!b),S=IH({state:o,setState:i,onClose:n,onSubmit:x,onReset:v,navigations:p,isLoading:!!b});return u.jsx(et.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:A=>{A||n?.()},open:e,children:u.jsxs(et.Content,{children:[u.jsx(et.Header,{children:u.jsx(K,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",children:y})}),u.jsx(et.Body,{children:$}),S]})})},MH=(t,e,n)=>{switch(t.view){case"LIST":case"CREATE":case"ERROR":case"CACHE_PURGE":case"DELETE":return u.jsxs(q,{direction:"row",children:[n?u.jsx(xl,{small:!0}):null,e(R(`popup.navigation.manage.header.${t.view}`))]});case"EDIT":return u.jsxs(q,{direction:"row",children:[n?u.jsx(xl,{small:!0}):null,e(R("popup.navigation.manage.header.EDIT"),{name:t.navigation.name})]});case"INITIAL":return null;default:return s0(t)}},EH=(t,e,n)=>{const r={setState:e,isLoading:n};switch(t.view){case"LIST":return u.jsx(pH,{...t,...r});case"EDIT":return u.jsx($H,{...t,...r});case"CREATE":return u.jsx(hH,{...t,...r});case"DELETE":return u.jsx(vH,{...t,...r});case"CACHE_PURGE":return u.jsx(AH,{...t,...r});case"INITIAL":return u.jsx(xl,{small:!0});case"ERROR":return u.jsx(yH,{...t,...r});default:return s0(t)}},IH=t=>{switch(t.state.view){case"LIST":return u.jsx(bH,{...t});case"CREATE":return u.jsx(fH,{...t,disabled:t.state.disabled});case"EDIT":return u.jsx(SH,{...t,disabled:t.state.disabled});case"DELETE":return u.jsx(xH,{...t});case"CACHE_PURGE":return u.jsx(kH,{...t});case"ERROR":return u.jsx(CH,{...t});case"INITIAL":return null;default:return s0(t.state)}},s0=t=>(console.warn(`Unknown state "${t?.view}". (${JSON.stringify(t)})`),null),jH=()=>{const[t,e]=g.useState(!1),n=g.useCallback(()=>e(!0),[e]),r=g.useCallback(()=>e(!1),[e]),o=g.useMemo(()=>t?u.jsx(RH,{initialState:{view:"INITIAL"},isOpened:!0,onClose:r}):null,[t,r]);return g.useMemo(()=>({navigationManagerModal:o,openNavigationManagerModal:n,closeNavigationManagerModal:r}),[o,n,r])},vg=u.jsx(fs,{}),DH=({activeNavigation:t,availableNavigations:e,structureHasErrors:n,structureHasChanged:r,isSaving:o,handleChangeSelection:i,handleLocalizationSelection:s,handleSave:a,handleCachePurge:l,permissions:c={},locale:d,currentLocale:h})=>{const{formatMessage:f}=ue.useIntl(),{openNavigationManagerModal:m,navigationManagerModal:p}=jH(),b=!!d.restLocale,{canUpdate:v}=c,x=Tt();return u.jsx(u.Fragment,{children:u.jsx(de.Layouts.Header,{title:f(R("header.title","UI Navigation")),subtitle:f(R("header.description")),primaryAction:u.jsxs(q,{direction:"row",size:2,children:[u.jsx(Z,{children:u.jsxs(ee.Root,{gap:4,style:x.data?.isCacheEnabled?{display:"flex"}:void 0,children:[b?null:u.jsx(ee.Item,{col:2}),v&&u.jsx(ee.Item,{col:3,children:u.jsx(ze,{onClick:m,startIcon:null,type:"button",variant:"secondary",fullWidth:!0,size:"S",children:f(R("header.action.manage"))})}),u.jsx(ee.Item,{col:v?4:10,children:u.jsx(MF.Root,{width:"100%",children:u.jsx(Sn,{type:"select",placeholder:"Change navigation",name:"navigationSelect",onChange:y=>{const $=e.find(({documentId:S})=>y===S);$&&i($)},value:t?.documentId,size:"S",style:null,children:e.filter(({locale:y})=>y===h).map(({documentId:y,name:$})=>u.jsx(An,{value:y,children:$},y))})})}),b?u.jsx(ee.Item,{col:2,children:u.jsx(Sn,{type:"select",placeholder:f(R("pages.main.header.localization.select.placeholder")),name:"navigationLocalizationSelect",onChange:s,value:h,size:"S",children:[d.defaultLocale,...d.restLocale].map(y=>u.jsx(An,{value:y,children:y},y))})}):null,v&&u.jsx(ee.Item,{col:3,children:u.jsx(ze,{onClick:a,startIcon:vg,disabled:n||!r||o,type:"submit",fullWidth:!0,size:"S",children:f(R("submit.cta.save"))})}),x.data?.isCacheEnabled&&u.jsx(ee.Item,{col:3,children:u.jsx(ze,{onClick:l,startIcon:vg,variant:"danger",type:"submit",fullWidth:!0,size:"S",children:f(R("submit.cta.cache.purge"))})})]})}),v&&p]}),secondaryAction:u.jsx(Ow,{icon:u.jsx(g2,{"aria-hidden":!0}),children:t?f(R("header.meta"),{id:t?.documentId,key:t?.slug}):null})})})},xg=u.jsx(u.Fragment,{}),OH=({onConfirm:t,onCancel:e})=>{const{formatMessage:n}=ue.useIntl();return u.jsx(mc,{isVisible:!0,header:n(R("pages.view.actions.changeLanguage.confirmation.header")),labelConfirm:n(R("pages.view.actions.changeLanguage.confirmation.confirm")),iconConfirm:xg,mainIcon:xg,onConfirm:t,onCancel:e,children:n(R("pages.view.actions.changeLanguage.confirmation.content"))})},LH=({startActions:t,endActions:e})=>u.jsxs(q,{justifyContent:"space-between",width:"100%",children:[u.jsx(q,{alignItems:"space-between",children:t}),u.jsx(q,{alignItems:"space-between",children:e})]}),NH=en.default.div`
|
|
2202
2202
|
border-radius: 50%;
|
|
2203
2203
|
background: #dcdce4;
|
|
2204
2204
|
width: 25px;
|
|
@@ -2328,7 +2328,7 @@ ${C.css`
|
|
|
2328
2328
|
border-radius: 0 0 0 100%;
|
|
2329
2329
|
}
|
|
2330
2330
|
`};
|
|
2331
|
-
`,XH=({item:t,isLast:e=!1,level:n=0,levelPath:r="",isParentAttachedToMenu:o,onItemLevelAdd:i,onItemRemove:s,onItemRestore:a,onItemEdit:l,onItemReOrder:c,onItemToggleCollapse:d,onItemSubmit:h,displayChildren:f,permissions:m,structureId:
|
|
2331
|
+
`,XH=({item:t,isLast:e=!1,level:n=0,levelPath:r="",isParentAttachedToMenu:o,onItemLevelAdd:i,onItemRemove:s,onItemRestore:a,onItemEdit:l,onItemReOrder:c,onItemToggleCollapse:d,onItemSubmit:h,displayChildren:f,permissions:m,structureId:p,viewParentId:b,locale:v})=>{const x=lr(t,!0),{formatMessage:y}=ue.useIntl(),$=Tt(),S=x.type==="EXTERNAL",A=x.type==="WRAPPER",k=oe.isNumber($.data?.allowedLevels)?n<$.data.allowedLevels-1:!0,T=oe.isNumber($.data?.allowedLevels)?n<$.data.allowedLevels:!0,I=!oe.isEmpty(t.items)&&!f,E=S?void 0:`${r==="/"?"":r}/${x.path==="/"?"":x.path}`.replace("//","/"),j=qw({uid:x.type==="INTERNAL"?x.relatedType??"":"",locale:v}),D=Pz().data?.find(ce=>x.type==="INTERNAL"?ce.uid===x.relatedType:!1),z=D?.uid.includes("api::"),V=j.data?.find(ce=>x.type==="INTERNAL"?ce.documentId===x.related:!1)??{documentId:"",id:0},W=!!V?.publishedAt,G=S?"":gc(V,$.data),P=D?.info.displayName??"",_=W?"success":"secondary",O=m.canUpdate,X=g.useRef(null),J=g.useRef(null),fe=g.useRef(null),[,se]=$d.useDrop({accept:`navigation-item_${r}`,hover(ce,je){const Te=ce.order??0,ye=t.order??0;if(Te===ye)return;const nt=J.current.getBoundingClientRect(),mt=(nt.bottom-nt.top)/2,no=je.getClientOffset();if(!no)return;const Ar=no.y-nt.top,Zn=Ar>mt?(t.order??0)+.5:(t.order??0)-.5;Te<ye&&Ar<mt||Te>ye&&Ar>mt||c({item:lr(ce,!0),newOrder:Zn})},collect:ce=>({isOverCurrent:ce.isOver({shallow:!0})})}),[{isDragging:pe},be,Se]=$d.useDrag({type:`navigation-item_${r}`,item:()=>t,collect:ce=>({isDragging:ce.isDragging()})}),re={dragRef:be(X),dropRef:se(J),previewRef:Se(fe)},xe=ce=>{const je=D?.kind==="singleType",Te=ce?.locale?`?plugins[i18n][locale]=${ce?.locale}`:"";return`/admin/content-manager/${je?"single-types":"collection-types"}/${D?.uid}${je?"":"/"+ce?.documentId}${Te}`},ge=g.useCallback(ce=>{if(!O)return;const je=(x.items??[]).reduce((Te,{order:ye})=>Te<ye?ye:Te,0);return i(ce,x.viewId,k,E,x.menuAttached,`${p}.${x.items?.length??0}`,je)},[x.viewId,k,E,x.menuAttached,p,x.items,O]);g.useEffect(()=>{x.isSearchActive&&re.dropRef?.current?.scrollIntoView?.({behavior:"smooth",block:"center",inline:"center"})},[x.isSearchActive,re.dropRef.current]);const ve=Uz({uid:x.type==="INTERNAL"?x.relatedType??"":"",locale:v});g.useEffect(()=>{ve()},[]);const he=C.useTheme();return u.jsxs(YH,{level:n,isLast:e,style:{opacity:pe?.2:1},ref:re?re.dropRef:void 0,children:[u.jsxs(sF,{style:{width:"728px",zIndex:1,position:"relative",overflow:"hidden",backgroundColor:x.isSearchActive?he.colors.secondary100:void 0,borderColor:x.isSearchActive?he.colors.secondary200:void 0,transition:"background-color 0.3s ease-in"},children:[x.removed&&u.jsx(GH,{}),u.jsxs("div",{ref:re.previewRef,children:[u.jsx(ng,{children:u.jsx(KH,{title:t.title??"",path:S?x.externalPath:E,icon:S?u.jsx(q8,{}):A?u.jsx(T8,{}):u.jsx(K7,{}),onItemRemove:()=>s({...t,viewParentId:b}),onItemEdit:()=>{const{__type:ce,documentId:je}=t.related??{};t.type!=="EXTERNAL"&&t.type!=="INTERNAL"&&t.type!=="WRAPPER"||l({item:t.type==="INTERNAL"?{...t,type:"INTERNAL",isMenuAllowedLevel:T,isParentAttachedToMenu:o,isSearchActive:!1,relatedType:ce??"",related:je??"",additionalFields:t.additionalFields??{},items:t.items??[],autoSync:t.autoSync??!0,externalPath:void 0,viewParentId:b,audience:t.audience?.map(({documentId:Te})=>Te)??[]}:t.type==="EXTERNAL"?{...t,type:"EXTERNAL",isMenuAllowedLevel:T,isParentAttachedToMenu:o,isSearchActive:!1,relatedType:void 0,related:void 0,additionalFields:t.additionalFields??{},items:t.items??[],autoSync:t.autoSync??!0,externalPath:t.externalPath??"",viewParentId:b,audience:t.audience?.map(({documentId:Te})=>Te)??[]}:{...t,type:"WRAPPER",isMenuAllowedLevel:T,isParentAttachedToMenu:o,isSearchActive:!1,additionalFields:t.additionalFields??{},items:t.items??[],autoSync:t.autoSync??!0,viewParentId:b,audience:t.audience?.map(({documentId:Te})=>Te)??[]},levelPath:r,isParentAttachedToMenu:o})},onItemRestore:()=>a({...t,viewParentId:b}),dragRef:re.dragRef,removed:x.removed,canUpdate:O,isSearchActive:x.isSearchActive})}),u.jsx(Yo,{}),u.jsx(ng,{style:{padding:"8px"},children:u.jsxs(q,{style:{width:"100%"},direction:"row",alignItems:"center",justifyContent:"space-between",children:[u.jsxs(q,{children:[!oe.isEmpty(t.items)&&u.jsx(BH,{toggle:()=>d({...t,viewParentId:b}),collapsed:x.collapsed,itemsCount:t.items?.length??0}),O&&k&&u.jsx(ez,{disabled:x.removed,startIcon:u.jsx(tf,{}),onClick:ge,children:u.jsx(K,{variant:"pi",fontWeight:"bold",textColor:x.removed?"neutral600":"primary600",children:y(R("components.navigationItem.action.newItem"))})})]}),x.type==="INTERNAL"&&x.related&&!V.id?u.jsxs(q,{justifyContent:"center",alignItems:"center",children:[u.jsxs(K,{variant:"omega",textColor:"neutral600",children:[P," / "]}),u.jsx(K,{variant:"omega",textColor:"neutral800",children:y(R("components.navigationItem.related.localeMissing"))})]}):null,G&&u.jsxs(q,{justifyContent:"center",alignItems:"center",children:[u.jsx(Qw,{borderColor:`${_}200`,backgroundColor:`${_}100`,textColor:`${_}600`,className:"action",small:!0,children:y(R(`components.navigationItem.badge.${W?"published":"draft"}`))}),u.jsxs(K,{variant:"omega",textColor:"neutral600",children:[P," / "]}),u.jsx(K,{variant:"omega",textColor:"neutral800",children:G}),z&&u.jsx(rw,{href:xe(V??void 0),endIcon:u.jsx(L$,{}),children:" "})]})]})})]})]}),I&&!x.removed&&!x.collapsed&&u.jsx(Zw,{onItemLevelAdd:i,onItemEdit:l,onItemSubmit:h,isParentAttachedToMenu:x.menuAttached,items:t.items??[],level:n+1,levelPath:E,permissions:m,structurePrefix:p,viewParentId:x.viewId,locale:v})]})},QH=en.default.div`
|
|
2332
2332
|
position: relative;
|
|
2333
2333
|
${({level:t,theme:e})=>t&&`
|
|
2334
2334
|
&::before {
|
|
@@ -2345,8 +2345,8 @@ ${C.css`
|
|
|
2345
2345
|
border-left: 4px solid ${e.colors.neutral300};
|
|
2346
2346
|
}
|
|
2347
2347
|
`};
|
|
2348
|
-
`,Zw=({isParentAttachedToMenu:t=!1,items:e,level:n=0,levelPath:r="",onItemEdit:o,onItemLevelAdd:i,onItemSubmit:s,displayFlat:a,permissions:l,structurePrefix:c,viewParentId:d,locale:h})=>{const f=({item:v,newOrder:x})=>{s({...v,order:x})},m=v=>{s(lr({...v,removed:!0},!0))},b=v=>{s(lr({...v,removed:!1},!0))},p=v=>{s(lr({...v,collapsed:!v.collapsed,updated:!0,isSearchActive:!1},!0))};return u.jsx(QH,{"data-level":n,children:e?.map((v,x)=>u.jsx(XH,{item:v,isLast:x===e.length-1,level:n,levelPath:r,isParentAttachedToMenu:t,onItemLevelAdd:i,onItemEdit:o,onItemSubmit:s,onItemRestore:b,onItemRemove:m,onItemReOrder:f,onItemToggleCollapse:p,displayChildren:a,permissions:l,structureId:c?`${c}.${x}`:x.toString(),viewParentId:d,locale:h},`list-item-${v.viewId||x}`))})},ZH=({handleCancel:t,handleSubmit:e,submitDisabled:n,canUpdate:r})=>{const{formatMessage:o}=ue.useIntl();return r?u.jsxs(et.Footer,{children:[u.jsx(et.Close,{children:u.jsx(ze,{onClick:t,variant:"tertiary",children:o(R("popup.item.form.button.cancel"))})}),u.jsx(ze,{onClick:e,disabled:n,children:o(R("popup.item.form.button.save"))})]}):null},JH=[/^mailto:[\w-\.]+@([\w-]+\.)+[\w-]{2,}$/,/^tel:(\+\d{1,3})?[\s]?(\(?\d{2,3}\)?)?[\s.-]?(\d{3})?[\s.-]?\d{3,4}$/,/^#.*/,/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/,/(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?/],a0=({additionalFields:t})=>B.z.object({title:B.z.string(),autoSync:B.z.boolean().optional(),removed:B.z.boolean().optional(),updated:B.z.boolean().optional(),uiRouterKey:B.z.string(),levelPath:B.z.string().optional(),isMenuAllowedLevel:B.z.boolean().optional(),parentAttachedToMenu:B.z.boolean().optional(),viewId:B.z.number().optional(),structureId:B.z.string().optional(),menuAttached:B.z.boolean().optional(),collapsed:B.z.boolean().optional(),isSearchActive:B.z.boolean().optional(),viewParentId:B.z.number().optional(),id:B.z.number().optional(),documentId:B.z.string().optional(),audience:B.z.string().array().optional(),order:B.z.number().optional(),items:B.z.any().array().optional(),additionalFields:B.z.object(t.reduce((e,n)=>{if(typeof n=="string")return e;switch(n.type){case"string":e[n.name]=n.required?B.z.string():B.z.string().optional();break;case"boolean":e[n.name]=n.required?B.z.boolean():B.z.boolean().optional();case"media":e[n.name]=n.required?B.z.any():B.z.any().optional();case"select":{n.multi?e[n.name]=n.required?B.z.string().array():B.z.string().array().optional():e[n.name]=n.required?B.z.string():B.z.string().optional();break}}return e},{}))}),eP=({additionalFields:t,isSingleSelected:e})=>a0({additionalFields:t}).extend({type:B.z.literal("INTERNAL"),path:B.z.string().or(B.z.null()).optional(),externalPath:B.z.string().nullish(),relatedType:B.z.string(),related:e?B.z.string().optional():B.z.string()}),tP=({isSingleSelected:t,additionalFields:e})=>a0({additionalFields:e}).extend({type:B.z.literal("EXTERNAL"),path:B.z.string().or(B.z.null()).optional(),externalPath:B.z.string().min(1).refine(n=>JH.some(r=>r.test(n))),relatedType:B.z.string().optional(),related:B.z.string().optional()}),nP=({isSingleSelected:t,additionalFields:e})=>a0({additionalFields:e}).extend({type:B.z.literal("WRAPPER"),path:B.z.string().or(B.z.null()).optional()}),rP=t=>B.z.discriminatedUnion("type",[tP(t),eP(t),nP(t)]),wg={autoSync:!0,type:"INTERNAL",relatedType:"",menuAttached:!1,title:"",externalPath:"",path:"",additionalFields:{},audience:[],updated:!1,uiRouterKey:""},oP=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return e.slugify(n)}})},iP=()=>{const t=Tt();return{encodePayload:r=>({...r,additionalFields:t.data?.additionalFields.reduce((o,i)=>{const{name:s,type:a}=i;if(s in(r.additionalFields??{})){let l=r.additionalFields[s];switch(a){case"boolean":l=oe.isBoolean(l)?`${l}`:l;break;case"media":l=l&&JSON.stringify(l);break}return{...o,[s]:l}}return o},{})||{}}),decodePayload:r=>({...r,additionalFields:t.data?.additionalFields.reduce((o,i)=>{const{name:s,type:a}=i;if(s in(r.additionalFields??{})){let l=r.additionalFields[s];switch(a){case"boolean":l=l==="true";break;case"media":l=l&&JSON.parse(l);break}return{...o,[s]:l}}return o},{})||{}})}},sP=()=>{const{formatMessage:t}=ue.useIntl(),[e,n]=g.useState({}),[r,o]=g.useState(),i=(c,d,h)=>{if(h){let f=c,m=d;if(oe.isObject(c)){const{name:b,value:p}=c.target;f=b,m=oe.isNil(m)?p:m}return oe.isString(f)&&s(f,m),h(c,m)}},s=(c,d)=>{n(oe.set({...e,additionalFields:{...e.additionalFields},updated:!0},c,d))};return{formValue:e,renderError:(c,d)=>oe.get(r,c)?t(R(d??c)):void 0,setFormError:o,handleChange:i,setFormValue:n,setFormValueItem:s,setFormValuesItems:c=>n({...e,...c,updated:!0})}},aP=async({slugify:t,title:e,config:n,related:r,relatedType:o,contentTypeItems:i})=>{if(e)return e?await t(e):void 0;if(r){const s=gc({...i?.find(a=>a.documentId===r.toString())??{documentId:"",id:0},__collectionUid:o},n);return s?await t(s):void 0}},lP=({currentType:t,config:e,contentTypeItems:n,currentRelated:r,currentRelatedType:o,isSingleSelected:i})=>{if(t!=="INTERNAL"||!o)return"";const s=e?.pathDefaultFields[o]??[];if(oe.isEmpty(t)&&!oe.isEmpty(s)){const a=i?oe.first(n??[]):n?.find(({id:c})=>c===r);return s.map(c=>a?.[c]??"").filter(c=>!!c.toString().trim())[0]??""}return""},cP=({currentPath:t,isExternal:e,current:n,currentType:r="INTERNAL",config:o,contentTypeItems:i,currentRelated:s,currentRelatedType:a,isSingleSelected:l})=>{if(!e){const c=oe.isEmpty(t)||t==="/"?lP({currentType:r,config:o,contentTypeItems:i,currentRelated:s,currentRelatedType:a,isSingleSelected:l}):t||"";return`${n.levelPath!=="/"?`${n.levelPath}`:""}/${c}`.replace("//","/")}},Jw=g.createContext({values:{},onChange:()=>null,handleChange:()=>null,renderError:()=>"",setFormValueItem:()=>null,canUpdate:void 0,isLoading:!0}),jn=()=>g.useContext(Jw),dP=()=>{const{formatMessage:t}=ue.useIntl(),e=Tt(),{values:n,onChange:r,handleChange:o,renderError:i,canUpdate:s}=jn(),l=(e.data?.contentTypes.length?["INTERNAL","EXTERNAL","WRAPPER"]:["EXTERNAL","WRAPPER"]).map(c=>({key:c,value:c,label:t(R(`popup.item.form.type.${c.toLowerCase()}.label`))}));return u.jsx(ee.Item,{alignItems:"flex-start",col:8,children:u.jsx(Ce.Field,{name:"type",label:t(R("popup.item.form.type.label","Internal link")),error:i("type"),hint:t(R("popup.item.form.title.placeholder","e.g. Blog")),children:u.jsx(Sn,{onChange:c=>o("type",c,r),value:n.type,name:"type",disabled:!s,width:"100%",children:l.map(({key:c,label:d,value:h})=>u.jsx(An,{value:h,children:d},c))})})},"title")},uP=({current:t})=>{const{formatMessage:e}=ue.useIntl(),n=Tt(),{values:r,onChange:o,handleChange:i,renderError:s,canUpdate:a}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:4,children:u.jsx(Ce.Field,{name:"menuAttached",label:e(R("popup.item.form.menuAttached.label","MenuAttached")),error:s("menuAttached"),hint:e(R("popup.item.form.menuAttached.placeholder","is menu item attached to menu")),children:u.jsx(wn,{name:"menuAttached",checked:r.menuAttached,onChange:l=>i(l,!r.menuAttached,o),value:r.menuAttached,onLabel:e(R("popup.item.form.menuAttached.value.yes","yes")),offLabel:e(R("popup.item.form.menuAttached.value.no","no")),disabled:!a||(n.data?.cascadeMenuAttached?!(t.isMenuAllowedLevel&&t.parentAttachedToMenu):!1),width:"100%"})})},"menuAttached")},hP=()=>{const{formatMessage:t}=ue.useIntl(),{values:e,onChange:n,handleChange:r,renderError:o,canUpdate:i}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:e.type==="INTERNAL"?8:12,children:u.jsx(Ce.Field,{name:"title",label:t(R("popup.item.form.title.label","Title")),error:o("title"),hint:t(R("popup.item.form.title.placeholder","e.g. Blog")),children:u.jsx(pn,{type:"string",disabled:!i||e.autoSync&&e.type==="INTERNAL",name:"title",onChange:(s,a)=>r(s,a,n),value:e.title})})},"title")},fP=()=>{const{formatMessage:t}=ue.useIntl(),{values:e,onChange:n,handleChange:r,renderError:o,canUpdate:i}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:4,children:u.jsx(Ce.Field,{name:"autoSync",label:t(R("popup.item.form.autoSync.label","Read fields from related")),error:o("autoSync"),children:u.jsx(wn,{name:"autoSync",checked:e.autoSync,onChange:s=>r(s,!e.autoSync,n),disabled:!i,onLabel:"Enabled",offLabel:"Disabled"})})},"autoSync")},mP=({contentTypeItems:t,current:e,isSingleSelected:n})=>{const{formatMessage:r}=ue.useIntl(),o=Tt(),{values:i,onChange:s,handleChange:a,renderError:l,canUpdate:c}=jn(),d=i.type==="EXTERNAL"?"externalPath":"path",h=i.type==="INTERNAL"?i:{related:void 0,relatedType:void 0},f=cP({currentPath:i.path,isExternal:i.type==="EXTERNAL",current:e,currentType:i.type,config:o.data,contentTypeItems:t,currentRelated:h.related,currentRelatedType:h.relatedType,isSingleSelected:n});return u.jsx(ee.Item,{alignItems:"flex-start",col:12,children:u.jsx(Ce.Field,{name:d,label:r(R(`popup.item.form.${d}.label`,"Path")),error:l(d,`popup.item.form.${d}.validation.type`),hint:[r(R(`popup.item.form.${d}.placeholder`,"e.g. Blog")),f?r(R("popup.item.form.type.external.description"),{value:f}):""].join(" "),children:u.jsx(pn,{disabled:!c,name:d,onChange:(m,b)=>a(m,b,s),value:i.type==="EXTERNAL"?i.externalPath:i.path,width:"100%"})})},"title")},gP="",pP={type:"media",multiple:!1,required:!1,allowedTypes:["images"],pluginOptions:{i18n:{localized:!1}}},bP=({name:t,field:e,isLoading:n,onChange:r,onChangeEnhancer:o,value:i,disabled:s})=>{const{toggleNotification:a}=de.useNotification(),{formatMessage:l}=ue.useIntl(),d=de.useStrapiApp("AdditionalFieldInput",f=>f.fields).media,h=g.useMemo(()=>({id:e.name,name:t||e.name,disabled:n||s,placeholder:e.placeholder}),[e,n]);switch(g.useEffect(()=>{if(e.type==="media"){const f=oe.isNull(i)?void 0:i;o(h.name,f,r)}},[i]),e.type){case"boolean":return u.jsx(wn,{...h,checked:!!i,onChange:f=>o(f,!i,r),onLabel:"true",offLabel:"false",type:"checkbox"});case"string":return u.jsx(pn,{...h,onChange:(f,m)=>o(f,m,r),value:i||gP});case"select":return e.multi?u.jsx(Eo,{...h,onChange:f=>o(h.name,f,r),value:oe.isNil(i)?e.multi?[]:null:i,multi:e.multi,withTags:e.multi,children:e.options.map((f,m)=>u.jsx(Nr,{value:f,children:f},`${e.name}-option-${m}`))}):u.jsx(Sn,{...h,onChange:f=>o(h.name,f,r),value:oe.isNil(i)?e.multi?[]:null:i,multi:e.multi,withTags:e.multi,children:e.options.map((f,m)=>u.jsx(An,{value:f,children:f},`${e.name}-option-${m}`))});case"media":return u.jsx(d,{...h,...pP,value:i});default:throw a({type:"warning",message:l(R("notification.error.customField.type"))}),new Error("Type of custom field is unsupported")}},vP=({additionalField:t})=>{const{canUpdate:e,isLoading:n,onChange:r,handleChange:o,renderError:i,values:s}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:6,children:u.jsx(Ce.Field,{name:`additionalFields.${t.name}`,label:t.label,hint:t.description,required:t.required,error:i(`additionalFields.${t.name}`),children:u.jsx(bP,{name:`additionalFields.${t.name}`,field:t,isLoading:n,onChange:r,onChangeEnhancer:o,value:oe.get(s?.additionalFields,t.name),disabled:!e})})},t.name)},xP=()=>{const{formatMessage:t}=ue.useIntl(),n=Tt().data?.availableAudience??[],r=g.useMemo(()=>n.map(c=>({value:c.documentId??0,label:c.name??" "})),[n]),{isLoading:o,renderError:i,onChange:s,handleChange:a,values:l}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:12,children:u.jsx(Ce.Field,{name:"audience",label:t(R("popup.item.form.audience.label")),error:i("audience"),hint:!o&&oe.isEmpty(r)?t(R("popup.item.form.title.placeholder","e.g. Blog")):void 0,children:u.jsx(Eo,{name:"audience",value:l.audience,onChange:c=>a("audience",c,s),width:"100%",children:r.map(({value:c,label:d})=>u.jsx(Nr,{value:c,children:d},c))})})},"audience")},wP=()=>{const t=Tt();if(!t.data?.additionalFields||oe.isEmpty(t.data.additionalFields))return null;const e=t.data.additionalFields.filter(r=>r!=="audience"),n=t.data.additionalFields.find(r=>r==="audience");return u.jsxs(u.Fragment,{children:[u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(ee.Item,{col:12,lg:12,children:u.jsx(Yo,{width:"100%"})})}),u.jsxs(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[e.map(r=>u.jsx(vP,{additionalField:r},r.name)),n&&u.jsx(xP,{})]}),u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(ee.Item,{col:12,lg:12,children:u.jsx(Yo,{width:"100%"})})})]})},yP=({availableLocale:t,current:e,currentNavigation:n,setIsLoading:r,setFormValuesItems:o})=>{const{formatMessage:i}=ue.useIntl(),[s,a]=g.useState(),l=Qz(),c=i0(),{canUpdate:d,isLoading:h}=jn(),f=g.useMemo(()=>t.map((b,p)=>({key:`${b}-${p}`,value:b,label:b})),[t]),m=g.useCallback(async b=>{b.preventDefault(),b.stopPropagation();const p=c.data?.find(({locale:v})=>v===s);p&&(r(!0),l.mutate({target:n.documentId,structureId:e.structureId,source:p.documentId},{onSuccess(v){l.reset();const{type:x,externalPath:y,path:$,related:S,title:A,uiRouterKey:k}=v;o({type:x,externalPath:y,path:$,title:A,uiRouterKey:k,related:S})},onSettled(){r(!1)}}))},[r,l,c]);return!f||f.length<1?null:u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsxs(ee.Item,{alignItems:"flex-start",col:12,children:[u.jsx(Yo,{marginTop:5,marginBottom:5}),u.jsxs(ee.Root,{gap:5,children:[u.jsx(ee.Item,{alignItems:"flex-start",col:6,lg:12,children:u.jsx(Ce.Field,{name:"i18n.locale",label:i(R("popup.item.form.i18n.locale.label","Copy details from")),children:u.jsx(Sn,{name:"i18n.locale",onChange:a,value:s,disabled:h||!d,placeholder:i(R("popup.item.form.i18n.locale.placeholder","locale")),children:f.map(({key:b,label:p,value:v})=>u.jsx(An,{value:v,children:p},b))})})}),d&&u.jsx(ee.Item,{alignItems:"flex-start",col:6,lg:12,paddingTop:6,children:u.jsx(Z,{children:u.jsx(ze,{variant:"tertiary",onClick:m,disabled:h||!s,children:i(R("popup.item.form.i18n.locale.button"))})})})]})]},"title")})},yg=(t,e)=>e?t.find(n=>n.value===e)?.label??"":"",ey=({name:t,onClear:e,onChange:n,options:r,value:o,disabled:i})=>{const[s,a]=g.useState(yg(r,o));return g.useEffect(()=>{a(yg(r,o))},[o,r]),u.jsx(dw,{name:t,autocomplete:"list",onClear:e,onChange:n,onTextValueChange:a,value:o,textValue:s,options:r,disabled:i,width:"100%",children:r.map(({key:l,label:c,value:d})=>u.jsx(uw,{value:d,children:c},l))})},CP=({contentTypeItems:t,current:e,currentRelatedType:n,isSingleSelected:r,setFormValuesItems:o,setIsSingleSelected:i})=>{const{formatMessage:s}=ue.useIntl(),a=Tt(),{canUpdate:l,isLoading:c,renderError:d,setFormValueItem:h,values:f}=jn(),m=e.type==="INTERNAL"?e.relatedType:void 0,b=g.useMemo(()=>oe.sortBy(a.data?.contentTypes?.filter(p=>p.isSingle?!!(n&&[n,m].includes(p.uid)):!0).map(p=>({key:p.uid,value:p.uid,label:p.contentTypeName})),p=>p.label),[a.data,n]);return g.useEffect(()=>{if(!n)return;const p=a.data?.contentTypes.find(v=>v.uid===n);if(p&&(i(p.isSingle),p.isSingle&&t?.length)){const v=t[0];v&&h("related",v.documentId)}},[n,a.data,t]),g.useEffect(()=>{n===""&&h("relatedType",a.data?.defaultContentType)},[a.data?.defaultContentType,f.type,n]),u.jsx(ee.Item,{alignItems:"flex-start",col:n&&!r?6:12,children:u.jsx(Ce.Field,{name:"relatedType",label:s(R("popup.item.form.relatedType.label","Related Type")),error:d("relatedType"),hint:!c&&oe.isEmpty(b)?s(R("popup.item.form.relatedType.empty","There are no more content types")):void 0,children:u.jsx(ey,{name:"relatedType",onClear:()=>o({related:void 0,relatedType:void 0,title:f.autoSync?"":f.title}),onChange:p=>o({related:void 0,relatedType:p,title:f.autoSync?"":f.title}),value:n,options:b,disabled:!a.data?.contentTypes.length||!l})})})},$P=(t,e,n)=>{const r=Tt();g.useEffect(()=>{if(!t.autoSync||!t.related||!r.data)return;const o=e?.find(c=>c.documentId===t.related);if(!o)return;const{contentTypesNameFields:i,pathDefaultFields:s}=r.data,a=s[t.relatedType]?.reduce((c,d)=>c||o?.[d],void 0)||"",l=(i[t.relatedType]??[]).concat(i.default??[]).reduce((c,d)=>c||o?.[d],void 0);a&&t.path,l&&t.title,n({path:a,title:l})},[t.autoSync,t.related,t.relatedType,e,r.data])},SP=({appendLabelPublicationStatus:t,contentTypeItems:e,isSingleSelected:n,values:r,setFormValuesItems:o})=>{const{formatMessage:i}=ue.useIntl(),s=Tt(),{canUpdate:a,isLoading:l,handleChange:c,onChange:d,renderError:h}=jn(),f=oe.sortBy(e?.map(b=>{const v=t(gc({...b,__collectionUid:r.relatedType},s.data),b,!1)+(b?.id?` (id: ${b.id})`:"");return{key:b?.documentId?.toString(),value:b?.documentId?.toString(),label:v}})??[],b=>b.label),m=oe.isEmpty(f);return $P(r,e,o),!r.relatedType||n?null:u.jsx(ee.Item,{alignItems:"flex-start",col:6,children:u.jsx(Ce.Field,{name:"related",label:i(R("popup.item.form.related.label","Related")),error:h("related"),hint:!l&&m?i(R("popup.item.form.related.empty","There are no more entities"),{contentTypeName:r.relatedType}):void 0,children:u.jsx(ey,{name:"related",onClear:()=>c("related",void 0,d),onChange:b=>c("related",b,d),value:r.related,options:f,disabled:l||m||!a})})})},AP=[],kP=({availableLocale:t,isLoading:e,current:n=wg,onSubmit:r,onCancel:o,appendLabelPublicationStatus:i=TP,locale:s,permissions:a={},currentNavigation:l})=>{const{formatMessage:c}=ue.useIntl(),[d,h]=g.useState(e),{canUpdate:f}=a,[m,b]=g.useState(!1),p=Tt(),v=p.data?.contentTypes??[],{toggleNotification:x}=de.useNotification(),{formValue:y,renderError:$,setFormError:S,handleChange:A,setFormValue:k,setFormValueItem:T,setFormValuesItems:I}=sP(),{encodePayload:E,decodePayload:j}=iP(),L=y.type==="INTERNAL",D=L&&!y.related&&!m||d,z=qw({uid:L?y.relatedType:"",locale:s}),V=async(P,_)=>{P.preventDefault();const O=E(_),{success:X,data:J,error:fe}=rP({isSingleSelected:m,additionalFields:p.data?.additionalFields??AP}).safeParse(O);if(X){const se=J.title.trim()?J.title.trim():J.type==="INTERNAL"?G(J?.related?.toString(),J.relatedType,m):"";h(!0);const pe=await aP(J.type==="INTERNAL"?{slugify:W.mutateAsync,title:se,related:J.related,relatedType:J.relatedType}:{slugify:W.mutateAsync,title:se});if(W.reset(),h(!1),!pe){x({type:"warning",message:c(R("popup.item.form.uiRouter.unableToRender"))});return}r(J.type==="INTERNAL"?{...J,title:se,uiRouterKey:pe}:{...J,title:se,uiRouterKey:pe})}else fe&&S(fe.issues.reduce((se,pe)=>({...se,[pe.path.join(".")]:pe.message}),{}))},W=oP(),G=g.useCallback((P,_,O)=>{let X;if(O){if(X=z.data?.find(J=>J.uid===_||J.__collectionUid===_),!X)return v.find(J=>J.uid===_)?.contentTypeName}else X={...z.data?.find(({documentId:fe})=>fe===P)||{documentId:null},__collectionUid:_};return gc(X,p.data)},[z.data,p.data,v]);return g.useEffect(()=>{k(j({...wg,...n}))},[n]),u.jsxs(u.Fragment,{children:[u.jsx(et.Body,{children:u.jsx(de.Form,{width:"auto",height:"auto",method:"POST",initialValues:y,children:({values:P,onChange:_})=>u.jsxs(Jw.Provider,{value:{values:P,onChange:_,handleChange:A,renderError:$,setFormValueItem:T,canUpdate:f,isLoading:d},children:[u.jsxs(ee.Root,{gap:5,paddingBottom:1,children:[u.jsx(dP,{}),u.jsx(uP,{current:n})]}),u.jsxs(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[u.jsx(hP,{}),P.type==="INTERNAL"&&u.jsx(fP,{})]}),u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(mP,{contentTypeItems:z.data,current:n,isSingleSelected:m})}),P.type==="INTERNAL"&&u.jsxs(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[u.jsx(CP,{contentTypeItems:z.data,current:n,currentRelatedType:P.relatedType,isSingleSelected:m,setFormValuesItems:I,setIsSingleSelected:b}),u.jsx(SP,{appendLabelPublicationStatus:i,contentTypeItems:z.data,values:P,isSingleSelected:m,setFormValuesItems:I})]}),u.jsx(wP,{}),u.jsx(yP,{availableLocale:t,current:n,currentNavigation:l,setIsLoading:h,setFormValuesItems:I}),u.jsx(ee.Root,{gap:5,children:u.jsx(ee.Item,{alignItems:"flex-start",col:12},"title")})]})})}),u.jsx(ZH,{handleSubmit:P=>V(P,y),handleCancel:o,submitDisabled:D,canUpdate:f})]})},TP=()=>"",RP=({isNewItem:t,canUpdate:e})=>{const{formatMessage:n}=ue.useIntl();let r="view";return e&&(r=t?"new":"edit"),u.jsx(et.Header,{children:u.jsx(K,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:n(R(`popup.item.header.${r}`))})})},MP=({availableLocale:t,isOpen:e,isLoading:n,currentItem:r={},onSubmit:o,onClose:i,locale:s,permissions:a,currentNavigation:l})=>{const{formatMessage:c}=ue.useIntl(),d=m=>{o(m)},h=(m,b,p)=>`${cH({relatedRef:b,type:b.isSingle?"INTERNAL":b.type,isCollection:p})?"":`[${c(R("notification.navigation.item.relation.status.draft"))}] `.toUpperCase()}${m}`,f=!!r.viewId;return u.jsx(et.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:m=>{m||i({preventDefault(){},stopPropagation(){},target:{}})},open:e,children:u.jsxs(et.Content,{children:[u.jsx(RP,{isNewItem:!f,canUpdate:a?.canUpdate}),u.jsx(kP,{availableLocale:t,current:r,isLoading:n,onSubmit:d,onCancel:i,appendLabelPublicationStatus:h,locale:s,permissions:a,currentNavigation:l})]})})},yd=0,EP=({value:t,setValue:e,initialIndex:n=yd})=>{const[r,o]=g.useState(t),[i,s]=g.useState(t),[a,l]=g.useState(n),[c,d]=g.useState(!!t),h=g.useRef(null),{formatMessage:f}=ue.useIntl();g.useEffect(()=>{c&&setTimeout(()=>{h.current?.querySelector("input")?.focus()},0)},[c]),g.useEffect(()=>{a&&r===i&&e({value:r,index:a})},[a,r,i]),g.useEffect(()=>{r!==i&&(s(r),l(yd),e({value:r,index:yd}))},[r,i]);const m=g.useCallback(v=>{v.code.toLowerCase()==="enter"&&l(x=>x+1)},[]),b=g.useCallback(v=>{o(v.target.value)},[o]),p=g.useCallback(()=>{o(""),d(!1)},[o,d]);return c?u.jsxs("div",{ref:h,children:[u.jsx(M_,{name:"searchbar",onClear:p,value:t,size:"S",onChange:b,clearLabel:"Clearing the search",placeholder:f(R("pages.main.search.placeholder","Type to start searching...")),onKeyDown:m,children:"Search for navigation items"}),u.jsx(K,{variant:"pi",fontColor:"neutral150",style:{margin:"3px 0 0",display:"inline-block"},children:f(R("pages.main.search.subLabel","press ENTER to highlight next item"))})]}):u.jsx(ut,{children:u.jsx(v2,{}),onClick:()=>d(!c)})},IP=({currentNavigation:t,setCurrentNavigation:e,canUpdate:n,addNewNavigationItem:r})=>{const{formatMessage:o}=ue.useIntl(),i=g.useCallback(()=>{t&&e({...t,items:t.items.map(c=>xo(c,!1))})},[e,t,xo]),s=g.useCallback(()=>{t&&e({...t,items:t.items.map(c=>xo(c,!0))})},[e,t,xo]),a=g.useCallback(c=>{const d=(t?.items??[]).reduce((h,{order:f})=>Math.max(h,f),0);r(c,void 0,!0,"",!0,t?.items.length.toString(),d+1)},[r,t?.items]),l=[{onClick:i,type:"submit",variant:"tertiary",tradId:"header.action.expandAll",margin:"8px"},{onClick:s,type:"submit",variant:"tertiary",tradId:"header.action.collapseAll",margin:"8px"}];return n&&l.push({onClick:a,type:"submit",variant:"primary",tradId:"header.action.newItem",startIcon:u.jsx(tf,{}),margin:"8px"}),l.map(({tradId:c,margin:d,...h},f)=>u.jsx(Z,{marginLeft:d,children:u.jsxs(ze,{...h,children:[" ",o(R(c))," "]})},f))},jP=({canUpdate:t,addNewNavigationItem:e,availableLocale:n,availableNavigations:r,currentNavigation:o,setCurrentNavigation:i})=>{const s=Zz(),{formatMessage:a}=ue.useIntl(),l=qz(),c=Wz(),{i18nCopyItemsModal:d,i18nCopySourceLocale:h,setI18nCopyModalOpened:f,setI18nCopySourceLocale:m}=nH(g.useCallback(p=>{const v=r.find(({locale:x,documentId:y})=>x===p&&y===o?.documentId);v&&v.documentId&&o?.documentId&&s.mutate({source:v.locale,target:o.locale,documentId:v.documentId},{onSuccess(x){s.reset(),i({...x.data,items:x.data.items.map(fc)}),l(),c()}})},[o])),b=g.useCallback(()=>{h&&f(!0)},[f,h]);return u.jsxs(q,{direction:"column",minHeight:"400px",justifyContent:"center",children:[u.jsx(Z,{padding:4,children:u.jsx(K,{variant:"beta",textColor:"neutral600",children:a(R("empty.description"))})}),t&&u.jsx(ze,{variant:"secondary",startIcon:u.jsx(Q7,{}),label:a(R("empty.cta")),onClick:e,children:a(R("empty.cta"))}),t&&!!n.length&&u.jsxs(q,{direction:"column",justifyContent:"center",children:[u.jsx(Z,{paddingTop:3,paddingBottom:3,children:u.jsx(K,{variant:"beta",textColor:"neutral600",children:a(R("view.i18n.fill.cta.header"))})}),u.jsxs(q,{direction:"row",justifyContent:"center",alignItems:"center",children:[u.jsx(Z,{paddingLeft:1,paddingRight:1,children:u.jsx(Sn,{onChange:m,value:h,size:"S",children:n.map(p=>u.jsx(An,{value:p,children:a(R("view.i18n.fill.option"),{locale:p})},p))})}),u.jsx(Z,{paddingLeft:1,paddingRight:1,children:u.jsx(ze,{variant:"tertiary",onClick:b,disabled:!h,size:"S",children:a(R("view.i18n.fill.cta.button"))})})]})]}),t&&d]})},DP=new Re.QueryClient,OP=()=>{const{formatMessage:t}=ue.useIntl(),e=i0(),n=Tt(),r=Kw(),{toggleNotification:o}=de.useNotification(),[i,s]=g.useState(),[a,l]=g.useState(),[c,d]=g.useState(!1),{canAccess:h,canUpdate:f,isLoadingForPermissions:m}=lH(),{localeData:b,currentLocale:p,isChangeLanguageVisible:v,changeCurrentLocaleAction:x,availableLocales:y}=iH(e.data,d),{searchValue:$,setSearchValue:S,isSearchEmpty:A,filteredList:k}=aH(a),{activeNavigationItem:T,addNewNavigationItem:I,editNavigationItem:E,closeNavigationItemPopup:j,isItemPopupVisible:L}=sH(f),D=Yw([e,{isPending:m}]),z=Uw({onError:_=>{o({type:"danger",message:t(R("notification.navigation.update.error"))});try{console.error(_),console.log(_.response.data.error)}catch{}},onSuccess:_=>{l({..._,items:_.items.map(fc)}),s({documentId:_.documentId,id:_.id}),d(!1)}}),V=()=>{a&&z.mutate(a)},W=_=>{_.preventDefault(),_.stopPropagation(),_.target.tagName!=="HTML"&&j()},G=_=>{if(a&&n.data){const O=Io(_,a?.items??[],n.data);l({...a,items:O}),d(!0),j()}},P=A?a?.items??[]:k;return g.useEffect(()=>{if(!a&&e.data?.[0]){let _;i?.documentId&&(_=e.data.find(O=>O.documentId===i.documentId&&O.id===i.id)),s(void 0),l(_||oe.first(e.data))}},[e.data,a]),g.useEffect(()=>{if(a&&p!==a.locale){s(void 0);const _=e.data?.find(O=>O.documentId===a.documentId&&O.locale===p);_&&_.documentId===a.documentId&&_.locale!==a.locale&&l(_)}},[a,p,e.data]),rH(),!e.data||!b||D?u.jsx(de.Page.Loading,{}):u.jsxs(de.Layouts.Root,{children:[u.jsx(de.Page.Title,{children:t(R("header.title","UI Navigation"))}),u.jsxs(de.Page.Main,{children:[u.jsx(DH,{availableNavigations:e.data,activeNavigation:a,handleCachePurge:()=>r.mutate(void 0),handleChangeSelection:l,handleLocalizationSelection:c?x.trigger:x.perform,handleSave:V,locale:b,structureHasChanged:c,isSaving:z.isPending,permissions:{canUpdate:f},currentLocale:p}),u.jsxs(de.Layouts.Content,{children:[u.jsx(LH,{startActions:u.jsx(EP,{value:$,setValue:S}),endActions:u.jsx(IP,{currentNavigation:a,setCurrentNavigation:l,canUpdate:f,addNewNavigationItem:I})}),a?.items.length?u.jsx(Zw,{items:P,onItemLevelAdd:I,onItemEdit:E,onItemSubmit:G,displayFlat:!A,isParentAttachedToMenu:!0,permissions:{canUpdate:f,canAccess:h},structurePrefix:"",locale:p??""}):u.jsx(jP,{canUpdate:f,addNewNavigationItem:I,availableLocale:y,availableNavigations:e.data,currentNavigation:a,setCurrentNavigation:l}),L&&p&&a&&u.jsx(MP,{availableLocale:y,currentItem:T,onSubmit:G,onClose:W,locale:p,permissions:{canUpdate:f},isOpen:L,isLoading:m,currentNavigation:a}),v&&u.jsx(OH,{onCancel:()=>x.cancel(),onConfirm:()=>x.perform()})]})]})]})};function LP(){const t=Ce.usePluginTheme();return u.jsx(Re.QueryClientProvider,{client:DP,children:u.jsx(gw,{theme:t,children:u.jsx(OP,{})})})}const NP=()=>u.jsx($d.DndProvider,{backend:ly.HTML5Backend,children:u.jsxs(wc.Routes,{children:[u.jsx(wc.Route,{path:"/",index:!0,Component:LP}),u.jsx(wc.Route,{path:"/*",Component:de.Page.Error})]})}),BP=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,FP=(t="",e={})=>{const{allowedContentTypes:n=[],restrictedContentTypes:r=[],contentTypes:o=[],preferCustomContentTypes:i=!1}=e,a=(i?["api::",...o]:n).filter(c=>t.includes(c)||t===c).length>0,l=r.filter(c=>t.includes(c)||t===c).length===0;return!!t&&a&&l},VP=(t="")=>{const e=i=>i.split("-").map(s=>oe.capitalize(s)).join(""),[n,r,o]=_P(t);return n==="api"?e(o):`${e(r)}${e(o)}`},_P=(t="")=>t.split(BP).filter(e=>e&&e.length>0),Cg="SERVER OFFLINE",ty=(t,e)=>new Promise(n=>{fetch(`${window.strapi.backendURL}/_health`,{method:"HEAD",mode:"no-cors",headers:{"Content-Type":"application/json","Keep-Alive":"false"}}).then(r=>{if(r.status>=400)throw new Error;if(!e)throw new Error(Cg);n(t)}).catch(r=>{setTimeout(()=>ty(t,r.message!==Cg).then(n),100)})}),l0=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readSettingsConfigIndex(),queryFn(){return e.readSettingsConfig()},staleTime:1e3*60*5})},ny=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQuery({queryKey:e.healthCheckIndex(),queryFn:()=>e.healthCheck(),retry:!0,retryDelay:1e3*5,enabled:!1});return Re.useMutation({mutationFn:()=>e.restart().then(()=>n.refetch())})},ry=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn:()=>e.restoreConfig()})},pc=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readContentTypeIndex(),queryFn:()=>e.readContentType(),staleTime:1/0})},zP=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return e.updateConfig({...n,contentTypesNameFields:Object.fromEntries(n.contentTypesNameFields.map(({key:r,fields:o})=>[r,o])),contentTypesPopulate:Object.fromEntries(n.contentTypesPopulate.map(({key:r,fields:o})=>[r,o])),pathDefaultFields:Object.fromEntries(n.pathDefaultFields.map(({key:r,fields:o})=>[r,o])),additionalFields:n.audienceFieldChecked?[...n.additionalFields,"audience"]:n.additionalFields,gql:{navigationItemRelated:n.contentTypes.map(r=>VP(r))}})}})},Cd=(t,e)=>{const n=e.map(o=>({key:o,fields:t[o]??[]}));return Object.entries(t).filter(([o,i])=>!e.includes(o)).map(([o,i])=>({key:o,fields:i})).concat(n)},HP=({config:t,setFormValue:e})=>{g.useEffect(()=>{if(t){const{additionalFields:n,contentTypes:r,contentTypesNameFields:o,contentTypesPopulate:i,pathDefaultFields:s}=t;e({...t,additionalFields:n.filter(a=>typeof a!="string"),audienceFieldChecked:n.includes("audience"),contentTypesNameFields:Cd(o,r),contentTypesPopulate:Cd(i,r),pathDefaultFields:Cd(s,r)})}},[t])},PP=["string","boolean","select","media"],Ts={background:"neutral0",hasRadius:!0,shadow:"filterShadow",padding:6},oy=g.createContext({values:{},onChange:()=>null,handleChange:()=>null,restartStatus:{required:!1},setRestartStatus:()=>null,renderError:()=>"",setFormValueItem:()=>null}),Sr=()=>g.useContext(oy),WP=({hasSettingsReadPermissions:t})=>{const{formatMessage:e}=ue.useIntl(),n=ry(),{setRestartStatus:r}=Sr(),[o,i]=g.useState(!1),s=async a=>{i(!1),a&&(n.mutate(),r({required:!0}))};return u.jsx(Z,{...Ts,width:"100%",children:u.jsxs(q,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(K,{variant:"delta",as:"h2",children:e(R("pages.settings.restoring.title"))}),u.jsxs(ee.Root,{gap:4,width:"100%",children:[u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(K,{children:e(R("pages.settings.actions.restore.description"))})}),u.jsxs(ee.Item,{col:12,s:12,xs:12,children:[t&&u.jsx(ze,{variant:"danger-light",startIcon:u.jsx(fs,{}),onClick:()=>i(!0),children:e(R("pages.settings.actions.restore.label"))}),u.jsx(mc,{isVisible:o,header:e(R("pages.settings.actions.restore.confirmation.header")),labelConfirm:e(R("pages.settings.actions.restore.confirmation.confirm")),iconConfirm:u.jsx($9,{}),onConfirm:()=>s(!0),onCancel:()=>s(!1),children:e(R("pages.settings.actions.restore.confirmation.description"))})]})]})]})})},qP=en.default(wB)`
|
|
2348
|
+
`,Zw=({isParentAttachedToMenu:t=!1,items:e,level:n=0,levelPath:r="",onItemEdit:o,onItemLevelAdd:i,onItemSubmit:s,displayFlat:a,permissions:l,structurePrefix:c,viewParentId:d,locale:h})=>{const f=({item:v,newOrder:x})=>{s({...v,order:x})},m=v=>{s(lr({...v,removed:!0},!0))},p=v=>{s(lr({...v,removed:!1},!0))},b=v=>{s(lr({...v,collapsed:!v.collapsed,updated:!0,isSearchActive:!1},!0))};return u.jsx(QH,{"data-level":n,children:e?.map((v,x)=>u.jsx(XH,{item:v,isLast:x===e.length-1,level:n,levelPath:r,isParentAttachedToMenu:t,onItemLevelAdd:i,onItemEdit:o,onItemSubmit:s,onItemRestore:p,onItemRemove:m,onItemReOrder:f,onItemToggleCollapse:b,displayChildren:a,permissions:l,structureId:c?`${c}.${x}`:x.toString(),viewParentId:d,locale:h},`list-item-${v.viewId||x}`))})},ZH=({handleCancel:t,handleSubmit:e,submitDisabled:n,canUpdate:r})=>{const{formatMessage:o}=ue.useIntl();return r?u.jsxs(et.Footer,{children:[u.jsx(et.Close,{children:u.jsx(ze,{onClick:t,variant:"tertiary",children:o(R("popup.item.form.button.cancel"))})}),u.jsx(ze,{onClick:e,disabled:n,children:o(R("popup.item.form.button.save"))})]}):null},JH=[/^mailto:[\w-\.]+@([\w-]+\.)+[\w-]{2,}$/,/^tel:(\+\d{1,3})?[\s]?(\(?\d{2,3}\)?)?[\s.-]?(\d{3})?[\s.-]?\d{3,4}$/,/^#.*/,/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/,/(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?/],a0=({additionalFields:t})=>B.z.object({title:B.z.string(),autoSync:B.z.boolean().optional(),removed:B.z.boolean().optional(),updated:B.z.boolean().optional(),uiRouterKey:B.z.string(),levelPath:B.z.string().optional(),isMenuAllowedLevel:B.z.boolean().optional(),parentAttachedToMenu:B.z.boolean().optional(),viewId:B.z.number().optional(),structureId:B.z.string().optional(),menuAttached:B.z.boolean().optional(),collapsed:B.z.boolean().optional(),isSearchActive:B.z.boolean().optional(),viewParentId:B.z.number().optional(),id:B.z.number().optional(),documentId:B.z.string().optional(),audience:B.z.string().array().optional(),order:B.z.number().optional(),items:B.z.any().array().optional(),additionalFields:B.z.object(t.reduce((e,n)=>{if(typeof n=="string")return e;switch(n.type){case"string":e[n.name]=n.required?B.z.string():B.z.string().optional();break;case"boolean":e[n.name]=n.required?B.z.boolean():B.z.boolean().optional();case"media":e[n.name]=n.required?B.z.any():B.z.any().optional();case"select":{n.multi?e[n.name]=n.required?B.z.string().array():B.z.string().array().optional():e[n.name]=n.required?B.z.string():B.z.string().optional();break}}return e},{}))}),eP=({additionalFields:t,isSingleSelected:e})=>a0({additionalFields:t}).extend({type:B.z.literal("INTERNAL"),path:B.z.string().or(B.z.null()).optional(),externalPath:B.z.string().nullish(),relatedType:B.z.string(),related:e?B.z.string().optional():B.z.string()}),tP=({isSingleSelected:t,additionalFields:e})=>a0({additionalFields:e}).extend({type:B.z.literal("EXTERNAL"),path:B.z.string().or(B.z.null()).optional(),externalPath:B.z.string().min(1).refine(n=>JH.some(r=>r.test(n))),relatedType:B.z.string().optional(),related:B.z.string().optional()}),nP=({isSingleSelected:t,additionalFields:e})=>a0({additionalFields:e}).extend({type:B.z.literal("WRAPPER"),path:B.z.string().or(B.z.null()).optional()}),rP=t=>B.z.discriminatedUnion("type",[tP(t),eP(t),nP(t)]),wg={autoSync:!0,type:"INTERNAL",relatedType:"",menuAttached:!1,title:"",externalPath:"",path:"",additionalFields:{},audience:[],updated:!1,uiRouterKey:""},oP=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return e.slugify(n)}})},iP=()=>{const t=Tt();return{encodePayload:r=>({...r,additionalFields:t.data?.additionalFields.reduce((o,i)=>{const{name:s,type:a}=i;if(s in(r.additionalFields??{})){let l=r.additionalFields[s];switch(a){case"boolean":l=oe.isBoolean(l)?`${l}`:l;break;case"media":l=l&&JSON.stringify(l);break}return{...o,[s]:l}}return o},{})||{}}),decodePayload:r=>({...r,additionalFields:t.data?.additionalFields.reduce((o,i)=>{const{name:s,type:a}=i;if(s in(r.additionalFields??{})){let l=r.additionalFields[s];switch(a){case"boolean":l=l==="true";break;case"media":l=l&&JSON.parse(l);break}return{...o,[s]:l}}return o},{})||{}})}},sP=()=>{const{formatMessage:t}=ue.useIntl(),[e,n]=g.useState({}),[r,o]=g.useState(),i=(c,d,h)=>{if(h){let f=c,m=d;if(oe.isObject(c)){const{name:p,value:b}=c.target;f=p,m=oe.isNil(m)?b:m}return oe.isString(f)&&s(f,m),h(c,m)}},s=(c,d)=>{n(oe.set({...e,additionalFields:{...e.additionalFields},updated:!0},c,d))};return{formValue:e,renderError:(c,d)=>oe.get(r,c)?t(R(d??c)):void 0,setFormError:o,handleChange:i,setFormValue:n,setFormValueItem:s,setFormValuesItems:c=>n({...e,...c,updated:!0})}},aP=async({slugify:t,title:e,config:n,related:r,relatedType:o,contentTypeItems:i})=>{if(e)return e?await t(e):void 0;if(r){const s=gc({...i?.find(a=>a.documentId===r.toString())??{documentId:"",id:0},__collectionUid:o},n);return s?await t(s):void 0}},lP=({currentType:t,config:e,contentTypeItems:n,currentRelated:r,currentRelatedType:o,isSingleSelected:i})=>{if(t!=="INTERNAL"||!o)return"";const s=e?.pathDefaultFields[o]??[];if(oe.isEmpty(t)&&!oe.isEmpty(s)){const a=i?oe.first(n??[]):n?.find(({id:c})=>c===r);return s.map(c=>a?.[c]??"").filter(c=>!!c.toString().trim())[0]??""}return""},cP=({currentPath:t,isExternal:e,current:n,currentType:r="INTERNAL",config:o,contentTypeItems:i,currentRelated:s,currentRelatedType:a,isSingleSelected:l})=>{if(!e){const c=oe.isEmpty(t)||t==="/"?lP({currentType:r,config:o,contentTypeItems:i,currentRelated:s,currentRelatedType:a,isSingleSelected:l}):t||"";return`${n.levelPath!=="/"?`${n.levelPath}`:""}/${c}`.replace("//","/")}},Jw=g.createContext({values:{},onChange:()=>null,handleChange:()=>null,renderError:()=>"",setFormValueItem:()=>null,canUpdate:void 0,isLoading:!0}),jn=()=>g.useContext(Jw),dP=()=>{const{formatMessage:t}=ue.useIntl(),e=Tt(),{values:n,onChange:r,handleChange:o,renderError:i,canUpdate:s}=jn(),l=(e.data?.contentTypes.length?["INTERNAL","EXTERNAL","WRAPPER"]:["EXTERNAL","WRAPPER"]).map(c=>({key:c,value:c,label:t(R(`popup.item.form.type.${c.toLowerCase()}.label`))}));return u.jsx(ee.Item,{alignItems:"flex-start",col:8,children:u.jsx(Ce.Field,{name:"type",label:t(R("popup.item.form.type.label","Internal link")),error:i("type"),hint:t(R("popup.item.form.title.placeholder","e.g. Blog")),children:u.jsx(Sn,{onChange:c=>o("type",c,r),value:n.type,name:"type",disabled:!s,width:"100%",children:l.map(({key:c,label:d,value:h})=>u.jsx(An,{value:h,children:d},c))})})},"title")},uP=({current:t})=>{const{formatMessage:e}=ue.useIntl(),n=Tt(),{values:r,onChange:o,handleChange:i,renderError:s,canUpdate:a}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:4,children:u.jsx(Ce.Field,{name:"menuAttached",label:e(R("popup.item.form.menuAttached.label","MenuAttached")),error:s("menuAttached"),hint:e(R("popup.item.form.menuAttached.placeholder","is menu item attached to menu")),children:u.jsx(wn,{name:"menuAttached",checked:r.menuAttached,onChange:l=>i(l,!r.menuAttached,o),value:r.menuAttached,onLabel:e(R("popup.item.form.menuAttached.value.yes","yes")),offLabel:e(R("popup.item.form.menuAttached.value.no","no")),disabled:!a||(n.data?.cascadeMenuAttached?!(t.isMenuAllowedLevel&&t.parentAttachedToMenu):!1),width:"100%"})})},"menuAttached")},hP=()=>{const{formatMessage:t}=ue.useIntl(),{values:e,onChange:n,handleChange:r,renderError:o,canUpdate:i}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:e.type==="INTERNAL"?8:12,children:u.jsx(Ce.Field,{name:"title",label:t(R("popup.item.form.title.label","Title")),error:o("title"),hint:t(R("popup.item.form.title.placeholder","e.g. Blog")),children:u.jsx(pn,{type:"string",disabled:!i||e.autoSync&&e.type==="INTERNAL",name:"title",onChange:(s,a)=>r(s,a,n),value:e.title})})},"title")},fP=()=>{const{formatMessage:t}=ue.useIntl(),{values:e,onChange:n,handleChange:r,renderError:o,canUpdate:i}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:4,children:u.jsx(Ce.Field,{name:"autoSync",label:t(R("popup.item.form.autoSync.label","Read fields from related")),error:o("autoSync"),children:u.jsx(wn,{name:"autoSync",checked:e.autoSync,onChange:s=>r(s,!e.autoSync,n),disabled:!i,onLabel:"Enabled",offLabel:"Disabled"})})},"autoSync")},mP=({contentTypeItems:t,current:e,isSingleSelected:n})=>{const{formatMessage:r}=ue.useIntl(),o=Tt(),{values:i,onChange:s,handleChange:a,renderError:l,canUpdate:c}=jn(),d=i.type==="EXTERNAL"?"externalPath":"path",h=i.type==="INTERNAL"?i:{related:void 0,relatedType:void 0},f=cP({currentPath:i.path,isExternal:i.type==="EXTERNAL",current:e,currentType:i.type,config:o.data,contentTypeItems:t,currentRelated:h.related,currentRelatedType:h.relatedType,isSingleSelected:n});return u.jsx(ee.Item,{alignItems:"flex-start",col:12,children:u.jsx(Ce.Field,{name:d,label:r(R(`popup.item.form.${d}.label`,"Path")),error:l(d,`popup.item.form.${d}.validation.type`),hint:[r(R(`popup.item.form.${d}.placeholder`,"e.g. Blog")),f?r(R("popup.item.form.type.external.description"),{value:f}):""].join(" "),children:u.jsx(pn,{disabled:!c,name:d,onChange:(m,p)=>a(m,p,s),value:i.type==="EXTERNAL"?i.externalPath:i.path,width:"100%"})})},"title")},gP="",pP={type:"media",required:!1,attribute:{multiple:!1,allowedTypes:["files","images","videos","audios"]},pluginOptions:{i18n:{localized:!1}}},bP=({name:t,field:e,isLoading:n,onChange:r,onChangeEnhancer:o,value:i,disabled:s})=>{const{toggleNotification:a}=de.useNotification(),{formatMessage:l}=ue.useIntl(),d=de.useStrapiApp("AdditionalFieldInput",f=>f.fields).media,h=g.useMemo(()=>({id:e.name,name:t||e.name,disabled:n||s,placeholder:e.placeholder}),[e,n]);switch(g.useEffect(()=>{if(e.type==="media"){const f=oe.isNull(i)?void 0:i;o(h.name,f,r)}},[i]),e.type){case"boolean":return u.jsx(wn,{...h,checked:!!i,onChange:f=>o(f,!i,r),onLabel:"true",offLabel:"false",type:"checkbox"});case"string":return u.jsx(pn,{...h,onChange:(f,m)=>o(f,m,r),value:i||gP});case"select":return e.multi?u.jsx(Eo,{...h,onChange:f=>o(h.name,f,r),value:oe.isNil(i)?e.multi?[]:null:i,multi:e.multi,withTags:e.multi,children:e.options.map((f,m)=>u.jsx(Nr,{value:f,children:f},`${e.name}-option-${m}`))}):u.jsx(Sn,{...h,onChange:f=>o(h.name,f,r),value:oe.isNil(i)?e.multi?[]:null:i,multi:e.multi,withTags:e.multi,children:e.options.map((f,m)=>u.jsx(An,{value:f,children:f},`${e.name}-option-${m}`))});case"media":return u.jsx(d,{...h,...pP,value:i});default:throw a({type:"warning",message:l(R("notification.error.customField.type"))}),new Error("Type of custom field is unsupported")}},vP=({additionalField:t})=>{const{canUpdate:e,isLoading:n,onChange:r,handleChange:o,renderError:i,values:s}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:6,children:u.jsx(Ce.Field,{name:`additionalFields.${t.name}`,label:t.label,hint:t.description,required:t.required,error:i(`additionalFields.${t.name}`),children:u.jsx(bP,{name:`additionalFields.${t.name}`,field:t,isLoading:n,onChange:r,onChangeEnhancer:o,value:oe.get(s?.additionalFields,t.name),disabled:!e})})},t.name)},xP=()=>{const{formatMessage:t}=ue.useIntl(),n=Tt().data?.availableAudience??[],r=g.useMemo(()=>n.map(c=>({value:c.documentId??0,label:c.name??" "})),[n]),{isLoading:o,renderError:i,onChange:s,handleChange:a,values:l}=jn();return u.jsx(ee.Item,{alignItems:"flex-start",col:12,children:u.jsx(Ce.Field,{name:"audience",label:t(R("popup.item.form.audience.label")),error:i("audience"),hint:!o&&oe.isEmpty(r)?t(R("popup.item.form.title.placeholder","e.g. Blog")):void 0,children:u.jsx(Eo,{name:"audience",value:l.audience,onChange:c=>a("audience",c,s),width:"100%",children:r.map(({value:c,label:d})=>u.jsx(Nr,{value:c,children:d},c))})})},"audience")},wP=()=>{const t=Tt();if(!t.data?.additionalFields||oe.isEmpty(t.data.additionalFields))return null;const e=t.data.additionalFields.filter(r=>r!=="audience"),n=t.data.additionalFields.find(r=>r==="audience");return u.jsxs(u.Fragment,{children:[u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(ee.Item,{col:12,lg:12,children:u.jsx(Yo,{width:"100%"})})}),u.jsxs(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[e.map(r=>u.jsx(vP,{additionalField:r},r.name)),n&&u.jsx(xP,{})]}),u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(ee.Item,{col:12,lg:12,children:u.jsx(Yo,{width:"100%"})})})]})},yP=({availableLocale:t,current:e,currentNavigation:n,setIsLoading:r,setFormValuesItems:o})=>{const{formatMessage:i}=ue.useIntl(),[s,a]=g.useState(),l=Qz(),c=i0(),{canUpdate:d,isLoading:h}=jn(),f=g.useMemo(()=>t.map((p,b)=>({key:`${p}-${b}`,value:p,label:p})),[t]),m=g.useCallback(async p=>{p.preventDefault(),p.stopPropagation();const b=c.data?.find(({locale:v})=>v===s);b&&(r(!0),l.mutate({target:n.documentId,structureId:e.structureId,source:b.documentId},{onSuccess(v){l.reset();const{type:x,externalPath:y,path:$,related:S,title:A,uiRouterKey:k}=v;o({type:x,externalPath:y,path:$,title:A,uiRouterKey:k,related:S})},onSettled(){r(!1)}}))},[r,l,c]);return!f||f.length<1?null:u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsxs(ee.Item,{alignItems:"flex-start",col:12,children:[u.jsx(Yo,{marginTop:5,marginBottom:5}),u.jsxs(ee.Root,{gap:5,children:[u.jsx(ee.Item,{alignItems:"flex-start",col:6,lg:12,children:u.jsx(Ce.Field,{name:"i18n.locale",label:i(R("popup.item.form.i18n.locale.label","Copy details from")),children:u.jsx(Sn,{name:"i18n.locale",onChange:a,value:s,disabled:h||!d,placeholder:i(R("popup.item.form.i18n.locale.placeholder","locale")),children:f.map(({key:p,label:b,value:v})=>u.jsx(An,{value:v,children:b},p))})})}),d&&u.jsx(ee.Item,{alignItems:"flex-start",col:6,lg:12,paddingTop:6,children:u.jsx(Z,{children:u.jsx(ze,{variant:"tertiary",onClick:m,disabled:h||!s,children:i(R("popup.item.form.i18n.locale.button"))})})})]})]},"title")})},yg=(t,e)=>e?t.find(n=>n.value===e)?.label??"":"",ey=({name:t,onClear:e,onChange:n,options:r,value:o,disabled:i})=>{const[s,a]=g.useState(yg(r,o));return g.useEffect(()=>{a(yg(r,o))},[o,r]),u.jsx(dw,{name:t,autocomplete:"list",onClear:e,onChange:n,onTextValueChange:a,value:o,textValue:s,options:r,disabled:i,width:"100%",children:r.map(({key:l,label:c,value:d})=>u.jsx(uw,{value:d,children:c},l))})},CP=({contentTypeItems:t,current:e,currentRelatedType:n,isSingleSelected:r,setFormValuesItems:o,setIsSingleSelected:i})=>{const{formatMessage:s}=ue.useIntl(),a=Tt(),{canUpdate:l,isLoading:c,renderError:d,setFormValueItem:h,values:f}=jn(),m=g.useMemo(()=>oe.sortBy(a.data?.contentTypes.map(p=>({key:p.uid,value:p.uid,label:p.contentTypeName})),p=>p.label),[a.data,n]);return g.useEffect(()=>{if(!n)return;const p=a.data?.contentTypes.find(b=>b.uid===n);if(p&&(i(p.isSingle),p.isSingle&&t?.length)){const b=t[0];b&&h("related",b.documentId)}},[n,a.data,t]),g.useEffect(()=>{n===""&&h("relatedType",a.data?.defaultContentType)},[a.data?.defaultContentType,f.type,n]),u.jsx(ee.Item,{alignItems:"flex-start",col:n&&!r?6:12,children:u.jsx(Ce.Field,{name:"relatedType",label:s(R("popup.item.form.relatedType.label","Related Type")),error:d("relatedType"),hint:!c&&oe.isEmpty(m)?s(R("popup.item.form.relatedType.empty","There are no more content types")):void 0,children:u.jsx(ey,{name:"relatedType",onClear:()=>o({related:void 0,relatedType:void 0,title:f.autoSync?"":f.title}),onChange:p=>o({related:void 0,relatedType:p,title:f.autoSync?"":f.title}),value:n,options:m,disabled:!a.data?.contentTypes.length||!l})})})},$P=(t,e,n)=>{const r=Tt();g.useEffect(()=>{if(!t.autoSync||!t.related||!r.data)return;const o=e?.find(c=>c.documentId===t.related);if(!o)return;const{contentTypesNameFields:i,pathDefaultFields:s}=r.data,a=s[t.relatedType]?.reduce((c,d)=>c||o?.[d],void 0)||"",l=(i[t.relatedType]??[]).concat(i.default??[]).reduce((c,d)=>c||o?.[d],void 0);a&&t.path,l&&t.title,n({path:a,title:l})},[t.autoSync,t.related,t.relatedType,e,r.data])},SP=({appendLabelPublicationStatus:t,contentTypeItems:e,isSingleSelected:n,values:r,setFormValuesItems:o})=>{const{formatMessage:i}=ue.useIntl(),s=Tt(),{canUpdate:a,isLoading:l,handleChange:c,onChange:d,renderError:h}=jn(),f=oe.sortBy(e?.map(p=>{const v=t(gc({...p,__collectionUid:r.relatedType},s.data),p,!1)+(p?.id?` (id: ${p.id})`:"");return{key:p?.documentId?.toString(),value:p?.documentId?.toString(),label:v}})??[],p=>p.label),m=oe.isEmpty(f);return $P(r,e,o),!r.relatedType||n?null:u.jsx(ee.Item,{alignItems:"flex-start",col:6,children:u.jsx(Ce.Field,{name:"related",label:i(R("popup.item.form.related.label","Related")),error:h("related"),hint:!l&&m?i(R("popup.item.form.related.empty","There are no more entities"),{contentTypeName:r.relatedType}):void 0,children:u.jsx(ey,{name:"related",onClear:()=>c("related",void 0,d),onChange:p=>c("related",p,d),value:r.related,options:f,disabled:l||m||!a})})})},AP=[],kP=({availableLocale:t,isLoading:e,current:n=wg,onSubmit:r,onCancel:o,appendLabelPublicationStatus:i=TP,locale:s,permissions:a={},currentNavigation:l})=>{const{formatMessage:c}=ue.useIntl(),[d,h]=g.useState(e),{canUpdate:f}=a,[m,p]=g.useState(!1),b=Tt(),v=b.data?.contentTypes??[],{toggleNotification:x}=de.useNotification(),{formValue:y,renderError:$,setFormError:S,handleChange:A,setFormValue:k,setFormValueItem:T,setFormValuesItems:I}=sP(),{encodePayload:E,decodePayload:j}=iP(),L=y.type==="INTERNAL",D=L&&!y.related&&!m||d,z=qw({uid:L?y.relatedType:"",locale:s}),V=async(P,_)=>{P.preventDefault();const O=E(_),{success:X,data:J,error:fe}=rP({isSingleSelected:m,additionalFields:b.data?.additionalFields??AP}).safeParse(O);if(X){const se=J.title.trim()?J.title.trim():J.type==="INTERNAL"?G(J?.related?.toString(),J.relatedType,m):"";h(!0);const pe=await aP(J.type==="INTERNAL"?{slugify:W.mutateAsync,title:se,related:J.related,relatedType:J.relatedType}:{slugify:W.mutateAsync,title:se});if(W.reset(),h(!1),!pe){x({type:"warning",message:c(R("popup.item.form.uiRouter.unableToRender"))});return}r(J.type==="INTERNAL"?{...J,title:se,uiRouterKey:pe}:{...J,title:se,uiRouterKey:pe})}else fe&&S(fe.issues.reduce((se,pe)=>({...se,[pe.path.join(".")]:pe.message}),{}))},W=oP(),G=g.useCallback((P,_,O)=>{let X;if(O){if(X=z.data?.find(J=>J.uid===_||J.__collectionUid===_),!X)return v.find(J=>J.uid===_)?.contentTypeName}else X={...z.data?.find(({documentId:fe})=>fe===P)||{documentId:null},__collectionUid:_};return gc(X,b.data)},[z.data,b.data,v]);return g.useEffect(()=>{k(j({...wg,...n}))},[n]),u.jsxs(u.Fragment,{children:[u.jsx(et.Body,{children:u.jsx(de.Form,{width:"auto",height:"auto",method:"POST",initialValues:y,children:({values:P,onChange:_})=>u.jsxs(Jw.Provider,{value:{values:P,onChange:_,handleChange:A,renderError:$,setFormValueItem:T,canUpdate:f,isLoading:d},children:[u.jsxs(ee.Root,{gap:5,paddingBottom:1,children:[u.jsx(dP,{}),u.jsx(uP,{current:n})]}),u.jsxs(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[u.jsx(hP,{}),P.type==="INTERNAL"&&u.jsx(fP,{})]}),u.jsx(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(mP,{contentTypeItems:z.data,current:n,isSingleSelected:m})}),P.type==="INTERNAL"&&u.jsxs(ee.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[u.jsx(CP,{contentTypeItems:z.data,current:n,currentRelatedType:P.relatedType,isSingleSelected:m,setFormValuesItems:I,setIsSingleSelected:p}),u.jsx(SP,{appendLabelPublicationStatus:i,contentTypeItems:z.data,values:P,isSingleSelected:m,setFormValuesItems:I})]}),u.jsx(wP,{}),u.jsx(yP,{availableLocale:t,current:n,currentNavigation:l,setIsLoading:h,setFormValuesItems:I}),u.jsx(ee.Root,{gap:5,children:u.jsx(ee.Item,{alignItems:"flex-start",col:12},"title")})]})})}),u.jsx(ZH,{handleSubmit:P=>V(P,y),handleCancel:o,submitDisabled:D,canUpdate:f})]})},TP=()=>"",RP=({isNewItem:t,canUpdate:e})=>{const{formatMessage:n}=ue.useIntl();let r="view";return e&&(r=t?"new":"edit"),u.jsx(et.Header,{children:u.jsx(K,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:n(R(`popup.item.header.${r}`))})})},MP=({availableLocale:t,isOpen:e,isLoading:n,currentItem:r={},onSubmit:o,onClose:i,locale:s,permissions:a,currentNavigation:l})=>{const{formatMessage:c}=ue.useIntl(),d=m=>{o(m)},h=(m,p,b)=>`${cH({relatedRef:p,type:p.isSingle?"INTERNAL":p.type,isCollection:b})?"":`[${c(R("notification.navigation.item.relation.status.draft"))}] `.toUpperCase()}${m}`,f=!!r.viewId;return u.jsx(et.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:m=>{m||i({preventDefault(){},stopPropagation(){},target:{}})},open:e,children:u.jsxs(et.Content,{children:[u.jsx(RP,{isNewItem:!f,canUpdate:a?.canUpdate}),u.jsx(kP,{availableLocale:t,current:r,isLoading:n,onSubmit:d,onCancel:i,appendLabelPublicationStatus:h,locale:s,permissions:a,currentNavigation:l})]})})},yd=0,EP=({value:t,setValue:e,initialIndex:n=yd})=>{const[r,o]=g.useState(t),[i,s]=g.useState(t),[a,l]=g.useState(n),[c,d]=g.useState(!!t),h=g.useRef(null),{formatMessage:f}=ue.useIntl();g.useEffect(()=>{c&&setTimeout(()=>{h.current?.querySelector("input")?.focus()},0)},[c]),g.useEffect(()=>{a&&r===i&&e({value:r,index:a})},[a,r,i]),g.useEffect(()=>{r!==i&&(s(r),l(yd),e({value:r,index:yd}))},[r,i]);const m=g.useCallback(v=>{v.code.toLowerCase()==="enter"&&l(x=>x+1)},[]),p=g.useCallback(v=>{o(v.target.value)},[o]),b=g.useCallback(()=>{o(""),d(!1)},[o,d]);return c?u.jsxs("div",{ref:h,children:[u.jsx(M_,{name:"searchbar",onClear:b,value:t,size:"S",onChange:p,clearLabel:"Clearing the search",placeholder:f(R("pages.main.search.placeholder","Type to start searching...")),onKeyDown:m,children:"Search for navigation items"}),u.jsx(K,{variant:"pi",fontColor:"neutral150",style:{margin:"3px 0 0",display:"inline-block"},children:f(R("pages.main.search.subLabel","press ENTER to highlight next item"))})]}):u.jsx(ut,{children:u.jsx(v2,{}),onClick:()=>d(!c)})},IP=({currentNavigation:t,setCurrentNavigation:e,canUpdate:n,addNewNavigationItem:r})=>{const{formatMessage:o}=ue.useIntl(),i=g.useCallback(()=>{t&&e({...t,items:t.items.map(c=>xo(c,!1))})},[e,t,xo]),s=g.useCallback(()=>{t&&e({...t,items:t.items.map(c=>xo(c,!0))})},[e,t,xo]),a=g.useCallback(c=>{const d=(t?.items??[]).reduce((h,{order:f})=>Math.max(h,f),0);r(c,void 0,!0,"",!0,t?.items.length.toString(),d+1)},[r,t?.items]),l=[{onClick:i,type:"submit",variant:"tertiary",tradId:"header.action.expandAll",margin:"8px"},{onClick:s,type:"submit",variant:"tertiary",tradId:"header.action.collapseAll",margin:"8px"}];return n&&l.push({onClick:a,type:"submit",variant:"primary",tradId:"header.action.newItem",startIcon:u.jsx(tf,{}),margin:"8px"}),l.map(({tradId:c,margin:d,...h},f)=>u.jsx(Z,{marginLeft:d,children:u.jsxs(ze,{...h,children:[" ",o(R(c))," "]})},f))},jP=({canUpdate:t,addNewNavigationItem:e,availableLocale:n,availableNavigations:r,currentNavigation:o,setCurrentNavigation:i})=>{const s=Zz(),{formatMessage:a}=ue.useIntl(),l=qz(),c=Wz(),{i18nCopyItemsModal:d,i18nCopySourceLocale:h,setI18nCopyModalOpened:f,setI18nCopySourceLocale:m}=nH(g.useCallback(b=>{const v=r.find(({locale:x,documentId:y})=>x===b&&y===o?.documentId);v&&v.documentId&&o?.documentId&&s.mutate({source:v.locale,target:o.locale,documentId:v.documentId},{onSuccess(x){s.reset(),i({...x.data,items:x.data.items.map(fc)}),l(),c()}})},[o])),p=g.useCallback(()=>{h&&f(!0)},[f,h]);return u.jsxs(q,{direction:"column",minHeight:"400px",justifyContent:"center",children:[u.jsx(Z,{padding:4,children:u.jsx(K,{variant:"beta",textColor:"neutral600",children:a(R("empty.description"))})}),t&&u.jsx(ze,{variant:"secondary",startIcon:u.jsx(Q7,{}),label:a(R("empty.cta")),onClick:e,children:a(R("empty.cta"))}),t&&!!n.length&&u.jsxs(q,{direction:"column",justifyContent:"center",children:[u.jsx(Z,{paddingTop:3,paddingBottom:3,children:u.jsx(K,{variant:"beta",textColor:"neutral600",children:a(R("view.i18n.fill.cta.header"))})}),u.jsxs(q,{direction:"row",justifyContent:"center",alignItems:"center",children:[u.jsx(Z,{paddingLeft:1,paddingRight:1,children:u.jsx(Sn,{onChange:m,value:h,size:"S",children:n.map(b=>u.jsx(An,{value:b,children:a(R("view.i18n.fill.option"),{locale:b})},b))})}),u.jsx(Z,{paddingLeft:1,paddingRight:1,children:u.jsx(ze,{variant:"tertiary",onClick:p,disabled:!h,size:"S",children:a(R("view.i18n.fill.cta.button"))})})]})]}),t&&d]})},DP=new Re.QueryClient,OP=()=>{const{formatMessage:t}=ue.useIntl(),e=i0(),n=Tt(),r=Kw(),{toggleNotification:o}=de.useNotification(),[i,s]=g.useState(),[a,l]=g.useState(),[c,d]=g.useState(!1),{canAccess:h,canUpdate:f,isLoadingForPermissions:m}=lH(),{localeData:p,currentLocale:b,isChangeLanguageVisible:v,changeCurrentLocaleAction:x,availableLocales:y}=iH(e.data,d),{searchValue:$,setSearchValue:S,isSearchEmpty:A,filteredList:k}=aH(a),{activeNavigationItem:T,addNewNavigationItem:I,editNavigationItem:E,closeNavigationItemPopup:j,isItemPopupVisible:L}=sH(f),D=Yw([e,{isPending:m}]),z=Uw({onError:_=>{o({type:"danger",message:t(R("notification.navigation.update.error"))});try{console.error(_),console.log(_.response.data.error)}catch{}},onSuccess:_=>{l({..._,items:_.items.map(fc)}),s({documentId:_.documentId,id:_.id}),d(!1)}}),V=()=>{a&&z.mutate(a)},W=_=>{_.preventDefault(),_.stopPropagation(),_.target.tagName!=="HTML"&&j()},G=_=>{if(a&&n.data){const O=Io(_,a?.items??[],n.data);l({...a,items:O}),d(!0),j()}},P=A?a?.items??[]:k;return g.useEffect(()=>{if(!a&&e.data?.[0]){let _;i?.documentId&&(_=e.data.find(O=>O.documentId===i.documentId&&O.id===i.id)),s(void 0),l(_||oe.first(e.data))}},[e.data,a]),g.useEffect(()=>{if(a&&b!==a.locale){s(void 0);const _=e.data?.find(O=>O.documentId===a.documentId&&O.locale===b);_&&_.documentId===a.documentId&&_.locale!==a.locale&&l(_)}},[a,b,e.data]),rH(),!e.data||!p||D?u.jsx(de.Page.Loading,{}):u.jsxs(de.Layouts.Root,{children:[u.jsx(de.Page.Title,{children:t(R("header.title","UI Navigation"))}),u.jsxs(de.Page.Main,{children:[u.jsx(DH,{availableNavigations:e.data,activeNavigation:a,handleCachePurge:()=>r.mutate(void 0),handleChangeSelection:l,handleLocalizationSelection:c?x.trigger:x.perform,handleSave:V,locale:p,structureHasChanged:c,isSaving:z.isPending,permissions:{canUpdate:f},currentLocale:b}),u.jsxs(de.Layouts.Content,{children:[u.jsx(LH,{startActions:u.jsx(EP,{value:$,setValue:S}),endActions:u.jsx(IP,{currentNavigation:a,setCurrentNavigation:l,canUpdate:f,addNewNavigationItem:I})}),a?.items.length?u.jsx(Zw,{items:P,onItemLevelAdd:I,onItemEdit:E,onItemSubmit:G,displayFlat:!A,isParentAttachedToMenu:!0,permissions:{canUpdate:f,canAccess:h},structurePrefix:"",locale:b??""}):u.jsx(jP,{canUpdate:f,addNewNavigationItem:I,availableLocale:y,availableNavigations:e.data,currentNavigation:a,setCurrentNavigation:l}),L&&b&&a&&u.jsx(MP,{availableLocale:y,currentItem:T,onSubmit:G,onClose:W,locale:b,permissions:{canUpdate:f},isOpen:L,isLoading:m,currentNavigation:a}),v&&u.jsx(OH,{onCancel:()=>x.cancel(),onConfirm:()=>x.perform()})]})]})]})};function LP(){const t=Ce.usePluginTheme();return u.jsx(Re.QueryClientProvider,{client:DP,children:u.jsx(gw,{theme:t,children:u.jsx(OP,{})})})}const NP=()=>u.jsx($d.DndProvider,{backend:ly.HTML5Backend,children:u.jsxs(wc.Routes,{children:[u.jsx(wc.Route,{path:"/",index:!0,Component:LP}),u.jsx(wc.Route,{path:"/*",Component:de.Page.Error})]})}),BP=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,FP=(t="",e={})=>{const{allowedContentTypes:n=[],restrictedContentTypes:r=[],contentTypes:o=[],preferCustomContentTypes:i=!1}=e,a=(i?["api::",...o]:n).filter(c=>t.includes(c)||t===c).length>0,l=r.filter(c=>t.includes(c)||t===c).length===0;return!!t&&a&&l},VP=(t="")=>{const e=i=>i.split("-").map(s=>oe.capitalize(s)).join(""),[n,r,o]=_P(t);return n==="api"?e(o):`${e(r)}${e(o)}`},_P=(t="")=>t.split(BP).filter(e=>e&&e.length>0),Cg="SERVER OFFLINE",ty=(t,e)=>new Promise(n=>{fetch(`${window.strapi.backendURL}/_health`,{method:"HEAD",mode:"no-cors",headers:{"Content-Type":"application/json","Keep-Alive":"false"}}).then(r=>{if(r.status>=400)throw new Error;if(!e)throw new Error(Cg);n(t)}).catch(r=>{setTimeout(()=>ty(t,r.message!==Cg).then(n),100)})}),l0=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readSettingsConfigIndex(),queryFn(){return e.readSettingsConfig()},staleTime:1e3*60*5})},ny=()=>{const t=de.getFetchClient(),e=Fe(t),n=Re.useQuery({queryKey:e.healthCheckIndex(),queryFn:()=>e.healthCheck(),retry:!0,retryDelay:1e3*5,enabled:!1});return Re.useMutation({mutationFn:()=>e.restart().then(()=>n.refetch())})},ry=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn:()=>e.restoreConfig()})},pc=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useQuery({queryKey:e.readContentTypeIndex(),queryFn:()=>e.readContentType(),staleTime:1/0})},zP=()=>{const t=de.getFetchClient(),e=Fe(t);return Re.useMutation({mutationFn(n){return e.updateConfig({...n,contentTypesNameFields:Object.fromEntries(n.contentTypesNameFields.map(({key:r,fields:o})=>[r,o])),contentTypesPopulate:Object.fromEntries(n.contentTypesPopulate.map(({key:r,fields:o})=>[r,o])),pathDefaultFields:Object.fromEntries(n.pathDefaultFields.map(({key:r,fields:o})=>[r,o])),additionalFields:n.audienceFieldChecked?[...n.additionalFields,"audience"]:n.additionalFields,gql:{navigationItemRelated:n.contentTypes.map(r=>VP(r))}})}})},Cd=(t,e)=>{const n=e.map(o=>({key:o,fields:t[o]??[]}));return Object.entries(t).filter(([o,i])=>!e.includes(o)).map(([o,i])=>({key:o,fields:i})).concat(n)},HP=({config:t,setFormValue:e})=>{g.useEffect(()=>{if(t){const{additionalFields:n,contentTypes:r,contentTypesNameFields:o,contentTypesPopulate:i,pathDefaultFields:s}=t;e({...t,additionalFields:n.filter(a=>typeof a!="string"),audienceFieldChecked:n.includes("audience"),contentTypesNameFields:Cd(o,r),contentTypesPopulate:Cd(i,r),pathDefaultFields:Cd(s,r)})}},[t])},PP=["string","boolean","select","media"],Ts={background:"neutral0",hasRadius:!0,shadow:"filterShadow",padding:6},oy=g.createContext({values:{},onChange:()=>null,handleChange:()=>null,restartStatus:{required:!1},setRestartStatus:()=>null,renderError:()=>"",setFormValueItem:()=>null}),Sr=()=>g.useContext(oy),WP=({hasSettingsReadPermissions:t})=>{const{formatMessage:e}=ue.useIntl(),n=ry(),{setRestartStatus:r}=Sr(),[o,i]=g.useState(!1),s=async a=>{i(!1),a&&(n.mutate(),r({required:!0}))};return u.jsx(Z,{...Ts,width:"100%",children:u.jsxs(q,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(K,{variant:"delta",as:"h2",children:e(R("pages.settings.restoring.title"))}),u.jsxs(ee.Root,{gap:4,width:"100%",children:[u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(K,{children:e(R("pages.settings.actions.restore.description"))})}),u.jsxs(ee.Item,{col:12,s:12,xs:12,children:[t&&u.jsx(ze,{variant:"danger-light",startIcon:u.jsx(fs,{}),onClick:()=>i(!0),children:e(R("pages.settings.actions.restore.label"))}),u.jsx(mc,{isVisible:o,header:e(R("pages.settings.actions.restore.confirmation.header")),labelConfirm:e(R("pages.settings.actions.restore.confirmation.confirm")),iconConfirm:u.jsx($9,{}),onConfirm:()=>s(!0),onCancel:()=>s(!1),children:e(R("pages.settings.actions.restore.confirmation.description"))})]})]})]})})},qP=en.default(wB)`
|
|
2349
2349
|
[role='status'] {
|
|
2350
2350
|
flex-direction: column;
|
|
2351
2351
|
}
|
|
2352
|
-
`,UP=({setIsReloading:t})=>{const{formatMessage:e}=ue.useIntl(),n=ny(),{restartStatus:r,setRestartStatus:o}=Sr(),i=async()=>{n.mutate(void 0,{onSuccess(){t(!0),ty(!0).then(a=>{a&&window.location.reload()})},onError(){o({required:!1})}})},s=()=>o({required:!1});return r.required?u.jsx(Z,{...Ts,width:"100%",children:u.jsx(qP,{closeLabel:e(R("pages.settings.actions.restart.alert.cancel")),title:e(R("pages.settings.actions.restart.alert.title")),action:u.jsx(Z,{children:u.jsx(ze,{onClick:i,startIcon:u.jsx(NS,{}),children:e(R("pages.settings.actions.restart.label"))})}),onClose:s,children:u.jsxs(u.Fragment,{children:[u.jsx(Z,{paddingBottom:1,children:e(R("pages.settings.actions.restart.alert.description"))}),r.reasons?.map((a,l)=>u.jsx(Z,{paddingBottom:1,children:e(R(`pages.settings.actions.restart.alert.reason.${a}`))},l))]})})}):null},KP=()=>{const t=l0(),{formatMessage:e}=ue.useIntl(),{values:n,onChange:r,handleChange:o,restartStatus:i}=Sr();return u.jsx(Z,{...Ts,width:"100%",children:u.jsxs(q,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(K,{variant:"delta",as:"h2",children:e(R("pages.settings.additional.title"))}),u.jsxs(ee.Root,{gap:4,width:"100%",children:[u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Z,{width:"100%",children:u.jsx(Ce.Field,{name:"allowedLevels",label:e(R("pages.settings.form.allowedLevels.label")),hint:e(R("pages.settings.form.allowedLevels.hint")),children:u.jsx(l_,{width:"100%",name:"allowedLevels",type:"number",placeholder:e(R("pages.settings.form.allowedLevels.placeholder")),onChange:(s,a)=>{if(oe.isObject(s)){const l=parseInt(s.target.value);return o(s.target.name,isNaN(l)?0:l,r)}return o(s,a,r)},value:n.allowedLevels,disabled:i.required})})})}),u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"cascadeMenuAttached",label:e(R("pages.settings.form.cascadeMenuAttached.label")),hint:e(R("pages.settings.form.cascadeMenuAttached.hint")),children:u.jsx(wn,{width:"100%",name:"cascadeMenuAttached",checked:n.cascadeMenuAttached,onChange:s=>o(s,!n.cascadeMenuAttached,r),onLabel:e(R("components.toggle.enabled")),offLabel:e(R("components.toggle.disabled")),disabled:i.required})})}),u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"audienceFieldChecked",label:e(R("pages.settings.form.audience.label")),hint:e(R("pages.settings.form.audience.hint")),children:u.jsx(wn,{name:"audienceFieldChecked",checked:n.audienceFieldChecked,onChange:s=>o(s,!n.audienceFieldChecked,r),onLabel:e(R("components.toggle.enabled")),offLabel:e(R("components.toggle.disabled")),disabled:i.required,width:"100%"})})}),t.data?.isCachePluginEnabled&&u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:"isCacheEnabled",label:e(R("pages.settings.form.cache.label")),hint:e(R("pages.settings.form.cache.hint")),children:u.jsx(wn,{name:"isCacheEnabled",checked:n.isCacheEnabled,onChange:s=>o(s,!n.isCacheEnabled,r),onLabel:e(R("components.toggle.enabled")),offLabel:e(R("components.toggle.disabled")),disabled:i.required,width:"100%"})})})]})]})})},GP=()=>{const{formatMessage:t}=ue.useIntl(),{values:e,onChange:n,handleChange:r,restartStatus:o}=Sr();return u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"preferCustomContentTypes",label:t(R("pages.settings.form.preferCustomContentTypes.label")),hint:t(R("pages.settings.form.preferCustomContentTypes.hint")),children:u.jsx(wn,{name:"preferCustomContentTypes",checked:e.preferCustomContentTypes,onChange:i=>r(i,!e.preferCustomContentTypes,n),onLabel:t(R("components.toggle.enabled")),offLabel:t(R("components.toggle.disabled")),disabled:o.required,width:"100%"})})})},YP=()=>{const t=l0(),e=pc(),{formatMessage:n}=ue.useIntl(),{values:r,onChange:o,handleChange:i,restartStatus:s,setFormValueItem:a,renderError:l}=Sr(),{contentTypes:c,preferCustomContentTypes:d}=r,h=oe.sortBy(Object.values(e.data??[]).filter(({uid:f})=>FP(f,{allowedContentTypes:t.data?.allowedContentTypes,restrictedContentTypes:t.data?.restrictedContentTypes,preferCustomContentTypes:d,contentTypes:c})).map(f=>{const m=e.data?.find(b=>b.uid===f.uid);if(m){const{isDisplayed:b,kind:p}=m;return{...f,available:b,isSingle:p==="singleType"}}return f}),f=>f.info.displayName);return u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"contentTypes",label:n(R("pages.settings.form.contentTypes.label")),hint:n(R("pages.settings.form.contentTypes.hint")),children:u.jsx(Eo,{name:"contentTypes",label:n(R("pages.settings.form.contentTypes.label")),"aria-label":n(R("pages.settings.form.contentTypes.label")),placeholder:n(R("pages.settings.form.contentTypes.placeholder")),value:r.contentTypes,onChange:f=>{i("contentTypes",f,o);const{contentTypesNameFields:m=[],contentTypesPopulate:b=[],pathDefaultFields:p=[]}=r,v=f.filter(y=>!m.find($=>$.key===y))??[],x=m.filter(y=>!f.includes(y.key)||y.key==="default").map(({key:y})=>y)??[];a("contentTypesNameFields",[...m.filter(({key:y})=>!x.includes(y)||y==="default")??[],...v.map(y=>({key:y,fields:[]}))]),a("contentTypesPopulate",[...b.filter(({key:y})=>!x.includes(y)||y==="default")??[],...v.map(y=>({key:y,fields:[]}))]),a("pathDefaultFields",[...p.filter(({key:y})=>!x.includes(y)||y==="default")??[],...v.map(y=>({key:y,fields:[]}))])},disabled:s.required,error:l("contentTypes"),withTags:!0,width:"100%",children:h.map(f=>u.jsx(Nr,{value:f.uid,children:f.info.displayName},f.uid))})})})},XP=()=>{const t=pc(),{formatMessage:e}=ue.useIntl(),{values:n,onChange:r,handleChange:o,restartStatus:i,renderError:s}=Sr(),a=g.useMemo(()=>n.contentTypes?.map(l=>t.data?.find(({uid:c})=>c===l)).filter(l=>l!==void 0)||[],[n.contentTypes,t.data]);return g.useEffect(()=>{n.defaultContentType&&(n.contentTypes.includes(n.defaultContentType)||o("defaultContentType",void 0,r))},[n.contentTypes]),u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"defaultContentType",label:e(R("pages.settings.form.defaultContentType.label")),hint:e(R("pages.settings.form.defaultContentType.hint")),children:u.jsx(Sn,{name:"defaultContentType",label:e(R("pages.settings.form.defaultContentType.label")),"aria-label":e(R("pages.settings.form.defaultContentType.label")),placeholder:e(R("pages.settings.form.defaultContentType.placeholder")),value:n.defaultContentType,onChange:l=>o("defaultContentType",l,r),onClear:()=>o("defaultContentType",void 0,r),disabled:i.required,error:s("defaultContentType"),withTags:!0,width:"100%",children:a.map(l=>u.jsx(An,{value:l.uid,children:l.info.displayName},l.uid))})})})},QP=["relation","media","component","dynamiczone"],ZP=()=>{const t=pc(),{formatMessage:e}=ue.useIntl(),{values:n,onChange:r,handleChange:o,restartStatus:i,renderError:s}=Sr(),{contentTypes:a,contentTypesNameFields:l}=n;return u.jsx(ee.Item,{col:12,s:12,xs:12,children:a?.length?u.jsx(bi.Root,{style:{width:"100%"},children:l.map((c,d)=>{const h=t.data?.find(({uid:p})=>p===c.key),f=h?.attributes??{},m=Object.keys(f).sort(),b=m.filter(p=>QP.includes(f[p]?.type));return h?u.jsxs(bi.Item,{value:c.key,children:[u.jsx(bi.Header,{children:u.jsx(bi.Trigger,{children:h?.info.displayName??e(R("pages.settings.form.nameField.default"))})}),u.jsx(bi.Content,{children:u.jsxs(ee.Root,{gap:4,padding:2,children:[u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:`contentTypesNameFields[${d}]`,label:e(R("pages.settings.form.nameField.label")),hint:e(R(`pages.settings.form.nameField.${oe.isEmpty(oe.get(n,`contentTypesNameFields[${d}].fields`,[]))?"empty":"hint"}`)),children:u.jsx(Eo,{name:`contentTypesNameFields[${d}]`,placeholder:e(R("pages.settings.form.nameField.placeholder")),value:oe.get(n,`contentTypesNameFields[${d}].fields`),onChange:p=>{const v=oe.get(n,"contentTypesNameFields",[]).map((x,y)=>y===d?{...x,fields:p}:x);return o("contentTypesNameFields",v,r)},disabled:i.required,error:s(`contentTypesNameFields[${d}]`),withTags:!0,children:m.map(p=>u.jsx(Nr,{value:p,children:p},p))})})}),u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:`contentTypesPopulate[${d-1}]`,label:e(R("pages.settings.form.populate.label")),hint:e(R(`pages.settings.form.populate.${oe.isEmpty(oe.get(n,`contentTypesPopulate[${d-1}]fields`,[]))?"empty":"hint"}`)),children:u.jsx(Eo,{width:"100%",name:`contentTypesPopulate[${d-1}]`,placeholder:e(R("pages.settings.form.populate.placeholder")),value:oe.get(n,`contentTypesPopulate[${d-1}].fields`,[]),onChange:p=>{const v=oe.get(n,"contentTypesPopulate",[]).map((x,y)=>y===d-1?{...x,fields:p}:x);return o("contentTypesPopulate",v,r)},disabled:i.required,error:s(`contentTypesPopulate[${d-1}]`),withTags:!0,children:b.map(p=>u.jsx(Nr,{value:p,children:p},p))})})}),u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:`pathDefaultFields[${d-1}]`,label:e(R("pages.settings.form.pathDefaultFields.label")),hint:e(R(`pages.settings.form.pathDefaultFields.${oe.isEmpty(oe.get(n,`pathDefaultFields[${d-1}].fields`,[]))?"empty":"hint"}`)),children:u.jsx(Eo,{name:`pathDefaultFields[${d-1}]`,width:"100%",placeholder:e(R("pages.settings.form.pathDefaultFields.placeholder")),value:oe.get(n,`pathDefaultFields[${d-1}].fields`,[]),onChange:p=>{const v=oe.get(n,"pathDefaultFields",[]).map((x,y)=>y===d-1?{...x,fields:p}:x);return o("pathDefaultFields",v,r)},disabled:i.required,error:s(`pathDefaultFields[${d-1}]`),withTags:!0,children:m.map(p=>u.jsx(Nr,{value:p,children:p},p))})})})]})})]},c.key):null})}):null})},JP=()=>{const{formatMessage:t}=ue.useIntl();return u.jsx(Z,{...Ts,width:"100%",children:u.jsxs(q,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(K,{variant:"delta",as:"h2",children:t(R("pages.settings.general.title"))}),u.jsx(ee.Root,{gap:4,width:"100%",children:u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsxs(ee.Root,{gap:4,width:"100%",children:[u.jsx(GP,{}),u.jsx(YP,{}),u.jsx(XP,{}),u.jsx(ZP,{})]})})})]})})},$g=u.jsx(PS,{}),eW=u.jsx(tf,{}),It="pages.settings.form.customFields.table.",tW=({data:t=[],onOpenModal:e,onRemoveCustomField:n,onToggleCustomField:r})=>{const[o,i]=g.useState(!1),[s,a]=g.useState(null),{toggleNotification:l}=de.useNotification(),c=g.useMemo(()=>oe.sortBy(t,"name"),[t]),{formatMessage:d}=ue.useIntl(),h=g.useCallback(b=>{a(b),i(!0)},[a,i]),f=g.useCallback(()=>{a(null),i(!1)},[a,i]),m=g.useCallback(()=>{s===null?l({type:"warning",message:d(R(`${It}confirmation.error`))}):n(s),f()},[f,s,Zu,n,l]);return u.jsxs(u.Fragment,{children:[u.jsx(mc,{isVisible:o,header:d(R(`${It}confirmation.header`)),children:d(R(`${It}confirmation.message`)),labelConfirm:d(R(`${It}confirmation.confirm`)),iconConfirm:$g,mainIcon:$g,onConfirm:m,onCancel:f}),u.jsxs(Bw,{width:"100%",colCount:4,rowCount:t.length+1,footer:u.jsx(J_,{onClick:b=>{b.preventDefault(),e(null)},icon:eW,children:d(R(`${It}footer`))}),children:[u.jsx(Vw,{children:u.jsxs(wl,{children:[u.jsx(Pt,{width:"20%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.name`))})}),u.jsx(Pt,{width:"60%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.label`))})}),u.jsx(Pt,{width:"15%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.type`))})}),u.jsx(Pt,{width:"5%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.required`))})}),u.jsx(Pt,{children:u.jsx(Cr,{})})]})}),u.jsx(Fw,{children:c.map(b=>typeof b!="string"?u.jsxs(wl,{children:[u.jsx(Wt,{width:"20%",children:u.jsx(K,{fontWeight:"semiBold",textColor:"neutral800",children:b.name})}),u.jsx(Wt,{width:"60%",children:u.jsx(K,{textColor:"neutral800",children:b.label})}),u.jsx(Wt,{width:"15%",children:u.jsx(K,{textColor:"neutral800",children:b.type})}),u.jsx(Wt,{width:"5%",children:u.jsx(Qf,{description:d(R(`${It}${b.required?"required":"notRequired"}`)),children:u.jsx(K,{textColor:"neutral800",children:b.required?u.jsx(fs,{}):u.jsx(b2,{})})})}),u.jsx(Wt,{children:u.jsx(q,{width:"100%",justifyContent:"flex-end",alignItems:"center",children:u.jsxs(nw,{children:[u.jsx(ut,{onClick:()=>r(b),label:d(R(`${It}${b.enabled?"disable":"enable"}`)),variant:b.enabled?"success-light":"tertiary",children:b.enabled?u.jsx(m2,{}):u.jsx(r7,{}),style:{minWidth:50}}),u.jsx(ut,{onClick:()=>e(b),label:d(R(`${It}edit`)),children:u.jsx(ef,{}),style:{minWidth:50}}),u.jsx(ut,{onClick:()=>h(b),label:d(R(`${It}remove`)),children:u.jsx(nf,{}),style:{minWidth:50}})]})})})]},b.name):null)})]})]})},nW=({onChange:t,initialValue:e,...n})=>{const[r,o]=g.useState(oe.isArray(e)?e.reduce((s,a)=>`${s}${a}; `,""):""),i=s=>{const a=s?.target.value??"",l=a.split(";").map(c=>c.trim()).filter(c=>!!c.length);o(a??""),t(l)};return u.jsx(pn,{...n,onChange:i,value:r})},Ve="pages.settings.form.customFields.popup.",rW=t=>t.map((e,n)=>({key:`${e}-${n}`,metadatas:{intlLabel:{id:e,defaultMessage:e},hidden:!1,disabled:!1},value:e,label:e})),oW=({isEditForm:t,customField:e,onSubmit:n,onClose:r})=>{const o=rW(PP),{formatMessage:i}=ue.useIntl(),[s,a]=g.useState({name:"",label:"",type:"string",required:!1,multi:!1,enabled:!0}),[l,c]=g.useState(),{type:d}=s;g.useEffect(()=>{e&&a({...e})},[e]);const h=(p,v,x)=>{if(x){let y=p,$=v;if(oe.isObject(p)){const{name:S,value:A}=p.target;y=S,$=oe.isNil($)?A:$}return oe.isString(y)&&f(y,$),x(p,$)}},f=(p,v)=>{a(oe.set({...s},p,v))},m=p=>{const v=oe.get(l,p);if(v)return i(R(`${Ve}${p}.${v}`))},b=(p,v)=>{const{success:x,data:y,error:$}=zw.safeParse(v);x?n(y):$&&c($.issues.reduce((S,A)=>({...S,[A.path.join(".")]:A.message}),{}))};return u.jsxs(u.Fragment,{children:[u.jsx(et.Body,{children:u.jsx(de.Form,{method:"POST",width:"auto",height:"auto",initialValues:s,children:({values:p,onChange:v})=>u.jsxs(ee.Root,{gap:5,children:[u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"name",label:i(R(`${Ve}name.label`)),hint:i(R(`${Ve}name.description`)),error:m("name"),required:!0,children:u.jsx(pn,{name:"name",value:p.name,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}name.placeholder`)),type:"string",disabled:t,width:"100%"})})},"name"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"label",label:i(R(`${Ve}label.label`)),hint:i(R(`${Ve}label.description`)),error:m("label"),required:!0,children:u.jsx(pn,{name:"label",value:p.label,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}label.placeholder`)),type:"string",width:"100%"})})},"label"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"description",label:i(R(`${Ve}description.label`)),hint:i(R(`${Ve}description.description`)),error:m("description"),children:u.jsx(pn,{name:"description",value:p.description,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}description.placeholder`)),type:"string",width:"100%"})})},"description"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"placeholder",label:i(R(`${Ve}placeholder.label`)),hint:i(R(`${Ve}placeholder.description`)),error:m("placeholder"),children:u.jsx(pn,{name:"placeholder",value:p.placeholder,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}placeholder.placeholder`)),type:"string",width:"100%"})})},"placeholder"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"type",label:i(R(`${Ve}type.label`)),hint:i(R(`${Ve}type.description`)),required:!0,children:u.jsx(Sn,{name:"type",value:p.type,onChange:x=>h("type",x,v),disabled:t,width:"100%",children:o.map(({key:x,label:y,value:$})=>u.jsx(An,{value:$,children:y},x))})})},"type"),d==="select"&&u.jsxs(u.Fragment,{children:[u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"multi",label:i(R(`${Ve}multi.label`)),hint:i(R(`${Ve}multi.description`)),error:m("multi"),children:u.jsx(wn,{name:"multi",checked:p.multi,onChange:x=>h(x,!p.multi,v),onLabel:"true",offLabel:"false",width:"100%"})})},"multi"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"options",label:i(R(`${Ve}options.label`)),hint:i(R(`${Ve}options.description`)),error:m("options"),children:u.jsx(nW,{name:"options",onChange:x=>h("options",x,v),initialValue:p.options})})},"options")]}),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"required",label:i(R(`${Ve}required.label`)),hint:i(R(`${Ve}required.description`)),error:m("required"),children:u.jsx(wn,{name:"required",placeholder:i(R(`${Ve}required.placeholder`)),checked:p.required,onChange:x=>h(x,!p.required,v),onLabel:"true",offLabel:"false",width:"100%"})})},"required")]})})}),u.jsxs(et.Footer,{children:[u.jsx(et.Close,{children:u.jsx(ze,{onClick:r,variant:"tertiary",children:i(R("popup.item.form.button.cancel"))})}),u.jsx(ze,{onClick:p=>b(p,s),children:i(R("popup.item.form.button.save"))})]})]})},iW=({isOpen:t,onClose:e,onSubmit:n,data:r})=>{const o=!!r,{formatMessage:i}=ue.useIntl();return u.jsx(et.Root,{onOpenChange:s=>{s||e()},open:t,labelledBy:"custom-field-modal",children:u.jsxs(et.Content,{children:[u.jsx(et.Header,{children:u.jsx(K,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:i(R(`pages.settings.form.customFields.popup.header.${o?"edit":"new"}`))})}),u.jsx(oW,{isEditForm:o,customField:r,onSubmit:n,onClose:e})]})})},sW=()=>{const{formatMessage:t}=ue.useIntl(),{values:{additionalFields:e},setFormValueItem:n}=Sr(),[r,o]=g.useState(!1),[i,s]=g.useState(null),a=h=>{s(h),o(!0)},l=h=>{const f=e.filter(m=>typeof m!="string"?m.name!==h.name:!0);n("additionalFields",f),s(null),o(!1)},c=h=>{const f={...h,enabled:!h.enabled},m=e.map(b=>typeof b!="string"&&h.name===b.name?f:b);n("additionalFields",m)},d=h=>{const m=!!e.find(b=>typeof b!="string"?b.name===h.name:!1)?e.map(b=>typeof b!="string"&&h.name===b.name?h:b):[...e,h];n("additionalFields",m),s(null),o(!1)};return u.jsxs(Z,{...Ts,width:"100%",children:[u.jsx(K,{variant:"delta",as:"h2",children:t(R("pages.settings.customFields.title"))}),u.jsx(Z,{padding:1}),u.jsx(tW,{data:e,onOpenModal:a,onRemoveCustomField:l,onToggleCustomField:c}),r&&u.jsx(iW,{onClose:()=>o(!1),onSubmit:d,isOpen:r,data:i})]})},aW=pz.omit({contentTypesNameFields:!0}).extend({audienceFieldChecked:B.z.boolean(),contentTypesNameFields:B.z.object({key:B.z.string(),fields:B.z.string().array()}).array(),contentTypesPopulate:B.z.object({key:B.z.string(),fields:B.z.string().array()}).array(),pathDefaultFields:B.z.object({key:B.z.string(),fields:B.z.string().array()}).array()}),Sg=new Re.QueryClient,lW=()=>{const t=l0(),e=pc(),n=zP(),r=ry(),o=ny(),{formatMessage:i}=ue.useIntl(),[s,a]=g.useState({required:!1}),[l,c]=g.useState(!1),d=de.useAuth("SettingsPage",k=>k.permissions),h=g.useMemo(()=>!!d.find(({action:k})=>k===Br.settings[0].action),[d]),f=g.useMemo(()=>!!d.find(({action:k})=>k===Br.access[0].action),[d]),m=t.isPending||e.isPending||n.isPending||o.isPending||r.isPending,[b,p]=g.useState({}),[v,x]=g.useState(),y=(k,T,I)=>{if(I){let E=k,j=T;if(oe.isObject(k)){const{name:L,value:D}=k.target;E=L,j=oe.isNil(j)?D:j}return oe.isString(E)&&$(E,j),I(k,j)}},$=(k,T)=>{p(I=>oe.set({...I},k,T))},S=k=>{if(oe.get(v,k))return i(R(k))},A=(k,T)=>{const{success:I,data:E,error:j}=aW.safeParse(T);I?n.mutate(E,{onSuccess(){a({required:!0}),n.reset()}}):j&&(x(j.issues.reduce((L,D)=>({...L,[D.path.join(".")]:D.message}),{})),console.warn("Invalid form data",j))};return HP({config:t.data,setFormValue:p}),h?m||l?u.jsx(de.Page.Loading,{}):u.jsx(de.Layouts.Root,{children:u.jsxs(de.Page.Main,{children:[u.jsx(de.Page.Title,{children:i(R("pages.settings.header.title"))}),u.jsx(de.Layouts.Header,{title:i(R("pages.settings.header.title")),subtitle:i(R("pages.settings.header.description")),primaryAction:f?u.jsx(ze,{startIcon:u.jsx(fs,{}),disabled:s.required,onClick:k=>A(k,b),children:i(R("pages.settings.actions.submit"))}):null}),u.jsx(de.Layouts.Content,{children:u.jsx(de.Form,{method:"POST",width:"auto",height:"auto",initialValues:b,children:({values:k,onChange:T})=>u.jsx(oy.Provider,{value:{values:k,onChange:T,handleChange:y,restartStatus:s,setRestartStatus:a,renderError:S,setFormValueItem:$},children:u.jsxs(q,{direction:"column",gap:4,children:[u.jsx(UP,{setIsReloading:c}),u.jsx(JP,{}),u.jsx(KP,{}),u.jsx(sW,{}),u.jsx(WP,{hasSettingsReadPermissions:f})]})})})})]})}):u.jsx(de.Page.NoPermissions,{})};function cW(){Sg.invalidateQueries();const t=Ce.usePluginTheme();return u.jsx(Re.QueryClientProvider,{client:Sg,children:u.jsx(gw,{theme:t,children:u.jsx(lW,{})})})}const dW="navigation",Ag="Navigation",uW={register(t){t.createSettingSection({id:Ht,intlLabel:{id:`${Ht}.plugin.section.name`,defaultMessage:`${Ag} plugin`}},[{intlLabel:{id:`${Ht}.plugin.section.item`,defaultMessage:"Configuration"},id:"navigation",to:Ht,Component(){return cW},permissions:Br.settings}]),t.addMenuLink({to:`plugins/${Ht}`,icon:my,intlLabel:{id:`${Ht}.plugin.name`,defaultMessage:Ag},Component(){return NP},permissions:Br.access,position:1}),t.registerPlugin({id:Ht,initializer:dy,isReady:!1,name:dW})},registerTrads:async function({locales:t=[]}){return Promise.all(t.map(async e=>e in hg?hg[e]().then(({default:r})=>({data:Ce.prefixPluginTranslations(Ce.flattenObject(r),Ht),locale:e})):{data:Ce.prefixPluginTranslations(Ce.flattenObject({}),Ht),locale:e}))}};module.exports=uW;
|
|
2352
|
+
`,UP=({setIsReloading:t})=>{const{formatMessage:e}=ue.useIntl(),n=ny(),{restartStatus:r,setRestartStatus:o}=Sr(),i=async()=>{n.mutate(void 0,{onSuccess(){t(!0),ty(!0).then(a=>{a&&window.location.reload()})},onError(){o({required:!1})}})},s=()=>o({required:!1});return r.required?u.jsx(Z,{...Ts,width:"100%",children:u.jsx(qP,{closeLabel:e(R("pages.settings.actions.restart.alert.cancel")),title:e(R("pages.settings.actions.restart.alert.title")),action:u.jsx(Z,{children:u.jsx(ze,{onClick:i,startIcon:u.jsx(NS,{}),children:e(R("pages.settings.actions.restart.label"))})}),onClose:s,children:u.jsxs(u.Fragment,{children:[u.jsx(Z,{paddingBottom:1,children:e(R("pages.settings.actions.restart.alert.description"))}),r.reasons?.map((a,l)=>u.jsx(Z,{paddingBottom:1,children:e(R(`pages.settings.actions.restart.alert.reason.${a}`))},l))]})})}):null},KP=()=>{const t=l0(),{formatMessage:e}=ue.useIntl(),{values:n,onChange:r,handleChange:o,restartStatus:i}=Sr();return u.jsx(Z,{...Ts,width:"100%",children:u.jsxs(q,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(K,{variant:"delta",as:"h2",children:e(R("pages.settings.additional.title"))}),u.jsxs(ee.Root,{gap:4,width:"100%",children:[u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Z,{width:"100%",children:u.jsx(Ce.Field,{name:"allowedLevels",label:e(R("pages.settings.form.allowedLevels.label")),hint:e(R("pages.settings.form.allowedLevels.hint")),children:u.jsx(l_,{width:"100%",name:"allowedLevels",type:"number",placeholder:e(R("pages.settings.form.allowedLevels.placeholder")),onChange:(s,a)=>{if(oe.isObject(s)){const l=parseInt(s.target.value);return o(s.target.name,isNaN(l)?0:l,r)}return o(s,a,r)},value:n.allowedLevels,disabled:i.required})})})}),u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"cascadeMenuAttached",label:e(R("pages.settings.form.cascadeMenuAttached.label")),hint:e(R("pages.settings.form.cascadeMenuAttached.hint")),children:u.jsx(wn,{width:"100%",name:"cascadeMenuAttached",checked:n.cascadeMenuAttached,onChange:s=>o(s,!n.cascadeMenuAttached,r),onLabel:e(R("components.toggle.enabled")),offLabel:e(R("components.toggle.disabled")),disabled:i.required})})}),u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"audienceFieldChecked",label:e(R("pages.settings.form.audience.label")),hint:e(R("pages.settings.form.audience.hint")),children:u.jsx(wn,{name:"audienceFieldChecked",checked:n.audienceFieldChecked,onChange:s=>o(s,!n.audienceFieldChecked,r),onLabel:e(R("components.toggle.enabled")),offLabel:e(R("components.toggle.disabled")),disabled:i.required,width:"100%"})})}),t.data?.isCachePluginEnabled&&u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:"isCacheEnabled",label:e(R("pages.settings.form.cache.label")),hint:e(R("pages.settings.form.cache.hint")),children:u.jsx(wn,{name:"isCacheEnabled",checked:n.isCacheEnabled,onChange:s=>o(s,!n.isCacheEnabled,r),onLabel:e(R("components.toggle.enabled")),offLabel:e(R("components.toggle.disabled")),disabled:i.required,width:"100%"})})})]})]})})},GP=()=>{const{formatMessage:t}=ue.useIntl(),{values:e,onChange:n,handleChange:r,restartStatus:o}=Sr();return u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"preferCustomContentTypes",label:t(R("pages.settings.form.preferCustomContentTypes.label")),hint:t(R("pages.settings.form.preferCustomContentTypes.hint")),children:u.jsx(wn,{name:"preferCustomContentTypes",checked:e.preferCustomContentTypes,onChange:i=>r(i,!e.preferCustomContentTypes,n),onLabel:t(R("components.toggle.enabled")),offLabel:t(R("components.toggle.disabled")),disabled:o.required,width:"100%"})})})},YP=()=>{const t=l0(),e=pc(),{formatMessage:n}=ue.useIntl(),{values:r,onChange:o,handleChange:i,restartStatus:s,setFormValueItem:a,renderError:l}=Sr(),{contentTypes:c,preferCustomContentTypes:d}=r,h=oe.sortBy(Object.values(e.data??[]).filter(({uid:f})=>FP(f,{allowedContentTypes:t.data?.allowedContentTypes,restrictedContentTypes:t.data?.restrictedContentTypes,preferCustomContentTypes:d,contentTypes:c})).map(f=>{const m=e.data?.find(p=>p.uid===f.uid);if(m){const{isDisplayed:p,kind:b}=m;return{...f,available:p,isSingle:b==="singleType"}}return f}),f=>f.info.displayName);return u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"contentTypes",label:n(R("pages.settings.form.contentTypes.label")),hint:n(R("pages.settings.form.contentTypes.hint")),children:u.jsx(Eo,{name:"contentTypes",label:n(R("pages.settings.form.contentTypes.label")),"aria-label":n(R("pages.settings.form.contentTypes.label")),placeholder:n(R("pages.settings.form.contentTypes.placeholder")),value:r.contentTypes,onChange:f=>{i("contentTypes",f,o);const{contentTypesNameFields:m=[],contentTypesPopulate:p=[],pathDefaultFields:b=[]}=r,v=f.filter(y=>!m.find($=>$.key===y))??[],x=m.filter(y=>!f.includes(y.key)||y.key==="default").map(({key:y})=>y)??[];a("contentTypesNameFields",[...m.filter(({key:y})=>!x.includes(y)||y==="default")??[],...v.map(y=>({key:y,fields:[]}))]),a("contentTypesPopulate",[...p.filter(({key:y})=>!x.includes(y)||y==="default")??[],...v.map(y=>({key:y,fields:[]}))]),a("pathDefaultFields",[...b.filter(({key:y})=>!x.includes(y)||y==="default")??[],...v.map(y=>({key:y,fields:[]}))])},disabled:s.required,error:l("contentTypes"),withTags:!0,width:"100%",children:h.map(f=>u.jsx(Nr,{value:f.uid,children:f.info.displayName},f.uid))})})})},XP=()=>{const t=pc(),{formatMessage:e}=ue.useIntl(),{values:n,onChange:r,handleChange:o,restartStatus:i,renderError:s}=Sr(),a=g.useMemo(()=>n.contentTypes?.map(l=>t.data?.find(({uid:c})=>c===l)).filter(l=>l!==void 0)||[],[n.contentTypes,t.data]);return g.useEffect(()=>{n.defaultContentType&&(n.contentTypes.includes(n.defaultContentType)||o("defaultContentType",void 0,r))},[n.contentTypes]),u.jsx(ee.Item,{col:4,s:12,xs:12,children:u.jsx(Ce.Field,{name:"defaultContentType",label:e(R("pages.settings.form.defaultContentType.label")),hint:e(R("pages.settings.form.defaultContentType.hint")),children:u.jsx(Sn,{name:"defaultContentType",label:e(R("pages.settings.form.defaultContentType.label")),"aria-label":e(R("pages.settings.form.defaultContentType.label")),placeholder:e(R("pages.settings.form.defaultContentType.placeholder")),value:n.defaultContentType,onChange:l=>o("defaultContentType",l,r),onClear:()=>o("defaultContentType",void 0,r),disabled:i.required,error:s("defaultContentType"),withTags:!0,width:"100%",children:a.map(l=>u.jsx(An,{value:l.uid,children:l.info.displayName},l.uid))})})})},QP=["relation","media","component","dynamiczone"],ZP=()=>{const t=pc(),{formatMessage:e}=ue.useIntl(),{values:n,onChange:r,handleChange:o,restartStatus:i,renderError:s}=Sr(),{contentTypes:a,contentTypesNameFields:l}=n;return u.jsx(ee.Item,{col:12,s:12,xs:12,children:a?.length?u.jsx(bi.Root,{style:{width:"100%"},children:l.map((c,d)=>{const h=t.data?.find(({uid:b})=>b===c.key),f=h?.attributes??{},m=Object.keys(f).sort(),p=m.filter(b=>QP.includes(f[b]?.type));return h?u.jsxs(bi.Item,{value:c.key,children:[u.jsx(bi.Header,{children:u.jsx(bi.Trigger,{children:h?.info.displayName??e(R("pages.settings.form.nameField.default"))})}),u.jsx(bi.Content,{children:u.jsxs(ee.Root,{gap:4,padding:2,children:[u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:`contentTypesNameFields[${d}]`,label:e(R("pages.settings.form.nameField.label")),hint:e(R(`pages.settings.form.nameField.${oe.isEmpty(oe.get(n,`contentTypesNameFields[${d}].fields`,[]))?"empty":"hint"}`)),children:u.jsx(Eo,{name:`contentTypesNameFields[${d}]`,placeholder:e(R("pages.settings.form.nameField.placeholder")),value:oe.get(n,`contentTypesNameFields[${d}].fields`),onChange:b=>{const v=oe.get(n,"contentTypesNameFields",[]).map((x,y)=>y===d?{...x,fields:b}:x);return o("contentTypesNameFields",v,r)},disabled:i.required,error:s(`contentTypesNameFields[${d}]`),withTags:!0,children:m.map(b=>u.jsx(Nr,{value:b,children:b},b))})})}),u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:`contentTypesPopulate[${d-1}]`,label:e(R("pages.settings.form.populate.label")),hint:e(R(`pages.settings.form.populate.${oe.isEmpty(oe.get(n,`contentTypesPopulate[${d-1}]fields`,[]))?"empty":"hint"}`)),children:u.jsx(Eo,{width:"100%",name:`contentTypesPopulate[${d-1}]`,placeholder:e(R("pages.settings.form.populate.placeholder")),value:oe.get(n,`contentTypesPopulate[${d-1}].fields`,[]),onChange:b=>{const v=oe.get(n,"contentTypesPopulate",[]).map((x,y)=>y===d-1?{...x,fields:b}:x);return o("contentTypesPopulate",v,r)},disabled:i.required,error:s(`contentTypesPopulate[${d-1}]`),withTags:!0,children:p.map(b=>u.jsx(Nr,{value:b,children:b},b))})})}),u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsx(Ce.Field,{name:`pathDefaultFields[${d-1}]`,label:e(R("pages.settings.form.pathDefaultFields.label")),hint:e(R(`pages.settings.form.pathDefaultFields.${oe.isEmpty(oe.get(n,`pathDefaultFields[${d-1}].fields`,[]))?"empty":"hint"}`)),children:u.jsx(Eo,{name:`pathDefaultFields[${d-1}]`,width:"100%",placeholder:e(R("pages.settings.form.pathDefaultFields.placeholder")),value:oe.get(n,`pathDefaultFields[${d-1}].fields`,[]),onChange:b=>{const v=oe.get(n,"pathDefaultFields",[]).map((x,y)=>y===d-1?{...x,fields:b}:x);return o("pathDefaultFields",v,r)},disabled:i.required,error:s(`pathDefaultFields[${d-1}]`),withTags:!0,children:m.map(b=>u.jsx(Nr,{value:b,children:b},b))})})})]})})]},c.key):null})}):null})},JP=()=>{const{formatMessage:t}=ue.useIntl();return u.jsx(Z,{...Ts,width:"100%",children:u.jsxs(q,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(K,{variant:"delta",as:"h2",children:t(R("pages.settings.general.title"))}),u.jsx(ee.Root,{gap:4,width:"100%",children:u.jsx(ee.Item,{col:12,s:12,xs:12,children:u.jsxs(ee.Root,{gap:4,width:"100%",children:[u.jsx(GP,{}),u.jsx(YP,{}),u.jsx(XP,{}),u.jsx(ZP,{})]})})})]})})},$g=u.jsx(PS,{}),eW=u.jsx(tf,{}),It="pages.settings.form.customFields.table.",tW=({data:t=[],onOpenModal:e,onRemoveCustomField:n,onToggleCustomField:r})=>{const[o,i]=g.useState(!1),[s,a]=g.useState(null),{toggleNotification:l}=de.useNotification(),c=g.useMemo(()=>oe.sortBy(t,"name"),[t]),{formatMessage:d}=ue.useIntl(),h=g.useCallback(p=>{a(p),i(!0)},[a,i]),f=g.useCallback(()=>{a(null),i(!1)},[a,i]),m=g.useCallback(()=>{s===null?l({type:"warning",message:d(R(`${It}confirmation.error`))}):n(s),f()},[f,s,Zu,n,l]);return u.jsxs(u.Fragment,{children:[u.jsx(mc,{isVisible:o,header:d(R(`${It}confirmation.header`)),children:d(R(`${It}confirmation.message`)),labelConfirm:d(R(`${It}confirmation.confirm`)),iconConfirm:$g,mainIcon:$g,onConfirm:m,onCancel:f}),u.jsxs(Bw,{width:"100%",colCount:4,rowCount:t.length+1,footer:u.jsx(J_,{onClick:p=>{p.preventDefault(),e(null)},icon:eW,children:d(R(`${It}footer`))}),children:[u.jsx(Vw,{children:u.jsxs(wl,{children:[u.jsx(Pt,{width:"20%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.name`))})}),u.jsx(Pt,{width:"60%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.label`))})}),u.jsx(Pt,{width:"15%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.type`))})}),u.jsx(Pt,{width:"5%",children:u.jsx(K,{variant:"sigma",textColor:"neutral600",children:d(R(`${It}header.required`))})}),u.jsx(Pt,{children:u.jsx(Cr,{})})]})}),u.jsx(Fw,{children:c.map(p=>typeof p!="string"?u.jsxs(wl,{children:[u.jsx(Wt,{width:"20%",children:u.jsx(K,{fontWeight:"semiBold",textColor:"neutral800",children:p.name})}),u.jsx(Wt,{width:"60%",children:u.jsx(K,{textColor:"neutral800",children:p.label})}),u.jsx(Wt,{width:"15%",children:u.jsx(K,{textColor:"neutral800",children:p.type})}),u.jsx(Wt,{width:"5%",children:u.jsx(Qf,{description:d(R(`${It}${p.required?"required":"notRequired"}`)),children:u.jsx(K,{textColor:"neutral800",children:p.required?u.jsx(fs,{}):u.jsx(b2,{})})})}),u.jsx(Wt,{children:u.jsx(q,{width:"100%",justifyContent:"flex-end",alignItems:"center",children:u.jsxs(nw,{children:[u.jsx(ut,{onClick:()=>r(p),label:d(R(`${It}${p.enabled?"disable":"enable"}`)),variant:p.enabled?"success-light":"tertiary",children:p.enabled?u.jsx(m2,{}):u.jsx(r7,{}),style:{minWidth:50}}),u.jsx(ut,{onClick:()=>e(p),label:d(R(`${It}edit`)),children:u.jsx(ef,{}),style:{minWidth:50}}),u.jsx(ut,{onClick:()=>h(p),label:d(R(`${It}remove`)),children:u.jsx(nf,{}),style:{minWidth:50}})]})})})]},p.name):null)})]})]})},nW=({onChange:t,initialValue:e,...n})=>{const[r,o]=g.useState(oe.isArray(e)?e.reduce((s,a)=>`${s}${a}; `,""):""),i=s=>{const a=s?.target.value??"",l=a.split(";").map(c=>c.trim()).filter(c=>!!c.length);o(a??""),t(l)};return u.jsx(pn,{...n,onChange:i,value:r})},Ve="pages.settings.form.customFields.popup.",rW=t=>t.map((e,n)=>({key:`${e}-${n}`,metadatas:{intlLabel:{id:e,defaultMessage:e},hidden:!1,disabled:!1},value:e,label:e})),oW=({isEditForm:t,customField:e,onSubmit:n,onClose:r})=>{const o=rW(PP),{formatMessage:i}=ue.useIntl(),[s,a]=g.useState({name:"",label:"",type:"string",required:!1,multi:!1,enabled:!0}),[l,c]=g.useState(),{type:d}=s;g.useEffect(()=>{e&&a({...e})},[e]);const h=(b,v,x)=>{if(x){let y=b,$=v;if(oe.isObject(b)){const{name:S,value:A}=b.target;y=S,$=oe.isNil($)?A:$}return oe.isString(y)&&f(y,$),x(b,$)}},f=(b,v)=>{a(oe.set({...s},b,v))},m=b=>{const v=oe.get(l,b);if(v)return i(R(`${Ve}${b}.${v}`))},p=(b,v)=>{const{success:x,data:y,error:$}=zw.safeParse(v);x?n(y):$&&c($.issues.reduce((S,A)=>({...S,[A.path.join(".")]:A.message}),{}))};return u.jsxs(u.Fragment,{children:[u.jsx(et.Body,{children:u.jsx(de.Form,{method:"POST",width:"auto",height:"auto",initialValues:s,children:({values:b,onChange:v})=>u.jsxs(ee.Root,{gap:5,children:[u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"name",label:i(R(`${Ve}name.label`)),hint:i(R(`${Ve}name.description`)),error:m("name"),required:!0,children:u.jsx(pn,{name:"name",value:b.name,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}name.placeholder`)),type:"string",disabled:t,width:"100%"})})},"name"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"label",label:i(R(`${Ve}label.label`)),hint:i(R(`${Ve}label.description`)),error:m("label"),required:!0,children:u.jsx(pn,{name:"label",value:b.label,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}label.placeholder`)),type:"string",width:"100%"})})},"label"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"description",label:i(R(`${Ve}description.label`)),hint:i(R(`${Ve}description.description`)),error:m("description"),children:u.jsx(pn,{name:"description",value:b.description,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}description.placeholder`)),type:"string",width:"100%"})})},"description"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"placeholder",label:i(R(`${Ve}placeholder.label`)),hint:i(R(`${Ve}placeholder.description`)),error:m("placeholder"),children:u.jsx(pn,{name:"placeholder",value:b.placeholder,onChange:(x,y)=>h(x,y,v),placeholder:i(R(`${Ve}placeholder.placeholder`)),type:"string",width:"100%"})})},"placeholder"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"type",label:i(R(`${Ve}type.label`)),hint:i(R(`${Ve}type.description`)),required:!0,children:u.jsx(Sn,{name:"type",value:b.type,onChange:x=>h("type",x,v),disabled:t,width:"100%",children:o.map(({key:x,label:y,value:$})=>u.jsx(An,{value:$,children:y},x))})})},"type"),d==="select"&&u.jsxs(u.Fragment,{children:[u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"multi",label:i(R(`${Ve}multi.label`)),hint:i(R(`${Ve}multi.description`)),error:m("multi"),children:u.jsx(wn,{name:"multi",checked:b.multi,onChange:x=>h(x,!b.multi,v),onLabel:"true",offLabel:"false",width:"100%"})})},"multi"),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"options",label:i(R(`${Ve}options.label`)),hint:i(R(`${Ve}options.description`)),error:m("options"),children:u.jsx(nW,{name:"options",onChange:x=>h("options",x,v),initialValue:b.options})})},"options")]}),u.jsx(ee.Item,{col:12,children:u.jsx(Ce.Field,{name:"required",label:i(R(`${Ve}required.label`)),hint:i(R(`${Ve}required.description`)),error:m("required"),children:u.jsx(wn,{name:"required",placeholder:i(R(`${Ve}required.placeholder`)),checked:b.required,onChange:x=>h(x,!b.required,v),onLabel:"true",offLabel:"false",width:"100%"})})},"required")]})})}),u.jsxs(et.Footer,{children:[u.jsx(et.Close,{children:u.jsx(ze,{onClick:r,variant:"tertiary",children:i(R("popup.item.form.button.cancel"))})}),u.jsx(ze,{onClick:b=>p(b,s),children:i(R("popup.item.form.button.save"))})]})]})},iW=({isOpen:t,onClose:e,onSubmit:n,data:r})=>{const o=!!r,{formatMessage:i}=ue.useIntl();return u.jsx(et.Root,{onOpenChange:s=>{s||e()},open:t,labelledBy:"custom-field-modal",children:u.jsxs(et.Content,{children:[u.jsx(et.Header,{children:u.jsx(K,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:i(R(`pages.settings.form.customFields.popup.header.${o?"edit":"new"}`))})}),u.jsx(oW,{isEditForm:o,customField:r,onSubmit:n,onClose:e})]})})},sW=()=>{const{formatMessage:t}=ue.useIntl(),{values:{additionalFields:e},setFormValueItem:n}=Sr(),[r,o]=g.useState(!1),[i,s]=g.useState(null),a=h=>{s(h),o(!0)},l=h=>{const f=e.filter(m=>typeof m!="string"?m.name!==h.name:!0);n("additionalFields",f),s(null),o(!1)},c=h=>{const f={...h,enabled:!h.enabled},m=e.map(p=>typeof p!="string"&&h.name===p.name?f:p);n("additionalFields",m)},d=h=>{const m=!!e.find(p=>typeof p!="string"?p.name===h.name:!1)?e.map(p=>typeof p!="string"&&h.name===p.name?h:p):[...e,h];n("additionalFields",m),s(null),o(!1)};return u.jsxs(Z,{...Ts,width:"100%",children:[u.jsx(K,{variant:"delta",as:"h2",children:t(R("pages.settings.customFields.title"))}),u.jsx(Z,{padding:1}),u.jsx(tW,{data:e,onOpenModal:a,onRemoveCustomField:l,onToggleCustomField:c}),r&&u.jsx(iW,{onClose:()=>o(!1),onSubmit:d,isOpen:r,data:i})]})},aW=pz.omit({contentTypesNameFields:!0}).extend({audienceFieldChecked:B.z.boolean(),contentTypesNameFields:B.z.object({key:B.z.string(),fields:B.z.string().array()}).array(),contentTypesPopulate:B.z.object({key:B.z.string(),fields:B.z.string().array()}).array(),pathDefaultFields:B.z.object({key:B.z.string(),fields:B.z.string().array()}).array()}),Sg=new Re.QueryClient,lW=()=>{const t=l0(),e=pc(),n=zP(),r=ry(),o=ny(),{formatMessage:i}=ue.useIntl(),[s,a]=g.useState({required:!1}),[l,c]=g.useState(!1),d=de.useAuth("SettingsPage",k=>k.permissions),h=g.useMemo(()=>!!d.find(({action:k})=>k===Br.settings[0].action),[d]),f=g.useMemo(()=>!!d.find(({action:k})=>k===Br.access[0].action),[d]),m=t.isPending||e.isPending||n.isPending||o.isPending||r.isPending,[p,b]=g.useState({}),[v,x]=g.useState(),y=(k,T,I)=>{if(I){let E=k,j=T;if(oe.isObject(k)){const{name:L,value:D}=k.target;E=L,j=oe.isNil(j)?D:j}return oe.isString(E)&&$(E,j),I(k,j)}},$=(k,T)=>{b(I=>oe.set({...I},k,T))},S=k=>{if(oe.get(v,k))return i(R(k))},A=(k,T)=>{const{success:I,data:E,error:j}=aW.safeParse(T);I?n.mutate(E,{onSuccess(){a({required:!0}),n.reset()}}):j&&(x(j.issues.reduce((L,D)=>({...L,[D.path.join(".")]:D.message}),{})),console.warn("Invalid form data",j))};return HP({config:t.data,setFormValue:b}),h?m||l?u.jsx(de.Page.Loading,{}):u.jsx(de.Layouts.Root,{children:u.jsxs(de.Page.Main,{children:[u.jsx(de.Page.Title,{children:i(R("pages.settings.header.title"))}),u.jsx(de.Layouts.Header,{title:i(R("pages.settings.header.title")),subtitle:i(R("pages.settings.header.description")),primaryAction:f?u.jsx(ze,{startIcon:u.jsx(fs,{}),disabled:s.required,onClick:k=>A(k,p),children:i(R("pages.settings.actions.submit"))}):null}),u.jsx(de.Layouts.Content,{children:u.jsx(de.Form,{method:"POST",width:"auto",height:"auto",initialValues:p,children:({values:k,onChange:T})=>u.jsx(oy.Provider,{value:{values:k,onChange:T,handleChange:y,restartStatus:s,setRestartStatus:a,renderError:S,setFormValueItem:$},children:u.jsxs(q,{direction:"column",gap:4,children:[u.jsx(UP,{setIsReloading:c}),u.jsx(JP,{}),u.jsx(KP,{}),u.jsx(sW,{}),u.jsx(WP,{hasSettingsReadPermissions:f})]})})})})]})}):u.jsx(de.Page.NoPermissions,{})};function cW(){Sg.invalidateQueries();const t=Ce.usePluginTheme();return u.jsx(Re.QueryClientProvider,{client:Sg,children:u.jsx(gw,{theme:t,children:u.jsx(lW,{})})})}const dW="navigation",Ag="Navigation",uW={register(t){t.createSettingSection({id:Ht,intlLabel:{id:`${Ht}.plugin.section.name`,defaultMessage:`${Ag} plugin`}},[{intlLabel:{id:`${Ht}.plugin.section.item`,defaultMessage:"Configuration"},id:"navigation",to:Ht,Component(){return cW},permissions:Br.settings}]),t.addMenuLink({to:`plugins/${Ht}`,icon:my,intlLabel:{id:`${Ht}.plugin.name`,defaultMessage:Ag},Component(){return NP},permissions:Br.access,position:1}),t.registerPlugin({id:Ht,initializer:dy,isReady:!1,name:dW})},registerTrads:async function({locales:t=[]}){return Promise.all(t.map(async e=>e in hg?hg[e]().then(({default:r})=>({data:Ce.prefixPluginTranslations(Ce.flattenObject(r),Ht),locale:e})):{data:Ce.prefixPluginTranslations(Ce.flattenObject({}),Ht),locale:e}))}};module.exports=uW;
|