sqlmesh 0.181.2.dev24__py3-none-any.whl → 0.181.2.dev25__py3-none-any.whl

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.
Files changed (54) hide show
  1. sqlmesh/_version.py +2 -2
  2. {sqlmesh-0.181.2.dev24.dist-info → sqlmesh-0.181.2.dev25.dist-info}/METADATA +1 -1
  3. {sqlmesh-0.181.2.dev24.dist-info → sqlmesh-0.181.2.dev25.dist-info}/RECORD +50 -50
  4. web/client/dist/assets/{Audits-7rP8WdsD.js → Audits-9LEBiRIZ.js} +1 -1
  5. web/client/dist/assets/{Banner-jMPu9_jP.js → Banner-Cd1C5Udq.js} +1 -1
  6. web/client/dist/assets/{ChevronDownIcon-BZk6URUK.js → ChevronDownIcon-Clb0EegJ.js} +1 -1
  7. web/client/dist/assets/{ChevronRightIcon-Ctcbr61G.js → ChevronRightIcon-dJMaxBt0.js} +1 -1
  8. web/client/dist/assets/{Content-DITnFT31.js → Content-BR4S-QHM.js} +1 -1
  9. web/client/dist/assets/{Content-C43kcRta.js → Content-poZFtj-2.js} +1 -1
  10. web/client/dist/assets/{Data-B5q1KzIa.js → Data-DaQiUe8h.js} +1 -1
  11. web/client/dist/assets/{DataCatalog-BRzSrlJL.js → DataCatalog-DOMFDv-k.js} +1 -1
  12. web/client/dist/assets/{Editor-7muj9lbw.js → Editor-BcrLy189.js} +1 -1
  13. web/client/dist/assets/{Editor-CAMzYH0x.js → Editor-BmDyTaeT.js} +1 -1
  14. web/client/dist/assets/{Errors-Bbd2EOQg.js → Errors-Cjh1BMUt.js} +1 -1
  15. web/client/dist/assets/FileExplorer-Cdh0DRgS.js +2 -0
  16. web/client/dist/assets/{Footer-Cnu_IoqE.js → Footer-CrjZJkj4.js} +1 -1
  17. web/client/dist/assets/{Header-NJkxh8bb.js → Header-DE3bKMcG.js} +1 -1
  18. web/client/dist/assets/Input-BY5Rc3go.js +41 -0
  19. web/client/dist/assets/Lineage-CLoHrLAT.js +1 -0
  20. web/client/dist/assets/{ListboxShow-CwgOYGSe.js → ListboxShow-TFvq9fMB.js} +1 -1
  21. web/client/dist/assets/{ModelLineage-Bnes5PV4.js → ModelLineage-CB8Rie_r.js} +1 -1
  22. web/client/dist/assets/{Models-B_sukTY5.js → Models-DXUrmUm_.js} +1 -1
  23. web/client/dist/assets/{Page-DxTzPmYT.js → Page-KC6UG65M.js} +1 -1
  24. web/client/dist/assets/{Plan-B2b637kI.js → Plan-xbMFAnVh.js} +1 -1
  25. web/client/dist/assets/{PlusCircleIcon-FgfUjgrM.js → PlusCircleIcon-CoFMRFQI.js} +1 -1
  26. web/client/dist/assets/{ReportErrors-xnNgNULg.js → ReportErrors-mVM8O5iE.js} +1 -1
  27. web/client/dist/assets/{Root-BMcIwqdc.js → Root-BuQJ2VAg.js} +1 -1
  28. web/client/dist/assets/{SearchList-9n_6_E0k.js → SearchList-BShQn9jm.js} +1 -1
  29. web/client/dist/assets/{SelectEnvironment-DC6x26Ax.js → SelectEnvironment-8p6ZQ-QH.js} +1 -1
  30. web/client/dist/assets/{SourceList-Chz492Ne.js → SourceList-DQ72TcK1.js} +1 -1
  31. web/client/dist/assets/{SourceListItem-DIieM0S_.js → SourceListItem-CncMnWed.js} +1 -1
  32. web/client/dist/assets/{SplitPane-CmzNrZQN.js → SplitPane-BY85POxQ.js} +1 -1
  33. web/client/dist/assets/{Tests-DbVFKqeG.js → Tests-DeaITzzp.js} +1 -1
  34. web/client/dist/assets/{Welcome-DxKW_LKA.js → Welcome-Blok6Zy8.js} +1 -1
  35. web/client/dist/assets/{context-CzM900aY.js → context-B3nwRpP1.js} +1 -1
  36. web/client/dist/assets/{context-DhymIb_N.js → context-Dx2o1ZRq.js} +37 -37
  37. web/client/dist/assets/{editor-Bf9rhumO.js → editor-Dj_6cws7.js} +1 -1
  38. web/client/dist/assets/{file-CcK5Oobc.js → file-Bs2Eq56_.js} +1 -1
  39. web/client/dist/assets/{help-DtLmoC0U.js → help-Bolb6haG.js} +1 -1
  40. web/client/dist/assets/index-COQuzlwN.js +1 -0
  41. web/client/dist/assets/{index-KZcJd7F1.js → index-CkIQhGgw.js} +1 -1
  42. web/client/dist/assets/{index-CLuHMKlN.js → index-DQbKL5-Q.js} +1 -1
  43. web/client/dist/assets/{plan-e4fPD47J.js → plan-BZyi7OFv.js} +1 -1
  44. web/client/dist/assets/{project-CjyecwCx.js → project-XFpF0AcJ.js} +1 -1
  45. web/client/dist/assets/{transition-C8EjNcgL.js → transition-B5aHgz_j.js} +1 -1
  46. web/client/dist/index.html +1 -1
  47. web/client/dist/assets/FileExplorer-DMR02idl.js +0 -5
  48. web/client/dist/assets/Input-CYm3h-zG.js +0 -41
  49. web/client/dist/assets/Lineage-HZl7aUI5.js +0 -1
  50. web/client/dist/assets/index-BdXOfeCo.js +0 -1
  51. {sqlmesh-0.181.2.dev24.dist-info → sqlmesh-0.181.2.dev25.dist-info}/WHEEL +0 -0
  52. {sqlmesh-0.181.2.dev24.dist-info → sqlmesh-0.181.2.dev25.dist-info}/entry_points.txt +0 -0
  53. {sqlmesh-0.181.2.dev24.dist-info → sqlmesh-0.181.2.dev25.dist-info}/licenses/LICENSE +0 -0
  54. {sqlmesh-0.181.2.dev24.dist-info → sqlmesh-0.181.2.dev25.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- import{r as x}from"./index-KZcJd7F1.js";import{r as C}from"./index-BdXOfeCo.js";function p(r,l,e){let s=e.initialDeps??[],t;function n(){var i,o,a,c;let h;e.key&&((i=e.debug)!=null&&i.call(e))&&(h=Date.now());const u=r();if(!(u.length!==s.length||u.some((m,f)=>s[f]!==m)))return t;s=u;let v;if(e.key&&((o=e.debug)!=null&&o.call(e))&&(v=Date.now()),t=l(...u),e.key&&((a=e.debug)!=null&&a.call(e))){const m=Math.round((Date.now()-h)*100)/100,f=Math.round((Date.now()-v)*100)/100,S=f/16,b=(g,O)=>{for(g=String(g);g.length<O;)g=" "+g;return g};console.info(`%c⏱ ${b(f,5)} /${b(m,5)} ms`,`
1
+ import{r as x}from"./index-CkIQhGgw.js";import{r as C}from"./index-COQuzlwN.js";function p(r,l,e){let s=e.initialDeps??[],t;function n(){var i,o,a,c;let h;e.key&&((i=e.debug)!=null&&i.call(e))&&(h=Date.now());const u=r();if(!(u.length!==s.length||u.some((m,f)=>s[f]!==m)))return t;s=u;let v;if(e.key&&((o=e.debug)!=null&&o.call(e))&&(v=Date.now()),t=l(...u),e.key&&((a=e.debug)!=null&&a.call(e))){const m=Math.round((Date.now()-h)*100)/100,f=Math.round((Date.now()-v)*100)/100,S=f/16,b=(g,O)=>{for(g=String(g);g.length<O;)g=" "+g;return g};console.info(`%c⏱ ${b(f,5)} /${b(m,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(c=e==null?void 0:e.onChange)==null||c.call(e,t),t}return n.updateDeps=i=>{s=i},n}function M(r,l){if(r===void 0)throw new Error("Unexpected undefined");return r}const T=(r,l)=>Math.abs(r-l)<=1,R=(r,l,e)=>{let s;return function(...t){r.clearTimeout(s),s=r.setTimeout(()=>l.apply(this,t),e)}},y=r=>{const{offsetWidth:l,offsetHeight:e}=r;return{width:l,height:e}},_=r=>r,A=r=>{const l=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),s=[];for(let t=l;t<=e;t++)s.push(t);return s},D=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;const t=i=>{const{width:o,height:a}=i;l({width:Math.round(o),height:Math.round(a)})};if(t(y(e)),!s.ResizeObserver)return()=>{};const n=new s.ResizeObserver(i=>{const o=()=>{const a=i[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){t({width:c.inlineSize,height:c.blockSize});return}}t(y(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(e,{box:"border-box"}),()=>{n.unobserve(e)}},w={passive:!0},I=typeof window>"u"?!0:"onscrollend"in window,k=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;let t=0;const n=r.options.useScrollendEvent&&I?()=>{}:R(s,()=>{l(t,!1)},r.options.isScrollingResetDelay),i=h=>()=>{const{horizontal:u,isRtl:d}=r.options;t=u?e.scrollLeft*(d&&-1||1):e.scrollTop,n(),l(t,h)},o=i(!0),a=i(!1);a(),e.addEventListener("scroll",o,w);const c=r.options.useScrollendEvent&&I;return c&&e.addEventListener("scrollend",a,w),()=>{e.removeEventListener("scroll",o),c&&e.removeEventListener("scrollend",a)}},F=(r,l,e)=>{if(l!=null&&l.borderBoxSize){const s=l.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},W=(r,{adjustments:l=0,behavior:e},s)=>{var t,n;const i=r+l;(n=(t=s.scrollElement)==null?void 0:t.scrollTo)==null||n.call(t,{[s.options.horizontal?"left":"top"]:i,behavior:e})};class j{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(t=>{t.forEach(n=>{const i=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var t;(t=s())==null||t.disconnect(),e=null},observe:t=>{var n;return(n=s())==null?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n;return(n=s())==null?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,t])=>{typeof t>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:_,rangeExtractor:A,onChange:()=>{},measureElement:F,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,t;(t=(s=this.options).onChange)==null||t.call(s,this,e)},this.maybeNotify=p(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const t=new Map,n=new Map;for(let i=s-1;i>=0;i--){const o=e[i];if(t.has(o.lane))continue;const a=n.get(o.lane);if(a==null||o.end>a.end?n.set(o.lane,o):o.end<a.end&&t.set(o.lane,!0),t.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((i,o)=>i.end===o.end?i.index-o.index:i.end-o.end)[0]:void 0},this.getMeasurementOptions=p(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,s,t,n,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i}),{key:!1}),this.getMeasurements=p(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,a);for(let h=a;h<e;h++){const u=n(h),d=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h),v=d?d.end+this.options.gap:s+t,m=o.get(u),f=typeof m=="number"?m:this.options.estimateSize(h),S=v+f,b=d?d.lane:h%this.options.lanes;c[h]={index:h,start:v,size:f,end:S,key:u,lane:b}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=p(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,t,n)=>this.range=e.length>0&&s>0?L({measurements:e,outerSize:s,scrollOffset:t,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=p(()=>{let e=null,s=null;const t=this.calculateRange();return t&&(e=t.startIndex,s=t.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,t,n,i)=>n===null||i===null?[]:e({startIndex:n,endIndex:i,overscan:s,count:t}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,t=e.getAttribute(s);return t?parseInt(t,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(e,s)=>{const t=this.indexFromElement(e),n=this.measurementsCache[t];if(!n)return;const i=n.key,o=this.elementsCache.get(i);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(t,this.options.measureElement(e,s,this))},this.resizeItem=(e,s)=>{const t=this.measurementsCache[e];if(!t)return;const n=this.itemSizeCache.get(t.key)??t.size,i=s-n;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(t,i,this):t.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(t.index),this.itemSizeCache=new Map(this.itemSizeCache.set(t.key,s)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((s,t)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=p(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const t=[];for(let n=0,i=e.length;n<i;n++){const o=e[n],a=s[o];t.push(a)}return t},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return M(s[z(0,s.length-1,t=>M(s[t]).start,e)])},this.getOffsetForAlignment=(e,s,t=0)=>{const n=this.getSize(),i=this.getScrollOffset();s==="auto"&&(s=e>=i+n?"end":"start"),s==="center"?e+=(t-n)/2:s==="end"&&(e-=n);const o=this.getTotalSize()-n;return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const t=this.measurementsCache[e];if(!t)return;const n=this.getSize(),i=this.getScrollOffset();if(s==="auto")if(t.end>=i+n-this.options.scrollPaddingEnd)s="end";else if(t.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];const o=s==="end"?t.end+this.options.scrollPaddingEnd:t.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,s,t.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:s="start",behavior:t}={})=>{this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,s),{adjustments:void 0,behavior:t})},this.scrollToIndex=(e,{align:s="auto",behavior:t}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(e,s);if(!n)return;const[i,o]=n;this._scrollToOffset(i,{adjustments:void 0,behavior:t}),t!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){const[c]=M(this.getOffsetForIndex(e,o)),h=this.getScrollOffset();T(c,h)||this.scrollToIndex(e,{align:o,behavior:t})}else this.scrollToIndex(e,{align:o,behavior:t})}))},this.scrollBy=(e,{behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let t;if(s.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=((e=s[s.length-1])==null?void 0:e.end)??0;else{const n=Array(this.options.lanes).fill(null);let i=s.length-1;for(;i>=0&&n.some(o=>o===null);){const o=s[i];n[o.lane]===null&&(n[o.lane]=o.end),i--}t=Math.max(...n.filter(o=>o!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:t})=>{this.options.scrollToFn(e,{behavior:t,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(l)}}const z=(r,l,e,s)=>{for(;r<=l;){const t=(r+l)/2|0,n=e(t);if(n<s)r=t+1;else if(n>s)l=t-1;else return t}return r>0?r-1:0};function L({measurements:r,outerSize:l,scrollOffset:e,lanes:s}){const t=r.length-1,n=a=>r[a].start;if(r.length<=s)return{startIndex:0,endIndex:t};let i=z(0,t,n,e),o=i;if(s===1)for(;o<t&&r[o].end<e+l;)o++;else if(s>1){const a=Array(s).fill(0);for(;o<t&&a.some(h=>h<e+l);){const h=r[o];a[h.lane]=h.end,o++}const c=Array(s).fill(e+l);for(;i>=0&&c.some(h=>h>=e);){const h=r[i];c[h.lane]=h.start,i--}i=Math.max(0,i-i%s),o=Math.min(t,o+(s-1-o%s))}return{startIndex:i,endIndex:o}}const E=typeof document<"u"?x.useLayoutEffect:x.useEffect;function P(r){const l=x.useReducer(()=>({}),{})[1],e={...r,onChange:(t,n)=>{var i;n?C.flushSync(l):l(),(i=r.onChange)==null||i.call(r,t,n)}},[s]=x.useState(()=>new j(e));return s.setOptions(e),E(()=>s._didMount(),[]),E(()=>s._willUpdate()),s}function N(r){return P({observeElementRect:D,observeElementOffset:k,scrollToFn:W,...r})}export{N as u};
@@ -1 +1 @@
1
- var N=Object.defineProperty;var D=(u,r,t)=>r in u?N(u,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[r]=t;var a=(u,r,t)=>D(u,typeof r!="symbol"?r+"":r,t);import{a0 as F,s as I,b as f,w as l,g as R,C as w,D as v,i as p,h as V,a1 as x}from"./index-KZcJd7F1.js";const s={Done:"done",Run:"run",Running:"running",RunningTask:"running-task",ApplyVirtual:"apply-virtual",ApplyBackfill:"apply-backfill",ApplyChangesAndBackfill:"apply-changes-and-backfill",ApplyMetadata:"apply-metadata",Applying:"applying",Cancelling:"cancelling"};class O extends F{constructor(t){super(t!=null&&t.isModel?t.initial:{...t,value:(t==null?void 0:t.value)??s.Run});a(this,"_value");this._value=(t==null?void 0:t.value)??this.initial.value}get value(){return this._value}get isRun(){return this.value===s.Run}get isDone(){return this.value===s.Done}get isApplyVirtual(){return this.value===s.ApplyVirtual}get isApplyBackfill(){return this.value===s.ApplyBackfill}get isApplyChangesAndBackfill(){return this.value===s.ApplyChangesAndBackfill}get isApplyMetadata(){return this.value===s.ApplyMetadata}get isApply(){return this.isApplyVirtual||this.isApplyBackfill||this.isApplyChangesAndBackfill||this.isApplyMetadata}get isCancelling(){return this.value===s.Cancelling}get isApplying(){return this.value===s.Applying}get isRunning(){return I([s.Running,s.RunningTask],this.value)}get isRunningTask(){return this.value===s.RunningTask}get isProcessing(){return this.isRunning||this.isApplying||this.isCancelling}get isIdle(){return f(this.isProcessing)}displayStatus(t){return this.isCancelling?"Cancelling Plan...":this.isApplying?"Applying Plan...":this.isRunning&&l(t.hasChanges)?"Getting Changes...":this.isRunning&&l(t.hasBackfills)?"Getting Backfills...":this.isRunning?"Checking Plan...":this.isRunningTask?"Running Task...":"Plan"}static getActionDisplayName(t,e=[],i="Plan"){if(!e.includes(t.value))return i;let n;switch(t.value){case s.Done:n="Done";break;case s.Running:n="Running...";break;case s.RunningTask:n="Running Task...";break;case s.Applying:n="Applying...";break;case s.Cancelling:n="Cancelling...";break;case s.Run:n="Plan";break;case s.ApplyChangesAndBackfill:n="Apply Changes And Backfill";break;case s.ApplyVirtual:n="Apply Virtual Update";break;case s.ApplyBackfill:n="Apply And Backfill";break;case s.ApplyMetadata:n="Apply Metadata";break;default:n=i;break}return n}static getPlanAction({planOverview:t,planApply:e,planCancel:i}){const n=t.isRunning,c=e.isRunning,h=i.isRunning,d=e.isFinished&&t.isFinished||i.isFinished;return i.isEmpty&&e.isEmpty&&t.isEmpty?s.Run:h?s.Cancelling:c?s.Applying:n?s.Running:d?s.Done:t.isVirtualUpdate?s.ApplyVirtual:t.isMetadataUpdate?s.ApplyMetadata:t.isBackfillUpdate?s.ApplyBackfill:t.isChangesAndBackfillUpdate?s.ApplyChangesAndBackfill:s.Done}}class U extends F{constructor(t){super(t==null?void 0:t.initial);a(this,"_current");a(this,"_isFetching",!1);this._current=t==null?void 0:t._current,this._isFetching=(t==null?void 0:t._isFetching)??!1}get current(){return this._current}get environment(){var t;return(t=this.current)==null?void 0:t.environment}get meta(){var t;return(t=this.current)==null?void 0:t.meta}get plan_options(){var t;return(t=this.current)==null?void 0:t.plan_options}get start(){var t;return(t=this.current)==null?void 0:t.start}get end(){var t;return(t=this.current)==null?void 0:t.end}get duration(){var t;return((t=this==null?void 0:this.meta)==null?void 0:t.duration)??-1}get isFinished(){var t,e,i,n;return R((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)!==w.init&&f(this.isFetching)}get isRunning(){var t,e,i,n;return v((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)===w.init||this.isFetching}get isSuccessful(){var t,e;return this.isFinished&&((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.status)===w.success}get isFailed(){var t,e,i;return this.isFinished&&(l((t=this.current)==null?void 0:t.meta)||((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.fail)}get isEmpty(){return l(this.current)}get isFetching(){return this._isFetching}set isFetching(t){this._isFetching=t}reset(){this._current=void 0}}class o extends F{constructor(t){var e,i;super(t);a(this,"name");a(this,"view_name");a(this,"node_type");a(this,"change_category");a(this,"diff");a(this,"indirect");a(this,"batches");a(this,"direct");a(this,"completed");a(this,"end");a(this,"interval");a(this,"start");a(this,"total");this.name=encodeURI(this.initial.name),this.view_name=encodeURI(this.initial.view_name),this.node_type=this.initial.node_type,this.change_category=this.initial.change_category,this.diff=this.initial.diff,this.batches=this.initial.batches,this.interval=this.initial.interval,this.start=this.initial.start,this.total=this.initial.total,this.completed=this.initial.completed,this.end=this.initial.end,this.indirect=(e=this.initial.indirect)==null?void 0:e.map(n=>new o(n)),this.direct=(i=this.initial.direct)==null?void 0:i.map(n=>new o(n))}get nodeType(){return this.node_type}get viewName(){return this.view_name}get displayName(){return decodeURI(this.name)}get displayViewName(){return decodeURI(this.view_name)}get changeCategory(){return this.change_category}}class k extends U{constructor(t){super(t);a(this,"_last");a(this,"_planOverview");a(this,"_lastPlanOverview");p(t)&&t.isModel&&(this._current=t._current,this._last=t._last,this._planOverview=t._planOverview,this._lastPlanOverview=t._lastPlanOverview)}get current(){return this._current??this._last}get environment(){var t,e;return((t=this._last)==null?void 0:t.environment)??((e=this._current)==null?void 0:e.environment)}get meta(){var t,e;return((t=this._last)==null?void 0:t.meta)??((e=this._current)==null?void 0:e.meta)}get plan_options(){var t,e;return((t=this._last)==null?void 0:t.plan_options)??((e=this._current)==null?void 0:e.plan_options)}get start(){var t,e;return((t=this._last)==null?void 0:t.start)??((e=this._current)==null?void 0:e.start)}get end(){var t,e;return((t=this._last)==null?void 0:t.end)??((e=this._current)==null?void 0:e.end)}get overview(){return this._lastPlanOverview??this._planOverview}get backfills(){var t;return((t=this.overview)==null?void 0:t.backfills)??[]}get added(){var t;return((t=this.overview)==null?void 0:t.added)??[]}get removed(){var t;return((t=this.overview)==null?void 0:t.removed)??[]}get direct(){var t;return((t=this.overview)==null?void 0:t.direct)??[]}get indirect(){var t;return((t=this.overview)==null?void 0:t.indirect)??[]}get metadata(){var t;return((t=this.overview)==null?void 0:t.metadata)??[]}get tasks(){var e,i,n,c;const t=((i=(e=this._last)==null?void 0:e.backfill)==null?void 0:i.tasks)??((c=(n=this._current)==null?void 0:n.backfill)==null?void 0:c.tasks)??{};return Object.entries(t??{}).reduce((h,[d,_])=>(h[encodeURI(d)]=new o(_),h),{})}get queue(){var t,e;return((e=(t=this.stageBackfill)==null?void 0:t.queue)==null?void 0:e.map(i=>this.tasks[encodeURI(i)]).filter(Boolean))??[]}get stageValidation(){var t;return(t=this.overview)==null?void 0:t.stageValidation}get stageChanges(){var t;return(t=this.overview)==null?void 0:t.stageChanges}get stageBackfills(){var t;return(t=this.overview)==null?void 0:t.stageBackfills}get stageCreation(){var t,e;return((t=this._last)==null?void 0:t.creation)??((e=this._current)==null?void 0:e.creation)}get stageRestate(){var t,e;return((t=this._last)==null?void 0:t.restate)??((e=this._current)==null?void 0:e.restate)}get stageBackfill(){var t,e;return((t=this._last)==null?void 0:t.backfill)??((e=this._current)==null?void 0:e.backfill)}get stagePromote(){var t,e;return((t=this._last)==null?void 0:t.promote)??((e=this._current)==null?void 0:e.promote)}get shouldShowEvaluation(){return this.isFailed||p(this.stageCreation)||p(this.stageBackfill)||p(this.stagePromote)}get evaluationStart(){var t,e,i,n,c,h;return((e=(t=this.stageCreation)==null?void 0:t.meta)==null?void 0:e.start)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.start)??((h=(c=this.stagePromote)==null?void 0:c.meta)==null?void 0:h.start)}get evaluationEnd(){var t,e,i,n,c,h;return((e=(t=this.stagePromote)==null?void 0:t.meta)==null?void 0:e.end)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.end)??((h=(c=this.stageCreation)==null?void 0:c.meta)==null?void 0:h.end)}update(t,e){var m,y,A,g,M,T,E;const{creation:i,restate:n,backfill:c,promote:h,meta:d,environment:_}=t,B=l(d)||l(_)?void 0:t;if(l(B)){this._current=void 0;return}l(this._current)&&(this._current=t),this._current.start=t.start,this._current.end=t.end,this._current.meta=t.meta,this._current.environment=t.environment,this._current.plan_options=t.plan_options,p(i)&&(l(this._current.creation)||v((m=this._current.creation.meta)==null?void 0:m.done))&&(this._current.creation=i),p(n)&&(l(this._current.restate)||v((y=this._current.restate.meta)==null?void 0:y.done))&&(this._current.restate=n),p(c)&&(l(this._current.backfill)||v((A=this._current.backfill.meta)==null?void 0:A.done))&&(this._current.backfill=c),p(h)&&(l(this._current.promote)||v((g=this._current.promote.meta)==null?void 0:g.done))&&(this._current.promote=h),R((T=(M=this.current)==null?void 0:M.meta)==null?void 0:T.done)&&l(this._last)?(this._last=this._current,this._lastPlanOverview=this._planOverview,this._current=void 0,this._planOverview=void 0):this._planOverview=p(d)&&p(_)?e==null?void 0:e.clone():void 0,this.isFetching=f((E=t.meta)==null?void 0:E.done)}reset(){this._current=void 0,this._planOverview=void 0}clear(){this._current=void 0,this._last=void 0,this._planOverview=void 0,this._lastPlanOverview=void 0}clone(){var e;const t=new k;return p(this.current)&&t.update(structuredClone(this.current),(e=this.overview)==null?void 0:e.clone()),t}}class b extends U{get cancel(){var r;return(r=this._current)==null?void 0:r.cancel}get isCancelling(){var r,t,e,i;return v((t=(r=this.current)==null?void 0:r.meta)==null?void 0:t.done)&&((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.init||this.isFetching}update(r){var t;this._current=r,this.isFetching=f((t=r.meta)==null?void 0:t.done)}}class C extends U{constructor(t){super(t);a(this,"_added",[]);a(this,"_removed",[]);a(this,"_direct",[]);a(this,"_indirect",[]);a(this,"_metadata",[]);a(this,"_backfills",[]);p(t)&&t.isModel&&(this._added=t.added,this._removed=t.removed,this._direct=t.direct,this._indirect=t.indirect,this._metadata=t.metadata,this._backfills=t.backfills)}get stageValidation(){var t;return(t=this._current)==null?void 0:t.validation}get stageChanges(){var t;return(t=this._current)==null?void 0:t.changes}get stageBackfills(){var t;return(t=this._current)==null?void 0:t.backfills}get validation(){var t;return(t=this._current)==null?void 0:t.validation}get hasChanges(){var d;if(l((d=this._current)==null?void 0:d.changes))return;const{added:t,removed:e,modified:i}=this._current.changes??{};if([t,e,i].every(l))return;const{direct:n,indirect:c,metadata:h}=i??{};return[t,e,n,c,h].some(V)}get changes(){var t;return(t=this._current)==null?void 0:t.changes}get hasBackfills(){var t,e,i;return l((e=(t=this._current)==null?void 0:t.backfills)==null?void 0:e.models)?void 0:V((i=this._current.backfills)==null?void 0:i.models)}get hasUpdates(){return R(this.hasChanges)||R(this.hasBackfills)}get backfills(){return this._backfills}get added(){return this._added}get removed(){return this._removed}get direct(){return this._direct}get indirect(){return this._indirect}get metadata(){return this._metadata}get isVirtualUpdate(){return p(this.hasChanges)&&l(this.hasBackfills)||!!this.hasChanges&&this.skipBackfill}get isMetadataUpdate(){var t;return!!((t=this.metadata)!=null&&t.length)&&l(this.hasBackfills)}get isBackfillUpdate(){return v(this.hasChanges)&&!!this.hasBackfills&&f(this.skipBackfill)}get isChangesAndBackfillUpdate(){return!!this.hasChanges&&!!this.hasBackfills&&f(this.skipBackfill)}get isLatest(){return this.isFinished&&l(this.hasChanges)&&(l(this.hasBackfills)||this.skipBackfill)}get skipTests(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_tests)??!1}get skipBackfill(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_backfill)??!1}update(t){var c,h,d,_,P,B,m,y,A;this._current=t,this.isFetching=f((c=t.meta)==null?void 0:c.done);const e=((h=this._current)==null?void 0:h.changes)??{},i=(e==null?void 0:e.modified)??{},n=((d=this._current)==null?void 0:d.backfills)??{};this._added=((_=e.added)==null?void 0:_.map(g=>new o(g)))??[],this._removed=((P=e.removed)==null?void 0:P.map(g=>new o(g)))??[],this._direct=((B=i.direct)==null?void 0:B.map(g=>new o(g)))??[],this._indirect=((m=i.indirect)==null?void 0:m.map(g=>new o(g)))??[],this._metadata=((y=i.metadata)==null?void 0:y.map(g=>new o(g)))??[],this._backfills=((A=n.models)==null?void 0:A.map(g=>new o(g)))??[]}clone(){const t=new C;return p(this.current)&&t.update(structuredClone(this.current)),t}}const G=x((u,r)=>({planAction:new O,planOverview:new C,planApply:new k,planCancel:new b,setPlanAction:t=>{u(()=>({planAction:new O(t)}))},setPlanApply:t=>{u(()=>({planApply:new k(t)}))},setPlanOverview:t=>{u(()=>({planOverview:new C(t)}))},setPlanCancel:t=>{u(()=>({planCancel:new b(t)}))},resetPlanTrackers:()=>{const t=r();t.planApply.reset(),t.planCancel.reset(),t.planOverview.reset(),u(()=>({planApply:new k(t.planApply),planCancel:new b(t.planCancel),planOverview:new C(t.planOverview)}))},resetPlanCancel:()=>{const t=r();t.planCancel.reset(),u(()=>({planCancel:new b(t.planCancel)}))},clearPlanApply:()=>{const t=r();t.planApply.clear(),u(()=>({planApply:new k(t.planApply)}))}}));export{s as E,C as M,O as a,G as u};
1
+ var N=Object.defineProperty;var D=(u,r,t)=>r in u?N(u,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[r]=t;var a=(u,r,t)=>D(u,typeof r!="symbol"?r+"":r,t);import{a0 as F,s as I,b as f,w as l,g as R,C as w,D as v,i as p,h as V,a1 as x}from"./index-CkIQhGgw.js";const s={Done:"done",Run:"run",Running:"running",RunningTask:"running-task",ApplyVirtual:"apply-virtual",ApplyBackfill:"apply-backfill",ApplyChangesAndBackfill:"apply-changes-and-backfill",ApplyMetadata:"apply-metadata",Applying:"applying",Cancelling:"cancelling"};class O extends F{constructor(t){super(t!=null&&t.isModel?t.initial:{...t,value:(t==null?void 0:t.value)??s.Run});a(this,"_value");this._value=(t==null?void 0:t.value)??this.initial.value}get value(){return this._value}get isRun(){return this.value===s.Run}get isDone(){return this.value===s.Done}get isApplyVirtual(){return this.value===s.ApplyVirtual}get isApplyBackfill(){return this.value===s.ApplyBackfill}get isApplyChangesAndBackfill(){return this.value===s.ApplyChangesAndBackfill}get isApplyMetadata(){return this.value===s.ApplyMetadata}get isApply(){return this.isApplyVirtual||this.isApplyBackfill||this.isApplyChangesAndBackfill||this.isApplyMetadata}get isCancelling(){return this.value===s.Cancelling}get isApplying(){return this.value===s.Applying}get isRunning(){return I([s.Running,s.RunningTask],this.value)}get isRunningTask(){return this.value===s.RunningTask}get isProcessing(){return this.isRunning||this.isApplying||this.isCancelling}get isIdle(){return f(this.isProcessing)}displayStatus(t){return this.isCancelling?"Cancelling Plan...":this.isApplying?"Applying Plan...":this.isRunning&&l(t.hasChanges)?"Getting Changes...":this.isRunning&&l(t.hasBackfills)?"Getting Backfills...":this.isRunning?"Checking Plan...":this.isRunningTask?"Running Task...":"Plan"}static getActionDisplayName(t,e=[],i="Plan"){if(!e.includes(t.value))return i;let n;switch(t.value){case s.Done:n="Done";break;case s.Running:n="Running...";break;case s.RunningTask:n="Running Task...";break;case s.Applying:n="Applying...";break;case s.Cancelling:n="Cancelling...";break;case s.Run:n="Plan";break;case s.ApplyChangesAndBackfill:n="Apply Changes And Backfill";break;case s.ApplyVirtual:n="Apply Virtual Update";break;case s.ApplyBackfill:n="Apply And Backfill";break;case s.ApplyMetadata:n="Apply Metadata";break;default:n=i;break}return n}static getPlanAction({planOverview:t,planApply:e,planCancel:i}){const n=t.isRunning,c=e.isRunning,h=i.isRunning,d=e.isFinished&&t.isFinished||i.isFinished;return i.isEmpty&&e.isEmpty&&t.isEmpty?s.Run:h?s.Cancelling:c?s.Applying:n?s.Running:d?s.Done:t.isVirtualUpdate?s.ApplyVirtual:t.isMetadataUpdate?s.ApplyMetadata:t.isBackfillUpdate?s.ApplyBackfill:t.isChangesAndBackfillUpdate?s.ApplyChangesAndBackfill:s.Done}}class U extends F{constructor(t){super(t==null?void 0:t.initial);a(this,"_current");a(this,"_isFetching",!1);this._current=t==null?void 0:t._current,this._isFetching=(t==null?void 0:t._isFetching)??!1}get current(){return this._current}get environment(){var t;return(t=this.current)==null?void 0:t.environment}get meta(){var t;return(t=this.current)==null?void 0:t.meta}get plan_options(){var t;return(t=this.current)==null?void 0:t.plan_options}get start(){var t;return(t=this.current)==null?void 0:t.start}get end(){var t;return(t=this.current)==null?void 0:t.end}get duration(){var t;return((t=this==null?void 0:this.meta)==null?void 0:t.duration)??-1}get isFinished(){var t,e,i,n;return R((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)!==w.init&&f(this.isFetching)}get isRunning(){var t,e,i,n;return v((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.done)&&((n=(i=this.current)==null?void 0:i.meta)==null?void 0:n.status)===w.init||this.isFetching}get isSuccessful(){var t,e;return this.isFinished&&((e=(t=this.current)==null?void 0:t.meta)==null?void 0:e.status)===w.success}get isFailed(){var t,e,i;return this.isFinished&&(l((t=this.current)==null?void 0:t.meta)||((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.fail)}get isEmpty(){return l(this.current)}get isFetching(){return this._isFetching}set isFetching(t){this._isFetching=t}reset(){this._current=void 0}}class o extends F{constructor(t){var e,i;super(t);a(this,"name");a(this,"view_name");a(this,"node_type");a(this,"change_category");a(this,"diff");a(this,"indirect");a(this,"batches");a(this,"direct");a(this,"completed");a(this,"end");a(this,"interval");a(this,"start");a(this,"total");this.name=encodeURI(this.initial.name),this.view_name=encodeURI(this.initial.view_name),this.node_type=this.initial.node_type,this.change_category=this.initial.change_category,this.diff=this.initial.diff,this.batches=this.initial.batches,this.interval=this.initial.interval,this.start=this.initial.start,this.total=this.initial.total,this.completed=this.initial.completed,this.end=this.initial.end,this.indirect=(e=this.initial.indirect)==null?void 0:e.map(n=>new o(n)),this.direct=(i=this.initial.direct)==null?void 0:i.map(n=>new o(n))}get nodeType(){return this.node_type}get viewName(){return this.view_name}get displayName(){return decodeURI(this.name)}get displayViewName(){return decodeURI(this.view_name)}get changeCategory(){return this.change_category}}class k extends U{constructor(t){super(t);a(this,"_last");a(this,"_planOverview");a(this,"_lastPlanOverview");p(t)&&t.isModel&&(this._current=t._current,this._last=t._last,this._planOverview=t._planOverview,this._lastPlanOverview=t._lastPlanOverview)}get current(){return this._current??this._last}get environment(){var t,e;return((t=this._last)==null?void 0:t.environment)??((e=this._current)==null?void 0:e.environment)}get meta(){var t,e;return((t=this._last)==null?void 0:t.meta)??((e=this._current)==null?void 0:e.meta)}get plan_options(){var t,e;return((t=this._last)==null?void 0:t.plan_options)??((e=this._current)==null?void 0:e.plan_options)}get start(){var t,e;return((t=this._last)==null?void 0:t.start)??((e=this._current)==null?void 0:e.start)}get end(){var t,e;return((t=this._last)==null?void 0:t.end)??((e=this._current)==null?void 0:e.end)}get overview(){return this._lastPlanOverview??this._planOverview}get backfills(){var t;return((t=this.overview)==null?void 0:t.backfills)??[]}get added(){var t;return((t=this.overview)==null?void 0:t.added)??[]}get removed(){var t;return((t=this.overview)==null?void 0:t.removed)??[]}get direct(){var t;return((t=this.overview)==null?void 0:t.direct)??[]}get indirect(){var t;return((t=this.overview)==null?void 0:t.indirect)??[]}get metadata(){var t;return((t=this.overview)==null?void 0:t.metadata)??[]}get tasks(){var e,i,n,c;const t=((i=(e=this._last)==null?void 0:e.backfill)==null?void 0:i.tasks)??((c=(n=this._current)==null?void 0:n.backfill)==null?void 0:c.tasks)??{};return Object.entries(t??{}).reduce((h,[d,_])=>(h[encodeURI(d)]=new o(_),h),{})}get queue(){var t,e;return((e=(t=this.stageBackfill)==null?void 0:t.queue)==null?void 0:e.map(i=>this.tasks[encodeURI(i)]).filter(Boolean))??[]}get stageValidation(){var t;return(t=this.overview)==null?void 0:t.stageValidation}get stageChanges(){var t;return(t=this.overview)==null?void 0:t.stageChanges}get stageBackfills(){var t;return(t=this.overview)==null?void 0:t.stageBackfills}get stageCreation(){var t,e;return((t=this._last)==null?void 0:t.creation)??((e=this._current)==null?void 0:e.creation)}get stageRestate(){var t,e;return((t=this._last)==null?void 0:t.restate)??((e=this._current)==null?void 0:e.restate)}get stageBackfill(){var t,e;return((t=this._last)==null?void 0:t.backfill)??((e=this._current)==null?void 0:e.backfill)}get stagePromote(){var t,e;return((t=this._last)==null?void 0:t.promote)??((e=this._current)==null?void 0:e.promote)}get shouldShowEvaluation(){return this.isFailed||p(this.stageCreation)||p(this.stageBackfill)||p(this.stagePromote)}get evaluationStart(){var t,e,i,n,c,h;return((e=(t=this.stageCreation)==null?void 0:t.meta)==null?void 0:e.start)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.start)??((h=(c=this.stagePromote)==null?void 0:c.meta)==null?void 0:h.start)}get evaluationEnd(){var t,e,i,n,c,h;return((e=(t=this.stagePromote)==null?void 0:t.meta)==null?void 0:e.end)??((n=(i=this.stageBackfill)==null?void 0:i.meta)==null?void 0:n.end)??((h=(c=this.stageCreation)==null?void 0:c.meta)==null?void 0:h.end)}update(t,e){var m,y,A,g,M,T,E;const{creation:i,restate:n,backfill:c,promote:h,meta:d,environment:_}=t,B=l(d)||l(_)?void 0:t;if(l(B)){this._current=void 0;return}l(this._current)&&(this._current=t),this._current.start=t.start,this._current.end=t.end,this._current.meta=t.meta,this._current.environment=t.environment,this._current.plan_options=t.plan_options,p(i)&&(l(this._current.creation)||v((m=this._current.creation.meta)==null?void 0:m.done))&&(this._current.creation=i),p(n)&&(l(this._current.restate)||v((y=this._current.restate.meta)==null?void 0:y.done))&&(this._current.restate=n),p(c)&&(l(this._current.backfill)||v((A=this._current.backfill.meta)==null?void 0:A.done))&&(this._current.backfill=c),p(h)&&(l(this._current.promote)||v((g=this._current.promote.meta)==null?void 0:g.done))&&(this._current.promote=h),R((T=(M=this.current)==null?void 0:M.meta)==null?void 0:T.done)&&l(this._last)?(this._last=this._current,this._lastPlanOverview=this._planOverview,this._current=void 0,this._planOverview=void 0):this._planOverview=p(d)&&p(_)?e==null?void 0:e.clone():void 0,this.isFetching=f((E=t.meta)==null?void 0:E.done)}reset(){this._current=void 0,this._planOverview=void 0}clear(){this._current=void 0,this._last=void 0,this._planOverview=void 0,this._lastPlanOverview=void 0}clone(){var e;const t=new k;return p(this.current)&&t.update(structuredClone(this.current),(e=this.overview)==null?void 0:e.clone()),t}}class b extends U{get cancel(){var r;return(r=this._current)==null?void 0:r.cancel}get isCancelling(){var r,t,e,i;return v((t=(r=this.current)==null?void 0:r.meta)==null?void 0:t.done)&&((i=(e=this.current)==null?void 0:e.meta)==null?void 0:i.status)===w.init||this.isFetching}update(r){var t;this._current=r,this.isFetching=f((t=r.meta)==null?void 0:t.done)}}class C extends U{constructor(t){super(t);a(this,"_added",[]);a(this,"_removed",[]);a(this,"_direct",[]);a(this,"_indirect",[]);a(this,"_metadata",[]);a(this,"_backfills",[]);p(t)&&t.isModel&&(this._added=t.added,this._removed=t.removed,this._direct=t.direct,this._indirect=t.indirect,this._metadata=t.metadata,this._backfills=t.backfills)}get stageValidation(){var t;return(t=this._current)==null?void 0:t.validation}get stageChanges(){var t;return(t=this._current)==null?void 0:t.changes}get stageBackfills(){var t;return(t=this._current)==null?void 0:t.backfills}get validation(){var t;return(t=this._current)==null?void 0:t.validation}get hasChanges(){var d;if(l((d=this._current)==null?void 0:d.changes))return;const{added:t,removed:e,modified:i}=this._current.changes??{};if([t,e,i].every(l))return;const{direct:n,indirect:c,metadata:h}=i??{};return[t,e,n,c,h].some(V)}get changes(){var t;return(t=this._current)==null?void 0:t.changes}get hasBackfills(){var t,e,i;return l((e=(t=this._current)==null?void 0:t.backfills)==null?void 0:e.models)?void 0:V((i=this._current.backfills)==null?void 0:i.models)}get hasUpdates(){return R(this.hasChanges)||R(this.hasBackfills)}get backfills(){return this._backfills}get added(){return this._added}get removed(){return this._removed}get direct(){return this._direct}get indirect(){return this._indirect}get metadata(){return this._metadata}get isVirtualUpdate(){return p(this.hasChanges)&&l(this.hasBackfills)||!!this.hasChanges&&this.skipBackfill}get isMetadataUpdate(){var t;return!!((t=this.metadata)!=null&&t.length)&&l(this.hasBackfills)}get isBackfillUpdate(){return v(this.hasChanges)&&!!this.hasBackfills&&f(this.skipBackfill)}get isChangesAndBackfillUpdate(){return!!this.hasChanges&&!!this.hasBackfills&&f(this.skipBackfill)}get isLatest(){return this.isFinished&&l(this.hasChanges)&&(l(this.hasBackfills)||this.skipBackfill)}get skipTests(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_tests)??!1}get skipBackfill(){var t,e;return((e=(t=this._current)==null?void 0:t.plan_options)==null?void 0:e.skip_backfill)??!1}update(t){var c,h,d,_,P,B,m,y,A;this._current=t,this.isFetching=f((c=t.meta)==null?void 0:c.done);const e=((h=this._current)==null?void 0:h.changes)??{},i=(e==null?void 0:e.modified)??{},n=((d=this._current)==null?void 0:d.backfills)??{};this._added=((_=e.added)==null?void 0:_.map(g=>new o(g)))??[],this._removed=((P=e.removed)==null?void 0:P.map(g=>new o(g)))??[],this._direct=((B=i.direct)==null?void 0:B.map(g=>new o(g)))??[],this._indirect=((m=i.indirect)==null?void 0:m.map(g=>new o(g)))??[],this._metadata=((y=i.metadata)==null?void 0:y.map(g=>new o(g)))??[],this._backfills=((A=n.models)==null?void 0:A.map(g=>new o(g)))??[]}clone(){const t=new C;return p(this.current)&&t.update(structuredClone(this.current)),t}}const G=x((u,r)=>({planAction:new O,planOverview:new C,planApply:new k,planCancel:new b,setPlanAction:t=>{u(()=>({planAction:new O(t)}))},setPlanApply:t=>{u(()=>({planApply:new k(t)}))},setPlanOverview:t=>{u(()=>({planOverview:new C(t)}))},setPlanCancel:t=>{u(()=>({planCancel:new b(t)}))},resetPlanTrackers:()=>{const t=r();t.planApply.reset(),t.planCancel.reset(),t.planOverview.reset(),u(()=>({planApply:new k(t.planApply),planCancel:new b(t.planCancel),planOverview:new C(t.planOverview)}))},resetPlanCancel:()=>{const t=r();t.planCancel.reset(),u(()=>({planCancel:new b(t.planCancel)}))},clearPlanApply:()=>{const t=r();t.planApply.clear(),u(()=>({planApply:new k(t.planApply)}))}}));export{s as E,C as M,O as a,G as u};
@@ -1 +1 @@
1
- var n=Object.defineProperty;var d=(i,t,e)=>t in i?n(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var c=(i,t,e)=>d(i,typeof t!="symbol"?t+"":t,e);import{a,M as f}from"./file-CcK5Oobc.js";import{b as p,a1 as u}from"./index-KZcJd7F1.js";class h extends a{constructor(e,s){super(e!=null&&e.isModel?e.initial:{...e,directories:(e==null?void 0:e.directories)??[],files:(e==null?void 0:e.files)??[]},s);c(this,"_isOpen",!1);c(this,"directories",[]);c(this,"files",[]);c(this,"syncStateOpen");e!=null&&e.isModel?(this.directories=e.directories,this.files=e.files):this.update({files:this.initial.files,directories:this.initial.directories})}get level(){var e;return(((e=this.parent)==null?void 0:e.level)??-1)+1}get isChanged(){return this.name!==this.initial.name||this.files.some(e=>e.isChanged)||this.directories.some(e=>e.isChanged)}get isEmpty(){return this.directories.length===0&&this.files.length===0}get withFiles(){return this.files.length>0}get withDirectories(){return this.directories.length>0}get isNotEmpty(){return this.withFiles||this.withDirectories}get artifacts(){return this.directories.concat(this.files)}get allDirectories(){return this.directories.concat(this.directories.map(e=>e.allDirectories).flat(100))}get allFiles(){return this.files.concat(this.allDirectories.map(e=>e.files).flat(100))}get allVisibleArtifacts(){return this.directories.map(e=>e.isOpened?[e,e.allVisibleArtifacts]:[e]).flat(100).concat(this.isOpened?this.files:[])}get allArtifacts(){return this.directories.map(e=>[e,e.allArtifacts]).flat(100).concat(this.files)}get isOpened(){return this._isOpen}get isClosed(){return p(this._isOpen)}get isModels(){return this.path.startsWith("models")}get isTests(){return this.path.startsWith("tests")}open(){var e;this._isOpen=!0,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}close(){var e;this._isOpen=!1,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}toggle(){this.isOpened?this.close():this.open()}expand(){this.open(),this.directories.forEach(e=>{e.expand()})}collapse(){this.close(),this.directories.forEach(e=>{e.collapse()})}containsName(e){return this.artifacts.some(s=>s.name===e)}hasFile(e){return this.allFiles.includes(e)}hasDirectory(e){return this.allDirectories.includes(e)}addFile(e){this.files.push(e),e.parent=this}addDirectory(e){this.directories.push(e),e.parent=this}removeFile(e){this.files=this.files.filter(s=>s!==e)}removeDirectory(e){this.directories=this.directories.filter(s=>s!==e)}update({files:e=[],directories:s=[]}){this.files=[],this.directories=[],s.forEach(r=>{this.addDirectory(new h(r,this))}),e.forEach(r=>{this.addFile(new f(r,this))})}}const O=u((i,t)=>({tests:void 0,project:new h,selectedFile:void 0,files:new Map,activeRange:[],setTests(e){i(()=>({tests:e}))},setActiveRange(e){const s=t();i(()=>({activeRange:s.project.allVisibleArtifacts.filter(r=>o(r,e??s.activeRange))}))},inActiveRange(e){const s=t();return o(e,s.activeRange)},setProject(e){i(()=>({project:e}))},setFiles(e){const s=t();s.files.clear(),i(()=>({files:new Map(e.reduce((r,l)=>r.set(l.id,l),s.files))}))},setSelectedFile(e){i(()=>({selectedFile:e}))},findArtifactByPath(e){const s=t();return a.findArtifactByPath(s.project,e)},refreshFiles(e){const s=t();s.setFiles(e??s.project.allFiles)}}));function o(i,t){return t.includes(i)}export{h as M,O as u};
1
+ var n=Object.defineProperty;var d=(i,t,e)=>t in i?n(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var c=(i,t,e)=>d(i,typeof t!="symbol"?t+"":t,e);import{a,M as f}from"./file-Bs2Eq56_.js";import{b as p,a1 as u}from"./index-CkIQhGgw.js";class h extends a{constructor(e,s){super(e!=null&&e.isModel?e.initial:{...e,directories:(e==null?void 0:e.directories)??[],files:(e==null?void 0:e.files)??[]},s);c(this,"_isOpen",!1);c(this,"directories",[]);c(this,"files",[]);c(this,"syncStateOpen");e!=null&&e.isModel?(this.directories=e.directories,this.files=e.files):this.update({files:this.initial.files,directories:this.initial.directories})}get level(){var e;return(((e=this.parent)==null?void 0:e.level)??-1)+1}get isChanged(){return this.name!==this.initial.name||this.files.some(e=>e.isChanged)||this.directories.some(e=>e.isChanged)}get isEmpty(){return this.directories.length===0&&this.files.length===0}get withFiles(){return this.files.length>0}get withDirectories(){return this.directories.length>0}get isNotEmpty(){return this.withFiles||this.withDirectories}get artifacts(){return this.directories.concat(this.files)}get allDirectories(){return this.directories.concat(this.directories.map(e=>e.allDirectories).flat(100))}get allFiles(){return this.files.concat(this.allDirectories.map(e=>e.files).flat(100))}get allVisibleArtifacts(){return this.directories.map(e=>e.isOpened?[e,e.allVisibleArtifacts]:[e]).flat(100).concat(this.isOpened?this.files:[])}get allArtifacts(){return this.directories.map(e=>[e,e.allArtifacts]).flat(100).concat(this.files)}get isOpened(){return this._isOpen}get isClosed(){return p(this._isOpen)}get isModels(){return this.path.startsWith("models")}get isTests(){return this.path.startsWith("tests")}open(){var e;this._isOpen=!0,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}close(){var e;this._isOpen=!1,(e=this.syncStateOpen)==null||e.call(this,this.isOpened)}toggle(){this.isOpened?this.close():this.open()}expand(){this.open(),this.directories.forEach(e=>{e.expand()})}collapse(){this.close(),this.directories.forEach(e=>{e.collapse()})}containsName(e){return this.artifacts.some(s=>s.name===e)}hasFile(e){return this.allFiles.includes(e)}hasDirectory(e){return this.allDirectories.includes(e)}addFile(e){this.files.push(e),e.parent=this}addDirectory(e){this.directories.push(e),e.parent=this}removeFile(e){this.files=this.files.filter(s=>s!==e)}removeDirectory(e){this.directories=this.directories.filter(s=>s!==e)}update({files:e=[],directories:s=[]}){this.files=[],this.directories=[],s.forEach(r=>{this.addDirectory(new h(r,this))}),e.forEach(r=>{this.addFile(new f(r,this))})}}const O=u((i,t)=>({tests:void 0,project:new h,selectedFile:void 0,files:new Map,activeRange:[],setTests(e){i(()=>({tests:e}))},setActiveRange(e){const s=t();i(()=>({activeRange:s.project.allVisibleArtifacts.filter(r=>o(r,e??s.activeRange))}))},inActiveRange(e){const s=t();return o(e,s.activeRange)},setProject(e){i(()=>({project:e}))},setFiles(e){const s=t();s.files.clear(),i(()=>({files:new Map(e.reduce((r,l)=>r.set(l.id,l),s.files))}))},setSelectedFile(e){i(()=>({selectedFile:e}))},findArtifactByPath(e){const s=t();return a.findArtifactByPath(s.project,e)},refreshFiles(e){const s=t();s.setFiles(e??s.project.allFiles)}}));function o(i,t){return t.includes(i)}export{h as M,O as u};
@@ -1,4 +1,4 @@
1
- import{r as l,R as E,f as De}from"./index-KZcJd7F1.js";import{r as ot}from"./index-BdXOfeCo.js";var lt=Object.defineProperty,ut=(e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t,n)=>(ut(e,typeof t!="symbol"?t+"":t,n),n);let at=class{constructor(){Se(this,"current",this.detect()),Se(this,"handoffState","pending"),Se(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},W=new at,B=(e,t)=>{W.isServer?l.useEffect(e,t):l.useLayoutEffect(e,t)};function j(e){let t=l.useRef(e);return B(()=>{t.current=e},[e]),t}let P=function(e){let t=j(e);return E.useCallback((...n)=>t.current(...n),[t])};function Ue(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function le(){let e=[],t={addEventListener(n,r,u,a){return n.addEventListener(r,u,a),t.add(()=>n.removeEventListener(r,u,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ue(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,u){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:u}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=le();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let u of e.splice(r,1))u()}},dispose(){for(let n of e.splice(0))n()}};return t}function qe(){let[e]=l.useState(le);return l.useEffect(()=>()=>e.dispose(),[e]),e}function it(){let e=typeof document>"u";return"useSyncExternalStore"in De?(t=>t.useSyncExternalStore)(De)(()=>()=>{},()=>!1,()=>!e):!1}function ve(){let e=it(),[t,n]=l.useState(W.isHandoffComplete);return t&&W.isHandoffComplete===!1&&n(!1),l.useEffect(()=>{t!==!0&&n(!0)},[t]),l.useEffect(()=>W.handoff(),[]),e?!1:t}var He;let ne=(He=E.useId)!=null?He:function(){let e=ve(),[t,n]=E.useState(e?()=>W.nextId():null);return B(()=>{t===null&&n(W.nextId())},[t]),t!=null?""+t:void 0};function I(e,t,...n){if(e in t){let u=t[e];return typeof u=="function"?u(...n):u}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(u=>`"${u}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,I),r}function me(e){return W.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Fe=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var K=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(K||{}),fe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fe||{}),st=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(st||{});function se(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Fe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ce=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ce||{});function Oe(e,t=0){var n;return e===((n=me(e))==null?void 0:n.body)?!1:I(t,{0(){return e.matches(Fe)},1(){let r=e;for(;r!==null;){if(r.matches(Fe))return!0;r=r.parentElement}return!1}})}function Fn(e){let t=me(e);le().nextFrame(()=>{t&&!Oe(t.activeElement,0)&&dt(e)})}var ct=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ct||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function dt(e){e==null||e.focus({preventScroll:!0})}let ft=["textarea","input"].join(",");function pt(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ft))!=null?n:!1}function vt(e,t=n=>n){return e.slice().sort((n,r)=>{let u=t(n),a=t(r);if(u===null||a===null)return 0;let o=u.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function xn(e,t){return J(se(),t,{relativeTo:e})}function J(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:u=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?vt(e):e:se(e);u.length>0&&o.length>1&&(o=o.filter(b=>!u.includes(b))),r=r??a.activeElement;let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=t&32?{preventScroll:!0}:{},s=0,d=o.length,f;do{if(s>=d||s+d<=0)return 0;let b=i+s;if(t&16)b=(b+d)%d;else{if(b<0)return 3;if(b>=d)return 1}f=o[b],f==null||f.focus(p),s+=c}while(f!==a.activeElement);return t&6&&pt(f)&&f.select(),2}function mt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ht(){return/Android/gi.test(window.navigator.userAgent)}function gt(){return mt()||ht()}function ce(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return document.addEventListener(e,u,n),()=>document.removeEventListener(e,u,n)},[e,n])}function Ge(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return window.addEventListener(e,u,n),()=>window.removeEventListener(e,u,n)},[e,n])}function bt(e,t,n=!0){let r=l.useRef(!1);l.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function u(o,c){if(!r.current||o.defaultPrevented)return;let i=c(o);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let p=function s(d){return typeof d=="function"?s(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(let s of p){if(s===null)continue;let d=s instanceof HTMLElement?s:s.current;if(d!=null&&d.contains(i)||o.composed&&o.composedPath().includes(d))return}return!Oe(i,Ce.Loose)&&i.tabIndex!==-1&&o.preventDefault(),t(o,i)}let a=l.useRef(null);ce("pointerdown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("mousedown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("click",o=>{gt()||a.current&&(u(o,()=>a.current),a.current=null)},!0),ce("touchend",o=>u(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Ge("blur",o=>u(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ue(...e){return l.useMemo(()=>me(...e),[...e])}function je(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Et(e,t){let[n,r]=l.useState(()=>je(e));return B(()=>{r(je(e))},[e.type,e.as]),B(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Ke=Symbol();function Ve(e,t=!0){return Object.assign(e,{[Ke]:t})}function U(...e){let t=l.useRef(e);l.useEffect(()=>{t.current=e},[e]);let n=P(r=>{for(let u of t.current)u!=null&&(typeof u=="function"?u(r):u.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Ke]))?void 0:n}function pe(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var re=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(re||{}),Z=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Z||{});function q({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:u,visible:a=!0,name:o,mergeRefs:c}){c=c??Pt;let i=We(t,e);if(a)return de(i,n,r,o,c);let p=u??0;if(p&2){let{static:s=!1,...d}=i;if(s)return de(d,n,r,o,c)}if(p&1){let{unmount:s=!0,...d}=i;return I(s?0:1,{0(){return null},1(){return de({...d,hidden:!0,style:{display:"none"}},n,r,o,c)}})}return de(i,n,r,o,c)}function de(e,t={},n,r,u){let{as:a=n,children:o,refName:c="ref",...i}=we(e,["unmount","static"]),p=e.ref!==void 0?{[c]:e.ref}:{},s=typeof o=="function"?o(t):o;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t));let d={};if(t){let f=!1,b=[];for(let[g,m]of Object.entries(t))typeof m=="boolean"&&(f=!0),m===!0&&b.push(g);f&&(d["data-headlessui-state"]=b.join(" "))}if(a===l.Fragment&&Object.keys(Be(i)).length>0){if(!l.isValidElement(s)||Array.isArray(s)&&s.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(i).map(m=>` - ${m}`).join(`
1
+ import{r as l,R as E,f as De}from"./index-CkIQhGgw.js";import{r as ot}from"./index-COQuzlwN.js";var lt=Object.defineProperty,ut=(e,t,n)=>t in e?lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t,n)=>(ut(e,typeof t!="symbol"?t+"":t,n),n);let at=class{constructor(){Se(this,"current",this.detect()),Se(this,"handoffState","pending"),Se(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},W=new at,B=(e,t)=>{W.isServer?l.useEffect(e,t):l.useLayoutEffect(e,t)};function j(e){let t=l.useRef(e);return B(()=>{t.current=e},[e]),t}let P=function(e){let t=j(e);return E.useCallback((...n)=>t.current(...n),[t])};function Ue(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function le(){let e=[],t={addEventListener(n,r,u,a){return n.addEventListener(r,u,a),t.add(()=>n.removeEventListener(r,u,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Ue(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,u){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:u}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=le();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let u of e.splice(r,1))u()}},dispose(){for(let n of e.splice(0))n()}};return t}function qe(){let[e]=l.useState(le);return l.useEffect(()=>()=>e.dispose(),[e]),e}function it(){let e=typeof document>"u";return"useSyncExternalStore"in De?(t=>t.useSyncExternalStore)(De)(()=>()=>{},()=>!1,()=>!e):!1}function ve(){let e=it(),[t,n]=l.useState(W.isHandoffComplete);return t&&W.isHandoffComplete===!1&&n(!1),l.useEffect(()=>{t!==!0&&n(!0)},[t]),l.useEffect(()=>W.handoff(),[]),e?!1:t}var He;let ne=(He=E.useId)!=null?He:function(){let e=ve(),[t,n]=E.useState(e?()=>W.nextId():null);return B(()=>{t===null&&n(W.nextId())},[t]),t!=null?""+t:void 0};function I(e,t,...n){if(e in t){let u=t[e];return typeof u=="function"?u(...n):u}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(u=>`"${u}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,I),r}function me(e){return W.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Fe=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var K=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(K||{}),fe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fe||{}),st=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(st||{});function se(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Fe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ce=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ce||{});function Oe(e,t=0){var n;return e===((n=me(e))==null?void 0:n.body)?!1:I(t,{0(){return e.matches(Fe)},1(){let r=e;for(;r!==null;){if(r.matches(Fe))return!0;r=r.parentElement}return!1}})}function Fn(e){let t=me(e);le().nextFrame(()=>{t&&!Oe(t.activeElement,0)&&dt(e)})}var ct=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ct||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function dt(e){e==null||e.focus({preventScroll:!0})}let ft=["textarea","input"].join(",");function pt(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ft))!=null?n:!1}function vt(e,t=n=>n){return e.slice().sort((n,r)=>{let u=t(n),a=t(r);if(u===null||a===null)return 0;let o=u.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function xn(e,t){return J(se(),t,{relativeTo:e})}function J(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:u=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?vt(e):e:se(e);u.length>0&&o.length>1&&(o=o.filter(b=>!u.includes(b))),r=r??a.activeElement;let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=t&32?{preventScroll:!0}:{},s=0,d=o.length,f;do{if(s>=d||s+d<=0)return 0;let b=i+s;if(t&16)b=(b+d)%d;else{if(b<0)return 3;if(b>=d)return 1}f=o[b],f==null||f.focus(p),s+=c}while(f!==a.activeElement);return t&6&&pt(f)&&f.select(),2}function mt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ht(){return/Android/gi.test(window.navigator.userAgent)}function gt(){return mt()||ht()}function ce(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return document.addEventListener(e,u,n),()=>document.removeEventListener(e,u,n)},[e,n])}function Ge(e,t,n){let r=j(t);l.useEffect(()=>{function u(a){r.current(a)}return window.addEventListener(e,u,n),()=>window.removeEventListener(e,u,n)},[e,n])}function bt(e,t,n=!0){let r=l.useRef(!1);l.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function u(o,c){if(!r.current||o.defaultPrevented)return;let i=c(o);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let p=function s(d){return typeof d=="function"?s(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(let s of p){if(s===null)continue;let d=s instanceof HTMLElement?s:s.current;if(d!=null&&d.contains(i)||o.composed&&o.composedPath().includes(d))return}return!Oe(i,Ce.Loose)&&i.tabIndex!==-1&&o.preventDefault(),t(o,i)}let a=l.useRef(null);ce("pointerdown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("mousedown",o=>{var c,i;r.current&&(a.current=((i=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:i[0])||o.target)},!0),ce("click",o=>{gt()||a.current&&(u(o,()=>a.current),a.current=null)},!0),ce("touchend",o=>u(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Ge("blur",o=>u(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ue(...e){return l.useMemo(()=>me(...e),[...e])}function je(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Et(e,t){let[n,r]=l.useState(()=>je(e));return B(()=>{r(je(e))},[e.type,e.as]),B(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Ke=Symbol();function Ve(e,t=!0){return Object.assign(e,{[Ke]:t})}function U(...e){let t=l.useRef(e);l.useEffect(()=>{t.current=e},[e]);let n=P(r=>{for(let u of t.current)u!=null&&(typeof u=="function"?u(r):u.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Ke]))?void 0:n}function pe(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var re=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(re||{}),Z=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Z||{});function q({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:u,visible:a=!0,name:o,mergeRefs:c}){c=c??Pt;let i=We(t,e);if(a)return de(i,n,r,o,c);let p=u??0;if(p&2){let{static:s=!1,...d}=i;if(s)return de(d,n,r,o,c)}if(p&1){let{unmount:s=!0,...d}=i;return I(s?0:1,{0(){return null},1(){return de({...d,hidden:!0,style:{display:"none"}},n,r,o,c)}})}return de(i,n,r,o,c)}function de(e,t={},n,r,u){let{as:a=n,children:o,refName:c="ref",...i}=we(e,["unmount","static"]),p=e.ref!==void 0?{[c]:e.ref}:{},s=typeof o=="function"?o(t):o;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t));let d={};if(t){let f=!1,b=[];for(let[g,m]of Object.entries(t))typeof m=="boolean"&&(f=!0),m===!0&&b.push(g);f&&(d["data-headlessui-state"]=b.join(" "))}if(a===l.Fragment&&Object.keys(Be(i)).length>0){if(!l.isValidElement(s)||Array.isArray(s)&&s.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(i).map(m=>` - ${m}`).join(`
2
2
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(m=>` - ${m}`).join(`
3
3
  `)].join(`
4
4
  `));let f=s.props,b=typeof(f==null?void 0:f.className)=="function"?(...m)=>pe(f==null?void 0:f.className(...m),i.className):pe(f==null?void 0:f.className,i.className),g=b?{className:b}:{};return l.cloneElement(s,Object.assign({},We(s.props,Be(we(i,["ref"]))),d,p,{ref:u(s.ref,p.ref)},g))}return l.createElement(a,Object.assign({},we(i,["ref"]),a!==l.Fragment&&p,a!==l.Fragment&&d),s)}function yt(){let e=l.useRef([]),t=l.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Pt(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function We(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let u in r)u.startsWith("on")&&typeof r[u]=="function"?(n[u]!=null||(n[u]=[]),n[u].push(r[u])):t[u]=r[u];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](u,...a){let o=n[r];for(let c of o){if((u instanceof Event||(u==null?void 0:u.nativeEvent)instanceof Event)&&u.defaultPrevented)return;c(u,...a)}}});return t}function _(e){var t;return Object.assign(l.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Be(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function we(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let St="div";var oe=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(oe||{});function wt(e,t){var n;let{features:r=1,...u}=e,a={ref:t,"aria-hidden":(r&2)===2?!0:(n=u["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return q({ourProps:a,theirProps:u,slot:{},defaultTag:St,name:"Hidden"})}let ie=_(wt),Ie=l.createContext(null);Ie.displayName="OpenClosedContext";var k=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(k||{});function he(){return l.useContext(Ie)}function ze({value:e,children:t}){return E.createElement(Ie.Provider,{value:e},t)}function Ye(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Tt(n)?!1:r}function Tt(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var X=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(X||{});function $t(e,t,n,r){let u=j(n);l.useEffect(()=>{e=e??window;function a(o){u.current(o)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}function Re(){let e=l.useRef(!1);return B(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ft(e){let t=P(e),n=l.useRef(!1);l.useEffect(()=>(n.current=!1,()=>{n.current=!0,Ue(()=>{n.current&&t()})}),[t])}var V=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(V||{});function Qe(){let e=l.useRef(0);return Ge("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}let Xe=l.createContext(!1);function xt(){return l.useContext(Xe)}function Nn(e){return E.createElement(Xe.Provider,{value:e.force},e.children)}function Nt(e){let t=xt(),n=l.useContext(Je),r=ue(e),[u,a]=l.useState(()=>{if(!t&&n!==null||W.isServer)return null;let o=r==null?void 0:r.getElementById("headlessui-portal-root");if(o)return o;if(r===null)return null;let c=r.createElement("div");return c.setAttribute("id","headlessui-portal-root"),r.body.appendChild(c)});return l.useEffect(()=>{u!==null&&(r!=null&&r.body.contains(u)||r==null||r.body.appendChild(u))},[u,r]),l.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),u}let Ct=l.Fragment;function Ot(e,t){let n=e,r=l.useRef(null),u=U(Ve(s=>{r.current=s}),t),a=ue(r),o=Nt(r),[c]=l.useState(()=>{var s;return W.isServer?null:(s=a==null?void 0:a.createElement("div"))!=null?s:null}),i=l.useContext(xe),p=ve();return B(()=>{!o||!c||o.contains(c)||(c.setAttribute("data-headlessui-portal",""),o.appendChild(c))},[o,c]),B(()=>{if(c&&i)return i.register(c)},[i,c]),Ft(()=>{var s;!o||!c||(c instanceof Node&&o.contains(c)&&o.removeChild(c),o.childNodes.length<=0&&((s=o.parentElement)==null||s.removeChild(o)))}),p?!o||!c?null:ot.createPortal(q({ourProps:{ref:u},theirProps:n,defaultTag:Ct,name:"Portal"}),c):null}let It=l.Fragment,Je=l.createContext(null);function Rt(e,t){let{target:n,...r}=e,u={ref:U(t)};return E.createElement(Je.Provider,{value:n},q({ourProps:u,theirProps:r,defaultTag:It,name:"Popover.Group"}))}let xe=l.createContext(null);function Mt(){let e=l.useContext(xe),t=l.useRef([]),n=P(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=P(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),u=l.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,l.useMemo(()=>function({children:a}){return E.createElement(xe.Provider,{value:u},a)},[u])]}let Lt=_(Ot),kt=_(Rt),Cn=Object.assign(Lt,{Group:kt});function At({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let u=l.useRef((r=n==null?void 0:n.current)!=null?r:null),a=ue(u),o=P(()=>{var c,i,p;let s=[];for(let d of e)d!==null&&(d instanceof HTMLElement?s.push(d):"current"in d&&d.current instanceof HTMLElement&&s.push(d.current));if(t!=null&&t.current)for(let d of t.current)s.push(d);for(let d of(c=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?c:[])d!==document.body&&d!==document.head&&d instanceof HTMLElement&&d.id!=="headlessui-portal-root"&&(d.contains(u.current)||d.contains((p=(i=u.current)==null?void 0:i.getRootNode())==null?void 0:p.host)||s.some(f=>d.contains(f))||s.push(d));return s});return{resolveContainers:o,contains:P(c=>o().some(i=>i.contains(c))),mainTreeNodeRef:u,MainTreeNode:l.useMemo(()=>function(){return n!=null?null:E.createElement(ie,{features:oe.Hidden,ref:u})},[u,n])}}function Dt(){let e=l.useRef(null);return{mainTreeNodeRef:e,MainTreeNode:l.useMemo(()=>function(){return E.createElement(ie,{features:oe.Hidden,ref:e})},[e])}}var Ht=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ht||{}),jt=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(jt||{});let Bt={0:e=>{let t={...e,popoverState:I(e.popoverState,{0:1,1:0})};return t.popoverState===0&&(t.__demoMode=!1),t},1(e){return e.popoverState===1?e:{...e,popoverState:1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Me=l.createContext(null);Me.displayName="PopoverContext";function ge(e){let t=l.useContext(Me);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ge),n}return t}let Le=l.createContext(null);Le.displayName="PopoverAPIContext";function ke(e){let t=l.useContext(Le);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ke),n}return t}let Ae=l.createContext(null);Ae.displayName="PopoverGroupContext";function Ze(){return l.useContext(Ae)}let be=l.createContext(null);be.displayName="PopoverPanelContext";function _t(){return l.useContext(be)}function Ut(e,t){return I(t.type,Bt,e,t)}let qt="div";function Gt(e,t){var n;let{__demoMode:r=!1,...u}=e,a=l.useRef(null),o=U(t,Ve(y=>{a.current=y})),c=l.useRef([]),i=l.useReducer(Ut,{__demoMode:r,popoverState:r?0:1,buttons:c,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:l.createRef(),afterPanelSentinel:l.createRef()}),[{popoverState:p,button:s,buttonId:d,panel:f,panelId:b,beforePanelSentinel:g,afterPanelSentinel:m},v]=i,S=ue((n=a.current)!=null?n:s),x=l.useMemo(()=>{if(!s||!f)return!1;for(let H of document.querySelectorAll("body > *"))if(Number(H==null?void 0:H.contains(s))^Number(H==null?void 0:H.contains(f)))return!0;let y=se(),L=y.indexOf(s),te=(L+y.length-1)%y.length,ee=(L+1)%y.length,G=y[te],ae=y[ee];return!f.contains(G)&&!f.contains(ae)},[s,f]),T=j(d),R=j(b),A=l.useMemo(()=>({buttonId:T,panelId:R,close:()=>v({type:1})}),[T,R,v]),C=Ze(),D=C==null?void 0:C.registerPopover,$=P(()=>{var y;return(y=C==null?void 0:C.isFocusWithinPopoverGroup())!=null?y:(S==null?void 0:S.activeElement)&&((s==null?void 0:s.contains(S.activeElement))||(f==null?void 0:f.contains(S.activeElement)))});l.useEffect(()=>D==null?void 0:D(A),[D,A]);let[N,F]=Mt(),h=At({mainTreeNodeRef:C==null?void 0:C.mainTreeNodeRef,portals:N,defaultContainers:[s,f]});$t(S==null?void 0:S.defaultView,"focus",y=>{var L,te,ee,G;y.target!==window&&y.target instanceof HTMLElement&&p===0&&($()||s&&f&&(h.contains(y.target)||(te=(L=g.current)==null?void 0:L.contains)!=null&&te.call(L,y.target)||(G=(ee=m.current)==null?void 0:ee.contains)!=null&&G.call(ee,y.target)||v({type:1})))},!0),bt(h.resolveContainers,(y,L)=>{v({type:1}),Oe(L,Ce.Loose)||(y.preventDefault(),s==null||s.focus())},p===0);let w=P(y=>{v({type:1});let L=y?y instanceof HTMLElement?y:"current"in y&&y.current instanceof HTMLElement?y.current:s:s;L==null||L.focus()}),O=l.useMemo(()=>({close:w,isPortalled:x}),[w,x]),M=l.useMemo(()=>({open:p===0,close:w}),[p,w]),z={ref:o};return E.createElement(be.Provider,{value:null},E.createElement(Me.Provider,{value:i},E.createElement(Le.Provider,{value:O},E.createElement(ze,{value:I(p,{0:k.Open,1:k.Closed})},E.createElement(F,null,q({ourProps:z,theirProps:u,slot:M,defaultTag:qt,name:"Popover"}),E.createElement(h.MainTreeNode,null))))))}let Kt="button";function Vt(e,t){let n=ne(),{id:r=`headlessui-popover-button-${n}`,...u}=e,[a,o]=ge("Popover.Button"),{isPortalled:c}=ke("Popover.Button"),i=l.useRef(null),p=`headlessui-focus-sentinel-${ne()}`,s=Ze(),d=s==null?void 0:s.closeOthers,f=_t()!==null;l.useEffect(()=>{if(!f)return o({type:3,buttonId:r}),()=>{o({type:3,buttonId:null})}},[f,r,o]);let[b]=l.useState(()=>Symbol()),g=U(i,t,f?null:h=>{if(h)a.buttons.current.push(b);else{let w=a.buttons.current.indexOf(b);w!==-1&&a.buttons.current.splice(w,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),h&&o({type:2,button:h})}),m=U(i,t),v=ue(i),S=P(h=>{var w,O,M;if(f){if(a.popoverState===1)return;switch(h.key){case X.Space:case X.Enter:h.preventDefault(),(O=(w=h.target).click)==null||O.call(w),o({type:1}),(M=a.button)==null||M.focus();break}}else switch(h.key){case X.Space:case X.Enter:h.preventDefault(),h.stopPropagation(),a.popoverState===1&&(d==null||d(a.buttonId)),o({type:0});break;case X.Escape:if(a.popoverState!==0)return d==null?void 0:d(a.buttonId);if(!i.current||v!=null&&v.activeElement&&!i.current.contains(v.activeElement))return;h.preventDefault(),h.stopPropagation(),o({type:1});break}}),x=P(h=>{f||h.key===X.Space&&h.preventDefault()}),T=P(h=>{var w,O;Ye(h.currentTarget)||e.disabled||(f?(o({type:1}),(w=a.button)==null||w.focus()):(h.preventDefault(),h.stopPropagation(),a.popoverState===1&&(d==null||d(a.buttonId)),o({type:0}),(O=a.button)==null||O.focus()))}),R=P(h=>{h.preventDefault(),h.stopPropagation()}),A=a.popoverState===0,C=l.useMemo(()=>({open:A}),[A]),D=Et(e,i),$=f?{ref:m,type:D,onKeyDown:S,onClick:T}:{ref:g,id:a.buttonId,type:D,"aria-expanded":a.popoverState===0,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:S,onKeyUp:x,onClick:T,onMouseDown:R},N=Qe(),F=P(()=>{let h=a.panel;if(!h)return;function w(){I(N.current,{[V.Forwards]:()=>J(h,K.First),[V.Backwards]:()=>J(h,K.Last)})===fe.Error&&J(se().filter(O=>O.dataset.headlessuiFocusGuard!=="true"),I(N.current,{[V.Forwards]:K.Next,[V.Backwards]:K.Previous}),{relativeTo:a.button})}w()});return E.createElement(E.Fragment,null,q({ourProps:$,theirProps:u,slot:C,defaultTag:Kt,name:"Popover.Button"}),A&&!f&&c&&E.createElement(ie,{id:p,features:oe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:F}))}let Wt="div",zt=re.RenderStrategy|re.Static;function Yt(e,t){let n=ne(),{id:r=`headlessui-popover-overlay-${n}`,...u}=e,[{popoverState:a},o]=ge("Popover.Overlay"),c=U(t),i=he(),p=i!==null?(i&k.Open)===k.Open:a===0,s=P(f=>{if(Ye(f.currentTarget))return f.preventDefault();o({type:1})}),d=l.useMemo(()=>({open:a===0}),[a]);return q({ourProps:{ref:c,id:r,"aria-hidden":!0,onClick:s},theirProps:u,slot:d,defaultTag:Wt,features:zt,visible:p,name:"Popover.Overlay"})}let Qt="div",Xt=re.RenderStrategy|re.Static;function Jt(e,t){let n=ne(),{id:r=`headlessui-popover-panel-${n}`,focus:u=!1,...a}=e,[o,c]=ge("Popover.Panel"),{close:i,isPortalled:p}=ke("Popover.Panel"),s=`headlessui-focus-sentinel-before-${ne()}`,d=`headlessui-focus-sentinel-after-${ne()}`,f=l.useRef(null),b=U(f,t,$=>{c({type:4,panel:$})}),g=ue(f),m=yt();B(()=>(c({type:5,panelId:r}),()=>{c({type:5,panelId:null})}),[r,c]);let v=he(),S=v!==null?(v&k.Open)===k.Open:o.popoverState===0,x=P($=>{var N;switch($.key){case X.Escape:if(o.popoverState!==0||!f.current||g!=null&&g.activeElement&&!f.current.contains(g.activeElement))return;$.preventDefault(),$.stopPropagation(),c({type:1}),(N=o.button)==null||N.focus();break}});l.useEffect(()=>{var $;e.static||o.popoverState===1&&(($=e.unmount)==null||$)&&c({type:4,panel:null})},[o.popoverState,e.unmount,e.static,c]),l.useEffect(()=>{if(o.__demoMode||!u||o.popoverState!==0||!f.current)return;let $=g==null?void 0:g.activeElement;f.current.contains($)||J(f.current,K.First)},[o.__demoMode,u,f,o.popoverState]);let T=l.useMemo(()=>({open:o.popoverState===0,close:i}),[o,i]),R={ref:b,id:r,onKeyDown:x,onBlur:u&&o.popoverState===0?$=>{var N,F,h,w,O;let M=$.relatedTarget;M&&f.current&&((N=f.current)!=null&&N.contains(M)||(c({type:1}),((h=(F=o.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&h.call(F,M)||(O=(w=o.afterPanelSentinel.current)==null?void 0:w.contains)!=null&&O.call(w,M))&&M.focus({preventScroll:!0})))}:void 0,tabIndex:-1},A=Qe(),C=P(()=>{let $=f.current;if(!$)return;function N(){I(A.current,{[V.Forwards]:()=>{var F;J($,K.First)===fe.Error&&((F=o.afterPanelSentinel.current)==null||F.focus())},[V.Backwards]:()=>{var F;(F=o.button)==null||F.focus({preventScroll:!0})}})}N()}),D=P(()=>{let $=f.current;if(!$)return;function N(){I(A.current,{[V.Forwards]:()=>{var F;if(!o.button)return;let h=se(),w=h.indexOf(o.button),O=h.slice(0,w+1),M=[...h.slice(w+1),...O];for(let z of M.slice())if(z.dataset.headlessuiFocusGuard==="true"||(F=o.panel)!=null&&F.contains(z)){let y=M.indexOf(z);y!==-1&&M.splice(y,1)}J(M,K.First,{sorted:!1})},[V.Backwards]:()=>{var F;J($,K.Previous)===fe.Error&&((F=o.button)==null||F.focus())}})}N()});return E.createElement(be.Provider,{value:r},S&&p&&E.createElement(ie,{id:s,ref:o.beforePanelSentinel,features:oe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:C}),q({mergeRefs:m,ourProps:R,theirProps:a,slot:T,defaultTag:Qt,features:Xt,visible:S,name:"Popover.Panel"}),S&&p&&E.createElement(ie,{id:d,ref:o.afterPanelSentinel,features:oe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:D}))}let Zt="div";function en(e,t){let n=l.useRef(null),r=U(n,t),[u,a]=l.useState([]),o=Dt(),c=P(m=>{a(v=>{let S=v.indexOf(m);if(S!==-1){let x=v.slice();return x.splice(S,1),x}return v})}),i=P(m=>(a(v=>[...v,m]),()=>c(m))),p=P(()=>{var m;let v=me(n);if(!v)return!1;let S=v.activeElement;return(m=n.current)!=null&&m.contains(S)?!0:u.some(x=>{var T,R;return((T=v.getElementById(x.buttonId.current))==null?void 0:T.contains(S))||((R=v.getElementById(x.panelId.current))==null?void 0:R.contains(S))})}),s=P(m=>{for(let v of u)v.buttonId.current!==m&&v.close()}),d=l.useMemo(()=>({registerPopover:i,unregisterPopover:c,isFocusWithinPopoverGroup:p,closeOthers:s,mainTreeNodeRef:o.mainTreeNodeRef}),[i,c,p,s,o.mainTreeNodeRef]),f=l.useMemo(()=>({}),[]),b=e,g={ref:r};return E.createElement(Ae.Provider,{value:d},q({ourProps:g,theirProps:b,slot:f,defaultTag:Zt,name:"Popover.Group"}),E.createElement(o.MainTreeNode,null))}let tn=_(Gt),nn=_(Vt),rn=_(Yt),on=_(Jt),ln=_(en),On=Object.assign(tn,{Button:nn,Overlay:rn,Panel:on,Group:ln});function un(e=0){let[t,n]=l.useState(e),r=Re(),u=l.useCallback(i=>{r.current&&n(p=>p|i)},[t,r]),a=l.useCallback(i=>!!(t&i),[t]),o=l.useCallback(i=>{r.current&&n(p=>p&~i)},[n,r]),c=l.useCallback(i=>{r.current&&n(p=>p^i)},[n]);return{flags:t,addFlag:u,hasFlag:a,removeFlag:o,toggleFlag:c}}function an(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Te(e,...t){e&&t.length>0&&e.classList.add(...t)}function $e(e,...t){e&&t.length>0&&e.classList.remove(...t)}function sn(e,t){let n=le();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:u}=getComputedStyle(e),[a,o]=[r,u].map(i=>{let[p=0]=i.split(",").filter(Boolean).map(s=>s.includes("ms")?parseFloat(s):parseFloat(s)*1e3).sort((s,d)=>d-s);return p}),c=a+o;if(c!==0){n.group(p=>{p.setTimeout(()=>{t(),p.dispose()},c),p.addEventListener(e,"transitionrun",s=>{s.target===s.currentTarget&&p.dispose()})});let i=n.addEventListener(e,"transitionend",p=>{p.target===p.currentTarget&&(t(),i())})}else t();return n.add(()=>t()),n.dispose}function cn(e,t,n,r){let u=n?"enter":"leave",a=le(),o=r!==void 0?an(r):()=>{};u==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let c=I(u,{enter:()=>t.enter,leave:()=>t.leave}),i=I(u,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),p=I(u,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return $e(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Te(e,...t.base,...c,...p),a.nextFrame(()=>{$e(e,...t.base,...c,...p),Te(e,...t.base,...c,...i),sn(e,()=>($e(e,...t.base,...c),Te(e,...t.base,...t.entered),o()))}),a.dispose}function dn({immediate:e,container:t,direction:n,classes:r,onStart:u,onStop:a}){let o=Re(),c=qe(),i=j(n);B(()=>{e&&(i.current="enter")},[e]),B(()=>{let p=le();c.add(p.dispose);let s=t.current;if(s&&i.current!=="idle"&&o.current)return p.dispose(),u.current(i.current),p.add(cn(s,r.current,i.current==="enter",()=>{p.dispose(),a.current(i.current)})),p.dispose},[n])}function Q(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Ee=l.createContext(null);Ee.displayName="TransitionContext";var fn=(e=>(e.Visible="visible",e.Hidden="hidden",e))(fn||{});function pn(){let e=l.useContext(Ee);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function vn(){let e=l.useContext(ye);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let ye=l.createContext(null);ye.displayName="NestingContext";function Pe(e){return"children"in e?Pe(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function et(e,t){let n=j(e),r=l.useRef([]),u=Re(),a=qe(),o=P((b,g=Z.Hidden)=>{let m=r.current.findIndex(({el:v})=>v===b);m!==-1&&(I(g,{[Z.Unmount](){r.current.splice(m,1)},[Z.Hidden](){r.current[m].state="hidden"}}),a.microTask(()=>{var v;!Pe(r)&&u.current&&((v=n.current)==null||v.call(n))}))}),c=P(b=>{let g=r.current.find(({el:m})=>m===b);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:b,state:"visible"}),()=>o(b,Z.Unmount)}),i=l.useRef([]),p=l.useRef(Promise.resolve()),s=l.useRef({enter:[],leave:[],idle:[]}),d=P((b,g,m)=>{i.current.splice(0),t&&(t.chains.current[g]=t.chains.current[g].filter(([v])=>v!==b)),t==null||t.chains.current[g].push([b,new Promise(v=>{i.current.push(v)})]),t==null||t.chains.current[g].push([b,new Promise(v=>{Promise.all(s.current[g].map(([S,x])=>x)).then(()=>v())})]),g==="enter"?p.current=p.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(g)):m(g)}),f=P((b,g,m)=>{Promise.all(s.current[g].splice(0).map(([v,S])=>S)).then(()=>{var v;(v=i.current.shift())==null||v()}).then(()=>m(g))});return l.useMemo(()=>({children:r,register:c,unregister:o,onStart:d,onStop:f,wait:p,chains:s}),[c,o,r,d,f,s,p])}function mn(){}let hn=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function _e(e){var t;let n={};for(let r of hn)n[r]=(t=e[r])!=null?t:mn;return n}function gn(e){let t=l.useRef(_e(e));return l.useEffect(()=>{t.current=_e(e)},[e]),t}let bn="div",tt=re.RenderStrategy;function En(e,t){var n,r;let{beforeEnter:u,afterEnter:a,beforeLeave:o,afterLeave:c,enter:i,enterFrom:p,enterTo:s,entered:d,leave:f,leaveFrom:b,leaveTo:g,...m}=e,v=l.useRef(null),S=U(v,t),x=(n=m.unmount)==null||n?Z.Unmount:Z.Hidden,{show:T,appear:R,initial:A}=pn(),[C,D]=l.useState(T?"visible":"hidden"),$=vn(),{register:N,unregister:F}=$;l.useEffect(()=>N(v),[N,v]),l.useEffect(()=>{if(x===Z.Hidden&&v.current){if(T&&C!=="visible"){D("visible");return}return I(C,{hidden:()=>F(v),visible:()=>N(v)})}},[C,v,N,F,T,x]);let h=j({base:Q(m.className),enter:Q(i),enterFrom:Q(p),enterTo:Q(s),entered:Q(d),leave:Q(f),leaveFrom:Q(b),leaveTo:Q(g)}),w=gn({beforeEnter:u,afterEnter:a,beforeLeave:o,afterLeave:c}),O=ve();l.useEffect(()=>{if(O&&C==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,C,O]);let M=A&&!R,z=R&&T&&A,y=!O||M?"idle":T?"enter":"leave",L=un(0),te=P(Y=>I(Y,{enter:()=>{L.addFlag(k.Opening),w.current.beforeEnter()},leave:()=>{L.addFlag(k.Closing),w.current.beforeLeave()},idle:()=>{}})),ee=P(Y=>I(Y,{enter:()=>{L.removeFlag(k.Opening),w.current.afterEnter()},leave:()=>{L.removeFlag(k.Closing),w.current.afterLeave()},idle:()=>{}})),G=et(()=>{D("hidden"),F(v)},$),ae=l.useRef(!1);dn({immediate:z,container:v,classes:h,direction:y,onStart:j(Y=>{ae.current=!0,G.onStart(v,Y,te)}),onStop:j(Y=>{ae.current=!1,G.onStop(v,Y,ee),Y==="leave"&&!Pe(G)&&(D("hidden"),F(v))})});let H=m,rt={ref:S};return z?H={...H,className:pe(m.className,...h.current.enter,...h.current.enterFrom)}:ae.current&&(H.className=pe(m.className,(r=v.current)==null?void 0:r.className),H.className===""&&delete H.className),E.createElement(ye.Provider,{value:G},E.createElement(ze,{value:I(C,{visible:k.Open,hidden:k.Closed})|L.flags},q({ourProps:rt,theirProps:H,defaultTag:bn,features:tt,visible:C==="visible",name:"Transition.Child"})))}function yn(e,t){let{show:n,appear:r=!1,unmount:u=!0,...a}=e,o=l.useRef(null),c=U(o,t);ve();let i=he();if(n===void 0&&i!==null&&(n=(i&k.Open)===k.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[p,s]=l.useState(n?"visible":"hidden"),d=et(()=>{s("hidden")}),[f,b]=l.useState(!0),g=l.useRef([n]);B(()=>{f!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),b(!1))},[g,n]);let m=l.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);l.useEffect(()=>{if(n)s("visible");else if(!Pe(d))s("hidden");else{let T=o.current;if(!T)return;let R=T.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&s("hidden")}},[n,d]);let v={unmount:u},S=P(()=>{var T;f&&b(!1),(T=e.beforeEnter)==null||T.call(e)}),x=P(()=>{var T;f&&b(!1),(T=e.beforeLeave)==null||T.call(e)});return E.createElement(ye.Provider,{value:d},E.createElement(Ee.Provider,{value:m},q({ourProps:{...v,as:l.Fragment,children:E.createElement(nt,{ref:c,...v,...a,beforeEnter:S,beforeLeave:x})},theirProps:{},defaultTag:l.Fragment,features:tt,visible:p==="visible",name:"Transition"})))}function Pn(e,t){let n=l.useContext(Ee)!==null,r=he()!==null;return E.createElement(E.Fragment,null,!n&&r?E.createElement(Ne,{ref:t,...e}):E.createElement(nt,{ref:t,...e}))}let Ne=_(yn),nt=_(En),Sn=_(Pn),In=Object.assign(Ne,{Child:Sn,Root:Ne});export{Ye as A,On as B,q as C,In as D,$t as E,Be as F,me as G,ze as H,ne as I,Oe as J,Ce as K,Fn as L,K as M,fe as N,J as O,vt as P,un as Q,j as R,Ve as S,Et as T,_ as U,yt as V,xn as _,Qe as a,ie as b,oe as c,Ft as d,dt as e,Re as f,mt as g,le as h,B as i,he as j,k,ve as l,Mt as m,ue as n,P as o,qe as p,At as q,bt as r,V as s,Ue as t,I as u,Nn as v,Cn as w,re as x,U as y,X as z};
@@ -231,7 +231,7 @@
231
231
  type="font/woff2"
232
232
  crossorigin="anonymous"
233
233
  />
234
- <script type="module" crossorigin src="/assets/index-KZcJd7F1.js"></script>
234
+ <script type="module" crossorigin src="/assets/index-CkIQhGgw.js"></script>
235
235
 
236
236
  </head>
237
237
 
@@ -1,5 +0,0 @@
1
- import{r as i,j as u,R as re,f as gn,ac as Zr,ad as pe,ae as Qr,a2 as Jr,c as L,W as hn,b as X,w as eo,h as to,a as no,A as ro,L as oo,S as so,m as io}from"./index-KZcJd7F1.js";import{u as k,M as lt}from"./project-CjyecwCx.js";import{r as ao,R as co}from"./index-BdXOfeCo.js";import{u as uo,o as lo,s as fo,f as go,a as ho,b as po,h as mo,l as vo,c as yo,d as Co,e as xo,z as So,g as bo,i as wo,R as Eo,j as Do,k as To}from"./Input-CYm3h-zG.js";import{M as Oo}from"./file-CcK5Oobc.js";import{useFileExplorer as Ge}from"./context-CzM900aY.js";import{u as pn,S as Io}from"./SearchList-9n_6_E0k.js";import{u as Qe}from"./editor-Bf9rhumO.js";import{F as Po}from"./ChevronDownIcon-BZk6URUK.js";import{F as Ro}from"./ChevronRightIcon-Ctcbr61G.js";import"./help-6Q7f7fjd.js";import"./transition-C8EjNcgL.js";function Mo({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625Z"}),i.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const No=i.forwardRef(Mo);function Ao({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z"}))}const _o=i.forwardRef(Ao);function jo({title:t,titleId:e,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?i.createElement("title",{id:e},t):null,i.createElement("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"}))}const Fo=i.forwardRef(jo);function P(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function Te(t,e=[]){let n=[];function r(s,a){const c=i.createContext(a),d=n.length;n=[...n,a];const l=h=>{var y;const{scope:g,children:m,...C}=h,p=((y=g==null?void 0:g[t])==null?void 0:y[d])||c,v=i.useMemo(()=>C,Object.values(C));return u.jsx(p.Provider,{value:v,children:m})};l.displayName=s+"Provider";function f(h,g){var p;const m=((p=g==null?void 0:g[t])==null?void 0:p[d])||c,C=i.useContext(m);if(C)return C;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[l,f]}const o=()=>{const s=n.map(a=>i.createContext(a));return function(c){const d=(c==null?void 0:c[t])||s;return i.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return o.scopeName=t,[r,Lo(o,...e)]}function Lo(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((c,{useScope:d,scopeName:l})=>{const h=d(s)[`__scope${l}`];return{...c,...h}},{});return i.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function Ut(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function mn(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Ut(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ut(t[o],null)}}}}function $(...t){return i.useCallback(mn(...t),t)}function He(t){const e=ko(t),n=i.forwardRef((r,o)=>{const{children:s,...a}=r,c=i.Children.toArray(s),d=c.find(Ho);if(d){const l=d.props.children,f=c.map(h=>h===d?i.Children.count(l)>1?i.Children.only(null):i.isValidElement(l)?l.props.children:null:h);return u.jsx(e,{...a,ref:o,children:i.isValidElement(l)?i.cloneElement(l,void 0,f):null})}return u.jsx(e,{...a,ref:o,children:s})});return n.displayName=`${t}.Slot`,n}function ko(t){const e=i.forwardRef((n,r)=>{const{children:o,...s}=n,a=i.isValidElement(o)?Bo(o):void 0,c=$(a,r);if(i.isValidElement(o)){const d=$o(s,o.props);return o.type!==i.Fragment&&(d.ref=c),i.cloneElement(o,d)}return i.Children.count(o)>1?i.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Uo=Symbol("radix.slottable");function Ho(t){return i.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Uo}function $o(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const d=s(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}function Bo(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Go=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],B=Go.reduce((t,e)=>{const n=He(`Primitive.${e}`),r=i.forwardRef((o,s)=>{const{asChild:a,...c}=o,d=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function vn(t,e){t&&ao.flushSync(()=>t.dispatchEvent(e))}function yn(t){const e=t+"CollectionProvider",[n,r]=Te(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:y}=p,w=re.useRef(null),b=re.useRef(new Map).current;return u.jsx(o,{scope:v,itemMap:b,collectionRef:w,children:y})};a.displayName=e;const c=t+"CollectionSlot",d=He(c),l=re.forwardRef((p,v)=>{const{scope:y,children:w}=p,b=s(c,y),E=$(v,b.collectionRef);return u.jsx(d,{ref:E,children:w})});l.displayName=c;const f=t+"CollectionItemSlot",h="data-radix-collection-item",g=He(f),m=re.forwardRef((p,v)=>{const{scope:y,children:w,...b}=p,E=re.useRef(null),I=$(v,E),R=s(f,y);return re.useEffect(()=>(R.itemMap.set(E,{ref:E,...b}),()=>void R.itemMap.delete(E))),u.jsx(g,{[h]:"",ref:I,children:w})});m.displayName=f;function C(p){const v=s(t+"CollectionConsumer",p);return re.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((R,T)=>b.indexOf(R.ref.current)-b.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:l,ItemSlot:m},C,r]}var Ko=i.createContext(void 0);function Cn(t){const e=i.useContext(Ko);return t||e||"ltr"}function J(t){const e=i.useRef(t);return i.useEffect(()=>{e.current=t}),i.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function Wo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t);i.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Vo="DismissableLayer",dt="dismissableLayer.update",Yo="dismissableLayer.pointerDownOutside",Xo="dismissableLayer.focusOutside",Ht,xn=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Sn=i.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...d}=t,l=i.useContext(xn),[f,h]=i.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=i.useState({}),C=$(e,T=>h(T)),p=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,I=Zo(T=>{const M=T.target,_=[...l.branches].some(F=>F.contains(M));!E||_||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},g),R=Qo(T=>{const M=T.target;[...l.branches].some(F=>F.contains(M))||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},g);return Wo(T=>{w===l.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),i.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ht=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),$t(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Ht)}},[f,g,n,l]),i.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),$t())},[f,l]),i.useEffect(()=>{const T=()=>m({});return document.addEventListener(dt,T),()=>document.removeEventListener(dt,T)},[]),u.jsx(B.div,{...d,ref:C,style:{pointerEvents:b?E?"auto":"none":void 0,...t.style},onFocusCapture:P(t.onFocusCapture,R.onFocusCapture),onBlurCapture:P(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:P(t.onPointerDownCapture,I.onPointerDownCapture)})});Sn.displayName=Vo;var zo="DismissableLayerBranch",qo=i.forwardRef((t,e)=>{const n=i.useContext(xn),r=i.useRef(null),o=$(e,r);return i.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(B.div,{...t,ref:o})});qo.displayName=zo;function Zo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let d=function(){bn(Yo,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=d,e.addEventListener("click",o.current,{once:!0})):d()}else e.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Qo(t,e=globalThis==null?void 0:globalThis.document){const n=J(t),r=i.useRef(!1);return i.useEffect(()=>{const o=s=>{s.target&&!r.current&&bn(Xo,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $t(){const t=new CustomEvent(dt);document.dispatchEvent(t)}function bn(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?vn(o,s):o.dispatchEvent(s)}var Je=0;function Jo(){i.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Bt()),document.body.insertAdjacentElement("beforeend",t[1]??Bt()),Je++,()=>{Je===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Je--}},[])}function Bt(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var et="focusScope.autoFocusOnMount",tt="focusScope.autoFocusOnUnmount",Gt={bubbles:!1,cancelable:!0},es="FocusScope",wn=i.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...a}=t,[c,d]=i.useState(null),l=J(o),f=J(s),h=i.useRef(null),g=$(e,p=>d(p)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let p=function(b){if(m.paused||!c)return;const E=b.target;c.contains(E)?h.current=E:oe(h.current,{select:!0})},v=function(b){if(m.paused||!c)return;const E=b.relatedTarget;E!==null&&(c.contains(E)||oe(h.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const I of b)I.removedNodes.length>0&&oe(c)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,c,m.paused]),i.useEffect(()=>{if(c){Wt.add(m);const p=document.activeElement;if(!c.contains(p)){const y=new CustomEvent(et,Gt);c.addEventListener(et,l),c.dispatchEvent(y),y.defaultPrevented||(ts(is(En(c)),{select:!0}),document.activeElement===p&&oe(c))}return()=>{c.removeEventListener(et,l),setTimeout(()=>{const y=new CustomEvent(tt,Gt);c.addEventListener(tt,f),c.dispatchEvent(y),y.defaultPrevented||oe(p??document.body,{select:!0}),c.removeEventListener(tt,f),Wt.remove(m)},0)}}},[c,l,f,m]);const C=i.useCallback(p=>{if(!n&&!r||m.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[b,E]=ns(w);b&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&oe(b,{select:!0})):p.shiftKey&&y===b&&(p.preventDefault(),n&&oe(E,{select:!0})):y===w&&p.preventDefault()}},[n,r,m.paused]);return u.jsx(B.div,{tabIndex:-1,...a,ref:g,onKeyDown:C})});wn.displayName=es;function ts(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(oe(r,{select:e}),document.activeElement!==n)return}function ns(t){const e=En(t),n=Kt(e,t),r=Kt(e.reverse(),t);return[n,r]}function En(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Kt(t,e){for(const n of t)if(!rs(n,{upTo:e}))return n}function rs(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function os(t){return t instanceof HTMLInputElement&&"select"in t}function oe(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&os(t)&&e&&t.select()}}var Wt=ss();function ss(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Vt(t,e),t.unshift(e)},remove(e){var n;t=Vt(t,e),(n=t[0])==null||n.resume()}}}function Vt(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function is(t){return t.filter(e=>e.tagName!=="A")}var se=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},as=gn[" useId ".trim().toString()]||(()=>{}),cs=0;function us(t){const[e,n]=i.useState(as());return se(()=>{n(r=>r??String(cs++))},[t]),e?`radix-${e}`:""}var ls="Arrow",Dn=i.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...s}=t;return u.jsx(B.svg,{...s,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dn.displayName=ls;var ds=Dn;function fs(t){const[e,n]=i.useState(void 0);return se(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,c;if("borderBoxSize"in s){const d=s.borderBoxSize,l=Array.isArray(d)?d[0]:d;a=l.inlineSize,c=l.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var xt="Popper",[Tn,On]=Te(xt),[gs,In]=Tn(xt),Pn=t=>{const{__scopePopper:e,children:n}=t,[r,o]=i.useState(null);return u.jsx(gs,{scope:e,anchor:r,onAnchorChange:o,children:n})};Pn.displayName=xt;var Rn="PopperAnchor",Mn=i.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,s=In(Rn,n),a=i.useRef(null),c=$(e,a);return i.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:u.jsx(B.div,{...o,ref:c})});Mn.displayName=Rn;var St="PopperContent",[hs,ps]=Tn(St),Nn=i.forwardRef((t,e)=>{var ne,ye,Y,Ce,Ft,Lt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:C,...p}=t,v=In(St,n),[y,w]=i.useState(null),b=$(e,xe=>w(xe)),[E,I]=i.useState(null),R=fs(E),T=(R==null?void 0:R.width)??0,M=(R==null?void 0:R.height)??0,_=r+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(l)?l:[l],A=D.length>0,K={padding:F,boundary:D.filter(vs),altBoundary:A},{refs:ee,floatingStyles:te,placement:V,isPositioned:U,middlewareData:S}=uo({strategy:"fixed",placement:_,whileElementsMounted:(...xe)=>yo(...xe,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[lo({mainAxis:o+M,alignmentAxis:a}),d&&fo({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vo():void 0,...K}),d&&go({...K}),ho({...K,apply:({elements:xe,rects:kt,availableWidth:Yr,availableHeight:Xr})=>{const{width:zr,height:qr}=kt.reference,Ne=xe.floating.style;Ne.setProperty("--radix-popper-available-width",`${Yr}px`),Ne.setProperty("--radix-popper-available-height",`${Xr}px`),Ne.setProperty("--radix-popper-anchor-width",`${zr}px`),Ne.setProperty("--radix-popper-anchor-height",`${qr}px`)}}),E&&po({element:E,padding:c}),ys({arrowWidth:T,arrowHeight:M}),g&&mo({strategy:"referenceHidden",...K})]}),[x,N]=jn(V),j=J(C);se(()=>{U&&(j==null||j())},[U,j]);const H=(ne=S.arrow)==null?void 0:ne.x,me=(ye=S.arrow)==null?void 0:ye.y,ve=((Y=S.arrow)==null?void 0:Y.centerOffset)!==0,[Me,ie]=i.useState();return se(()=>{y&&ie(window.getComputedStyle(y).zIndex)},[y]),u.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:U?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Me,"--radix-popper-transform-origin":[(Ce=S.transformOrigin)==null?void 0:Ce.x,(Ft=S.transformOrigin)==null?void 0:Ft.y].join(" "),...((Lt=S.hide)==null?void 0:Lt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:u.jsx(hs,{scope:n,placedSide:x,onArrowChange:I,arrowX:H,arrowY:me,shouldHideArrow:ve,children:u.jsx(B.div,{"data-side":x,"data-align":N,...p,ref:b,style:{...p.style,animation:U?void 0:"none"}})})})});Nn.displayName=St;var An="PopperArrow",ms={top:"bottom",right:"left",bottom:"top",left:"right"},_n=i.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,s=ps(An,r),a=ms[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(ds,{...o,ref:n,style:{...o.style,display:"block"}})})});_n.displayName=An;function vs(t){return t!==null}var ys=t=>({name:"transformOrigin",options:t,fn(e){var v,y,w;const{placement:n,rects:r,middlewareData:o}=e,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,c=a?0:t.arrowWidth,d=a?0:t.arrowHeight,[l,f]=jn(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(((y=o.arrow)==null?void 0:y.x)??0)+c/2,m=(((w=o.arrow)==null?void 0:w.y)??0)+d/2;let C="",p="";return l==="bottom"?(C=a?h:`${g}px`,p=`${-d}px`):l==="top"?(C=a?h:`${g}px`,p=`${r.floating.height+d}px`):l==="right"?(C=`${-d}px`,p=a?h:`${m}px`):l==="left"&&(C=`${r.floating.width+d}px`,p=a?h:`${m}px`),{data:{x:C,y:p}}}});function jn(t){const[e,n="center"]=t.split("-");return[e,n]}var Cs=Pn,xs=Mn,Ss=Nn,bs=_n,ws="Portal",Fn=i.forwardRef((t,e)=>{var c;const{container:n,...r}=t,[o,s]=i.useState(!1);se(()=>s(!0),[]);const a=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?co.createPortal(u.jsx(B.div,{...r,ref:e}),a):null});Fn.displayName=ws;function Es(t,e){return i.useReducer((n,r)=>e[n][r]??n,t)}var Oe=t=>{const{present:e,children:n}=t,r=Ds(e),o=typeof n=="function"?n({present:r.isPresent}):i.Children.only(n),s=$(r.ref,Ts(o));return typeof n=="function"||r.isPresent?i.cloneElement(o,{ref:s}):null};Oe.displayName="Presence";function Ds(t){const[e,n]=i.useState(),r=i.useRef(null),o=i.useRef(t),s=i.useRef("none"),a=t?"mounted":"unmounted",[c,d]=Es(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const l=Ae(r.current);s.current=c==="mounted"?l:"none"},[c]),se(()=>{const l=r.current,f=o.current;if(f!==t){const g=s.current,m=Ae(l);t?d("MOUNT"):m==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(f&&g!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),se(()=>{if(e){let l;const f=e.ownerDocument.defaultView??window,h=m=>{const p=Ae(r.current).includes(m.animationName);if(m.target===e&&p&&(d("ANIMATION_END"),!o.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",l=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},g=m=>{m.target===e&&(s.current=Ae(r.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(l),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Ae(t){return(t==null?void 0:t.animationName)||"none"}function Ts(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Os=gn[" useInsertionEffect ".trim().toString()]||se;function Is({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,s,a]=Ps({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:o;{const f=i.useRef(t!==void 0);i.useEffect(()=>{const h=f.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const l=i.useCallback(f=>{var h;if(c){const g=Rs(f)?f(t):f;g!==t&&((h=a.current)==null||h.call(a,g))}else s(f)},[c,t,s,a]);return[d,l]}function Ps({defaultProp:t,onChange:e}){const[n,r]=i.useState(t),o=i.useRef(n),s=i.useRef(e);return Os(()=>{s.current=e},[e]),i.useEffect(()=>{var a;o.current!==n&&((a=s.current)==null||a.call(s,n),o.current=n)},[n,o]),[n,r,s]}function Rs(t){return typeof t=="function"}var nt="rovingFocusGroup.onEntryFocus",Ms={bubbles:!1,cancelable:!0},Ie="RovingFocusGroup",[ft,Ln,Ns]=yn(Ie),[As,kn]=Te(Ie,[Ns]),[_s,js]=As(Ie),Un=i.forwardRef((t,e)=>u.jsx(ft.Provider,{scope:t.__scopeRovingFocusGroup,children:u.jsx(ft.Slot,{scope:t.__scopeRovingFocusGroup,children:u.jsx(Fs,{...t,ref:e})})}));Un.displayName=Ie;var Fs=i.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...h}=t,g=i.useRef(null),m=$(e,g),C=Cn(s),[p,v]=Is({prop:a,defaultProp:c??null,onChange:d,caller:Ie}),[y,w]=i.useState(!1),b=J(l),E=Ln(n),I=i.useRef(!1),[R,T]=i.useState(0);return i.useEffect(()=>{const M=g.current;if(M)return M.addEventListener(nt,b),()=>M.removeEventListener(nt,b)},[b]),u.jsx(_s,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:p,onItemFocus:i.useCallback(M=>v(M),[v]),onItemShiftTab:i.useCallback(()=>w(!0),[]),onFocusableItemAdd:i.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:i.useCallback(()=>T(M=>M-1),[]),children:u.jsx(B.div,{tabIndex:y||R===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:P(t.onMouseDown,()=>{I.current=!0}),onFocus:P(t.onFocus,M=>{const _=!I.current;if(M.target===M.currentTarget&&_&&!y){const F=new CustomEvent(nt,Ms);if(M.currentTarget.dispatchEvent(F),!F.defaultPrevented){const D=E().filter(V=>V.focusable),A=D.find(V=>V.active),K=D.find(V=>V.id===p),te=[A,K,...D].filter(Boolean).map(V=>V.ref.current);Bn(te,f)}}I.current=!1}),onBlur:P(t.onBlur,()=>w(!1))})})}),Hn="RovingFocusGroupItem",$n=i.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:a,...c}=t,d=us(),l=s||d,f=js(Hn,n),h=f.currentTabStopId===l,g=Ln(n),{onFocusableItemAdd:m,onFocusableItemRemove:C,currentTabStopId:p}=f;return i.useEffect(()=>{if(r)return m(),()=>C()},[r,m,C]),u.jsx(ft.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:u.jsx(B.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:e,onMouseDown:P(t.onMouseDown,v=>{r?f.onItemFocus(l):v.preventDefault()}),onFocus:P(t.onFocus,()=>f.onItemFocus(l)),onKeyDown:P(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){f.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=Us(v,f.orientation,f.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let b=g().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const E=b.indexOf(v.currentTarget);b=f.loop?Hs(b,E+1):b.slice(E+1)}setTimeout(()=>Bn(b))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:p!=null}):a})})});$n.displayName=Hn;var Ls={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ks(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Us(t,e,n){const r=ks(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ls[r]}function Bn(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Hs(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var $s=Un,Bs=$n,Gn=Co(),rt=function(){},Ke=i.forwardRef(function(t,e){var n=i.useRef(null),r=i.useState({onScrollCapture:rt,onWheelCapture:rt,onTouchMoveCapture:rt}),o=r[0],s=r[1],a=t.forwardProps,c=t.children,d=t.className,l=t.removeScrollBar,f=t.enabled,h=t.shards,g=t.sideCar,m=t.noIsolation,C=t.inert,p=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,w=t.gapMode,b=Zr(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=xo([n,e]),R=pe(pe({},b),o);return i.createElement(i.Fragment,null,f&&i.createElement(E,{sideCar:Gn,removeScrollBar:l,shards:h,noIsolation:m,inert:C,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:w}),a?i.cloneElement(i.Children.only(c),pe(pe({},R),{ref:I})):i.createElement(y,pe({},R,{className:d,ref:I}),c))});Ke.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ke.classNames={fullWidth:bo,zeroRight:So};var gt=!1;if(typeof window<"u")try{var _e=Object.defineProperty({},"passive",{get:function(){return gt=!0,!0}});window.addEventListener("test",_e,_e),window.removeEventListener("test",_e,_e)}catch{gt=!1}var fe=gt?{passive:!1}:!1,Gs=function(t){return t.tagName==="TEXTAREA"},Kn=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Gs(t)&&n[e]==="visible")},Ks=function(t){return Kn(t,"overflowY")},Ws=function(t){return Kn(t,"overflowX")},Yt=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Wn(t,r);if(o){var s=Vn(t,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vs=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Ys=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},Wn=function(t,e){return t==="v"?Ks(e):Ws(e)},Vn=function(t,e){return t==="v"?Vs(e):Ys(e)},Xs=function(t,e){return t==="h"&&e==="rtl"?-1:1},zs=function(t,e,n,r,o){var s=Xs(t,window.getComputedStyle(e).direction),a=s*r,c=n.target,d=e.contains(c),l=!1,f=a>0,h=0,g=0;do{var m=Vn(t,c),C=m[0],p=m[1],v=m[2],y=p-v-s*C;(C||y)&&Wn(t,c)&&(h+=y,g+=C),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(f&&Math.abs(h)<1||!f&&Math.abs(g)<1)&&(l=!0),l},je=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Xt=function(t){return[t.deltaX,t.deltaY]},zt=function(t){return t&&"current"in t?t.current:t},qs=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Zs=function(t){return`
2
- .block-interactivity-`.concat(t,` {pointer-events: none;}
3
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
4
- `)},Qs=0,ge=[];function Js(t){var e=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(Qs++)[0],s=i.useState(wo)[0],a=i.useRef(t);i.useEffect(function(){a.current=t},[t]),i.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Qr([t.lockRef.current],(t.shards||[]).map(zt),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=i.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=je(p),w=n.current,b="deltaX"in p?p.deltaX:w[0]-y[0],E="deltaY"in p?p.deltaY:w[1]-y[1],I,R=p.target,T=Math.abs(b)>Math.abs(E)?"h":"v";if("touches"in p&&T==="h"&&R.type==="range")return!1;var M=Yt(T,R);if(!M)return!0;if(M?I=T:(I=T==="v"?"h":"v",M=Yt(T,R)),!M)return!1;if(!r.current&&"changedTouches"in p&&(b||E)&&(r.current=I),!I)return!0;var _=r.current||I;return zs(_,v,p,_==="h"?b:E)},[]),d=i.useCallback(function(p){var v=p;if(!(!ge.length||ge[ge.length-1]!==s)){var y="deltaY"in v?Xt(v):je(v),w=e.current.filter(function(I){return I.name===v.type&&(I.target===v.target||v.target===I.shadowParent)&&qs(I.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var b=(a.current.shards||[]).map(zt).filter(Boolean).filter(function(I){return I.contains(v.target)}),E=b.length>0?c(v,b[0]):!a.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),l=i.useCallback(function(p,v,y,w){var b={name:p,delta:v,target:y,should:w,shadowParent:ei(y)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(E){return E!==b})},1)},[]),f=i.useCallback(function(p){n.current=je(p),r.current=void 0},[]),h=i.useCallback(function(p){l(p.type,Xt(p),p.target,c(p,t.lockRef.current))},[]),g=i.useCallback(function(p){l(p.type,je(p),p.target,c(p,t.lockRef.current))},[]);i.useEffect(function(){return ge.push(s),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",d,fe),document.addEventListener("touchmove",d,fe),document.addEventListener("touchstart",f,fe),function(){ge=ge.filter(function(p){return p!==s}),document.removeEventListener("wheel",d,fe),document.removeEventListener("touchmove",d,fe),document.removeEventListener("touchstart",f,fe)}},[]);var m=t.removeScrollBar,C=t.inert;return i.createElement(i.Fragment,null,C?i.createElement(s,{styles:Zs(o)}):null,m?i.createElement(Eo,{gapMode:t.gapMode}):null)}function ei(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ti=Do(Gn,Js);var Yn=i.forwardRef(function(t,e){return i.createElement(Ke,pe({},t,{ref:e,sideCar:ti}))});Yn.classNames=Ke.classNames;var ht=["Enter"," "],ni=["ArrowDown","PageUp","Home"],Xn=["ArrowUp","PageDown","End"],ri=[...ni,...Xn],oi={ltr:[...ht,"ArrowRight"],rtl:[...ht,"ArrowLeft"]},si={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pe="Menu",[we,ii,ai]=yn(Pe),[ue,zn]=Te(Pe,[ai,On,kn]),We=On(),qn=kn(),[ci,le]=ue(Pe),[ui,Re]=ue(Pe),Zn=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:a=!0}=t,c=We(e),[d,l]=i.useState(null),f=i.useRef(!1),h=J(s),g=Cn(o);return i.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),u.jsx(Cs,{...c,children:u.jsx(ci,{scope:e,open:n,onOpenChange:h,content:d,onContentChange:l,children:u.jsx(ui,{scope:e,onClose:i.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:g,modal:a,children:r})})})};Zn.displayName=Pe;var li="MenuAnchor",bt=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=We(n);return u.jsx(xs,{...o,...r,ref:e})});bt.displayName=li;var wt="MenuPortal",[di,Qn]=ue(wt,{forceMount:void 0}),Jn=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=le(wt,e);return u.jsx(di,{scope:e,forceMount:n,children:u.jsx(Oe,{present:n||s.open,children:u.jsx(Fn,{asChild:!0,container:o,children:r})})})};Jn.displayName=wt;var Z="MenuContent",[fi,Et]=ue(Z),er=i.forwardRef((t,e)=>{const n=Qn(Z,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,s=le(Z,t.__scopeMenu),a=Re(Z,t.__scopeMenu);return u.jsx(we.Provider,{scope:t.__scopeMenu,children:u.jsx(Oe,{present:r||s.open,children:u.jsx(we.Slot,{scope:t.__scopeMenu,children:a.modal?u.jsx(gi,{...o,ref:e}):u.jsx(hi,{...o,ref:e})})})})}),gi=i.forwardRef((t,e)=>{const n=le(Z,t.__scopeMenu),r=i.useRef(null),o=$(e,r);return i.useEffect(()=>{const s=r.current;if(s)return To(s)},[]),u.jsx(Dt,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hi=i.forwardRef((t,e)=>{const n=le(Z,t.__scopeMenu);return u.jsx(Dt,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pi=He("MenuContent.ScrollLock"),Dt=i.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:C,...p}=t,v=le(Z,n),y=Re(Z,n),w=We(n),b=qn(n),E=ii(n),[I,R]=i.useState(null),T=i.useRef(null),M=$(e,T,v.onContentChange),_=i.useRef(0),F=i.useRef(""),D=i.useRef(0),A=i.useRef(null),K=i.useRef("right"),ee=i.useRef(0),te=C?Yn:i.Fragment,V=C?{as:pi,allowPinchZoom:!0}:void 0,U=x=>{var ne,ye;const N=F.current+x,j=E().filter(Y=>!Y.disabled),H=document.activeElement,me=(ne=j.find(Y=>Y.ref.current===H))==null?void 0:ne.textValue,ve=j.map(Y=>Y.textValue),Me=Oi(ve,N,me),ie=(ye=j.find(Y=>Y.textValue===Me))==null?void 0:ye.ref.current;(function Y(Ce){F.current=Ce,window.clearTimeout(_.current),Ce!==""&&(_.current=window.setTimeout(()=>Y(""),1e3))})(N),ie&&setTimeout(()=>ie.focus())};i.useEffect(()=>()=>window.clearTimeout(_.current),[]),Jo();const S=i.useCallback(x=>{var j,H;return K.current===((j=A.current)==null?void 0:j.side)&&Pi(x,(H=A.current)==null?void 0:H.area)},[]);return u.jsx(fi,{scope:n,searchRef:F,onItemEnter:i.useCallback(x=>{S(x)&&x.preventDefault()},[S]),onItemLeave:i.useCallback(x=>{var N;S(x)||((N=T.current)==null||N.focus(),R(null))},[S]),onTriggerLeave:i.useCallback(x=>{S(x)&&x.preventDefault()},[S]),pointerGraceTimerRef:D,onPointerGraceIntentChange:i.useCallback(x=>{A.current=x},[]),children:u.jsx(te,{...V,children:u.jsx(wn,{asChild:!0,trapped:o,onMountAutoFocus:P(s,x=>{var N;x.preventDefault(),(N=T.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(Sn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,children:u.jsx($s,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:I,onCurrentTabStopIdChange:R,onEntryFocus:P(d,x=>{y.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(Ss,{role:"menu","aria-orientation":"vertical","data-state":mr(v.open),"data-radix-menu-content":"",dir:y.dir,...w,...p,ref:M,style:{outline:"none",...p.style},onKeyDown:P(p.onKeyDown,x=>{const j=x.target.closest("[data-radix-menu-content]")===x.currentTarget,H=x.ctrlKey||x.altKey||x.metaKey,me=x.key.length===1;j&&(x.key==="Tab"&&x.preventDefault(),!H&&me&&U(x.key));const ve=T.current;if(x.target!==ve||!ri.includes(x.key))return;x.preventDefault();const ie=E().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);Xn.includes(x.key)&&ie.reverse(),Di(ie)}),onBlur:P(t.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(_.current),F.current="")}),onPointerMove:P(t.onPointerMove,Ee(x=>{const N=x.target,j=ee.current!==x.clientX;if(x.currentTarget.contains(N)&&j){const H=x.clientX>ee.current?"right":"left";K.current=H,ee.current=x.clientX}}))})})})})})})});er.displayName=Z;var mi="MenuGroup",Tt=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx(B.div,{role:"group",...r,ref:e})});Tt.displayName=mi;var vi="MenuLabel",tr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx(B.div,{...r,ref:e})});tr.displayName=vi;var $e="MenuItem",qt="menu.itemSelect",Ve=i.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,s=i.useRef(null),a=Re($e,t.__scopeMenu),c=Et($e,t.__scopeMenu),d=$(e,s),l=i.useRef(!1),f=()=>{const h=s.current;if(!n&&h){const g=new CustomEvent(qt,{bubbles:!0,cancelable:!0});h.addEventListener(qt,m=>r==null?void 0:r(m),{once:!0}),vn(h,g),g.defaultPrevented?l.current=!1:a.onClose()}};return u.jsx(nr,{...o,ref:d,disabled:n,onClick:P(t.onClick,f),onPointerDown:h=>{var g;(g=t.onPointerDown)==null||g.call(t,h),l.current=!0},onPointerUp:P(t.onPointerUp,h=>{var g;l.current||(g=h.currentTarget)==null||g.click()}),onKeyDown:P(t.onKeyDown,h=>{const g=c.searchRef.current!=="";n||g&&h.key===" "||ht.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Ve.displayName=$e;var nr=i.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=t,a=Et($e,n),c=qn(n),d=i.useRef(null),l=$(e,d),[f,h]=i.useState(!1),[g,m]=i.useState("");return i.useEffect(()=>{const C=d.current;C&&m((C.textContent??"").trim())},[s.children]),u.jsx(we.ItemSlot,{scope:n,disabled:r,textValue:o??g,children:u.jsx(Bs,{asChild:!0,...c,focusable:!r,children:u.jsx(B.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:P(t.onPointerMove,Ee(C=>{r?a.onItemLeave(C):(a.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:P(t.onPointerLeave,Ee(C=>a.onItemLeave(C))),onFocus:P(t.onFocus,()=>h(!0)),onBlur:P(t.onBlur,()=>h(!1))})})})}),yi="MenuCheckboxItem",rr=i.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return u.jsx(cr,{scope:t.__scopeMenu,checked:n,children:u.jsx(Ve,{role:"menuitemcheckbox","aria-checked":Be(n)?"mixed":n,...o,ref:e,"data-state":It(n),onSelect:P(o.onSelect,()=>r==null?void 0:r(Be(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rr.displayName=yi;var or="MenuRadioGroup",[Ci,xi]=ue(or,{value:void 0,onValueChange:()=>{}}),sr=i.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,s=J(r);return u.jsx(Ci,{scope:t.__scopeMenu,value:n,onValueChange:s,children:u.jsx(Tt,{...o,ref:e})})});sr.displayName=or;var ir="MenuRadioItem",ar=i.forwardRef((t,e)=>{const{value:n,...r}=t,o=xi(ir,t.__scopeMenu),s=n===o.value;return u.jsx(cr,{scope:t.__scopeMenu,checked:s,children:u.jsx(Ve,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":It(s),onSelect:P(r.onSelect,()=>{var a;return(a=o.onValueChange)==null?void 0:a.call(o,n)},{checkForDefaultPrevented:!1})})})});ar.displayName=ir;var Ot="MenuItemIndicator",[cr,Si]=ue(Ot,{checked:!1}),ur=i.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,s=Si(Ot,n);return u.jsx(Oe,{present:r||Be(s.checked)||s.checked===!0,children:u.jsx(B.span,{...o,ref:e,"data-state":It(s.checked)})})});ur.displayName=Ot;var bi="MenuSeparator",lr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return u.jsx(B.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});lr.displayName=bi;var wi="MenuArrow",dr=i.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=We(n);return u.jsx(bs,{...o,...r,ref:e})});dr.displayName=wi;var Ei="MenuSub",[qu,fr]=ue(Ei),Se="MenuSubTrigger",gr=i.forwardRef((t,e)=>{const n=le(Se,t.__scopeMenu),r=Re(Se,t.__scopeMenu),o=fr(Se,t.__scopeMenu),s=Et(Se,t.__scopeMenu),a=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,l={__scopeMenu:t.__scopeMenu},f=i.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const h=c.current;return()=>{window.clearTimeout(h),d(null)}},[c,d]),u.jsx(bt,{asChild:!0,...l,children:u.jsx(nr,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":mr(n.open),...t,ref:mn(e,o.onTriggerChange),onClick:h=>{var g;(g=t.onClick)==null||g.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:P(t.onPointerMove,Ee(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:P(t.onPointerLeave,Ee(h=>{var m,C;f();const g=(m=n.content)==null?void 0:m.getBoundingClientRect();if(g){const p=(C=n.content)==null?void 0:C.dataset.side,v=p==="right",y=v?-5:5,w=g[v?"left":"right"],b=g[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+y,y:h.clientY},{x:w,y:g.top},{x:b,y:g.top},{x:b,y:g.bottom},{x:w,y:g.bottom}],side:p}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:P(t.onKeyDown,h=>{var m;const g=s.searchRef.current!=="";t.disabled||g&&h.key===" "||oi[r.dir].includes(h.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),h.preventDefault())})})})});gr.displayName=Se;var hr="MenuSubContent",pr=i.forwardRef((t,e)=>{const n=Qn(Z,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,s=le(Z,t.__scopeMenu),a=Re(Z,t.__scopeMenu),c=fr(hr,t.__scopeMenu),d=i.useRef(null),l=$(e,d);return u.jsx(we.Provider,{scope:t.__scopeMenu,children:u.jsx(Oe,{present:r||s.open,children:u.jsx(we.Slot,{scope:t.__scopeMenu,children:u.jsx(Dt,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:l,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;a.isUsingKeyboardRef.current&&((h=d.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:P(t.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:P(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:P(t.onKeyDown,f=>{var m;const h=f.currentTarget.contains(f.target),g=si[a.dir].includes(f.key);h&&g&&(s.onOpenChange(!1),(m=c.trigger)==null||m.focus(),f.preventDefault())})})})})})});pr.displayName=hr;function mr(t){return t?"open":"closed"}function Be(t){return t==="indeterminate"}function It(t){return Be(t)?"indeterminate":t?"checked":"unchecked"}function Di(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Ti(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Oi(t,e,n){const o=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=Ti(t,Math.max(s,0));o.length===1&&(a=a.filter(l=>l!==n));const d=a.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function Ii(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s],d=e[a],l=c.x,f=c.y,h=d.x,g=d.y;f>r!=g>r&&n<(h-l)*(r-f)/(g-f)+l&&(o=!o)}return o}function Pi(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Ii(n,e)}function Ee(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Ri=Zn,Mi=bt,Ni=Jn,Ai=er,_i=Tt,ji=tr,Fi=Ve,Li=rr,ki=sr,Ui=ar,Hi=ur,$i=lr,Bi=dr,Gi=gr,Ki=pr,Pt="ContextMenu",[Wi,Zu]=Te(Pt,[zn]),G=zn(),[Vi,vr]=Wi(Pt),yr=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:s=!0}=t,[a,c]=i.useState(!1),d=G(e),l=J(r),f=i.useCallback(h=>{c(h),l(h)},[l]);return u.jsx(Vi,{scope:e,open:a,onOpenChange:f,modal:s,children:u.jsx(Ri,{...d,dir:o,open:a,onOpenChange:f,modal:s,children:n})})};yr.displayName=Pt;var Cr="ContextMenuTrigger",xr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,s=vr(Cr,n),a=G(n),c=i.useRef({x:0,y:0}),d=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),l=i.useRef(0),f=i.useCallback(()=>window.clearTimeout(l.current),[]),h=g=>{c.current={x:g.clientX,y:g.clientY},s.onOpenChange(!0)};return i.useEffect(()=>f,[f]),i.useEffect(()=>void(r&&f()),[r,f]),u.jsxs(u.Fragment,{children:[u.jsx(Mi,{...a,virtualRef:d}),u.jsx(B.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:P(t.onContextMenu,g=>{f(),h(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:P(t.onPointerDown,Fe(g=>{f(),l.current=window.setTimeout(()=>h(g),700)})),onPointerMove:r?t.onPointerMove:P(t.onPointerMove,Fe(f)),onPointerCancel:r?t.onPointerCancel:P(t.onPointerCancel,Fe(f)),onPointerUp:r?t.onPointerUp:P(t.onPointerUp,Fe(f))})]})});xr.displayName=Cr;var Yi="ContextMenuPortal",Sr=t=>{const{__scopeContextMenu:e,...n}=t,r=G(e);return u.jsx(Ni,{...r,...n})};Sr.displayName=Yi;var br="ContextMenuContent",wr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=vr(br,n),s=G(n),a=i.useRef(!1);return u.jsx(Ai,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var d;(d=t.onCloseAutoFocus)==null||d.call(t,c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{var d;(d=t.onInteractOutside)==null||d.call(t,c),!c.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wr.displayName=br;var Xi="ContextMenuGroup",zi=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(_i,{...o,...r,ref:e})});zi.displayName=Xi;var qi="ContextMenuLabel",Zi=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(ji,{...o,...r,ref:e})});Zi.displayName=qi;var Qi="ContextMenuItem",Er=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Fi,{...o,...r,ref:e})});Er.displayName=Qi;var Ji="ContextMenuCheckboxItem",ea=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Li,{...o,...r,ref:e})});ea.displayName=Ji;var ta="ContextMenuRadioGroup",na=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(ki,{...o,...r,ref:e})});na.displayName=ta;var ra="ContextMenuRadioItem",oa=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Ui,{...o,...r,ref:e})});oa.displayName=ra;var sa="ContextMenuItemIndicator",ia=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Hi,{...o,...r,ref:e})});ia.displayName=sa;var aa="ContextMenuSeparator",Dr=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx($i,{...o,...r,ref:e})});Dr.displayName=aa;var ca="ContextMenuArrow",ua=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Bi,{...o,...r,ref:e})});ua.displayName=ca;var la="ContextMenuSubTrigger",da=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Gi,{...o,...r,ref:e})});da.displayName=la;var fa="ContextMenuSubContent",ga=i.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=G(n);return u.jsx(Ki,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ga.displayName=fa;function Fe(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var ha=yr,pa=xr,ma=Sr,va=wr,Q=Er,Zt=Dr;const Tr=i.createContext({dragDropManager:void 0});function z(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Qt=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Jt=function(){return Math.random().toString(36).substring(7).split("").join(".")},en={INIT:"@@redux/INIT"+Jt(),REPLACE:"@@redux/REPLACE"+Jt()};function ya(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Or(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(z(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(z(1));return n(Or)(t,e)}if(typeof t!="function")throw new Error(z(2));var o=t,s=e,a=[],c=a,d=!1;function l(){c===a&&(c=a.slice())}function f(){if(d)throw new Error(z(3));return s}function h(p){if(typeof p!="function")throw new Error(z(4));if(d)throw new Error(z(5));var v=!0;return l(),c.push(p),function(){if(v){if(d)throw new Error(z(6));v=!1,l();var w=c.indexOf(p);c.splice(w,1),a=null}}}function g(p){if(!ya(p))throw new Error(z(7));if(typeof p.type>"u")throw new Error(z(8));if(d)throw new Error(z(9));try{d=!0,s=o(s,p)}finally{d=!1}for(var v=a=c,y=0;y<v.length;y++){var w=v[y];w()}return p}function m(p){if(typeof p!="function")throw new Error(z(10));o=p,g({type:en.REPLACE})}function C(){var p,v=h;return p={subscribe:function(w){if(typeof w!="object"||w===null)throw new Error(z(11));function b(){w.next&&w.next(f())}b();var E=v(b);return{unsubscribe:E}}},p[Qt]=function(){return this},p}return g({type:en.INIT}),r={dispatch:g,subscribe:h,getState:f,replaceReducer:m},r[Qt]=C,r}function O(t,e,...n){if(Ca()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;r=new Error(e.replace(/%s/g,function(){return n[o++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Ca(){return typeof process<"u"&&!0}function xa(t,e,n){return e.split(".").reduce((r,o)=>r&&r[o]?r[o]:n||null,t)}function Sa(t,e){return t.filter(n=>n!==e)}function Ir(t){return typeof t=="object"}function ba(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const o=[];return n.forEach((s,a)=>{s===1&&o.push(a)}),o}function wa(t,e){return t.filter(n=>e.indexOf(n)>-1)}const Rt="dnd-core/INIT_COORDS",Ye="dnd-core/BEGIN_DRAG",Mt="dnd-core/PUBLISH_DRAG_SOURCE",Xe="dnd-core/HOVER",ze="dnd-core/DROP",qe="dnd-core/END_DRAG";function tn(t,e){return{type:Rt,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const Ea={type:Rt,payload:{clientOffset:null,sourceClientOffset:null}};function Da(t){return function(n=[],r={publishSource:!0}){const{publishSource:o=!0,clientOffset:s,getSourceClientOffset:a}=r,c=t.getMonitor(),d=t.getRegistry();t.dispatch(tn(s)),Ta(n,c,d);const l=Pa(n,c);if(l==null){t.dispatch(Ea);return}let f=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");Oa(a),f=a(l)}t.dispatch(tn(s,f));const g=d.getSource(l).beginDrag(c,l);if(g==null)return;Ia(g),d.pinSource(l);const m=d.getSourceType(l);return{type:Ye,payload:{itemType:m,item:g,sourceId:l,clientOffset:s||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}function Ta(t,e,n){O(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){O(n.getSource(r),"Expected sourceIds to be registered.")})}function Oa(t){O(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ia(t){O(Ir(t),"Item must be an object.")}function Pa(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function Ra(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Ra(t,o,n[o])})}return t}function Na(t){return function(n={}){const r=t.getMonitor(),o=t.getRegistry();Aa(r),Fa(r).forEach((a,c)=>{const d=_a(a,c,o,r),l={type:ze,payload:{dropResult:Ma({},n,d)}};t.dispatch(l)})}}function Aa(t){O(t.isDragging(),"Cannot call drop while not dragging."),O(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function _a(t,e,n,r){const o=n.getTarget(t);let s=o?o.drop(r,t):void 0;return ja(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function ja(t){O(typeof t>"u"||Ir(t),"Drop result must either be an object or undefined.")}function Fa(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function La(t){return function(){const n=t.getMonitor(),r=t.getRegistry();ka(n);const o=n.getSourceId();return o!=null&&(r.getSource(o,!0).endDrag(n,o),r.unpinSource()),{type:qe}}}function ka(t){O(t.isDragging(),"Cannot call endDrag while not dragging.")}function pt(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function Ua(t){return function(n,{clientOffset:r}={}){Ha(n);const o=n.slice(0),s=t.getMonitor(),a=t.getRegistry(),c=s.getItemType();return Ba(o,a,c),$a(o,s,a),Ga(o,s,a),{type:Xe,payload:{targetIds:o,clientOffset:r||null}}}}function Ha(t){O(Array.isArray(t),"Expected targetIds to be an array.")}function $a(t,e,n){O(e.isDragging(),"Cannot call hover while not dragging."),O(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const o=t[r];O(t.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(o);O(s,"Expected targetIds to be registered.")}}function Ba(t,e,n){for(let r=t.length-1;r>=0;r--){const o=t[r],s=e.getTargetType(o);pt(s,n)||t.splice(r,1)}}function Ga(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function Ka(t){return function(){if(t.getMonitor().isDragging())return{type:Mt}}}function Wa(t){return{beginDrag:Da(t),publishDragSource:Ka(t),hover:Ua(t),drop:Na(t),endDrag:La(t)}}class Va{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...a)=>{const c=s.apply(e,a);typeof c<"u"&&n(c)}}const o=Wa(this);return Object.keys(o).reduce((s,a)=>{const c=o[a];return s[a]=r(c),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function Ya(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Pr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Xa(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:Pr(Ya(e,r),n)}function za(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:Pr(e,n)}const be=[],Nt=[];be.__IS_NONE__=!0;Nt.__IS_ALL__=!0;function qa(t,e){return t===be?!1:t===Nt||typeof e>"u"?!0:wa(e,t).length>0}class Za{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;O(typeof e=="function","listener must be a function."),O(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let o=this.store.getState().stateId;const s=()=>{const a=this.store.getState(),c=a.stateId;try{c===o||c===o+1&&!qa(a.dirtyHandlerIds,r)||e()}finally{o=c}};return this.store.subscribe(s)}subscribeToOffsetChange(e){O(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const o=this.store.getState().dragOffset;o!==n&&(n=o,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return O(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(O(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();return pt(r,o)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(O(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),o=this.getItemType();return r!==o?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const o=this.registry.getTargetType(e),s=this.getItemType();if(s&&!pt(o,s))return!1;const a=this.getTargetIds();if(!a.length)return!1;const c=a.indexOf(e);return r?c===a.length-1:c>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xa(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return za(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const nn=typeof global<"u"?global:self,Rr=nn.MutationObserver||nn.WebKitMutationObserver;function Mr(t){return function(){const n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),t()}}}function Qa(t){let e=1;const n=new Rr(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Ja=typeof Rr=="function"?Qa:Mr;class ec{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,o=e.length-this.index;r<o;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Ja(this.flush),this.requestErrorThrow=Mr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class tc{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class nc{create(e){const n=this.freeTasks,r=n.length?n.pop():new tc(this.onError,o=>n[n.length]=o);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Nr=new ec,rc=new nc(Nr.registerPendingError);function oc(t){Nr.enqueueTask(rc.create(t))}const At="dnd-core/ADD_SOURCE",_t="dnd-core/ADD_TARGET",jt="dnd-core/REMOVE_SOURCE",Ze="dnd-core/REMOVE_TARGET";function sc(t){return{type:At,payload:{sourceId:t}}}function ic(t){return{type:_t,payload:{targetId:t}}}function ac(t){return{type:jt,payload:{sourceId:t}}}function cc(t){return{type:Ze,payload:{targetId:t}}}function uc(t){O(typeof t.canDrag=="function","Expected canDrag to be a function."),O(typeof t.beginDrag=="function","Expected beginDrag to be a function."),O(typeof t.endDrag=="function","Expected endDrag to be a function.")}function lc(t){O(typeof t.canDrop=="function","Expected canDrop to be a function."),O(typeof t.hover=="function","Expected hover to be a function."),O(typeof t.drop=="function","Expected beginDrag to be a function.")}function mt(t,e){if(e&&Array.isArray(t)){t.forEach(n=>mt(n,!1));return}O(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var q;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(q||(q={}));let dc=0;function fc(){return dc++}function gc(t){const e=fc().toString();switch(t){case q.SOURCE:return`S${e}`;case q.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function rn(t){switch(t[0]){case"S":return q.SOURCE;case"T":return q.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function on(t,e){const n=t.entries();let r=!1;do{const{done:o,value:[,s]}=n.next();if(s===e)return!0;r=!!o}while(!r);return!1}class hc{addSource(e,n){mt(e),uc(n);const r=this.addHandler(q.SOURCE,e,n);return this.store.dispatch(sc(r)),r}addTarget(e,n){mt(e,!0),lc(n);const r=this.addHandler(q.TARGET,e,n);return this.store.dispatch(ic(r)),r}containsHandler(e){return on(this.dragSources,e)||on(this.dropTargets,e)}getSource(e,n=!1){return O(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return O(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return O(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return O(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return rn(e)===q.SOURCE}isTargetId(e){return rn(e)===q.TARGET}removeSource(e){O(this.getSource(e),"Expected an existing source."),this.store.dispatch(ac(e)),oc(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){O(this.getTarget(e),"Expected an existing target."),this.store.dispatch(cc(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);O(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){O(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const o=gc(e);return this.types.set(o,n),e===q.SOURCE?this.dragSources.set(o,r):e===q.TARGET&&this.dropTargets.set(o,r),o}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const pc=(t,e)=>t===e;function mc(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function vc(t,e,n=pc){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function yc(t=be,e){switch(e.type){case Xe:break;case At:case _t:case Ze:case jt:return be;case Ye:case Mt:case qe:case ze:default:return Nt}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,o=ba(n,r);if(!(o.length>0||!vc(n,r)))return be;const a=r[r.length-1],c=n[n.length-1];return a!==c&&(a&&o.push(a),c&&o.push(c)),o}function Cc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Cc(t,o,n[o])})}return t}const sn={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Sc(t=sn,e){const{payload:n}=e;switch(e.type){case Rt:case Ye:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Xe:return mc(t.clientOffset,n.clientOffset)?t:xc({},t,{clientOffset:n.clientOffset});case qe:case ze:return sn;default:return t}}function bc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function he(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){bc(t,o,n[o])})}return t}const wc={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ec(t=wc,e){const{payload:n}=e;switch(e.type){case Ye:return he({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Mt:return he({},t,{isSourcePublic:!0});case Xe:return he({},t,{targetIds:n.targetIds});case Ze:return t.targetIds.indexOf(n.targetId)===-1?t:he({},t,{targetIds:Sa(t.targetIds,n.targetId)});case ze:return he({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case qe:return he({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Dc(t=0,e){switch(e.type){case At:case _t:return t+1;case jt:case Ze:return t-1;default:return t}}function Tc(t=0){return t+1}function Oc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ic(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Oc(t,o,n[o])})}return t}function Pc(t={},e){return{dirtyHandlerIds:yc(t.dirtyHandlerIds,{type:e.type,payload:Ic({},e.payload,{prevTargetIds:xa(t,"dragOperation.targetIds",[])})}),dragOffset:Sc(t.dragOffset,e),refCount:Dc(t.refCount,e),dragOperation:Ec(t.dragOperation,e),stateId:Tc(t.stateId)}}function Rc(t,e=void 0,n={},r=!1){const o=Mc(r),s=new Za(o,new hc(o)),a=new Va(o,s),c=t(a,e,n);return a.receiveBackend(c),a}function Mc(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Or(Pc,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function Nc(t,e){if(t==null)return{};var n=Ac(t,e),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(o=0;o<s.length;o++)r=s[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ac(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,s;for(s=0;s<r.length;s++)o=r[s],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}let an=0;const Ue=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var _c=i.memo(function(e){var{children:n}=e,r=Nc(e,["children"]);const[o,s]=jc(r);return i.useEffect(()=>{if(s){const a=Ar();return++an,()=>{--an===0&&(a[Ue]=null)}}},[]),u.jsx(Tr.Provider,{value:o,children:n})});function jc(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=Fc(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function Fc(t,e=Ar(),n,r){const o=e;return o[Ue]||(o[Ue]={dragDropManager:Rc(t,e,n,r)}),o[Ue]}function Ar(){return typeof global<"u"?global:window}var ot,cn;function Lc(){return cn||(cn=1,ot=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var a=s[o];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),ot}var kc=Lc();const Uc=Jr(kc),ae=typeof window<"u"?i.useLayoutEffect:i.useEffect;function _r(t,e,n){const[r,o]=i.useState(()=>e(t)),s=i.useCallback(()=>{const a=e(t);Uc(r,a)||(o(a),n&&n())},[r,t,n]);return ae(s),[r,s]}function Hc(t,e,n){const[r,o]=_r(t,e,n);return ae(function(){const a=t.getHandlerId();if(a!=null)return t.subscribeToStateChange(o,{handlerIds:[a]})},[t,o]),r}function jr(t,e,n){return Hc(e,t||(()=>({})),()=>n.reconnect())}function Fr(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),i.useMemo(()=>typeof t=="function"?t():t,n)}function $c(t){return i.useMemo(()=>t.hooks.dragSource(),[t])}function Bc(t){return i.useMemo(()=>t.hooks.dragPreview(),[t])}let st=!1,it=!1;class Gc{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){O(!st,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return st=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{st=!1}}isDragging(){if(!this.sourceId)return!1;O(!it,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return it=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{it=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let at=!1;class Kc{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;O(!at,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return at=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{at=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function Wc(t,e,n){const r=n.getRegistry(),o=r.addTarget(t,e);return[o,()=>r.removeTarget(o)]}function Vc(t,e,n){const r=n.getRegistry(),o=r.addSource(t,e);return[o,()=>r.removeSource(o)]}function vt(t,e,n,r){let o;if(o!==void 0)return!!o;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),a=Object.keys(e);if(s.length!==a.length)return!1;const c=Object.prototype.hasOwnProperty.bind(e);for(let d=0;d<s.length;d++){const l=s[d];if(!c(l))return!1;const f=t[l],h=e[l];if(o=void 0,o===!1||o===void 0&&f!==h)return!1}return!0}function yt(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Yc(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Xc(t){return(e=null,n=null)=>{if(!i.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return Yc(r),zc(r,n?s=>t(s,n):t)}}function Lr(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const o=Xc(r);e[n]=()=>o}}),e}function un(t,e){typeof t=="function"?t(e):t.current=e}function zc(t,e){const n=t.ref;return O(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?i.cloneElement(t,{ref:r=>{un(n,r),un(e,r)}}):i.cloneElement(t,{ref:e})}class qc{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vt(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vt(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Lr({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,yt(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,yt(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Zc{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vt(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Lr({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,yt(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function de(){const{dragDropManager:t}=i.useContext(Tr);return O(t!=null,"Expected drag drop context"),t}function Qc(t,e){const n=de(),r=i.useMemo(()=>new qc(n.getBackend()),[n]);return ae(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),ae(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function Jc(){const t=de();return i.useMemo(()=>new Gc(t),[t])}class eu{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,o=this.monitor,{isDragging:s}=r;return s?s(o):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:o}=e;o&&o(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function tu(t,e,n){const r=i.useMemo(()=>new eu(t,e,n),[e,n]);return i.useEffect(()=>{r.spec=t},[t]),r}function nu(t){return i.useMemo(()=>{const e=t.type;return O(e!=null,"spec.type must be defined"),e},[t])}function ru(t,e,n){const r=de(),o=tu(t,e,n),s=nu(t);ae(function(){if(s!=null){const[c,d]=Vc(s,o,r);return e.receiveHandlerId(c),n.receiveHandlerId(c),d}},[r,e,n,o,s])}function kr(t,e){const n=Fr(t,e);O(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=Jc(),o=Qc(n.options,n.previewOptions);return ru(n,r,o),[jr(n.collect,r,o),$c(o),Bc(o)]}function ou(t){const n=de().getMonitor(),[r,o]=_r(n,t);return i.useEffect(()=>n.subscribeToOffsetChange(o)),i.useEffect(()=>n.subscribeToStateChange(o)),r}function su(t){return i.useMemo(()=>t.hooks.dropTarget(),[t])}function iu(t){const e=de(),n=i.useMemo(()=>new Zc(e.getBackend()),[e]);return ae(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function au(){const t=de();return i.useMemo(()=>new Kc(t),[t])}function cu(t){const{accept:e}=t;return i.useMemo(()=>(O(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class uu{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function lu(t,e){const n=i.useMemo(()=>new uu(t,e),[e]);return i.useEffect(()=>{n.spec=t},[t]),n}function du(t,e,n){const r=de(),o=lu(t,e),s=cu(t);ae(function(){const[c,d]=Wc(s,o,r);return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,o,n,s.map(a=>a.toString()).join("|")])}function fu(t,e){const n=Fr(t,e),r=au(),o=iu(n.options);return du(n,r,o),[jr(n.collect,r,o),su(o)]}function Ur(t){let e=null;return()=>(e==null&&(e=t()),e)}function gu(t,e){return t.filter(n=>n!==e)}function hu(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const o=[];return n.forEach(s=>o.push(s)),o}class pu{enter(e){const n=this.entered.length,r=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(e));return this.entered=hu(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=gu(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class mu{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const o=this.config.exposeProperties[r];o!=null&&(n[r]={value:o(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Hr="__NATIVE_FILE__",$r="__NATIVE_URL__",Br="__NATIVE_TEXT__",Gr="__NATIVE_HTML__",ln=Object.freeze(Object.defineProperty({__proto__:null,FILE:Hr,HTML:Gr,TEXT:Br,URL:$r},Symbol.toStringTag,{value:"Module"}));function ct(t,e,n){const r=e.reduce((o,s)=>o||t.getData(s),"");return r??n}const Ct={[Hr]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[Gr]:{exposeProperties:{html:(t,e)=>ct(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[$r]:{exposeProperties:{urls:(t,e)=>ct(t,e,"").split(`
5
- `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[Br]:{exposeProperties:{text:(t,e)=>ct(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function vu(t,e){const n=Ct[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new mu(n);return r.loadDataTransfer(e),r}function ut(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Ct).filter(n=>{const r=Ct[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(o=>e.indexOf(o)>-1):!1})[0]||null}const yu=Ur(()=>/firefox/i.test(navigator.userAgent)),Kr=Ur(()=>!!window.safari);class dn{interpolate(e){const{xs:n,ys:r,c1s:o,c2s:s,c3s:a}=this;let c=n.length-1;if(e===n[c])return r[c];let d=0,l=a.length-1,f;for(;d<=l;){f=Math.floor(.5*(d+l));const m=n[f];if(m<e)d=f+1;else if(m>e)l=f-1;else return r[f]}c=Math.max(0,l);const h=e-n[c],g=h*h;return r[c]+o[c]*h+s[c]*g+a[c]*h*g}constructor(e,n){const{length:r}=e,o=[];for(let m=0;m<r;m++)o.push(m);o.sort((m,C)=>e[m]<e[C]?-1:1);const s=[],a=[];let c,d;for(let m=0;m<r-1;m++)c=e[m+1]-e[m],d=n[m+1]-n[m],s.push(c),a.push(d/c);const l=[a[0]];for(let m=0;m<s.length-1;m++){const C=a[m],p=a[m+1];if(C*p<=0)l.push(0);else{c=s[m];const v=s[m+1],y=c+v;l.push(3*y/((y+v)/C+(y+c)/p))}}l.push(a[a.length-1]);const f=[],h=[];let g;for(let m=0;m<l.length-1;m++){g=a[m];const C=l[m],p=1/s[m],v=C+l[m+1]-g-g;f.push((g-C-v)*p),h.push(v*p*p)}this.xs=e,this.ys=n,this.c1s=l,this.c2s=f,this.c3s=h}}const Cu=1;function Wr(t){const e=t.nodeType===Cu?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Le(t){return{x:t.clientX,y:t.clientY}}function xu(t){var e;return t.nodeName==="IMG"&&(yu()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function Su(t,e,n,r){let o=t?e.width:n,s=t?e.height:r;return Kr()&&t&&(s/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:s}}function bu(t,e,n,r,o){const s=xu(e),c=Wr(s?t:e),d={x:n.x-c.x,y:n.y-c.y},{offsetWidth:l,offsetHeight:f}=t,{anchorX:h,anchorY:g}=r,{dragPreviewWidth:m,dragPreviewHeight:C}=Su(s,e,l,f),p=()=>{let R=new dn([0,.5,1],[d.y,d.y/f*C,d.y+C-f]).interpolate(g);return Kr()&&s&&(R+=(window.devicePixelRatio-1)*C),R},v=()=>new dn([0,.5,1],[d.x,d.x/l*m,d.x+m-l]).interpolate(h),{offsetX:y,offsetY:w}=o,b=y===0||y,E=w===0||w;return{x:b?y:v(),y:E?w:p()}}class wu{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function Eu(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Eu(t,o,n[o])})}return t}class Du{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const o=a=>this.handleDragStart(a,e),s=a=>this.handleSelectStart(a);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=a=>this.handleDragEnter(a,e),o=a=>this.handleDragOver(a,e),s=a=>this.handleDrop(a,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",o),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",o),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return fn({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return fn({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(ln).some(n=>ln[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=vu(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=o=>{const s=this.sourceNodes.get(o);return s&&Wr(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const a=Le(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:c}=o,d=ut(c);if(this.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){const f=this.monitor.getSourceId(),h=this.sourceNodes.get(f),g=this.sourcePreviewNodes.get(f)||h;if(g){const{anchorX:m,anchorY:C,offsetX:p,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),b=bu(h,g,a,{anchorX:m,anchorY:C},{offsetX:p,offsetY:v});c.setDragImage(g,b.x,b.y)}}try{c==null||c.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.target);const{captureDraggingState:l}=this.getCurrentSourcePreviewNodeOptions();l?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(d)this.beginDragNativeItem(d);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}if(!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:c}=o,d=ut(c);d&&this.beginDragNativeItem(d,c)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=o.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Le(o)}),s.some(c=>this.monitor.canDropOnTarget(c))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=o=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}},this.handleTopDragOver=o=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}this.altKeyPressed=o.altKey,this.lastClientOffset=Le(o),this.scheduleHover(s),(s||[]).some(c=>this.monitor.canDropOnTarget(c))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;o.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}else ut(o.dataTransfer)&&o.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Le(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const s=o.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(o.preventDefault(),s.dragDrop()))},this.options=new wu(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new pu(this.isNodeInDocument)}}let ke;function Vr(){return ke||(ke=new Image,ke.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ke}const Tu=function(e,n,r){return new Du(e,n,r)};function ce({file:t,className:e,style:n}){const r=k(D=>D.selectedFile),o=k(D=>D.setSelectedFile),s=k(D=>D.activeRange),a=k(D=>D.setActiveRange),c=k(D=>D.inActiveRange),d=Qe(D=>D.addTab),l=Qe(D=>D.selectTab),f=Qe(D=>D.createTab),[h,g]=i.useState(!1),m=pn(()=>g(!0),{threshold:50,onFinish(){g(!1)},onCancel(){g(!1)}}),{setArtifactRename:C,renameArtifact:p,artifactRename:v,selectArtifactsInRange:y,removeArtifactWithConfirmation:w}=Ge(),[b,E]=i.useState(!1),[{isDragging:I},R,T]=kr(()=>({type:"artifact",item:t,end(){g(!1)},canDrag(){return v!==t&&h},collect(D){return{isDragging:D.isDragging()}}}),[t,v,h]);i.useEffect(()=>{T(Vr(),{captureDraggingState:!0})},[T]);function M(D){D.stopPropagation(),D.shiftKey&&D.preventDefault();let A=s;D.metaKey?(c(t)?A=A.filter(K=>K!==t):A.push(t),a(A)):D.shiftKey&&A.length>0?y(t):(A.length>0&&(A=[]),A.push(t),a(A),o(t))}function _(){const D=f(t);d(D),l(D)}const F=s.length>1&&c(t);return u.jsx("div",{...m,ref:R,children:u.jsxs(W.Container,{artifact:t,isSelected:r===t,className:L(v===t&&"bg-primary-10",b&&"bg-primary-10",h&&"bg-primary-10 !cursor-grabbing outline-2 !outline-primary-500",I&&"opacity-50",e),style:n,onDoubleClick:D=>{D.stopPropagation(),_()},handleSelect:M,children:[u.jsx(ce.Icons,{}),v===t?u.jsx(W.Rename,{artifact:v,rename:p,close:()=>C(void 0)}):u.jsxs(W.ContextMenu,{trigger:u.jsx(W.ContextMenuTrigger,{children:u.jsx(ce.Display,{file:t})}),onOpenChange:E,children:[r!==t&&u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",F?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:F,onClick:D=>{D.stopPropagation()},onSelect:D=>{D.stopPropagation(),_()},children:["Open in New Tab",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",F?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:F,onClick:D=>{D.stopPropagation()},onSelect:D=>{D.stopPropagation(),C(t)},children:["Rename",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-danger-500 hover:bg-danger-500 hover:text-light",onSelect:D=>{D.stopPropagation(),w(t)},children:["Remove ",c(t)?s.length:"",u.jsx("div",{className:"ml-auto pl-5"})]})]})]})})}function Ou({file:t}){return u.jsx("span",{title:t.name,className:L("inline-block overflow-hidden overflow-ellipsis py-[0.125rem]"),children:hn(t.name,50,20)})}function Iu(){return u.jsx("div",{className:"flex items-center",children:u.jsx(No,{className:"inline-block w-3 ml-1 mr-2"})})}ce.Display=Ou;ce.Icons=Iu;const De=function t({directory:e,className:n,style:r}){const o=k(S=>S.selectedFile),s=k(S=>S.activeRange),a=k(S=>S.setActiveRange),c=k(S=>S.inActiveRange),[d,l]=i.useState(e.isOpened),[f,h]=i.useState(!1),[g,m]=i.useState(!1),C=pn(()=>m(!0),{threshold:50,onFinish(){m(!1)},onCancel(){m(!1)}}),{setArtifactRename:p,renameArtifact:v,artifactRename:y,createDirectory:w,createFile:b,moveArtifacts:E,removeArtifactWithConfirmation:I,selectArtifactsInRange:R}=Ge(),[{isOver:T},M]=fu(()=>({accept:"artifact",drop(S,x){if(X(x.canDrop()))return;const N=c(S)?s:[S];E(N,e),e.open()},canDrop(S,x){const N=c(S)?s:[S];return x.isOver({shallow:!0})&&to(N)&&N.reduce((j,H)=>!(X(j)||H.parent===e||H===e||H instanceof lt&&H.hasDirectory(e)),!0)},collect(S){return{isOver:S.isOver({shallow:!0})&&S.canDrop()}}}),[s]),[{isDragging:_},F,D]=kr(()=>({type:"artifact",item:e,end(){m(!1)},canDrag(){return y!==e&&g},collect(S){return{isDragging:S.isDragging()}}}),[e,y,g]),[A,K,ee,te]=i.useMemo(()=>{if(s.length<2)return[!1,!1,!1,!1];let S=!0,x=!0,N=!0;for(const j of Array.from(s))j instanceof lt&&S?(x&&(x=j.isOpened),N&&(N=j.isClosed)):S=!1;return[S,x,N,X(x)&&X(N)]},[s]);i.useEffect(()=>{e.syncStateOpen=l},[e]),i.useEffect(()=>{D(Vr(),{captureDraggingState:!0})},[D]),i.useEffect(()=>{eo(o)||d||e.hasFile(o)&&e.open()},[o]);function V(S){S.stopPropagation(),S.shiftKey||S.metaKey?S.preventDefault():e.toggle();let x=s;S.metaKey?(c(e)?x=x.filter(N=>N!==e):x.push(e),a(x)):S.shiftKey&&x.length>0?R(e):(x.length>0&&(x=[]),x.push(e),a(x))}const U=s.length>1&&c(e);return u.jsx("div",{className:L("h-full",_&&"opacity-50"),children:u.jsxs("div",{ref:M,className:L(T&&X(_)&&"bg-primary-5"),children:[e.withParent&&u.jsx("div",{...C,ref:e.withParent?F:void 0,children:u.jsxs(W.Container,{artifact:e,className:L(y===e&&"bg-primary-10",g&&"bg-primary-10 !cursor-grabbing",f&&"bg-primary-10",n),style:r,handleSelect:V,children:[u.jsx(t.Icons,{isOpen:d||T&&X(_)}),y===e?u.jsx(W.Rename,{artifact:y,rename:v,close:()=>p(void 0)}):u.jsxs(W.ContextMenu,{trigger:u.jsx(W.ContextMenuTrigger,{children:u.jsx(t.Display,{directory:e})}),onOpenChange:h,children:[u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U&&X(A)?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U&&X(A),onSelect:S=>{S.stopPropagation(),s.length>1&&c(e)?s.forEach(x=>{K?x.collapse():ee?x.expand():te&&(x.isOpened?x.collapse():x.expand())}):e.isOpened?e.collapse():e.expand(),a([])},children:[A&&K&&"Collapse All",A&&ee&&"Expand All",A&&te&&"Toggle All",X(A)&&e.isOpened&&"Collapse",X(A)&&e.isClosed&&"Expand",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsx(Zt,{className:"h-[1px] bg-accent-200 m-2"}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onSelect:S=>{S.stopPropagation(),b(e)},children:["New File",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onSelect:S=>{S.stopPropagation(),w(e)},children:["New Folder",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsx(Zt,{className:"h-[1px] bg-accent-200 m-2"}),u.jsxs(Q,{className:L("py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 ",U?"opacity-50 cursor-not-allowed":"hover:bg-accent-500 hover:text-light"),disabled:U,onClick:S=>{S.stopPropagation()},onSelect:S=>{S.stopPropagation(),p(e)},children:["Rename",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-danger-500 hover:bg-danger-500 hover:text-light",onSelect:S=>{S.stopPropagation(),I(e)},children:["Remove ",c(e)?s.length:"",u.jsx("div",{className:"ml-auto pl-5"})]})]})]})}),(T&&X(_)||d||!e.withParent)&&e.withDirectories&&u.jsx("ul",{className:L(c(e)&&"bg-primary-5"),children:e.directories.map(S=>u.jsx("li",{title:S.name,children:u.jsx(t,{directory:S,style:{paddingLeft:e.withParent?`${e.level/2+.25}rem`:0}},S.id)},S.id))}),(T&&X(_)||d||!e.withParent)&&e.withFiles&&u.jsx("ul",{className:L(c(e)&&"bg-primary-5"),children:e.files.map(S=>u.jsx("li",{title:S.name,children:u.jsx(ce,{file:S,style:{paddingLeft:e.withParent?`${e.level/2+.25}rem`:0}},S.id)},S.id))})]})})};function Pu({directory:t}){return u.jsxs("div",{className:"w-full flex justify-between items-center py-[0.125rem]",children:[u.jsx("span",{title:t.name,className:"overflow-hidden overflow-ellipsis whitespace-nowrap",children:hn(t.name,50,20)}),u.jsx("span",{className:"inline-block text-xs rounded-full px-2 bg-neutral-10 ml-2",children:t.directories.length+t.files.length})]})}function Ru({hasChevron:t=!0,hasFolder:e=!0,isOpen:n=!1,className:r}){const o=n?Po:Ro,s=n?_o:Fo;return u.jsxs("div",{className:L("flex items-center mr-2",r),children:[t&&u.jsx(o,{className:"inline-block w-5"}),e&&u.jsx(s,{className:"inline-block w-4 fill-primary-500"})]})}De.Icons=Ru;De.Display=Pu;const Mu={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"};function Nu(){const t=k(a=>a.activeRange),e=k(a=>a.inActiveRange),{isDragging:n,currentOffset:r,artifact:o}=ou(a=>({artifact:a.getItem(),isDragging:a.isDragging(),currentOffset:a.getSourceClientOffset()})),s=i.useMemo(()=>Array.from(e(o)?t:new Set([o])).filter(Boolean),[t,o]);return u.jsx(u.Fragment,{children:n&&u.jsx("div",{style:Mu,children:u.jsx("div",{style:Au(r),className:"!cursor-grabbing !rounded-lg overflow-hidden",children:s.map(a=>u.jsxs("span",{children:[a instanceof lt&&u.jsxs(W.Container,{artifact:a,className:"bg-theme",children:[u.jsx(De.Icons,{hasChevron:!1}),u.jsx(De.Display,{directory:a})]},a.path),a instanceof Oo&&u.jsxs(W.Container,{artifact:a,className:"bg-theme",children:[u.jsx(ce.Icons,{}),u.jsx(ce.Display,{file:a})]},a.path)]},a.id))})})})}function Au(t){if(t==null)return{display:"none"};const{x:e,y:n}=t;return{display:"inline-block",transform:`translate(${e}px, ${n}px)`,filter:"drop-shadow(0 2px 12px rgba(0,0,0,0.45))"}}const W=function t({className:e}){const n=k(g=>g.project),r=k(g=>g.setSelectedFile),o=k(g=>g.activeRange),s=k(g=>g.setActiveRange),a=no(g=>g.addConfirmation),{isFetching:c}=ro(),{removeArtifacts:d,createDirectory:l,createFile:f}=Ge();function h(g){g.key==="Escape"&&s([]),g.ctrlKey&&g.key==="Backspace"&&o.length>0&&a({headline:"Removing Selected Files/Directories",description:`Are you sure you want to remove ${o.length} items?`,yesText:"Yes, Remove",noText:"No, Cancel",details:Array.from(o).map(m=>m.path),action:()=>{d(o)}})}return u.jsx("div",{tabIndex:0,className:L("flex flex-col w-full h-full overflow-hidden text-sm text-neutral-500 dark:text-neutral-400 font-regular select-none",e),onKeyDown:h,children:c?u.jsx("div",{className:"flex justify-center items-center w-full h-full",children:u.jsxs(oo,{className:"inline-block",children:[u.jsx(so,{className:"w-3 h-3 border border-neutral-10 mr-2"}),u.jsx("h3",{className:"text-md",children:"Getting Project Files..."})]})}):u.jsxs(u.Fragment,{children:[u.jsx(Io,{list:n.allFiles,searchBy:"path",displayBy:"name",size:io.sm,onSelect:r,direction:"top",isFullWidth:!0}),u.jsxs(t.ContextMenu,{trigger:u.jsx(t.ContextMenuTrigger,{className:"h-full pb-1",children:u.jsx(_c,{backend:Tu,children:u.jsxs("div",{className:"w-full relative h-full px-1 overflow-hidden overflow-y-auto hover:scrollbar scrollbar--vertical",children:[u.jsx(Nu,{}),u.jsx(De,{className:"z-20 relative",directory:n},n.id)]})})}),children:[u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 hover:bg-accent-500 hover:text-light",onSelect:g=>{g.stopPropagation(),f(n)},children:["New File",u.jsx("div",{className:"ml-auto pl-5"})]}),u.jsxs(Q,{className:"py-1.5 group leading-none rounded-md flex items-center relative pl-6 pr-2 select-none outline-none font-medium text-xs text-neutral-500 hover:bg-accent-500 hover:text-light",onSelect:g=>{g.stopPropagation(),l(n)},children:["New Folder",u.jsx("div",{className:"ml-auto pl-5"})]})]},n.id)]})})};function _u({trigger:t,children:e,onOpenChange:n}){return u.jsxs(ha,{onOpenChange:n,children:[t,u.jsx(ma,{children:u.jsx(va,{className:"bg-light rounded-md overflow-hidden shadow-lg py-2 px-1 z-50",onClick:r=>{r.stopPropagation()},children:e})})]})}function ju({children:t,className:e}){return u.jsx(pa,{className:L("flex w-full overflow-hidden",e),onContextMenu:n=>{n.stopPropagation()},children:t})}function Fu({artifact:t,rename:e,close:n}){const r=re.useRef(null),[o,s]=i.useState("");return i.useEffect(()=>{s(t.name),setTimeout(()=>{var a;(a=r.current)==null||a.focus()},100)},[t]),u.jsx("div",{className:"w-full flex items-center py-[0.125rem] pr-2",children:u.jsx("input",{ref:r,type:"text",className:"w-full overflow-hidden overflow-ellipsis bg-primary-900 text-primary-100",value:o,onInput:a=>{a.stopPropagation(),s(a.target.value)},onBlur:a=>{a.stopPropagation(),n()},onKeyDown:a=>{a.key==="Enter"&&(a.stopPropagation(),o.trim()!==""&&o!==t.name&&e(t,o),n()),a.key==="Escape"&&(a.stopPropagation(),n())}})})}function Lu({artifact:t,children:e,isSelected:n=!1,className:r,style:o,handleSelect:s,onDoubleClick:a}){const{setArtifactRename:c,isBottomGroupInActiveRange:d,isTopGroupInActiveRange:l,isMiddleGroupInActiveRange:f}=Ge(),h=k(m=>m.activeRange),g=k(m=>m.inActiveRange);return u.jsx("span",{tabIndex:0,className:L("w-full flex items-center group/file px-2",r,l(t)?"rounded-t-md":d(t)?"rounded-b-md":f(t)?"":g(t)&&"rounded-md",g(t)&&h.length>1&&h.indexOf(t)<h.length-1?"border-b border-primary-400":"border-b border-transparent",g(t)?"bg-primary-10 dark:bg-primary-20":n&&"rounded-md bg-neutral-10 text-neutral-600 dark:bg-dark-lighter dark:text-primary-500"),style:o,onClick:s,onDoubleClick:a,onKeyDown:m=>{m.key==="Enter"&&(m.stopPropagation(),c(t),s==null||s(m)),m.key===" "&&(m.stopPropagation(),s==null||s(m))},children:e})}W.ContextMenu=_u;W.ContextMenuTrigger=ju;W.Rename=Fu;W.Container=Lu;export{W as default};