@agent-dock/cli 0.3.22 → 0.3.23
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/cli.js +118 -28
- package/dist/cli.js.map +3 -3
- package/package.json +1 -1
- package/public/assets/{ImageLightbox-DSVEjfab.js → ImageLightbox-DPzNNZkM.js} +1 -1
- package/public/assets/{PromptEditor-B6CITkrn.js → PromptEditor-D_zjFOzD.js} +1 -1
- package/public/assets/{main-Vf3EflnQ.js → main-B-Q2oskz.js} +294 -274
- package/public/index.html +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as vn}from"./index-CWUiS-aC.js";import{r as n}from"./syntax-highlighter-d-DuIo_w.js";import{r as En}from"./main-Vf3EflnQ.js";const Nt="carousel",Tt="controller",xn="navigation",bn="no-scroll",qe="portal",wn="root",kt="toolbar",gt="zoom",Fe="loading",Ve="error",Ue="complete",Cn="placeholder",_n=e=>`active-slide-${e}`,Pn="fullsize",Qe="flex_center",Sn="no_scroll",Dt="no_scroll_padding",Je="slide",At="slide_wrapper",Mn="slide_wrapper_interactive",fe="prev",he="next",vt="swipe",Ee="close",Zt="onPointerDown",Wt="onPointerMove",$t="onPointerUp",zt="onPointerLeave",Ft="onPointerCancel",et="onKeyDown",Ln="onKeyUp",tt="onWheel",yn="Escape",In="ArrowLeft",On="ArrowRight",Rn="button",Be="icon",Vt="contain",Et="cover",Ut="Unknown action type",Xt="yarl__";function ie(...e){return e.filter(Boolean).join(" ")}function k(e){return`${Xt}${e}`}function q(e){return`--${Xt}${e}`}function Se(e,t){return`${e}${t?`_${t}`:""}`}function nt(e){return t=>Se(e,t)}function xe(e,t){var o;return(o=e==null?void 0:e[t])!==null&&o!==void 0?o:t}function Nn(e,t,o){return xe(e,"{index} of {total}").replace(/\{index}/g,`${st(o,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function ot(...e){return()=>{e.forEach(t=>{t()})}}function se(e,t,o){return()=>{const r=n.useContext(o);if(!r)throw new Error(`${e} must be used within a ${t}.Provider`);return r}}function rt(){return typeof window<"u"}function it(e,t=0){const o=10**t;return Math.round((e+Number.EPSILON)*o)/o}function me(e){return e.type===void 0||e.type==="image"}function ct(e,t){return e.imageFit===Et||e.imageFit!==Vt&&t===Et}function Ne(e){return typeof e=="string"?Number.parseInt(e,10):e}function Oe(e){if(typeof e=="number")return{pixel:e};if(typeof e=="string"){const t=Ne(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Tn(e,t){const o=Oe(t),r=o.percent!==void 0?e.width/100*o.percent:o.pixel;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function Yt(e){return Number.isFinite(e)?(Math.round(e/90)*90%360+360)%360:0}function kn(){return(rt()?window==null?void 0:window.devicePixelRatio:void 0)||1}function st(e,t){return t>0?(e%t+t)%t:0}function Ht(e){return e.length>0}function Bt(e,t){return e[st(t,e.length)]}function Ke(e,t){return Ht(e)?Bt(e,t):void 0}function Dn(e){return me(e)?e.src:void 0}function An(e,t,o){if(!o)return e;const{buttons:r,...i}=e,s=r.findIndex(l=>l===t),c=n.isValidElement(o)?n.cloneElement(o,{key:t},null):o;if(s>=0){const l=[...r];return l.splice(s,1,c),{buttons:l,...i}}return{buttons:[c,...r],...i}}function Zn(e,t,o=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),o))}const Wn=Number(n.version.split(".")[0])>=19;function $n(e){return{inert:Wn?e:e?"":void 0}}function zn(e){e.scrollTop}const je={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[Ee]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:Vt,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,closeOnEscape:!0,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function ae(e,t){return{name:e,component:t}}function Y(e,t){return{module:e,children:t}}function Kt(e,t,o){return e.module.name===t?o(e):e.children?[Y(e.module,e.children.flatMap(r=>{var i;return(i=Kt(r,t,o))!==null&&i!==void 0?i:[]}))]:[e]}function ve(e,t,o){return e.flatMap(r=>{var i;return(i=Kt(r,t,o))!==null&&i!==void 0?i:[]})}function Fn(e,t=[],o=[]){let r=e;const i=p=>{const g=[...r];for(;g.length>0;){const u=g.pop();if((u==null?void 0:u.module.name)===p)return!0;u!=null&&u.children&&g.push(...u.children)}return!1},s=(p,g)=>{if(p===""){r=[Y(g,r)];return}r=ve(r,p,u=>[Y(g,[u])])},c=(p,g)=>{r=ve(r,p,u=>[Y(u.module,[Y(g,u.children)])])},l=(p,g,u)=>{r=ve(r,p,_=>{var x;return[Y(_.module,[...u?[Y(g)]:[],...(x=_.children)!==null&&x!==void 0?x:[],...u?[]:[Y(g)]])]})},d=(p,g,u)=>{r=ve(r,p,_=>[...u?[Y(g)]:[],_,...u?[]:[Y(g)]])},a=p=>{c(Tt,p)},m=(p,g)=>{r=ve(r,p,u=>[Y(g,u.children)])},f=p=>{r=ve(r,p,g=>g.children)},h=p=>{o.push(p)};return t.forEach(p=>{p({contains:i,addParent:s,append:c,addChild:l,addSibling:d,addModule:a,replace:m,remove:f,augment:h})}),{config:r,augmentation:p=>o.reduce((g,u)=>u(g),p)}}const jt=n.createContext(null),Gt=se("useA11yContext","A11yContext",jt);function Vn({children:e}){const[t,o]=n.useState(!1),[r,i]=n.useState(!1),s=n.useMemo(()=>({focusWithin:t,trackFocusWithin:(l,d)=>{const a=m=>f=>{var h;f.currentTarget.contains(f.relatedTarget)||o(m),(h=m?l:d)===null||h===void 0||h(f)};return{onFocus:a(!0),onBlur:a(!1)}},autoPlaying:r,setAutoPlaying:i}),[t,r]);return n.createElement(jt.Provider,{value:s},e)}const qt=n.createContext(null),Te=se("useDocument","DocumentContext",qt);function Un({nodeRef:e,children:t}){const o=n.useMemo(()=>{const r=s=>{var c;return((c=s||e.current)===null||c===void 0?void 0:c.ownerDocument)||document};return{getOwnerDocument:r,getOwnerWindow:s=>{var c;return((c=r(s))===null||c===void 0?void 0:c.defaultView)||window}}},[e]);return n.createElement(qt.Provider,{value:o},t)}const Qt=n.createContext(null),ke=se("useEvents","EventsContext",Qt);function Xn({children:e}){const[t]=n.useState({});n.useEffect(()=>()=>{Object.keys(t).forEach(r=>delete t[r])},[t]);const o=n.useMemo(()=>{const r=(c,l)=>{var d;(d=t[c])===null||d===void 0||d.splice(0,t[c].length,...t[c].filter(a=>a!==l))};return{publish:(...[c,l])=>{var d;(d=t[c])===null||d===void 0||d.forEach(a=>a(l))},subscribe:(c,l)=>(t[c]||(t[c]=[]),t[c].push(l),()=>r(c,l)),unsubscribe:r}},[t]);return n.createElement(Qt.Provider,{value:o},e)}const Jt=n.createContext(null),te=se("useLightboxProps","LightboxPropsContext",Jt);function Yn({children:e,...t}){return n.createElement(Jt.Provider,{value:t},e)}const en=n.createContext(null),ue=se("useLightboxState","LightboxStateContext",en),tn=n.createContext(null),Hn=se("useLightboxDispatch","LightboxDispatchContext",tn);function Bn(e,t){switch(t.type){case"swipe":{const{slides:o}=e,r=(t==null?void 0:t.increment)||0,i=e.globalIndex+r,s=st(i,o.length),c=Ke(o,s),l=r||t.duration!==void 0?{increment:r,duration:t.duration,easing:t.easing}:void 0;return{slides:o,currentIndex:s,globalIndex:i,currentSlide:c,animation:l}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:Ke(t.slides,t.index)}:e;default:throw new Error(Ut)}}function Kn({slides:e,index:t,children:o}){const[r,i]=n.useReducer(Bn,{slides:e,currentIndex:t,globalIndex:t,currentSlide:Ke(e,t)}),[s,c]=n.useState(e),[l,d]=n.useState(t);(e!==s||t!==l)&&(c(e),d(t),i({type:"update",slides:e,index:t}));const a=n.useMemo(()=>({...r,state:r,dispatch:i}),[r,i]);return n.createElement(tn.Provider,{value:i},n.createElement(en.Provider,{value:a},o))}const nn=n.createContext(null),jn=se("useRTLContext","RTLContext",nn);function Gn({isRTL:e,children:t}){const o=n.useMemo(()=>({isRTL:e}),[e]);return n.createElement(nn.Provider,{value:o},t)}const qn=n.createContext(null);function De(e){const t=n.useContext(qn);return e&&t?Yt(t(e)):0}const on=n.createContext(null),Ae=se("useTimeouts","TimeoutsContext",on);function Qn({children:e}){const[t]=n.useState([]);n.useEffect(()=>()=>{t.forEach(r=>window.clearTimeout(r)),t.splice(0,t.length)},[t]);const o=n.useMemo(()=>{const r=c=>{t.splice(0,t.length,...t.filter(l=>l!==c))};return{setTimeout:(c,l)=>{const d=window.setTimeout(()=>{r(d),c()},l);return t.push(d),d},clearTimeout:c=>{c!==void 0&&(r(c),window.clearTimeout(c))}}},[t]);return n.createElement(on.Provider,{value:o},e)}const lt=n.forwardRef(function({label:t,className:o,icon:r,renderIcon:i,onClick:s,style:c,...l},d){const{styles:a,labels:m}=te(),f=xe(m,t);return n.createElement("button",{ref:d,type:"button",title:f,"aria-label":f,className:ie(k(Rn),o),onClick:s,style:{...c,...a.button},...l},i?i():n.createElement(r,{className:k(Be),style:a.icon}))});function Jn(e,t){const o=r=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...r},t);return o.displayName=e,o}function pe(e,t){return Jn(e,n.createElement("g",{fill:"currentColor"},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}const eo=pe("Close",n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),to=pe("Previous",n.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),no=pe("Next",n.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),oo=pe("Loading",n.createElement(n.Fragment,null,Array.from({length:8}).map((e,t,o)=>n.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/o.length*(t+1),transform:`rotate(${360/o.length*t}, 12, 12)`})))),ro=pe("Error",n.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),ce=rt()?n.useLayoutEffect:n.useEffect;function at(){const[e,t]=n.useState(!1);return n.useEffect(()=>{var o,r;const i=(o=window.matchMedia)===null||o===void 0?void 0:o.call(window,"(prefers-reduced-motion: reduce)");t(i==null?void 0:i.matches);const s=c=>t(c.matches);return(r=i==null?void 0:i.addEventListener)===null||r===void 0||r.call(i,"change",s),()=>{var c;return(c=i==null?void 0:i.removeEventListener)===null||c===void 0?void 0:c.call(i,"change",s)}},[]),e}function io(e){let t=0,o=0,r=0;const s=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(s){const c=s[1].split(",").map(Ne);c.length===6?(t=c[4],o=c[5]):c.length===16&&(t=c[12],o=c[13],r=c[14])}return{x:t,y:o,z:r}}function xt(e,t){const o=n.useRef(void 0),r=n.useRef(void 0),i=at();return ce(()=>{var s,c,l;if(e.current&&o.current!==void 0&&!i){const{keyframes:d,duration:a,easing:m,onfinish:f}=t(o.current,e.current.getBoundingClientRect(),io(e.current))||{};if(d&&a){(s=r.current)===null||s===void 0||s.cancel(),r.current=void 0;try{r.current=(l=(c=e.current).animate)===null||l===void 0?void 0:l.call(c,d,{duration:a,easing:m})}catch(h){console.error(h)}r.current&&(r.current.onfinish=()=>{r.current=void 0,f==null||f()})}}o.current=void 0}),{prepareAnimation:s=>{o.current=s},isAnimationPlaying:()=>{var s;return((s=r.current)===null||s===void 0?void 0:s.playState)==="running"}}}function rn(){const e=n.useRef(null),t=n.useRef(void 0),[o,r]=n.useState();return{setContainerRef:n.useCallback(s=>{e.current=s,t.current&&(t.current.disconnect(),t.current=void 0);const c=()=>{if(s){const l=window.getComputedStyle(s),d=a=>parseFloat(a)||0;r({width:Math.round(s.clientWidth-d(l.paddingLeft)-d(l.paddingRight)),height:Math.round(s.clientHeight-d(l.paddingTop)-d(l.paddingBottom))})}else r(void 0)};c(),s&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(c),t.current.observe(s))},[]),containerRef:e,containerRect:o}}function Ie(){const e=n.useRef(void 0),{setTimeout:t,clearTimeout:o}=Ae();return n.useCallback((r,i)=>{o(e.current),e.current=t(r,i>0?i:0)},[t,o])}function A(e){const t=n.useRef(e);return ce(()=>{t.current=e}),n.useCallback((...o)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...o)},[])}function bt(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Ge(e,t){return n.useMemo(()=>e==null&&t==null?null:o=>{bt(e,o),bt(t,o)},[e,t])}function co(e,t=!1){const o=n.useRef(!1);ce(()=>{t&&o.current&&(o.current=!1,e())},[t,e]);const r=n.useCallback(()=>{o.current=!0},[]),i=n.useCallback(()=>{o.current=!1},[]);return{onFocus:r,onBlur:i}}function ut(){return jn().isRTL}function so(){const[e]=n.useState({}),t=n.useCallback((i,s)=>{var c;(c=e[i])===null||c===void 0||c.forEach(l=>{s.isPropagationStopped()||l(s)})},[e]),o=n.useMemo(()=>({onPointerDown:i=>t(Zt,i),onPointerMove:i=>t(Wt,i),onPointerUp:i=>t($t,i),onPointerLeave:i=>t(zt,i),onPointerCancel:i=>t(Ft,i),onKeyDown:i=>t(et,i),onKeyUp:i=>t(Ln,i),onWheel:i=>t(tt,i)}),[t]),r=n.useCallback((i,s)=>(e[i]||(e[i]=[]),e[i].unshift(s),()=>{const c=e[i];c&&c.splice(0,c.length,...c.filter(l=>l!==s))}),[e]);return{registerSensors:o,subscribeSensors:r}}function wt(e,t){const o=n.useRef(0),r=Ie(),i=A((...s)=>{o.current=Date.now(),e(...s)});return n.useCallback((...s)=>{r(()=>{i(...s)},t-(Date.now()-o.current))},[t,i,r])}const Xe=nt("slide"),Ye=nt("slide_image");function Re({slide:e,offset:t,render:o,rect:r,rotation:i=0,imageFit:s,imageProps:c,onClick:l,onLoad:d,onError:a,style:m}){var f,h,p,g,u,_,x,M;const[L,R]=n.useState(Fe),{publish:P}=ke(),{setTimeout:N}=Ae(),y=n.useRef(null);n.useEffect(()=>{t===0&&P(_n(L))},[t,L,P]);const T=A(W=>{("decode"in W?W.decode():Promise.resolve()).catch(()=>{}).then(()=>{W.parentNode&&(R(Ue),N(()=>{d==null||d(W)},0))})}),v=n.useCallback(W=>{y.current=W,W!=null&&W.complete&&T(W)},[T]),I=n.useCallback(W=>{T(W.currentTarget)},[T]),Z=A(()=>{R(Ve),a==null||a()}),U=ct(e,s),w=Yt(i),S=w%180!==0,b=r&&S?{width:r.height,height:r.width}:r,F=S&&b?`${b.width}px`:"100%",$=S&&b?`${b.height}px`:"100%",C=(W,ge)=>Number.isFinite(W)?W:ge,D=C(Math.max(...((h=(f=e.srcSet)===null||f===void 0?void 0:f.map(W=>W.width))!==null&&h!==void 0?h:[]).concat(e.width?[e.width]:[]).filter(Boolean)),((p=y.current)===null||p===void 0?void 0:p.naturalWidth)||0),O=C(Math.max(...((u=(g=e.srcSet)===null||g===void 0?void 0:g.map(W=>W.height))!==null&&u!==void 0?u:[]).concat(e.height?[e.height]:[]).filter(Boolean)),((_=y.current)===null||_===void 0?void 0:_.naturalHeight)||0),X=D&&O?{maxWidth:`min(${D}px, ${F})`,maxHeight:`min(${O}px, ${$})`}:{maxWidth:F,maxHeight:$},V=b&&D&&O?Math.min(b.width/D,b.height/O,1):0,H=S&&b?U?{width:b.width,height:b.height}:V?{width:D*V,height:O*V}:null:null,B=(x=e.srcSet)===null||x===void 0?void 0:x.slice().sort((W,ge)=>W.width-ge.width).map(W=>`${W.src} ${W.width}w`).join(", "),Q=(()=>{if(b)return!e.width||!e.height?b.width:(U?Math.max:Math.min)(b.height/e.height*e.width,b.width)})(),J=B&&Q!==void 0&&rt()?`${Math.round(Q)}px`:void 0,{style:be,className:Me,...we}=(typeof c=="function"?c(e):c)||{};return n.createElement(n.Fragment,null,n.createElement("img",{ref:v,onLoad:I,onError:Z,onClick:l,draggable:!1,className:ie(k(Ye()),U&&k(Ye("cover")),L!==Ue&&k(Ye("loading")),Me),style:{...X,...w?{rotate:`${w}deg`}:null,...S?{flexShrink:0}:null,...H,...m,...be},...we,alt:(M=e.alt)!==null&&M!==void 0?M:"",sizes:J,srcSet:B,src:e.src}),L!==Ue&&n.createElement("div",{className:k(Xe(Cn))},L===Fe&&(o!=null&&o.iconLoading?o.iconLoading():n.createElement(oo,{className:ie(k(Be),k(Xe(Fe)))})),L===Ve&&(o!=null&&o.iconError?o.iconError():n.createElement(ro,{className:ie(k(Be),k(Xe(Ve)))}))))}const lo=n.forwardRef(function({className:t,children:o,onFocus:r,onBlur:i,...s},c){const l=n.useRef(null),[d,a]=n.useState(!1),{trackFocusWithin:m}=Gt(),f=A(()=>{if(l.current){const h=window.getComputedStyle(l.current).direction==="rtl";h!==d&&a(h)}});return n.useEffect(f),n.createElement(Un,{nodeRef:l},n.createElement(Gn,{isRTL:d},n.createElement("div",{ref:Ge(c,l),className:ie(k("root"),t),...m(r,i),...s},o)))});var K;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"})(K||(K={}));function cn(e,t,o,r,i){n.useEffect(()=>i?()=>{}:ot(e(Zt,t),e(Wt,o),e($t,r),e(zt,r),e(Ft,r)),[e,t,o,r,i])}var ne;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"})(ne||(ne={}));const He=30;function ao({disableSwipeNavigation:e,closeOnBackdropClick:t},o,r,i,s,c,l,d,a,m,f,h,p,g,u,_){const x=n.useRef(0),M=n.useRef([]),L=n.useRef(void 0),R=n.useRef(0),P=n.useRef(ne.NONE),N=n.useCallback(w=>{L.current===w.pointerId&&(L.current=void 0,P.current=ne.NONE);const S=M.current;S.splice(0,S.length,...S.filter(b=>b.pointerId!==w.pointerId))},[]),y=n.useCallback(w=>{N(w),w.persist(),M.current.push(w)},[N]),T=n.useCallback(w=>M.current.find(({pointerId:S})=>w.pointerId===S),[]),v=A(w=>{y(w)}),I=(w,S)=>f&&w>S||m&&w<-S,Z=A(w=>{const S=T(w);if(S)if(L.current===w.pointerId){const b=Date.now()-R.current,F=x.current;P.current===ne.SWIPE?Math.abs(F)>.3*i||Math.abs(F)>5&&b<s?d(F,b):a(F):P.current===ne.PULL&&(I(F,2*He)?g(F,b):u(F)),x.current=0,P.current=ne.NONE}else{const{target:b}=w;t&&b instanceof HTMLElement&&b===S.target&&(b.classList.contains(k(Je))||b.classList.contains(k(At)))&&_()}N(w)}),U=A(w=>{const S=T(w);if(S){const b=L.current===w.pointerId;if(w.buttons===0){b&&x.current!==0?Z(w):N(S);return}const F=w.clientX-S.clientX,$=w.clientY-S.clientY;if(L.current===void 0){const C=D=>{y(w),L.current=w.pointerId,R.current=Date.now(),P.current=D};Math.abs(F)>Math.abs($)&&Math.abs(F)>He&&r(F)?e||(C(ne.SWIPE),c()):Math.abs($)>Math.abs(F)&&I($,He)&&(C(ne.PULL),h())}else b&&(P.current===ne.SWIPE?(x.current=F,l(F)):P.current===ne.PULL&&(x.current=$,p($)))}});cn(o,v,U,Z)}function uo({preventDefaultWheelX:e,preventDefaultWheelY:t}){const o=n.useRef(null),r=A(i=>{const s=Math.abs(i.deltaX)>Math.abs(i.deltaY);(s&&e||!s&&t||i.ctrlKey)&&i.preventDefault()});return n.useCallback(i=>{var s;i?i.addEventListener("wheel",r,{passive:!1}):(s=o.current)===null||s===void 0||s.removeEventListener("wheel",r),o.current=i},[r])}function fo(e,t,o,r,i,s,c,l,d){const a=n.useRef(0),m=n.useRef(0),f=n.useRef(void 0),h=n.useRef(void 0),p=n.useRef(0),g=n.useRef(void 0),u=n.useRef(0),{setTimeout:_,clearTimeout:x}=Ae(),M=n.useCallback(()=>{f.current&&(x(f.current),f.current=void 0)},[x]),L=n.useCallback(()=>{h.current&&(x(h.current),h.current=void 0)},[x]),R=A(()=>{e!==K.SWIPE&&(a.current=0,u.current=0,M(),L())});n.useEffect(R,[e,R]);const P=A(y=>{h.current=void 0,a.current===y&&d(a.current)}),N=A(y=>{if(y.ctrlKey||Math.abs(y.deltaY)>Math.abs(y.deltaX))return;const T=v=>{p.current=v,x(g.current),g.current=v>0?_(()=>{p.current=0,g.current=void 0},300):void 0};if(e===K.NONE){if(Math.abs(y.deltaX)<=1.2*Math.abs(p.current)){T(y.deltaX);return}if(!o(-y.deltaX))return;if(m.current+=y.deltaX,M(),Math.abs(m.current)>30)m.current=0,T(0),u.current=Date.now(),s();else{const v=m.current;f.current=_(()=>{f.current=void 0,v===m.current&&(m.current=0)},i)}}else if(e===K.SWIPE){let v=a.current-y.deltaX;if(v=Math.min(Math.abs(v),r)*Math.sign(v),a.current=v,c(v),L(),Math.abs(v)>.2*r){T(y.deltaX),l(v,Date.now()-u.current);return}h.current=_(()=>P(v),2*i)}else T(y.deltaX)});n.useEffect(()=>t(tt,N),[t,N])}const Ct=nt("container"),sn=n.createContext(null),le=se("useController","ControllerContext",sn);function ho({children:e,...t}){var o;const{carousel:r,animation:i,controller:s,on:c,styles:l,render:d}=t,{closeOnPullUp:a,closeOnPullDown:m,preventDefaultWheelX:f,preventDefaultWheelY:h}=s,[p,g]=n.useState(),u=ue(),_=Hn(),[x,M]=n.useState(K.NONE),L=n.useRef(0),R=n.useRef(0),P=n.useRef(1),{registerSensors:N,subscribeSensors:y}=so(),{subscribe:T,publish:v}=ke(),I=Ie(),Z=Ie(),U=Ie(),{containerRef:w,setContainerRef:S,containerRect:b}=rn(),F=Ge(uo({preventDefaultWheelX:f,preventDefaultWheelY:h}),S),$=n.useRef(null),C=Ge($,void 0),{getOwnerDocument:D}=Te(),O=ut(),X=E=>(O?-1:1)*(typeof E=="number"?E:1),V=A(()=>{var E;return(E=w.current)===null||E===void 0?void 0:E.focus()}),H=A(()=>t),B=A(()=>u),G=n.useCallback(E=>v(fe,E),[v]),Q=n.useCallback(E=>v(he,E),[v]),J=n.useCallback(()=>v(Ee),[v]),be=E=>!(r.finite&&(X(E)>0&&u.currentIndex===0||X(E)<0&&u.currentIndex===u.slides.length-1)),Me=E=>{var z;L.current=E,(z=w.current)===null||z===void 0||z.style.setProperty(q("swipe_offset"),`${Math.round(E)}px`)},we=E=>{var z,j;R.current=E,P.current=(()=>{const _e=m&&E>0?E:a&&E<0?-E:0;return Math.min(Math.max(it(1-_e/60*(1-.5),2),.5),1)})(),(z=w.current)===null||z===void 0||z.style.setProperty(q("pull_offset"),`${Math.round(E)}px`),(j=w.current)===null||j===void 0||j.style.setProperty(q("pull_opacity"),`${P.current}`)},{prepareAnimation:W}=xt($,(E,z,j)=>{if($.current&&b)return{keyframes:[{transform:`translate(0, ${E.rect.y-z.y+j.y}px)`,opacity:E.opacity},{transform:"translate(0, 0)",opacity:1}],duration:E.duration,easing:i.easing.fade}}),ge=(E,z)=>{if(a||m){we(E);let j=0;$.current&&(j=i.fade*(z?2:1),W({rect:$.current.getBoundingClientRect(),opacity:P.current,duration:j})),U(()=>{we(0),M(K.NONE)},j),M(K.ANIMATION),z||J()}},{prepareAnimation:hn,isAnimationPlaying:mn}=xt($,(E,z,j)=>{var oe;if($.current&&b&&(!((oe=u.animation)===null||oe===void 0)&&oe.duration)){const ee=Oe(r.spacing),_e=(ee.percent?ee.percent*b.width/100:ee.pixel)||0;return{keyframes:[{transform:`translate(${X(u.globalIndex-E.index)*(b.width+_e)+E.rect.x-z.x+j.x}px, 0)`},{transform:"translate(0, 0)"}],duration:u.animation.duration,easing:u.animation.easing}}}),Ce=A(E=>{var z,j;const oe=E.offset||0,ee=oe?i.swipe:(z=i.navigation)!==null&&z!==void 0?z:i.swipe,_e=!oe&&!mn()?i.easing.navigation:i.easing.swipe;let{direction:Le}=E;const ye=(j=E.count)!==null&&j!==void 0?j:1;let We=K.ANIMATION,re=ee*ye;if(!Le){const Pe=b==null?void 0:b.width,pt=E.duration||0,ze=Pe?ee/Pe*Math.abs(oe):ee;ye!==0?(pt<ze?re=re/ze*Math.max(pt,ze/5):Pe&&(re=ee/Pe*(Pe-Math.abs(oe))),Le=X(oe)>0?fe:he):re=ee/2}let $e=0;Le===fe?be(X(1))?$e=-ye:(We=K.NONE,re=ee):Le===he&&(be(X(-1))?$e=ye:(We=K.NONE,re=ee)),re=Math.round(re),Z(()=>{Me(0),M(K.NONE)},re),$.current&&hn({rect:$.current.getBoundingClientRect(),index:u.globalIndex}),M(We),v(vt,{type:"swipe",increment:$e,duration:re,easing:_e})});n.useEffect(()=>{var E,z;!((E=u.animation)===null||E===void 0)&&E.increment&&(!((z=u.animation)===null||z===void 0)&&z.duration)&&I(()=>_({type:"swipe",increment:0}),u.animation.duration)},[u.animation,_,I]);const ft=[y,be,(b==null?void 0:b.width)||0,i.swipe,()=>M(K.SWIPE),E=>Me(E),(E,z)=>Ce({offset:E,duration:z,count:1}),E=>Ce({offset:E,count:0})],pn=[()=>{m&&M(K.PULL)},E=>we(E),E=>ge(E),E=>ge(E,!0)];ao(s,...ft,a,m,...pn,J),fo(x,...ft);const ht=A(()=>{s.focus&&D().querySelector(`.${k(qe)} .${k(Ct())}`)&&V()});n.useEffect(ht,[ht]);const mt=A(()=>{var E;(E=c.view)===null||E===void 0||E.call(c,{index:u.currentIndex})});n.useEffect(mt,[u.globalIndex,mt]),n.useEffect(()=>ot(T(fe,E=>Ce({direction:fe,...E})),T(he,E=>Ce({direction:he,...E})),T(vt,E=>_(E))),[T,Ce,_]);const gn=n.useMemo(()=>({prev:G,next:Q,close:J,focus:V,slideRect:b?Tn(b,r.padding):{width:0,height:0},containerRect:b||{width:0,height:0},subscribeSensors:y,containerRef:w,setCarouselRef:C,toolbarWidth:p,setToolbarWidth:g}),[G,Q,J,V,y,b,w,C,p,g,r.padding]);return n.useImperativeHandle(s.ref,()=>({prev:G,next:Q,close:J,focus:V,getLightboxProps:H,getLightboxState:B}),[G,Q,J,V,H,B]),n.createElement("div",{ref:F,className:ie(k(Ct()),k(Qe)),style:{...x===K.SWIPE?{[q("swipe_offset")]:`${Math.round(L.current)}px`}:null,...x===K.PULL?{[q("pull_offset")]:`${Math.round(R.current)}px`,[q("pull_opacity")]:`${P.current}`}:null,...s.touchAction!=="none"?{[q("controller_touch_action")]:s.touchAction}:null,...l.container},tabIndex:-1,...N},b&&n.createElement(sn.Provider,{value:gn},e,(o=d.controls)===null||o===void 0?void 0:o.call(d)))}const mo=ae(Tt,ho);function de(e){return Se(Nt,e)}function _t(e){return Se(Je,e)}function po({slide:e,offset:t}){const o=n.useRef(null),{currentIndex:r,slides:i}=ue(),{slideRect:s,focus:c}=le(),{render:l,carousel:{imageFit:d,imageProps:a},on:{click:m},styles:{slide:f},labels:h}=te(),{getOwnerDocument:p}=Te(),g=De(e),u=t!==0;n.useEffect(()=>{var x;u&&(!((x=o.current)===null||x===void 0)&&x.contains(p().activeElement))&&c()},[u,c,p]);const _=()=>{var x,M,L,R;let P=(x=l.slide)===null||x===void 0?void 0:x.call(l,{slide:e,offset:t,rect:s});return!P&&me(e)&&(P=n.createElement(Re,{slide:e,offset:t,render:l,rect:s,rotation:g,imageFit:d,imageProps:a,onClick:u?void 0:()=>m==null?void 0:m({index:r})})),P?n.createElement(n.Fragment,null,(M=l.slideHeader)===null||M===void 0?void 0:M.call(l,{slide:e}),((L=l.slideContainer)!==null&&L!==void 0?L:(({children:N})=>N))({slide:e,children:P}),(R=l.slideFooter)===null||R===void 0?void 0:R.call(l,{slide:e})):null};return n.createElement("div",{ref:o,className:ie(k(_t()),!u&&k(_t("current")),k(Qe)),...$n(u),style:f,role:"group","aria-roledescription":xe(h,"Slide"),"aria-label":Nn(h,i,r+t)},_())}function go(){const e=te().styles.slide;return n.createElement("div",{className:k(Je),style:e})}function vo({carousel:e,labels:t}){const{slides:o,currentIndex:r,globalIndex:i}=ue(),{setCarouselRef:s}=le(),{autoPlaying:c,focusWithin:l}=Gt(),d=Oe(e.spacing),a=Oe(e.padding),m=Zn(e,o,1),f=[];if(Ht(o))for(let h=r-m;h<=r+m;h+=1){const p=Bt(o,h),g=i-r+h,u=e.finite&&(h<0||h>o.length-1);f.push(u?{key:g}:{key:[`${g}`,Dn(p)].filter(Boolean).join("|"),offset:h-r,slide:p})}return n.createElement("div",{ref:s,className:ie(k(de()),f.length>0&&k(de("with_slides"))),style:{[`${q(de("slides_count"))}`]:f.length,[`${q(de("spacing_px"))}`]:d.pixel||0,[`${q(de("spacing_percent"))}`]:d.percent||0,[`${q(de("padding_px"))}`]:a.pixel||0,[`${q(de("padding_percent"))}`]:a.percent||0},role:"region","aria-live":c&&!l?"off":"polite","aria-roledescription":xe(t,"Carousel"),"aria-label":xe(t,"Photo gallery")},f.map(({key:h,slide:p,offset:g})=>p?n.createElement(po,{key:h,slide:p,offset:g}):n.createElement(go,{key:h})))}const Eo=ae(Nt,vo);function ln(){const{carousel:e}=te(),{slides:t,currentIndex:o}=ue(),r=t.length===0||e.finite&&o===0,i=t.length===0||e.finite&&o===t.length-1;return{prevDisabled:r,nextDisabled:i}}function xo(e){var t;const o=ut(),{publish:r}=ke(),{animation:i,controller:s}=te(),{prevDisabled:c,nextDisabled:l}=ln(),d=((t=i.navigation)!==null&&t!==void 0?t:i.swipe)/2,a=wt(()=>r(fe),d),m=wt(()=>r(he),d),f=A(h=>{switch(h.key){case yn:if(!s.closeOnEscape)return;r(Ee);break;case In:(o?l:c)||(o?m:a)();break;case On:(o?c:l)||(o?a:m)();break;default:return}h.stopPropagation()});n.useEffect(()=>e(et,f),[e,f])}function Pt({label:e,icon:t,renderIcon:o,action:r,onClick:i,disabled:s,style:c}){return n.createElement(lt,{label:e,icon:t,renderIcon:o,className:k(`navigation_${r}`),disabled:s,onClick:i,style:c,...co(le().focus,s)})}function bo({render:{buttonPrev:e,buttonNext:t,iconPrev:o,iconNext:r},styles:i}){const{prev:s,next:c,subscribeSensors:l}=le(),{prevDisabled:d,nextDisabled:a}=ln();return xo(l),n.createElement(n.Fragment,null,e?e():n.createElement(Pt,{label:"Previous",action:fe,icon:to,renderIcon:o,style:i.navigationPrev,disabled:d,onClick:s}),t?t():n.createElement(Pt,{label:"Next",action:he,icon:no,renderIcon:r,style:i.navigationNext,disabled:a,onClick:c}))}const wo=ae(xn,bo),St=k(Sn),Co=k(Dt);function _o(e){return"style"in e}function Mt(e,t,o){const r=window.getComputedStyle(e),i=o?"padding-left":"padding-right",s=o?r.paddingLeft:r.paddingRight,c=e.style.getPropertyValue(i);return e.style.setProperty(i,`${(Ne(s)||0)+t}px`),()=>{c?e.style.setProperty(i,c):e.style.removeProperty(i)}}function Po({noScroll:{disabled:e},children:t}){const o=ut(),{getOwnerDocument:r,getOwnerWindow:i}=Te();return n.useEffect(()=>{if(e)return()=>{};const s=[],c=i(),{body:l,documentElement:d}=r(),a=Math.round(c.innerWidth-d.clientWidth);if(a>0){s.push(Mt(l,a,o));const m=l.getElementsByTagName("*");for(let f=0;f<m.length;f+=1){const h=m[f];_o(h)&&c.getComputedStyle(h).getPropertyValue("position")==="fixed"&&!h.classList.contains(Co)&&s.push(Mt(h,a,o))}}return l.classList.add(St),()=>{l.classList.remove(St),s.forEach(m=>m())}},[o,e,r,i]),n.createElement(n.Fragment,null,t)}const So=ae(bn,Po);function Lt(e){return Se(qe,e)}function yt(e,t,o){const r=e.getAttribute(t);return e.setAttribute(t,o),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}function Mo({portal:{root:e,container:{className:t,style:o,...r}={}},animation:i,styles:s,className:c,on:l,close:d,labels:a,children:m}){const[f,h]=n.useState(!1),[p,g]=n.useState(!1),u=n.useRef([]),_=n.useRef(null),{setTimeout:x}=Ae(),{subscribe:M}=ke(),R=at()?0:i.fade;n.useEffect(()=>(h(!0),()=>{h(!1),g(!1)}),[]);const P=A(()=>{u.current.forEach(v=>v()),u.current=[]}),N=A(()=>{var v;g(!1),P(),(v=l.exiting)===null||v===void 0||v.call(l),x(()=>{var I;(I=l.exited)===null||I===void 0||I.call(l),d()},R)});n.useEffect(()=>M(Ee,N),[M,N]);const y=A(v=>{var I,Z,U;zn(v),g(!0),(I=l.entering)===null||I===void 0||I.call(l);const w=(U=(Z=v.parentNode)===null||Z===void 0?void 0:Z.children)!==null&&U!==void 0?U:[];for(let S=0;S<w.length;S+=1){const b=w[S];["TEMPLATE","SCRIPT","STYLE"].indexOf(b.tagName)===-1&&b!==v&&(u.current.push(yt(b,"inert","")),u.current.push(yt(b,"aria-hidden","true")))}u.current.push(()=>{var S,b;(b=(S=_.current)===null||S===void 0?void 0:S.focus)===null||b===void 0||b.call(S)}),x(()=>{var S;(S=l.entered)===null||S===void 0||S.call(l)},R)}),T=n.useCallback(v=>{v?y(v):P()},[y,P]);return f?En.createPortal(n.createElement(lo,{ref:T,className:ie(c,t,k(Lt()),k(Dt),p&&k(Lt("open"))),"aria-modal":!0,role:"dialog","aria-label":xe(a,"Lightbox"),style:{...i.fade!==je.animation.fade?{[q("fade_animation_duration")]:`${R}ms`}:null,...i.easing.fade!==je.animation.easing.fade?{[q("fade_animation_timing_function")]:i.easing.fade}:null,...s.root,...o},onFocus:v=>{_.current||(_.current=v.relatedTarget)},...r},m),(typeof e=="function"?e():e)||document.body):null}const Lo=ae(qe,Mo);function yo({children:e}){return n.createElement(n.Fragment,null,e)}const Io=ae(wn,yo);function Oo(e){return Se(kt,e)}function Ro({toolbar:{buttons:e},render:{buttonClose:t,iconClose:o},styles:r}){const{close:i,setToolbarWidth:s}=le(),{setContainerRef:c,containerRect:l}=rn();ce(()=>{s(l==null?void 0:l.width)},[s,l==null?void 0:l.width]);const d=()=>t?t():n.createElement(lt,{key:Ee,label:"Close",icon:eo,renderIcon:o,onClick:i});return n.createElement("div",{ref:c,style:r.toolbar,className:k(Oo())},e==null?void 0:e.map(a=>a===Ee?d():a))}const No=ae(kt,Ro);function an(e,t){var o;return n.createElement(e.module.component,{key:e.module.name,...t},(o=e.children)===null||o===void 0?void 0:o.map(r=>an(r,t)))}function To(e,t={}){const{easing:o,...r}=e,{easing:i,...s}=t;return{easing:{...o,...i},...r,...s}}function ko({carousel:e,animation:t,render:o,toolbar:r,controller:i,noScroll:s,on:c,plugins:l,slides:d,index:a,...m}){const{animation:f,carousel:h,render:p,toolbar:g,controller:u,noScroll:_,on:x,slides:M,index:L,plugins:R,...P}=je,{config:N,augmentation:y}=Fn([Y(Lo,[Y(So,[Y(mo,[Y(Eo),Y(No),Y(wo)])])])],l||R),T=y({animation:To(f,t),carousel:{...h,...e},render:{...p,...o},toolbar:{...g,...r},controller:{...u,...i},noScroll:{..._,...s},on:{...x,...c},...P,...m});return T.open?n.createElement(Yn,{...T},n.createElement(Kn,{slides:d||M,index:Ne(a||L)},n.createElement(Qn,null,n.createElement(Xn,null,n.createElement(Vn,null,an(Y(Io,N),T)))))):null}const un={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1,maxZoom:8};function Do(e){return Math.min(Math.max(e,Number.EPSILON),1)}function dn(e){const{minZoom:t,...o}={...un,...e};return{minZoom:Do(t),...o}}function Ao(e,t,o,r){const i=n.useRef(void 0),s=n.useRef(void 0),{zoom:c}=te().animation,l=at(),d=A(()=>{var a,m,f;if((a=i.current)===null||a===void 0||a.cancel(),i.current=void 0,s.current&&(r!=null&&r.current)){try{i.current=(f=(m=r.current).animate)===null||f===void 0?void 0:f.call(m,[{transform:s.current},{transform:`scale(${e}) translateX(${t}px) translateY(${o}px)`}],{duration:l?0:c??500,easing:i.current?"ease-out":"ease-in-out"})}catch(h){console.error(h)}s.current=void 0,i.current&&(i.current.onfinish=()=>{i.current=void 0})}});return ce(d,[e,t,o,d]),n.useCallback(()=>{s.current=r!=null&&r.current?window.getComputedStyle(r.current).transform:void 0},[r])}function Zo(e,t){const{on:o}=te(),r=A(()=>{var i;t||(i=o.zoom)===null||i===void 0||i.call(o,{zoom:e})});n.useEffect(r,[e,r])}function Ze(){const{zoom:e}=te();return dn(e)}function Wo(e,t){var o;const r=typeof e=="function"?(o=e(t))!==null&&o!==void 0?o:un.maxZoom:e;return Math.max(r,1)}function $o(e,t){var o,r;let i={width:0,height:0},s={width:0,height:0};const{currentSlide:c}=ue(),l=De(c),{imageFit:d}=te().carousel,{maxZoomPixelRatio:a,maxZoom:m}=Ze();if(e&&c){const h={...c,...t};if(me(h)){const p=ct(h,d),g=Math.max(...(((o=h.srcSet)===null||o===void 0?void 0:o.map(L=>L.width))||[]).concat(h.width?[h.width]:[])),u=Math.max(...(((r=h.srcSet)===null||r===void 0?void 0:r.map(L=>L.height))||[]).concat(h.height?[h.height]:[])),_=l%180!==0,x=_?u:g,M=_?g:u;x>0&&M>0&&e.width>0&&e.height>0&&(s=p?{width:Math.round(Math.min(x,e.width/e.height*M)),height:Math.round(Math.min(M,e.height/e.width*x))}:{width:x,height:M},s={width:s.width*a,height:s.height*a},i=p?{width:Math.min(e.width,s.width,x),height:Math.min(e.height,s.height,M)}:{width:Math.round(Math.min(e.width,e.height/M*x,x)),height:Math.round(Math.min(e.height,e.width/x*M,M))})}else e.width>0&&e.height>0&&(t&&t.width>0&&t.height>0?i={width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}:i={width:e.width,height:e.height})}const f=c&&i.width?me(c)?Math.max(it(s.width/i.width,5),1):Wo(m,c):1;return{imageRect:i,maxZoom:f}}function It(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function Ot(e,t,o=100,r=2){return e*Math.min(1+Math.abs(t/o),r)**Math.sign(t)}function zo(e,t,o,r,i,s,c,l,d){const a=n.useRef([]),m=n.useRef(0),f=n.useRef(void 0),{globalIndex:h}=ue(),{getOwnerWindow:p}=Te(),{containerRef:g,subscribeSensors:u}=le(),{keyboardMoveDistance:_,zoomInMultiplier:x,wheelZoomDistanceFactor:M,scrollToZoom:L,doubleTapDelay:R,doubleClickDelay:P,doubleClickMaxStops:N,pinchZoomDistanceFactor:y,pinchZoomV4:T}=Ze(),v=n.useCallback(C=>{if(g.current){const{pageX:D,pageY:O}=C,{scrollX:X,scrollY:V}=p(),{left:H,top:B,width:G,height:Q}=g.current.getBoundingClientRect();return[D-H-X-G/2,O-B-V-Q/2]}return[]},[g,p]),I=A(C=>{const D=e(),{key:O,metaKey:X,ctrlKey:V}=C,H=X||V,B=()=>{C.preventDefault(),C.stopPropagation()};if(D>1){const G=(Q,J)=>{B(),l(Q,J)};O==="ArrowDown"?G(0,_):O==="ArrowUp"?G(0,-_):O==="ArrowLeft"?G(-_,0):O==="ArrowRight"&&G(_,0)}O==="+"||H&&O==="="?(B(),i()):O==="-"||H&&O==="_"?(B(),s()):H&&O==="0"&&(B(),c(1))}),Z=A(C=>{const D=e();if((C.ctrlKey||L)&&Math.abs(C.deltaY)>Math.abs(C.deltaX)){C.stopPropagation(),c(Ot(D,-C.deltaY,M),!0,...v(C));return}D>1&&(C.stopPropagation(),L||l(C.deltaX,C.deltaY))}),U=n.useCallback(C=>{const D=a.current;D.splice(0,D.length,...D.filter(O=>O.pointerId!==C.pointerId))},[]),w=n.useCallback(C=>{U(C),C.persist(),a.current.push(C)},[U]),S=A(C=>{var D;const O=e(),X=a.current;if(C.pointerType==="mouse"&&C.buttons>1||!(!((D=d==null?void 0:d.current)===null||D===void 0)&&D.contains(C.target)))return;O>1&&C.stopPropagation();const{timeStamp:V}=C;if(X.length===0&&V-m.current<(C.pointerType==="touch"?R:P)){m.current=0;const H=O>=1?O!==o?O*Math.max(o**(1/N),x):1:O!==t?O/Math.max(t**(-1/N),x):1;c(H,!1,...v(C))}else m.current=V;if(w(C),X.length===2){const H=It(X[0],X[1]);f.current={previousDistance:H,initialDistance:Math.max(H,1),initialZoom:O}}}),b=A(C=>{const D=e(),O=a.current,X=O.find(V=>V.pointerId===C.pointerId);if(O.length===2&&f.current){C.stopPropagation(),w(C);const V=It(O[0],O[1]),H=T?f.current.initialZoom/f.current.initialDistance*V:Ot(D,V-f.current.previousDistance,y);c(H,!0,...O.map(B=>v(B)).reduce((B,G)=>G.map((Q,J)=>B[J]+Q/2))),f.current.previousDistance=V;return}D>1&&(C.stopPropagation(),X&&(O.length===1&&l((X.clientX-C.clientX)/D,(X.clientY-C.clientY)/D),w(C)))}),F=n.useCallback(C=>{const D=a.current;D.length===2&&D.find(O=>O.pointerId===C.pointerId)&&(f.current=void 0),U(C)},[U]),$=n.useCallback(()=>{const C=a.current;C.splice(0,C.length),m.current=0,f.current=void 0},[]);cn(u,S,b,F,r),n.useEffect($,[h,$]),n.useEffect(()=>r?()=>{}:ot($,u(et,I),u(tt,Z)),[r,u,$,I,Z])}function Fo(e,t,o){const[r,i]=n.useState(1),[s,c]=n.useState(0),[l,d]=n.useState(0),a=n.useRef({zoom:r,offsetX:s,offsetY:l}),m=Ao(r,s,l,o),{currentSlide:f,globalIndex:h}=ue(),{containerRect:p,slideRect:g}=le(),{minZoom:u,zoomInMultiplier:_}=Ze(),x=f&&me(f)?f.src:void 0,M=De(f),L=!(o!=null&&o.current);ce(()=>{a.current={zoom:1,offsetX:0,offsetY:0},i(1),c(0),d(0)},[h,x,M]);const R=n.useCallback((I,Z,U)=>{const w=U||a.current.zoom,S=a.current.offsetX-(I||0),b=a.current.offsetY-(Z||0),F=(e.width*w-g.width)/2/w,$=(e.height*w-g.height)/2/w;a.current.offsetX=Math.min(Math.abs(S),Math.max(F,0))*Math.sign(S),a.current.offsetY=Math.min(Math.abs(b),Math.max($,0))*Math.sign(b),c(a.current.offsetX),d(a.current.offsetY)},[g,e.width,e.height]),P=n.useCallback((I,Z,U,w)=>{const S=it(I+.01<t?I-.01>u?I:u:t,5);Z||m();const{zoom:b}=a.current;R(U?U*(1/b-1/S):0,w?w*(1/b-1/S):0,S),a.current.zoom=S,i(S)},[u,t,R,m]),N=n.useCallback(()=>a.current.zoom,[]),y=A(()=>{const I=N();I>1&&(I>t&&P(t,!0),R())});ce(y,[p.width,p.height,y]);const T=n.useCallback(()=>{const I=N(),Z=I*_;P(I<1&&Z>1?1:Z)},[_,N,P]),v=n.useCallback(()=>{const I=N(),Z=I/_;P(I>1&&Z<1?1:Z)},[_,N,P]);return{zoom:r,offsetX:s,offsetY:l,disabled:L,getZoom:N,changeOffsets:R,changeZoom:P,zoomIn:T,zoomOut:v}}const fn=n.createContext(null),dt=se("useZoom","ZoomControllerContext",fn);function Vo({children:e}){const[t,o]=n.useState(),{slideRect:r}=le(),{ref:i,minZoom:s}=Ze(),{imageRect:c,maxZoom:l}=$o(r,t==null?void 0:t.imageDimensions),{zoom:d,offsetX:a,offsetY:m,disabled:f,getZoom:h,changeZoom:p,changeOffsets:g,zoomIn:u,zoomOut:_}=Fo(c,l,t==null?void 0:t.zoomWrapperRef);Zo(d,f),zo(h,s,l,f,u,_,p,g,t==null?void 0:t.zoomWrapperRef);const x=n.useMemo(()=>({zoom:d,minZoom:s,maxZoom:l,offsetX:a,offsetY:m,disabled:f,zoomIn:u,zoomOut:_,changeZoom:p}),[d,s,l,a,m,f,u,_,p]);n.useImperativeHandle(i,()=>x,[x]);const M=n.useMemo(()=>({...x,setZoomWrapper:o}),[x,o]);return n.createElement(fn.Provider,{value:M},e)}const Uo=pe("ZoomIn",n.createElement(n.Fragment,null,n.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),n.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),Xo=pe("ZoomOut",n.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),Rt=n.forwardRef(function({zoomIn:t,onLoseFocus:o},r){const i=n.useRef(!1),s=n.useRef(!1),{zoom:c,minZoom:l,maxZoom:d,zoomIn:a,zoomOut:m,disabled:f}=dt(),{render:h}=te(),p=f||(t?c>=d:c<=l);return n.useEffect(()=>{p&&i.current&&s.current&&o(),p||(i.current=!0)},[p,o]),n.createElement(lt,{ref:r,disabled:p,label:t?"Zoom in":"Zoom out",icon:t?Uo:Xo,renderIcon:t?h.iconZoomIn:h.iconZoomOut,onClick:t?a:m,onFocus:()=>{s.current=!0},onBlur:()=>{s.current=!1}})});function Yo(){const e=n.useRef(null),t=n.useRef(null),{focus:o}=le(),r=n.useCallback(c=>{var l,d;!((l=c.current)===null||l===void 0)&&l.disabled?o():(d=c.current)===null||d===void 0||d.focus()},[o]),i=n.useCallback(()=>r(e),[r]),s=n.useCallback(()=>r(t),[r]);return n.createElement(n.Fragment,null,n.createElement(Rt,{zoomIn:!0,ref:e,onLoseFocus:s}),n.createElement(Rt,{ref:t,onLoseFocus:i}))}function Ho(){const{render:e}=te(),t=dt();return e.buttonZoom?n.createElement(n.Fragment,null,e.buttonZoom(t)):n.createElement(Yo,null)}function Bo(e){var t;return(((t=e.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function Ko({current:e,preload:t},{type:o,source:r}){switch(o){case"fetch":return e?{current:e,preload:r}:{current:r};case"done":return r===t?{current:r}:{current:e,preload:t};default:throw new Error(Ut)}}function jo(e){var t,o;const[{current:r,preload:i},s]=n.useReducer(Ko,{}),{slide:c,rect:l,rotation:d=0,imageFit:a,render:m,interactive:f,zoom:h=1}=e,p=d%180!==0,g=p?{width:l.height,height:l.width}:l,u=c.srcSet.sort((v,I)=>v.width-I.width),_=(t=c.width)!==null&&t!==void 0?t:u[u.length-1].width,x=(o=c.height)!==null&&o!==void 0?o:u[u.length-1].height,M=ct(c,a),L=Math.max(...u.map(v=>v.width)),R=Math.min((M?Math.max:Math.min)(g.width,_*(g.height/x))*h,L),P=kn(),N=A(()=>{var v;const I=(v=u.find(Z=>Z.width>=R*P))!==null&&v!==void 0?v:u[u.length-1];(!r||u.findIndex(Z=>Z.src===r)<u.findIndex(Z=>Z===I))&&s({type:"fetch",source:I.src})});ce(N,[R,P,N]);const y=A(v=>s({type:"done",source:v})),T={WebkitTransform:f?"initial":"translateZ(0)"};return M||Object.assign(T,g.width/g.height<_/x?{width:p?`${g.width}px`:"100%",height:"auto"}:{width:"auto",height:p?`${g.height}px`:"100%"}),n.createElement(n.Fragment,null,i&&i!==r&&n.createElement(Re,{key:"preload",...e,offset:void 0,slide:{...c,src:i,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...T},onLoad:()=>y(i),render:{...m,iconLoading:()=>null,iconError:()=>null}}),r&&n.createElement(Re,{key:"current",...e,slide:{...c,src:r,srcSet:void 0},style:T}))}function Go({render:e,slide:t,offset:o,rect:r}){var i;const[s,c]=n.useState(),l=n.useRef(null),d=me(t),a=De(t),{zoom:m,maxZoom:f,offsetX:h,offsetY:p,setZoomWrapper:g}=dt(),u=m>1,{carousel:_,on:x}=te(),{currentIndex:M}=ue();ce(()=>{if(o!==0||d||!l.current)return()=>{};const R=()=>{const N=l.current;if(!N)return;let y=0,T=0;for(const v of N.children)v instanceof HTMLElement&&(y=Math.max(y,v.offsetWidth),T=Math.max(T,v.offsetHeight));c(v=>v&&v.width===y&&v.height===T?v:{width:y,height:T})};if(R(),typeof ResizeObserver>"u")return()=>{};const P=new ResizeObserver(R);for(const N of l.current.children)P.observe(N);return()=>P.disconnect()},[o,d,r]),ce(()=>o===0?(g({zoomWrapperRef:l,imageDimensions:s}),()=>g(void 0)):()=>{},[o,s,g]);let L=(i=e.slide)===null||i===void 0?void 0:i.call(e,{slide:t,offset:o,rect:r,zoom:m,maxZoom:f});if(!L&&d){const R={slide:t,offset:o,rect:r,rotation:a,render:e,imageFit:_.imageFit,imageProps:_.imageProps,onClick:o===0?()=>{var P;return(P=x.click)===null||P===void 0?void 0:P.call(x,{index:M})}:void 0};L=Bo(t)?n.createElement(jo,{...R,slide:t,interactive:u,zoom:o===0?m:1}):n.createElement(Re,{onLoad:P=>c({width:P.naturalWidth,height:P.naturalHeight}),...R})}return L?n.createElement("div",{ref:l,className:ie(k(Pn),k(Qe),k(At),u&&k(Mn)),style:o===0?{transform:`scale(${m}) translateX(${h}px) translateY(${p}px)`}:void 0},L):null}const qo=({augment:e,addModule:t})=>{e(({zoom:o,toolbar:r,render:i,controller:s,...c})=>{const l=dn(o);return{zoom:l,toolbar:An(r,gt,n.createElement(Ho,null)),render:{...i,slide:d=>{var a,m;return me(d.slide)||d.slide.type!=null&&(!((a=l.supports)===null||a===void 0)&&a.includes(d.slide.type))?n.createElement(Go,{render:i,...d}):(m=i.slide)===null||m===void 0?void 0:m.call(i,d)}},controller:{...s,preventDefaultWheelY:l.scrollToZoom},...c}}),t(ae(gt,Vo))};function tr({src:e,alt:t,slides:o,index:r=0,open:i,onClose:s}){const c=o&&o.length>0?o:e?[{src:e,alt:t}]:[];return vn.jsx(ko,{open:i,close:s,index:r,slides:c,plugins:[qo],zoom:{scrollToZoom:!0,maxZoomPixelRatio:5},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)"},toolbar:{background:"transparent",padding:"16px"},button:{backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:"9999px",color:"#fff",width:40,height:40},icon:{width:20,height:20}},animation:{fade:200}})}export{tr as default};
|
|
1
|
+
import{j as vn}from"./index-CWUiS-aC.js";import{r as n}from"./syntax-highlighter-d-DuIo_w.js";import{r as En}from"./main-B-Q2oskz.js";const Nt="carousel",Tt="controller",xn="navigation",bn="no-scroll",qe="portal",wn="root",kt="toolbar",gt="zoom",Fe="loading",Ve="error",Ue="complete",Cn="placeholder",_n=e=>`active-slide-${e}`,Pn="fullsize",Qe="flex_center",Sn="no_scroll",Dt="no_scroll_padding",Je="slide",At="slide_wrapper",Mn="slide_wrapper_interactive",fe="prev",he="next",vt="swipe",Ee="close",Zt="onPointerDown",Wt="onPointerMove",$t="onPointerUp",zt="onPointerLeave",Ft="onPointerCancel",et="onKeyDown",Ln="onKeyUp",tt="onWheel",yn="Escape",In="ArrowLeft",On="ArrowRight",Rn="button",Be="icon",Vt="contain",Et="cover",Ut="Unknown action type",Xt="yarl__";function ie(...e){return e.filter(Boolean).join(" ")}function k(e){return`${Xt}${e}`}function q(e){return`--${Xt}${e}`}function Se(e,t){return`${e}${t?`_${t}`:""}`}function nt(e){return t=>Se(e,t)}function xe(e,t){var o;return(o=e==null?void 0:e[t])!==null&&o!==void 0?o:t}function Nn(e,t,o){return xe(e,"{index} of {total}").replace(/\{index}/g,`${st(o,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function ot(...e){return()=>{e.forEach(t=>{t()})}}function se(e,t,o){return()=>{const r=n.useContext(o);if(!r)throw new Error(`${e} must be used within a ${t}.Provider`);return r}}function rt(){return typeof window<"u"}function it(e,t=0){const o=10**t;return Math.round((e+Number.EPSILON)*o)/o}function me(e){return e.type===void 0||e.type==="image"}function ct(e,t){return e.imageFit===Et||e.imageFit!==Vt&&t===Et}function Ne(e){return typeof e=="string"?Number.parseInt(e,10):e}function Oe(e){if(typeof e=="number")return{pixel:e};if(typeof e=="string"){const t=Ne(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Tn(e,t){const o=Oe(t),r=o.percent!==void 0?e.width/100*o.percent:o.pixel;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function Yt(e){return Number.isFinite(e)?(Math.round(e/90)*90%360+360)%360:0}function kn(){return(rt()?window==null?void 0:window.devicePixelRatio:void 0)||1}function st(e,t){return t>0?(e%t+t)%t:0}function Ht(e){return e.length>0}function Bt(e,t){return e[st(t,e.length)]}function Ke(e,t){return Ht(e)?Bt(e,t):void 0}function Dn(e){return me(e)?e.src:void 0}function An(e,t,o){if(!o)return e;const{buttons:r,...i}=e,s=r.findIndex(l=>l===t),c=n.isValidElement(o)?n.cloneElement(o,{key:t},null):o;if(s>=0){const l=[...r];return l.splice(s,1,c),{buttons:l,...i}}return{buttons:[c,...r],...i}}function Zn(e,t,o=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),o))}const Wn=Number(n.version.split(".")[0])>=19;function $n(e){return{inert:Wn?e:e?"":void 0}}function zn(e){e.scrollTop}const je={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[Ee]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:Vt,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,closeOnEscape:!0,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function ae(e,t){return{name:e,component:t}}function Y(e,t){return{module:e,children:t}}function Kt(e,t,o){return e.module.name===t?o(e):e.children?[Y(e.module,e.children.flatMap(r=>{var i;return(i=Kt(r,t,o))!==null&&i!==void 0?i:[]}))]:[e]}function ve(e,t,o){return e.flatMap(r=>{var i;return(i=Kt(r,t,o))!==null&&i!==void 0?i:[]})}function Fn(e,t=[],o=[]){let r=e;const i=p=>{const g=[...r];for(;g.length>0;){const u=g.pop();if((u==null?void 0:u.module.name)===p)return!0;u!=null&&u.children&&g.push(...u.children)}return!1},s=(p,g)=>{if(p===""){r=[Y(g,r)];return}r=ve(r,p,u=>[Y(g,[u])])},c=(p,g)=>{r=ve(r,p,u=>[Y(u.module,[Y(g,u.children)])])},l=(p,g,u)=>{r=ve(r,p,_=>{var x;return[Y(_.module,[...u?[Y(g)]:[],...(x=_.children)!==null&&x!==void 0?x:[],...u?[]:[Y(g)]])]})},d=(p,g,u)=>{r=ve(r,p,_=>[...u?[Y(g)]:[],_,...u?[]:[Y(g)]])},a=p=>{c(Tt,p)},m=(p,g)=>{r=ve(r,p,u=>[Y(g,u.children)])},f=p=>{r=ve(r,p,g=>g.children)},h=p=>{o.push(p)};return t.forEach(p=>{p({contains:i,addParent:s,append:c,addChild:l,addSibling:d,addModule:a,replace:m,remove:f,augment:h})}),{config:r,augmentation:p=>o.reduce((g,u)=>u(g),p)}}const jt=n.createContext(null),Gt=se("useA11yContext","A11yContext",jt);function Vn({children:e}){const[t,o]=n.useState(!1),[r,i]=n.useState(!1),s=n.useMemo(()=>({focusWithin:t,trackFocusWithin:(l,d)=>{const a=m=>f=>{var h;f.currentTarget.contains(f.relatedTarget)||o(m),(h=m?l:d)===null||h===void 0||h(f)};return{onFocus:a(!0),onBlur:a(!1)}},autoPlaying:r,setAutoPlaying:i}),[t,r]);return n.createElement(jt.Provider,{value:s},e)}const qt=n.createContext(null),Te=se("useDocument","DocumentContext",qt);function Un({nodeRef:e,children:t}){const o=n.useMemo(()=>{const r=s=>{var c;return((c=s||e.current)===null||c===void 0?void 0:c.ownerDocument)||document};return{getOwnerDocument:r,getOwnerWindow:s=>{var c;return((c=r(s))===null||c===void 0?void 0:c.defaultView)||window}}},[e]);return n.createElement(qt.Provider,{value:o},t)}const Qt=n.createContext(null),ke=se("useEvents","EventsContext",Qt);function Xn({children:e}){const[t]=n.useState({});n.useEffect(()=>()=>{Object.keys(t).forEach(r=>delete t[r])},[t]);const o=n.useMemo(()=>{const r=(c,l)=>{var d;(d=t[c])===null||d===void 0||d.splice(0,t[c].length,...t[c].filter(a=>a!==l))};return{publish:(...[c,l])=>{var d;(d=t[c])===null||d===void 0||d.forEach(a=>a(l))},subscribe:(c,l)=>(t[c]||(t[c]=[]),t[c].push(l),()=>r(c,l)),unsubscribe:r}},[t]);return n.createElement(Qt.Provider,{value:o},e)}const Jt=n.createContext(null),te=se("useLightboxProps","LightboxPropsContext",Jt);function Yn({children:e,...t}){return n.createElement(Jt.Provider,{value:t},e)}const en=n.createContext(null),ue=se("useLightboxState","LightboxStateContext",en),tn=n.createContext(null),Hn=se("useLightboxDispatch","LightboxDispatchContext",tn);function Bn(e,t){switch(t.type){case"swipe":{const{slides:o}=e,r=(t==null?void 0:t.increment)||0,i=e.globalIndex+r,s=st(i,o.length),c=Ke(o,s),l=r||t.duration!==void 0?{increment:r,duration:t.duration,easing:t.easing}:void 0;return{slides:o,currentIndex:s,globalIndex:i,currentSlide:c,animation:l}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:Ke(t.slides,t.index)}:e;default:throw new Error(Ut)}}function Kn({slides:e,index:t,children:o}){const[r,i]=n.useReducer(Bn,{slides:e,currentIndex:t,globalIndex:t,currentSlide:Ke(e,t)}),[s,c]=n.useState(e),[l,d]=n.useState(t);(e!==s||t!==l)&&(c(e),d(t),i({type:"update",slides:e,index:t}));const a=n.useMemo(()=>({...r,state:r,dispatch:i}),[r,i]);return n.createElement(tn.Provider,{value:i},n.createElement(en.Provider,{value:a},o))}const nn=n.createContext(null),jn=se("useRTLContext","RTLContext",nn);function Gn({isRTL:e,children:t}){const o=n.useMemo(()=>({isRTL:e}),[e]);return n.createElement(nn.Provider,{value:o},t)}const qn=n.createContext(null);function De(e){const t=n.useContext(qn);return e&&t?Yt(t(e)):0}const on=n.createContext(null),Ae=se("useTimeouts","TimeoutsContext",on);function Qn({children:e}){const[t]=n.useState([]);n.useEffect(()=>()=>{t.forEach(r=>window.clearTimeout(r)),t.splice(0,t.length)},[t]);const o=n.useMemo(()=>{const r=c=>{t.splice(0,t.length,...t.filter(l=>l!==c))};return{setTimeout:(c,l)=>{const d=window.setTimeout(()=>{r(d),c()},l);return t.push(d),d},clearTimeout:c=>{c!==void 0&&(r(c),window.clearTimeout(c))}}},[t]);return n.createElement(on.Provider,{value:o},e)}const lt=n.forwardRef(function({label:t,className:o,icon:r,renderIcon:i,onClick:s,style:c,...l},d){const{styles:a,labels:m}=te(),f=xe(m,t);return n.createElement("button",{ref:d,type:"button",title:f,"aria-label":f,className:ie(k(Rn),o),onClick:s,style:{...c,...a.button},...l},i?i():n.createElement(r,{className:k(Be),style:a.icon}))});function Jn(e,t){const o=r=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...r},t);return o.displayName=e,o}function pe(e,t){return Jn(e,n.createElement("g",{fill:"currentColor"},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}const eo=pe("Close",n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),to=pe("Previous",n.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),no=pe("Next",n.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),oo=pe("Loading",n.createElement(n.Fragment,null,Array.from({length:8}).map((e,t,o)=>n.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/o.length*(t+1),transform:`rotate(${360/o.length*t}, 12, 12)`})))),ro=pe("Error",n.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),ce=rt()?n.useLayoutEffect:n.useEffect;function at(){const[e,t]=n.useState(!1);return n.useEffect(()=>{var o,r;const i=(o=window.matchMedia)===null||o===void 0?void 0:o.call(window,"(prefers-reduced-motion: reduce)");t(i==null?void 0:i.matches);const s=c=>t(c.matches);return(r=i==null?void 0:i.addEventListener)===null||r===void 0||r.call(i,"change",s),()=>{var c;return(c=i==null?void 0:i.removeEventListener)===null||c===void 0?void 0:c.call(i,"change",s)}},[]),e}function io(e){let t=0,o=0,r=0;const s=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(s){const c=s[1].split(",").map(Ne);c.length===6?(t=c[4],o=c[5]):c.length===16&&(t=c[12],o=c[13],r=c[14])}return{x:t,y:o,z:r}}function xt(e,t){const o=n.useRef(void 0),r=n.useRef(void 0),i=at();return ce(()=>{var s,c,l;if(e.current&&o.current!==void 0&&!i){const{keyframes:d,duration:a,easing:m,onfinish:f}=t(o.current,e.current.getBoundingClientRect(),io(e.current))||{};if(d&&a){(s=r.current)===null||s===void 0||s.cancel(),r.current=void 0;try{r.current=(l=(c=e.current).animate)===null||l===void 0?void 0:l.call(c,d,{duration:a,easing:m})}catch(h){console.error(h)}r.current&&(r.current.onfinish=()=>{r.current=void 0,f==null||f()})}}o.current=void 0}),{prepareAnimation:s=>{o.current=s},isAnimationPlaying:()=>{var s;return((s=r.current)===null||s===void 0?void 0:s.playState)==="running"}}}function rn(){const e=n.useRef(null),t=n.useRef(void 0),[o,r]=n.useState();return{setContainerRef:n.useCallback(s=>{e.current=s,t.current&&(t.current.disconnect(),t.current=void 0);const c=()=>{if(s){const l=window.getComputedStyle(s),d=a=>parseFloat(a)||0;r({width:Math.round(s.clientWidth-d(l.paddingLeft)-d(l.paddingRight)),height:Math.round(s.clientHeight-d(l.paddingTop)-d(l.paddingBottom))})}else r(void 0)};c(),s&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(c),t.current.observe(s))},[]),containerRef:e,containerRect:o}}function Ie(){const e=n.useRef(void 0),{setTimeout:t,clearTimeout:o}=Ae();return n.useCallback((r,i)=>{o(e.current),e.current=t(r,i>0?i:0)},[t,o])}function A(e){const t=n.useRef(e);return ce(()=>{t.current=e}),n.useCallback((...o)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...o)},[])}function bt(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Ge(e,t){return n.useMemo(()=>e==null&&t==null?null:o=>{bt(e,o),bt(t,o)},[e,t])}function co(e,t=!1){const o=n.useRef(!1);ce(()=>{t&&o.current&&(o.current=!1,e())},[t,e]);const r=n.useCallback(()=>{o.current=!0},[]),i=n.useCallback(()=>{o.current=!1},[]);return{onFocus:r,onBlur:i}}function ut(){return jn().isRTL}function so(){const[e]=n.useState({}),t=n.useCallback((i,s)=>{var c;(c=e[i])===null||c===void 0||c.forEach(l=>{s.isPropagationStopped()||l(s)})},[e]),o=n.useMemo(()=>({onPointerDown:i=>t(Zt,i),onPointerMove:i=>t(Wt,i),onPointerUp:i=>t($t,i),onPointerLeave:i=>t(zt,i),onPointerCancel:i=>t(Ft,i),onKeyDown:i=>t(et,i),onKeyUp:i=>t(Ln,i),onWheel:i=>t(tt,i)}),[t]),r=n.useCallback((i,s)=>(e[i]||(e[i]=[]),e[i].unshift(s),()=>{const c=e[i];c&&c.splice(0,c.length,...c.filter(l=>l!==s))}),[e]);return{registerSensors:o,subscribeSensors:r}}function wt(e,t){const o=n.useRef(0),r=Ie(),i=A((...s)=>{o.current=Date.now(),e(...s)});return n.useCallback((...s)=>{r(()=>{i(...s)},t-(Date.now()-o.current))},[t,i,r])}const Xe=nt("slide"),Ye=nt("slide_image");function Re({slide:e,offset:t,render:o,rect:r,rotation:i=0,imageFit:s,imageProps:c,onClick:l,onLoad:d,onError:a,style:m}){var f,h,p,g,u,_,x,M;const[L,R]=n.useState(Fe),{publish:P}=ke(),{setTimeout:N}=Ae(),y=n.useRef(null);n.useEffect(()=>{t===0&&P(_n(L))},[t,L,P]);const T=A(W=>{("decode"in W?W.decode():Promise.resolve()).catch(()=>{}).then(()=>{W.parentNode&&(R(Ue),N(()=>{d==null||d(W)},0))})}),v=n.useCallback(W=>{y.current=W,W!=null&&W.complete&&T(W)},[T]),I=n.useCallback(W=>{T(W.currentTarget)},[T]),Z=A(()=>{R(Ve),a==null||a()}),U=ct(e,s),w=Yt(i),S=w%180!==0,b=r&&S?{width:r.height,height:r.width}:r,F=S&&b?`${b.width}px`:"100%",$=S&&b?`${b.height}px`:"100%",C=(W,ge)=>Number.isFinite(W)?W:ge,D=C(Math.max(...((h=(f=e.srcSet)===null||f===void 0?void 0:f.map(W=>W.width))!==null&&h!==void 0?h:[]).concat(e.width?[e.width]:[]).filter(Boolean)),((p=y.current)===null||p===void 0?void 0:p.naturalWidth)||0),O=C(Math.max(...((u=(g=e.srcSet)===null||g===void 0?void 0:g.map(W=>W.height))!==null&&u!==void 0?u:[]).concat(e.height?[e.height]:[]).filter(Boolean)),((_=y.current)===null||_===void 0?void 0:_.naturalHeight)||0),X=D&&O?{maxWidth:`min(${D}px, ${F})`,maxHeight:`min(${O}px, ${$})`}:{maxWidth:F,maxHeight:$},V=b&&D&&O?Math.min(b.width/D,b.height/O,1):0,H=S&&b?U?{width:b.width,height:b.height}:V?{width:D*V,height:O*V}:null:null,B=(x=e.srcSet)===null||x===void 0?void 0:x.slice().sort((W,ge)=>W.width-ge.width).map(W=>`${W.src} ${W.width}w`).join(", "),Q=(()=>{if(b)return!e.width||!e.height?b.width:(U?Math.max:Math.min)(b.height/e.height*e.width,b.width)})(),J=B&&Q!==void 0&&rt()?`${Math.round(Q)}px`:void 0,{style:be,className:Me,...we}=(typeof c=="function"?c(e):c)||{};return n.createElement(n.Fragment,null,n.createElement("img",{ref:v,onLoad:I,onError:Z,onClick:l,draggable:!1,className:ie(k(Ye()),U&&k(Ye("cover")),L!==Ue&&k(Ye("loading")),Me),style:{...X,...w?{rotate:`${w}deg`}:null,...S?{flexShrink:0}:null,...H,...m,...be},...we,alt:(M=e.alt)!==null&&M!==void 0?M:"",sizes:J,srcSet:B,src:e.src}),L!==Ue&&n.createElement("div",{className:k(Xe(Cn))},L===Fe&&(o!=null&&o.iconLoading?o.iconLoading():n.createElement(oo,{className:ie(k(Be),k(Xe(Fe)))})),L===Ve&&(o!=null&&o.iconError?o.iconError():n.createElement(ro,{className:ie(k(Be),k(Xe(Ve)))}))))}const lo=n.forwardRef(function({className:t,children:o,onFocus:r,onBlur:i,...s},c){const l=n.useRef(null),[d,a]=n.useState(!1),{trackFocusWithin:m}=Gt(),f=A(()=>{if(l.current){const h=window.getComputedStyle(l.current).direction==="rtl";h!==d&&a(h)}});return n.useEffect(f),n.createElement(Un,{nodeRef:l},n.createElement(Gn,{isRTL:d},n.createElement("div",{ref:Ge(c,l),className:ie(k("root"),t),...m(r,i),...s},o)))});var K;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"})(K||(K={}));function cn(e,t,o,r,i){n.useEffect(()=>i?()=>{}:ot(e(Zt,t),e(Wt,o),e($t,r),e(zt,r),e(Ft,r)),[e,t,o,r,i])}var ne;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"})(ne||(ne={}));const He=30;function ao({disableSwipeNavigation:e,closeOnBackdropClick:t},o,r,i,s,c,l,d,a,m,f,h,p,g,u,_){const x=n.useRef(0),M=n.useRef([]),L=n.useRef(void 0),R=n.useRef(0),P=n.useRef(ne.NONE),N=n.useCallback(w=>{L.current===w.pointerId&&(L.current=void 0,P.current=ne.NONE);const S=M.current;S.splice(0,S.length,...S.filter(b=>b.pointerId!==w.pointerId))},[]),y=n.useCallback(w=>{N(w),w.persist(),M.current.push(w)},[N]),T=n.useCallback(w=>M.current.find(({pointerId:S})=>w.pointerId===S),[]),v=A(w=>{y(w)}),I=(w,S)=>f&&w>S||m&&w<-S,Z=A(w=>{const S=T(w);if(S)if(L.current===w.pointerId){const b=Date.now()-R.current,F=x.current;P.current===ne.SWIPE?Math.abs(F)>.3*i||Math.abs(F)>5&&b<s?d(F,b):a(F):P.current===ne.PULL&&(I(F,2*He)?g(F,b):u(F)),x.current=0,P.current=ne.NONE}else{const{target:b}=w;t&&b instanceof HTMLElement&&b===S.target&&(b.classList.contains(k(Je))||b.classList.contains(k(At)))&&_()}N(w)}),U=A(w=>{const S=T(w);if(S){const b=L.current===w.pointerId;if(w.buttons===0){b&&x.current!==0?Z(w):N(S);return}const F=w.clientX-S.clientX,$=w.clientY-S.clientY;if(L.current===void 0){const C=D=>{y(w),L.current=w.pointerId,R.current=Date.now(),P.current=D};Math.abs(F)>Math.abs($)&&Math.abs(F)>He&&r(F)?e||(C(ne.SWIPE),c()):Math.abs($)>Math.abs(F)&&I($,He)&&(C(ne.PULL),h())}else b&&(P.current===ne.SWIPE?(x.current=F,l(F)):P.current===ne.PULL&&(x.current=$,p($)))}});cn(o,v,U,Z)}function uo({preventDefaultWheelX:e,preventDefaultWheelY:t}){const o=n.useRef(null),r=A(i=>{const s=Math.abs(i.deltaX)>Math.abs(i.deltaY);(s&&e||!s&&t||i.ctrlKey)&&i.preventDefault()});return n.useCallback(i=>{var s;i?i.addEventListener("wheel",r,{passive:!1}):(s=o.current)===null||s===void 0||s.removeEventListener("wheel",r),o.current=i},[r])}function fo(e,t,o,r,i,s,c,l,d){const a=n.useRef(0),m=n.useRef(0),f=n.useRef(void 0),h=n.useRef(void 0),p=n.useRef(0),g=n.useRef(void 0),u=n.useRef(0),{setTimeout:_,clearTimeout:x}=Ae(),M=n.useCallback(()=>{f.current&&(x(f.current),f.current=void 0)},[x]),L=n.useCallback(()=>{h.current&&(x(h.current),h.current=void 0)},[x]),R=A(()=>{e!==K.SWIPE&&(a.current=0,u.current=0,M(),L())});n.useEffect(R,[e,R]);const P=A(y=>{h.current=void 0,a.current===y&&d(a.current)}),N=A(y=>{if(y.ctrlKey||Math.abs(y.deltaY)>Math.abs(y.deltaX))return;const T=v=>{p.current=v,x(g.current),g.current=v>0?_(()=>{p.current=0,g.current=void 0},300):void 0};if(e===K.NONE){if(Math.abs(y.deltaX)<=1.2*Math.abs(p.current)){T(y.deltaX);return}if(!o(-y.deltaX))return;if(m.current+=y.deltaX,M(),Math.abs(m.current)>30)m.current=0,T(0),u.current=Date.now(),s();else{const v=m.current;f.current=_(()=>{f.current=void 0,v===m.current&&(m.current=0)},i)}}else if(e===K.SWIPE){let v=a.current-y.deltaX;if(v=Math.min(Math.abs(v),r)*Math.sign(v),a.current=v,c(v),L(),Math.abs(v)>.2*r){T(y.deltaX),l(v,Date.now()-u.current);return}h.current=_(()=>P(v),2*i)}else T(y.deltaX)});n.useEffect(()=>t(tt,N),[t,N])}const Ct=nt("container"),sn=n.createContext(null),le=se("useController","ControllerContext",sn);function ho({children:e,...t}){var o;const{carousel:r,animation:i,controller:s,on:c,styles:l,render:d}=t,{closeOnPullUp:a,closeOnPullDown:m,preventDefaultWheelX:f,preventDefaultWheelY:h}=s,[p,g]=n.useState(),u=ue(),_=Hn(),[x,M]=n.useState(K.NONE),L=n.useRef(0),R=n.useRef(0),P=n.useRef(1),{registerSensors:N,subscribeSensors:y}=so(),{subscribe:T,publish:v}=ke(),I=Ie(),Z=Ie(),U=Ie(),{containerRef:w,setContainerRef:S,containerRect:b}=rn(),F=Ge(uo({preventDefaultWheelX:f,preventDefaultWheelY:h}),S),$=n.useRef(null),C=Ge($,void 0),{getOwnerDocument:D}=Te(),O=ut(),X=E=>(O?-1:1)*(typeof E=="number"?E:1),V=A(()=>{var E;return(E=w.current)===null||E===void 0?void 0:E.focus()}),H=A(()=>t),B=A(()=>u),G=n.useCallback(E=>v(fe,E),[v]),Q=n.useCallback(E=>v(he,E),[v]),J=n.useCallback(()=>v(Ee),[v]),be=E=>!(r.finite&&(X(E)>0&&u.currentIndex===0||X(E)<0&&u.currentIndex===u.slides.length-1)),Me=E=>{var z;L.current=E,(z=w.current)===null||z===void 0||z.style.setProperty(q("swipe_offset"),`${Math.round(E)}px`)},we=E=>{var z,j;R.current=E,P.current=(()=>{const _e=m&&E>0?E:a&&E<0?-E:0;return Math.min(Math.max(it(1-_e/60*(1-.5),2),.5),1)})(),(z=w.current)===null||z===void 0||z.style.setProperty(q("pull_offset"),`${Math.round(E)}px`),(j=w.current)===null||j===void 0||j.style.setProperty(q("pull_opacity"),`${P.current}`)},{prepareAnimation:W}=xt($,(E,z,j)=>{if($.current&&b)return{keyframes:[{transform:`translate(0, ${E.rect.y-z.y+j.y}px)`,opacity:E.opacity},{transform:"translate(0, 0)",opacity:1}],duration:E.duration,easing:i.easing.fade}}),ge=(E,z)=>{if(a||m){we(E);let j=0;$.current&&(j=i.fade*(z?2:1),W({rect:$.current.getBoundingClientRect(),opacity:P.current,duration:j})),U(()=>{we(0),M(K.NONE)},j),M(K.ANIMATION),z||J()}},{prepareAnimation:hn,isAnimationPlaying:mn}=xt($,(E,z,j)=>{var oe;if($.current&&b&&(!((oe=u.animation)===null||oe===void 0)&&oe.duration)){const ee=Oe(r.spacing),_e=(ee.percent?ee.percent*b.width/100:ee.pixel)||0;return{keyframes:[{transform:`translate(${X(u.globalIndex-E.index)*(b.width+_e)+E.rect.x-z.x+j.x}px, 0)`},{transform:"translate(0, 0)"}],duration:u.animation.duration,easing:u.animation.easing}}}),Ce=A(E=>{var z,j;const oe=E.offset||0,ee=oe?i.swipe:(z=i.navigation)!==null&&z!==void 0?z:i.swipe,_e=!oe&&!mn()?i.easing.navigation:i.easing.swipe;let{direction:Le}=E;const ye=(j=E.count)!==null&&j!==void 0?j:1;let We=K.ANIMATION,re=ee*ye;if(!Le){const Pe=b==null?void 0:b.width,pt=E.duration||0,ze=Pe?ee/Pe*Math.abs(oe):ee;ye!==0?(pt<ze?re=re/ze*Math.max(pt,ze/5):Pe&&(re=ee/Pe*(Pe-Math.abs(oe))),Le=X(oe)>0?fe:he):re=ee/2}let $e=0;Le===fe?be(X(1))?$e=-ye:(We=K.NONE,re=ee):Le===he&&(be(X(-1))?$e=ye:(We=K.NONE,re=ee)),re=Math.round(re),Z(()=>{Me(0),M(K.NONE)},re),$.current&&hn({rect:$.current.getBoundingClientRect(),index:u.globalIndex}),M(We),v(vt,{type:"swipe",increment:$e,duration:re,easing:_e})});n.useEffect(()=>{var E,z;!((E=u.animation)===null||E===void 0)&&E.increment&&(!((z=u.animation)===null||z===void 0)&&z.duration)&&I(()=>_({type:"swipe",increment:0}),u.animation.duration)},[u.animation,_,I]);const ft=[y,be,(b==null?void 0:b.width)||0,i.swipe,()=>M(K.SWIPE),E=>Me(E),(E,z)=>Ce({offset:E,duration:z,count:1}),E=>Ce({offset:E,count:0})],pn=[()=>{m&&M(K.PULL)},E=>we(E),E=>ge(E),E=>ge(E,!0)];ao(s,...ft,a,m,...pn,J),fo(x,...ft);const ht=A(()=>{s.focus&&D().querySelector(`.${k(qe)} .${k(Ct())}`)&&V()});n.useEffect(ht,[ht]);const mt=A(()=>{var E;(E=c.view)===null||E===void 0||E.call(c,{index:u.currentIndex})});n.useEffect(mt,[u.globalIndex,mt]),n.useEffect(()=>ot(T(fe,E=>Ce({direction:fe,...E})),T(he,E=>Ce({direction:he,...E})),T(vt,E=>_(E))),[T,Ce,_]);const gn=n.useMemo(()=>({prev:G,next:Q,close:J,focus:V,slideRect:b?Tn(b,r.padding):{width:0,height:0},containerRect:b||{width:0,height:0},subscribeSensors:y,containerRef:w,setCarouselRef:C,toolbarWidth:p,setToolbarWidth:g}),[G,Q,J,V,y,b,w,C,p,g,r.padding]);return n.useImperativeHandle(s.ref,()=>({prev:G,next:Q,close:J,focus:V,getLightboxProps:H,getLightboxState:B}),[G,Q,J,V,H,B]),n.createElement("div",{ref:F,className:ie(k(Ct()),k(Qe)),style:{...x===K.SWIPE?{[q("swipe_offset")]:`${Math.round(L.current)}px`}:null,...x===K.PULL?{[q("pull_offset")]:`${Math.round(R.current)}px`,[q("pull_opacity")]:`${P.current}`}:null,...s.touchAction!=="none"?{[q("controller_touch_action")]:s.touchAction}:null,...l.container},tabIndex:-1,...N},b&&n.createElement(sn.Provider,{value:gn},e,(o=d.controls)===null||o===void 0?void 0:o.call(d)))}const mo=ae(Tt,ho);function de(e){return Se(Nt,e)}function _t(e){return Se(Je,e)}function po({slide:e,offset:t}){const o=n.useRef(null),{currentIndex:r,slides:i}=ue(),{slideRect:s,focus:c}=le(),{render:l,carousel:{imageFit:d,imageProps:a},on:{click:m},styles:{slide:f},labels:h}=te(),{getOwnerDocument:p}=Te(),g=De(e),u=t!==0;n.useEffect(()=>{var x;u&&(!((x=o.current)===null||x===void 0)&&x.contains(p().activeElement))&&c()},[u,c,p]);const _=()=>{var x,M,L,R;let P=(x=l.slide)===null||x===void 0?void 0:x.call(l,{slide:e,offset:t,rect:s});return!P&&me(e)&&(P=n.createElement(Re,{slide:e,offset:t,render:l,rect:s,rotation:g,imageFit:d,imageProps:a,onClick:u?void 0:()=>m==null?void 0:m({index:r})})),P?n.createElement(n.Fragment,null,(M=l.slideHeader)===null||M===void 0?void 0:M.call(l,{slide:e}),((L=l.slideContainer)!==null&&L!==void 0?L:(({children:N})=>N))({slide:e,children:P}),(R=l.slideFooter)===null||R===void 0?void 0:R.call(l,{slide:e})):null};return n.createElement("div",{ref:o,className:ie(k(_t()),!u&&k(_t("current")),k(Qe)),...$n(u),style:f,role:"group","aria-roledescription":xe(h,"Slide"),"aria-label":Nn(h,i,r+t)},_())}function go(){const e=te().styles.slide;return n.createElement("div",{className:k(Je),style:e})}function vo({carousel:e,labels:t}){const{slides:o,currentIndex:r,globalIndex:i}=ue(),{setCarouselRef:s}=le(),{autoPlaying:c,focusWithin:l}=Gt(),d=Oe(e.spacing),a=Oe(e.padding),m=Zn(e,o,1),f=[];if(Ht(o))for(let h=r-m;h<=r+m;h+=1){const p=Bt(o,h),g=i-r+h,u=e.finite&&(h<0||h>o.length-1);f.push(u?{key:g}:{key:[`${g}`,Dn(p)].filter(Boolean).join("|"),offset:h-r,slide:p})}return n.createElement("div",{ref:s,className:ie(k(de()),f.length>0&&k(de("with_slides"))),style:{[`${q(de("slides_count"))}`]:f.length,[`${q(de("spacing_px"))}`]:d.pixel||0,[`${q(de("spacing_percent"))}`]:d.percent||0,[`${q(de("padding_px"))}`]:a.pixel||0,[`${q(de("padding_percent"))}`]:a.percent||0},role:"region","aria-live":c&&!l?"off":"polite","aria-roledescription":xe(t,"Carousel"),"aria-label":xe(t,"Photo gallery")},f.map(({key:h,slide:p,offset:g})=>p?n.createElement(po,{key:h,slide:p,offset:g}):n.createElement(go,{key:h})))}const Eo=ae(Nt,vo);function ln(){const{carousel:e}=te(),{slides:t,currentIndex:o}=ue(),r=t.length===0||e.finite&&o===0,i=t.length===0||e.finite&&o===t.length-1;return{prevDisabled:r,nextDisabled:i}}function xo(e){var t;const o=ut(),{publish:r}=ke(),{animation:i,controller:s}=te(),{prevDisabled:c,nextDisabled:l}=ln(),d=((t=i.navigation)!==null&&t!==void 0?t:i.swipe)/2,a=wt(()=>r(fe),d),m=wt(()=>r(he),d),f=A(h=>{switch(h.key){case yn:if(!s.closeOnEscape)return;r(Ee);break;case In:(o?l:c)||(o?m:a)();break;case On:(o?c:l)||(o?a:m)();break;default:return}h.stopPropagation()});n.useEffect(()=>e(et,f),[e,f])}function Pt({label:e,icon:t,renderIcon:o,action:r,onClick:i,disabled:s,style:c}){return n.createElement(lt,{label:e,icon:t,renderIcon:o,className:k(`navigation_${r}`),disabled:s,onClick:i,style:c,...co(le().focus,s)})}function bo({render:{buttonPrev:e,buttonNext:t,iconPrev:o,iconNext:r},styles:i}){const{prev:s,next:c,subscribeSensors:l}=le(),{prevDisabled:d,nextDisabled:a}=ln();return xo(l),n.createElement(n.Fragment,null,e?e():n.createElement(Pt,{label:"Previous",action:fe,icon:to,renderIcon:o,style:i.navigationPrev,disabled:d,onClick:s}),t?t():n.createElement(Pt,{label:"Next",action:he,icon:no,renderIcon:r,style:i.navigationNext,disabled:a,onClick:c}))}const wo=ae(xn,bo),St=k(Sn),Co=k(Dt);function _o(e){return"style"in e}function Mt(e,t,o){const r=window.getComputedStyle(e),i=o?"padding-left":"padding-right",s=o?r.paddingLeft:r.paddingRight,c=e.style.getPropertyValue(i);return e.style.setProperty(i,`${(Ne(s)||0)+t}px`),()=>{c?e.style.setProperty(i,c):e.style.removeProperty(i)}}function Po({noScroll:{disabled:e},children:t}){const o=ut(),{getOwnerDocument:r,getOwnerWindow:i}=Te();return n.useEffect(()=>{if(e)return()=>{};const s=[],c=i(),{body:l,documentElement:d}=r(),a=Math.round(c.innerWidth-d.clientWidth);if(a>0){s.push(Mt(l,a,o));const m=l.getElementsByTagName("*");for(let f=0;f<m.length;f+=1){const h=m[f];_o(h)&&c.getComputedStyle(h).getPropertyValue("position")==="fixed"&&!h.classList.contains(Co)&&s.push(Mt(h,a,o))}}return l.classList.add(St),()=>{l.classList.remove(St),s.forEach(m=>m())}},[o,e,r,i]),n.createElement(n.Fragment,null,t)}const So=ae(bn,Po);function Lt(e){return Se(qe,e)}function yt(e,t,o){const r=e.getAttribute(t);return e.setAttribute(t,o),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}function Mo({portal:{root:e,container:{className:t,style:o,...r}={}},animation:i,styles:s,className:c,on:l,close:d,labels:a,children:m}){const[f,h]=n.useState(!1),[p,g]=n.useState(!1),u=n.useRef([]),_=n.useRef(null),{setTimeout:x}=Ae(),{subscribe:M}=ke(),R=at()?0:i.fade;n.useEffect(()=>(h(!0),()=>{h(!1),g(!1)}),[]);const P=A(()=>{u.current.forEach(v=>v()),u.current=[]}),N=A(()=>{var v;g(!1),P(),(v=l.exiting)===null||v===void 0||v.call(l),x(()=>{var I;(I=l.exited)===null||I===void 0||I.call(l),d()},R)});n.useEffect(()=>M(Ee,N),[M,N]);const y=A(v=>{var I,Z,U;zn(v),g(!0),(I=l.entering)===null||I===void 0||I.call(l);const w=(U=(Z=v.parentNode)===null||Z===void 0?void 0:Z.children)!==null&&U!==void 0?U:[];for(let S=0;S<w.length;S+=1){const b=w[S];["TEMPLATE","SCRIPT","STYLE"].indexOf(b.tagName)===-1&&b!==v&&(u.current.push(yt(b,"inert","")),u.current.push(yt(b,"aria-hidden","true")))}u.current.push(()=>{var S,b;(b=(S=_.current)===null||S===void 0?void 0:S.focus)===null||b===void 0||b.call(S)}),x(()=>{var S;(S=l.entered)===null||S===void 0||S.call(l)},R)}),T=n.useCallback(v=>{v?y(v):P()},[y,P]);return f?En.createPortal(n.createElement(lo,{ref:T,className:ie(c,t,k(Lt()),k(Dt),p&&k(Lt("open"))),"aria-modal":!0,role:"dialog","aria-label":xe(a,"Lightbox"),style:{...i.fade!==je.animation.fade?{[q("fade_animation_duration")]:`${R}ms`}:null,...i.easing.fade!==je.animation.easing.fade?{[q("fade_animation_timing_function")]:i.easing.fade}:null,...s.root,...o},onFocus:v=>{_.current||(_.current=v.relatedTarget)},...r},m),(typeof e=="function"?e():e)||document.body):null}const Lo=ae(qe,Mo);function yo({children:e}){return n.createElement(n.Fragment,null,e)}const Io=ae(wn,yo);function Oo(e){return Se(kt,e)}function Ro({toolbar:{buttons:e},render:{buttonClose:t,iconClose:o},styles:r}){const{close:i,setToolbarWidth:s}=le(),{setContainerRef:c,containerRect:l}=rn();ce(()=>{s(l==null?void 0:l.width)},[s,l==null?void 0:l.width]);const d=()=>t?t():n.createElement(lt,{key:Ee,label:"Close",icon:eo,renderIcon:o,onClick:i});return n.createElement("div",{ref:c,style:r.toolbar,className:k(Oo())},e==null?void 0:e.map(a=>a===Ee?d():a))}const No=ae(kt,Ro);function an(e,t){var o;return n.createElement(e.module.component,{key:e.module.name,...t},(o=e.children)===null||o===void 0?void 0:o.map(r=>an(r,t)))}function To(e,t={}){const{easing:o,...r}=e,{easing:i,...s}=t;return{easing:{...o,...i},...r,...s}}function ko({carousel:e,animation:t,render:o,toolbar:r,controller:i,noScroll:s,on:c,plugins:l,slides:d,index:a,...m}){const{animation:f,carousel:h,render:p,toolbar:g,controller:u,noScroll:_,on:x,slides:M,index:L,plugins:R,...P}=je,{config:N,augmentation:y}=Fn([Y(Lo,[Y(So,[Y(mo,[Y(Eo),Y(No),Y(wo)])])])],l||R),T=y({animation:To(f,t),carousel:{...h,...e},render:{...p,...o},toolbar:{...g,...r},controller:{...u,...i},noScroll:{..._,...s},on:{...x,...c},...P,...m});return T.open?n.createElement(Yn,{...T},n.createElement(Kn,{slides:d||M,index:Ne(a||L)},n.createElement(Qn,null,n.createElement(Xn,null,n.createElement(Vn,null,an(Y(Io,N),T)))))):null}const un={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1,maxZoom:8};function Do(e){return Math.min(Math.max(e,Number.EPSILON),1)}function dn(e){const{minZoom:t,...o}={...un,...e};return{minZoom:Do(t),...o}}function Ao(e,t,o,r){const i=n.useRef(void 0),s=n.useRef(void 0),{zoom:c}=te().animation,l=at(),d=A(()=>{var a,m,f;if((a=i.current)===null||a===void 0||a.cancel(),i.current=void 0,s.current&&(r!=null&&r.current)){try{i.current=(f=(m=r.current).animate)===null||f===void 0?void 0:f.call(m,[{transform:s.current},{transform:`scale(${e}) translateX(${t}px) translateY(${o}px)`}],{duration:l?0:c??500,easing:i.current?"ease-out":"ease-in-out"})}catch(h){console.error(h)}s.current=void 0,i.current&&(i.current.onfinish=()=>{i.current=void 0})}});return ce(d,[e,t,o,d]),n.useCallback(()=>{s.current=r!=null&&r.current?window.getComputedStyle(r.current).transform:void 0},[r])}function Zo(e,t){const{on:o}=te(),r=A(()=>{var i;t||(i=o.zoom)===null||i===void 0||i.call(o,{zoom:e})});n.useEffect(r,[e,r])}function Ze(){const{zoom:e}=te();return dn(e)}function Wo(e,t){var o;const r=typeof e=="function"?(o=e(t))!==null&&o!==void 0?o:un.maxZoom:e;return Math.max(r,1)}function $o(e,t){var o,r;let i={width:0,height:0},s={width:0,height:0};const{currentSlide:c}=ue(),l=De(c),{imageFit:d}=te().carousel,{maxZoomPixelRatio:a,maxZoom:m}=Ze();if(e&&c){const h={...c,...t};if(me(h)){const p=ct(h,d),g=Math.max(...(((o=h.srcSet)===null||o===void 0?void 0:o.map(L=>L.width))||[]).concat(h.width?[h.width]:[])),u=Math.max(...(((r=h.srcSet)===null||r===void 0?void 0:r.map(L=>L.height))||[]).concat(h.height?[h.height]:[])),_=l%180!==0,x=_?u:g,M=_?g:u;x>0&&M>0&&e.width>0&&e.height>0&&(s=p?{width:Math.round(Math.min(x,e.width/e.height*M)),height:Math.round(Math.min(M,e.height/e.width*x))}:{width:x,height:M},s={width:s.width*a,height:s.height*a},i=p?{width:Math.min(e.width,s.width,x),height:Math.min(e.height,s.height,M)}:{width:Math.round(Math.min(e.width,e.height/M*x,x)),height:Math.round(Math.min(e.height,e.width/x*M,M))})}else e.width>0&&e.height>0&&(t&&t.width>0&&t.height>0?i={width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}:i={width:e.width,height:e.height})}const f=c&&i.width?me(c)?Math.max(it(s.width/i.width,5),1):Wo(m,c):1;return{imageRect:i,maxZoom:f}}function It(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function Ot(e,t,o=100,r=2){return e*Math.min(1+Math.abs(t/o),r)**Math.sign(t)}function zo(e,t,o,r,i,s,c,l,d){const a=n.useRef([]),m=n.useRef(0),f=n.useRef(void 0),{globalIndex:h}=ue(),{getOwnerWindow:p}=Te(),{containerRef:g,subscribeSensors:u}=le(),{keyboardMoveDistance:_,zoomInMultiplier:x,wheelZoomDistanceFactor:M,scrollToZoom:L,doubleTapDelay:R,doubleClickDelay:P,doubleClickMaxStops:N,pinchZoomDistanceFactor:y,pinchZoomV4:T}=Ze(),v=n.useCallback(C=>{if(g.current){const{pageX:D,pageY:O}=C,{scrollX:X,scrollY:V}=p(),{left:H,top:B,width:G,height:Q}=g.current.getBoundingClientRect();return[D-H-X-G/2,O-B-V-Q/2]}return[]},[g,p]),I=A(C=>{const D=e(),{key:O,metaKey:X,ctrlKey:V}=C,H=X||V,B=()=>{C.preventDefault(),C.stopPropagation()};if(D>1){const G=(Q,J)=>{B(),l(Q,J)};O==="ArrowDown"?G(0,_):O==="ArrowUp"?G(0,-_):O==="ArrowLeft"?G(-_,0):O==="ArrowRight"&&G(_,0)}O==="+"||H&&O==="="?(B(),i()):O==="-"||H&&O==="_"?(B(),s()):H&&O==="0"&&(B(),c(1))}),Z=A(C=>{const D=e();if((C.ctrlKey||L)&&Math.abs(C.deltaY)>Math.abs(C.deltaX)){C.stopPropagation(),c(Ot(D,-C.deltaY,M),!0,...v(C));return}D>1&&(C.stopPropagation(),L||l(C.deltaX,C.deltaY))}),U=n.useCallback(C=>{const D=a.current;D.splice(0,D.length,...D.filter(O=>O.pointerId!==C.pointerId))},[]),w=n.useCallback(C=>{U(C),C.persist(),a.current.push(C)},[U]),S=A(C=>{var D;const O=e(),X=a.current;if(C.pointerType==="mouse"&&C.buttons>1||!(!((D=d==null?void 0:d.current)===null||D===void 0)&&D.contains(C.target)))return;O>1&&C.stopPropagation();const{timeStamp:V}=C;if(X.length===0&&V-m.current<(C.pointerType==="touch"?R:P)){m.current=0;const H=O>=1?O!==o?O*Math.max(o**(1/N),x):1:O!==t?O/Math.max(t**(-1/N),x):1;c(H,!1,...v(C))}else m.current=V;if(w(C),X.length===2){const H=It(X[0],X[1]);f.current={previousDistance:H,initialDistance:Math.max(H,1),initialZoom:O}}}),b=A(C=>{const D=e(),O=a.current,X=O.find(V=>V.pointerId===C.pointerId);if(O.length===2&&f.current){C.stopPropagation(),w(C);const V=It(O[0],O[1]),H=T?f.current.initialZoom/f.current.initialDistance*V:Ot(D,V-f.current.previousDistance,y);c(H,!0,...O.map(B=>v(B)).reduce((B,G)=>G.map((Q,J)=>B[J]+Q/2))),f.current.previousDistance=V;return}D>1&&(C.stopPropagation(),X&&(O.length===1&&l((X.clientX-C.clientX)/D,(X.clientY-C.clientY)/D),w(C)))}),F=n.useCallback(C=>{const D=a.current;D.length===2&&D.find(O=>O.pointerId===C.pointerId)&&(f.current=void 0),U(C)},[U]),$=n.useCallback(()=>{const C=a.current;C.splice(0,C.length),m.current=0,f.current=void 0},[]);cn(u,S,b,F,r),n.useEffect($,[h,$]),n.useEffect(()=>r?()=>{}:ot($,u(et,I),u(tt,Z)),[r,u,$,I,Z])}function Fo(e,t,o){const[r,i]=n.useState(1),[s,c]=n.useState(0),[l,d]=n.useState(0),a=n.useRef({zoom:r,offsetX:s,offsetY:l}),m=Ao(r,s,l,o),{currentSlide:f,globalIndex:h}=ue(),{containerRect:p,slideRect:g}=le(),{minZoom:u,zoomInMultiplier:_}=Ze(),x=f&&me(f)?f.src:void 0,M=De(f),L=!(o!=null&&o.current);ce(()=>{a.current={zoom:1,offsetX:0,offsetY:0},i(1),c(0),d(0)},[h,x,M]);const R=n.useCallback((I,Z,U)=>{const w=U||a.current.zoom,S=a.current.offsetX-(I||0),b=a.current.offsetY-(Z||0),F=(e.width*w-g.width)/2/w,$=(e.height*w-g.height)/2/w;a.current.offsetX=Math.min(Math.abs(S),Math.max(F,0))*Math.sign(S),a.current.offsetY=Math.min(Math.abs(b),Math.max($,0))*Math.sign(b),c(a.current.offsetX),d(a.current.offsetY)},[g,e.width,e.height]),P=n.useCallback((I,Z,U,w)=>{const S=it(I+.01<t?I-.01>u?I:u:t,5);Z||m();const{zoom:b}=a.current;R(U?U*(1/b-1/S):0,w?w*(1/b-1/S):0,S),a.current.zoom=S,i(S)},[u,t,R,m]),N=n.useCallback(()=>a.current.zoom,[]),y=A(()=>{const I=N();I>1&&(I>t&&P(t,!0),R())});ce(y,[p.width,p.height,y]);const T=n.useCallback(()=>{const I=N(),Z=I*_;P(I<1&&Z>1?1:Z)},[_,N,P]),v=n.useCallback(()=>{const I=N(),Z=I/_;P(I>1&&Z<1?1:Z)},[_,N,P]);return{zoom:r,offsetX:s,offsetY:l,disabled:L,getZoom:N,changeOffsets:R,changeZoom:P,zoomIn:T,zoomOut:v}}const fn=n.createContext(null),dt=se("useZoom","ZoomControllerContext",fn);function Vo({children:e}){const[t,o]=n.useState(),{slideRect:r}=le(),{ref:i,minZoom:s}=Ze(),{imageRect:c,maxZoom:l}=$o(r,t==null?void 0:t.imageDimensions),{zoom:d,offsetX:a,offsetY:m,disabled:f,getZoom:h,changeZoom:p,changeOffsets:g,zoomIn:u,zoomOut:_}=Fo(c,l,t==null?void 0:t.zoomWrapperRef);Zo(d,f),zo(h,s,l,f,u,_,p,g,t==null?void 0:t.zoomWrapperRef);const x=n.useMemo(()=>({zoom:d,minZoom:s,maxZoom:l,offsetX:a,offsetY:m,disabled:f,zoomIn:u,zoomOut:_,changeZoom:p}),[d,s,l,a,m,f,u,_,p]);n.useImperativeHandle(i,()=>x,[x]);const M=n.useMemo(()=>({...x,setZoomWrapper:o}),[x,o]);return n.createElement(fn.Provider,{value:M},e)}const Uo=pe("ZoomIn",n.createElement(n.Fragment,null,n.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),n.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),Xo=pe("ZoomOut",n.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),Rt=n.forwardRef(function({zoomIn:t,onLoseFocus:o},r){const i=n.useRef(!1),s=n.useRef(!1),{zoom:c,minZoom:l,maxZoom:d,zoomIn:a,zoomOut:m,disabled:f}=dt(),{render:h}=te(),p=f||(t?c>=d:c<=l);return n.useEffect(()=>{p&&i.current&&s.current&&o(),p||(i.current=!0)},[p,o]),n.createElement(lt,{ref:r,disabled:p,label:t?"Zoom in":"Zoom out",icon:t?Uo:Xo,renderIcon:t?h.iconZoomIn:h.iconZoomOut,onClick:t?a:m,onFocus:()=>{s.current=!0},onBlur:()=>{s.current=!1}})});function Yo(){const e=n.useRef(null),t=n.useRef(null),{focus:o}=le(),r=n.useCallback(c=>{var l,d;!((l=c.current)===null||l===void 0)&&l.disabled?o():(d=c.current)===null||d===void 0||d.focus()},[o]),i=n.useCallback(()=>r(e),[r]),s=n.useCallback(()=>r(t),[r]);return n.createElement(n.Fragment,null,n.createElement(Rt,{zoomIn:!0,ref:e,onLoseFocus:s}),n.createElement(Rt,{ref:t,onLoseFocus:i}))}function Ho(){const{render:e}=te(),t=dt();return e.buttonZoom?n.createElement(n.Fragment,null,e.buttonZoom(t)):n.createElement(Yo,null)}function Bo(e){var t;return(((t=e.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function Ko({current:e,preload:t},{type:o,source:r}){switch(o){case"fetch":return e?{current:e,preload:r}:{current:r};case"done":return r===t?{current:r}:{current:e,preload:t};default:throw new Error(Ut)}}function jo(e){var t,o;const[{current:r,preload:i},s]=n.useReducer(Ko,{}),{slide:c,rect:l,rotation:d=0,imageFit:a,render:m,interactive:f,zoom:h=1}=e,p=d%180!==0,g=p?{width:l.height,height:l.width}:l,u=c.srcSet.sort((v,I)=>v.width-I.width),_=(t=c.width)!==null&&t!==void 0?t:u[u.length-1].width,x=(o=c.height)!==null&&o!==void 0?o:u[u.length-1].height,M=ct(c,a),L=Math.max(...u.map(v=>v.width)),R=Math.min((M?Math.max:Math.min)(g.width,_*(g.height/x))*h,L),P=kn(),N=A(()=>{var v;const I=(v=u.find(Z=>Z.width>=R*P))!==null&&v!==void 0?v:u[u.length-1];(!r||u.findIndex(Z=>Z.src===r)<u.findIndex(Z=>Z===I))&&s({type:"fetch",source:I.src})});ce(N,[R,P,N]);const y=A(v=>s({type:"done",source:v})),T={WebkitTransform:f?"initial":"translateZ(0)"};return M||Object.assign(T,g.width/g.height<_/x?{width:p?`${g.width}px`:"100%",height:"auto"}:{width:"auto",height:p?`${g.height}px`:"100%"}),n.createElement(n.Fragment,null,i&&i!==r&&n.createElement(Re,{key:"preload",...e,offset:void 0,slide:{...c,src:i,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...T},onLoad:()=>y(i),render:{...m,iconLoading:()=>null,iconError:()=>null}}),r&&n.createElement(Re,{key:"current",...e,slide:{...c,src:r,srcSet:void 0},style:T}))}function Go({render:e,slide:t,offset:o,rect:r}){var i;const[s,c]=n.useState(),l=n.useRef(null),d=me(t),a=De(t),{zoom:m,maxZoom:f,offsetX:h,offsetY:p,setZoomWrapper:g}=dt(),u=m>1,{carousel:_,on:x}=te(),{currentIndex:M}=ue();ce(()=>{if(o!==0||d||!l.current)return()=>{};const R=()=>{const N=l.current;if(!N)return;let y=0,T=0;for(const v of N.children)v instanceof HTMLElement&&(y=Math.max(y,v.offsetWidth),T=Math.max(T,v.offsetHeight));c(v=>v&&v.width===y&&v.height===T?v:{width:y,height:T})};if(R(),typeof ResizeObserver>"u")return()=>{};const P=new ResizeObserver(R);for(const N of l.current.children)P.observe(N);return()=>P.disconnect()},[o,d,r]),ce(()=>o===0?(g({zoomWrapperRef:l,imageDimensions:s}),()=>g(void 0)):()=>{},[o,s,g]);let L=(i=e.slide)===null||i===void 0?void 0:i.call(e,{slide:t,offset:o,rect:r,zoom:m,maxZoom:f});if(!L&&d){const R={slide:t,offset:o,rect:r,rotation:a,render:e,imageFit:_.imageFit,imageProps:_.imageProps,onClick:o===0?()=>{var P;return(P=x.click)===null||P===void 0?void 0:P.call(x,{index:M})}:void 0};L=Bo(t)?n.createElement(jo,{...R,slide:t,interactive:u,zoom:o===0?m:1}):n.createElement(Re,{onLoad:P=>c({width:P.naturalWidth,height:P.naturalHeight}),...R})}return L?n.createElement("div",{ref:l,className:ie(k(Pn),k(Qe),k(At),u&&k(Mn)),style:o===0?{transform:`scale(${m}) translateX(${h}px) translateY(${p}px)`}:void 0},L):null}const qo=({augment:e,addModule:t})=>{e(({zoom:o,toolbar:r,render:i,controller:s,...c})=>{const l=dn(o);return{zoom:l,toolbar:An(r,gt,n.createElement(Ho,null)),render:{...i,slide:d=>{var a,m;return me(d.slide)||d.slide.type!=null&&(!((a=l.supports)===null||a===void 0)&&a.includes(d.slide.type))?n.createElement(Go,{render:i,...d}):(m=i.slide)===null||m===void 0?void 0:m.call(i,d)}},controller:{...s,preventDefaultWheelY:l.scrollToZoom},...c}}),t(ae(gt,Vo))};function tr({src:e,alt:t,slides:o,index:r=0,open:i,onClose:s}){const c=o&&o.length>0?o:e?[{src:e,alt:t}]:[];return vn.jsx(ko,{open:i,close:s,index:r,slides:c,plugins:[qo],zoom:{scrollToZoom:!0,maxZoomPixelRatio:5},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)"},toolbar:{background:"transparent",padding:"16px"},button:{backgroundColor:"rgba(255, 255, 255, 0.1)",borderRadius:"9999px",color:"#fff",width:40,height:40},icon:{width:20,height:20}},animation:{fade:200}})}export{tr as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Q}from"./index-CWUiS-aC.js";import{r as me}from"./syntax-highlighter-d-DuIo_w.js";import{k as Pd,b as Nd,s as Hd,P as Wd,E as Fd,S as zd,a as Vd,M as $d,c as qd}from"./main-
|
|
1
|
+
import{j as Q}from"./index-CWUiS-aC.js";import{r as me}from"./syntax-highlighter-d-DuIo_w.js";import{k as Pd,b as Nd,s as Hd,P as Wd,E as Fd,S as zd,a as Vd,M as $d,c as qd}from"./main-B-Q2oskz.js";function Yr(){return Yr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Yr.apply(null,arguments)}function jd(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let Jr=[],nc=[];(()=>{let n="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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?nc:Jr).push(t=t+n[e])})();function _d(n){if(n<768)return!1;for(let e=0,t=Jr.length;;){let i=e+t>>1;if(n<Jr[i])t=i;else if(n>=nc[i])e=i+1;else return!0;if(e==t)return!1}}function Ul(n){return n>=127462&&n<=127487}const Gl=8205;function Kd(n,e,t=!0,i=!0){return(t?sc:Ud)(n,e,i)}function sc(n,e,t){if(e==n.length)return e;e&&rc(n.charCodeAt(e))&&oc(n.charCodeAt(e-1))&&e--;let i=mr(n,e);for(e+=Xl(i);e<n.length;){let s=mr(n,e);if(i==Gl||s==Gl||t&&_d(s))e+=Xl(s),i=s;else if(Ul(s)){let r=0,o=e-2;for(;o>=0&&Ul(mr(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Ud(n,e,t){for(;e>1;){let i=sc(n,e-2,t);if(i<e)return i;e--}return 0}function mr(n,e){let t=n.charCodeAt(e);if(!oc(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return rc(i)?(t-55296<<10)+(i-56320)+65536:t}function rc(n){return n>=56320&&n<57344}function oc(n){return n>=55296&&n<56320}function Xl(n){return n<65536?1:2}class G{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,t,i){[e,t]=Li(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),pt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Li(this,e,t);let i=[];return this.decompose(e,t,i,0),pt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Zi(this),r=new Zi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Zi(this,e)}iterRange(e,t=this.length){return new lc(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ac(i)}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]?G.empty:e.length<=32?new fe(e):pt.from(fe.split(e,[]))}}class fe extends G{constructor(e,t=Gd(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Xd(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new fe(Yl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=us(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new fe(l,o.length+r.length));else{let a=l.length>>1;i.push(new fe(l.slice(0,a)),new fe(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof fe))return super.replace(e,t,i);[e,t]=Li(this,e,t);let s=us(this.text,us(i.text,Yl(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new fe(s,r):pt.from(fe.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
|
2
2
|
`){[e,t]=Li(this,e,t);let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new fe(i,s)),i=[],s=-1);return s>-1&&t.push(new fe(i,s)),t}}class pt extends G{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=Li(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new pt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
3
3
|
`){[e,t]=Li(this,e,t);let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof pt))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new fe(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof pt)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof fe&&a&&(p=c[c.length-1])instanceof fe&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new fe(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:pt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new pt(l,t)}}G.empty=new fe([""],0);function Gd(n){let e=-1;for(let t of n)e+=t.length+1;return e}function us(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function Yl(n,e,t){return us(n,[""],e,t)}class Zi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof fe?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof fe?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
4
|
`,this;e--}else if(s instanceof fe){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof fe?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class lc{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Zi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),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 ac{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(G.prototype[Symbol.iterator]=function(){return this.iter()},Zi.prototype[Symbol.iterator]=lc.prototype[Symbol.iterator]=ac.prototype[Symbol.iterator]=function(){return this});let Xd=class{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}};function Li(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function ke(n,e,t=!0,i=!0){return Kd(n,e,t,i)}function Yd(n){return n>=56320&&n<57344}function Jd(n){return n>=55296&&n<56320}function Re(n,e){let t=n.charCodeAt(e);if(!Jd(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Yd(i)?(t-55296<<10)+(i-56320)+65536:t}function sl(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function mt(n){return n<65536?1:2}const Qr=/\r\n?|\n/;var Oe=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Oe||(Oe={}));class kt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Zr(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new kt(e)}composeDesc(e){return this.empty?e:e.empty?this:hc(this,e)}mapDesc(e,t=!1){return e.empty?this:eo(this,e,t)}mapPos(e,t=-1,i=Oe.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=Oe.Simple&&h>=e&&(i==Oe.TrackDel&&s<e&&h>e||i==Oe.TrackBefore&&s<e||i==Oe.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new kt(e)}static create(e){return new kt(e)}}class be extends kt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Zr(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return eo(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(G.empty);i.push(o?e.slice(r,r+o):G.empty)}r+=o}return new be(t,i)}compose(e){return this.empty?e:e.empty?this:hc(this,e,!0)}map(e,t=!1){return e.empty?this:eo(this,e,t,!0)}iterChanges(e,t=!1){Zr(this,e,t)}get desc(){return kt.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new fn(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let c=Math.min(r.len,a-l);Ae(s,c,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;Ae(t,c,f),f>0&&Wt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l<h;){if(r.done)break e;let c=Math.min(r.len,h-l);Ae(t,c,-1),Ae(s,c,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(c),l+=c}}return{changes:new be(t,i),filtered:kt.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;o<t&&Ae(s,t-o,-1);let f=new be(s,r);l=l?l.compose(f.map(l)):f,s=[],r=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof be){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?G.of(d.split(i||Qr)):d:G.empty,m=p.length;if(f==u&&m==0)return;f<o&&a(),f>o&&Ae(s,f-o,-1),Ae(s,u-f,m),Wt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new be(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push(G.empty);i[s]=G.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new be(t,i)}static createSet(e,t){return new be(e,t)}}function Ae(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Wt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(G.empty);n.push(t)}}function Zr(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let h=s,c=r,f=G.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function eo(n,e,t,i=!1){let s=[],r=i?[]:null,o=new fn(n),l=new fn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);Ae(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(Ae(s,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(Ae(s,0,o.ins),r&&Wt(r,s,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;Ae(s,h,a<o.i?o.ins:0),r&&a<o.i&&Wt(r,s,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?be.createSet(s,r):kt.create(s);throw new Error("Mismatched change set lengths")}}}function hc(n,e,t=!1){let i=[],s=t?[]:null,r=new fn(n),o=new fn(e);for(let l=!1;;){if(r.done&&o.done)return s?be.createSet(i,s):kt.create(i);if(r.ins==0)Ae(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)Ae(i,0,o.ins,l),s&&Wt(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;Ae(i,a,c,l),s&&c&&Wt(s,i,o.text)}else o.ins==-1?(Ae(i,r.off?0:r.len,a,l),s&&Wt(s,i,r.textBit(a))):(Ae(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&Wt(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class fn{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,t=this.i-2>>1;return t>=e.length?G.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?G.empty:t[i].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 Nt{constructor(e,t,i,s){this.from=e,this.to=t,this.flags=i,this.goalColumn=s}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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Nt(i,s,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return w.range(e,t,void 0,void 0,i);let s=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return w.range(this.anchor,s,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!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 w.range(e.anchor,e.head)}static create(e,t,i,s){return new Nt(e,t,i,s)}}class w{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:w.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new w([this.main],0)}addRange(e,t=!0){return w.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,w.create(i,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 w(e.ranges.map(t=>Nt.fromJSON(t)),e.main)}static single(e,t=e){return new w([w.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=i:r.from<i)return w.normalized(e.slice(),t);i=r.to}return new w(e,t)}static cursor(e,t=0,i,s){return Nt.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i)),s)}static range(e,t,i,s,r){let o=s==null?7:Math.min(6,s);return!r&&e!=t&&(r=t<e?1:-1),r&&(o|=r<0?8:16),t<e?Nt.create(t,e,o|32,i):Nt.create(e,t,o,i)}static undirectionalRange(e,t){return Nt.create(e,t,64,void 0)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?w.range(a,l):w.range(l,a))}}return new w(e,t)}}function cc(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let rl=0;class R{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=rl++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new R(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:ol),!!e.static,e.enables)}of(e){return new ds([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ds(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ds(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function ol(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class ds{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=rl++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||to(f,c)){let d=i(f);if(l?!Jl(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=Cs(u,p);if(this.dependencies.every(g=>g instanceof R?u.facet(g)===f.facet(g):g instanceof Le?u.field(g,!1)==f.field(g,!1):!0)||(l?Jl(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}}function Jl(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function to(n,e){let t=!1;for(let i of e)en(n,i)&1&&(t=!0);return t}function Qd(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=Cs(a,i[c]);if(s[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)en(a,h);return a.values[o]=l(a),1},update(a,h){if(!to(a,r))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=to(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&ol(t,f))return a.values[o]=u,0;let d=l(a);return e.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const Hn=R.define({static:!0});class Le{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new Le(rl++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Hn).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>{let r=i.facet(Hn),o=s.facet(Hn),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Hn.of({field:this,create:e})]}get extension(){return this}}const ei={lowest:4,low:3,default:2,high:1,highest:0};function $i(n){return e=>new fc(e,n)}const fi={highest:$i(ei.highest),high:$i(ei.high),default:$i(ei.default),low:$i(ei.low),lowest:$i(ei.lowest)};class fc{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class Ys{of(e){return new io(this,e)}reconfigure(e){return Ys.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class io{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class Ss{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Zd(e,t,o))u instanceof Le?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,ol(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(b=>b.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(b=>g.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(g=>Qd(g,p,d))}}let f=h.map(u=>u(l));return new Ss(e,o,f,l,a,r)}}function Zd(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof io&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof io){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof fc)r(o.inner,o.prec);else if(o instanceof Le)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ds)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,ei.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,ei.default),i.reduce((o,l)=>o.concat(l))}function en(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Cs(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const uc=R.define(),no=R.define({combine:n=>n.some(e=>e),static:!0}),dc=R.define({combine:n=>n.length?n[0]:void 0,static:!0}),pc=R.define(),mc=R.define(),gc=R.define(),bc=R.define({combine:n=>n.length?n[0]:!1});class St{constructor(e,t){this.type=e,this.value=t}static define(){return new ep}}class ep{of(e){return new St(this,e)}}class tp{constructor(e){this.map=e}of(e){return new $(this,e)}}class ${constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new $(this.type,t)}is(e){return this.type==e}static define(e={}){return new tp(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}$.reconfigure=$.define();$.appendConfig=$.define();class ye{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&cc(i,t.newLength),r.some(l=>l.type==ye.time)||(this.annotations=r.concat(ye.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ye(e,t,i,s,r,o)}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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ye.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ye.time=St.define();ye.userEvent=St.define();ye.addToHistory=St.define();ye.remote=St.define();function ip(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function yc(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=be.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:$.mapEffects(n.effects,s).concat($.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function so(n,e,t){let i=e.selection,s=wi(e.annotations);return e.userEvent&&(s=s.concat(ye.userEvent.of(e.userEvent))),{changes:e.changes instanceof be?e.changes:be.of(e.changes||[],t,n.facet(dc)),selection:i&&(i instanceof w?i:w.single(i.anchor,i.head)),effects:wi(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function xc(n,e,t){let i=so(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=yc(i,so(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=ye.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return sp(t?np(s):s)}function np(n){let e=n.startState,t=!0;for(let s of e.facet(pc)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:ip(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=be.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=ye.create(e,s,n.selection&&n.selection.map(r),$.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(mc);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof ye?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ye?n=r[0]:n=xc(e,wi(r),!1)}return n}function sp(n){let e=n.startState,t=e.facet(gc),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=yc(i,so(e,r,n.changes.newLength),!0))}return i==n?n:ye.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const rp=[];function wi(n){return n==null?rp:Array.isArray(n)?n:[n]}var le=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(le||(le={}));const op=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ro;try{ro=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function lp(n){if(ro)return ro.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||op.test(t)))return!0}return!1}function ap(n){return e=>{if(!/\S/.test(e))return le.Space;if(lp(e))return le.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return le.Word;return le.Other}}class _{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)en(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return en(this,i),Cs(this,i)}update(...e){return xc(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let l of e.effects)l.is(Ys.reconfigure)?(t&&(s=new Map,t.compartments.forEach((a,h)=>s.set(h,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is($.reconfigure)?(t=null,i=l.value):l.is($.appendConfig)&&(t=null,i=wi(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=Ss.resolve(i,s,this),r=new _(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(no)?e.newSelection:e.newSelection.asSingle();new _(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:w.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=wi(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(c);let f=s.mapDesc(h,!0);r.push(a.range.map(f)),s=s.compose(c),o=$.mapEffects(o,c).concat($.mapEffects(wi(a.effects),f))}return{changes:s,selection:w.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof be?e:be.of(e,this.doc.length,this.facet(_.lineSeparator))}toText(e){return G.of(e.split(this.facet(_.lineSeparator)||Qr))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(en(this,t),Cs(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof Le&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return _.create({doc:e.doc,selection:w.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Ss.resolve(e.extensions||[],new Map),i=e.doc instanceof G?e.doc:G.of((e.doc||"").split(t.staticFacet(_.lineSeparator)||Qr)),s=e.selection?e.selection instanceof w?e.selection:w.single(e.selection.anchor,e.selection.head):w.single(0);return cc(s,i.length),t.staticFacet(no)||(s=s.asSingle()),new _(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(_.tabSize)}get lineBreak(){return this.facet(_.lineSeparator)||`
|