realtimex-crm 0.1.4 → 0.2.0

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.
@@ -1,4 +1,4 @@
1
- var zo=Object.defineProperty;var o=(e,t)=>zo(e,"name",{value:t,configurable:!0});import{r as v,C as Yo,L as Ko,u as Jo,a as Xo,b as Qo,c as Zo,d as es,e as $t,f as ur,g as ts,h as fr,i as ns,j as rs,k as os,l as vn,m as g,F as pr,n as gr,o as mr,p as hr,q as ss,B as br,X as is,_ as as,s as ls,t as cs,v as ds,I as xr,w as vr,x as us,y as yr,z as fs,A as ps,D as gs,E as ms,G as yn,H as Be,T as Dn,J as hs,K as bs,R as xs,M as vs,N as ys,O as Ds,P as j,Q as Cs,S as Dr,U as he,V as Ss,W as Is,Y as Wt,Z as Vt,$ as it,a0 as at,a1 as lt,a2 as ct,a3 as Cr,a4 as ws,a5 as Sr,a6 as Cn,a7 as Ae,a8 as Ir,a9 as Es,aa as Ps,ab as $e,ac as Rt,ad as Ns,ae as Ut,af as dt,ag as As,ah as wr,ai as Rs,aj as Os,ak as Ht,al as Ts,am as Bs,an as Er,ao as Pr,ap as Nr,aq as Je,ar as Ls,as as js,at as Ar,au as Rr,av as Ms,aw as Fs,ax as _s,ay as Gs,az as ks,aA as $s,aB as Ws,aC as Vs,aD as Us,aE as Hs,aF as Or,aG as qs,aH as zs,aI as Ys,aJ as Ks,aK as Js,aL as Xs,aM as Qs,aN as Zs,aO as ei,aP as ti}from"./index-ChDTDzD2.js";var ni=o(function(){var e=v.useContext(Yo);if(!e)throw new Error("useCreateContext must be used inside a CreateContextProvider");return e},"useCreateContext"),ri=o(function(){var e=v.useContext(Ko);if(!e)throw new Error("useListFilterContext must be used inside a ListFilterContextProvider");return e},"useListFilterContext"),Re=function(){return Re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Re.apply(this,arguments)},oi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},si=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},ii=o(function(e){var t,n=e.debounce,r=e.enableGetChoices,s=e.filter,i=e.page,a=i===void 0?1:i,l=e.perPage,c=l===void 0?25:l,d=e.sort,p=d===void 0?{field:"id",order:"DESC"}:d,f=e.queryOptions,u=f===void 0?{}:f,m=e.reference,h=e.source,x=Jo().getValues,b=Xo(h),D=(t=Qo({name:b}))!==null&&t!==void 0?t:x(b),C=u.meta,E=oi(u,["meta"]),S=Zo(m,{ids:D||ai,meta:C},{enabled:D!=null&&D.length>0}),I=S.data,P=S.error,O=S.isLoading,T=S.isFetching,k=S.isPaused,N=S.isPending,A=S.isPlaceholderData,$=S.refetch,K=es({resource:m,page:a,perPage:c,sort:p,debounce:n,filter:s}),L=K[0],_=K[1],se=I?I.filter(Boolean):[],ye=r?r(L.filterValues):!0,W=$t(m,{pagination:{page:L.page,perPage:L.perPage},sort:{field:L.sort,order:L.order},filter:Re(Re({},L.filter),s),meta:C},Re({retry:!1,enabled:ye,placeholderData:o(function(H){return H},"placeholderData")},E)),ee=W.data,de=W.total,te=W.pageInfo,De=W.error,ie=W.isLoading,Ue=W.isFetching,Ce=W.isPaused,Se=W.isPending,He=W.isPlaceholderData,qe=W.refetch,ue=ee&&ee.length>0?li(ee,se):se.length>0?se:ee,Ie=v.useCallback(function(){$(),qe()},[$,qe]),xn=v.useMemo(function(){return{field:L.sort,order:L.order}},[L.sort,L.order]);return{sort:xn,allChoices:ue,availableChoices:ee,selectedChoices:se,displayedFilters:L.displayedFilters,error:P||De,filter:s,filterValues:L.filterValues,hideFilter:_.hideFilter,isFetching:T||Ue,isLoading:O||ie,isPaused:k||Ce,isPending:N||Se,isPlaceholderData:A||He,page:L.page,perPage:L.perPage,refetch:Ie,resource:m,setFilters:_.setFilters,setPage:_.setPage,setPerPage:_.setPerPage,setSort:_.setSort,showFilter:_.showFilter,source:h,total:de,hasNextPage:te?te.hasNextPage:de!=null?L.page*L.perPage<de:void 0,hasPreviousPage:te?te.hasPreviousPage:L.page>1,isFromReference:!0}},"useReferenceArrayInputController"),ai=[],li=o(function(e,t){var n=si([],e,!0),r=e.map(function(s){return s.id});return t.forEach(function(s){r.includes(s.id)||(r.push(s.id),n.push(s))}),n},"mergeReferences");const ci=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],di=ur("archive-restore",ci);const ui=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],fi=ur("archive",ui),Tr=o(e=>{const{filterToQuery:t=pi,inputText:n}=e,{allChoices:r=[],source:s,resource:i,isFromReference:a,setFilters:l}=ts(e),{id:c,field:d,isRequired:p}=fr({...e,source:s}),f=ns(),{placeholder:u=f("ra.action.search",{_:"Search..."})}=e,m=rs(i),{getChoiceText:h,getChoiceValue:x}=os({optionText:e.optionText??(a?m:"name"),optionValue:e.optionValue??"id",disableValue:e.disableValue,translateChoice:e.translateChoice??!a}),b=v.useRef(null),[D,C]=v.useState(!1),E=vn(N=>{d.onChange(d.value.filter(A=>A!==x(N)))}),S=vn(N=>{const A=b.current;A&&((N.key==="Delete"||N.key==="Backspace")&&A.value===""&&d.onChange(d.value.slice(0,-1)),N.key==="Escape"&&A.blur())}),I=r.filter(N=>!d.value.includes(x(N))),P=r.filter(N=>d.value.includes(x(N))),[O,T]=v.useState(""),k=v.useCallback(N=>typeof n=="function"?n(N):n!==void 0?n:h(N),[n,h]);return g.jsxs(pr,{className:e.className,id:c,name:d.name,children:[e.label!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:e.label,source:e.source??s,resource:i,isRequired:p})}),g.jsx(hr,{children:g.jsxs(ss,{onKeyDown:S,shouldFilter:!a,className:"overflow-visible bg-transparent",children:[g.jsx("div",{className:"group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",children:g.jsxs("div",{className:"flex flex-wrap gap-1",children:[P.map(N=>g.jsxs(br,{variant:"outline",children:[k(N),g.jsxs("button",{className:"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",onKeyDown:o(A=>{A.key==="Enter"&&E(N)},"onKeyDown"),onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onClick:o(A=>{A.preventDefault(),E(N)},"onClick"),children:[g.jsx("span",{className:"sr-only",children:f("ra.action.remove",{_:"Remove"})}),g.jsx(is,{className:"h-3 w-3"})]})]},x(N))),g.jsx(as.Input,{ref:b,value:O,onValueChange:o(N=>{T(N),a&&l(t(N),void 0,!0)},"onValueChange"),onBlur:o(()=>C(!1),"onBlur"),onFocus:o(()=>C(!0),"onFocus"),placeholder:u,className:"ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground"})]})}),g.jsx("div",{className:"relative",children:g.jsx(ls,{children:D&&I.length>0?g.jsx("div",{className:"absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:g.jsx(cs,{className:"h-full overflow-auto",children:I.map(N=>g.jsx(ds,{onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onSelect:o(()=>{T(""),a&&l(t("")),d.onChange([...d.value,x(N)])},"onSelect"),className:"cursor-pointer",children:h(N)},x(N)))})}):null})})]})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"AutocompleteArrayInput"),pi=o(e=>({q:e}),"DefaultFilterToQuery"),gi=o(({actions:e,children:t,className:n,disableBreadcrumb:r,title:s,...i})=>g.jsx(us,{...i,children:g.jsx(mi,{actions:e,className:n,disableBreadcrumb:r,title:s,children:t})}),"Create"),mi=o(({actions:e,disableBreadcrumb:t,title:n,children:r,className:s})=>{const i=ni(),a=yr();if(!a)throw new Error("The CreateView component must be used within a ResourceContextProvider");const c=fs()(a,2),p=ps()({resource:a,type:"list"}),f=gs();return g.jsxs(g.Fragment,{children:[!t&&g.jsxs(ms,{children:[f&&g.jsx(yn,{children:g.jsx(Be,{to:"/",children:g.jsx(Dn,{i18nKey:"ra.page.dashboard",children:"Home"})})}),g.jsx(yn,{children:g.jsx(Be,{to:p,children:c})}),g.jsx(hs,{children:g.jsx(Dn,{i18nKey:"ra.action.create",children:"Create"})})]}),g.jsxs("div",{className:bs("flex justify-between items-start flex-wrap gap-2 my-2",s),children:[g.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:n!==void 0?n:i.defaultTitle}),e]}),g.jsx("div",{className:"my-2",children:r})]})},"CreateView"),hi=o(e=>{const{children:t=bi,reference:n,sort:r,filter:s=xi}=e;if(v.Children.count(t)!==1)throw new Error("<ReferenceArrayInput> only accepts a single child (like <AutocompleteArrayInput>)");const i=ii({...e,sort:r,filter:s});return g.jsx(xs,{value:n,children:g.jsx(vs,{value:i,children:t})})},"ReferenceArrayInput"),bi=g.jsx(Tr,{}),xi={},vi=o(e=>{const{label:t,source:n,className:r,resource:s,validate:i,format:a,parse:l=yi,onFocus:c,...d}=e,p=yr({resource:s}),{id:f,field:u,isRequired:m}=fr(e),h=o(S=>{const I=S.target.value,P=l(I);b(I),u.onChange(P??0)},"handleChange"),[x,b]=v.useState(u.value?.toString()??""),D=v.useRef(!1),C=o(S=>{c?.(S),D.current=!0},"handleFocus"),E=o(S=>{u.onBlur?.(S),D.current=!1,b(u.value?.toString()??"")},"handleBlur");return v.useEffect(()=>{D.current||b(u.value?.toString()??"")},[u.value]),g.jsxs(pr,{id:f,className:r,name:u.name,children:[t!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:t,source:n,resource:p,isRequired:m})}),g.jsx(hr,{children:g.jsx(ys,{...d,...u,type:"number",value:x,onChange:h,onFocus:C,onBlur:E})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"NumberInput"),yi=o(e=>{if(e==null||e==="")return null;const t=parseFloat(e);return isNaN(t)?0:t},"convertStringToNumber");function U(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}o(U,"formatProdErrorMessage");var Di=typeof Symbol=="function"&&Symbol.observable||"@@observable",Sn=Di,In=o(()=>Math.random().toString(36).substring(7).split("").join("."),"randomString"),Ci={INIT:`@@redux/INIT${In()}`,REPLACE:`@@redux/REPLACE${In()}`},wn=Ci;function Si(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}o(Si,"isPlainObject");function Br(e,t,n){if(typeof e!="function")throw new Error(U(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(U(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(U(1));return n(Br)(e,t)}let r=e,s=t,i=new Map,a=i,l=0,c=!1;function d(){a===i&&(a=new Map,i.forEach((b,D)=>{a.set(D,b)}))}o(d,"ensureCanMutateNextListeners");function p(){if(c)throw new Error(U(3));return s}o(p,"getState");function f(b){if(typeof b!="function")throw new Error(U(4));if(c)throw new Error(U(5));let D=!0;d();const C=l++;return a.set(C,b),o(function(){if(D){if(c)throw new Error(U(6));D=!1,d(),a.delete(C),i=null}},"unsubscribe")}o(f,"subscribe");function u(b){if(!Si(b))throw new Error(U(7));if(typeof b.type>"u")throw new Error(U(8));if(typeof b.type!="string")throw new Error(U(17));if(c)throw new Error(U(9));try{c=!0,s=r(s,b)}finally{c=!1}return(i=a).forEach(C=>{C()}),b}o(u,"dispatch");function m(b){if(typeof b!="function")throw new Error(U(10));r=b,u({type:wn.REPLACE})}o(m,"replaceReducer");function h(){const b=f;return{subscribe(D){if(typeof D!="object"||D===null)throw new Error(U(11));function C(){const S=D;S.next&&S.next(p())}return o(C,"observeState"),C(),{unsubscribe:b(C)}},[Sn](){return this}}}return o(h,"observable"),u({type:wn.INIT}),{dispatch:u,subscribe:f,getState:p,replaceReducer:m,[Sn]:h}}o(Br,"createStore$1");function En(e,t){return function(...n){return t(e.apply(this,n))}}o(En,"bindActionCreator");function Pn(e,t){if(typeof e=="function")return En(e,t);if(typeof e!="object"||e===null)throw new Error(U(16));const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=En(s,t))}return n}o(Pn,"bindActionCreators$1");function Lr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}o(Lr,"compose");function Ii(...e){return t=>(n,r)=>{const s=t(n,r);let i=o(()=>{throw new Error(U(15))},"dispatch");const a={getState:s.getState,dispatch:o((c,...d)=>i(c,...d),"dispatch")},l=e.map(c=>c(a));return i=Lr(...l)(s.dispatch),{...s,dispatch:i}}}o(Ii,"applyMiddleware");var xt={exports:{}},vt={};var Nn;function wi(){if(Nn)return vt;Nn=1;var e=Ds();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}o(t,"is");var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return vt.useSyncExternalStoreWithSelector=function(c,d,p,f,u){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function b(I){if(!D){if(D=!0,C=I,I=f(I),u!==void 0&&h.hasValue){var P=h.value;if(u(P,I))return E=P}return E=I}if(P=E,n(C,I))return P;var O=f(I);return u!==void 0&&u(P,O)?(C=I,P):(C=I,E=O)}o(b,"memoizedSelector");var D=!1,C,E,S=p===void 0?null:p;return[function(){return b(d())},S===null?void 0:function(){return b(S())}]},[d,p,f,u]);var x=r(c,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=x},[x]),l(x),x},vt}o(wi,"requireUseSyncExternalStoreWithSelector_production");var An;function Ei(){return An||(An=1,xt.exports=wi()),xt.exports}o(Ei,"requireWithSelector");Ei();var Pi=v.version.startsWith("19"),Ni=Symbol.for(Pi?"react.transitional.element":"react.element"),Ai=Symbol.for("react.portal"),Ri=Symbol.for("react.fragment"),Oi=Symbol.for("react.strict_mode"),Ti=Symbol.for("react.profiler"),Bi=Symbol.for("react.consumer"),Li=Symbol.for("react.context"),jr=Symbol.for("react.forward_ref"),ji=Symbol.for("react.suspense"),Mi=Symbol.for("react.suspense_list"),qt=Symbol.for("react.memo"),Fi=Symbol.for("react.lazy"),_i=jr,Gi=qt;function ki(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case Ni:switch(e=e.type,e){case Ri:case Ti:case Oi:case ji:case Mi:return e;default:switch(e=e&&e.$$typeof,e){case Li:case jr:case Fi:case qt:return e;case Bi:return e;default:return t}}case Ai:return t}}}o(ki,"typeOf");function $i(e){return ki(e)===qt}o($i,"isMemo");function Wi(e,t,n,r,{areStatesEqual:s,areOwnPropsEqual:i,areStatePropsEqual:a}){let l=!1,c,d,p,f,u;function m(C,E){return c=C,d=E,p=e(c,d),f=t(r,d),u=n(p,f,d),l=!0,u}o(m,"handleFirstCall");function h(){return p=e(c,d),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(h,"handleNewPropsAndNewState");function x(){return e.dependsOnOwnProps&&(p=e(c,d)),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(x,"handleNewProps");function b(){const C=e(c,d),E=!a(C,p);return p=C,E&&(u=n(p,f,d)),u}o(b,"handleNewState");function D(C,E){const S=!i(E,d),I=!s(C,c,E,d);return c=C,d=E,S&&I?h():S?x():I?b():u}return o(D,"handleSubsequentCalls"),o(function(E,S){return l?D(E,S):m(E,S)},"pureFinalPropsSelector")}o(Wi,"pureFinalPropsSelectorFactory");function Vi(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...s}){const i=t(e,s),a=n(e,s),l=r(e,s);return Wi(i,a,l,e,s)}o(Vi,"finalPropsSelectorFactory");function Ui(e,t){const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=(...i)=>t(s(...i)))}return n}o(Ui,"bindActionCreators");function Ot(e){return o(function(n){const r=e(n);function s(){return r}return o(s,"constantSelector"),s.dependsOnOwnProps=!1,s},"initConstantSelector")}o(Ot,"wrapMapToPropsConstant");function Rn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}o(Rn,"getDependsOnOwnProps");function Mr(e,t){return o(function(r,{displayName:s}){const i=o(function(l,c){return i.dependsOnOwnProps?i.mapToProps(l,c):i.mapToProps(l,void 0)},"mapToPropsProxy");return i.dependsOnOwnProps=!0,i.mapToProps=o(function(l,c){i.mapToProps=e,i.dependsOnOwnProps=Rn(e);let d=i(l,c);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Rn(d),d=i(l,c)),d},"detectFactoryAndVerify"),i},"initProxySelector")}o(Mr,"wrapMapToPropsFunc");function zt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}o(zt,"createInvalidArgFactory");function Hi(e){return e&&typeof e=="object"?Ot(t=>Ui(e,t)):e?typeof e=="function"?Mr(e):zt(e,"mapDispatchToProps"):Ot(t=>({dispatch:t}))}o(Hi,"mapDispatchToPropsFactory");function qi(e){return e?typeof e=="function"?Mr(e):zt(e,"mapStateToProps"):Ot(()=>({}))}o(qi,"mapStateToPropsFactory");function zi(e,t,n){return{...n,...e,...t}}o(zi,"defaultMergeProps");function Yi(e){return o(function(n,{displayName:r,areMergedPropsEqual:s}){let i=!1,a;return o(function(c,d,p){const f=e(c,d,p);return i?s(f,a)||(a=f):(i=!0,a=f),a},"mergePropsProxy")},"initMergePropsProxy")}o(Yi,"wrapMergePropsFunc");function Ki(e){return e?typeof e=="function"?Yi(e):zt(e,"mergeProps"):()=>zi}o(Ki,"mergePropsFactory");function Ji(e){e()}o(Ji,"defaultNoopBatch");function Xi(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Ji(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,o(function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)},"unsubscribe")}}}o(Xi,"createListenerCollection");var On={notify(){},get:o(()=>[],"get")};function Fr(e,t){let n,r=On,s=0,i=!1;function a(x){p();const b=r.subscribe(x);let D=!1;return()=>{D||(D=!0,b(),f())}}o(a,"addNestedSub");function l(){r.notify()}o(l,"notifyNestedSubs");function c(){h.onStateChange&&h.onStateChange()}o(c,"handleChangeWrapper");function d(){return i}o(d,"isSubscribed");function p(){s++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Xi())}o(p,"trySubscribe");function f(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=On)}o(f,"tryUnsubscribe");function u(){i||(i=!0,p())}o(u,"trySubscribeSelf");function m(){i&&(i=!1,f())}o(m,"tryUnsubscribeSelf");const h={addNestedSub:a,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:u,tryUnsubscribe:m,getListeners:o(()=>r,"getListeners")};return h}o(Fr,"createSubscription");var Qi=o(()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u","canUseDOM"),Zi=Qi(),ea=o(()=>typeof navigator<"u"&&navigator.product==="ReactNative","isRunningInReactNative"),ta=ea(),na=o(()=>Zi||ta?v.useLayoutEffect:v.useEffect,"getUseIsomorphicLayoutEffect"),Qe=na();function Tn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}o(Tn,"is");function yt(e,t){if(Tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Tn(e[n[s]],t[n[s]]))return!1;return!0}o(yt,"shallowEqual");var ra={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},oa={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},sa={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ia={[_i]:sa,[Gi]:_r};function Bn(e){return $i(e)?_r:ia[e.$$typeof]||ra}o(Bn,"getStatics");var aa=Object.defineProperty,la=Object.getOwnPropertyNames,Ln=Object.getOwnPropertySymbols,ca=Object.getOwnPropertyDescriptor,da=Object.getPrototypeOf,jn=Object.prototype;function Tt(e,t){if(typeof t!="string"){if(jn){const i=da(t);i&&i!==jn&&Tt(e,i)}let n=la(t);Ln&&(n=n.concat(Ln(t)));const r=Bn(e),s=Bn(t);for(let i=0;i<n.length;++i){const a=n[i];if(!oa[a]&&!(s&&s[a])&&!(r&&r[a])){const l=ca(t,a);try{aa(e,a,l)}catch{}}}}return e}o(Tt,"hoistNonReactStatics");var ua=Symbol.for("react-redux-context"),fa=typeof globalThis<"u"?globalThis:{};function pa(){if(!v.createContext)return{};const e=fa[ua]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}o(pa,"getContext");var Gr=pa(),ga=[null,null];function ma(e,t,n){Qe(()=>e(...t),n)}o(ma,"useIsomorphicLayoutEffectWithArgs");function ha(e,t,n,r,s,i){e.current=r,n.current=!1,s.current&&(s.current=null,i())}o(ha,"captureWrapperProps");function ba(e,t,n,r,s,i,a,l,c,d,p){if(!e)return()=>{};let f=!1,u=null;const m=o(()=>{if(f||!l.current)return;const x=t.getState();let b,D;try{b=r(x,s.current)}catch(C){D=C,u=C}D||(u=null),b===i.current?a.current||d():(i.current=b,c.current=b,a.current=!0,p())},"checkForUpdates");return n.onStateChange=m,n.trySubscribe(),m(),o(()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u},"unsubscribeWrapper")}o(ba,"subscribeUpdates");function xa(e,t){return e===t}o(xa,"strictEqual");function va(e,t,n,{pure:r,areStatesEqual:s=xa,areOwnPropsEqual:i=yt,areStatePropsEqual:a=yt,areMergedPropsEqual:l=yt,forwardRef:c=!1,context:d=Gr}={}){const p=d,f=qi(e),u=Hi(t),m=Ki(n),h=!!e;return o(b=>{const D=b.displayName||b.name||"Component",C=`Connect(${D})`,E={shouldHandleStateChanges:h,displayName:C,wrappedComponentName:D,WrappedComponent:b,initMapStateToProps:f,initMapDispatchToProps:u,initMergeProps:m,areStatesEqual:s,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:l};function S(O){const[T,k,N]=v.useMemo(()=>{const{reactReduxForwardedRef:H,...we}=O;return[O.context,H,we]},[O]),A=v.useMemo(()=>{let H=p;return T?.Consumer,H},[T,p]),$=v.useContext(A),K=!!O.store&&!!O.store.getState&&!!O.store.dispatch,L=!!$&&!!$.store,_=K?O.store:$.store,se=L?$.getServerState:_.getState,ye=v.useMemo(()=>Vi(_.dispatch,E),[_]),[W,ee]=v.useMemo(()=>{if(!h)return ga;const H=Fr(_,K?void 0:$.subscription),we=H.notifyNestedSubs.bind(H);return[H,we]},[_,K,$]),de=v.useMemo(()=>K?$:{...$,subscription:W},[K,$,W]),te=v.useRef(void 0),De=v.useRef(N),ie=v.useRef(void 0),Ue=v.useRef(!1),Ce=v.useRef(!1),Se=v.useRef(void 0);Qe(()=>(Ce.current=!0,()=>{Ce.current=!1}),[]);const He=v.useMemo(()=>o(()=>ie.current&&N===De.current?ie.current:ye(_.getState(),N),"selector"),[_,N]),qe=v.useMemo(()=>o(we=>W?ba(h,_,W,ye,De,te,Ue,Ce,ie,ee,we):()=>{},"subscribe"),[W]);ma(ha,[De,te,Ue,N,ie,ee]);let ue;try{ue=v.useSyncExternalStore(qe,He,se?()=>ye(se(),N):He)}catch(H){throw Se.current&&(H.message+=`
1
+ var zo=Object.defineProperty;var o=(e,t)=>zo(e,"name",{value:t,configurable:!0});import{r as v,C as Yo,L as Ko,u as Jo,a as Xo,b as Qo,c as Zo,d as es,e as $t,f as ur,g as ts,h as fr,i as ns,j as rs,k as os,l as vn,m as g,F as pr,n as gr,o as mr,p as hr,q as ss,B as br,X as is,_ as as,s as ls,t as cs,v as ds,I as xr,w as vr,x as us,y as yr,z as fs,A as ps,D as gs,E as ms,G as yn,H as Be,T as Dn,J as hs,K as bs,R as xs,M as vs,N as ys,O as Ds,P as j,Q as Cs,S as Dr,U as he,V as Ss,W as Is,Y as Wt,Z as Vt,$ as it,a0 as at,a1 as lt,a2 as ct,a3 as Cr,a4 as ws,a5 as Sr,a6 as Cn,a7 as Ae,a8 as Ir,a9 as Es,aa as Ps,ab as $e,ac as Rt,ad as Ns,ae as Ut,af as dt,ag as As,ah as wr,ai as Rs,aj as Os,ak as Ht,al as Ts,am as Bs,an as Er,ao as Pr,ap as Nr,aq as Je,ar as Ls,as as js,at as Ar,au as Rr,av as Ms,aw as Fs,ax as _s,ay as Gs,az as ks,aA as $s,aB as Ws,aC as Vs,aD as Us,aE as Hs,aF as Or,aG as qs,aH as zs,aI as Ys,aJ as Ks,aK as Js,aL as Xs,aM as Qs,aN as Zs,aO as ei,aP as ti}from"./index-NL4AEbnn.js";var ni=o(function(){var e=v.useContext(Yo);if(!e)throw new Error("useCreateContext must be used inside a CreateContextProvider");return e},"useCreateContext"),ri=o(function(){var e=v.useContext(Ko);if(!e)throw new Error("useListFilterContext must be used inside a ListFilterContextProvider");return e},"useListFilterContext"),Re=function(){return Re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Re.apply(this,arguments)},oi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},si=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},ii=o(function(e){var t,n=e.debounce,r=e.enableGetChoices,s=e.filter,i=e.page,a=i===void 0?1:i,l=e.perPage,c=l===void 0?25:l,d=e.sort,p=d===void 0?{field:"id",order:"DESC"}:d,f=e.queryOptions,u=f===void 0?{}:f,m=e.reference,h=e.source,x=Jo().getValues,b=Xo(h),D=(t=Qo({name:b}))!==null&&t!==void 0?t:x(b),C=u.meta,E=oi(u,["meta"]),S=Zo(m,{ids:D||ai,meta:C},{enabled:D!=null&&D.length>0}),I=S.data,P=S.error,O=S.isLoading,T=S.isFetching,k=S.isPaused,N=S.isPending,A=S.isPlaceholderData,$=S.refetch,K=es({resource:m,page:a,perPage:c,sort:p,debounce:n,filter:s}),L=K[0],_=K[1],se=I?I.filter(Boolean):[],ye=r?r(L.filterValues):!0,W=$t(m,{pagination:{page:L.page,perPage:L.perPage},sort:{field:L.sort,order:L.order},filter:Re(Re({},L.filter),s),meta:C},Re({retry:!1,enabled:ye,placeholderData:o(function(H){return H},"placeholderData")},E)),ee=W.data,de=W.total,te=W.pageInfo,De=W.error,ie=W.isLoading,Ue=W.isFetching,Ce=W.isPaused,Se=W.isPending,He=W.isPlaceholderData,qe=W.refetch,ue=ee&&ee.length>0?li(ee,se):se.length>0?se:ee,Ie=v.useCallback(function(){$(),qe()},[$,qe]),xn=v.useMemo(function(){return{field:L.sort,order:L.order}},[L.sort,L.order]);return{sort:xn,allChoices:ue,availableChoices:ee,selectedChoices:se,displayedFilters:L.displayedFilters,error:P||De,filter:s,filterValues:L.filterValues,hideFilter:_.hideFilter,isFetching:T||Ue,isLoading:O||ie,isPaused:k||Ce,isPending:N||Se,isPlaceholderData:A||He,page:L.page,perPage:L.perPage,refetch:Ie,resource:m,setFilters:_.setFilters,setPage:_.setPage,setPerPage:_.setPerPage,setSort:_.setSort,showFilter:_.showFilter,source:h,total:de,hasNextPage:te?te.hasNextPage:de!=null?L.page*L.perPage<de:void 0,hasPreviousPage:te?te.hasPreviousPage:L.page>1,isFromReference:!0}},"useReferenceArrayInputController"),ai=[],li=o(function(e,t){var n=si([],e,!0),r=e.map(function(s){return s.id});return t.forEach(function(s){r.includes(s.id)||(r.push(s.id),n.push(s))}),n},"mergeReferences");const ci=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],di=ur("archive-restore",ci);const ui=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],fi=ur("archive",ui),Tr=o(e=>{const{filterToQuery:t=pi,inputText:n}=e,{allChoices:r=[],source:s,resource:i,isFromReference:a,setFilters:l}=ts(e),{id:c,field:d,isRequired:p}=fr({...e,source:s}),f=ns(),{placeholder:u=f("ra.action.search",{_:"Search..."})}=e,m=rs(i),{getChoiceText:h,getChoiceValue:x}=os({optionText:e.optionText??(a?m:"name"),optionValue:e.optionValue??"id",disableValue:e.disableValue,translateChoice:e.translateChoice??!a}),b=v.useRef(null),[D,C]=v.useState(!1),E=vn(N=>{d.onChange(d.value.filter(A=>A!==x(N)))}),S=vn(N=>{const A=b.current;A&&((N.key==="Delete"||N.key==="Backspace")&&A.value===""&&d.onChange(d.value.slice(0,-1)),N.key==="Escape"&&A.blur())}),I=r.filter(N=>!d.value.includes(x(N))),P=r.filter(N=>d.value.includes(x(N))),[O,T]=v.useState(""),k=v.useCallback(N=>typeof n=="function"?n(N):n!==void 0?n:h(N),[n,h]);return g.jsxs(pr,{className:e.className,id:c,name:d.name,children:[e.label!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:e.label,source:e.source??s,resource:i,isRequired:p})}),g.jsx(hr,{children:g.jsxs(ss,{onKeyDown:S,shouldFilter:!a,className:"overflow-visible bg-transparent",children:[g.jsx("div",{className:"group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",children:g.jsxs("div",{className:"flex flex-wrap gap-1",children:[P.map(N=>g.jsxs(br,{variant:"outline",children:[k(N),g.jsxs("button",{className:"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",onKeyDown:o(A=>{A.key==="Enter"&&E(N)},"onKeyDown"),onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onClick:o(A=>{A.preventDefault(),E(N)},"onClick"),children:[g.jsx("span",{className:"sr-only",children:f("ra.action.remove",{_:"Remove"})}),g.jsx(is,{className:"h-3 w-3"})]})]},x(N))),g.jsx(as.Input,{ref:b,value:O,onValueChange:o(N=>{T(N),a&&l(t(N),void 0,!0)},"onValueChange"),onBlur:o(()=>C(!1),"onBlur"),onFocus:o(()=>C(!0),"onFocus"),placeholder:u,className:"ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground"})]})}),g.jsx("div",{className:"relative",children:g.jsx(ls,{children:D&&I.length>0?g.jsx("div",{className:"absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:g.jsx(cs,{className:"h-full overflow-auto",children:I.map(N=>g.jsx(ds,{onMouseDown:o(A=>{A.preventDefault(),A.stopPropagation()},"onMouseDown"),onSelect:o(()=>{T(""),a&&l(t("")),d.onChange([...d.value,x(N)])},"onSelect"),className:"cursor-pointer",children:h(N)},x(N)))})}):null})})]})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"AutocompleteArrayInput"),pi=o(e=>({q:e}),"DefaultFilterToQuery"),gi=o(({actions:e,children:t,className:n,disableBreadcrumb:r,title:s,...i})=>g.jsx(us,{...i,children:g.jsx(mi,{actions:e,className:n,disableBreadcrumb:r,title:s,children:t})}),"Create"),mi=o(({actions:e,disableBreadcrumb:t,title:n,children:r,className:s})=>{const i=ni(),a=yr();if(!a)throw new Error("The CreateView component must be used within a ResourceContextProvider");const c=fs()(a,2),p=ps()({resource:a,type:"list"}),f=gs();return g.jsxs(g.Fragment,{children:[!t&&g.jsxs(ms,{children:[f&&g.jsx(yn,{children:g.jsx(Be,{to:"/",children:g.jsx(Dn,{i18nKey:"ra.page.dashboard",children:"Home"})})}),g.jsx(yn,{children:g.jsx(Be,{to:p,children:c})}),g.jsx(hs,{children:g.jsx(Dn,{i18nKey:"ra.action.create",children:"Create"})})]}),g.jsxs("div",{className:bs("flex justify-between items-start flex-wrap gap-2 my-2",s),children:[g.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:n!==void 0?n:i.defaultTitle}),e]}),g.jsx("div",{className:"my-2",children:r})]})},"CreateView"),hi=o(e=>{const{children:t=bi,reference:n,sort:r,filter:s=xi}=e;if(v.Children.count(t)!==1)throw new Error("<ReferenceArrayInput> only accepts a single child (like <AutocompleteArrayInput>)");const i=ii({...e,sort:r,filter:s});return g.jsx(xs,{value:n,children:g.jsx(vs,{value:i,children:t})})},"ReferenceArrayInput"),bi=g.jsx(Tr,{}),xi={},vi=o(e=>{const{label:t,source:n,className:r,resource:s,validate:i,format:a,parse:l=yi,onFocus:c,...d}=e,p=yr({resource:s}),{id:f,field:u,isRequired:m}=fr(e),h=o(S=>{const I=S.target.value,P=l(I);b(I),u.onChange(P??0)},"handleChange"),[x,b]=v.useState(u.value?.toString()??""),D=v.useRef(!1),C=o(S=>{c?.(S),D.current=!0},"handleFocus"),E=o(S=>{u.onBlur?.(S),D.current=!1,b(u.value?.toString()??"")},"handleBlur");return v.useEffect(()=>{D.current||b(u.value?.toString()??"")},[u.value]),g.jsxs(pr,{id:f,className:r,name:u.name,children:[t!==!1&&g.jsx(gr,{children:g.jsx(mr,{label:t,source:n,resource:p,isRequired:m})}),g.jsx(hr,{children:g.jsx(ys,{...d,...u,type:"number",value:x,onChange:h,onFocus:C,onBlur:E})}),g.jsx(xr,{helperText:e.helperText}),g.jsx(vr,{})]})},"NumberInput"),yi=o(e=>{if(e==null||e==="")return null;const t=parseFloat(e);return isNaN(t)?0:t},"convertStringToNumber");function U(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}o(U,"formatProdErrorMessage");var Di=typeof Symbol=="function"&&Symbol.observable||"@@observable",Sn=Di,In=o(()=>Math.random().toString(36).substring(7).split("").join("."),"randomString"),Ci={INIT:`@@redux/INIT${In()}`,REPLACE:`@@redux/REPLACE${In()}`},wn=Ci;function Si(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}o(Si,"isPlainObject");function Br(e,t,n){if(typeof e!="function")throw new Error(U(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(U(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(U(1));return n(Br)(e,t)}let r=e,s=t,i=new Map,a=i,l=0,c=!1;function d(){a===i&&(a=new Map,i.forEach((b,D)=>{a.set(D,b)}))}o(d,"ensureCanMutateNextListeners");function p(){if(c)throw new Error(U(3));return s}o(p,"getState");function f(b){if(typeof b!="function")throw new Error(U(4));if(c)throw new Error(U(5));let D=!0;d();const C=l++;return a.set(C,b),o(function(){if(D){if(c)throw new Error(U(6));D=!1,d(),a.delete(C),i=null}},"unsubscribe")}o(f,"subscribe");function u(b){if(!Si(b))throw new Error(U(7));if(typeof b.type>"u")throw new Error(U(8));if(typeof b.type!="string")throw new Error(U(17));if(c)throw new Error(U(9));try{c=!0,s=r(s,b)}finally{c=!1}return(i=a).forEach(C=>{C()}),b}o(u,"dispatch");function m(b){if(typeof b!="function")throw new Error(U(10));r=b,u({type:wn.REPLACE})}o(m,"replaceReducer");function h(){const b=f;return{subscribe(D){if(typeof D!="object"||D===null)throw new Error(U(11));function C(){const S=D;S.next&&S.next(p())}return o(C,"observeState"),C(),{unsubscribe:b(C)}},[Sn](){return this}}}return o(h,"observable"),u({type:wn.INIT}),{dispatch:u,subscribe:f,getState:p,replaceReducer:m,[Sn]:h}}o(Br,"createStore$1");function En(e,t){return function(...n){return t(e.apply(this,n))}}o(En,"bindActionCreator");function Pn(e,t){if(typeof e=="function")return En(e,t);if(typeof e!="object"||e===null)throw new Error(U(16));const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=En(s,t))}return n}o(Pn,"bindActionCreators$1");function Lr(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}o(Lr,"compose");function Ii(...e){return t=>(n,r)=>{const s=t(n,r);let i=o(()=>{throw new Error(U(15))},"dispatch");const a={getState:s.getState,dispatch:o((c,...d)=>i(c,...d),"dispatch")},l=e.map(c=>c(a));return i=Lr(...l)(s.dispatch),{...s,dispatch:i}}}o(Ii,"applyMiddleware");var xt={exports:{}},vt={};var Nn;function wi(){if(Nn)return vt;Nn=1;var e=Ds();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}o(t,"is");var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return vt.useSyncExternalStoreWithSelector=function(c,d,p,f,u){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=a(function(){function b(I){if(!D){if(D=!0,C=I,I=f(I),u!==void 0&&h.hasValue){var P=h.value;if(u(P,I))return E=P}return E=I}if(P=E,n(C,I))return P;var O=f(I);return u!==void 0&&u(P,O)?(C=I,P):(C=I,E=O)}o(b,"memoizedSelector");var D=!1,C,E,S=p===void 0?null:p;return[function(){return b(d())},S===null?void 0:function(){return b(S())}]},[d,p,f,u]);var x=r(c,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=x},[x]),l(x),x},vt}o(wi,"requireUseSyncExternalStoreWithSelector_production");var An;function Ei(){return An||(An=1,xt.exports=wi()),xt.exports}o(Ei,"requireWithSelector");Ei();var Pi=v.version.startsWith("19"),Ni=Symbol.for(Pi?"react.transitional.element":"react.element"),Ai=Symbol.for("react.portal"),Ri=Symbol.for("react.fragment"),Oi=Symbol.for("react.strict_mode"),Ti=Symbol.for("react.profiler"),Bi=Symbol.for("react.consumer"),Li=Symbol.for("react.context"),jr=Symbol.for("react.forward_ref"),ji=Symbol.for("react.suspense"),Mi=Symbol.for("react.suspense_list"),qt=Symbol.for("react.memo"),Fi=Symbol.for("react.lazy"),_i=jr,Gi=qt;function ki(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case Ni:switch(e=e.type,e){case Ri:case Ti:case Oi:case ji:case Mi:return e;default:switch(e=e&&e.$$typeof,e){case Li:case jr:case Fi:case qt:return e;case Bi:return e;default:return t}}case Ai:return t}}}o(ki,"typeOf");function $i(e){return ki(e)===qt}o($i,"isMemo");function Wi(e,t,n,r,{areStatesEqual:s,areOwnPropsEqual:i,areStatePropsEqual:a}){let l=!1,c,d,p,f,u;function m(C,E){return c=C,d=E,p=e(c,d),f=t(r,d),u=n(p,f,d),l=!0,u}o(m,"handleFirstCall");function h(){return p=e(c,d),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(h,"handleNewPropsAndNewState");function x(){return e.dependsOnOwnProps&&(p=e(c,d)),t.dependsOnOwnProps&&(f=t(r,d)),u=n(p,f,d),u}o(x,"handleNewProps");function b(){const C=e(c,d),E=!a(C,p);return p=C,E&&(u=n(p,f,d)),u}o(b,"handleNewState");function D(C,E){const S=!i(E,d),I=!s(C,c,E,d);return c=C,d=E,S&&I?h():S?x():I?b():u}return o(D,"handleSubsequentCalls"),o(function(E,S){return l?D(E,S):m(E,S)},"pureFinalPropsSelector")}o(Wi,"pureFinalPropsSelectorFactory");function Vi(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...s}){const i=t(e,s),a=n(e,s),l=r(e,s);return Wi(i,a,l,e,s)}o(Vi,"finalPropsSelectorFactory");function Ui(e,t){const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=(...i)=>t(s(...i)))}return n}o(Ui,"bindActionCreators");function Ot(e){return o(function(n){const r=e(n);function s(){return r}return o(s,"constantSelector"),s.dependsOnOwnProps=!1,s},"initConstantSelector")}o(Ot,"wrapMapToPropsConstant");function Rn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}o(Rn,"getDependsOnOwnProps");function Mr(e,t){return o(function(r,{displayName:s}){const i=o(function(l,c){return i.dependsOnOwnProps?i.mapToProps(l,c):i.mapToProps(l,void 0)},"mapToPropsProxy");return i.dependsOnOwnProps=!0,i.mapToProps=o(function(l,c){i.mapToProps=e,i.dependsOnOwnProps=Rn(e);let d=i(l,c);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Rn(d),d=i(l,c)),d},"detectFactoryAndVerify"),i},"initProxySelector")}o(Mr,"wrapMapToPropsFunc");function zt(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}o(zt,"createInvalidArgFactory");function Hi(e){return e&&typeof e=="object"?Ot(t=>Ui(e,t)):e?typeof e=="function"?Mr(e):zt(e,"mapDispatchToProps"):Ot(t=>({dispatch:t}))}o(Hi,"mapDispatchToPropsFactory");function qi(e){return e?typeof e=="function"?Mr(e):zt(e,"mapStateToProps"):Ot(()=>({}))}o(qi,"mapStateToPropsFactory");function zi(e,t,n){return{...n,...e,...t}}o(zi,"defaultMergeProps");function Yi(e){return o(function(n,{displayName:r,areMergedPropsEqual:s}){let i=!1,a;return o(function(c,d,p){const f=e(c,d,p);return i?s(f,a)||(a=f):(i=!0,a=f),a},"mergePropsProxy")},"initMergePropsProxy")}o(Yi,"wrapMergePropsFunc");function Ki(e){return e?typeof e=="function"?Yi(e):zt(e,"mergeProps"):()=>zi}o(Ki,"mergePropsFactory");function Ji(e){e()}o(Ji,"defaultNoopBatch");function Xi(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Ji(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,o(function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)},"unsubscribe")}}}o(Xi,"createListenerCollection");var On={notify(){},get:o(()=>[],"get")};function Fr(e,t){let n,r=On,s=0,i=!1;function a(x){p();const b=r.subscribe(x);let D=!1;return()=>{D||(D=!0,b(),f())}}o(a,"addNestedSub");function l(){r.notify()}o(l,"notifyNestedSubs");function c(){h.onStateChange&&h.onStateChange()}o(c,"handleChangeWrapper");function d(){return i}o(d,"isSubscribed");function p(){s++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=Xi())}o(p,"trySubscribe");function f(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=On)}o(f,"tryUnsubscribe");function u(){i||(i=!0,p())}o(u,"trySubscribeSelf");function m(){i&&(i=!1,f())}o(m,"tryUnsubscribeSelf");const h={addNestedSub:a,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:u,tryUnsubscribe:m,getListeners:o(()=>r,"getListeners")};return h}o(Fr,"createSubscription");var Qi=o(()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u","canUseDOM"),Zi=Qi(),ea=o(()=>typeof navigator<"u"&&navigator.product==="ReactNative","isRunningInReactNative"),ta=ea(),na=o(()=>Zi||ta?v.useLayoutEffect:v.useEffect,"getUseIsomorphicLayoutEffect"),Qe=na();function Tn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}o(Tn,"is");function yt(e,t){if(Tn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Tn(e[n[s]],t[n[s]]))return!1;return!0}o(yt,"shallowEqual");var ra={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},oa={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},sa={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ia={[_i]:sa,[Gi]:_r};function Bn(e){return $i(e)?_r:ia[e.$$typeof]||ra}o(Bn,"getStatics");var aa=Object.defineProperty,la=Object.getOwnPropertyNames,Ln=Object.getOwnPropertySymbols,ca=Object.getOwnPropertyDescriptor,da=Object.getPrototypeOf,jn=Object.prototype;function Tt(e,t){if(typeof t!="string"){if(jn){const i=da(t);i&&i!==jn&&Tt(e,i)}let n=la(t);Ln&&(n=n.concat(Ln(t)));const r=Bn(e),s=Bn(t);for(let i=0;i<n.length;++i){const a=n[i];if(!oa[a]&&!(s&&s[a])&&!(r&&r[a])){const l=ca(t,a);try{aa(e,a,l)}catch{}}}}return e}o(Tt,"hoistNonReactStatics");var ua=Symbol.for("react-redux-context"),fa=typeof globalThis<"u"?globalThis:{};function pa(){if(!v.createContext)return{};const e=fa[ua]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}o(pa,"getContext");var Gr=pa(),ga=[null,null];function ma(e,t,n){Qe(()=>e(...t),n)}o(ma,"useIsomorphicLayoutEffectWithArgs");function ha(e,t,n,r,s,i){e.current=r,n.current=!1,s.current&&(s.current=null,i())}o(ha,"captureWrapperProps");function ba(e,t,n,r,s,i,a,l,c,d,p){if(!e)return()=>{};let f=!1,u=null;const m=o(()=>{if(f||!l.current)return;const x=t.getState();let b,D;try{b=r(x,s.current)}catch(C){D=C,u=C}D||(u=null),b===i.current?a.current||d():(i.current=b,c.current=b,a.current=!0,p())},"checkForUpdates");return n.onStateChange=m,n.trySubscribe(),m(),o(()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u},"unsubscribeWrapper")}o(ba,"subscribeUpdates");function xa(e,t){return e===t}o(xa,"strictEqual");function va(e,t,n,{pure:r,areStatesEqual:s=xa,areOwnPropsEqual:i=yt,areStatePropsEqual:a=yt,areMergedPropsEqual:l=yt,forwardRef:c=!1,context:d=Gr}={}){const p=d,f=qi(e),u=Hi(t),m=Ki(n),h=!!e;return o(b=>{const D=b.displayName||b.name||"Component",C=`Connect(${D})`,E={shouldHandleStateChanges:h,displayName:C,wrappedComponentName:D,WrappedComponent:b,initMapStateToProps:f,initMapDispatchToProps:u,initMergeProps:m,areStatesEqual:s,areStatePropsEqual:a,areOwnPropsEqual:i,areMergedPropsEqual:l};function S(O){const[T,k,N]=v.useMemo(()=>{const{reactReduxForwardedRef:H,...we}=O;return[O.context,H,we]},[O]),A=v.useMemo(()=>{let H=p;return T?.Consumer,H},[T,p]),$=v.useContext(A),K=!!O.store&&!!O.store.getState&&!!O.store.dispatch,L=!!$&&!!$.store,_=K?O.store:$.store,se=L?$.getServerState:_.getState,ye=v.useMemo(()=>Vi(_.dispatch,E),[_]),[W,ee]=v.useMemo(()=>{if(!h)return ga;const H=Fr(_,K?void 0:$.subscription),we=H.notifyNestedSubs.bind(H);return[H,we]},[_,K,$]),de=v.useMemo(()=>K?$:{...$,subscription:W},[K,$,W]),te=v.useRef(void 0),De=v.useRef(N),ie=v.useRef(void 0),Ue=v.useRef(!1),Ce=v.useRef(!1),Se=v.useRef(void 0);Qe(()=>(Ce.current=!0,()=>{Ce.current=!1}),[]);const He=v.useMemo(()=>o(()=>ie.current&&N===De.current?ie.current:ye(_.getState(),N),"selector"),[_,N]),qe=v.useMemo(()=>o(we=>W?ba(h,_,W,ye,De,te,Ue,Ce,ie,ee,we):()=>{},"subscribe"),[W]);ma(ha,[De,te,Ue,N,ie,ee]);let ue;try{ue=v.useSyncExternalStore(qe,He,se?()=>ye(se(),N):He)}catch(H){throw Se.current&&(H.message+=`
2
2
  The error may be correlated with this previous error:
3
3
  ${Se.current.stack}
4
4
 
@@ -56,4 +56,4 @@ ${Se.current.stack}
56
56
  -ms-user-select: none;
57
57
  overflow-anchor: none;
58
58
  `}}];return{always:Pe(a,"always"),resting:Pe(a,"resting"),dragging:Pe(a,"dragging"),dropAnimating:Pe(a,"dropAnimating"),userCancel:Pe(a,"userCancel")}},"getStyles$1");const Y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect,Et=o(()=>{const e=document.querySelector("head");return e||y(),e},"getHead"),Zn=o(e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},"createStyleEl");function Qc(e,t){const n=R(()=>Xc(e),[e]),r=v.useRef(null),s=v.useRef(null),i=w(M(f=>{const u=s.current;u||y(),u.textContent=f}),[]),a=w(f=>{const u=r.current;u||y(),u.textContent=f},[]);Y(()=>{!r.current&&!s.current||y();const f=Zn(t),u=Zn(t);return r.current=f,s.current=u,f.setAttribute(`${ge}-always`,e),u.setAttribute(`${ge}-dynamic`,e),Et().appendChild(f),Et().appendChild(u),a(n.always),i(n.resting),()=>{const m=o(h=>{const x=h.current;x||y(),Et().removeChild(x),h.current=null},"remove");m(r),m(s)}},[t,a,i,n.always,n.resting,e]);const l=w(()=>i(n.dragging),[i,n.dragging]),c=w(f=>{if(f==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),d=w(()=>{s.current&&i(n.resting)},[i,n.resting]);return R(()=>({dragging:l,dropping:c,resting:d}),[l,c,d])}o(Qc,"useStyleMarshal");function Po(e,t){return Array.from(e.querySelectorAll(t))}o(Po,"querySelectorAll");var No=o(e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window,"getWindowFromEl");function mt(e){return e instanceof No(e).HTMLElement}o(mt,"isHtmlElement");function Zc(e,t){const n=`[${me.contextId}="${e}"]`,r=Po(document,n);if(!r.length)return null;const s=r.find(i=>i.getAttribute(me.draggableId)===t);return!s||!mt(s)?null:s}o(Zc,"findDragHandle");function ed(e){const t=v.useRef({}),n=v.useRef(null),r=v.useRef(null),s=v.useRef(!1),i=w(o(function(u,m){const h={id:u,focus:m};return t.current[u]=h,o(function(){const b=t.current;b[u]!==h&&delete b[u]},"unregister")},"register2"),[]),a=w(o(function(u){const m=Zc(e,u);m&&m!==document.activeElement&&m.focus()},"tryGiveFocus2"),[e]),l=w(o(function(u,m){n.current===u&&(n.current=m)},"tryShiftRecord2"),[]),c=w(o(function(){r.current||s.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const u=n.current;u&&a(u)}))},"tryRestoreFocusRecorded2"),[a]),d=w(o(function(u){n.current=null;const m=document.activeElement;m&&m.getAttribute(me.draggableId)===u&&(n.current=u)},"tryRecordFocus2"),[]);return Y(()=>(s.current=!0,o(function(){s.current=!1;const u=r.current;u&&cancelAnimationFrame(u)},"clearFrameOnUnmount")),[]),R(()=>({register:i,tryRecordFocus:d,tryRestoreFocusRecorded:c,tryShiftRecord:l}),[i,d,c,l])}o(ed,"useFocusMarshal");function td(){const e={draggables:{},droppables:{}},t=[];function n(f){return t.push(f),o(function(){const m=t.indexOf(f);m!==-1&&t.splice(m,1)},"unsubscribe")}o(n,"subscribe");function r(f){t.length&&t.forEach(u=>u(f))}o(r,"notify");function s(f){return e.draggables[f]||null}o(s,"findDraggableById");function i(f){const u=s(f);return u||y(),u}o(i,"getDraggableById");const a={register:o(f=>{e.draggables[f.descriptor.id]=f,r({type:"ADDITION",value:f})},"register"),update:o((f,u)=>{const m=e.draggables[u.descriptor.id];m&&m.uniqueId===f.uniqueId&&(delete e.draggables[u.descriptor.id],e.draggables[f.descriptor.id]=f)},"update"),unregister:o(f=>{const u=f.descriptor.id,m=s(u);m&&f.uniqueId===m.uniqueId&&(delete e.draggables[u],e.droppables[f.descriptor.droppableId]&&r({type:"REMOVAL",value:f}))},"unregister"),getById:i,findById:s,exists:o(f=>!!s(f),"exists"),getAllByType:o(f=>Object.values(e.draggables).filter(u=>u.descriptor.type===f),"getAllByType")};function l(f){return e.droppables[f]||null}o(l,"findDroppableById");function c(f){const u=l(f);return u||y(),u}o(c,"getDroppableById");const d={register:o(f=>{e.droppables[f.descriptor.id]=f},"register"),unregister:o(f=>{const u=l(f.descriptor.id);u&&f.uniqueId===u.uniqueId&&delete e.droppables[f.descriptor.id]},"unregister"),getById:c,findById:l,exists:o(f=>!!l(f),"exists"),getAllByType:o(f=>Object.values(e.droppables).filter(u=>u.descriptor.type===f),"getAllByType")};function p(){e.draggables={},e.droppables={},t.length=0}return o(p,"clean2"),{draggable:a,droppable:d,subscribe:n,clean:p}}o(td,"createRegistry");function nd(){const e=R(td,[]);return v.useEffect(()=>o(function(){e.clean()},"unmount"),[e]),e}o(nd,"useRegistry");var un=j.createContext(null),ot=o(()=>{const e=document.body;return e||y(),e},"getBodyElement");const rd={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},od=o(e=>`rfd-announcement-${e}`,"getId");function sd(e){const t=R(()=>od(e),[e]),n=v.useRef(null);return v.useEffect(o(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),tt(i.style,rd),ot().appendChild(i),o(function(){setTimeout(o(function(){const c=ot();c.contains(i)&&c.removeChild(i),i===n.current&&(n.current=null)},"remove"))},"cleanup")},"setup"),[t]),w(s=>{const i=n.current;if(i){i.textContent=s;return}},[])}o(sd,"useAnnouncer");const id={separator:"::"};function fn(e,t=id){const n=j.useId();return R(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}o(fn,"useUniqueId");function ad({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}o(ad,"getElementId");function ld({contextId:e,text:t}){const n=fn("hidden-text",{separator:"-"}),r=R(()=>ad({contextId:e,uniqueId:n}),[n,e]);return v.useEffect(o(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",ot().appendChild(i),o(function(){const l=ot();l.contains(i)&&l.removeChild(i)},"unmount")},"mount"),[r,t]),r}o(ld,"useHiddenTextElement");var ht=j.createContext(null);function Ao(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),t}o(Ao,"usePrevious");function cd(){let e=null;function t(){return!!e}o(t,"isClaimed");function n(a){return a===e}o(n,"isActive2");function r(a){e&&y();const l={abandon:a};return e=l,l}o(r,"claim");function s(){e||y(),e=null}o(s,"release");function i(){e&&(e.abandon(),s())}return o(i,"tryAbandon"),{isClaimed:t,isActive:n,claim:r,release:s,tryAbandon:i}}o(cd,"create");function ke(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}o(ke,"isDragging");const dd=9,ud=13,pn=27,Ro=32,fd=33,pd=34,gd=35,md=36,hd=37,bd=38,xd=39,vd=40,yd={[ud]:!0,[dd]:!0};var Oo=o(e=>{yd[e.keyCode]&&e.preventDefault()},"preventStandardKeyEvents");const bt=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),To=0,er=5;function Dd(e,t){return Math.abs(t.x-e.x)>=er||Math.abs(t.y-e.y)>=er}o(Dd,"isSloppyClickThresholdExceeded");const tr={type:"IDLE"};function Cd({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o(s=>{const{button:i,clientX:a,clientY:l}=s;if(i!==To)return;const c={x:a,y:l},d=n();if(d.type==="DRAGGING"){s.preventDefault(),d.actions.move(c);return}d.type!=="PENDING"&&y();const p=d.point;if(!Dd(p,c))return;s.preventDefault();const f=d.actions.fluidLift(c);r({type:"DRAGGING",actions:f})},"fn")},{eventName:"mouseup",fn:o(s=>{const i=n();if(i.type!=="DRAGGING"){e();return}s.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()},"fn")},{eventName:"mousedown",fn:o(s=>{n().type==="DRAGGING"&&s.preventDefault(),e()},"fn")},{eventName:"keydown",fn:o(s=>{if(n().type==="PENDING"){e();return}if(s.keyCode===pn){s.preventDefault(),e();return}Oo(s)},"fn")},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:o(()=>{n().type==="PENDING"&&e()},"fn")},{eventName:"webkitmouseforcedown",fn:o(s=>{const i=n();if(i.type==="IDLE"&&y(),i.actions.shouldRespectForcePress()){e();return}s.preventDefault()},"fn")},{eventName:bt,fn:e}]}o(Cd,"getCaptureBindings");function Sd(e){const t=v.useRef(tr),n=v.useRef(ne),r=R(()=>({eventName:"mousedown",fn:o(function(f){if(f.defaultPrevented||f.button!==To||f.ctrlKey||f.metaKey||f.shiftKey||f.altKey)return;const u=e.findClosestDraggableId(f);if(!u)return;const m=e.tryGetLock(u,a,{sourceEvent:f});if(!m)return;f.preventDefault();const h={x:f.clientX,y:f.clientY};n.current(),d(m,h)},"onMouseDown")}),[e]),s=R(()=>({eventName:"webkitmouseforcewillbegin",fn:o(p=>{if(p.defaultPrevented)return;const f=e.findClosestDraggableId(p);if(!f)return;const u=e.findOptionsForDraggable(f);u&&(u.shouldRespectForcePress||e.canGetLock(f)&&p.preventDefault())},"fn")}),[e]),i=w(o(function(){const f={passive:!1,capture:!0};n.current=X(window,[s,r],f)},"listenForCapture2"),[s,r]),a=w(()=>{t.current.type!=="IDLE"&&(t.current=tr,n.current(),i())},[i]),l=w(()=>{const p=t.current;a(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[a]),c=w(o(function(){const f={capture:!0,passive:!1},u=Cd({cancel:l,completed:a,getPhase:o(()=>t.current,"getPhase"),setPhase:o(m=>{t.current=m},"setPhase")});n.current=X(window,u,f)},"bindCapturingEvents2"),[l,a]),d=w(o(function(f,u){t.current.type!=="IDLE"&&y(),t.current={type:"PENDING",point:u,actions:f},c()},"startPendingDrag2"),[c]);Y(o(function(){return i(),o(function(){n.current()},"unmount")},"mount"),[i])}o(Sd,"useMouseSensor");function Id(){}o(Id,"noop$1");const wd={[pd]:!0,[fd]:!0,[md]:!0,[gd]:!0};function Ed(e,t){function n(){t(),e.cancel()}o(n,"cancel");function r(){t(),e.drop()}return o(r,"drop2"),[{eventName:"keydown",fn:o(s=>{if(s.keyCode===pn){s.preventDefault(),n();return}if(s.keyCode===Ro){s.preventDefault(),r();return}if(s.keyCode===vd){s.preventDefault(),e.moveDown();return}if(s.keyCode===bd){s.preventDefault(),e.moveUp();return}if(s.keyCode===xd){s.preventDefault(),e.moveRight();return}if(s.keyCode===hd){s.preventDefault(),e.moveLeft();return}if(wd[s.keyCode]){s.preventDefault();return}Oo(s)},"fn")},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:bt,fn:n}]}o(Ed,"getDraggingBindings");function Pd(e){const t=v.useRef(Id),n=R(()=>({eventName:"keydown",fn:o(function(i){if(i.defaultPrevented||i.keyCode!==Ro)return;const a=e.findClosestDraggableId(i);if(!a)return;const l=e.tryGetLock(a,p,{sourceEvent:i});if(!l)return;i.preventDefault();let c=!0;const d=l.snapLift();t.current();function p(){c||y(),c=!1,t.current(),r()}o(p,"stop"),t.current=X(window,Ed(d,p),{capture:!0,passive:!1})},"onKeyDown")}),[e]),r=w(o(function(){const i={passive:!1,capture:!0};t.current=X(window,[n],i)},"tryStartCapture"),[n]);Y(o(function(){return r(),o(function(){t.current()},"unmount")},"mount"),[r])}o(Pd,"useKeyboardSensor");const Pt={type:"IDLE"},Nd=120,Ad=.15;function Rd({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:o(n=>{n.preventDefault()},"fn")},{eventName:"keydown",fn:o(n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===pn&&n.preventDefault(),e()},"fn")},{eventName:bt,fn:e}]}o(Rd,"getWindowBindings");function Od({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:o(r=>{const s=n();if(s.type!=="DRAGGING"){e();return}s.hasMoved=!0;const{clientX:i,clientY:a}=r.touches[0],l={x:i,y:a};r.preventDefault(),s.actions.move(l)},"fn")},{eventName:"touchend",fn:o(r=>{const s=n();if(s.type!=="DRAGGING"){e();return}r.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),t()},"fn")},{eventName:"touchcancel",fn:o(r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()},"fn")},{eventName:"touchforcechange",fn:o(r=>{const s=n();s.type==="IDLE"&&y();const i=r.touches[0];if(!i||!(i.force>=Ad))return;const l=s.actions.shouldRespectForcePress();if(s.type==="PENDING"){l&&e();return}if(l){if(s.hasMoved){r.preventDefault();return}e();return}r.preventDefault()},"fn")},{eventName:bt,fn:e}]}o(Od,"getHandleBindings");function Td(e){const t=v.useRef(Pt),n=v.useRef(ne),r=w(o(function(){return t.current},"getPhase2"),[]),s=w(o(function(m){t.current=m},"setPhase2"),[]),i=R(()=>({eventName:"touchstart",fn:o(function(m){if(m.defaultPrevented)return;const h=e.findClosestDraggableId(m);if(!h)return;const x=e.tryGetLock(h,l,{sourceEvent:m});if(!x)return;const b=m.touches[0],{clientX:D,clientY:C}=b,E={x:D,y:C};n.current(),f(x,E)},"onTouchStart")}),[e]),a=w(o(function(){const m={capture:!0,passive:!1};n.current=X(window,[i],m)},"listenForCapture2"),[i]),l=w(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),s(Pt),n.current(),a())},[a,s]),c=w(()=>{const u=t.current;l(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[l]),d=w(o(function(){const m={capture:!0,passive:!1},h={cancel:c,completed:l,getPhase:r},x=X(window,Od(h),m),b=X(window,Rd(h),m);n.current=o(function(){x(),b()},"unbindAll")},"bindCapturingEvents2"),[c,r,l]),p=w(o(function(){const m=r();m.type!=="PENDING"&&y();const h=m.actions.fluidLift(m.point);s({type:"DRAGGING",actions:h,hasMoved:!1})},"startDragging2"),[r,s]),f=w(o(function(m,h){r().type!=="IDLE"&&y();const x=setTimeout(p,Nd);s({type:"PENDING",point:h,actions:m,longPressTimerId:x}),d()},"startPendingDrag2"),[d,r,s,p]);Y(o(function(){return a(),o(function(){n.current();const h=r();h.type==="PENDING"&&(clearTimeout(h.longPressTimerId),s(Pt))},"unmount")},"mount"),[r,a,s]),Y(o(function(){return X(window,[{eventName:"touchmove",fn:o(()=>{},"fn"),options:{capture:!1,passive:!1}}])},"webkitHack"),[])}o(Td,"useTouchSensor");const Bd=["input","button","textarea","select","option","optgroup","video","audio"];function Bo(e,t){if(t==null)return!1;if(Bd.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:Bo(e,t.parentElement)}o(Bo,"isAnInteractiveElement");function Ld(e,t){const n=t.target;return mt(n)?Bo(e,n):!1}o(Ld,"isEventInInteractiveElement");var jd=o(e=>Z(e.getBoundingClientRect()).center,"getBorderBoxCenterPosition");function Md(e){return e instanceof No(e).Element}o(Md,"isElement");const Fd=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function Lo(e,t){return e==null?null:e[Fd](t)?e:Lo(e.parentElement,t)}o(Lo,"closestPonyfill");function _d(e,t){return e.closest?e.closest(t):Lo(e,t)}o(_d,"closest");function Gd(e){return`[${me.contextId}="${e}"]`}o(Gd,"getSelector");function kd(e,t){const n=t.target;if(!Md(n))return null;const r=Gd(e),s=_d(n,r);return!s||!mt(s)?null:s}o(kd,"findClosestDragHandleFromEvent");function $d(e,t){const n=kd(e,t);return n?n.getAttribute(me.draggableId):null}o($d,"tryGetClosestDraggableIdFromEvent");function Wd(e,t){const n=`[${_t.contextId}="${e}"]`,s=Po(document,n).find(i=>i.getAttribute(_t.id)===t);return!s||!mt(s)?null:s}o(Wd,"findDraggable");function Vd(e){e.preventDefault()}o(Vd,"preventDefault");function Ye({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}o(Ye,"isActive");function jo({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const s=n.draggable.findById(r);return!(!s||!s.options.isEnabled||!So(t.getState(),r))}o(jo,"canStart");function Ud({lockAPI:e,contextId:t,store:n,registry:r,draggableId:s,forceSensorStop:i,sourceEvent:a}){if(!jo({lockAPI:e,store:n,registry:r,draggableId:s}))return null;const c=r.draggable.getById(s),d=Wd(t,c.descriptor.id);if(!d||a&&!c.options.canDragInteractiveElements&&Ld(d,a))return null;const p=e.claim(i||ne);let f="PRE_DRAG";function u(){return c.options.shouldRespectForcePress}o(u,"getShouldRespectForcePress");function m(){return e.isActive(p)}o(m,"isLockActive");function h(I,P){Ye({expected:I,phase:f,isLockActive:m,shouldWarn:!0})&&n.dispatch(P())}o(h,"tryDispatch");const x=h.bind(null,"DRAGGING");function b(I){function P(){e.release(),f="COMPLETED"}o(P,"completed"),f!=="PRE_DRAG"&&(P(),y()),n.dispatch(_l(I.liftActionArgs)),f="DRAGGING";function O(T,k={shouldBlockNextClick:!1}){if(I.cleanup(),k.shouldBlockNextClick){const N=X(window,[{eventName:"click",fn:Vd,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(N)}P(),n.dispatch(mo({reason:T}))}return o(O,"finish2"),{isActive:o(()=>Ye({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1}),"isActive"),shouldRespectForcePress:u,drop:o(T=>O("DROP",T),"drop"),cancel:o(T=>O("CANCEL",T),"cancel"),...I.actions}}o(b,"lift2");function D(I){const P=Le(T=>{x(()=>go({client:T}))});return{...b({liftActionArgs:{id:s,clientSelection:I,movementMode:"FLUID"},cleanup:o(()=>P.cancel(),"cleanup"),actions:{move:P}}),move:P}}o(D,"fluidLift");function C(){const I={moveUp:o(()=>x(zl),"moveUp"),moveRight:o(()=>x(Kl),"moveRight"),moveDown:o(()=>x(Yl),"moveDown"),moveLeft:o(()=>x(Jl),"moveLeft")};return b({liftActionArgs:{id:s,clientSelection:jd(d),movementMode:"SNAP"},cleanup:ne,actions:I})}o(C,"snapLift");function E(){Ye({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!0})&&e.release()}return o(E,"abortPreDrag"),{isActive:o(()=>Ye({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1}),"isActive"),shouldRespectForcePress:u,fluidLift:D,snapLift:C,abort:E}}o(Ud,"tryStart");const Hd=[Sd,Pd,Td];function qd({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:s}){const i=[...s?Hd:[],...r||[]],a=v.useState(()=>cd())[0],l=w(o(function(b,D){ke(b)&&!ke(D)&&a.tryAbandon()},"tryAbandonLock2"),[a]);Y(o(function(){let b=t.getState();return t.subscribe(()=>{const C=t.getState();l(b,C),b=C})},"listenToStore"),[a,t,l]),Y(()=>a.tryAbandon,[a.tryAbandon]);const c=w(x=>jo({lockAPI:a,registry:n,store:t,draggableId:x}),[a,n,t]),d=w((x,b,D)=>Ud({lockAPI:a,registry:n,contextId:e,store:t,draggableId:x,forceSensorStop:b||null,sourceEvent:D&&D.sourceEvent?D.sourceEvent:null}),[e,a,n,t]),p=w(x=>$d(e,x),[e]),f=w(x=>{const b=n.draggable.findById(x);return b?b.options:null},[n.draggable]),u=w(o(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(rn()))},"tryReleaseLock2"),[a,t]),m=w(()=>a.isClaimed(),[a]),h=R(()=>({canGetLock:c,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:f,tryReleaseLock:u,isLockClaimed:m}),[c,d,p,f,u,m]);for(let x=0;x<i.length;x++)i[x](h)}o(qd,"useSensorMarshal");const zd=o(e=>({onBeforeCapture:o(t=>{const n=o(()=>{e.onBeforeCapture&&e.onBeforeCapture(t)},"onBeforeCapureCallback");Dr.flushSync(n)},"onBeforeCapture"),onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),"createResponders"),Yd=o(e=>({...Ge,...e.autoScrollerOptions,durationDampening:{...Ge.durationDampening,...e.autoScrollerOptions}}),"createAutoScrollerOptions");function Ne(e){return e.current||y(),e.current}o(Ne,"getStore");function Kd(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:s,dragHandleUsageInstructions:i}=e,a=v.useRef(null),l=Ao(e),c=w(()=>zd(l.current),[l]),d=w(()=>Yd(l.current),[l]),p=sd(t),f=ld({contextId:t,text:i}),u=Qc(t,s),m=w(N=>{Ne(a).dispatch(N)},[]),h=R(()=>Pn({publishWhileDragging:kl,updateDroppableScroll:Wl,updateDroppableIsEnabled:Vl,updateDroppableIsCombineEnabled:Ul,collectionStarting:$l},m),[m]),x=nd(),b=R(()=>Rc(x,h),[x,h]),D=R(()=>zc({scrollWindow:Oc,scrollDroppable:b.scrollDroppable,getAutoScrollerOptions:d,...Pn({move:go},m)}),[b.scrollDroppable,m,d]),C=ed(t),E=R(()=>Ec({announce:p,autoScroller:D,dimensionMarshal:b,focusMarshal:C,getResponders:c,styleMarshal:u}),[p,D,b,C,c,u]);a.current=E;const S=w(()=>{const N=Ne(a);N.getState().phase!=="IDLE"&&N.dispatch(rn())},[]),I=w(()=>{const N=Ne(a).getState();return N.phase==="DROP_ANIMATING"?!0:N.phase==="IDLE"?!1:N.isDragging},[]),P=R(()=>({isDragging:I,tryAbort:S}),[I,S]);n(P);const O=w(N=>So(Ne(a).getState(),N),[]),T=w(()=>le(Ne(a).getState()),[]),k=R(()=>({marshal:b,focus:C,contextId:t,canLift:O,isMovementAllowed:T,dragHandleUsageInstructionsId:f,registry:x}),[t,b,f,C,O,T,x]);return qd({contextId:t,store:E,registry:x,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),v.useEffect(()=>S,[S]),j.createElement(ht.Provider,{value:k},j.createElement(Da,{context:un,store:E},e.children))}o(Kd,"App");function Jd(){return j.useId()}o(Jd,"useUniqueContextId");function Xd(e){const t=Jd(),n=e.dragHandleUsageInstructions||Xe.dragHandleUsageInstructions;return j.createElement(Bt,null,r=>j.createElement(Kd,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}o(Xd,"DragDropContext");const nr={dragging:5e3,dropAnimating:4500},Qd=o((e,t)=>t?Te.drop(t.duration):e?Te.snap:Te.fluid,"getDraggingTransition"),Zd=o((e,t)=>{if(e)return t?_e.opacity.drop:_e.opacity.combining},"getDraggingOpacity"),eu=o(e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP","getShouldDraggingAnimate");function tu(e){const n=e.dimension.client,{offset:r,combineWith:s,dropping:i}=e,a=!!s,l=eu(e),c=!!i,d=c?Mt.drop(r,a):Mt.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Qd(l,i),transform:d,opacity:Zd(a,c),zIndex:c?nr.dropAnimating:nr.dragging,pointerEvents:"none"}}o(tu,"getDraggingStyle");function nu(e){return{transform:Mt.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}o(nu,"getSecondaryStyle");function ru(e){return e.type==="DRAGGING"?tu(e):nu(e)}o(ru,"getStyle$1");function ou(e,t,n=F){const r=window.getComputedStyle(t),s=t.getBoundingClientRect(),i=$r(s,r),a=et(i,n),l={client:i,tagName:t.tagName.toLowerCase(),display:r.display},c={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:l,displaceBy:c,client:i,page:a}}o(ou,"getDimension$1");function su(e){const t=fn("draggable"),{descriptor:n,registry:r,getDraggableRef:s,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:l}=e,c=R(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:l}),[i,l,a]),d=w(m=>{const h=s();return h||y(),ou(n,h,m)},[n,s]),p=R(()=>({uniqueId:t,descriptor:n,options:c,getDimension:d}),[n,d,c,t]),f=v.useRef(p),u=v.useRef(!0);Y(()=>(r.draggable.register(f.current),()=>r.draggable.unregister(f.current)),[r.draggable]),Y(()=>{if(u.current){u.current=!1;return}const m=f.current;f.current=p,r.draggable.update(p,m)},[p,r.draggable])}o(su,"useDraggablePublisher");var gn=j.createContext(null);function st(e){const t=v.useContext(e);return t||y(),t}o(st,"useRequiredContext");function iu(e){e.preventDefault()}o(iu,"preventHtml5Dnd");const au=o(e=>{const t=v.useRef(null),n=w((P=null)=>{t.current=P},[]),r=w(()=>t.current,[]),{contextId:s,dragHandleUsageInstructionsId:i,registry:a}=st(ht),{type:l,droppableId:c}=st(gn),d=R(()=>({id:e.draggableId,index:e.index,type:l,droppableId:c}),[e.draggableId,e.index,l,c]),{children:p,draggableId:f,isEnabled:u,shouldRespectForcePress:m,canDragInteractiveElements:h,isClone:x,mapped:b,dropAnimationFinished:D}=e;if(!x){const P=R(()=>({descriptor:d,registry:a,getDraggableRef:r,canDragInteractiveElements:h,shouldRespectForcePress:m,isEnabled:u}),[d,a,r,h,m,u]);su(P)}const C=R(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":f,"data-rfd-drag-handle-context-id":s,draggable:!1,onDragStart:iu}:null,[s,i,f,u]),E=w(P=>{b.type==="DRAGGING"&&b.dropping&&P.propertyName==="transform"&&Dr.flushSync(D)},[D,b]),S=R(()=>{const P=ru(b),O=b.type==="DRAGGING"&&b.dropping?E:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":s,"data-rfd-draggable-id":f,style:P,onTransitionEnd:O},dragHandleProps:C}},[s,C,f,b,E,n]),I=R(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return j.createElement(j.Fragment,null,p(S,b.snapshot,I))},"Draggable");var Mo=o((e,t)=>e===t,"isStrictEqual"),Fo=o(e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null},"whatIsDraggedOverFromResult");const lu=o(e=>e.combine?e.combine.draggableId:null,"getCombineWithFromResult"),cu=o(e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null,"getCombineWithFromImpact");function du(){const e=M((s,i)=>({x:s,y:i})),t=M((s,i,a=null,l=null,c=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!c,dropAnimation:c,mode:s,draggingOver:a,combineWith:l,combineTargetFor:null})),n=M((s,i,a,l,c=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:c,combineWith:d,mode:i,offset:s,dimension:a,forceShouldAnimate:p,snapshot:t(i,l,c,d,null)}}));return o((s,i)=>{if(ke(s)){if(s.critical.draggable.id!==i.draggableId)return null;const a=s.current.client.offset,l=s.dimensions.draggables[i.draggableId],c=z(s.impact),d=cu(s.impact),p=s.forceShouldAnimate;return n(e(a.x,a.y),s.movementMode,l,i.isClone,c,d,p)}if(s.phase==="DROP_ANIMATING"){const a=s.completed;if(a.result.draggableId!==i.draggableId)return null;const l=i.isClone,c=s.dimensions.draggables[i.draggableId],d=a.result,p=d.mode,f=Fo(d),u=lu(d),h={duration:s.dropDuration,curve:sn.drop,moveTo:s.newHomeClientOffset,opacity:u?_e.opacity.drop:null,scale:u?_e.scale.drop:null};return{mapped:{type:"DRAGGING",offset:s.newHomeClientOffset,dimension:c,dropping:h,draggingOver:f,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,l,f,u,h)}}}return null},"selector")}o(du,"getDraggableSelector");function _o(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}o(_o,"getSecondarySnapshot");const uu={mapped:{type:"SECONDARY",offset:F,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:_o(null)}};function fu(){const e=M((a,l)=>({x:a,y:l})),t=M(_o),n=M((a,l=null,c)=>({mapped:{type:"SECONDARY",offset:a,combineTargetFor:l,shouldAnimateDisplacement:c,snapshot:t(l)}})),r=o(a=>a?n(F,a,!0):null,"getFallback"),s=o((a,l,c,d)=>{const p=c.displaced.visible[a],f=!!(d.inVirtualList&&d.effected[a]),u=ft(c),m=u&&u.draggableId===a?l:null;if(!p){if(!f)return r(m);if(c.displaced.invisible[a])return null;const b=be(d.displacedBy.point),D=e(b.x,b.y);return n(D,m,!0)}if(f)return r(m);const h=c.displacedBy.point,x=e(h.x,h.y);return n(x,m,p.shouldAnimate)},"getProps");return o((a,l)=>{if(ke(a))return a.critical.draggable.id===l.draggableId?null:s(l.draggableId,a.critical.draggable.id,a.impact,a.afterCritical);if(a.phase==="DROP_ANIMATING"){const c=a.completed;return c.result.draggableId===l.draggableId?null:s(l.draggableId,c.result.draggableId,c.impact,c.afterCritical)}return null},"selector")}o(fu,"getSecondarySelector");const pu=o(()=>{const e=du(),t=fu();return o((r,s)=>e(r,s)||t(r,s)||uu,"selector")},"makeMapStateToProps$1"),gu={dropAnimationFinished:ho},mu=kr(pu,gu,null,{context:un,areStatePropsEqual:Mo})(au);function Go(e){return st(gn).isUsingCloneFor===e.draggableId&&!e.isClone?null:j.createElement(mu,e)}o(Go,"PrivateDraggable");function hu(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return j.createElement(Go,tt({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}o(hu,"PublicDraggable");const ko=o(e=>t=>e===t,"isEqual"),bu=ko("scroll"),xu=ko("auto"),rr=o((e,t)=>t(e.overflowX)||t(e.overflowY),"isEither"),vu=o(e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return rr(n,bu)||rr(n,xu)},"isElementScrollable"),yu=o(()=>!1,"isBodyScrollable"),$o=o(e=>e==null?null:e===document.body?yu()?e:null:e===document.documentElement?null:vu(e)?e:$o(e.parentElement),"getClosestScrollable");var Gt=o(e=>({x:e.scrollLeft,y:e.scrollTop}),"getScroll");const Wo=o(e=>e?window.getComputedStyle(e).position==="fixed"?!0:Wo(e.parentElement):!1,"getIsFixed");var Du=o(e=>{const t=$o(e),n=Wo(e);return{closestScrollable:t,isFixedOnPage:n}},"getEnv"),Cu=o(({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:s,client:i,page:a,closest:l})=>{const c=(()=>{if(!l)return null;const{scrollSize:u,client:m}=l,h=yo({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:m.paddingBox.height,width:m.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:m,scrollSize:u,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:h,diff:{value:F,displacement:F}}}})(),d=s==="vertical"?Qt:Qr,p=pe({page:a,withPlaceholder:null,axis:d,frame:c});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:a,frame:c,subject:p}},"getDroppableDimension");const Su=o((e,t)=>{const n=Wr(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,s=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,a=s+t.scrollWidth,c=Yt({top:r,right:a,bottom:i,left:s},n.border);return Kt({borderBox:c,margin:n.margin,border:n.border,padding:n.padding})},"getClient");var Iu=o(({ref:e,descriptor:t,env:n,windowScroll:r,direction:s,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:l})=>{const c=n.closestScrollable,d=Su(e,c),p=et(d,r),f=(()=>{if(!c)return null;const m=Wr(c),h={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:m,page:et(m,r),scroll:Gt(c),scrollSize:h,shouldClipSubject:l}})();return Cu({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:s,client:d,page:p,closest:f})},"getDimension");const wu={passive:!1},Eu={passive:!0};var or=o(e=>e.shouldPublishImmediately?wu:Eu,"getListenerOptions");const Ke=o(e=>e&&e.env.closestScrollable||null,"getClosestScrollableFromDrag");function Pu(e){const t=v.useRef(null),n=st(ht),r=fn("droppable"),{registry:s,marshal:i}=n,a=Ao(e),l=R(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),c=v.useRef(l),d=R(()=>M((S,I)=>{t.current||y();const P={x:S,y:I};i.updateDroppableScroll(l.id,P)}),[l.id,i]),p=w(()=>{const S=t.current;return!S||!S.env.closestScrollable?F:Gt(S.env.closestScrollable)},[]),f=w(()=>{const S=p();d(S.x,S.y)},[p,d]),u=R(()=>Le(f),[f]),m=w(()=>{const S=t.current,I=Ke(S);if(S&&I||y(),S.scrollOptions.shouldPublishImmediately){f();return}u()},[u,f]),h=w((S,I)=>{t.current&&y();const P=a.current,O=P.getDroppableRef();O||y();const T=Du(O),k={ref:O,descriptor:l,env:T,scrollOptions:I};t.current=k;const N=Iu({ref:O,descriptor:l,env:T,windowScroll:S,direction:P.direction,isDropDisabled:P.isDropDisabled,isCombineEnabled:P.isCombineEnabled,shouldClipSubject:!P.ignoreContainerClipping}),A=T.closestScrollable;return A&&(A.setAttribute(Qn.contextId,n.contextId),A.addEventListener("scroll",m,or(k.scrollOptions))),N},[n.contextId,l,m,a]),x=w(()=>{const S=t.current,I=Ke(S);return S&&I||y(),Gt(I)},[]),b=w(()=>{const S=t.current;S||y();const I=Ke(S);t.current=null,I&&(u.cancel(),I.removeAttribute(Qn.contextId),I.removeEventListener("scroll",m,or(S.scrollOptions)))},[m,u]),D=w(S=>{const I=t.current;I||y();const P=Ke(I);P||y(),P.scrollTop+=S.y,P.scrollLeft+=S.x},[]),C=R(()=>({getDimensionAndWatchScroll:h,getScrollWhileDragging:x,dragStopped:b,scroll:D}),[b,h,x,D]),E=R(()=>({uniqueId:r,descriptor:l,callbacks:C}),[C,l,r]);Y(()=>(c.current=E.descriptor,s.droppable.register(E),()=>{t.current&&b(),s.droppable.unregister(E)}),[C,l,b,E,i,s.droppable]),Y(()=>{t.current&&i.updateDroppableIsEnabled(c.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),Y(()=>{t.current&&i.updateDroppableIsCombineEnabled(c.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}o(Pu,"useDroppablePublisher");function Nt(){}o(Nt,"noop");const sr={width:0,height:0,margin:La},Nu=o(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?sr:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},"getSize"),Au=o(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Nu({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?Te.placeholder:null}},"getStyle"),Ru=o(e=>{const t=v.useRef(null),n=w(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:s,onClose:i,contextId:a}=e,[l,c]=v.useState(e.animate==="open");v.useEffect(()=>l?r!=="open"?(n(),c(!1),Nt):t.current?Nt:(t.current=setTimeout(()=>{t.current=null,c(!1)}),n):Nt,[r,l,n]);const d=w(f=>{f.propertyName==="height"&&(s(),r==="close"&&i())},[r,i,s]),p=Au({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return j.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":a,onTransitionEnd:d,ref:e.innerRef})},"Placeholder");var Ou=j.memo(Ru);const bn=class bn extends j.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}};o(bn,"AnimateInOut");let kt=bn;const Tu=o(e=>{const t=v.useContext(ht);t||y();const{contextId:n,isMovementAllowed:r}=t,s=v.useRef(null),i=v.useRef(null),{children:a,droppableId:l,type:c,mode:d,direction:p,ignoreContainerClipping:f,isDropDisabled:u,isCombineEnabled:m,snapshot:h,useClone:x,updateViewportMaxScroll:b,getContainerForClone:D}=e,C=w(()=>s.current,[]),E=w((A=null)=>{s.current=A},[]);w(()=>i.current,[]);const S=w((A=null)=>{i.current=A},[]),I=w(()=>{r()&&b({maxScroll:Co()})},[r,b]);Pu({droppableId:l,type:c,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:m,ignoreContainerClipping:f,getDroppableRef:C});const P=R(()=>j.createElement(kt,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:A,data:$,animate:K})=>j.createElement(Ou,{placeholder:$,onClose:A,innerRef:S,animate:K,contextId:n,onTransitionEnd:I})),[n,I,e.placeholder,e.shouldAnimatePlaceholder,S]),O=R(()=>({innerRef:E,placeholder:P,droppableProps:{"data-rfd-droppable-id":l,"data-rfd-droppable-context-id":n}}),[n,l,P,E]),T=x?x.dragging.draggableId:null,k=R(()=>({droppableId:l,type:c,isUsingCloneFor:T}),[l,T,c]);function N(){if(!x)return null;const{dragging:A,render:$}=x,K=j.createElement(Go,{draggableId:A.draggableId,index:A.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(L,_)=>$(L,_,A));return Cs.createPortal(K,D())}return o(N,"getClone"),j.createElement(gn.Provider,{value:k},a(O,h),N())},"Droppable");function Bu(){return document.body||y(),document.body}o(Bu,"getBody");const ir={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:Bu},Vo=o(e=>{let t={...e},n;for(n in ir)e[n]===void 0&&(t={...t,[n]:ir[n]});return t},"attachDefaultPropsToOwnProps"),At=o((e,t)=>e===t.droppable.type,"isMatchingType"),ar=o((e,t)=>t.draggables[e.draggable.id],"getDraggable"),Lu=o(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,a,l,c,d,p)=>{const f=d.descriptor.id;if(d.descriptor.droppableId===i){const h=p?{render:p,dragging:n(d.descriptor)}:null,x={isDraggingOver:l,draggingOverWith:l?f:null,draggingFromThisWith:f,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:x,useClone:h}}if(!a)return t;if(!c)return e;const m={isDraggingOver:l,draggingOverWith:f,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:m,useClone:null}});return o((i,a)=>{const l=Vo(a),c=l.droppableId,d=l.type,p=!l.isDropDisabled,f=l.renderClone;if(ke(i)){const u=i.critical;if(!At(d,u))return t;const m=ar(u,i.dimensions),h=z(i.impact)===c;return r(c,p,h,h,m,f)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!At(d,u.critical))return t;const m=ar(u.critical,i.dimensions);return r(c,p,Fo(u.result)===c,z(u.impact)===c,m,f)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!At(d,u.critical))return t;const m=z(u.impact)===c,h=!!(u.impact.at&&u.impact.at.type==="COMBINE"),x=u.critical.droppable.id===c;return m?h?e:t:x?e:t}return t},"selector")},"makeMapStateToProps"),ju={updateViewportMaxScroll:ql},Mu=kr(Lu,ju,(e,t,n)=>({...Vo(n),...e,...t}),{context:un,areStatePropsEqual:Mo})(Tu),Fu=o(({deal:e,index:t})=>e?g.jsx(hu,{draggableId:String(e.id),index:t,children:o((n,r)=>g.jsx(Uo,{provided:n,snapshot:r,deal:e}),"children")}):null,"DealCard"),Uo=o(({provided:e,snapshot:t,deal:n})=>{const r=he(),s=o(()=>{r(`/deals/${n.id}/show`,void 0,void 0,void 0,{_scrollToTop:!1})},"handleClick");return g.jsx("div",{className:"cursor-pointer",...e?.draggableProps,...e?.dragHandleProps,ref:e?.innerRef,onClick:s,children:g.jsx(Ss,{className:`py-4 transition-all duration-200 ${t?.isDragging?"opacity-90 transform rotate-1 shadow-lg":"shadow-sm hover:shadow-md"}`,children:g.jsxs(Is,{className:"px-4 flex",children:[g.jsx(Wt,{source:"company_id",record:n,reference:"companies",link:!1,children:g.jsx(Vt,{width:20,height:20})}),g.jsxs("div",{className:"ml-3",children:[g.jsx("p",{className:"text-sm font-medium mb-2",children:n.name}),g.jsxs("p",{className:"text-xs text-muted-foreground",children:[n.amount.toLocaleString("en-US",{notation:"compact",style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumSignificantDigits:3}),n.category?`, ${n.category}`:""]})]})]})})})},"DealCardContent"),lr=o(()=>{const{identity:e}=it(),{data:t,total:n,isPending:r}=$t("deals",{pagination:{page:1,perPage:1e3},sort:{field:"archived_at",order:"DESC"},filter:{"archived_at@not.is":null}}),[s,i]=v.useState(!1);if(v.useEffect(()=>{!r&&n===0&&i(!1)},[r,n]),v.useEffect(()=>{i(!1)},[t]),!e||r||!n||!t)return null;const a=t.reduce((l,c)=>{const d=new Date(c.archived_at).toDateString();return l[d]||(l[d]=[]),l[d].push(c),l},{});return g.jsxs("div",{className:"w-full flex flex-row items-center justify-center",children:[g.jsx(at,{variant:"ghost",onClick:o(()=>i(!0),"onClick"),className:"my-4",children:"View archived deals"}),g.jsx(lt,{open:s,onOpenChange:o(()=>i(!1),"onOpenChange"),children:g.jsxs(ct,{className:"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:[g.jsx(Cr,{children:"Archived Deals"}),g.jsx("div",{className:"flex flex-col gap-8",children:Object.entries(a).map(([l,c])=>g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsx("h4",{className:"font-bold",children:_u(l)}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8",children:c.map(d=>g.jsx("div",{children:g.jsx(Uo,{deal:d})},d.id))})]},l))})]})})]})},"DealArchivedList");function _u(e){const t=new Date(e);t.setHours(0,0,0,0);const n=new Date;n.setHours(0,0,0,0);const r=t.getTime()-n.getTime(),s=Math.round(r/(1e3*60*60*24));if(Math.abs(s)>7)return new Intl.DateTimeFormat(void 0,{day:"numeric",month:"long"}).format(t);const i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});return Gu(i.format(s,"day"))}o(_u,"getRelativeTimeString");function Gu(e){return e.charAt(0).toUpperCase()+e.slice(1)}o(Gu,"ucFirst");const Ho=o(()=>{const e=ws();return g.jsxs("div",{className:"flex flex-col gap-8",children:[g.jsx(ku,{}),g.jsxs("div",{className:`flex gap-6 ${e?"flex-col":"flex-row"}`,children:[g.jsx($u,{}),g.jsx(Sr,{orientation:e?"horizontal":"vertical"}),g.jsx(Wu,{})]})]})},"DealInputs"),ku=o(()=>g.jsxs("div",{className:"flex flex-col gap-4 flex-1",children:[g.jsx(Cn,{source:"name",label:"Deal name",validate:Ae(),helperText:!1}),g.jsx(Cn,{source:"description",multiline:!0,rows:3,helperText:!1})]}),"DealInfoInputs"),$u=o(()=>g.jsxs("div",{className:"flex flex-col gap-4 flex-1",children:[g.jsx("h3",{className:"text-base font-medium",children:"Linked to"}),g.jsx(Ir,{source:"company_id",reference:"companies",children:g.jsx(Es,{validate:Ae()})}),g.jsx(hi,{source:"contact_ids",reference:"contacts_summary",children:g.jsx(Tr,{label:"Contacts",optionText:Ps,helperText:!1})})]}),"DealLinkedToInputs"),Wu=o(()=>{const{dealStages:e,dealCategories:t}=$e();return g.jsxs("div",{className:"flex flex-col gap-4 flex-1",children:[g.jsx("h3",{className:"text-base font-medium",children:"Misc"}),g.jsx(Rt,{source:"category",label:"Category",choices:t.map(n=>({id:n,name:n})),helperText:!1}),g.jsx(vi,{source:"amount",defaultValue:0,helperText:!1,validate:Ae()}),g.jsx(Ns,{validate:Ae(),source:"expected_closing_date",helperText:!1,defaultValue:new Date().toISOString().split("T")[0]}),g.jsx(Rt,{source:"stage",choices:e.map(n=>({id:n.value,name:n.label})),defaultValue:"opportunity",helperText:!1,validate:Ae()})]})},"DealMiscInputs"),qo=o(({open:e})=>{const t=he(),n=Ut(),{data:r}=dt(),s=o(()=>{t("/deals")},"handleClose"),i=As(),a=o(async c=>{if(!r){t("/deals");return}const d=r.filter(u=>u.stage===c.stage&&u.id!==c.id);await Promise.all(d.map(async u=>n.update("deals",{id:u.id,data:{index:u.index+1},previousData:u})));const p=d.reduce((u,m)=>({...u,[m.id]:{...m,index:m.index+1}}),{}),f=Date.now();i.setQueriesData({queryKey:["deals","getList"]},u=>u&&{...u,data:u.data.map(m=>p[m.id]||m)},{updatedAt:f}),t("/deals")},"onSuccess"),{identity:l}=it();return g.jsx(lt,{open:e,onOpenChange:o(()=>s(),"onOpenChange"),children:g.jsx(ct,{className:"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:g.jsx(gi,{resource:"deals",mutationOptions:{onSuccess:a},children:g.jsxs(wr,{defaultValues:{sales_id:l?.id,contact_ids:[],index:0},children:[g.jsx(Ho,{}),g.jsx(Rs,{children:g.jsx(Os,{})})]})})})})},"DealCreate"),Vu=o(({open:e,id:t})=>{const n=he(),r=Ht(),s=o(()=>{n("/deals",void 0,void 0,void 0,{_scrollToTop:!1})},"handleClose");return g.jsx(lt,{open:e,onOpenChange:o(()=>s(),"onOpenChange"),children:g.jsx(ct,{className:"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:t?g.jsxs(Ts,{id:t,mutationMode:"pessimistic",mutationOptions:{onSuccess:o(()=>{r("Deal updated"),n(`/deals/${t}/show`,void 0,void 0,void 0,{_scrollToTop:!1})},"onSuccess")},children:[g.jsx(Uu,{}),g.jsxs(wr,{children:[g.jsx(Ho,{}),g.jsx(Bs,{})]})]}):null})})},"DealEdit");function Uu(){const e=Er();return e?g.jsx(Cr,{className:"pb-0",children:g.jsxs("div",{className:"flex justify-between items-start mb-8",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(Wt,{source:"company_id",reference:"companies",link:"show",children:g.jsx(Vt,{})}),g.jsxs("h2",{className:"text-2xl font-semibold",children:["Edit ",e.name," deal"]})]}),g.jsxs("div",{className:"flex gap-2 pr-12",children:[g.jsx(Pr,{}),g.jsx(at,{asChild:!0,variant:"outline",className:"h-9",children:g.jsx(Be,{to:`/deals/${e.id}/show`,children:"Back to deal"})})]})]})}):null}o(Uu,"EditHeader");const Hu=o(({children:e})=>{const t=Nr(),n=Je("/deals/create",t.pathname),r=Ls(),{data:s,isPending:i}=$t("contacts",{pagination:{page:1,perPage:1}});return i?g.jsx(js,{value:50}):g.jsxs("div",{className:"flex flex-col justify-center items-center gap-12",style:{height:`calc(100dvh - ${r}px)`},children:[g.jsx("img",{src:"./img/empty.svg",alt:"No deals found"}),s&&s.length>0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-col items-center gap-0",children:[g.jsx("h3",{className:"text-lg font-bold",children:"No deals found"}),g.jsx("p",{className:"text-sm text-center text-muted-foreground mb-4",children:"It seems your deal list is empty."})]}),g.jsx("div",{className:"flex space-x-8",children:g.jsx(Ar,{label:"Create deal"})}),g.jsx(qo,{open:!!n}),e]}):g.jsxs("div",{className:"flex flex-col items-center gap-0",children:[g.jsx("h3",{className:"text-lg font-bold",children:"No deals found"}),g.jsxs("p",{className:"text-sm text-center text-muted-foreground mb-4",children:["It seems your contact list is empty.",g.jsx("br",{}),g.jsx(Be,{to:"/contacts/create",className:"hover:underline",children:"Add your first contact"})," ","before creating a deal."]})]})]})},"DealEmpty"),qu=o(({stage:e,deals:t})=>{const n=t.reduce((s,i)=>s+i.amount,0),{dealStages:r}=$e();return g.jsxs("div",{className:"flex-1 pb-8",children:[g.jsxs("div",{className:"flex flex-col items-center",children:[g.jsx("h3",{className:"text-base font-medium",children:Rr(r,e)}),g.jsx("p",{className:"text-sm text-muted-foreground",children:n.toLocaleString("en-US",{notation:"compact",style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumSignificantDigits:3})})]}),g.jsx(Mu,{droppableId:e,children:o((s,i)=>g.jsxs("div",{ref:s.innerRef,...s.droppableProps,className:`flex flex-col rounded-2xl mt-2 gap-2 ${i.isDraggingOver?"bg-muted":""}`,children:[t.map((a,l)=>g.jsx(Fu,{deal:a,index:l},a.id)),s.placeholder]}),"children")})]})},"DealColumn"),cr=o((e,t)=>{if(!t)return{};const n=e.reduce((r,s)=>(r[s.stage].push(s),r),t.reduce((r,s)=>({...r,[s.value]:[]}),{}));return t.forEach(r=>{n[r.value]=n[r.value].sort((s,i)=>s.index-i.index)}),n},"getDealsByStage"),zu=o(()=>{const{dealStages:e}=$e(),{data:t,isPending:n,refetch:r}=dt(),s=Ut(),[i,a]=v.useState(cr([],e));if(v.useEffect(()=>{if(t){const c=cr(t,e);Ms(c,i)||a(c)}},[t]),n)return null;const l=o(c=>{const{destination:d,source:p}=c;if(!d||d.droppableId===p.droppableId&&d.index===p.index)return;const f=p.droppableId,u=d.droppableId,m=i[f][p.index],h=i[u][d.index]??{stage:u,index:void 0};a(Yu(m,{stage:f,index:p.index},{stage:u,index:d.index},i)),Ku(m,h,s).then(()=>{r()})},"onDragEnd");return g.jsx(Xd,{onDragEnd:l,children:g.jsx("div",{className:"flex gap-4",children:e.map(c=>g.jsx(qu,{stage:c.value,deals:i[c.value]},c.value))})})},"DealListContent"),Yu=o((e,t,n,r)=>{if(t.stage===n.stage){const s=r[t.stage];return s.splice(t.index,1),s.splice(n.index??s.length+1,0,e),{...r,[n.stage]:s}}else{const s=r[t.stage],i=r[n.stage];return s.splice(t.index,1),i.splice(n.index??i.length+1,0,e),{...r,[t.stage]:s,[n.stage]:i}}},"updateDealStageLocal"),Ku=o(async(e,t,n)=>{if(e.stage===t.stage){const{data:r}=await n.getList("deals",{sort:{field:"index",order:"ASC"},pagination:{page:1,perPage:100},filter:{stage:e.stage}}),s=t.index??r.length+1;e.index>s?await Promise.all([...r.filter(i=>i.index>=s&&i.index<e.index).map(i=>n.update("deals",{id:i.id,data:{index:i.index+1},previousData:i})),n.update("deals",{id:e.id,data:{index:s},previousData:e})]):await Promise.all([...r.filter(i=>i.index<=s&&i.index>e.index).map(i=>n.update("deals",{id:i.id,data:{index:i.index-1},previousData:i})),n.update("deals",{id:e.id,data:{index:s},previousData:e})])}else{const[{data:r},{data:s}]=await Promise.all([n.getList("deals",{sort:{field:"index",order:"ASC"},pagination:{page:1,perPage:100},filter:{stage:e.stage}}),n.getList("deals",{sort:{field:"index",order:"ASC"},pagination:{page:1,perPage:100},filter:{stage:t.stage}})]),i=t.index??s.length+1;await Promise.all([...r.filter(a=>a.index>e.index).map(a=>n.update("deals",{id:a.id,data:{index:a.index-1},previousData:a})),...s.filter(a=>a.index>=i).map(a=>n.update("deals",{id:a.id,data:{index:a.index+1},previousData:a})),n.update("deals",{id:e.id,data:{index:i,stage:t.stage},previousData:e})])}},"updateDealStage"),Ju=o(()=>{const{data:e,error:t,isPending:n}=dt();return n||t?g.jsx("div",{className:"h-8"}):g.jsx("div",{className:"flex flex-row flex-wrap gap-4 mt-4",children:e.map(r=>g.jsxs("div",{className:"flex flex-row gap-4 items-center",children:[g.jsx(Fs,{record:r}),g.jsxs("div",{className:"flex flex-col",children:[g.jsxs(Be,{to:`/contacts/${r.id}/show`,className:"text-sm hover:underline",children:[r.first_name," ",r.last_name]}),g.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.title,r.title&&r.company_name&&" at ",r.company_name]})]})]},r.id))})},"ContactList"),dr=o(({open:e,id:t})=>{const n=he(),r=o(()=>{n("list","deals")},"handleClose");return g.jsx(lt,{open:e,onOpenChange:o(s=>!s&&r(),"onOpenChange"),children:g.jsx(ct,{className:"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0",children:t?g.jsx(_s,{id:t,children:g.jsx(Xu,{})}):null})})},"DealShow"),Xu=o(()=>{const{dealStages:e}=$e(),t=Er();return t?g.jsx(g.Fragment,{children:g.jsxs("div",{className:"space-y-2",children:[t.archived_at?g.jsx(Qu,{}):null,g.jsxs("div",{className:"flex-1",children:[g.jsxs("div",{className:"flex justify-between items-start mb-8",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(Wt,{source:"company_id",reference:"companies",link:"show",children:g.jsx(Vt,{})}),g.jsx("h2",{className:"text-2xl font-semibold",children:t.name})]}),g.jsx("div",{className:`flex gap-2 ${t.archived_at?"":"pr-12"}`,children:t.archived_at?g.jsxs(g.Fragment,{children:[g.jsx(ef,{record:t}),g.jsx(Pr,{})]}):g.jsxs(g.Fragment,{children:[g.jsx(Zu,{record:t}),g.jsx(Gs,{})]})})]}),g.jsxs("div",{className:"flex gap-8 m-4",children:[g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Expected closing date"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm",children:$s(new Date(t.expected_closing_date))?ks(new Date(t.expected_closing_date),"PP"):"Invalid date"}),new Date(t.expected_closing_date)<new Date?g.jsx(br,{variant:"destructive",children:"Past"}):null]})]}),g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Budget"}),g.jsx("span",{className:"text-sm",children:t.amount.toLocaleString("en-US",{notation:"compact",style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumSignificantDigits:3})})]}),t.category&&g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Category"}),g.jsx("span",{className:"text-sm",children:t.category})]}),g.jsxs("div",{className:"flex flex-col mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Stage"}),g.jsx("span",{className:"text-sm",children:Rr(e,t.stage)})]})]}),!!t.contact_ids?.length&&g.jsx("div",{className:"m-4",children:g.jsxs("div",{className:"flex flex-col min-h-12 mr-10",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Contacts"}),g.jsx(Ws,{source:"contact_ids",reference:"contacts_summary",children:g.jsx(Ju,{})})]})}),t.description&&g.jsxs("div",{className:"m-4 whitespace-pre-line",children:[g.jsx("span",{className:"text-xs text-muted-foreground tracking-wide",children:"Description"}),g.jsx("p",{className:"text-sm leading-6",children:t.description})]}),g.jsxs("div",{className:"m-4",children:[g.jsx(Sr,{className:"mb-4"}),g.jsx(Vs,{target:"deal_id",reference:"dealNotes",sort:{field:"date",order:"DESC"},empty:g.jsx(Hs,{reference:"deals"}),children:g.jsx(Us,{reference:"deals"})})]})]})]})}):null},"DealShowContent"),Qu=o(()=>g.jsx("div",{className:"bg-orange-500 px-6 py-4",children:g.jsx("h3",{className:"text-lg font-bold text-white",children:"Archived Deal"})}),"ArchivedTitle"),Zu=o(({record:e})=>{const[t]=zs(),n=he(),r=Ht(),s=Or(),i=o(()=>{t("deals",{id:e.id,data:{archived_at:new Date().toISOString()},previousData:e},{onSuccess:o(()=>{n("list","deals"),r("Deal archived",{type:"info",undoable:!1}),s()},"onSuccess"),onError:o(()=>{r("Error: deal not archived",{type:"error"})},"onError")})},"handleClick");return g.jsxs(at,{onClick:i,size:"sm",variant:"outline",className:"flex items-center gap-2 h-9",children:[g.jsx(fi,{className:"w-4 h-4"}),"Archive"]})},"ArchiveButton"),ef=o(({record:e})=>{const t=Ut(),n=he(),r=Ht(),s=Or(),{mutate:i}=qs({mutationFn:o(()=>t.unarchiveDeal(e),"mutationFn"),onSuccess:o(()=>{n("list","deals"),r("Deal unarchived",{type:"info",undoable:!1}),s()},"onSuccess"),onError:o(()=>{r("Error: deal not unarchived",{type:"error"})},"onError")}),a=o(()=>{i()},"handleClick");return g.jsxs(at,{onClick:a,size:"sm",variant:"outline",className:"flex items-center gap-2 h-9",children:[g.jsx(di,{className:"w-4 h-4"}),"Send back to the board"]})},"UnarchiveButton"),tf=o(e=>{const{filterValues:t,displayedFilters:n,setFilters:r}=ri(),{identity:s}=it(),i=o(()=>{const a={...t};typeof t.sales_id<"u"?delete a.sales_id:a.sales_id=s&&s?.id,r(a,n)},"handleChange");return g.jsx("div",{className:"mt-auto pb-2.25",children:g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(Ys,{id:"only-mine",checked:typeof t.sales_id<"u",onCheckedChange:i}),g.jsx(Ks,{htmlFor:"only-mine",children:"Only companies I manage"})]})})},"OnlyMineInput"),af=o(()=>{const{identity:e}=it(),{dealCategories:t}=$e();if(!e)return null;const n=[g.jsx(Js,{source:"q",alwaysOn:!0}),g.jsx(Ir,{source:"company_id",reference:"companies",children:g.jsx(Xs,{label:!1,placeholder:"Company"})}),g.jsx(Rt,{source:"category",emptyText:"Category",choices:t.map(r=>({id:r,name:r}))}),g.jsx(tf,{source:"sales_id",alwaysOn:!0})];return g.jsx(Qs,{perPage:100,filter:{"archived_at@is":null},title:!1,sort:{field:"index",order:"DESC"},filters:n,actions:g.jsx(rf,{}),pagination:null,children:g.jsx(nf,{})})},"DealList"),nf=o(()=>{const e=Nr(),t=Je("/deals/create",e.pathname),n=Je("/deals/:id/show",e.pathname),r=Je("/deals/:id",e.pathname),{data:s,isPending:i,filterValues:a}=dt(),l=a&&Object.keys(a).length>0;return i?null:!s?.length&&!l?g.jsx(g.Fragment,{children:g.jsxs(Hu,{children:[g.jsx(dr,{open:!!n,id:n?.params.id}),g.jsx(lr,{})]})}):g.jsxs("div",{className:"w-full",children:[g.jsx(zu,{}),g.jsx(lr,{}),g.jsx(qo,{open:!!t}),g.jsx(Vu,{open:!!r&&!t,id:r?.params.id}),g.jsx(dr,{open:!!n,id:n?.params.id})]})},"DealLayout"),rf=o(()=>g.jsxs(Zs,{children:[g.jsx(ei,{}),g.jsx(ti,{}),g.jsx(Ar,{label:"New Deal"})]}),"DealActions");export{af as default};
59
- //# sourceMappingURL=DealList-BVEX05UH.js.map
59
+ //# sourceMappingURL=DealList-D2733gLg.js.map