picture-designer 0.1.3 → 0.1.4
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.
|
@@ -16993,7 +16993,7 @@ const DA = ({
|
|
|
16993
16993
|
};
|
|
16994
16994
|
return (
|
|
16995
16995
|
// inline-flex щоб контейнер стиснувся до розмірів картинки
|
|
16996
|
-
/* @__PURE__ */ L.jsxs("div", { className: `relative justify-center items-center overflow-hidden bg-gray-100 rounded-md shadow-lg ${o ? "hidden pointer-events-none" : "inline-flex"}`, children: [
|
|
16996
|
+
/* @__PURE__ */ L.jsxs("div", { className: `max-h-[70vh] relative justify-center items-center overflow-hidden bg-gray-100 rounded-md shadow-lg ${o ? "hidden pointer-events-none" : "inline-flex"}`, children: [
|
|
16997
16997
|
/* @__PURE__ */ L.jsx(
|
|
16998
16998
|
"img",
|
|
16999
16999
|
{
|
|
@@ -17001,7 +17001,7 @@ const DA = ({
|
|
|
17001
17001
|
src: i,
|
|
17002
17002
|
alt: "Wallpaper preview",
|
|
17003
17003
|
onLoad: h,
|
|
17004
|
-
className: "
|
|
17004
|
+
className: " w-auto object-contain block select-none",
|
|
17005
17005
|
draggable: !1
|
|
17006
17006
|
}
|
|
17007
17007
|
),
|
|
@@ -19281,7 +19281,6 @@ function IR({ className: l, ...r }) {
|
|
|
19281
19281
|
);
|
|
19282
19282
|
}
|
|
19283
19283
|
function tO({ apiUrl: l, productId: r, imageUrl: i }) {
|
|
19284
|
-
console.log("0.1.3");
|
|
19285
19284
|
const [o, s] = S.useState(), [f, d] = S.useState(), [h, g] = S.useState(!1), [p, v] = S.useState(!1), b = S.useRef(null), T = async (x) => await wT(x, {
|
|
19286
19285
|
cacheBust: !0,
|
|
19287
19286
|
pixelRatio: 1,
|
|
@@ -135,10 +135,10 @@ For more information, see https://radix-ui.com/primitives/docs/components/${r.do
|
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const MS=La("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function NS({...l}){return L.jsx(gS,{"data-slot":"sheet",...l})}function zS({...l}){return L.jsx(yS,{"data-slot":"sheet-trigger",...l})}function US({...l}){return L.jsx(kd,{"data-slot":"sheet-close",...l})}function LS({...l}){return L.jsx(vS,{"data-slot":"sheet-portal",...l})}function jS({className:l,...r}){return L.jsx(bS,{"data-slot":"sheet-overlay",className:_t("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",l),...r})}function HS({className:l,children:r,side:i="right",...o}){return L.jsxs(LS,{children:[L.jsx(jS,{}),L.jsxs(SS,{"data-slot":"sheet-content",className:_t("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",i==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-[95%] border-l",i==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",i==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",i==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",l),...o,children:[r,L.jsxs(kd,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[L.jsx(MS,{className:"size-4"}),L.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function BS({className:l,...r}){return L.jsx("div",{"data-slot":"sheet-header",className:_t("flex flex-col gap-1.5 p-4",l),...r})}function qS({className:l,...r}){return L.jsx("div",{"data-slot":"sheet-footer",className:_t("mt-auto flex flex-col gap-2 p-4",l),...r})}function kS({className:l,...r}){return L.jsx(ES,{"data-slot":"sheet-title",className:_t("text-foreground font-semibold",l),...r})}function VS({className:l,type:r,...i}){return L.jsx("input",{type:r,"data-slot":"input",className:_t("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",l),...i})}function GS({className:l,...r}){return L.jsx("div",{"data-slot":"input-group",role:"group",className:_t("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",l),...r})}const YS=Lf("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5","block-end":"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function Yd({className:l,align:r="inline-start",...i}){return L.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":r,className:_t(YS({align:r}),l),onClick:o=>{o.target.closest("button")||o.currentTarget.parentElement?.querySelector("input")?.focus()},...i})}function XS({className:l,...r}){return L.jsx(VS,{"data-slot":"input-group-control",className:_t("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",l),...r})}function sn(l,r,{checkForDefaultPrevented:i=!0}={}){return function(s){if(l?.(s),i===!1||!s.defaultPrevented)return r?.(s)}}var QS="DismissableLayer",wu="dismissableLayer.update",ZS="dismissableLayer.pointerDownOutside",KS="dismissableLayer.focusOutside",Xd,Qd=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zd=S.forwardRef((l,r)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f,onInteractOutside:d,onDismiss:h,...g}=l,p=S.useContext(Qd),[v,b]=S.useState(null),T=v?.ownerDocument??globalThis?.document,[,C]=S.useState({}),w=st(r,Q=>b(Q)),x=Array.from(p.layers),[O]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),H=x.indexOf(O),K=v?x.indexOf(v):-1,Z=p.layersWithOutsidePointerEventsDisabled.size>0,Y=K>=H,$=FS(Q=>{const J=Q.target,ie=[...p.branches].some(ce=>ce.contains(J));!Y||ie||(s?.(Q),d?.(Q),Q.defaultPrevented||h?.())},T),F=JS(Q=>{const J=Q.target;[...p.branches].some(ce=>ce.contains(J))||(f?.(Q),d?.(Q),Q.defaultPrevented||h?.())},T);return Wf(Q=>{K===p.layers.size-1&&(o?.(Q),!Q.defaultPrevented&&h&&(Q.preventDefault(),h()))},T),S.useEffect(()=>{if(v)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Xd=T.body.style.pointerEvents,T.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),Kd(),()=>{i&&p.layersWithOutsidePointerEventsDisabled.size===1&&(T.body.style.pointerEvents=Xd)}},[v,T,i,p]),S.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),Kd())},[v,p]),S.useEffect(()=>{const Q=()=>C({});return document.addEventListener(wu,Q),()=>document.removeEventListener(wu,Q)},[]),L.jsx(lt.div,{...g,ref:w,style:{pointerEvents:Z?Y?"auto":"none":void 0,...l.style},onFocusCapture:sn(l.onFocusCapture,F.onFocusCapture),onBlurCapture:sn(l.onBlurCapture,F.onBlurCapture),onPointerDownCapture:sn(l.onPointerDownCapture,$.onPointerDownCapture)})});Zd.displayName=QS;var PS="DismissableLayerBranch",$S=S.forwardRef((l,r)=>{const i=S.useContext(Qd),o=S.useRef(null),s=st(r,o);return S.useEffect(()=>{const f=o.current;if(f)return i.branches.add(f),()=>{i.branches.delete(f)}},[i.branches]),L.jsx(lt.div,{...l,ref:s})});$S.displayName=PS;function FS(l,r=globalThis?.document){const i=_n(l),o=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const f=h=>{if(h.target&&!o.current){let g=function(){Pd(ZS,i,p,{discrete:!0})};const p={originalEvent:h};h.pointerType==="touch"?(r.removeEventListener("click",s.current),s.current=g,r.addEventListener("click",s.current,{once:!0})):g()}else r.removeEventListener("click",s.current);o.current=!1},d=window.setTimeout(()=>{r.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(d),r.removeEventListener("pointerdown",f),r.removeEventListener("click",s.current)}},[r,i]),{onPointerDownCapture:()=>o.current=!0}}function JS(l,r=globalThis?.document){const i=_n(l),o=S.useRef(!1);return S.useEffect(()=>{const s=f=>{f.target&&!o.current&&Pd(KS,i,{originalEvent:f},{discrete:!1})};return r.addEventListener("focusin",s),()=>r.removeEventListener("focusin",s)},[r,i]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Kd(){const l=new CustomEvent(wu);document.dispatchEvent(l)}function Pd(l,r,i,{discrete:o}){const s=i.originalEvent.target,f=new CustomEvent(l,{bubbles:!1,cancelable:!0,detail:i});r&&s.addEventListener(l,r,{once:!0}),o?Jf(s,f):s.dispatchEvent(f)}const WS=["top","right","bottom","left"],Nn=Math.min,vt=Math.max,ri=Math.round,ii=Math.floor,Ft=l=>({x:l,y:l}),IS={left:"right",right:"left",bottom:"top",top:"bottom"},e1={start:"end",end:"start"};function Au(l,r,i){return vt(l,Nn(r,i))}function cn(l,r){return typeof l=="function"?l(r):l}function fn(l){return l.split("-")[0]}function Hl(l){return l.split("-")[1]}function Tu(l){return l==="x"?"y":"x"}function Ru(l){return l==="y"?"height":"width"}const t1=new Set(["top","bottom"]);function Jt(l){return t1.has(fn(l))?"y":"x"}function Ou(l){return Tu(Jt(l))}function n1(l,r,i){i===void 0&&(i=!1);const o=Hl(l),s=Ou(l),f=Ru(s);let d=s==="x"?o===(i?"end":"start")?"right":"left":o==="start"?"bottom":"top";return r.reference[f]>r.floating[f]&&(d=oi(d)),[d,oi(d)]}function l1(l){const r=oi(l);return[Cu(l),r,Cu(r)]}function Cu(l){return l.replace(/start|end/g,r=>e1[r])}const $d=["left","right"],Fd=["right","left"],a1=["top","bottom"],r1=["bottom","top"];function i1(l,r,i){switch(l){case"top":case"bottom":return i?r?Fd:$d:r?$d:Fd;case"left":case"right":return r?a1:r1;default:return[]}}function o1(l,r,i,o){const s=Hl(l);let f=i1(fn(l),i==="start",o);return s&&(f=f.map(d=>d+"-"+s),r&&(f=f.concat(f.map(Cu)))),f}function oi(l){return l.replace(/left|right|bottom|top/g,r=>IS[r])}function u1(l){return{top:0,right:0,bottom:0,left:0,...l}}function Jd(l){return typeof l!="number"?u1(l):{top:l,right:l,bottom:l,left:l}}function ui(l){const{x:r,y:i,width:o,height:s}=l;return{width:o,height:s,top:i,left:r,right:r+o,bottom:i+s,x:r,y:i}}function Wd(l,r,i){let{reference:o,floating:s}=l;const f=Jt(r),d=Ou(r),h=Ru(d),g=fn(r),p=f==="y",v=o.x+o.width/2-s.width/2,b=o.y+o.height/2-s.height/2,T=o[h]/2-s[h]/2;let C;switch(g){case"top":C={x:v,y:o.y-s.height};break;case"bottom":C={x:v,y:o.y+o.height};break;case"right":C={x:o.x+o.width,y:b};break;case"left":C={x:o.x-s.width,y:b};break;default:C={x:o.x,y:o.y}}switch(Hl(r)){case"start":C[d]-=T*(i&&p?-1:1);break;case"end":C[d]+=T*(i&&p?-1:1);break}return C}const s1=async(l,r,i)=>{const{placement:o="bottom",strategy:s="absolute",middleware:f=[],platform:d}=i,h=f.filter(Boolean),g=await(d.isRTL==null?void 0:d.isRTL(r));let p=await d.getElementRects({reference:l,floating:r,strategy:s}),{x:v,y:b}=Wd(p,o,g),T=o,C={},w=0;for(let x=0;x<h.length;x++){const{name:O,fn:H}=h[x],{x:K,y:Z,data:Y,reset:$}=await H({x:v,y:b,initialPlacement:o,placement:T,strategy:s,middlewareData:C,rects:p,platform:d,elements:{reference:l,floating:r}});v=K??v,b=Z??b,C={...C,[O]:{...C[O],...Y}},$&&w<=50&&(w++,typeof $=="object"&&($.placement&&(T=$.placement),$.rects&&(p=$.rects===!0?await d.getElementRects({reference:l,floating:r,strategy:s}):$.rects),{x:v,y:b}=Wd(p,T,g)),x=-1)}return{x:v,y:b,placement:T,strategy:s,middlewareData:C}};async function ja(l,r){var i;r===void 0&&(r={});const{x:o,y:s,platform:f,rects:d,elements:h,strategy:g}=l,{boundary:p="clippingAncestors",rootBoundary:v="viewport",elementContext:b="floating",altBoundary:T=!1,padding:C=0}=cn(r,l),w=Jd(C),O=h[T?b==="floating"?"reference":"floating":b],H=ui(await f.getClippingRect({element:(i=await(f.isElement==null?void 0:f.isElement(O)))==null||i?O:O.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(h.floating)),boundary:p,rootBoundary:v,strategy:g})),K=b==="floating"?{x:o,y:s,width:d.floating.width,height:d.floating.height}:d.reference,Z=await(f.getOffsetParent==null?void 0:f.getOffsetParent(h.floating)),Y=await(f.isElement==null?void 0:f.isElement(Z))?await(f.getScale==null?void 0:f.getScale(Z))||{x:1,y:1}:{x:1,y:1},$=ui(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:K,offsetParent:Z,strategy:g}):K);return{top:(H.top-$.top+w.top)/Y.y,bottom:($.bottom-H.bottom+w.bottom)/Y.y,left:(H.left-$.left+w.left)/Y.x,right:($.right-H.right+w.right)/Y.x}}const c1=l=>({name:"arrow",options:l,async fn(r){const{x:i,y:o,placement:s,rects:f,platform:d,elements:h,middlewareData:g}=r,{element:p,padding:v=0}=cn(l,r)||{};if(p==null)return{};const b=Jd(v),T={x:i,y:o},C=Ou(s),w=Ru(C),x=await d.getDimensions(p),O=C==="y",H=O?"top":"left",K=O?"bottom":"right",Z=O?"clientHeight":"clientWidth",Y=f.reference[w]+f.reference[C]-T[C]-f.floating[w],$=T[C]-f.reference[C],F=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let Q=F?F[Z]:0;(!Q||!await(d.isElement==null?void 0:d.isElement(F)))&&(Q=h.floating[Z]||f.floating[w]);const J=Y/2-$/2,ie=Q/2-x[w]/2-1,ce=Nn(b[H],ie),Ce=Nn(b[K],ie),ve=ce,he=Q-x[w]-Ce,me=Q/2-x[w]/2+J,we=Au(ve,me,he),k=!g.arrow&&Hl(s)!=null&&me!==we&&f.reference[w]/2-(me<ve?ce:Ce)-x[w]/2<0,B=k?me<ve?me-ve:me-he:0;return{[C]:T[C]+B,data:{[C]:we,centerOffset:me-we-B,...k&&{alignmentOffset:B}},reset:k}}}),f1=function(l){return l===void 0&&(l={}),{name:"flip",options:l,async fn(r){var i,o;const{placement:s,middlewareData:f,rects:d,initialPlacement:h,platform:g,elements:p}=r,{mainAxis:v=!0,crossAxis:b=!0,fallbackPlacements:T,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...O}=cn(l,r);if((i=f.arrow)!=null&&i.alignmentOffset)return{};const H=fn(s),K=Jt(h),Z=fn(h)===h,Y=await(g.isRTL==null?void 0:g.isRTL(p.floating)),$=T||(Z||!x?[oi(h)]:l1(h)),F=w!=="none";!T&&F&&$.push(...o1(h,x,w,Y));const Q=[h,...$],J=await ja(r,O),ie=[];let ce=((o=f.flip)==null?void 0:o.overflows)||[];if(v&&ie.push(J[H]),b){const me=n1(s,d,Y);ie.push(J[me[0]],J[me[1]])}if(ce=[...ce,{placement:s,overflows:ie}],!ie.every(me=>me<=0)){var Ce,ve;const me=(((Ce=f.flip)==null?void 0:Ce.index)||0)+1,we=Q[me];if(we&&(!(b==="alignment"?K!==Jt(we):!1)||ce.every(_=>_.overflows[0]>0&&Jt(_.placement)===K)))return{data:{index:me,overflows:ce},reset:{placement:we}};let k=(ve=ce.filter(B=>B.overflows[0]<=0).sort((B,_)=>B.overflows[1]-_.overflows[1])[0])==null?void 0:ve.placement;if(!k)switch(C){case"bestFit":{var he;const B=(he=ce.filter(_=>{if(F){const re=Jt(_.placement);return re===K||re==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(re=>re>0).reduce((re,pe)=>re+pe,0)]).sort((_,re)=>_[1]-re[1])[0])==null?void 0:he[0];B&&(k=B);break}case"initialPlacement":k=h;break}if(s!==k)return{reset:{placement:k}}}return{}}}};function Id(l,r){return{top:l.top-r.height,right:l.right-r.width,bottom:l.bottom-r.height,left:l.left-r.width}}function eh(l){return WS.some(r=>l[r]>=0)}const d1=function(l){return l===void 0&&(l={}),{name:"hide",options:l,async fn(r){const{rects:i}=r,{strategy:o="referenceHidden",...s}=cn(l,r);switch(o){case"referenceHidden":{const f=await ja(r,{...s,elementContext:"reference"}),d=Id(f,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:eh(d)}}}case"escaped":{const f=await ja(r,{...s,altBoundary:!0}),d=Id(f,i.floating);return{data:{escapedOffsets:d,escaped:eh(d)}}}default:return{}}}}},th=new Set(["left","top"]);async function h1(l,r){const{placement:i,platform:o,elements:s}=l,f=await(o.isRTL==null?void 0:o.isRTL(s.floating)),d=fn(i),h=Hl(i),g=Jt(i)==="y",p=th.has(d)?-1:1,v=f&&g?-1:1,b=cn(r,l);let{mainAxis:T,crossAxis:C,alignmentAxis:w}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return h&&typeof w=="number"&&(C=h==="end"?w*-1:w),g?{x:C*v,y:T*p}:{x:T*p,y:C*v}}const m1=function(l){return l===void 0&&(l=0),{name:"offset",options:l,async fn(r){var i,o;const{x:s,y:f,placement:d,middlewareData:h}=r,g=await h1(r,l);return d===((i=h.offset)==null?void 0:i.placement)&&(o=h.arrow)!=null&&o.alignmentOffset?{}:{x:s+g.x,y:f+g.y,data:{...g,placement:d}}}}},p1=function(l){return l===void 0&&(l={}),{name:"shift",options:l,async fn(r){const{x:i,y:o,placement:s}=r,{mainAxis:f=!0,crossAxis:d=!1,limiter:h={fn:O=>{let{x:H,y:K}=O;return{x:H,y:K}}},...g}=cn(l,r),p={x:i,y:o},v=await ja(r,g),b=Jt(fn(s)),T=Tu(b);let C=p[T],w=p[b];if(f){const O=T==="y"?"top":"left",H=T==="y"?"bottom":"right",K=C+v[O],Z=C-v[H];C=Au(K,C,Z)}if(d){const O=b==="y"?"top":"left",H=b==="y"?"bottom":"right",K=w+v[O],Z=w-v[H];w=Au(K,w,Z)}const x=h.fn({...r,[T]:C,[b]:w});return{...x,data:{x:x.x-i,y:x.y-o,enabled:{[T]:f,[b]:d}}}}}},g1=function(l){return l===void 0&&(l={}),{options:l,fn(r){const{x:i,y:o,placement:s,rects:f,middlewareData:d}=r,{offset:h=0,mainAxis:g=!0,crossAxis:p=!0}=cn(l,r),v={x:i,y:o},b=Jt(s),T=Tu(b);let C=v[T],w=v[b];const x=cn(h,r),O=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(g){const Z=T==="y"?"height":"width",Y=f.reference[T]-f.floating[Z]+O.mainAxis,$=f.reference[T]+f.reference[Z]-O.mainAxis;C<Y?C=Y:C>$&&(C=$)}if(p){var H,K;const Z=T==="y"?"width":"height",Y=th.has(fn(s)),$=f.reference[b]-f.floating[Z]+(Y&&((H=d.offset)==null?void 0:H[b])||0)+(Y?0:O.crossAxis),F=f.reference[b]+f.reference[Z]+(Y?0:((K=d.offset)==null?void 0:K[b])||0)-(Y?O.crossAxis:0);w<$?w=$:w>F&&(w=F)}return{[T]:C,[b]:w}}}},y1=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(r){var i,o;const{placement:s,rects:f,platform:d,elements:h}=r,{apply:g=()=>{},...p}=cn(l,r),v=await ja(r,p),b=fn(s),T=Hl(s),C=Jt(s)==="y",{width:w,height:x}=f.floating;let O,H;b==="top"||b==="bottom"?(O=b,H=T===(await(d.isRTL==null?void 0:d.isRTL(h.floating))?"start":"end")?"left":"right"):(H=b,O=T==="end"?"top":"bottom");const K=x-v.top-v.bottom,Z=w-v.left-v.right,Y=Nn(x-v[O],K),$=Nn(w-v[H],Z),F=!r.middlewareData.shift;let Q=Y,J=$;if((i=r.middlewareData.shift)!=null&&i.enabled.x&&(J=Z),(o=r.middlewareData.shift)!=null&&o.enabled.y&&(Q=K),F&&!T){const ce=vt(v.left,0),Ce=vt(v.right,0),ve=vt(v.top,0),he=vt(v.bottom,0);C?J=w-2*(ce!==0||Ce!==0?ce+Ce:vt(v.left,v.right)):Q=x-2*(ve!==0||he!==0?ve+he:vt(v.top,v.bottom))}await g({...r,availableWidth:J,availableHeight:Q});const ie=await d.getDimensions(h.floating);return w!==ie.width||x!==ie.height?{reset:{rects:!0}}:{}}}};function si(){return typeof window<"u"}function Bl(l){return nh(l)?(l.nodeName||"").toLowerCase():"#document"}function bt(l){var r;return(l==null||(r=l.ownerDocument)==null?void 0:r.defaultView)||window}function Wt(l){var r;return(r=(nh(l)?l.ownerDocument:l.document)||window.document)==null?void 0:r.documentElement}function nh(l){return si()?l instanceof Node||l instanceof bt(l).Node:!1}function Vt(l){return si()?l instanceof Element||l instanceof bt(l).Element:!1}function It(l){return si()?l instanceof HTMLElement||l instanceof bt(l).HTMLElement:!1}function lh(l){return!si()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof bt(l).ShadowRoot}const v1=new Set(["inline","contents"]);function Ha(l){const{overflow:r,overflowX:i,overflowY:o,display:s}=Gt(l);return/auto|scroll|overlay|hidden|clip/.test(r+o+i)&&!v1.has(s)}const b1=new Set(["table","td","th"]);function S1(l){return b1.has(Bl(l))}const E1=[":popover-open",":modal"];function ci(l){return E1.some(r=>{try{return l.matches(r)}catch{return!1}})}const x1=["transform","translate","scale","rotate","perspective"],w1=["transform","translate","scale","rotate","perspective","filter"],A1=["paint","layout","strict","content"];function Du(l){const r=_u(),i=Vt(l)?Gt(l):l;return x1.some(o=>i[o]?i[o]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!r&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!r&&(i.filter?i.filter!=="none":!1)||w1.some(o=>(i.willChange||"").includes(o))||A1.some(o=>(i.contain||"").includes(o))}function T1(l){let r=zn(l);for(;It(r)&&!ql(r);){if(Du(r))return r;if(ci(r))return null;r=zn(r)}return null}function _u(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const R1=new Set(["html","body","#document"]);function ql(l){return R1.has(Bl(l))}function Gt(l){return bt(l).getComputedStyle(l)}function fi(l){return Vt(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function zn(l){if(Bl(l)==="html")return l;const r=l.assignedSlot||l.parentNode||lh(l)&&l.host||Wt(l);return lh(r)?r.host:r}function ah(l){const r=zn(l);return ql(r)?l.ownerDocument?l.ownerDocument.body:l.body:It(r)&&Ha(r)?r:ah(r)}function Ba(l,r,i){var o;r===void 0&&(r=[]),i===void 0&&(i=!0);const s=ah(l),f=s===((o=l.ownerDocument)==null?void 0:o.body),d=bt(s);if(f){const h=Mu(d);return r.concat(d,d.visualViewport||[],Ha(s)?s:[],h&&i?Ba(h):[])}return r.concat(s,Ba(s,[],i))}function Mu(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function rh(l){const r=Gt(l);let i=parseFloat(r.width)||0,o=parseFloat(r.height)||0;const s=It(l),f=s?l.offsetWidth:i,d=s?l.offsetHeight:o,h=ri(i)!==f||ri(o)!==d;return h&&(i=f,o=d),{width:i,height:o,$:h}}function Nu(l){return Vt(l)?l:l.contextElement}function kl(l){const r=Nu(l);if(!It(r))return Ft(1);const i=r.getBoundingClientRect(),{width:o,height:s,$:f}=rh(r);let d=(f?ri(i.width):i.width)/o,h=(f?ri(i.height):i.height)/s;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const O1=Ft(0);function ih(l){const r=bt(l);return!_u()||!r.visualViewport?O1:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function C1(l,r,i){return r===void 0&&(r=!1),!i||r&&i!==bt(l)?!1:r}function ul(l,r,i,o){r===void 0&&(r=!1),i===void 0&&(i=!1);const s=l.getBoundingClientRect(),f=Nu(l);let d=Ft(1);r&&(o?Vt(o)&&(d=kl(o)):d=kl(l));const h=C1(f,i,o)?ih(f):Ft(0);let g=(s.left+h.x)/d.x,p=(s.top+h.y)/d.y,v=s.width/d.x,b=s.height/d.y;if(f){const T=bt(f),C=o&&Vt(o)?bt(o):o;let w=T,x=Mu(w);for(;x&&o&&C!==w;){const O=kl(x),H=x.getBoundingClientRect(),K=Gt(x),Z=H.left+(x.clientLeft+parseFloat(K.paddingLeft))*O.x,Y=H.top+(x.clientTop+parseFloat(K.paddingTop))*O.y;g*=O.x,p*=O.y,v*=O.x,b*=O.y,g+=Z,p+=Y,w=bt(x),x=Mu(w)}}return ui({width:v,height:b,x:g,y:p})}function zu(l,r){const i=fi(l).scrollLeft;return r?r.left+i:ul(Wt(l)).left+i}function oh(l,r,i){i===void 0&&(i=!1);const o=l.getBoundingClientRect(),s=o.left+r.scrollLeft-(i?0:zu(l,o)),f=o.top+r.scrollTop;return{x:s,y:f}}function D1(l){let{elements:r,rect:i,offsetParent:o,strategy:s}=l;const f=s==="fixed",d=Wt(o),h=r?ci(r.floating):!1;if(o===d||h&&f)return i;let g={scrollLeft:0,scrollTop:0},p=Ft(1);const v=Ft(0),b=It(o);if((b||!b&&!f)&&((Bl(o)!=="body"||Ha(d))&&(g=fi(o)),It(o))){const C=ul(o);p=kl(o),v.x=C.x+o.clientLeft,v.y=C.y+o.clientTop}const T=d&&!b&&!f?oh(d,g,!0):Ft(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-g.scrollLeft*p.x+v.x+T.x,y:i.y*p.y-g.scrollTop*p.y+v.y+T.y}}function _1(l){return Array.from(l.getClientRects())}function M1(l){const r=Wt(l),i=fi(l),o=l.ownerDocument.body,s=vt(r.scrollWidth,r.clientWidth,o.scrollWidth,o.clientWidth),f=vt(r.scrollHeight,r.clientHeight,o.scrollHeight,o.clientHeight);let d=-i.scrollLeft+zu(l);const h=-i.scrollTop;return Gt(o).direction==="rtl"&&(d+=vt(r.clientWidth,o.clientWidth)-s),{width:s,height:f,x:d,y:h}}function N1(l,r){const i=bt(l),o=Wt(l),s=i.visualViewport;let f=o.clientWidth,d=o.clientHeight,h=0,g=0;if(s){f=s.width,d=s.height;const p=_u();(!p||p&&r==="fixed")&&(h=s.offsetLeft,g=s.offsetTop)}return{width:f,height:d,x:h,y:g}}const z1=new Set(["absolute","fixed"]);function U1(l,r){const i=ul(l,!0,r==="fixed"),o=i.top+l.clientTop,s=i.left+l.clientLeft,f=It(l)?kl(l):Ft(1),d=l.clientWidth*f.x,h=l.clientHeight*f.y,g=s*f.x,p=o*f.y;return{width:d,height:h,x:g,y:p}}function uh(l,r,i){let o;if(r==="viewport")o=N1(l,i);else if(r==="document")o=M1(Wt(l));else if(Vt(r))o=U1(r,i);else{const s=ih(l);o={x:r.x-s.x,y:r.y-s.y,width:r.width,height:r.height}}return ui(o)}function sh(l,r){const i=zn(l);return i===r||!Vt(i)||ql(i)?!1:Gt(i).position==="fixed"||sh(i,r)}function L1(l,r){const i=r.get(l);if(i)return i;let o=Ba(l,[],!1).filter(h=>Vt(h)&&Bl(h)!=="body"),s=null;const f=Gt(l).position==="fixed";let d=f?zn(l):l;for(;Vt(d)&&!ql(d);){const h=Gt(d),g=Du(d);!g&&h.position==="fixed"&&(s=null),(f?!g&&!s:!g&&h.position==="static"&&!!s&&z1.has(s.position)||Ha(d)&&!g&&sh(l,d))?o=o.filter(v=>v!==d):s=h,d=zn(d)}return r.set(l,o),o}function j1(l){let{element:r,boundary:i,rootBoundary:o,strategy:s}=l;const d=[...i==="clippingAncestors"?ci(r)?[]:L1(r,this._c):[].concat(i),o],h=d[0],g=d.reduce((p,v)=>{const b=uh(r,v,s);return p.top=vt(b.top,p.top),p.right=Nn(b.right,p.right),p.bottom=Nn(b.bottom,p.bottom),p.left=vt(b.left,p.left),p},uh(r,h,s));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function H1(l){const{width:r,height:i}=rh(l);return{width:r,height:i}}function B1(l,r,i){const o=It(r),s=Wt(r),f=i==="fixed",d=ul(l,!0,f,r);let h={scrollLeft:0,scrollTop:0};const g=Ft(0);function p(){g.x=zu(s)}if(o||!o&&!f)if((Bl(r)!=="body"||Ha(s))&&(h=fi(r)),o){const C=ul(r,!0,f,r);g.x=C.x+r.clientLeft,g.y=C.y+r.clientTop}else s&&p();f&&!o&&s&&p();const v=s&&!o&&!f?oh(s,h):Ft(0),b=d.left+h.scrollLeft-g.x-v.x,T=d.top+h.scrollTop-g.y-v.y;return{x:b,y:T,width:d.width,height:d.height}}function Uu(l){return Gt(l).position==="static"}function ch(l,r){if(!It(l)||Gt(l).position==="fixed")return null;if(r)return r(l);let i=l.offsetParent;return Wt(l)===i&&(i=i.ownerDocument.body),i}function fh(l,r){const i=bt(l);if(ci(l))return i;if(!It(l)){let s=zn(l);for(;s&&!ql(s);){if(Vt(s)&&!Uu(s))return s;s=zn(s)}return i}let o=ch(l,r);for(;o&&S1(o)&&Uu(o);)o=ch(o,r);return o&&ql(o)&&Uu(o)&&!Du(o)?i:o||T1(l)||i}const q1=async function(l){const r=this.getOffsetParent||fh,i=this.getDimensions,o=await i(l.floating);return{reference:B1(l.reference,await r(l.floating),l.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function k1(l){return Gt(l).direction==="rtl"}const V1={convertOffsetParentRelativeRectToViewportRelativeRect:D1,getDocumentElement:Wt,getClippingRect:j1,getOffsetParent:fh,getElementRects:q1,getClientRects:_1,getDimensions:H1,getScale:kl,isElement:Vt,isRTL:k1};function dh(l,r){return l.x===r.x&&l.y===r.y&&l.width===r.width&&l.height===r.height}function G1(l,r){let i=null,o;const s=Wt(l);function f(){var h;clearTimeout(o),(h=i)==null||h.disconnect(),i=null}function d(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),f();const p=l.getBoundingClientRect(),{left:v,top:b,width:T,height:C}=p;if(h||r(),!T||!C)return;const w=ii(b),x=ii(s.clientWidth-(v+T)),O=ii(s.clientHeight-(b+C)),H=ii(v),Z={rootMargin:-w+"px "+-x+"px "+-O+"px "+-H+"px",threshold:vt(0,Nn(1,g))||1};let Y=!0;function $(F){const Q=F[0].intersectionRatio;if(Q!==g){if(!Y)return d();Q?d(!1,Q):o=setTimeout(()=>{d(!1,1e-7)},1e3)}Q===1&&!dh(p,l.getBoundingClientRect())&&d(),Y=!1}try{i=new IntersectionObserver($,{...Z,root:s.ownerDocument})}catch{i=new IntersectionObserver($,Z)}i.observe(l)}return d(!0),f}function Y1(l,r,i,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,p=Nu(l),v=s||f?[...p?Ba(p):[],...Ba(r)]:[];v.forEach(H=>{s&&H.addEventListener("scroll",i,{passive:!0}),f&&H.addEventListener("resize",i)});const b=p&&h?G1(p,i):null;let T=-1,C=null;d&&(C=new ResizeObserver(H=>{let[K]=H;K&&K.target===p&&C&&(C.unobserve(r),cancelAnimationFrame(T),T=requestAnimationFrame(()=>{var Z;(Z=C)==null||Z.observe(r)})),i()}),p&&!g&&C.observe(p),C.observe(r));let w,x=g?ul(l):null;g&&O();function O(){const H=ul(l);x&&!dh(x,H)&&i(),x=H,w=requestAnimationFrame(O)}return i(),()=>{var H;v.forEach(K=>{s&&K.removeEventListener("scroll",i),f&&K.removeEventListener("resize",i)}),b?.(),(H=C)==null||H.disconnect(),C=null,g&&cancelAnimationFrame(w)}}const X1=m1,Q1=p1,Z1=f1,K1=y1,P1=d1,hh=c1,$1=g1,F1=(l,r,i)=>{const o=new Map,s={platform:V1,...i},f={...s.platform,_c:o};return s1(l,r,{...s,platform:f})};var J1=typeof document<"u",W1=function(){},di=J1?S.useLayoutEffect:W1;function hi(l,r){if(l===r)return!0;if(typeof l!=typeof r)return!1;if(typeof l=="function"&&l.toString()===r.toString())return!0;let i,o,s;if(l&&r&&typeof l=="object"){if(Array.isArray(l)){if(i=l.length,i!==r.length)return!1;for(o=i;o--!==0;)if(!hi(l[o],r[o]))return!1;return!0}if(s=Object.keys(l),i=s.length,i!==Object.keys(r).length)return!1;for(o=i;o--!==0;)if(!{}.hasOwnProperty.call(r,s[o]))return!1;for(o=i;o--!==0;){const f=s[o];if(!(f==="_owner"&&l.$$typeof)&&!hi(l[f],r[f]))return!1}return!0}return l!==l&&r!==r}function mh(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function ph(l,r){const i=mh(l);return Math.round(r*i)/i}function Lu(l){const r=S.useRef(l);return di(()=>{r.current=l}),r}function I1(l){l===void 0&&(l={});const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s,elements:{reference:f,floating:d}={},transform:h=!0,whileElementsMounted:g,open:p}=l,[v,b]=S.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[T,C]=S.useState(o);hi(T,o)||C(o);const[w,x]=S.useState(null),[O,H]=S.useState(null),K=S.useCallback(_=>{_!==F.current&&(F.current=_,x(_))},[]),Z=S.useCallback(_=>{_!==Q.current&&(Q.current=_,H(_))},[]),Y=f||w,$=d||O,F=S.useRef(null),Q=S.useRef(null),J=S.useRef(v),ie=g!=null,ce=Lu(g),Ce=Lu(s),ve=Lu(p),he=S.useCallback(()=>{if(!F.current||!Q.current)return;const _={placement:r,strategy:i,middleware:T};Ce.current&&(_.platform=Ce.current),F1(F.current,Q.current,_).then(re=>{const pe={...re,isPositioned:ve.current!==!1};me.current&&!hi(J.current,pe)&&(J.current=pe,su.flushSync(()=>{b(pe)}))})},[T,r,i,Ce,ve]);di(()=>{p===!1&&J.current.isPositioned&&(J.current.isPositioned=!1,b(_=>({..._,isPositioned:!1})))},[p]);const me=S.useRef(!1);di(()=>(me.current=!0,()=>{me.current=!1}),[]),di(()=>{if(Y&&(F.current=Y),$&&(Q.current=$),Y&&$){if(ce.current)return ce.current(Y,$,he);he()}},[Y,$,he,ce,ie]);const we=S.useMemo(()=>({reference:F,floating:Q,setReference:K,setFloating:Z}),[K,Z]),k=S.useMemo(()=>({reference:Y,floating:$}),[Y,$]),B=S.useMemo(()=>{const _={position:i,left:0,top:0};if(!k.floating)return _;const re=ph(k.floating,v.x),pe=ph(k.floating,v.y);return h?{..._,transform:"translate("+re+"px, "+pe+"px)",...mh(k.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:re,top:pe}},[i,h,k.floating,v.x,v.y]);return S.useMemo(()=>({...v,update:he,refs:we,elements:k,floatingStyles:B}),[v,he,we,k,B])}const eE=l=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:l,fn(i){const{element:o,padding:s}=typeof l=="function"?l(i):l;return o&&r(o)?o.current!=null?hh({element:o.current,padding:s}).fn(i):{}:o?hh({element:o,padding:s}).fn(i):{}}}},tE=(l,r)=>({...X1(l),options:[l,r]}),nE=(l,r)=>({...Q1(l),options:[l,r]}),lE=(l,r)=>({...$1(l),options:[l,r]}),aE=(l,r)=>({...Z1(l),options:[l,r]}),rE=(l,r)=>({...K1(l),options:[l,r]}),iE=(l,r)=>({...P1(l),options:[l,r]}),oE=(l,r)=>({...eE(l),options:[l,r]});var uE="Arrow",gh=S.forwardRef((l,r)=>{const{children:i,width:o=10,height:s=5,...f}=l;return L.jsx(lt.svg,{...f,ref:r,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:l.asChild?i:L.jsx("polygon",{points:"0,0 30,0 15,10"})})});gh.displayName=uE;var sE=gh;function cE(l){const[r,i]=S.useState(void 0);return Pt(()=>{if(l){i({width:l.offsetWidth,height:l.offsetHeight});const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const f=s[0];let d,h;if("borderBoxSize"in f){const g=f.borderBoxSize,p=Array.isArray(g)?g[0]:g;d=p.inlineSize,h=p.blockSize}else d=l.offsetWidth,h=l.offsetHeight;i({width:d,height:h})});return o.observe(l,{box:"border-box"}),()=>o.unobserve(l)}else i(void 0)},[l]),r}var ju="Popper",[yh,vh]=uu(ju),[fE,bh]=yh(ju),Sh=l=>{const{__scopePopper:r,children:i}=l,[o,s]=S.useState(null);return L.jsx(fE,{scope:r,anchor:o,onAnchorChange:s,children:i})};Sh.displayName=ju;var Eh="PopperAnchor",xh=S.forwardRef((l,r)=>{const{__scopePopper:i,virtualRef:o,...s}=l,f=bh(Eh,i),d=S.useRef(null),h=st(r,d),g=S.useRef(null);return S.useEffect(()=>{const p=g.current;g.current=o?.current||d.current,p!==g.current&&f.onAnchorChange(g.current)}),o?null:L.jsx(lt.div,{...s,ref:h})});xh.displayName=Eh;var Hu="PopperContent",[dE,hE]=yh(Hu),wh=S.forwardRef((l,r)=>{const{__scopePopper:i,side:o="bottom",sideOffset:s=0,align:f="center",alignOffset:d=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:p=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:T=!1,updatePositionStrategy:C="optimized",onPlaced:w,...x}=l,O=bh(Hu,i),[H,K]=S.useState(null),Z=st(r,I=>K(I)),[Y,$]=S.useState(null),F=cE(Y),Q=F?.width??0,J=F?.height??0,ie=o+(f!=="center"?"-"+f:""),ce=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},Ce=Array.isArray(p)?p:[p],ve=Ce.length>0,he={padding:ce,boundary:Ce.filter(pE),altBoundary:ve},{refs:me,floatingStyles:we,placement:k,isPositioned:B,middlewareData:_}=I1({strategy:"fixed",placement:ie,whileElementsMounted:(...I)=>Y1(...I,{animationFrame:C==="always"}),elements:{reference:O.anchor},middleware:[tE({mainAxis:s+J,alignmentAxis:d}),g&&nE({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?lE():void 0,...he}),g&&aE({...he}),rE({...he,apply:({elements:I,rects:Ze,availableWidth:Re,availableHeight:ot})=>{const{width:dn,height:Xt}=Ze.reference,Ln=I.floating.style;Ln.setProperty("--radix-popper-available-width",`${Re}px`),Ln.setProperty("--radix-popper-available-height",`${ot}px`),Ln.setProperty("--radix-popper-anchor-width",`${dn}px`),Ln.setProperty("--radix-popper-anchor-height",`${Xt}px`)}}),Y&&oE({element:Y,padding:h}),gE({arrowWidth:Q,arrowHeight:J}),T&&iE({strategy:"referenceHidden",...he})]}),[re,pe]=Rh(k),A=_n(w);Pt(()=>{B&&A?.()},[B,A]);const G=_.arrow?.x,W=_.arrow?.y,P=_.arrow?.centerOffset!==0,[le,Ae]=S.useState();return Pt(()=>{H&&Ae(window.getComputedStyle(H).zIndex)},[H]),L.jsx("div",{ref:me.setFloating,"data-radix-popper-content-wrapper":"",style:{...we,transform:B?we.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:L.jsx(dE,{scope:i,placedSide:re,onArrowChange:$,arrowX:G,arrowY:W,shouldHideArrow:P,children:L.jsx(lt.div,{"data-side":re,"data-align":pe,...x,ref:Z,style:{...x.style,animation:B?void 0:"none"}})})})});wh.displayName=Hu;var Ah="PopperArrow",mE={top:"bottom",right:"left",bottom:"top",left:"right"},Th=S.forwardRef(function(r,i){const{__scopePopper:o,...s}=r,f=hE(Ah,o),d=mE[f.placedSide];return L.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:L.jsx(sE,{...s,ref:i,style:{...s.style,display:"block"}})})});Th.displayName=Ah;function pE(l){return l!==null}var gE=l=>({name:"transformOrigin",options:l,fn(r){const{placement:i,rects:o,middlewareData:s}=r,d=s.arrow?.centerOffset!==0,h=d?0:l.arrowWidth,g=d?0:l.arrowHeight,[p,v]=Rh(i),b={start:"0%",center:"50%",end:"100%"}[v],T=(s.arrow?.x??0)+h/2,C=(s.arrow?.y??0)+g/2;let w="",x="";return p==="bottom"?(w=d?b:`${T}px`,x=`${-g}px`):p==="top"?(w=d?b:`${T}px`,x=`${o.floating.height+g}px`):p==="right"?(w=`${-g}px`,x=d?b:`${C}px`):p==="left"&&(w=`${o.floating.width+g}px`,x=d?b:`${C}px`),{data:{x:w,y:x}}}});function Rh(l){const[r,i="center"]=l.split("-");return[r,i]}var yE=Sh,vE=xh,bE=wh,SE=Th;function EE(l,r){return S.useReducer((i,o)=>r[i][o]??i,l)}var Bu=l=>{const{present:r,children:i}=l,o=xE(r),s=typeof i=="function"?i({present:o.isPresent}):S.Children.only(i),f=st(o.ref,wE(s));return typeof i=="function"||o.isPresent?S.cloneElement(s,{ref:f}):null};Bu.displayName="Presence";function xE(l){const[r,i]=S.useState(),o=S.useRef(null),s=S.useRef(l),f=S.useRef("none"),d=l?"mounted":"unmounted",[h,g]=EE(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const p=mi(o.current);f.current=h==="mounted"?p:"none"},[h]),Pt(()=>{const p=o.current,v=s.current;if(v!==l){const T=f.current,C=mi(p);l?g("MOUNT"):C==="none"||p?.display==="none"?g("UNMOUNT"):g(v&&T!==C?"ANIMATION_OUT":"UNMOUNT"),s.current=l}},[l,g]),Pt(()=>{if(r){let p;const v=r.ownerDocument.defaultView??window,b=C=>{const x=mi(o.current).includes(CSS.escape(C.animationName));if(C.target===r&&x&&(g("ANIMATION_END"),!s.current)){const O=r.style.animationFillMode;r.style.animationFillMode="forwards",p=v.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=O)})}},T=C=>{C.target===r&&(f.current=mi(o.current))};return r.addEventListener("animationstart",T),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{v.clearTimeout(p),r.removeEventListener("animationstart",T),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else g("ANIMATION_END")},[r,g]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:S.useCallback(p=>{o.current=p?getComputedStyle(p):null,i(p)},[])}}function mi(l){return l?.animationName||"none"}function wE(l){let r=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?l.ref:(r=Object.getOwnPropertyDescriptor(l,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?l.props.ref:l.props.ref||l.ref)}var AE=Symbol("radix.slottable");function TE(l){const r=({children:i})=>L.jsx(L.Fragment,{children:i});return r.displayName=`${l}.Slottable`,r.__radixId=AE,r}var RE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),OE="VisuallyHidden",Oh=S.forwardRef((l,r)=>L.jsx(lt.span,{...l,ref:r,style:{...RE,...l.style}}));Oh.displayName=OE;var CE=Oh,[pi,IR]=uu("Tooltip",[vh]),gi=vh(),Ch="TooltipProvider",DE=700,qu="tooltip.open",[_E,ku]=pi(Ch),Dh=l=>{const{__scopeTooltip:r,delayDuration:i=DE,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:f}=l,d=S.useRef(!0),h=S.useRef(!1),g=S.useRef(0);return S.useEffect(()=>{const p=g.current;return()=>window.clearTimeout(p)},[]),L.jsx(_E,{scope:r,isOpenDelayedRef:d,delayDuration:i,onOpen:S.useCallback(()=>{window.clearTimeout(g.current),d.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.current=!0,o)},[o]),isPointerInTransitRef:h,onPointerInTransitChange:S.useCallback(p=>{h.current=p},[]),disableHoverableContent:s,children:f})};Dh.displayName=Ch;var qa="Tooltip",[ME,ka]=pi(qa),_h=l=>{const{__scopeTooltip:r,children:i,open:o,defaultOpen:s,onOpenChange:f,disableHoverableContent:d,delayDuration:h}=l,g=ku(qa,l.__scopeTooltip),p=gi(r),[v,b]=S.useState(null),T=Kr(),C=S.useRef(0),w=d??g.disableHoverableContent,x=h??g.delayDuration,O=S.useRef(!1),[H,K]=Ff({prop:o,defaultProp:s??!1,onChange:Q=>{Q?(g.onOpen(),document.dispatchEvent(new CustomEvent(qu))):g.onClose(),f?.(Q)},caller:qa}),Z=S.useMemo(()=>H?O.current?"delayed-open":"instant-open":"closed",[H]),Y=S.useCallback(()=>{window.clearTimeout(C.current),C.current=0,O.current=!1,K(!0)},[K]),$=S.useCallback(()=>{window.clearTimeout(C.current),C.current=0,K(!1)},[K]),F=S.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{O.current=!0,K(!0),C.current=0},x)},[x,K]);return S.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]),L.jsx(yE,{...p,children:L.jsx(ME,{scope:r,contentId:T,open:H,stateAttribute:Z,trigger:v,onTriggerChange:b,onTriggerEnter:S.useCallback(()=>{g.isOpenDelayedRef.current?F():Y()},[g.isOpenDelayedRef,F,Y]),onTriggerLeave:S.useCallback(()=>{w?$():(window.clearTimeout(C.current),C.current=0)},[$,w]),onOpen:Y,onClose:$,disableHoverableContent:w,children:i})})};_h.displayName=qa;var Vu="TooltipTrigger",Mh=S.forwardRef((l,r)=>{const{__scopeTooltip:i,...o}=l,s=ka(Vu,i),f=ku(Vu,i),d=gi(i),h=S.useRef(null),g=st(r,h,s.onTriggerChange),p=S.useRef(!1),v=S.useRef(!1),b=S.useCallback(()=>p.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),L.jsx(vE,{asChild:!0,...d,children:L.jsx(lt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:g,onPointerMove:sn(l.onPointerMove,T=>{T.pointerType!=="touch"&&!v.current&&!f.isPointerInTransitRef.current&&(s.onTriggerEnter(),v.current=!0)}),onPointerLeave:sn(l.onPointerLeave,()=>{s.onTriggerLeave(),v.current=!1}),onPointerDown:sn(l.onPointerDown,()=>{s.open&&s.onClose(),p.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:sn(l.onFocus,()=>{p.current||s.onOpen()}),onBlur:sn(l.onBlur,s.onClose),onClick:sn(l.onClick,s.onClose)})})});Mh.displayName=Vu;var Gu="TooltipPortal",[NE,zE]=pi(Gu,{forceMount:void 0}),Nh=l=>{const{__scopeTooltip:r,forceMount:i,children:o,container:s}=l,f=ka(Gu,r);return L.jsx(NE,{scope:r,forceMount:i,children:L.jsx(Bu,{present:i||f.open,children:L.jsx(hu,{asChild:!0,container:s,children:o})})})};Nh.displayName=Gu;var Vl="TooltipContent",zh=S.forwardRef((l,r)=>{const i=zE(Vl,l.__scopeTooltip),{forceMount:o=i.forceMount,side:s="top",...f}=l,d=ka(Vl,l.__scopeTooltip);return L.jsx(Bu,{present:o||d.open,children:d.disableHoverableContent?L.jsx(Uh,{side:s,...f,ref:r}):L.jsx(UE,{side:s,...f,ref:r})})}),UE=S.forwardRef((l,r)=>{const i=ka(Vl,l.__scopeTooltip),o=ku(Vl,l.__scopeTooltip),s=S.useRef(null),f=st(r,s),[d,h]=S.useState(null),{trigger:g,onClose:p}=i,v=s.current,{onPointerInTransitChange:b}=o,T=S.useCallback(()=>{h(null),b(!1)},[b]),C=S.useCallback((w,x)=>{const O=w.currentTarget,H={x:w.clientX,y:w.clientY},K=BE(H,O.getBoundingClientRect()),Z=qE(H,K),Y=kE(x.getBoundingClientRect()),$=GE([...Z,...Y]);h($),b(!0)},[b]);return S.useEffect(()=>()=>T(),[T]),S.useEffect(()=>{if(g&&v){const w=O=>C(O,v),x=O=>C(O,g);return g.addEventListener("pointerleave",w),v.addEventListener("pointerleave",x),()=>{g.removeEventListener("pointerleave",w),v.removeEventListener("pointerleave",x)}}},[g,v,C,T]),S.useEffect(()=>{if(d){const w=x=>{const O=x.target,H={x:x.clientX,y:x.clientY},K=g?.contains(O)||v?.contains(O),Z=!VE(H,d);K?T():Z&&(T(),p())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[g,v,d,p,T]),L.jsx(Uh,{...l,ref:f})}),[LE,jE]=pi(qa,{isInside:!1}),HE=TE("TooltipContent"),Uh=S.forwardRef((l,r)=>{const{__scopeTooltip:i,children:o,"aria-label":s,onEscapeKeyDown:f,onPointerDownOutside:d,...h}=l,g=ka(Vl,i),p=gi(i),{onClose:v}=g;return S.useEffect(()=>(document.addEventListener(qu,v),()=>document.removeEventListener(qu,v)),[v]),S.useEffect(()=>{if(g.trigger){const b=T=>{T.target?.contains(g.trigger)&&v()};return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[g.trigger,v]),L.jsx(Zd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:b=>b.preventDefault(),onDismiss:v,children:L.jsxs(bE,{"data-state":g.stateAttribute,...p,...h,ref:r,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[L.jsx(HE,{children:o}),L.jsx(LE,{scope:i,isInside:!0,children:L.jsx(CE,{id:g.contentId,role:"tooltip",children:s||o})})]})})});zh.displayName=Vl;var Lh="TooltipArrow",jh=S.forwardRef((l,r)=>{const{__scopeTooltip:i,...o}=l,s=gi(i);return jE(Lh,i).isInside?null:L.jsx(SE,{...s,...o,ref:r})});jh.displayName=Lh;function BE(l,r){const i=Math.abs(r.top-l.y),o=Math.abs(r.bottom-l.y),s=Math.abs(r.right-l.x),f=Math.abs(r.left-l.x);switch(Math.min(i,o,s,f)){case f:return"left";case s:return"right";case i:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function qE(l,r,i=5){const o=[];switch(r){case"top":o.push({x:l.x-i,y:l.y+i},{x:l.x+i,y:l.y+i});break;case"bottom":o.push({x:l.x-i,y:l.y-i},{x:l.x+i,y:l.y-i});break;case"left":o.push({x:l.x+i,y:l.y-i},{x:l.x+i,y:l.y+i});break;case"right":o.push({x:l.x-i,y:l.y-i},{x:l.x-i,y:l.y+i});break}return o}function kE(l){const{top:r,right:i,bottom:o,left:s}=l;return[{x:s,y:r},{x:i,y:r},{x:i,y:o},{x:s,y:o}]}function VE(l,r){const{x:i,y:o}=l;let s=!1;for(let f=0,d=r.length-1;f<r.length;d=f++){const h=r[f],g=r[d],p=h.x,v=h.y,b=g.x,T=g.y;v>o!=T>o&&i<(b-p)*(o-v)/(T-v)+p&&(s=!s)}return s}function GE(l){const r=l.slice();return r.sort((i,o)=>i.x<o.x?-1:i.x>o.x?1:i.y<o.y?-1:i.y>o.y?1:0),YE(r)}function YE(l){if(l.length<=1)return l.slice();const r=[];for(let o=0;o<l.length;o++){const s=l[o];for(;r.length>=2;){const f=r[r.length-1],d=r[r.length-2];if((f.x-d.x)*(s.y-d.y)>=(f.y-d.y)*(s.x-d.x))r.pop();else break}r.push(s)}r.pop();const i=[];for(let o=l.length-1;o>=0;o--){const s=l[o];for(;i.length>=2;){const f=i[i.length-1],d=i[i.length-2];if((f.x-d.x)*(s.y-d.y)>=(f.y-d.y)*(s.x-d.x))i.pop();else break}i.push(s)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}var XE=Dh,QE=_h,ZE=Mh,KE=Nh,PE=zh,$E=jh;function FE({delayDuration:l=0,...r}){return L.jsx(XE,{"data-slot":"tooltip-provider",delayDuration:l,...r})}function JE({...l}){return L.jsx(FE,{children:L.jsx(QE,{"data-slot":"tooltip",...l})})}function WE({...l}){return L.jsx(ZE,{"data-slot":"tooltip-trigger",...l})}function IE({className:l,sideOffset:r=0,children:i,...o}){return L.jsx(KE,{children:L.jsxs(PE,{"data-slot":"tooltip-content",sideOffset:r,className:_t("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",l),...o,children:[i,L.jsx($E,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Hh({value:l,setValue:r,label:i,icon:o}){return L.jsxs("div",{className:"flex flex-col gap-1.5",children:[L.jsx("label",{className:"uppercase text-xs font-semibold",htmlFor:i,children:i}),L.jsxs(GS,{children:[L.jsx(Yd,{align:"inline-start",children:o}),L.jsx(XS,{id:i,type:"number",min:1,value:l,onChange:s=>r(Number(s.target.value))}),L.jsx(Yd,{align:"inline-end",children:L.jsx("span",{className:"text-xs bg-muted p-2",children:"in"})})]})]})}function ex({children:l,actionButton:r,widthValue:i,onWidthChange:o,heightValue:s,onHeightChange:f}){return L.jsxs(NS,{children:[L.jsx(zS,{asChild:!0,children:L.jsx(ou,{children:"Preview wallpaper"})}),L.jsxs(HS,{children:[L.jsx(BS,{children:L.jsx(kS,{children:"Preview wallpaper"})}),L.jsx("div",{className:"grid flex-1 auto-rows-min gap-6 px-4",children:l}),L.jsx(qS,{children:L.jsxs("div",{className:"flex items-start justify-between",children:[L.jsxs("div",{className:"space-y-4",children:[L.jsxs("div",{className:"flex items-center gap-1.5",children:[L.jsx("p",{className:"uppercase text-xs font-semibold",children:"Measurement"}),L.jsxs(JE,{children:[L.jsx(WE,{asChild:!0,children:L.jsx(OS,{className:"w-4"})}),L.jsx(IE,{children:L.jsx("p",{className:"max-w-[250px]",children:"State the desired measurements for your photo wallpaper. To ensure a margin when hanging, we recommend always adding about 2-4 inches extra, to the width and the height, in addition to the measurements of the wall."})})]})]}),L.jsxs("div",{className:"flex items-center gap-4",children:[L.jsx(Hh,{label:"Width",value:i,setValue:o,icon:L.jsx(DS,{className:"size-4"})}),L.jsx(Hh,{label:"Height",value:s,setValue:f,icon:L.jsx(_S,{className:"size-4"})})]})]}),L.jsxs("div",{className:"flex flex-col gap-2.5 w-1/5",children:[r,L.jsx(US,{asChild:!0,children:L.jsx(ou,{variant:"outline",children:"Cancel"})})]})]})})]})]})}const tx=({width:l=50,height:r=50,imageUrl:i,generatingImg:o})=>{const s=S.useRef(null),[f,d]=S.useState(null),h=v=>{const b=v.currentTarget,T=b.naturalWidth/b.naturalHeight;d(T)},g=r>0?l/r:1,p=()=>{if(!f||!l||!r)return{display:"none"};const v={aspectRatio:`${l} / ${r}`,boxShadow:"0 0 0 9999px rgba(255, 255, 255, 0.75)"};return g>f?{...v,width:"100%",height:"auto"}:{...v,height:"100%",width:"auto"}};return L.jsxs("div",{className:`relative justify-center items-center overflow-hidden bg-gray-100 rounded-md shadow-lg ${o?"hidden pointer-events-none":"inline-flex"}`,children:[L.jsx("img",{ref:s,src:i,alt:"Wallpaper preview",onLoad:h,className:"max-h-[70vh] w-auto object-contain block select-none",draggable:!1}),f&&L.jsx("div",{className:"absolute z-10 border-2 border-dashed border-gray-400 cursor-move",style:p(),children:L.jsx("div",{className:"absolute inset-0 flex items-end justify-end m-1 pointer-events-none",children:L.jsxs("span",{className:"bg-white/80 backdrop-blur-sm text-gray-800 text-xs font-semibold px-2 py-1 rounded shadow-sm border border-gray-200",children:[l,'" × ',r,'"']})})})]})};var nx={env:{NODE_ENV:"production"}};function lx(l,r){if(l.match(/^[a-z]+:\/\//i))return l;if(l.match(/^\/\//))return window.location.protocol+l;if(l.match(/^[a-z]+:/i))return l;const i=document.implementation.createHTMLDocument(),o=i.createElement("base"),s=i.createElement("a");return i.head.appendChild(o),i.body.appendChild(s),r&&(o.href=r),s.href=l,s.href}const ax=(()=>{let l=0;const r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(l+=1,`u${r()}${l}`)})();function Un(l){const r=[];for(let i=0,o=l.length;i<o;i++)r.push(l[i]);return r}let Gl=null;function Bh(l={}){return Gl||(l.includeStyleProperties?(Gl=l.includeStyleProperties,Gl):(Gl=Un(window.getComputedStyle(document.documentElement)),Gl))}function yi(l,r){const o=(l.ownerDocument.defaultView||window).getComputedStyle(l).getPropertyValue(r);return o?parseFloat(o.replace("px","")):0}function rx(l){const r=yi(l,"border-left-width"),i=yi(l,"border-right-width");return l.clientWidth+r+i}function ix(l){const r=yi(l,"border-top-width"),i=yi(l,"border-bottom-width");return l.clientHeight+r+i}function qh(l,r={}){const i=r.width||rx(l),o=r.height||ix(l);return{width:i,height:o}}function ox(){let l,r;try{r=nx}catch{}const i=r&&r.env?r.env.devicePixelRatio:null;return i&&(l=parseInt(i,10),Number.isNaN(l)&&(l=1)),l||window.devicePixelRatio||1}const St=16384;function ux(l){(l.width>St||l.height>St)&&(l.width>St&&l.height>St?l.width>l.height?(l.height*=St/l.width,l.width=St):(l.width*=St/l.height,l.height=St):l.width>St?(l.height*=St/l.width,l.width=St):(l.width*=St/l.height,l.height=St))}function vi(l){return new Promise((r,i)=>{const o=new Image;o.onload=()=>{o.decode().then(()=>{requestAnimationFrame(()=>r(o))})},o.onerror=i,o.crossOrigin="anonymous",o.decoding="async",o.src=l})}async function sx(l){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(l)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)}async function cx(l,r,i){const o="http://www.w3.org/2000/svg",s=document.createElementNS(o,"svg"),f=document.createElementNS(o,"foreignObject");return s.setAttribute("width",`${r}`),s.setAttribute("height",`${i}`),s.setAttribute("viewBox",`0 0 ${r} ${i}`),f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("externalResourcesRequired","true"),s.appendChild(f),f.appendChild(l),sx(s)}const ct=(l,r)=>{if(l instanceof r)return!0;const i=Object.getPrototypeOf(l);return i===null?!1:i.constructor.name===r.name||ct(i,r)};function fx(l){const r=l.getPropertyValue("content");return`${l.cssText} content: '${r.replace(/'|"/g,"")}';`}function dx(l,r){return Bh(r).map(i=>{const o=l.getPropertyValue(i),s=l.getPropertyPriority(i);return`${i}: ${o}${s?" !important":""};`}).join(" ")}function hx(l,r,i,o){const s=`.${l}:${r}`,f=i.cssText?fx(i):dx(i,o);return document.createTextNode(`${s}{${f}}`)}function kh(l,r,i,o){const s=window.getComputedStyle(l,i),f=s.getPropertyValue("content");if(f===""||f==="none")return;const d=ax();try{r.className=`${r.className} ${d}`}catch{return}const h=document.createElement("style");h.appendChild(hx(d,i,s,o)),r.appendChild(h)}function mx(l,r,i){kh(l,r,":before",i),kh(l,r,":after",i)}const Vh="application/font-woff",Gh="image/jpeg",px={woff:Vh,woff2:Vh,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Gh,jpeg:Gh,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function gx(l){const r=/\.([^./]*?)$/g.exec(l);return r?r[1]:""}function Yu(l){const r=gx(l).toLowerCase();return px[r]||""}function yx(l){return l.split(/,/)[1]}function Xu(l){return l.search(/^(data:)/)!==-1}function vx(l,r){return`data:${r};base64,${l}`}async function Yh(l,r,i){const o=await fetch(l,r);if(o.status===404)throw new Error(`Resource "${o.url}" not found`);const s=await o.blob();return new Promise((f,d)=>{const h=new FileReader;h.onerror=d,h.onloadend=()=>{try{f(i({res:o,result:h.result}))}catch(g){d(g)}},h.readAsDataURL(s)})}const Qu={};function bx(l,r,i){let o=l.replace(/\?.*/,"");return i&&(o=l),/ttf|otf|eot|woff2?/i.test(o)&&(o=o.replace(/.*\//,"")),r?`[${r}]${o}`:o}async function Zu(l,r,i){const o=bx(l,r,i.includeQueryParams);if(Qu[o]!=null)return Qu[o];i.cacheBust&&(l+=(/\?/.test(l)?"&":"?")+new Date().getTime());let s;try{const f=await Yh(l,i.fetchRequestInit,({res:d,result:h})=>(r||(r=d.headers.get("Content-Type")||""),yx(h)));s=vx(f,r)}catch(f){s=i.imagePlaceholder||"";let d=`Failed to fetch resource: ${l}`;f&&(d=typeof f=="string"?f:f.message),d&&console.warn(d)}return Qu[o]=s,s}async function Sx(l){const r=l.toDataURL();return r==="data:,"?l.cloneNode(!1):vi(r)}async function Ex(l,r){if(l.currentSrc){const f=document.createElement("canvas"),d=f.getContext("2d");f.width=l.clientWidth,f.height=l.clientHeight,d?.drawImage(l,0,0,f.width,f.height);const h=f.toDataURL();return vi(h)}const i=l.poster,o=Yu(i),s=await Zu(i,o,r);return vi(s)}async function xx(l,r){var i;try{if(!((i=l?.contentDocument)===null||i===void 0)&&i.body)return await bi(l.contentDocument.body,r,!0)}catch{}return l.cloneNode(!1)}async function wx(l,r){return ct(l,HTMLCanvasElement)?Sx(l):ct(l,HTMLVideoElement)?Ex(l,r):ct(l,HTMLIFrameElement)?xx(l,r):l.cloneNode(Xh(l))}const Ax=l=>l.tagName!=null&&l.tagName.toUpperCase()==="SLOT",Xh=l=>l.tagName!=null&&l.tagName.toUpperCase()==="SVG";async function Tx(l,r,i){var o,s;if(Xh(r))return r;let f=[];return Ax(l)&&l.assignedNodes?f=Un(l.assignedNodes()):ct(l,HTMLIFrameElement)&&(!((o=l.contentDocument)===null||o===void 0)&&o.body)?f=Un(l.contentDocument.body.childNodes):f=Un(((s=l.shadowRoot)!==null&&s!==void 0?s:l).childNodes),f.length===0||ct(l,HTMLVideoElement)||await f.reduce((d,h)=>d.then(()=>bi(h,i)).then(g=>{g&&r.appendChild(g)}),Promise.resolve()),r}function Rx(l,r,i){const o=r.style;if(!o)return;const s=window.getComputedStyle(l);s.cssText?(o.cssText=s.cssText,o.transformOrigin=s.transformOrigin):Bh(i).forEach(f=>{let d=s.getPropertyValue(f);f==="font-size"&&d.endsWith("px")&&(d=`${Math.floor(parseFloat(d.substring(0,d.length-2)))-.1}px`),ct(l,HTMLIFrameElement)&&f==="display"&&d==="inline"&&(d="block"),f==="d"&&r.getAttribute("d")&&(d=`path(${r.getAttribute("d")})`),o.setProperty(f,d,s.getPropertyPriority(f))})}function Ox(l,r){ct(l,HTMLTextAreaElement)&&(r.innerHTML=l.value),ct(l,HTMLInputElement)&&r.setAttribute("value",l.value)}function Cx(l,r){if(ct(l,HTMLSelectElement)){const i=r,o=Array.from(i.children).find(s=>l.value===s.getAttribute("value"));o&&o.setAttribute("selected","")}}function Dx(l,r,i){return ct(r,Element)&&(Rx(l,r,i),mx(l,r,i),Ox(l,r),Cx(l,r)),r}async function _x(l,r){const i=l.querySelectorAll?l.querySelectorAll("use"):[];if(i.length===0)return l;const o={};for(let f=0;f<i.length;f++){const h=i[f].getAttribute("xlink:href");if(h){const g=l.querySelector(h),p=document.querySelector(h);!g&&p&&!o[h]&&(o[h]=await bi(p,r,!0))}}const s=Object.values(o);if(s.length){const f="http://www.w3.org/1999/xhtml",d=document.createElementNS(f,"svg");d.setAttribute("xmlns",f),d.style.position="absolute",d.style.width="0",d.style.height="0",d.style.overflow="hidden",d.style.display="none";const h=document.createElementNS(f,"defs");d.appendChild(h);for(let g=0;g<s.length;g++)h.appendChild(s[g]);l.appendChild(d)}return l}async function bi(l,r,i){return!i&&r.filter&&!r.filter(l)?null:Promise.resolve(l).then(o=>wx(o,r)).then(o=>Tx(l,o,r)).then(o=>Dx(l,o,r)).then(o=>_x(o,r))}const Qh=/url\((['"]?)([^'"]+?)\1\)/g,Mx=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Nx=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function zx(l){const r=l.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function Ux(l){const r=[];return l.replace(Qh,(i,o,s)=>(r.push(s),i)),r.filter(i=>!Xu(i))}async function Lx(l,r,i,o,s){try{const f=i?lx(r,i):r,d=Yu(r);let h;return s||(h=await Zu(f,d,o)),l.replace(zx(r),`$1${h}$3`)}catch{}return l}function jx(l,{preferredFontFormat:r}){return r?l.replace(Nx,i=>{for(;;){const[o,,s]=Mx.exec(i)||[];if(!s)return"";if(s===r)return`src: ${o};`}}):l}function Zh(l){return l.search(Qh)!==-1}async function Kh(l,r,i){if(!Zh(l))return l;const o=jx(l,i);return Ux(o).reduce((f,d)=>f.then(h=>Lx(h,d,r,i)),Promise.resolve(o))}async function Yl(l,r,i){var o;const s=(o=r.style)===null||o===void 0?void 0:o.getPropertyValue(l);if(s){const f=await Kh(s,null,i);return r.style.setProperty(l,f,r.style.getPropertyPriority(l)),!0}return!1}async function Hx(l,r){await Yl("background",l,r)||await Yl("background-image",l,r),await Yl("mask",l,r)||await Yl("-webkit-mask",l,r)||await Yl("mask-image",l,r)||await Yl("-webkit-mask-image",l,r)}async function Bx(l,r){const i=ct(l,HTMLImageElement);if(!(i&&!Xu(l.src))&&!(ct(l,SVGImageElement)&&!Xu(l.href.baseVal)))return;const o=i?l.src:l.href.baseVal,s=await Zu(o,Yu(o),r);await new Promise((f,d)=>{l.onload=f,l.onerror=r.onImageErrorHandler?(...g)=>{try{f(r.onImageErrorHandler(...g))}catch(p){d(p)}}:d;const h=l;h.decode&&(h.decode=f),h.loading==="lazy"&&(h.loading="eager"),i?(l.srcset="",l.src=s):l.href.baseVal=s})}async function qx(l,r){const o=Un(l.childNodes).map(s=>Ph(s,r));await Promise.all(o).then(()=>l)}async function Ph(l,r){ct(l,Element)&&(await Hx(l,r),await Bx(l,r),await qx(l,r))}function kx(l,r){const{style:i}=l;r.backgroundColor&&(i.backgroundColor=r.backgroundColor),r.width&&(i.width=`${r.width}px`),r.height&&(i.height=`${r.height}px`);const o=r.style;return o!=null&&Object.keys(o).forEach(s=>{i[s]=o[s]}),l}const $h={};async function Fh(l){let r=$h[l];if(r!=null)return r;const o=await(await fetch(l)).text();return r={url:l,cssText:o},$h[l]=r,r}async function Jh(l,r){let i=l.cssText;const o=/url\(["']?([^"')]+)["']?\)/g,f=(i.match(/url\([^)]+\)/g)||[]).map(async d=>{let h=d.replace(o,"$1");return h.startsWith("https://")||(h=new URL(h,l.url).href),Yh(h,r.fetchRequestInit,({result:g})=>(i=i.replace(d,`url(${g})`),[d,g]))});return Promise.all(f).then(()=>i)}function Wh(l){if(l==null)return[];const r=[],i=/(\/\*[\s\S]*?\*\/)/gi;let o=l.replace(i,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const g=s.exec(o);if(g===null)break;r.push(g[0])}o=o.replace(s,"");const f=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,d="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",h=new RegExp(d,"gi");for(;;){let g=f.exec(o);if(g===null){if(g=h.exec(o),g===null)break;f.lastIndex=h.lastIndex}else h.lastIndex=f.lastIndex;r.push(g[0])}return r}async function Vx(l,r){const i=[],o=[];return l.forEach(s=>{if("cssRules"in s)try{Un(s.cssRules||[]).forEach((f,d)=>{if(f.type===CSSRule.IMPORT_RULE){let h=d+1;const g=f.href,p=Fh(g).then(v=>Jh(v,r)).then(v=>Wh(v).forEach(b=>{try{s.insertRule(b,b.startsWith("@import")?h+=1:s.cssRules.length)}catch(T){console.error("Error inserting rule from remote css",{rule:b,error:T})}})).catch(v=>{console.error("Error loading remote css",v.toString())});o.push(p)}})}catch(f){const d=l.find(h=>h.href==null)||document.styleSheets[0];s.href!=null&&o.push(Fh(s.href).then(h=>Jh(h,r)).then(h=>Wh(h).forEach(g=>{d.insertRule(g,d.cssRules.length)})).catch(h=>{console.error("Error loading remote stylesheet",h)})),console.error("Error inlining remote css file",f)}}),Promise.all(o).then(()=>(l.forEach(s=>{if("cssRules"in s)try{Un(s.cssRules||[]).forEach(f=>{i.push(f)})}catch(f){console.error(`Error while reading CSS rules from ${s.href}`,f)}}),i))}function Gx(l){return l.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>Zh(r.style.getPropertyValue("src")))}async function Yx(l,r){if(l.ownerDocument==null)throw new Error("Provided element is not within a Document");const i=Un(l.ownerDocument.styleSheets),o=await Vx(i,r);return Gx(o)}function Ih(l){return l.trim().replace(/["']/g,"")}function Xx(l){const r=new Set;function i(o){(o.style.fontFamily||getComputedStyle(o).fontFamily).split(",").forEach(f=>{r.add(Ih(f))}),Array.from(o.children).forEach(f=>{f instanceof HTMLElement&&i(f)})}return i(l),r}async function Qx(l,r){const i=await Yx(l,r),o=Xx(l);return(await Promise.all(i.filter(f=>o.has(Ih(f.style.fontFamily))).map(f=>{const d=f.parentStyleSheet?f.parentStyleSheet.href:null;return Kh(f.cssText,d,r)}))).join(`
|
|
138
|
+
*/const MS=La("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function NS({...l}){return L.jsx(gS,{"data-slot":"sheet",...l})}function zS({...l}){return L.jsx(yS,{"data-slot":"sheet-trigger",...l})}function US({...l}){return L.jsx(kd,{"data-slot":"sheet-close",...l})}function LS({...l}){return L.jsx(vS,{"data-slot":"sheet-portal",...l})}function jS({className:l,...r}){return L.jsx(bS,{"data-slot":"sheet-overlay",className:_t("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",l),...r})}function HS({className:l,children:r,side:i="right",...o}){return L.jsxs(LS,{children:[L.jsx(jS,{}),L.jsxs(SS,{"data-slot":"sheet-content",className:_t("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",i==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-[95%] border-l",i==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",i==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",i==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",l),...o,children:[r,L.jsxs(kd,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[L.jsx(MS,{className:"size-4"}),L.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function BS({className:l,...r}){return L.jsx("div",{"data-slot":"sheet-header",className:_t("flex flex-col gap-1.5 p-4",l),...r})}function qS({className:l,...r}){return L.jsx("div",{"data-slot":"sheet-footer",className:_t("mt-auto flex flex-col gap-2 p-4",l),...r})}function kS({className:l,...r}){return L.jsx(ES,{"data-slot":"sheet-title",className:_t("text-foreground font-semibold",l),...r})}function VS({className:l,type:r,...i}){return L.jsx("input",{type:r,"data-slot":"input",className:_t("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",l),...i})}function GS({className:l,...r}){return L.jsx("div",{"data-slot":"input-group",role:"group",className:_t("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",l),...r})}const YS=Lf("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5","block-end":"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function Yd({className:l,align:r="inline-start",...i}){return L.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":r,className:_t(YS({align:r}),l),onClick:o=>{o.target.closest("button")||o.currentTarget.parentElement?.querySelector("input")?.focus()},...i})}function XS({className:l,...r}){return L.jsx(VS,{"data-slot":"input-group-control",className:_t("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",l),...r})}function sn(l,r,{checkForDefaultPrevented:i=!0}={}){return function(s){if(l?.(s),i===!1||!s.defaultPrevented)return r?.(s)}}var QS="DismissableLayer",wu="dismissableLayer.update",ZS="dismissableLayer.pointerDownOutside",KS="dismissableLayer.focusOutside",Xd,Qd=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zd=S.forwardRef((l,r)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f,onInteractOutside:d,onDismiss:h,...g}=l,p=S.useContext(Qd),[v,b]=S.useState(null),T=v?.ownerDocument??globalThis?.document,[,C]=S.useState({}),w=st(r,Q=>b(Q)),x=Array.from(p.layers),[O]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),H=x.indexOf(O),K=v?x.indexOf(v):-1,Z=p.layersWithOutsidePointerEventsDisabled.size>0,Y=K>=H,$=FS(Q=>{const J=Q.target,ie=[...p.branches].some(ce=>ce.contains(J));!Y||ie||(s?.(Q),d?.(Q),Q.defaultPrevented||h?.())},T),F=JS(Q=>{const J=Q.target;[...p.branches].some(ce=>ce.contains(J))||(f?.(Q),d?.(Q),Q.defaultPrevented||h?.())},T);return Wf(Q=>{K===p.layers.size-1&&(o?.(Q),!Q.defaultPrevented&&h&&(Q.preventDefault(),h()))},T),S.useEffect(()=>{if(v)return i&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Xd=T.body.style.pointerEvents,T.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),Kd(),()=>{i&&p.layersWithOutsidePointerEventsDisabled.size===1&&(T.body.style.pointerEvents=Xd)}},[v,T,i,p]),S.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),Kd())},[v,p]),S.useEffect(()=>{const Q=()=>C({});return document.addEventListener(wu,Q),()=>document.removeEventListener(wu,Q)},[]),L.jsx(lt.div,{...g,ref:w,style:{pointerEvents:Z?Y?"auto":"none":void 0,...l.style},onFocusCapture:sn(l.onFocusCapture,F.onFocusCapture),onBlurCapture:sn(l.onBlurCapture,F.onBlurCapture),onPointerDownCapture:sn(l.onPointerDownCapture,$.onPointerDownCapture)})});Zd.displayName=QS;var PS="DismissableLayerBranch",$S=S.forwardRef((l,r)=>{const i=S.useContext(Qd),o=S.useRef(null),s=st(r,o);return S.useEffect(()=>{const f=o.current;if(f)return i.branches.add(f),()=>{i.branches.delete(f)}},[i.branches]),L.jsx(lt.div,{...l,ref:s})});$S.displayName=PS;function FS(l,r=globalThis?.document){const i=_n(l),o=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const f=h=>{if(h.target&&!o.current){let g=function(){Pd(ZS,i,p,{discrete:!0})};const p={originalEvent:h};h.pointerType==="touch"?(r.removeEventListener("click",s.current),s.current=g,r.addEventListener("click",s.current,{once:!0})):g()}else r.removeEventListener("click",s.current);o.current=!1},d=window.setTimeout(()=>{r.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(d),r.removeEventListener("pointerdown",f),r.removeEventListener("click",s.current)}},[r,i]),{onPointerDownCapture:()=>o.current=!0}}function JS(l,r=globalThis?.document){const i=_n(l),o=S.useRef(!1);return S.useEffect(()=>{const s=f=>{f.target&&!o.current&&Pd(KS,i,{originalEvent:f},{discrete:!1})};return r.addEventListener("focusin",s),()=>r.removeEventListener("focusin",s)},[r,i]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Kd(){const l=new CustomEvent(wu);document.dispatchEvent(l)}function Pd(l,r,i,{discrete:o}){const s=i.originalEvent.target,f=new CustomEvent(l,{bubbles:!1,cancelable:!0,detail:i});r&&s.addEventListener(l,r,{once:!0}),o?Jf(s,f):s.dispatchEvent(f)}const WS=["top","right","bottom","left"],Nn=Math.min,vt=Math.max,ri=Math.round,ii=Math.floor,Ft=l=>({x:l,y:l}),IS={left:"right",right:"left",bottom:"top",top:"bottom"},e1={start:"end",end:"start"};function Au(l,r,i){return vt(l,Nn(r,i))}function cn(l,r){return typeof l=="function"?l(r):l}function fn(l){return l.split("-")[0]}function Hl(l){return l.split("-")[1]}function Tu(l){return l==="x"?"y":"x"}function Ru(l){return l==="y"?"height":"width"}const t1=new Set(["top","bottom"]);function Jt(l){return t1.has(fn(l))?"y":"x"}function Ou(l){return Tu(Jt(l))}function n1(l,r,i){i===void 0&&(i=!1);const o=Hl(l),s=Ou(l),f=Ru(s);let d=s==="x"?o===(i?"end":"start")?"right":"left":o==="start"?"bottom":"top";return r.reference[f]>r.floating[f]&&(d=oi(d)),[d,oi(d)]}function l1(l){const r=oi(l);return[Cu(l),r,Cu(r)]}function Cu(l){return l.replace(/start|end/g,r=>e1[r])}const $d=["left","right"],Fd=["right","left"],a1=["top","bottom"],r1=["bottom","top"];function i1(l,r,i){switch(l){case"top":case"bottom":return i?r?Fd:$d:r?$d:Fd;case"left":case"right":return r?a1:r1;default:return[]}}function o1(l,r,i,o){const s=Hl(l);let f=i1(fn(l),i==="start",o);return s&&(f=f.map(d=>d+"-"+s),r&&(f=f.concat(f.map(Cu)))),f}function oi(l){return l.replace(/left|right|bottom|top/g,r=>IS[r])}function u1(l){return{top:0,right:0,bottom:0,left:0,...l}}function Jd(l){return typeof l!="number"?u1(l):{top:l,right:l,bottom:l,left:l}}function ui(l){const{x:r,y:i,width:o,height:s}=l;return{width:o,height:s,top:i,left:r,right:r+o,bottom:i+s,x:r,y:i}}function Wd(l,r,i){let{reference:o,floating:s}=l;const f=Jt(r),d=Ou(r),h=Ru(d),g=fn(r),p=f==="y",v=o.x+o.width/2-s.width/2,b=o.y+o.height/2-s.height/2,T=o[h]/2-s[h]/2;let C;switch(g){case"top":C={x:v,y:o.y-s.height};break;case"bottom":C={x:v,y:o.y+o.height};break;case"right":C={x:o.x+o.width,y:b};break;case"left":C={x:o.x-s.width,y:b};break;default:C={x:o.x,y:o.y}}switch(Hl(r)){case"start":C[d]-=T*(i&&p?-1:1);break;case"end":C[d]+=T*(i&&p?-1:1);break}return C}const s1=async(l,r,i)=>{const{placement:o="bottom",strategy:s="absolute",middleware:f=[],platform:d}=i,h=f.filter(Boolean),g=await(d.isRTL==null?void 0:d.isRTL(r));let p=await d.getElementRects({reference:l,floating:r,strategy:s}),{x:v,y:b}=Wd(p,o,g),T=o,C={},w=0;for(let x=0;x<h.length;x++){const{name:O,fn:H}=h[x],{x:K,y:Z,data:Y,reset:$}=await H({x:v,y:b,initialPlacement:o,placement:T,strategy:s,middlewareData:C,rects:p,platform:d,elements:{reference:l,floating:r}});v=K??v,b=Z??b,C={...C,[O]:{...C[O],...Y}},$&&w<=50&&(w++,typeof $=="object"&&($.placement&&(T=$.placement),$.rects&&(p=$.rects===!0?await d.getElementRects({reference:l,floating:r,strategy:s}):$.rects),{x:v,y:b}=Wd(p,T,g)),x=-1)}return{x:v,y:b,placement:T,strategy:s,middlewareData:C}};async function ja(l,r){var i;r===void 0&&(r={});const{x:o,y:s,platform:f,rects:d,elements:h,strategy:g}=l,{boundary:p="clippingAncestors",rootBoundary:v="viewport",elementContext:b="floating",altBoundary:T=!1,padding:C=0}=cn(r,l),w=Jd(C),O=h[T?b==="floating"?"reference":"floating":b],H=ui(await f.getClippingRect({element:(i=await(f.isElement==null?void 0:f.isElement(O)))==null||i?O:O.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(h.floating)),boundary:p,rootBoundary:v,strategy:g})),K=b==="floating"?{x:o,y:s,width:d.floating.width,height:d.floating.height}:d.reference,Z=await(f.getOffsetParent==null?void 0:f.getOffsetParent(h.floating)),Y=await(f.isElement==null?void 0:f.isElement(Z))?await(f.getScale==null?void 0:f.getScale(Z))||{x:1,y:1}:{x:1,y:1},$=ui(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:K,offsetParent:Z,strategy:g}):K);return{top:(H.top-$.top+w.top)/Y.y,bottom:($.bottom-H.bottom+w.bottom)/Y.y,left:(H.left-$.left+w.left)/Y.x,right:($.right-H.right+w.right)/Y.x}}const c1=l=>({name:"arrow",options:l,async fn(r){const{x:i,y:o,placement:s,rects:f,platform:d,elements:h,middlewareData:g}=r,{element:p,padding:v=0}=cn(l,r)||{};if(p==null)return{};const b=Jd(v),T={x:i,y:o},C=Ou(s),w=Ru(C),x=await d.getDimensions(p),O=C==="y",H=O?"top":"left",K=O?"bottom":"right",Z=O?"clientHeight":"clientWidth",Y=f.reference[w]+f.reference[C]-T[C]-f.floating[w],$=T[C]-f.reference[C],F=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let Q=F?F[Z]:0;(!Q||!await(d.isElement==null?void 0:d.isElement(F)))&&(Q=h.floating[Z]||f.floating[w]);const J=Y/2-$/2,ie=Q/2-x[w]/2-1,ce=Nn(b[H],ie),Ce=Nn(b[K],ie),ve=ce,he=Q-x[w]-Ce,me=Q/2-x[w]/2+J,we=Au(ve,me,he),k=!g.arrow&&Hl(s)!=null&&me!==we&&f.reference[w]/2-(me<ve?ce:Ce)-x[w]/2<0,B=k?me<ve?me-ve:me-he:0;return{[C]:T[C]+B,data:{[C]:we,centerOffset:me-we-B,...k&&{alignmentOffset:B}},reset:k}}}),f1=function(l){return l===void 0&&(l={}),{name:"flip",options:l,async fn(r){var i,o;const{placement:s,middlewareData:f,rects:d,initialPlacement:h,platform:g,elements:p}=r,{mainAxis:v=!0,crossAxis:b=!0,fallbackPlacements:T,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...O}=cn(l,r);if((i=f.arrow)!=null&&i.alignmentOffset)return{};const H=fn(s),K=Jt(h),Z=fn(h)===h,Y=await(g.isRTL==null?void 0:g.isRTL(p.floating)),$=T||(Z||!x?[oi(h)]:l1(h)),F=w!=="none";!T&&F&&$.push(...o1(h,x,w,Y));const Q=[h,...$],J=await ja(r,O),ie=[];let ce=((o=f.flip)==null?void 0:o.overflows)||[];if(v&&ie.push(J[H]),b){const me=n1(s,d,Y);ie.push(J[me[0]],J[me[1]])}if(ce=[...ce,{placement:s,overflows:ie}],!ie.every(me=>me<=0)){var Ce,ve;const me=(((Ce=f.flip)==null?void 0:Ce.index)||0)+1,we=Q[me];if(we&&(!(b==="alignment"?K!==Jt(we):!1)||ce.every(_=>_.overflows[0]>0&&Jt(_.placement)===K)))return{data:{index:me,overflows:ce},reset:{placement:we}};let k=(ve=ce.filter(B=>B.overflows[0]<=0).sort((B,_)=>B.overflows[1]-_.overflows[1])[0])==null?void 0:ve.placement;if(!k)switch(C){case"bestFit":{var he;const B=(he=ce.filter(_=>{if(F){const re=Jt(_.placement);return re===K||re==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(re=>re>0).reduce((re,pe)=>re+pe,0)]).sort((_,re)=>_[1]-re[1])[0])==null?void 0:he[0];B&&(k=B);break}case"initialPlacement":k=h;break}if(s!==k)return{reset:{placement:k}}}return{}}}};function Id(l,r){return{top:l.top-r.height,right:l.right-r.width,bottom:l.bottom-r.height,left:l.left-r.width}}function eh(l){return WS.some(r=>l[r]>=0)}const d1=function(l){return l===void 0&&(l={}),{name:"hide",options:l,async fn(r){const{rects:i}=r,{strategy:o="referenceHidden",...s}=cn(l,r);switch(o){case"referenceHidden":{const f=await ja(r,{...s,elementContext:"reference"}),d=Id(f,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:eh(d)}}}case"escaped":{const f=await ja(r,{...s,altBoundary:!0}),d=Id(f,i.floating);return{data:{escapedOffsets:d,escaped:eh(d)}}}default:return{}}}}},th=new Set(["left","top"]);async function h1(l,r){const{placement:i,platform:o,elements:s}=l,f=await(o.isRTL==null?void 0:o.isRTL(s.floating)),d=fn(i),h=Hl(i),g=Jt(i)==="y",p=th.has(d)?-1:1,v=f&&g?-1:1,b=cn(r,l);let{mainAxis:T,crossAxis:C,alignmentAxis:w}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return h&&typeof w=="number"&&(C=h==="end"?w*-1:w),g?{x:C*v,y:T*p}:{x:T*p,y:C*v}}const m1=function(l){return l===void 0&&(l=0),{name:"offset",options:l,async fn(r){var i,o;const{x:s,y:f,placement:d,middlewareData:h}=r,g=await h1(r,l);return d===((i=h.offset)==null?void 0:i.placement)&&(o=h.arrow)!=null&&o.alignmentOffset?{}:{x:s+g.x,y:f+g.y,data:{...g,placement:d}}}}},p1=function(l){return l===void 0&&(l={}),{name:"shift",options:l,async fn(r){const{x:i,y:o,placement:s}=r,{mainAxis:f=!0,crossAxis:d=!1,limiter:h={fn:O=>{let{x:H,y:K}=O;return{x:H,y:K}}},...g}=cn(l,r),p={x:i,y:o},v=await ja(r,g),b=Jt(fn(s)),T=Tu(b);let C=p[T],w=p[b];if(f){const O=T==="y"?"top":"left",H=T==="y"?"bottom":"right",K=C+v[O],Z=C-v[H];C=Au(K,C,Z)}if(d){const O=b==="y"?"top":"left",H=b==="y"?"bottom":"right",K=w+v[O],Z=w-v[H];w=Au(K,w,Z)}const x=h.fn({...r,[T]:C,[b]:w});return{...x,data:{x:x.x-i,y:x.y-o,enabled:{[T]:f,[b]:d}}}}}},g1=function(l){return l===void 0&&(l={}),{options:l,fn(r){const{x:i,y:o,placement:s,rects:f,middlewareData:d}=r,{offset:h=0,mainAxis:g=!0,crossAxis:p=!0}=cn(l,r),v={x:i,y:o},b=Jt(s),T=Tu(b);let C=v[T],w=v[b];const x=cn(h,r),O=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(g){const Z=T==="y"?"height":"width",Y=f.reference[T]-f.floating[Z]+O.mainAxis,$=f.reference[T]+f.reference[Z]-O.mainAxis;C<Y?C=Y:C>$&&(C=$)}if(p){var H,K;const Z=T==="y"?"width":"height",Y=th.has(fn(s)),$=f.reference[b]-f.floating[Z]+(Y&&((H=d.offset)==null?void 0:H[b])||0)+(Y?0:O.crossAxis),F=f.reference[b]+f.reference[Z]+(Y?0:((K=d.offset)==null?void 0:K[b])||0)-(Y?O.crossAxis:0);w<$?w=$:w>F&&(w=F)}return{[T]:C,[b]:w}}}},y1=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(r){var i,o;const{placement:s,rects:f,platform:d,elements:h}=r,{apply:g=()=>{},...p}=cn(l,r),v=await ja(r,p),b=fn(s),T=Hl(s),C=Jt(s)==="y",{width:w,height:x}=f.floating;let O,H;b==="top"||b==="bottom"?(O=b,H=T===(await(d.isRTL==null?void 0:d.isRTL(h.floating))?"start":"end")?"left":"right"):(H=b,O=T==="end"?"top":"bottom");const K=x-v.top-v.bottom,Z=w-v.left-v.right,Y=Nn(x-v[O],K),$=Nn(w-v[H],Z),F=!r.middlewareData.shift;let Q=Y,J=$;if((i=r.middlewareData.shift)!=null&&i.enabled.x&&(J=Z),(o=r.middlewareData.shift)!=null&&o.enabled.y&&(Q=K),F&&!T){const ce=vt(v.left,0),Ce=vt(v.right,0),ve=vt(v.top,0),he=vt(v.bottom,0);C?J=w-2*(ce!==0||Ce!==0?ce+Ce:vt(v.left,v.right)):Q=x-2*(ve!==0||he!==0?ve+he:vt(v.top,v.bottom))}await g({...r,availableWidth:J,availableHeight:Q});const ie=await d.getDimensions(h.floating);return w!==ie.width||x!==ie.height?{reset:{rects:!0}}:{}}}};function si(){return typeof window<"u"}function Bl(l){return nh(l)?(l.nodeName||"").toLowerCase():"#document"}function bt(l){var r;return(l==null||(r=l.ownerDocument)==null?void 0:r.defaultView)||window}function Wt(l){var r;return(r=(nh(l)?l.ownerDocument:l.document)||window.document)==null?void 0:r.documentElement}function nh(l){return si()?l instanceof Node||l instanceof bt(l).Node:!1}function Vt(l){return si()?l instanceof Element||l instanceof bt(l).Element:!1}function It(l){return si()?l instanceof HTMLElement||l instanceof bt(l).HTMLElement:!1}function lh(l){return!si()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof bt(l).ShadowRoot}const v1=new Set(["inline","contents"]);function Ha(l){const{overflow:r,overflowX:i,overflowY:o,display:s}=Gt(l);return/auto|scroll|overlay|hidden|clip/.test(r+o+i)&&!v1.has(s)}const b1=new Set(["table","td","th"]);function S1(l){return b1.has(Bl(l))}const E1=[":popover-open",":modal"];function ci(l){return E1.some(r=>{try{return l.matches(r)}catch{return!1}})}const x1=["transform","translate","scale","rotate","perspective"],w1=["transform","translate","scale","rotate","perspective","filter"],A1=["paint","layout","strict","content"];function Du(l){const r=_u(),i=Vt(l)?Gt(l):l;return x1.some(o=>i[o]?i[o]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!r&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!r&&(i.filter?i.filter!=="none":!1)||w1.some(o=>(i.willChange||"").includes(o))||A1.some(o=>(i.contain||"").includes(o))}function T1(l){let r=zn(l);for(;It(r)&&!ql(r);){if(Du(r))return r;if(ci(r))return null;r=zn(r)}return null}function _u(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const R1=new Set(["html","body","#document"]);function ql(l){return R1.has(Bl(l))}function Gt(l){return bt(l).getComputedStyle(l)}function fi(l){return Vt(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function zn(l){if(Bl(l)==="html")return l;const r=l.assignedSlot||l.parentNode||lh(l)&&l.host||Wt(l);return lh(r)?r.host:r}function ah(l){const r=zn(l);return ql(r)?l.ownerDocument?l.ownerDocument.body:l.body:It(r)&&Ha(r)?r:ah(r)}function Ba(l,r,i){var o;r===void 0&&(r=[]),i===void 0&&(i=!0);const s=ah(l),f=s===((o=l.ownerDocument)==null?void 0:o.body),d=bt(s);if(f){const h=Mu(d);return r.concat(d,d.visualViewport||[],Ha(s)?s:[],h&&i?Ba(h):[])}return r.concat(s,Ba(s,[],i))}function Mu(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function rh(l){const r=Gt(l);let i=parseFloat(r.width)||0,o=parseFloat(r.height)||0;const s=It(l),f=s?l.offsetWidth:i,d=s?l.offsetHeight:o,h=ri(i)!==f||ri(o)!==d;return h&&(i=f,o=d),{width:i,height:o,$:h}}function Nu(l){return Vt(l)?l:l.contextElement}function kl(l){const r=Nu(l);if(!It(r))return Ft(1);const i=r.getBoundingClientRect(),{width:o,height:s,$:f}=rh(r);let d=(f?ri(i.width):i.width)/o,h=(f?ri(i.height):i.height)/s;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const O1=Ft(0);function ih(l){const r=bt(l);return!_u()||!r.visualViewport?O1:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function C1(l,r,i){return r===void 0&&(r=!1),!i||r&&i!==bt(l)?!1:r}function ul(l,r,i,o){r===void 0&&(r=!1),i===void 0&&(i=!1);const s=l.getBoundingClientRect(),f=Nu(l);let d=Ft(1);r&&(o?Vt(o)&&(d=kl(o)):d=kl(l));const h=C1(f,i,o)?ih(f):Ft(0);let g=(s.left+h.x)/d.x,p=(s.top+h.y)/d.y,v=s.width/d.x,b=s.height/d.y;if(f){const T=bt(f),C=o&&Vt(o)?bt(o):o;let w=T,x=Mu(w);for(;x&&o&&C!==w;){const O=kl(x),H=x.getBoundingClientRect(),K=Gt(x),Z=H.left+(x.clientLeft+parseFloat(K.paddingLeft))*O.x,Y=H.top+(x.clientTop+parseFloat(K.paddingTop))*O.y;g*=O.x,p*=O.y,v*=O.x,b*=O.y,g+=Z,p+=Y,w=bt(x),x=Mu(w)}}return ui({width:v,height:b,x:g,y:p})}function zu(l,r){const i=fi(l).scrollLeft;return r?r.left+i:ul(Wt(l)).left+i}function oh(l,r,i){i===void 0&&(i=!1);const o=l.getBoundingClientRect(),s=o.left+r.scrollLeft-(i?0:zu(l,o)),f=o.top+r.scrollTop;return{x:s,y:f}}function D1(l){let{elements:r,rect:i,offsetParent:o,strategy:s}=l;const f=s==="fixed",d=Wt(o),h=r?ci(r.floating):!1;if(o===d||h&&f)return i;let g={scrollLeft:0,scrollTop:0},p=Ft(1);const v=Ft(0),b=It(o);if((b||!b&&!f)&&((Bl(o)!=="body"||Ha(d))&&(g=fi(o)),It(o))){const C=ul(o);p=kl(o),v.x=C.x+o.clientLeft,v.y=C.y+o.clientTop}const T=d&&!b&&!f?oh(d,g,!0):Ft(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-g.scrollLeft*p.x+v.x+T.x,y:i.y*p.y-g.scrollTop*p.y+v.y+T.y}}function _1(l){return Array.from(l.getClientRects())}function M1(l){const r=Wt(l),i=fi(l),o=l.ownerDocument.body,s=vt(r.scrollWidth,r.clientWidth,o.scrollWidth,o.clientWidth),f=vt(r.scrollHeight,r.clientHeight,o.scrollHeight,o.clientHeight);let d=-i.scrollLeft+zu(l);const h=-i.scrollTop;return Gt(o).direction==="rtl"&&(d+=vt(r.clientWidth,o.clientWidth)-s),{width:s,height:f,x:d,y:h}}function N1(l,r){const i=bt(l),o=Wt(l),s=i.visualViewport;let f=o.clientWidth,d=o.clientHeight,h=0,g=0;if(s){f=s.width,d=s.height;const p=_u();(!p||p&&r==="fixed")&&(h=s.offsetLeft,g=s.offsetTop)}return{width:f,height:d,x:h,y:g}}const z1=new Set(["absolute","fixed"]);function U1(l,r){const i=ul(l,!0,r==="fixed"),o=i.top+l.clientTop,s=i.left+l.clientLeft,f=It(l)?kl(l):Ft(1),d=l.clientWidth*f.x,h=l.clientHeight*f.y,g=s*f.x,p=o*f.y;return{width:d,height:h,x:g,y:p}}function uh(l,r,i){let o;if(r==="viewport")o=N1(l,i);else if(r==="document")o=M1(Wt(l));else if(Vt(r))o=U1(r,i);else{const s=ih(l);o={x:r.x-s.x,y:r.y-s.y,width:r.width,height:r.height}}return ui(o)}function sh(l,r){const i=zn(l);return i===r||!Vt(i)||ql(i)?!1:Gt(i).position==="fixed"||sh(i,r)}function L1(l,r){const i=r.get(l);if(i)return i;let o=Ba(l,[],!1).filter(h=>Vt(h)&&Bl(h)!=="body"),s=null;const f=Gt(l).position==="fixed";let d=f?zn(l):l;for(;Vt(d)&&!ql(d);){const h=Gt(d),g=Du(d);!g&&h.position==="fixed"&&(s=null),(f?!g&&!s:!g&&h.position==="static"&&!!s&&z1.has(s.position)||Ha(d)&&!g&&sh(l,d))?o=o.filter(v=>v!==d):s=h,d=zn(d)}return r.set(l,o),o}function j1(l){let{element:r,boundary:i,rootBoundary:o,strategy:s}=l;const d=[...i==="clippingAncestors"?ci(r)?[]:L1(r,this._c):[].concat(i),o],h=d[0],g=d.reduce((p,v)=>{const b=uh(r,v,s);return p.top=vt(b.top,p.top),p.right=Nn(b.right,p.right),p.bottom=Nn(b.bottom,p.bottom),p.left=vt(b.left,p.left),p},uh(r,h,s));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function H1(l){const{width:r,height:i}=rh(l);return{width:r,height:i}}function B1(l,r,i){const o=It(r),s=Wt(r),f=i==="fixed",d=ul(l,!0,f,r);let h={scrollLeft:0,scrollTop:0};const g=Ft(0);function p(){g.x=zu(s)}if(o||!o&&!f)if((Bl(r)!=="body"||Ha(s))&&(h=fi(r)),o){const C=ul(r,!0,f,r);g.x=C.x+r.clientLeft,g.y=C.y+r.clientTop}else s&&p();f&&!o&&s&&p();const v=s&&!o&&!f?oh(s,h):Ft(0),b=d.left+h.scrollLeft-g.x-v.x,T=d.top+h.scrollTop-g.y-v.y;return{x:b,y:T,width:d.width,height:d.height}}function Uu(l){return Gt(l).position==="static"}function ch(l,r){if(!It(l)||Gt(l).position==="fixed")return null;if(r)return r(l);let i=l.offsetParent;return Wt(l)===i&&(i=i.ownerDocument.body),i}function fh(l,r){const i=bt(l);if(ci(l))return i;if(!It(l)){let s=zn(l);for(;s&&!ql(s);){if(Vt(s)&&!Uu(s))return s;s=zn(s)}return i}let o=ch(l,r);for(;o&&S1(o)&&Uu(o);)o=ch(o,r);return o&&ql(o)&&Uu(o)&&!Du(o)?i:o||T1(l)||i}const q1=async function(l){const r=this.getOffsetParent||fh,i=this.getDimensions,o=await i(l.floating);return{reference:B1(l.reference,await r(l.floating),l.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function k1(l){return Gt(l).direction==="rtl"}const V1={convertOffsetParentRelativeRectToViewportRelativeRect:D1,getDocumentElement:Wt,getClippingRect:j1,getOffsetParent:fh,getElementRects:q1,getClientRects:_1,getDimensions:H1,getScale:kl,isElement:Vt,isRTL:k1};function dh(l,r){return l.x===r.x&&l.y===r.y&&l.width===r.width&&l.height===r.height}function G1(l,r){let i=null,o;const s=Wt(l);function f(){var h;clearTimeout(o),(h=i)==null||h.disconnect(),i=null}function d(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),f();const p=l.getBoundingClientRect(),{left:v,top:b,width:T,height:C}=p;if(h||r(),!T||!C)return;const w=ii(b),x=ii(s.clientWidth-(v+T)),O=ii(s.clientHeight-(b+C)),H=ii(v),Z={rootMargin:-w+"px "+-x+"px "+-O+"px "+-H+"px",threshold:vt(0,Nn(1,g))||1};let Y=!0;function $(F){const Q=F[0].intersectionRatio;if(Q!==g){if(!Y)return d();Q?d(!1,Q):o=setTimeout(()=>{d(!1,1e-7)},1e3)}Q===1&&!dh(p,l.getBoundingClientRect())&&d(),Y=!1}try{i=new IntersectionObserver($,{...Z,root:s.ownerDocument})}catch{i=new IntersectionObserver($,Z)}i.observe(l)}return d(!0),f}function Y1(l,r,i,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,p=Nu(l),v=s||f?[...p?Ba(p):[],...Ba(r)]:[];v.forEach(H=>{s&&H.addEventListener("scroll",i,{passive:!0}),f&&H.addEventListener("resize",i)});const b=p&&h?G1(p,i):null;let T=-1,C=null;d&&(C=new ResizeObserver(H=>{let[K]=H;K&&K.target===p&&C&&(C.unobserve(r),cancelAnimationFrame(T),T=requestAnimationFrame(()=>{var Z;(Z=C)==null||Z.observe(r)})),i()}),p&&!g&&C.observe(p),C.observe(r));let w,x=g?ul(l):null;g&&O();function O(){const H=ul(l);x&&!dh(x,H)&&i(),x=H,w=requestAnimationFrame(O)}return i(),()=>{var H;v.forEach(K=>{s&&K.removeEventListener("scroll",i),f&&K.removeEventListener("resize",i)}),b?.(),(H=C)==null||H.disconnect(),C=null,g&&cancelAnimationFrame(w)}}const X1=m1,Q1=p1,Z1=f1,K1=y1,P1=d1,hh=c1,$1=g1,F1=(l,r,i)=>{const o=new Map,s={platform:V1,...i},f={...s.platform,_c:o};return s1(l,r,{...s,platform:f})};var J1=typeof document<"u",W1=function(){},di=J1?S.useLayoutEffect:W1;function hi(l,r){if(l===r)return!0;if(typeof l!=typeof r)return!1;if(typeof l=="function"&&l.toString()===r.toString())return!0;let i,o,s;if(l&&r&&typeof l=="object"){if(Array.isArray(l)){if(i=l.length,i!==r.length)return!1;for(o=i;o--!==0;)if(!hi(l[o],r[o]))return!1;return!0}if(s=Object.keys(l),i=s.length,i!==Object.keys(r).length)return!1;for(o=i;o--!==0;)if(!{}.hasOwnProperty.call(r,s[o]))return!1;for(o=i;o--!==0;){const f=s[o];if(!(f==="_owner"&&l.$$typeof)&&!hi(l[f],r[f]))return!1}return!0}return l!==l&&r!==r}function mh(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function ph(l,r){const i=mh(l);return Math.round(r*i)/i}function Lu(l){const r=S.useRef(l);return di(()=>{r.current=l}),r}function I1(l){l===void 0&&(l={});const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s,elements:{reference:f,floating:d}={},transform:h=!0,whileElementsMounted:g,open:p}=l,[v,b]=S.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[T,C]=S.useState(o);hi(T,o)||C(o);const[w,x]=S.useState(null),[O,H]=S.useState(null),K=S.useCallback(_=>{_!==F.current&&(F.current=_,x(_))},[]),Z=S.useCallback(_=>{_!==Q.current&&(Q.current=_,H(_))},[]),Y=f||w,$=d||O,F=S.useRef(null),Q=S.useRef(null),J=S.useRef(v),ie=g!=null,ce=Lu(g),Ce=Lu(s),ve=Lu(p),he=S.useCallback(()=>{if(!F.current||!Q.current)return;const _={placement:r,strategy:i,middleware:T};Ce.current&&(_.platform=Ce.current),F1(F.current,Q.current,_).then(re=>{const pe={...re,isPositioned:ve.current!==!1};me.current&&!hi(J.current,pe)&&(J.current=pe,su.flushSync(()=>{b(pe)}))})},[T,r,i,Ce,ve]);di(()=>{p===!1&&J.current.isPositioned&&(J.current.isPositioned=!1,b(_=>({..._,isPositioned:!1})))},[p]);const me=S.useRef(!1);di(()=>(me.current=!0,()=>{me.current=!1}),[]),di(()=>{if(Y&&(F.current=Y),$&&(Q.current=$),Y&&$){if(ce.current)return ce.current(Y,$,he);he()}},[Y,$,he,ce,ie]);const we=S.useMemo(()=>({reference:F,floating:Q,setReference:K,setFloating:Z}),[K,Z]),k=S.useMemo(()=>({reference:Y,floating:$}),[Y,$]),B=S.useMemo(()=>{const _={position:i,left:0,top:0};if(!k.floating)return _;const re=ph(k.floating,v.x),pe=ph(k.floating,v.y);return h?{..._,transform:"translate("+re+"px, "+pe+"px)",...mh(k.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:re,top:pe}},[i,h,k.floating,v.x,v.y]);return S.useMemo(()=>({...v,update:he,refs:we,elements:k,floatingStyles:B}),[v,he,we,k,B])}const eE=l=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:l,fn(i){const{element:o,padding:s}=typeof l=="function"?l(i):l;return o&&r(o)?o.current!=null?hh({element:o.current,padding:s}).fn(i):{}:o?hh({element:o,padding:s}).fn(i):{}}}},tE=(l,r)=>({...X1(l),options:[l,r]}),nE=(l,r)=>({...Q1(l),options:[l,r]}),lE=(l,r)=>({...$1(l),options:[l,r]}),aE=(l,r)=>({...Z1(l),options:[l,r]}),rE=(l,r)=>({...K1(l),options:[l,r]}),iE=(l,r)=>({...P1(l),options:[l,r]}),oE=(l,r)=>({...eE(l),options:[l,r]});var uE="Arrow",gh=S.forwardRef((l,r)=>{const{children:i,width:o=10,height:s=5,...f}=l;return L.jsx(lt.svg,{...f,ref:r,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:l.asChild?i:L.jsx("polygon",{points:"0,0 30,0 15,10"})})});gh.displayName=uE;var sE=gh;function cE(l){const[r,i]=S.useState(void 0);return Pt(()=>{if(l){i({width:l.offsetWidth,height:l.offsetHeight});const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const f=s[0];let d,h;if("borderBoxSize"in f){const g=f.borderBoxSize,p=Array.isArray(g)?g[0]:g;d=p.inlineSize,h=p.blockSize}else d=l.offsetWidth,h=l.offsetHeight;i({width:d,height:h})});return o.observe(l,{box:"border-box"}),()=>o.unobserve(l)}else i(void 0)},[l]),r}var ju="Popper",[yh,vh]=uu(ju),[fE,bh]=yh(ju),Sh=l=>{const{__scopePopper:r,children:i}=l,[o,s]=S.useState(null);return L.jsx(fE,{scope:r,anchor:o,onAnchorChange:s,children:i})};Sh.displayName=ju;var Eh="PopperAnchor",xh=S.forwardRef((l,r)=>{const{__scopePopper:i,virtualRef:o,...s}=l,f=bh(Eh,i),d=S.useRef(null),h=st(r,d),g=S.useRef(null);return S.useEffect(()=>{const p=g.current;g.current=o?.current||d.current,p!==g.current&&f.onAnchorChange(g.current)}),o?null:L.jsx(lt.div,{...s,ref:h})});xh.displayName=Eh;var Hu="PopperContent",[dE,hE]=yh(Hu),wh=S.forwardRef((l,r)=>{const{__scopePopper:i,side:o="bottom",sideOffset:s=0,align:f="center",alignOffset:d=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:p=[],collisionPadding:v=0,sticky:b="partial",hideWhenDetached:T=!1,updatePositionStrategy:C="optimized",onPlaced:w,...x}=l,O=bh(Hu,i),[H,K]=S.useState(null),Z=st(r,I=>K(I)),[Y,$]=S.useState(null),F=cE(Y),Q=F?.width??0,J=F?.height??0,ie=o+(f!=="center"?"-"+f:""),ce=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},Ce=Array.isArray(p)?p:[p],ve=Ce.length>0,he={padding:ce,boundary:Ce.filter(pE),altBoundary:ve},{refs:me,floatingStyles:we,placement:k,isPositioned:B,middlewareData:_}=I1({strategy:"fixed",placement:ie,whileElementsMounted:(...I)=>Y1(...I,{animationFrame:C==="always"}),elements:{reference:O.anchor},middleware:[tE({mainAxis:s+J,alignmentAxis:d}),g&&nE({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?lE():void 0,...he}),g&&aE({...he}),rE({...he,apply:({elements:I,rects:Ze,availableWidth:Re,availableHeight:ot})=>{const{width:dn,height:Xt}=Ze.reference,Ln=I.floating.style;Ln.setProperty("--radix-popper-available-width",`${Re}px`),Ln.setProperty("--radix-popper-available-height",`${ot}px`),Ln.setProperty("--radix-popper-anchor-width",`${dn}px`),Ln.setProperty("--radix-popper-anchor-height",`${Xt}px`)}}),Y&&oE({element:Y,padding:h}),gE({arrowWidth:Q,arrowHeight:J}),T&&iE({strategy:"referenceHidden",...he})]}),[re,pe]=Rh(k),A=_n(w);Pt(()=>{B&&A?.()},[B,A]);const G=_.arrow?.x,W=_.arrow?.y,P=_.arrow?.centerOffset!==0,[le,Ae]=S.useState();return Pt(()=>{H&&Ae(window.getComputedStyle(H).zIndex)},[H]),L.jsx("div",{ref:me.setFloating,"data-radix-popper-content-wrapper":"",style:{...we,transform:B?we.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:L.jsx(dE,{scope:i,placedSide:re,onArrowChange:$,arrowX:G,arrowY:W,shouldHideArrow:P,children:L.jsx(lt.div,{"data-side":re,"data-align":pe,...x,ref:Z,style:{...x.style,animation:B?void 0:"none"}})})})});wh.displayName=Hu;var Ah="PopperArrow",mE={top:"bottom",right:"left",bottom:"top",left:"right"},Th=S.forwardRef(function(r,i){const{__scopePopper:o,...s}=r,f=hE(Ah,o),d=mE[f.placedSide];return L.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:L.jsx(sE,{...s,ref:i,style:{...s.style,display:"block"}})})});Th.displayName=Ah;function pE(l){return l!==null}var gE=l=>({name:"transformOrigin",options:l,fn(r){const{placement:i,rects:o,middlewareData:s}=r,d=s.arrow?.centerOffset!==0,h=d?0:l.arrowWidth,g=d?0:l.arrowHeight,[p,v]=Rh(i),b={start:"0%",center:"50%",end:"100%"}[v],T=(s.arrow?.x??0)+h/2,C=(s.arrow?.y??0)+g/2;let w="",x="";return p==="bottom"?(w=d?b:`${T}px`,x=`${-g}px`):p==="top"?(w=d?b:`${T}px`,x=`${o.floating.height+g}px`):p==="right"?(w=`${-g}px`,x=d?b:`${C}px`):p==="left"&&(w=`${o.floating.width+g}px`,x=d?b:`${C}px`),{data:{x:w,y:x}}}});function Rh(l){const[r,i="center"]=l.split("-");return[r,i]}var yE=Sh,vE=xh,bE=wh,SE=Th;function EE(l,r){return S.useReducer((i,o)=>r[i][o]??i,l)}var Bu=l=>{const{present:r,children:i}=l,o=xE(r),s=typeof i=="function"?i({present:o.isPresent}):S.Children.only(i),f=st(o.ref,wE(s));return typeof i=="function"||o.isPresent?S.cloneElement(s,{ref:f}):null};Bu.displayName="Presence";function xE(l){const[r,i]=S.useState(),o=S.useRef(null),s=S.useRef(l),f=S.useRef("none"),d=l?"mounted":"unmounted",[h,g]=EE(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const p=mi(o.current);f.current=h==="mounted"?p:"none"},[h]),Pt(()=>{const p=o.current,v=s.current;if(v!==l){const T=f.current,C=mi(p);l?g("MOUNT"):C==="none"||p?.display==="none"?g("UNMOUNT"):g(v&&T!==C?"ANIMATION_OUT":"UNMOUNT"),s.current=l}},[l,g]),Pt(()=>{if(r){let p;const v=r.ownerDocument.defaultView??window,b=C=>{const x=mi(o.current).includes(CSS.escape(C.animationName));if(C.target===r&&x&&(g("ANIMATION_END"),!s.current)){const O=r.style.animationFillMode;r.style.animationFillMode="forwards",p=v.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=O)})}},T=C=>{C.target===r&&(f.current=mi(o.current))};return r.addEventListener("animationstart",T),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{v.clearTimeout(p),r.removeEventListener("animationstart",T),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else g("ANIMATION_END")},[r,g]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:S.useCallback(p=>{o.current=p?getComputedStyle(p):null,i(p)},[])}}function mi(l){return l?.animationName||"none"}function wE(l){let r=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?l.ref:(r=Object.getOwnPropertyDescriptor(l,"ref")?.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?l.props.ref:l.props.ref||l.ref)}var AE=Symbol("radix.slottable");function TE(l){const r=({children:i})=>L.jsx(L.Fragment,{children:i});return r.displayName=`${l}.Slottable`,r.__radixId=AE,r}var RE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),OE="VisuallyHidden",Oh=S.forwardRef((l,r)=>L.jsx(lt.span,{...l,ref:r,style:{...RE,...l.style}}));Oh.displayName=OE;var CE=Oh,[pi,IR]=uu("Tooltip",[vh]),gi=vh(),Ch="TooltipProvider",DE=700,qu="tooltip.open",[_E,ku]=pi(Ch),Dh=l=>{const{__scopeTooltip:r,delayDuration:i=DE,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:f}=l,d=S.useRef(!0),h=S.useRef(!1),g=S.useRef(0);return S.useEffect(()=>{const p=g.current;return()=>window.clearTimeout(p)},[]),L.jsx(_E,{scope:r,isOpenDelayedRef:d,delayDuration:i,onOpen:S.useCallback(()=>{window.clearTimeout(g.current),d.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.current=!0,o)},[o]),isPointerInTransitRef:h,onPointerInTransitChange:S.useCallback(p=>{h.current=p},[]),disableHoverableContent:s,children:f})};Dh.displayName=Ch;var qa="Tooltip",[ME,ka]=pi(qa),_h=l=>{const{__scopeTooltip:r,children:i,open:o,defaultOpen:s,onOpenChange:f,disableHoverableContent:d,delayDuration:h}=l,g=ku(qa,l.__scopeTooltip),p=gi(r),[v,b]=S.useState(null),T=Kr(),C=S.useRef(0),w=d??g.disableHoverableContent,x=h??g.delayDuration,O=S.useRef(!1),[H,K]=Ff({prop:o,defaultProp:s??!1,onChange:Q=>{Q?(g.onOpen(),document.dispatchEvent(new CustomEvent(qu))):g.onClose(),f?.(Q)},caller:qa}),Z=S.useMemo(()=>H?O.current?"delayed-open":"instant-open":"closed",[H]),Y=S.useCallback(()=>{window.clearTimeout(C.current),C.current=0,O.current=!1,K(!0)},[K]),$=S.useCallback(()=>{window.clearTimeout(C.current),C.current=0,K(!1)},[K]),F=S.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{O.current=!0,K(!0),C.current=0},x)},[x,K]);return S.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]),L.jsx(yE,{...p,children:L.jsx(ME,{scope:r,contentId:T,open:H,stateAttribute:Z,trigger:v,onTriggerChange:b,onTriggerEnter:S.useCallback(()=>{g.isOpenDelayedRef.current?F():Y()},[g.isOpenDelayedRef,F,Y]),onTriggerLeave:S.useCallback(()=>{w?$():(window.clearTimeout(C.current),C.current=0)},[$,w]),onOpen:Y,onClose:$,disableHoverableContent:w,children:i})})};_h.displayName=qa;var Vu="TooltipTrigger",Mh=S.forwardRef((l,r)=>{const{__scopeTooltip:i,...o}=l,s=ka(Vu,i),f=ku(Vu,i),d=gi(i),h=S.useRef(null),g=st(r,h,s.onTriggerChange),p=S.useRef(!1),v=S.useRef(!1),b=S.useCallback(()=>p.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),L.jsx(vE,{asChild:!0,...d,children:L.jsx(lt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:g,onPointerMove:sn(l.onPointerMove,T=>{T.pointerType!=="touch"&&!v.current&&!f.isPointerInTransitRef.current&&(s.onTriggerEnter(),v.current=!0)}),onPointerLeave:sn(l.onPointerLeave,()=>{s.onTriggerLeave(),v.current=!1}),onPointerDown:sn(l.onPointerDown,()=>{s.open&&s.onClose(),p.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:sn(l.onFocus,()=>{p.current||s.onOpen()}),onBlur:sn(l.onBlur,s.onClose),onClick:sn(l.onClick,s.onClose)})})});Mh.displayName=Vu;var Gu="TooltipPortal",[NE,zE]=pi(Gu,{forceMount:void 0}),Nh=l=>{const{__scopeTooltip:r,forceMount:i,children:o,container:s}=l,f=ka(Gu,r);return L.jsx(NE,{scope:r,forceMount:i,children:L.jsx(Bu,{present:i||f.open,children:L.jsx(hu,{asChild:!0,container:s,children:o})})})};Nh.displayName=Gu;var Vl="TooltipContent",zh=S.forwardRef((l,r)=>{const i=zE(Vl,l.__scopeTooltip),{forceMount:o=i.forceMount,side:s="top",...f}=l,d=ka(Vl,l.__scopeTooltip);return L.jsx(Bu,{present:o||d.open,children:d.disableHoverableContent?L.jsx(Uh,{side:s,...f,ref:r}):L.jsx(UE,{side:s,...f,ref:r})})}),UE=S.forwardRef((l,r)=>{const i=ka(Vl,l.__scopeTooltip),o=ku(Vl,l.__scopeTooltip),s=S.useRef(null),f=st(r,s),[d,h]=S.useState(null),{trigger:g,onClose:p}=i,v=s.current,{onPointerInTransitChange:b}=o,T=S.useCallback(()=>{h(null),b(!1)},[b]),C=S.useCallback((w,x)=>{const O=w.currentTarget,H={x:w.clientX,y:w.clientY},K=BE(H,O.getBoundingClientRect()),Z=qE(H,K),Y=kE(x.getBoundingClientRect()),$=GE([...Z,...Y]);h($),b(!0)},[b]);return S.useEffect(()=>()=>T(),[T]),S.useEffect(()=>{if(g&&v){const w=O=>C(O,v),x=O=>C(O,g);return g.addEventListener("pointerleave",w),v.addEventListener("pointerleave",x),()=>{g.removeEventListener("pointerleave",w),v.removeEventListener("pointerleave",x)}}},[g,v,C,T]),S.useEffect(()=>{if(d){const w=x=>{const O=x.target,H={x:x.clientX,y:x.clientY},K=g?.contains(O)||v?.contains(O),Z=!VE(H,d);K?T():Z&&(T(),p())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[g,v,d,p,T]),L.jsx(Uh,{...l,ref:f})}),[LE,jE]=pi(qa,{isInside:!1}),HE=TE("TooltipContent"),Uh=S.forwardRef((l,r)=>{const{__scopeTooltip:i,children:o,"aria-label":s,onEscapeKeyDown:f,onPointerDownOutside:d,...h}=l,g=ka(Vl,i),p=gi(i),{onClose:v}=g;return S.useEffect(()=>(document.addEventListener(qu,v),()=>document.removeEventListener(qu,v)),[v]),S.useEffect(()=>{if(g.trigger){const b=T=>{T.target?.contains(g.trigger)&&v()};return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[g.trigger,v]),L.jsx(Zd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:b=>b.preventDefault(),onDismiss:v,children:L.jsxs(bE,{"data-state":g.stateAttribute,...p,...h,ref:r,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[L.jsx(HE,{children:o}),L.jsx(LE,{scope:i,isInside:!0,children:L.jsx(CE,{id:g.contentId,role:"tooltip",children:s||o})})]})})});zh.displayName=Vl;var Lh="TooltipArrow",jh=S.forwardRef((l,r)=>{const{__scopeTooltip:i,...o}=l,s=gi(i);return jE(Lh,i).isInside?null:L.jsx(SE,{...s,...o,ref:r})});jh.displayName=Lh;function BE(l,r){const i=Math.abs(r.top-l.y),o=Math.abs(r.bottom-l.y),s=Math.abs(r.right-l.x),f=Math.abs(r.left-l.x);switch(Math.min(i,o,s,f)){case f:return"left";case s:return"right";case i:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function qE(l,r,i=5){const o=[];switch(r){case"top":o.push({x:l.x-i,y:l.y+i},{x:l.x+i,y:l.y+i});break;case"bottom":o.push({x:l.x-i,y:l.y-i},{x:l.x+i,y:l.y-i});break;case"left":o.push({x:l.x+i,y:l.y-i},{x:l.x+i,y:l.y+i});break;case"right":o.push({x:l.x-i,y:l.y-i},{x:l.x-i,y:l.y+i});break}return o}function kE(l){const{top:r,right:i,bottom:o,left:s}=l;return[{x:s,y:r},{x:i,y:r},{x:i,y:o},{x:s,y:o}]}function VE(l,r){const{x:i,y:o}=l;let s=!1;for(let f=0,d=r.length-1;f<r.length;d=f++){const h=r[f],g=r[d],p=h.x,v=h.y,b=g.x,T=g.y;v>o!=T>o&&i<(b-p)*(o-v)/(T-v)+p&&(s=!s)}return s}function GE(l){const r=l.slice();return r.sort((i,o)=>i.x<o.x?-1:i.x>o.x?1:i.y<o.y?-1:i.y>o.y?1:0),YE(r)}function YE(l){if(l.length<=1)return l.slice();const r=[];for(let o=0;o<l.length;o++){const s=l[o];for(;r.length>=2;){const f=r[r.length-1],d=r[r.length-2];if((f.x-d.x)*(s.y-d.y)>=(f.y-d.y)*(s.x-d.x))r.pop();else break}r.push(s)}r.pop();const i=[];for(let o=l.length-1;o>=0;o--){const s=l[o];for(;i.length>=2;){const f=i[i.length-1],d=i[i.length-2];if((f.x-d.x)*(s.y-d.y)>=(f.y-d.y)*(s.x-d.x))i.pop();else break}i.push(s)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}var XE=Dh,QE=_h,ZE=Mh,KE=Nh,PE=zh,$E=jh;function FE({delayDuration:l=0,...r}){return L.jsx(XE,{"data-slot":"tooltip-provider",delayDuration:l,...r})}function JE({...l}){return L.jsx(FE,{children:L.jsx(QE,{"data-slot":"tooltip",...l})})}function WE({...l}){return L.jsx(ZE,{"data-slot":"tooltip-trigger",...l})}function IE({className:l,sideOffset:r=0,children:i,...o}){return L.jsx(KE,{children:L.jsxs(PE,{"data-slot":"tooltip-content",sideOffset:r,className:_t("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",l),...o,children:[i,L.jsx($E,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Hh({value:l,setValue:r,label:i,icon:o}){return L.jsxs("div",{className:"flex flex-col gap-1.5",children:[L.jsx("label",{className:"uppercase text-xs font-semibold",htmlFor:i,children:i}),L.jsxs(GS,{children:[L.jsx(Yd,{align:"inline-start",children:o}),L.jsx(XS,{id:i,type:"number",min:1,value:l,onChange:s=>r(Number(s.target.value))}),L.jsx(Yd,{align:"inline-end",children:L.jsx("span",{className:"text-xs bg-muted p-2",children:"in"})})]})]})}function ex({children:l,actionButton:r,widthValue:i,onWidthChange:o,heightValue:s,onHeightChange:f}){return L.jsxs(NS,{children:[L.jsx(zS,{asChild:!0,children:L.jsx(ou,{children:"Preview wallpaper"})}),L.jsxs(HS,{children:[L.jsx(BS,{children:L.jsx(kS,{children:"Preview wallpaper"})}),L.jsx("div",{className:"grid flex-1 auto-rows-min gap-6 px-4",children:l}),L.jsx(qS,{children:L.jsxs("div",{className:"flex items-start justify-between",children:[L.jsxs("div",{className:"space-y-4",children:[L.jsxs("div",{className:"flex items-center gap-1.5",children:[L.jsx("p",{className:"uppercase text-xs font-semibold",children:"Measurement"}),L.jsxs(JE,{children:[L.jsx(WE,{asChild:!0,children:L.jsx(OS,{className:"w-4"})}),L.jsx(IE,{children:L.jsx("p",{className:"max-w-[250px]",children:"State the desired measurements for your photo wallpaper. To ensure a margin when hanging, we recommend always adding about 2-4 inches extra, to the width and the height, in addition to the measurements of the wall."})})]})]}),L.jsxs("div",{className:"flex items-center gap-4",children:[L.jsx(Hh,{label:"Width",value:i,setValue:o,icon:L.jsx(DS,{className:"size-4"})}),L.jsx(Hh,{label:"Height",value:s,setValue:f,icon:L.jsx(_S,{className:"size-4"})})]})]}),L.jsxs("div",{className:"flex flex-col gap-2.5 w-1/5",children:[r,L.jsx(US,{asChild:!0,children:L.jsx(ou,{variant:"outline",children:"Cancel"})})]})]})})]})]})}const tx=({width:l=50,height:r=50,imageUrl:i,generatingImg:o})=>{const s=S.useRef(null),[f,d]=S.useState(null),h=v=>{const b=v.currentTarget,T=b.naturalWidth/b.naturalHeight;d(T)},g=r>0?l/r:1,p=()=>{if(!f||!l||!r)return{display:"none"};const v={aspectRatio:`${l} / ${r}`,boxShadow:"0 0 0 9999px rgba(255, 255, 255, 0.75)"};return g>f?{...v,width:"100%",height:"auto"}:{...v,height:"100%",width:"auto"}};return L.jsxs("div",{className:`max-h-[70vh] relative justify-center items-center overflow-hidden bg-gray-100 rounded-md shadow-lg ${o?"hidden pointer-events-none":"inline-flex"}`,children:[L.jsx("img",{ref:s,src:i,alt:"Wallpaper preview",onLoad:h,className:" w-auto object-contain block select-none",draggable:!1}),f&&L.jsx("div",{className:"absolute z-10 border-2 border-dashed border-gray-400 cursor-move",style:p(),children:L.jsx("div",{className:"absolute inset-0 flex items-end justify-end m-1 pointer-events-none",children:L.jsxs("span",{className:"bg-white/80 backdrop-blur-sm text-gray-800 text-xs font-semibold px-2 py-1 rounded shadow-sm border border-gray-200",children:[l,'" × ',r,'"']})})})]})};var nx={env:{NODE_ENV:"production"}};function lx(l,r){if(l.match(/^[a-z]+:\/\//i))return l;if(l.match(/^\/\//))return window.location.protocol+l;if(l.match(/^[a-z]+:/i))return l;const i=document.implementation.createHTMLDocument(),o=i.createElement("base"),s=i.createElement("a");return i.head.appendChild(o),i.body.appendChild(s),r&&(o.href=r),s.href=l,s.href}const ax=(()=>{let l=0;const r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(l+=1,`u${r()}${l}`)})();function Un(l){const r=[];for(let i=0,o=l.length;i<o;i++)r.push(l[i]);return r}let Gl=null;function Bh(l={}){return Gl||(l.includeStyleProperties?(Gl=l.includeStyleProperties,Gl):(Gl=Un(window.getComputedStyle(document.documentElement)),Gl))}function yi(l,r){const o=(l.ownerDocument.defaultView||window).getComputedStyle(l).getPropertyValue(r);return o?parseFloat(o.replace("px","")):0}function rx(l){const r=yi(l,"border-left-width"),i=yi(l,"border-right-width");return l.clientWidth+r+i}function ix(l){const r=yi(l,"border-top-width"),i=yi(l,"border-bottom-width");return l.clientHeight+r+i}function qh(l,r={}){const i=r.width||rx(l),o=r.height||ix(l);return{width:i,height:o}}function ox(){let l,r;try{r=nx}catch{}const i=r&&r.env?r.env.devicePixelRatio:null;return i&&(l=parseInt(i,10),Number.isNaN(l)&&(l=1)),l||window.devicePixelRatio||1}const St=16384;function ux(l){(l.width>St||l.height>St)&&(l.width>St&&l.height>St?l.width>l.height?(l.height*=St/l.width,l.width=St):(l.width*=St/l.height,l.height=St):l.width>St?(l.height*=St/l.width,l.width=St):(l.width*=St/l.height,l.height=St))}function vi(l){return new Promise((r,i)=>{const o=new Image;o.onload=()=>{o.decode().then(()=>{requestAnimationFrame(()=>r(o))})},o.onerror=i,o.crossOrigin="anonymous",o.decoding="async",o.src=l})}async function sx(l){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(l)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)}async function cx(l,r,i){const o="http://www.w3.org/2000/svg",s=document.createElementNS(o,"svg"),f=document.createElementNS(o,"foreignObject");return s.setAttribute("width",`${r}`),s.setAttribute("height",`${i}`),s.setAttribute("viewBox",`0 0 ${r} ${i}`),f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("externalResourcesRequired","true"),s.appendChild(f),f.appendChild(l),sx(s)}const ct=(l,r)=>{if(l instanceof r)return!0;const i=Object.getPrototypeOf(l);return i===null?!1:i.constructor.name===r.name||ct(i,r)};function fx(l){const r=l.getPropertyValue("content");return`${l.cssText} content: '${r.replace(/'|"/g,"")}';`}function dx(l,r){return Bh(r).map(i=>{const o=l.getPropertyValue(i),s=l.getPropertyPriority(i);return`${i}: ${o}${s?" !important":""};`}).join(" ")}function hx(l,r,i,o){const s=`.${l}:${r}`,f=i.cssText?fx(i):dx(i,o);return document.createTextNode(`${s}{${f}}`)}function kh(l,r,i,o){const s=window.getComputedStyle(l,i),f=s.getPropertyValue("content");if(f===""||f==="none")return;const d=ax();try{r.className=`${r.className} ${d}`}catch{return}const h=document.createElement("style");h.appendChild(hx(d,i,s,o)),r.appendChild(h)}function mx(l,r,i){kh(l,r,":before",i),kh(l,r,":after",i)}const Vh="application/font-woff",Gh="image/jpeg",px={woff:Vh,woff2:Vh,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Gh,jpeg:Gh,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function gx(l){const r=/\.([^./]*?)$/g.exec(l);return r?r[1]:""}function Yu(l){const r=gx(l).toLowerCase();return px[r]||""}function yx(l){return l.split(/,/)[1]}function Xu(l){return l.search(/^(data:)/)!==-1}function vx(l,r){return`data:${r};base64,${l}`}async function Yh(l,r,i){const o=await fetch(l,r);if(o.status===404)throw new Error(`Resource "${o.url}" not found`);const s=await o.blob();return new Promise((f,d)=>{const h=new FileReader;h.onerror=d,h.onloadend=()=>{try{f(i({res:o,result:h.result}))}catch(g){d(g)}},h.readAsDataURL(s)})}const Qu={};function bx(l,r,i){let o=l.replace(/\?.*/,"");return i&&(o=l),/ttf|otf|eot|woff2?/i.test(o)&&(o=o.replace(/.*\//,"")),r?`[${r}]${o}`:o}async function Zu(l,r,i){const o=bx(l,r,i.includeQueryParams);if(Qu[o]!=null)return Qu[o];i.cacheBust&&(l+=(/\?/.test(l)?"&":"?")+new Date().getTime());let s;try{const f=await Yh(l,i.fetchRequestInit,({res:d,result:h})=>(r||(r=d.headers.get("Content-Type")||""),yx(h)));s=vx(f,r)}catch(f){s=i.imagePlaceholder||"";let d=`Failed to fetch resource: ${l}`;f&&(d=typeof f=="string"?f:f.message),d&&console.warn(d)}return Qu[o]=s,s}async function Sx(l){const r=l.toDataURL();return r==="data:,"?l.cloneNode(!1):vi(r)}async function Ex(l,r){if(l.currentSrc){const f=document.createElement("canvas"),d=f.getContext("2d");f.width=l.clientWidth,f.height=l.clientHeight,d?.drawImage(l,0,0,f.width,f.height);const h=f.toDataURL();return vi(h)}const i=l.poster,o=Yu(i),s=await Zu(i,o,r);return vi(s)}async function xx(l,r){var i;try{if(!((i=l?.contentDocument)===null||i===void 0)&&i.body)return await bi(l.contentDocument.body,r,!0)}catch{}return l.cloneNode(!1)}async function wx(l,r){return ct(l,HTMLCanvasElement)?Sx(l):ct(l,HTMLVideoElement)?Ex(l,r):ct(l,HTMLIFrameElement)?xx(l,r):l.cloneNode(Xh(l))}const Ax=l=>l.tagName!=null&&l.tagName.toUpperCase()==="SLOT",Xh=l=>l.tagName!=null&&l.tagName.toUpperCase()==="SVG";async function Tx(l,r,i){var o,s;if(Xh(r))return r;let f=[];return Ax(l)&&l.assignedNodes?f=Un(l.assignedNodes()):ct(l,HTMLIFrameElement)&&(!((o=l.contentDocument)===null||o===void 0)&&o.body)?f=Un(l.contentDocument.body.childNodes):f=Un(((s=l.shadowRoot)!==null&&s!==void 0?s:l).childNodes),f.length===0||ct(l,HTMLVideoElement)||await f.reduce((d,h)=>d.then(()=>bi(h,i)).then(g=>{g&&r.appendChild(g)}),Promise.resolve()),r}function Rx(l,r,i){const o=r.style;if(!o)return;const s=window.getComputedStyle(l);s.cssText?(o.cssText=s.cssText,o.transformOrigin=s.transformOrigin):Bh(i).forEach(f=>{let d=s.getPropertyValue(f);f==="font-size"&&d.endsWith("px")&&(d=`${Math.floor(parseFloat(d.substring(0,d.length-2)))-.1}px`),ct(l,HTMLIFrameElement)&&f==="display"&&d==="inline"&&(d="block"),f==="d"&&r.getAttribute("d")&&(d=`path(${r.getAttribute("d")})`),o.setProperty(f,d,s.getPropertyPriority(f))})}function Ox(l,r){ct(l,HTMLTextAreaElement)&&(r.innerHTML=l.value),ct(l,HTMLInputElement)&&r.setAttribute("value",l.value)}function Cx(l,r){if(ct(l,HTMLSelectElement)){const i=r,o=Array.from(i.children).find(s=>l.value===s.getAttribute("value"));o&&o.setAttribute("selected","")}}function Dx(l,r,i){return ct(r,Element)&&(Rx(l,r,i),mx(l,r,i),Ox(l,r),Cx(l,r)),r}async function _x(l,r){const i=l.querySelectorAll?l.querySelectorAll("use"):[];if(i.length===0)return l;const o={};for(let f=0;f<i.length;f++){const h=i[f].getAttribute("xlink:href");if(h){const g=l.querySelector(h),p=document.querySelector(h);!g&&p&&!o[h]&&(o[h]=await bi(p,r,!0))}}const s=Object.values(o);if(s.length){const f="http://www.w3.org/1999/xhtml",d=document.createElementNS(f,"svg");d.setAttribute("xmlns",f),d.style.position="absolute",d.style.width="0",d.style.height="0",d.style.overflow="hidden",d.style.display="none";const h=document.createElementNS(f,"defs");d.appendChild(h);for(let g=0;g<s.length;g++)h.appendChild(s[g]);l.appendChild(d)}return l}async function bi(l,r,i){return!i&&r.filter&&!r.filter(l)?null:Promise.resolve(l).then(o=>wx(o,r)).then(o=>Tx(l,o,r)).then(o=>Dx(l,o,r)).then(o=>_x(o,r))}const Qh=/url\((['"]?)([^'"]+?)\1\)/g,Mx=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Nx=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function zx(l){const r=l.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function Ux(l){const r=[];return l.replace(Qh,(i,o,s)=>(r.push(s),i)),r.filter(i=>!Xu(i))}async function Lx(l,r,i,o,s){try{const f=i?lx(r,i):r,d=Yu(r);let h;return s||(h=await Zu(f,d,o)),l.replace(zx(r),`$1${h}$3`)}catch{}return l}function jx(l,{preferredFontFormat:r}){return r?l.replace(Nx,i=>{for(;;){const[o,,s]=Mx.exec(i)||[];if(!s)return"";if(s===r)return`src: ${o};`}}):l}function Zh(l){return l.search(Qh)!==-1}async function Kh(l,r,i){if(!Zh(l))return l;const o=jx(l,i);return Ux(o).reduce((f,d)=>f.then(h=>Lx(h,d,r,i)),Promise.resolve(o))}async function Yl(l,r,i){var o;const s=(o=r.style)===null||o===void 0?void 0:o.getPropertyValue(l);if(s){const f=await Kh(s,null,i);return r.style.setProperty(l,f,r.style.getPropertyPriority(l)),!0}return!1}async function Hx(l,r){await Yl("background",l,r)||await Yl("background-image",l,r),await Yl("mask",l,r)||await Yl("-webkit-mask",l,r)||await Yl("mask-image",l,r)||await Yl("-webkit-mask-image",l,r)}async function Bx(l,r){const i=ct(l,HTMLImageElement);if(!(i&&!Xu(l.src))&&!(ct(l,SVGImageElement)&&!Xu(l.href.baseVal)))return;const o=i?l.src:l.href.baseVal,s=await Zu(o,Yu(o),r);await new Promise((f,d)=>{l.onload=f,l.onerror=r.onImageErrorHandler?(...g)=>{try{f(r.onImageErrorHandler(...g))}catch(p){d(p)}}:d;const h=l;h.decode&&(h.decode=f),h.loading==="lazy"&&(h.loading="eager"),i?(l.srcset="",l.src=s):l.href.baseVal=s})}async function qx(l,r){const o=Un(l.childNodes).map(s=>Ph(s,r));await Promise.all(o).then(()=>l)}async function Ph(l,r){ct(l,Element)&&(await Hx(l,r),await Bx(l,r),await qx(l,r))}function kx(l,r){const{style:i}=l;r.backgroundColor&&(i.backgroundColor=r.backgroundColor),r.width&&(i.width=`${r.width}px`),r.height&&(i.height=`${r.height}px`);const o=r.style;return o!=null&&Object.keys(o).forEach(s=>{i[s]=o[s]}),l}const $h={};async function Fh(l){let r=$h[l];if(r!=null)return r;const o=await(await fetch(l)).text();return r={url:l,cssText:o},$h[l]=r,r}async function Jh(l,r){let i=l.cssText;const o=/url\(["']?([^"')]+)["']?\)/g,f=(i.match(/url\([^)]+\)/g)||[]).map(async d=>{let h=d.replace(o,"$1");return h.startsWith("https://")||(h=new URL(h,l.url).href),Yh(h,r.fetchRequestInit,({result:g})=>(i=i.replace(d,`url(${g})`),[d,g]))});return Promise.all(f).then(()=>i)}function Wh(l){if(l==null)return[];const r=[],i=/(\/\*[\s\S]*?\*\/)/gi;let o=l.replace(i,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const g=s.exec(o);if(g===null)break;r.push(g[0])}o=o.replace(s,"");const f=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,d="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",h=new RegExp(d,"gi");for(;;){let g=f.exec(o);if(g===null){if(g=h.exec(o),g===null)break;f.lastIndex=h.lastIndex}else h.lastIndex=f.lastIndex;r.push(g[0])}return r}async function Vx(l,r){const i=[],o=[];return l.forEach(s=>{if("cssRules"in s)try{Un(s.cssRules||[]).forEach((f,d)=>{if(f.type===CSSRule.IMPORT_RULE){let h=d+1;const g=f.href,p=Fh(g).then(v=>Jh(v,r)).then(v=>Wh(v).forEach(b=>{try{s.insertRule(b,b.startsWith("@import")?h+=1:s.cssRules.length)}catch(T){console.error("Error inserting rule from remote css",{rule:b,error:T})}})).catch(v=>{console.error("Error loading remote css",v.toString())});o.push(p)}})}catch(f){const d=l.find(h=>h.href==null)||document.styleSheets[0];s.href!=null&&o.push(Fh(s.href).then(h=>Jh(h,r)).then(h=>Wh(h).forEach(g=>{d.insertRule(g,d.cssRules.length)})).catch(h=>{console.error("Error loading remote stylesheet",h)})),console.error("Error inlining remote css file",f)}}),Promise.all(o).then(()=>(l.forEach(s=>{if("cssRules"in s)try{Un(s.cssRules||[]).forEach(f=>{i.push(f)})}catch(f){console.error(`Error while reading CSS rules from ${s.href}`,f)}}),i))}function Gx(l){return l.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>Zh(r.style.getPropertyValue("src")))}async function Yx(l,r){if(l.ownerDocument==null)throw new Error("Provided element is not within a Document");const i=Un(l.ownerDocument.styleSheets),o=await Vx(i,r);return Gx(o)}function Ih(l){return l.trim().replace(/["']/g,"")}function Xx(l){const r=new Set;function i(o){(o.style.fontFamily||getComputedStyle(o).fontFamily).split(",").forEach(f=>{r.add(Ih(f))}),Array.from(o.children).forEach(f=>{f instanceof HTMLElement&&i(f)})}return i(l),r}async function Qx(l,r){const i=await Yx(l,r),o=Xx(l);return(await Promise.all(i.filter(f=>o.has(Ih(f.style.fontFamily))).map(f=>{const d=f.parentStyleSheet?f.parentStyleSheet.href:null;return Kh(f.cssText,d,r)}))).join(`
|
|
139
139
|
`)}async function Zx(l,r){const i=r.fontEmbedCSS!=null?r.fontEmbedCSS:r.skipFonts?null:await Qx(l,r);if(i){const o=document.createElement("style"),s=document.createTextNode(i);o.appendChild(s),l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o)}}async function Kx(l,r={}){const{width:i,height:o}=qh(l,r),s=await bi(l,r,!0);return await Zx(s,r),await Ph(s,r),kx(s,r),await cx(s,i,o)}async function Px(l,r={}){const{width:i,height:o}=qh(l,r),s=await Kx(l,r),f=await vi(s),d=document.createElement("canvas"),h=d.getContext("2d"),g=r.pixelRatio||ox(),p=r.canvasWidth||i,v=r.canvasHeight||o;return d.width=p*g,d.height=v*g,r.skipAutoScale||ux(d),d.style.width=`${p}`,d.style.height=`${v}`,r.backgroundColor&&(h.fillStyle=r.backgroundColor,h.fillRect(0,0,d.width,d.height)),h.drawImage(f,0,0,d.width,d.height),d}async function $x(l,r={}){return(await Px(l,r)).toDataURL()}function em(l,r){return function(){return l.apply(r,arguments)}}var tm={};const{toString:Fx}=Object.prototype,{getPrototypeOf:Ku}=Object,{iterator:Si,toStringTag:nm}=Symbol,Ei=(l=>r=>{const i=Fx.call(r);return l[i]||(l[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Yt=l=>(l=l.toLowerCase(),r=>Ei(r)===l),xi=l=>r=>typeof r===l,{isArray:Xl}=Array,Ql=xi("undefined");function Va(l){return l!==null&&!Ql(l)&&l.constructor!==null&&!Ql(l.constructor)&&ft(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const lm=Yt("ArrayBuffer");function Jx(l){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(l):r=l&&l.buffer&&lm(l.buffer),r}const Wx=xi("string"),ft=xi("function"),am=xi("number"),Ga=l=>l!==null&&typeof l=="object",Ix=l=>l===!0||l===!1,wi=l=>{if(Ei(l)!=="object")return!1;const r=Ku(l);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(nm in l)&&!(Si in l)},ew=l=>{if(!Ga(l)||Va(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},tw=Yt("Date"),nw=Yt("File"),lw=Yt("Blob"),aw=Yt("FileList"),rw=l=>Ga(l)&&ft(l.pipe),iw=l=>{let r;return l&&(typeof FormData=="function"&&l instanceof FormData||ft(l.append)&&((r=Ei(l))==="formdata"||r==="object"&&ft(l.toString)&&l.toString()==="[object FormData]"))},ow=Yt("URLSearchParams"),[uw,sw,cw,fw]=["ReadableStream","Request","Response","Headers"].map(Yt),dw=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ya(l,r,{allOwnKeys:i=!1}={}){if(l===null||typeof l>"u")return;let o,s;if(typeof l!="object"&&(l=[l]),Xl(l))for(o=0,s=l.length;o<s;o++)r.call(null,l[o],o,l);else{if(Va(l))return;const f=i?Object.getOwnPropertyNames(l):Object.keys(l),d=f.length;let h;for(o=0;o<d;o++)h=f[o],r.call(null,l[h],h,l)}}function rm(l,r){if(Va(l))return null;r=r.toLowerCase();const i=Object.keys(l);let o=i.length,s;for(;o-- >0;)if(s=i[o],r===s.toLowerCase())return s;return null}const sl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,im=l=>!Ql(l)&&l!==sl;function Pu(){const{caseless:l,skipUndefined:r}=im(this)&&this||{},i={},o=(s,f)=>{const d=l&&rm(i,f)||f;wi(i[d])&&wi(s)?i[d]=Pu(i[d],s):wi(s)?i[d]=Pu({},s):Xl(s)?i[d]=s.slice():(!r||!Ql(s))&&(i[d]=s)};for(let s=0,f=arguments.length;s<f;s++)arguments[s]&&Ya(arguments[s],o);return i}const hw=(l,r,i,{allOwnKeys:o}={})=>(Ya(r,(s,f)=>{i&&ft(s)?l[f]=em(s,i):l[f]=s},{allOwnKeys:o}),l),mw=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),pw=(l,r,i,o)=>{l.prototype=Object.create(r.prototype,o),l.prototype.constructor=l,Object.defineProperty(l,"super",{value:r.prototype}),i&&Object.assign(l.prototype,i)},gw=(l,r,i,o)=>{let s,f,d;const h={};if(r=r||{},l==null)return r;do{for(s=Object.getOwnPropertyNames(l),f=s.length;f-- >0;)d=s[f],(!o||o(d,l,r))&&!h[d]&&(r[d]=l[d],h[d]=!0);l=i!==!1&&Ku(l)}while(l&&(!i||i(l,r))&&l!==Object.prototype);return r},yw=(l,r,i)=>{l=String(l),(i===void 0||i>l.length)&&(i=l.length),i-=r.length;const o=l.indexOf(r,i);return o!==-1&&o===i},vw=l=>{if(!l)return null;if(Xl(l))return l;let r=l.length;if(!am(r))return null;const i=new Array(r);for(;r-- >0;)i[r]=l[r];return i},bw=(l=>r=>l&&r instanceof l)(typeof Uint8Array<"u"&&Ku(Uint8Array)),Sw=(l,r)=>{const o=(l&&l[Si]).call(l);let s;for(;(s=o.next())&&!s.done;){const f=s.value;r.call(l,f[0],f[1])}},Ew=(l,r)=>{let i;const o=[];for(;(i=l.exec(r))!==null;)o.push(i);return o},xw=Yt("HTMLFormElement"),ww=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,s){return o.toUpperCase()+s}),om=(({hasOwnProperty:l})=>(r,i)=>l.call(r,i))(Object.prototype),Aw=Yt("RegExp"),um=(l,r)=>{const i=Object.getOwnPropertyDescriptors(l),o={};Ya(i,(s,f)=>{let d;(d=r(s,f,l))!==!1&&(o[f]=d||s)}),Object.defineProperties(l,o)},Tw=l=>{um(l,(r,i)=>{if(ft(l)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=l[i];if(ft(o)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Rw=(l,r)=>{const i={},o=s=>{s.forEach(f=>{i[f]=!0})};return Xl(l)?o(l):o(String(l).split(r)),i},Ow=()=>{},Cw=(l,r)=>l!=null&&Number.isFinite(l=+l)?l:r;function Dw(l){return!!(l&&ft(l.append)&&l[nm]==="FormData"&&l[Si])}const _w=l=>{const r=new Array(10),i=(o,s)=>{if(Ga(o)){if(r.indexOf(o)>=0)return;if(Va(o))return o;if(!("toJSON"in o)){r[s]=o;const f=Xl(o)?[]:{};return Ya(o,(d,h)=>{const g=i(d,s+1);!Ql(g)&&(f[h]=g)}),r[s]=void 0,f}}return o};return i(l,0)},Mw=Yt("AsyncFunction"),Nw=l=>l&&(Ga(l)||ft(l))&&ft(l.then)&&ft(l.catch),sm=((l,r)=>l?setImmediate:r?((i,o)=>(sl.addEventListener("message",({source:s,data:f})=>{s===sl&&f===i&&o.length&&o.shift()()},!1),s=>{o.push(s),sl.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",ft(sl.postMessage)),zw=typeof queueMicrotask<"u"?queueMicrotask.bind(sl):typeof tm<"u"&&tm.nextTick||sm,j={isArray:Xl,isArrayBuffer:lm,isBuffer:Va,isFormData:iw,isArrayBufferView:Jx,isString:Wx,isNumber:am,isBoolean:Ix,isObject:Ga,isPlainObject:wi,isEmptyObject:ew,isReadableStream:uw,isRequest:sw,isResponse:cw,isHeaders:fw,isUndefined:Ql,isDate:tw,isFile:nw,isBlob:lw,isRegExp:Aw,isFunction:ft,isStream:rw,isURLSearchParams:ow,isTypedArray:bw,isFileList:aw,forEach:Ya,merge:Pu,extend:hw,trim:dw,stripBOM:mw,inherits:pw,toFlatObject:gw,kindOf:Ei,kindOfTest:Yt,endsWith:yw,toArray:vw,forEachEntry:Sw,matchAll:Ew,isHTMLForm:xw,hasOwnProperty:om,hasOwnProp:om,reduceDescriptors:um,freezeMethods:Tw,toObjectSet:Rw,toCamelCase:ww,noop:Ow,toFiniteNumber:Cw,findKey:rm,global:sl,isContextDefined:im,isSpecCompliantForm:Dw,toJSONObject:_w,isAsyncFn:Mw,isThenable:Nw,setImmediate:sm,asap:zw,isIterable:l=>l!=null&&ft(l[Si])};function fe(l,r,i,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=l,this.name="AxiosError",r&&(this.code=r),i&&(this.config=i),o&&(this.request=o),s&&(this.response=s,this.status=s.status?s.status:null)}j.inherits(fe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}});const cm=fe.prototype,fm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(l=>{fm[l]={value:l}}),Object.defineProperties(fe,fm),Object.defineProperty(cm,"isAxiosError",{value:!0}),fe.from=(l,r,i,o,s,f)=>{const d=Object.create(cm);j.toFlatObject(l,d,function(v){return v!==Error.prototype},p=>p!=="isAxiosError");const h=l&&l.message?l.message:"Error",g=r==null&&l?l.code:r;return fe.call(d,h,g,i,o,s),l&&d.cause==null&&Object.defineProperty(d,"cause",{value:l,configurable:!0}),d.name=l&&l.name||"Error",f&&Object.assign(d,f),d};const Uw=null;function $u(l){return j.isPlainObject(l)||j.isArray(l)}function dm(l){return j.endsWith(l,"[]")?l.slice(0,-2):l}function hm(l,r,i){return l?l.concat(r).map(function(s,f){return s=dm(s),!i&&f?"["+s+"]":s}).join(i?".":""):r}function Lw(l){return j.isArray(l)&&!l.some($u)}const jw=j.toFlatObject(j,{},null,function(r){return/^is[A-Z]/.test(r)});function Ai(l,r,i){if(!j.isObject(l))throw new TypeError("target must be an object");r=r||new FormData,i=j.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,O){return!j.isUndefined(O[x])});const o=i.metaTokens,s=i.visitor||v,f=i.dots,d=i.indexes,g=(i.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(r);if(!j.isFunction(s))throw new TypeError("visitor must be a function");function p(w){if(w===null)return"";if(j.isDate(w))return w.toISOString();if(j.isBoolean(w))return w.toString();if(!g&&j.isBlob(w))throw new fe("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(w)||j.isTypedArray(w)?g&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function v(w,x,O){let H=w;if(w&&!O&&typeof w=="object"){if(j.endsWith(x,"{}"))x=o?x:x.slice(0,-2),w=JSON.stringify(w);else if(j.isArray(w)&&Lw(w)||(j.isFileList(w)||j.endsWith(x,"[]"))&&(H=j.toArray(w)))return x=dm(x),H.forEach(function(Z,Y){!(j.isUndefined(Z)||Z===null)&&r.append(d===!0?hm([x],Y,f):d===null?x:x+"[]",p(Z))}),!1}return $u(w)?!0:(r.append(hm(O,x,f),p(w)),!1)}const b=[],T=Object.assign(jw,{defaultVisitor:v,convertValue:p,isVisitable:$u});function C(w,x){if(!j.isUndefined(w)){if(b.indexOf(w)!==-1)throw Error("Circular reference detected in "+x.join("."));b.push(w),j.forEach(w,function(H,K){(!(j.isUndefined(H)||H===null)&&s.call(r,H,j.isString(K)?K.trim():K,x,T))===!0&&C(H,x?x.concat(K):[K])}),b.pop()}}if(!j.isObject(l))throw new TypeError("data must be an object");return C(l),r}function mm(l){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(o){return r[o]})}function Fu(l,r){this._pairs=[],l&&Ai(l,this,r)}const pm=Fu.prototype;pm.append=function(r,i){this._pairs.push([r,i])},pm.toString=function(r){const i=r?function(o){return r.call(this,o,mm)}:mm;return this._pairs.map(function(s){return i(s[0])+"="+i(s[1])},"").join("&")};function Hw(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function gm(l,r,i){if(!r)return l;const o=i&&i.encode||Hw;j.isFunction(i)&&(i={serialize:i});const s=i&&i.serialize;let f;if(s?f=s(r,i):f=j.isURLSearchParams(r)?r.toString():new Fu(r,i).toString(o),f){const d=l.indexOf("#");d!==-1&&(l=l.slice(0,d)),l+=(l.indexOf("?")===-1?"?":"&")+f}return l}class ym{constructor(){this.handlers=[]}use(r,i,o){return this.handlers.push({fulfilled:r,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){j.forEach(this.handlers,function(o){o!==null&&r(o)})}}const vm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Bw={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Fu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ju=typeof window<"u"&&typeof document<"u",Wu=typeof navigator=="object"&&navigator||void 0,qw=Ju&&(!Wu||["ReactNative","NativeScript","NS"].indexOf(Wu.product)<0),kw=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vw=Ju&&window.location.href||"http://localhost",at={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ju,hasStandardBrowserEnv:qw,hasStandardBrowserWebWorkerEnv:kw,navigator:Wu,origin:Vw},Symbol.toStringTag,{value:"Module"})),...Bw};function Gw(l,r){return Ai(l,new at.classes.URLSearchParams,{visitor:function(i,o,s,f){return at.isNode&&j.isBuffer(i)?(this.append(o,i.toString("base64")),!1):f.defaultVisitor.apply(this,arguments)},...r})}function Yw(l){return j.matchAll(/\w+|\[(\w*)]/g,l).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Xw(l){const r={},i=Object.keys(l);let o;const s=i.length;let f;for(o=0;o<s;o++)f=i[o],r[f]=l[f];return r}function bm(l){function r(i,o,s,f){let d=i[f++];if(d==="__proto__")return!0;const h=Number.isFinite(+d),g=f>=i.length;return d=!d&&j.isArray(s)?s.length:d,g?(j.hasOwnProp(s,d)?s[d]=[s[d],o]:s[d]=o,!h):((!s[d]||!j.isObject(s[d]))&&(s[d]=[]),r(i,o,s[d],f)&&j.isArray(s[d])&&(s[d]=Xw(s[d])),!h)}if(j.isFormData(l)&&j.isFunction(l.entries)){const i={};return j.forEachEntry(l,(o,s)=>{r(Yw(o),s,i,0)}),i}return null}function Qw(l,r,i){if(j.isString(l))try{return(r||JSON.parse)(l),j.trim(l)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(l)}const Xa={transitional:vm,adapter:["xhr","http","fetch"],transformRequest:[function(r,i){const o=i.getContentType()||"",s=o.indexOf("application/json")>-1,f=j.isObject(r);if(f&&j.isHTMLForm(r)&&(r=new FormData(r)),j.isFormData(r))return s?JSON.stringify(bm(r)):r;if(j.isArrayBuffer(r)||j.isBuffer(r)||j.isStream(r)||j.isFile(r)||j.isBlob(r)||j.isReadableStream(r))return r;if(j.isArrayBufferView(r))return r.buffer;if(j.isURLSearchParams(r))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let h;if(f){if(o.indexOf("application/x-www-form-urlencoded")>-1)return Gw(r,this.formSerializer).toString();if((h=j.isFileList(r))||o.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return Ai(h?{"files[]":r}:r,g&&new g,this.formSerializer)}}return f||s?(i.setContentType("application/json",!1),Qw(r)):r}],transformResponse:[function(r){const i=this.transitional||Xa.transitional,o=i&&i.forcedJSONParsing,s=this.responseType==="json";if(j.isResponse(r)||j.isReadableStream(r))return r;if(r&&j.isString(r)&&(o&&!this.responseType||s)){const d=!(i&&i.silentJSONParsing)&&s;try{return JSON.parse(r,this.parseReviver)}catch(h){if(d)throw h.name==="SyntaxError"?fe.from(h,fe.ERR_BAD_RESPONSE,this,null,this.response):h}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:at.classes.FormData,Blob:at.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],l=>{Xa.headers[l]={}});const Zw=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Kw=l=>{const r={};let i,o,s;return l&&l.split(`
|
|
140
140
|
`).forEach(function(d){s=d.indexOf(":"),i=d.substring(0,s).trim().toLowerCase(),o=d.substring(s+1).trim(),!(!i||r[i]&&Zw[i])&&(i==="set-cookie"?r[i]?r[i].push(o):r[i]=[o]:r[i]=r[i]?r[i]+", "+o:o)}),r},Sm=Symbol("internals");function Qa(l){return l&&String(l).trim().toLowerCase()}function Ti(l){return l===!1||l==null?l:j.isArray(l)?l.map(Ti):String(l)}function Pw(l){const r=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=i.exec(l);)r[o[1]]=o[2];return r}const $w=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function Iu(l,r,i,o,s){if(j.isFunction(o))return o.call(this,r,i);if(s&&(r=i),!!j.isString(r)){if(j.isString(o))return r.indexOf(o)!==-1;if(j.isRegExp(o))return o.test(r)}}function Fw(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,i,o)=>i.toUpperCase()+o)}function Jw(l,r){const i=j.toCamelCase(" "+r);["get","set","has"].forEach(o=>{Object.defineProperty(l,o+i,{value:function(s,f,d){return this[o].call(this,r,s,f,d)},configurable:!0})})}let dt=class{constructor(r){r&&this.set(r)}set(r,i,o){const s=this;function f(h,g,p){const v=Qa(g);if(!v)throw new Error("header name must be a non-empty string");const b=j.findKey(s,v);(!b||s[b]===void 0||p===!0||p===void 0&&s[b]!==!1)&&(s[b||g]=Ti(h))}const d=(h,g)=>j.forEach(h,(p,v)=>f(p,v,g));if(j.isPlainObject(r)||r instanceof this.constructor)d(r,i);else if(j.isString(r)&&(r=r.trim())&&!$w(r))d(Kw(r),i);else if(j.isObject(r)&&j.isIterable(r)){let h={},g,p;for(const v of r){if(!j.isArray(v))throw TypeError("Object iterator must return a key-value pair");h[p=v[0]]=(g=h[p])?j.isArray(g)?[...g,v[1]]:[g,v[1]]:v[1]}d(h,i)}else r!=null&&f(i,r,o);return this}get(r,i){if(r=Qa(r),r){const o=j.findKey(this,r);if(o){const s=this[o];if(!i)return s;if(i===!0)return Pw(s);if(j.isFunction(i))return i.call(this,s,o);if(j.isRegExp(i))return i.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,i){if(r=Qa(r),r){const o=j.findKey(this,r);return!!(o&&this[o]!==void 0&&(!i||Iu(this,this[o],o,i)))}return!1}delete(r,i){const o=this;let s=!1;function f(d){if(d=Qa(d),d){const h=j.findKey(o,d);h&&(!i||Iu(o,o[h],h,i))&&(delete o[h],s=!0)}}return j.isArray(r)?r.forEach(f):f(r),s}clear(r){const i=Object.keys(this);let o=i.length,s=!1;for(;o--;){const f=i[o];(!r||Iu(this,this[f],f,r,!0))&&(delete this[f],s=!0)}return s}normalize(r){const i=this,o={};return j.forEach(this,(s,f)=>{const d=j.findKey(o,f);if(d){i[d]=Ti(s),delete i[f];return}const h=r?Fw(f):String(f).trim();h!==f&&delete i[f],i[h]=Ti(s),o[h]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const i=Object.create(null);return j.forEach(this,(o,s)=>{o!=null&&o!==!1&&(i[s]=r&&j.isArray(o)?o.join(", "):o)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,i])=>r+": "+i).join(`
|
|
141
141
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...i){const o=new this(r);return i.forEach(s=>o.set(s)),o}static accessor(r){const o=(this[Sm]=this[Sm]={accessors:{}}).accessors,s=this.prototype;function f(d){const h=Qa(d);o[h]||(Jw(s,d),o[h]=!0)}return j.isArray(r)?r.forEach(f):f(r),this}};dt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(dt.prototype,({value:l},r)=>{let i=r[0].toUpperCase()+r.slice(1);return{get:()=>l,set(o){this[i]=o}}}),j.freezeMethods(dt);function es(l,r){const i=this||Xa,o=r||i,s=dt.from(o.headers);let f=o.data;return j.forEach(l,function(h){f=h.call(i,f,s.normalize(),r?r.status:void 0)}),s.normalize(),f}function Em(l){return!!(l&&l.__CANCEL__)}function Zl(l,r,i){fe.call(this,l??"canceled",fe.ERR_CANCELED,r,i),this.name="CanceledError"}j.inherits(Zl,fe,{__CANCEL__:!0});function xm(l,r,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?l(i):r(new fe("Request failed with status code "+i.status,[fe.ERR_BAD_REQUEST,fe.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function Ww(l){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l);return r&&r[1]||""}function Iw(l,r){l=l||10;const i=new Array(l),o=new Array(l);let s=0,f=0,d;return r=r!==void 0?r:1e3,function(g){const p=Date.now(),v=o[f];d||(d=p),i[s]=g,o[s]=p;let b=f,T=0;for(;b!==s;)T+=i[b++],b=b%l;if(s=(s+1)%l,s===f&&(f=(f+1)%l),p-d<r)return;const C=v&&p-v;return C?Math.round(T*1e3/C):void 0}}function eA(l,r){let i=0,o=1e3/r,s,f;const d=(p,v=Date.now())=>{i=v,s=null,f&&(clearTimeout(f),f=null),l(...p)};return[(...p)=>{const v=Date.now(),b=v-i;b>=o?d(p,v):(s=p,f||(f=setTimeout(()=>{f=null,d(s)},o-b)))},()=>s&&d(s)]}const Ri=(l,r,i=3)=>{let o=0;const s=Iw(50,250);return eA(f=>{const d=f.loaded,h=f.lengthComputable?f.total:void 0,g=d-o,p=s(g),v=d<=h;o=d;const b={loaded:d,total:h,progress:h?d/h:void 0,bytes:g,rate:p||void 0,estimated:p&&h&&v?(h-d)/p:void 0,event:f,lengthComputable:h!=null,[r?"download":"upload"]:!0};l(b)},i)},wm=(l,r)=>{const i=l!=null;return[o=>r[0]({lengthComputable:i,total:l,loaded:o}),r[1]]},Am=l=>(...r)=>j.asap(()=>l(...r)),tA=at.hasStandardBrowserEnv?((l,r)=>i=>(i=new URL(i,at.origin),l.protocol===i.protocol&&l.host===i.host&&(r||l.port===i.port)))(new URL(at.origin),at.navigator&&/(msie|trident)/i.test(at.navigator.userAgent)):()=>!0,nA=at.hasStandardBrowserEnv?{write(l,r,i,o,s,f,d){if(typeof document>"u")return;const h=[`${l}=${encodeURIComponent(r)}`];j.isNumber(i)&&h.push(`expires=${new Date(i).toUTCString()}`),j.isString(o)&&h.push(`path=${o}`),j.isString(s)&&h.push(`domain=${s}`),f===!0&&h.push("secure"),j.isString(d)&&h.push(`SameSite=${d}`),document.cookie=h.join("; ")},read(l){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+l+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(l){this.write(l,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function lA(l){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(l)}function aA(l,r){return r?l.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):l}function Tm(l,r,i){let o=!lA(r);return l&&(o||i==!1)?aA(l,r):r}const Rm=l=>l instanceof dt?{...l}:l;function cl(l,r){r=r||{};const i={};function o(p,v,b,T){return j.isPlainObject(p)&&j.isPlainObject(v)?j.merge.call({caseless:T},p,v):j.isPlainObject(v)?j.merge({},v):j.isArray(v)?v.slice():v}function s(p,v,b,T){if(j.isUndefined(v)){if(!j.isUndefined(p))return o(void 0,p,b,T)}else return o(p,v,b,T)}function f(p,v){if(!j.isUndefined(v))return o(void 0,v)}function d(p,v){if(j.isUndefined(v)){if(!j.isUndefined(p))return o(void 0,p)}else return o(void 0,v)}function h(p,v,b){if(b in r)return o(p,v);if(b in l)return o(void 0,p)}const g={url:f,method:f,data:f,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:h,headers:(p,v,b)=>s(Rm(p),Rm(v),b,!0)};return j.forEach(Object.keys({...l,...r}),function(v){const b=g[v]||s,T=b(l[v],r[v],v);j.isUndefined(T)&&b!==h||(i[v]=T)}),i}const Om=l=>{const r=cl({},l);let{data:i,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:f,headers:d,auth:h}=r;if(r.headers=d=dt.from(d),r.url=gm(Tm(r.baseURL,r.url,r.allowAbsoluteUrls),l.params,l.paramsSerializer),h&&d.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),j.isFormData(i)){if(at.hasStandardBrowserEnv||at.hasStandardBrowserWebWorkerEnv)d.setContentType(void 0);else if(j.isFunction(i.getHeaders)){const g=i.getHeaders(),p=["content-type","content-length"];Object.entries(g).forEach(([v,b])=>{p.includes(v.toLowerCase())&&d.set(v,b)})}}if(at.hasStandardBrowserEnv&&(o&&j.isFunction(o)&&(o=o(r)),o||o!==!1&&tA(r.url))){const g=s&&f&&nA.read(f);g&&d.set(s,g)}return r},rA=typeof XMLHttpRequest<"u"&&function(l){return new Promise(function(i,o){const s=Om(l);let f=s.data;const d=dt.from(s.headers).normalize();let{responseType:h,onUploadProgress:g,onDownloadProgress:p}=s,v,b,T,C,w;function x(){C&&C(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(v),s.signal&&s.signal.removeEventListener("abort",v)}let O=new XMLHttpRequest;O.open(s.method.toUpperCase(),s.url,!0),O.timeout=s.timeout;function H(){if(!O)return;const Z=dt.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),$={data:!h||h==="text"||h==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:Z,config:l,request:O};xm(function(Q){i(Q),x()},function(Q){o(Q),x()},$),O=null}"onloadend"in O?O.onloadend=H:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(H)},O.onabort=function(){O&&(o(new fe("Request aborted",fe.ECONNABORTED,l,O)),O=null)},O.onerror=function(Y){const $=Y&&Y.message?Y.message:"Network Error",F=new fe($,fe.ERR_NETWORK,l,O);F.event=Y||null,o(F),O=null},O.ontimeout=function(){let Y=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const $=s.transitional||vm;s.timeoutErrorMessage&&(Y=s.timeoutErrorMessage),o(new fe(Y,$.clarifyTimeoutError?fe.ETIMEDOUT:fe.ECONNABORTED,l,O)),O=null},f===void 0&&d.setContentType(null),"setRequestHeader"in O&&j.forEach(d.toJSON(),function(Y,$){O.setRequestHeader($,Y)}),j.isUndefined(s.withCredentials)||(O.withCredentials=!!s.withCredentials),h&&h!=="json"&&(O.responseType=s.responseType),p&&([T,w]=Ri(p,!0),O.addEventListener("progress",T)),g&&O.upload&&([b,C]=Ri(g),O.upload.addEventListener("progress",b),O.upload.addEventListener("loadend",C)),(s.cancelToken||s.signal)&&(v=Z=>{O&&(o(!Z||Z.type?new Zl(null,l,O):Z),O.abort(),O=null)},s.cancelToken&&s.cancelToken.subscribe(v),s.signal&&(s.signal.aborted?v():s.signal.addEventListener("abort",v)));const K=Ww(s.url);if(K&&at.protocols.indexOf(K)===-1){o(new fe("Unsupported protocol "+K+":",fe.ERR_BAD_REQUEST,l));return}O.send(f||null)})},iA=(l,r)=>{const{length:i}=l=l?l.filter(Boolean):[];if(r||i){let o=new AbortController,s;const f=function(p){if(!s){s=!0,h();const v=p instanceof Error?p:this.reason;o.abort(v instanceof fe?v:new Zl(v instanceof Error?v.message:v))}};let d=r&&setTimeout(()=>{d=null,f(new fe(`timeout ${r} of ms exceeded`,fe.ETIMEDOUT))},r);const h=()=>{l&&(d&&clearTimeout(d),d=null,l.forEach(p=>{p.unsubscribe?p.unsubscribe(f):p.removeEventListener("abort",f)}),l=null)};l.forEach(p=>p.addEventListener("abort",f));const{signal:g}=o;return g.unsubscribe=()=>j.asap(h),g}},oA=function*(l,r){let i=l.byteLength;if(i<r){yield l;return}let o=0,s;for(;o<i;)s=o+r,yield l.slice(o,s),o=s},uA=async function*(l,r){for await(const i of sA(l))yield*oA(i,r)},sA=async function*(l){if(l[Symbol.asyncIterator]){yield*l;return}const r=l.getReader();try{for(;;){const{done:i,value:o}=await r.read();if(i)break;yield o}}finally{await r.cancel()}},Cm=(l,r,i,o)=>{const s=uA(l,r);let f=0,d,h=g=>{d||(d=!0,o&&o(g))};return new ReadableStream({async pull(g){try{const{done:p,value:v}=await s.next();if(p){h(),g.close();return}let b=v.byteLength;if(i){let T=f+=b;i(T)}g.enqueue(new Uint8Array(v))}catch(p){throw h(p),p}},cancel(g){return h(g),s.return()}},{highWaterMark:2})},Dm=64*1024,{isFunction:Oi}=j,cA=(({Request:l,Response:r})=>({Request:l,Response:r}))(j.global),{ReadableStream:_m,TextEncoder:Mm}=j.global,Nm=(l,...r)=>{try{return!!l(...r)}catch{return!1}},fA=l=>{l=j.merge.call({skipUndefined:!0},cA,l);const{fetch:r,Request:i,Response:o}=l,s=r?Oi(r):typeof fetch=="function",f=Oi(i),d=Oi(o);if(!s)return!1;const h=s&&Oi(_m),g=s&&(typeof Mm=="function"?(w=>x=>w.encode(x))(new Mm):async w=>new Uint8Array(await new i(w).arrayBuffer())),p=f&&h&&Nm(()=>{let w=!1;const x=new i(at.origin,{body:new _m,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!x}),v=d&&h&&Nm(()=>j.isReadableStream(new o("").body)),b={stream:v&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!b[w]&&(b[w]=(x,O)=>{let H=x&&x[w];if(H)return H.call(x);throw new fe(`Response type '${w}' is not supported`,fe.ERR_NOT_SUPPORT,O)})});const T=async w=>{if(w==null)return 0;if(j.isBlob(w))return w.size;if(j.isSpecCompliantForm(w))return(await new i(at.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(j.isArrayBufferView(w)||j.isArrayBuffer(w))return w.byteLength;if(j.isURLSearchParams(w)&&(w=w+""),j.isString(w))return(await g(w)).byteLength},C=async(w,x)=>{const O=j.toFiniteNumber(w.getContentLength());return O??T(x)};return async w=>{let{url:x,method:O,data:H,signal:K,cancelToken:Z,timeout:Y,onDownloadProgress:$,onUploadProgress:F,responseType:Q,headers:J,withCredentials:ie="same-origin",fetchOptions:ce}=Om(w),Ce=r||fetch;Q=Q?(Q+"").toLowerCase():"text";let ve=iA([K,Z&&Z.toAbortSignal()],Y),he=null;const me=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let we;try{if(F&&p&&O!=="get"&&O!=="head"&&(we=await C(J,H))!==0){let A=new i(x,{method:"POST",body:H,duplex:"half"}),G;if(j.isFormData(H)&&(G=A.headers.get("content-type"))&&J.setContentType(G),A.body){const[W,P]=wm(we,Ri(Am(F)));H=Cm(A.body,Dm,W,P)}}j.isString(ie)||(ie=ie?"include":"omit");const k=f&&"credentials"in i.prototype,B={...ce,signal:ve,method:O.toUpperCase(),headers:J.normalize().toJSON(),body:H,duplex:"half",credentials:k?ie:void 0};he=f&&new i(x,B);let _=await(f?Ce(he,ce):Ce(x,B));const re=v&&(Q==="stream"||Q==="response");if(v&&($||re&&me)){const A={};["status","statusText","headers"].forEach(le=>{A[le]=_[le]});const G=j.toFiniteNumber(_.headers.get("content-length")),[W,P]=$&&wm(G,Ri(Am($),!0))||[];_=new o(Cm(_.body,Dm,W,()=>{P&&P(),me&&me()}),A)}Q=Q||"text";let pe=await b[j.findKey(b,Q)||"text"](_,w);return!re&&me&&me(),await new Promise((A,G)=>{xm(A,G,{data:pe,headers:dt.from(_.headers),status:_.status,statusText:_.statusText,config:w,request:he})})}catch(k){throw me&&me(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new fe("Network Error",fe.ERR_NETWORK,w,he),{cause:k.cause||k}):fe.from(k,k&&k.code,w,he)}}},dA=new Map,zm=l=>{let r=l&&l.env||{};const{fetch:i,Request:o,Response:s}=r,f=[o,s,i];let d=f.length,h=d,g,p,v=dA;for(;h--;)g=f[h],p=v.get(g),p===void 0&&v.set(g,p=h?new Map:fA(r)),v=p;return p};zm();const ts={http:Uw,xhr:rA,fetch:{get:zm}};j.forEach(ts,(l,r)=>{if(l){try{Object.defineProperty(l,"name",{value:r})}catch{}Object.defineProperty(l,"adapterName",{value:r})}});const Um=l=>`- ${l}`,hA=l=>j.isFunction(l)||l===null||l===!1;function mA(l,r){l=j.isArray(l)?l:[l];const{length:i}=l;let o,s;const f={};for(let d=0;d<i;d++){o=l[d];let h;if(s=o,!hA(o)&&(s=ts[(h=String(o)).toLowerCase()],s===void 0))throw new fe(`Unknown adapter '${h}'`);if(s&&(j.isFunction(s)||(s=s.get(r))))break;f[h||"#"+d]=s}if(!s){const d=Object.entries(f).map(([g,p])=>`adapter ${g} `+(p===!1?"is not supported by the environment":"is not available in the build"));let h=i?d.length>1?`since :
|
|
142
142
|
`+d.map(Um).join(`
|
|
143
143
|
`):" "+Um(d[0]):"as no adapter specified";throw new fe("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return s}const Lm={getAdapter:mA,adapters:ts};function ns(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new Zl(null,l)}function jm(l){return ns(l),l.headers=dt.from(l.headers),l.data=es.call(l,l.transformRequest),["post","put","patch"].indexOf(l.method)!==-1&&l.headers.setContentType("application/x-www-form-urlencoded",!1),Lm.getAdapter(l.adapter||Xa.adapter,l)(l).then(function(o){return ns(l),o.data=es.call(l,l.transformResponse,o),o.headers=dt.from(o.headers),o},function(o){return Em(o)||(ns(l),o&&o.response&&(o.response.data=es.call(l,l.transformResponse,o.response),o.response.headers=dt.from(o.response.headers))),Promise.reject(o)})}const Hm="1.13.2",Ci={};["object","boolean","number","function","string","symbol"].forEach((l,r)=>{Ci[l]=function(o){return typeof o===l||"a"+(r<1?"n ":" ")+l}});const Bm={};Ci.transitional=function(r,i,o){function s(f,d){return"[Axios v"+Hm+"] Transitional option '"+f+"'"+d+(o?". "+o:"")}return(f,d,h)=>{if(r===!1)throw new fe(s(d," has been removed"+(i?" in "+i:"")),fe.ERR_DEPRECATED);return i&&!Bm[d]&&(Bm[d]=!0,console.warn(s(d," has been deprecated since v"+i+" and will be removed in the near future"))),r?r(f,d,h):!0}},Ci.spelling=function(r){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${r}`),!0)};function pA(l,r,i){if(typeof l!="object")throw new fe("options must be an object",fe.ERR_BAD_OPTION_VALUE);const o=Object.keys(l);let s=o.length;for(;s-- >0;){const f=o[s],d=r[f];if(d){const h=l[f],g=h===void 0||d(h,f,l);if(g!==!0)throw new fe("option "+f+" must be "+g,fe.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new fe("Unknown option "+f,fe.ERR_BAD_OPTION)}}const Di={assertOptions:pA,validators:Ci},en=Di.validators;let fl=class{constructor(r){this.defaults=r||{},this.interceptors={request:new ym,response:new ym}}async request(r,i){try{return await this._request(r,i)}catch(o){if(o instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const f=s.stack?s.stack.replace(/^.+\n/,""):"";try{o.stack?f&&!String(o.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
144
|
-
`+f):o.stack=f}catch{}}throw o}}_request(r,i){typeof r=="string"?(i=i||{},i.url=r):i=r||{},i=cl(this.defaults,i);const{transitional:o,paramsSerializer:s,headers:f}=i;o!==void 0&&Di.assertOptions(o,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},!1),s!=null&&(j.isFunction(s)?i.paramsSerializer={serialize:s}:Di.assertOptions(s,{encode:en.function,serialize:en.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Di.assertOptions(i,{baseUrl:en.spelling("baseURL"),withXsrfToken:en.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=f&&j.merge(f.common,f[i.method]);f&&j.forEach(["delete","get","head","post","put","patch","common"],w=>{delete f[w]}),i.headers=dt.concat(d,f);const h=[];let g=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(i)===!1||(g=g&&x.synchronous,h.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let v,b=0,T;if(!g){const w=[jm.bind(this),void 0];for(w.unshift(...h),w.push(...p),T=w.length,v=Promise.resolve(i);b<T;)v=v.then(w[b++],w[b++]);return v}T=h.length;let C=i;for(;b<T;){const w=h[b++],x=h[b++];try{C=w(C)}catch(O){x.call(this,O);break}}try{v=jm.call(this,C)}catch(w){return Promise.reject(w)}for(b=0,T=p.length;b<T;)v=v.then(p[b++],p[b++]);return v}getUri(r){r=cl(this.defaults,r);const i=Tm(r.baseURL,r.url,r.allowAbsoluteUrls);return gm(i,r.params,r.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(r){fl.prototype[r]=function(i,o){return this.request(cl(o||{},{method:r,url:i,data:(o||{}).data}))}}),j.forEach(["post","put","patch"],function(r){function i(o){return function(f,d,h){return this.request(cl(h||{},{method:r,headers:o?{"Content-Type":"multipart/form-data"}:{},url:f,data:d}))}}fl.prototype[r]=i(),fl.prototype[r+"Form"]=i(!0)});let gA=class Nv{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(f){i=f});const o=this;this.promise.then(s=>{if(!o._listeners)return;let f=o._listeners.length;for(;f-- >0;)o._listeners[f](s);o._listeners=null}),this.promise.then=s=>{let f;const d=new Promise(h=>{o.subscribe(h),f=h}).then(s);return d.cancel=function(){o.unsubscribe(f)},d},r(function(f,d,h){o.reason||(o.reason=new Zl(f,d,h),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const i=this._listeners.indexOf(r);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const r=new AbortController,i=o=>{r.abort(o)};return this.subscribe(i),r.signal.unsubscribe=()=>this.unsubscribe(i),r.signal}static source(){let r;return{token:new Nv(function(s){r=s}),cancel:r}}};function yA(l){return function(i){return l.apply(null,i)}}function vA(l){return j.isObject(l)&&l.isAxiosError===!0}const ls={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ls).forEach(([l,r])=>{ls[r]=l});function qm(l){const r=new fl(l),i=em(fl.prototype.request,r);return j.extend(i,fl.prototype,r,{allOwnKeys:!0}),j.extend(i,r,null,{allOwnKeys:!0}),i.create=function(s){return qm(cl(l,s))},i}const Be=qm(Xa);Be.Axios=fl,Be.CanceledError=Zl,Be.CancelToken=gA,Be.isCancel=Em,Be.VERSION=Hm,Be.toFormData=Ai,Be.AxiosError=fe,Be.Cancel=Be.CanceledError,Be.all=function(r){return Promise.all(r)},Be.spread=yA,Be.isAxiosError=vA,Be.mergeConfig=cl,Be.AxiosHeaders=dt,Be.formToJSON=l=>bm(j.isHTMLForm(l)?new FormData(l):l),Be.getAdapter=Lm.getAdapter,Be.HttpStatusCode=ls,Be.default=Be;const{Axios:iO,AxiosError:oO,CanceledError:uO,isCancel:sO,CancelToken:cO,VERSION:fO,all:dO,Cancel:hO,isAxiosError:mO,spread:pO,toFormData:gO,AxiosHeaders:yO,HttpStatusCode:vO,formToJSON:bO,getAdapter:SO,mergeConfig:EO}=Be;function bA({className:l,...r}){return L.jsx(CS,{role:"status","aria-label":"Loading",className:_t("size-4 animate-spin",l),...r})}function SA({apiUrl:l,productId:r,imageUrl:i}){
|
|
144
|
+
`+f):o.stack=f}catch{}}throw o}}_request(r,i){typeof r=="string"?(i=i||{},i.url=r):i=r||{},i=cl(this.defaults,i);const{transitional:o,paramsSerializer:s,headers:f}=i;o!==void 0&&Di.assertOptions(o,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},!1),s!=null&&(j.isFunction(s)?i.paramsSerializer={serialize:s}:Di.assertOptions(s,{encode:en.function,serialize:en.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Di.assertOptions(i,{baseUrl:en.spelling("baseURL"),withXsrfToken:en.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=f&&j.merge(f.common,f[i.method]);f&&j.forEach(["delete","get","head","post","put","patch","common"],w=>{delete f[w]}),i.headers=dt.concat(d,f);const h=[];let g=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(i)===!1||(g=g&&x.synchronous,h.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let v,b=0,T;if(!g){const w=[jm.bind(this),void 0];for(w.unshift(...h),w.push(...p),T=w.length,v=Promise.resolve(i);b<T;)v=v.then(w[b++],w[b++]);return v}T=h.length;let C=i;for(;b<T;){const w=h[b++],x=h[b++];try{C=w(C)}catch(O){x.call(this,O);break}}try{v=jm.call(this,C)}catch(w){return Promise.reject(w)}for(b=0,T=p.length;b<T;)v=v.then(p[b++],p[b++]);return v}getUri(r){r=cl(this.defaults,r);const i=Tm(r.baseURL,r.url,r.allowAbsoluteUrls);return gm(i,r.params,r.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(r){fl.prototype[r]=function(i,o){return this.request(cl(o||{},{method:r,url:i,data:(o||{}).data}))}}),j.forEach(["post","put","patch"],function(r){function i(o){return function(f,d,h){return this.request(cl(h||{},{method:r,headers:o?{"Content-Type":"multipart/form-data"}:{},url:f,data:d}))}}fl.prototype[r]=i(),fl.prototype[r+"Form"]=i(!0)});let gA=class Nv{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(f){i=f});const o=this;this.promise.then(s=>{if(!o._listeners)return;let f=o._listeners.length;for(;f-- >0;)o._listeners[f](s);o._listeners=null}),this.promise.then=s=>{let f;const d=new Promise(h=>{o.subscribe(h),f=h}).then(s);return d.cancel=function(){o.unsubscribe(f)},d},r(function(f,d,h){o.reason||(o.reason=new Zl(f,d,h),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const i=this._listeners.indexOf(r);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const r=new AbortController,i=o=>{r.abort(o)};return this.subscribe(i),r.signal.unsubscribe=()=>this.unsubscribe(i),r.signal}static source(){let r;return{token:new Nv(function(s){r=s}),cancel:r}}};function yA(l){return function(i){return l.apply(null,i)}}function vA(l){return j.isObject(l)&&l.isAxiosError===!0}const ls={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ls).forEach(([l,r])=>{ls[r]=l});function qm(l){const r=new fl(l),i=em(fl.prototype.request,r);return j.extend(i,fl.prototype,r,{allOwnKeys:!0}),j.extend(i,r,null,{allOwnKeys:!0}),i.create=function(s){return qm(cl(l,s))},i}const Be=qm(Xa);Be.Axios=fl,Be.CanceledError=Zl,Be.CancelToken=gA,Be.isCancel=Em,Be.VERSION=Hm,Be.toFormData=Ai,Be.AxiosError=fe,Be.Cancel=Be.CanceledError,Be.all=function(r){return Promise.all(r)},Be.spread=yA,Be.isAxiosError=vA,Be.mergeConfig=cl,Be.AxiosHeaders=dt,Be.formToJSON=l=>bm(j.isHTMLForm(l)?new FormData(l):l),Be.getAdapter=Lm.getAdapter,Be.HttpStatusCode=ls,Be.default=Be;const{Axios:iO,AxiosError:oO,CanceledError:uO,isCancel:sO,CancelToken:cO,VERSION:fO,all:dO,Cancel:hO,isAxiosError:mO,spread:pO,toFormData:gO,AxiosHeaders:yO,HttpStatusCode:vO,formToJSON:bO,getAdapter:SO,mergeConfig:EO}=Be;function bA({className:l,...r}){return L.jsx(CS,{role:"status","aria-label":"Loading",className:_t("size-4 animate-spin",l),...r})}function SA({apiUrl:l,productId:r,imageUrl:i}){const[o,s]=S.useState(),[f,d]=S.useState(),[h,g]=S.useState(!1),[p,v]=S.useState(!1),b=S.useRef(null),T=async x=>await $x(x,{cacheBust:!0,pixelRatio:1,skipFonts:!1}),C=async()=>{if(b.current){g(!0),v(!0),await Nb(100);try{const x=await T(b.current),{data:O}=await Be.post(l,{productId:r,image:x});console.log(O),await Be.post("/cart/add.json",{items:[{id:O.id,quantity:1}]}),window.location.href="/cart"}catch(x){window.alert("Error while cropping or adding product to cart. Contact our manager."),console.error("Error while cropping or adding product to cart. Contact our manager."),console.error(x)}finally{g(!1),v(!1)}}},w=L.jsxs(ou,{onClick:C,disabled:h,children:[h&&L.jsx(bA,{})," Add to cart"]});return L.jsx(L.Fragment,{children:L.jsx(ex,{actionButton:w,heightValue:f,widthValue:o,onHeightChange:d,onWidthChange:s,children:L.jsxs("div",{className:"flex justify-center",children:[L.jsx("img",{className:"object-cover max-h-[70vh] border-2 border-dashed border-black",src:i,ref:b,style:{aspectRatio:`${o??"50"} / ${f??"50"}`,pointerEvents:"none",display:p?"block":"none"}}),L.jsx(tx,{width:o,height:f,imageUrl:i,generatingImg:p})]})})})}function EA(l,r){const i=typeof l=="string"?document.querySelector(l):l;Yv.createRoot(i).render(L.jsx(SA,{...r}))}return Qo.mountConstructorWidget=EA,Object.defineProperty(Qo,Symbol.toStringTag,{value:"Module"}),Qo}({});
|