django-admin-react 1.3.0__tar.gz → 1.3.2__tar.gz
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.
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/PKG-INFO +1 -1
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/static/admin_react/.vite/manifest.json +4 -4
- django_admin_react-1.3.2/django_admin_react/static/admin_react/assets/ColumnLayoutModal-d8DzodFV.js +5 -0
- django_admin_react-1.3.0/django_admin_react/static/admin_react/assets/JsonViewer-CGUvMntK.js → django_admin_react-1.3.2/django_admin_react/static/admin_react/assets/JsonViewer-CngogvZk.js +1 -1
- django_admin_react-1.3.2/django_admin_react/static/admin_react/assets/index-BhQX9Otw.js +8 -0
- django_admin_react-1.3.2/django_admin_react/static/admin_react/assets/index-Cfb0xrFR.css +1 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/static/admin_react/index.html +2 -2
- django_admin_react-1.3.2/django_admin_react/templates/django_admin_react/_experience_toggle_strip.html +41 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/pyproject.toml +1 -1
- django_admin_react-1.3.0/django_admin_react/static/admin_react/assets/ColumnLayoutModal-D4m6pUL5.js +0 -5
- django_admin_react-1.3.0/django_admin_react/static/admin_react/assets/index-Cb7PAxbs.js +0 -8
- django_admin_react-1.3.0/django_admin_react/static/admin_react/assets/index-CrqOF5FE.css +0 -1
- django_admin_react-1.3.0/django_admin_react/templates/django_admin_react/_experience_toggle_strip.html +0 -22
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/LICENSE +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/README.md +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/README.md +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/__init__.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/apps.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/audit.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/conf.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/pwa.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templates/README.md +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templates/admin/base_site.html +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templates/admin_react/README.md +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templates/admin_react/index.html +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templates/admin_react/login.html +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templates/admin_react/sw.js +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templatetags/__init__.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/templatetags/experience_toggle.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/urls.py +0 -0
- {django_admin_react-1.3.0 → django_admin_react-1.3.2}/django_admin_react/views.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"../../packages/details/src/JsonViewer.tsx": {
|
|
3
|
-
"file": "assets/JsonViewer-
|
|
3
|
+
"file": "assets/JsonViewer-CngogvZk.js",
|
|
4
4
|
"name": "JsonViewer",
|
|
5
5
|
"src": "../../packages/details/src/JsonViewer.tsx",
|
|
6
6
|
"isDynamicEntry": true,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
]
|
|
10
10
|
},
|
|
11
11
|
"index.html": {
|
|
12
|
-
"file": "assets/index-
|
|
12
|
+
"file": "assets/index-BhQX9Otw.js",
|
|
13
13
|
"name": "index",
|
|
14
14
|
"src": "index.html",
|
|
15
15
|
"isEntry": true,
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"src/ColumnLayoutModal.tsx"
|
|
19
19
|
],
|
|
20
20
|
"css": [
|
|
21
|
-
"assets/index-
|
|
21
|
+
"assets/index-Cfb0xrFR.css"
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
24
|
"src/ColumnLayoutModal.tsx": {
|
|
25
|
-
"file": "assets/ColumnLayoutModal-
|
|
25
|
+
"file": "assets/ColumnLayoutModal-d8DzodFV.js",
|
|
26
26
|
"name": "ColumnLayoutModal",
|
|
27
27
|
"src": "src/ColumnLayoutModal.tsx",
|
|
28
28
|
"isDynamicEntry": true,
|
django_admin_react-1.3.2/django_admin_react/static/admin_react/assets/ColumnLayoutModal-d8DzodFV.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{c as bt,d as c,R as P,r as Te,j as A,M as In,b as An,a as Gt}from"./index-BhQX9Otw.js";const Nn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Tn=bt("grip-vertical",Nn);const On=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],kn=bt("lock",On);const Ln=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],jn=bt("rotate-ccw",Ln);function zn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function we(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mt(e){return"nodeType"in e}function B(e){var t,n;return e?we(e)?e:mt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=B(e);return e instanceof t}function $e(e){return we(e)?!1:e instanceof B(e).HTMLElement}function _t(e){return e instanceof B(e).SVGElement}function xe(e){return e?we(e)?e.document:mt(e)?yt(e)?e:$e(e)||_t(e)?e.ownerDocument:document:document:document}const Z=tt?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Z(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Pn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function je(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Z(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ft(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function Xe(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function Jt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const ye=Jt(1),ze=Jt(-1);function Bn(e){return"clientX"in e&&"clientY"in e}function xt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function $n(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ht(e){if($n(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Bn(e)?{x:e.clientX,y:e.clientY}:null}const Pe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Pe.Translate.toString(e),Pe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),jt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fn(e){return e.matches(jt)?e:e.querySelector(jt)}const Xn={display:"none"};function Yn(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:Xn},n)}function Un(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Wn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Qt=c.createContext(null);function Hn(e){const t=c.useContext(Qt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Vn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Kn={draggable:`
|
|
2
|
+
To pick up a draggable item, press the space bar.
|
|
3
|
+
While dragging, use the arrow keys to move the item.
|
|
4
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
+
`},qn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Gn(e){let{announcements:t=qn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Kn}=e;const{announce:i,announcement:s}=Wn(),a=Xe("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),Hn(c.useMemo(()=>({onDragStart(d){let{active:h}=d;i(t.onDragStart({active:h}))},onDragMove(d){let{active:h,over:g}=d;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(d){let{active:h,over:g}=d;i(t.onDragOver({active:h,over:g}))},onDragEnd(d){let{active:h,over:g}=d;i(t.onDragEnd({active:h,over:g}))},onDragCancel(d){let{active:h,over:g}=d;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!l)return null;const f=P.createElement(P.Fragment,null,P.createElement(Yn,{id:r,value:o.draggable}),P.createElement(Un,{id:a,announcement:s}));return n?Te.createPortal(f,n):f}var T;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(T||(T={}));function Qe(){}function zt(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function _n(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const q=Object.freeze({x:0,y:0});function Zt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function en(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Jn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Pt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function tn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Bt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Bt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=Zt(Bt(l),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(en)},Zn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Pt(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=Pt(l),f=o.reduce((h,g,b)=>h+Zt(u[b],g),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(en)};function er(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,u=e.width*e.height,f=s*a,d=f/(l+u-f);return Number(d.toFixed(4))}return 0}const tr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=er(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(Jn)};function nr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function nn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:q}function rr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const or=rr(1);function ir(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function sr(e,t,n){const r=ir(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:l+f,bottom:u+d,left:l}}const ar={ignoreTransform:!1};function De(e,t){t===void 0&&(t=ar);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=B(e).getComputedStyle(e);u&&(n=sr(n,u,f))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function $t(e){return De(e,{ignoreTransform:!0})}function cr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function lr(e,t){return t===void 0&&(t=B(e).getComputedStyle(e)),t.position==="fixed"}function ur(e,t){t===void 0&&(t=B(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function nt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!$e(o)||_t(o)||n.includes(o))return n;const i=B(e).getComputedStyle(o);return o!==e&&ur(o,i)&&n.push(o),lr(o,i)?n:r(o.parentNode)}return e?r(e):n}function rn(e){const[t]=nt(e,1);return t??null}function lt(e){return!tt||!e?null:we(e)?e:mt(e)?yt(e)||e===xe(e).scrollingElement?window:$e(e)?e:null:null}function on(e){return we(e)?e.scrollX:e.scrollLeft}function sn(e){return we(e)?e.scrollY:e.scrollTop}function gt(e){return{x:on(e),y:sn(e)}}var k;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(k||(k={}));function an(e){return!tt||!e?!1:e===document.scrollingElement}function cn(e){const t={x:0,y:0},n=an(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const dr={x:.2,y:.2};function fr(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=dr);const{isTop:u,isBottom:f,isLeft:d,isRight:h}=cn(e),g={x:0,y:0},b={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=k.Backward,b.y=r*Math.abs((t.top+v.height-i)/v.height)):!f&&l>=t.bottom-v.height&&(g.y=k.Forward,b.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!h&&a>=t.right-v.width?(g.x=k.Forward,b.x=r*Math.abs((t.right-v.width-a)/v.width)):!d&&s<=t.left+v.width&&(g.x=k.Backward,b.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:b}}function hr(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ln(e){return e.reduce((t,n)=>ye(t,gt(n)),q)}function gr(e){return e.reduce((t,n)=>t+on(n),0)}function vr(e){return e.reduce((t,n)=>t+sn(n),0)}function pr(e,t){if(t===void 0&&(t=De),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);rn(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const br=[["x",["left","right"],gr],["y",["top","bottom"],vr]];class Dt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=nt(n),o=ln(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of br)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Oe{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function mr(e){const{EventTarget:t}=B(e);return e instanceof t?e:xe(e)}function ut(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var H;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(H||(H={}));function Ft(e){e.preventDefault()}function yr(e){e.stopPropagation()}var x;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(x||(x={}));const un={start:[x.Space,x.Enter],cancel:[x.Esc],end:[x.Space,x.Enter,x.Tab]},wr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case x.Right:return{...n,x:n.x+25};case x.Left:return{...n,x:n.x-25};case x.Down:return{...n,y:n.y+25};case x.Up:return{...n,y:n.y-25}}};class Ct{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Oe(xe(n)),this.windowListeners=new Oe(B(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(H.Resize,this.handleCancel),this.windowListeners.add(H.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(H.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&pr(r),n(q)}handleKeyDown(t){if(xt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=un,coordinateGetter:s=wr,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:q;this.referenceCoordinates||(this.referenceCoordinates=f);const d=s(t,{active:n,context:r.current,currentCoordinates:f});if(d){const h=ze(d,f),g={x:0,y:0},{scrollableAncestors:b}=r.current;for(const v of b){const p=t.code,{isTop:y,isRight:w,isLeft:m,isBottom:R,maxScroll:S,minScroll:E}=cn(v),D=hr(v),C={x:Math.min(p===x.Right?D.right-D.width/2:D.right,Math.max(p===x.Right?D.left:D.left+D.width/2,d.x)),y:Math.min(p===x.Down?D.bottom-D.height/2:D.bottom,Math.max(p===x.Down?D.top:D.top+D.height/2,d.y))},N=p===x.Right&&!w||p===x.Left&&!m,O=p===x.Down&&!R||p===x.Up&&!y;if(N&&C.x!==d.x){const I=v.scrollLeft+h.x,V=p===x.Right&&I<=S.x||p===x.Left&&I>=E.x;if(V&&!h.y){v.scrollTo({left:I,behavior:a});return}V?g.x=v.scrollLeft-I:g.x=p===x.Right?v.scrollLeft-S.x:v.scrollLeft-E.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(O&&C.y!==d.y){const I=v.scrollTop+h.y,V=p===x.Down&&I<=S.y||p===x.Up&&I>=E.y;if(V&&!h.x){v.scrollTo({top:I,behavior:a});return}V?g.y=v.scrollTop-I:g.y=p===x.Down?v.scrollTop-S.y:v.scrollTop-E.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,ye(ze(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ct.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=un,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Xt(e){return!!(e&&"distance"in e)}function Yt(e){return!!(e&&"delay"in e)}class Rt{constructor(t,n,r){var o;r===void 0&&(r=mr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=xe(s),this.documentListeners=new Oe(this.document),this.listeners=new Oe(r),this.windowListeners=new Oe(B(s)),this.initialCoordinates=(o=ht(i))!=null?o:q,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(H.Resize,this.handleCancel),this.windowListeners.add(H.DragStart,Ft),this.windowListeners.add(H.VisibilityChange,this.handleCancel),this.windowListeners.add(H.ContextMenu,Ft),this.documentListeners.add(H.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Xt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(H.Click,yr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(H.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=ht(t))!=null?n:q,u=ze(o,l);if(!r&&a){if(Xt(a)){if(a.tolerance!=null&&ut(u,a.tolerance))return this.handleCancel();if(ut(u,a.distance))return this.handleStart()}if(Yt(a)&&ut(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===x.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class St extends Rt{constructor(t){const{event:n}=t,r=xe(n.target);super(t,xr,r)}}St.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Dr={move:{name:"mousemove"},end:{name:"mouseup"}};var vt;(function(e){e[e.RightClick=2]="RightClick"})(vt||(vt={}));class Cr extends Rt{constructor(t){super(t,Dr,xe(t.event.target))}}Cr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===vt.RightClick?!1:(r?.({event:n}),!0)}}];const dt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Rr extends Rt{constructor(t){super(t,dt)}static setup(){return window.addEventListener(dt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(dt.move.name,t)};function t(){}}}Rr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var ke;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ke||(ke={}));var Ze;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ze||(Ze={}));function Sr(e){let{acceleration:t,activator:n=ke.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=Ze.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:h}=e;const g=Mr({delta:d,disabled:!i}),[b,v]=Pn(),p=c.useRef({x:0,y:0}),y=c.useRef({x:0,y:0}),w=c.useMemo(()=>{switch(n){case ke.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ke.DraggableRect:return o}},[n,o,l]),m=c.useRef(null),R=c.useCallback(()=>{const E=m.current;if(!E)return;const D=p.current.x*y.current.x,C=p.current.y*y.current.y;E.scrollBy(D,C)},[]),S=c.useMemo(()=>a===Ze.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!i||!u.length||!w){v();return}for(const E of S){if(r?.(E)===!1)continue;const D=u.indexOf(E),C=f[D];if(!C)continue;const{direction:N,speed:O}=fr(E,C,w,t,h);for(const I of["x","y"])g[I][N[I]]||(O[I]=0,N[I]=0);if(O.x>0||O.y>0){v(),m.current=E,b(R,s),p.current=O,y.current=N;return}}p.current={x:0,y:0},y.current={x:0,y:0},v()},[t,R,r,v,i,s,JSON.stringify(w),JSON.stringify(g),b,u,S,f,JSON.stringify(h)])}const Er={x:{[k.Backward]:!1,[k.Forward]:!1},y:{[k.Backward]:!1,[k.Forward]:!1}};function Mr(e){let{delta:t,disabled:n}=e;const r=ft(t);return Fe(o=>{if(n||!r||!o)return Er;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[k.Backward]:o.x[k.Backward]||i.x===-1,[k.Forward]:o.x[k.Forward]||i.x===1},y:{[k.Backward]:o.y[k.Backward]||i.y===-1,[k.Forward]:o.y[k.Forward]||i.y===1}}},[n,t,r])}function Ir(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Ar(e,t){return c.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Be;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Be||(Be={}));var pt;(function(e){e.Optimized="optimized"})(pt||(pt={}));const Ut=new Map;function Nr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=c.useState(null),{frequency:a,measure:l,strategy:u}=o,f=c.useRef(e),d=p(),h=je(d),g=c.useCallback(function(y){y===void 0&&(y=[]),!h.current&&s(w=>w===null?y:w.concat(y.filter(m=>!w.includes(m))))},[h]),b=c.useRef(null),v=Fe(y=>{if(d&&!n)return Ut;if(!y||y===Ut||f.current!==e||i!=null){const w=new Map;for(let m of e){if(!m)continue;if(i&&i.length>0&&!i.includes(m.id)&&m.rect.current){w.set(m.id,m.rect.current);continue}const R=m.node.current,S=R?new Dt(l(R),R):null;m.rect.current=S,S&&w.set(m.id,S)}return w}return y},[e,i,n,d,l]);return c.useEffect(()=>{f.current=e},[e]),c.useEffect(()=>{d||g()},[n,d]),c.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),c.useEffect(()=>{d||typeof a!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},a))},[a,d,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function p(){switch(u){case Be.Always:return!1;case Be.BeforeDragging:return n;default:return!n}}}function dn(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Tr(e,t){return dn(e,t)}function Or(e){let{callback:t,disabled:n}=e;const r=wt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function rt(e){let{callback:t,disabled:n}=e;const r=wt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function kr(e){return new Dt(De(e),e)}function Wt(e,t,n){t===void 0&&(t=kr);const[r,o]=c.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const s=Or({callback(l){if(e)for(const u of l){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=rt({callback:i});return Z(()=>{i(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function Lr(e){const t=dn(e);return nn(e,t)}const Ht=[];function jr(e){const t=c.useRef(e),n=Fe(r=>e?r&&r!==Ht&&e&&t.current&&e.parentNode===t.current.parentNode?r:nt(e):Ht,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function zr(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(i=>{const s=lt(i.target);s&&n(a=>a?(a.set(s,gt(s)),new Map(a)):null)},[]);return c.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const u=lt(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,gt(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const u=lt(l);u?.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>ye(i,s),q):ln(e):q,[e,t])}function Vt(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==q;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ze(e,n.current):q}function Pr(e){c.useEffect(()=>{if(!tt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Br(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function fn(e){return c.useMemo(()=>e?cr(e):null,[e])}const Kt=[];function $r(e,t){t===void 0&&(t=De);const[n]=e,r=fn(n?B(n):null),[o,i]=c.useState(Kt);function s(){i(()=>e.length?e.map(l=>an(l)?r:new Dt(t(l),l)):Kt)}const a=rt({callback:s});return Z(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),o}function Fr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return $e(t)?t:e}function Xr(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:f}of u)if($e(f)){r(d=>{const h=t(f);return d?{...d,width:h.width,height:h.height}:h});break}},[t]),i=rt({callback:o}),s=c.useCallback(u=>{const f=Fr(u);i?.disconnect(),f&&i?.observe(f),r(f?t(f):null)},[t,i]),[a,l]=Je(s);return c.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Yr=[{sensor:St,options:{}},{sensor:Ct,options:{}}],Ur={current:{}},_e={draggable:{measure:$t},droppable:{measure:$t,strategy:Be.WhileDragging,frequency:pt.Optimized},dragOverlay:{measure:De}};class Le extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Wr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Le,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qe},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:_e,measureDroppableContainers:Qe,windowRect:null,measuringScheduled:!1},Hr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qe,draggableNodes:new Map,over:null,measureDroppableContainers:Qe},ot=c.createContext(Hr),hn=c.createContext(Wr);function Vr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Le}}}function Kr(e,t){switch(t.type){case T.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case T.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case T.DragEnd:case T.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case T.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Le(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case T.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Le(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case T.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Le(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function qr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(ot),i=ft(r),s=ft(n?.id);return c.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!xt(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[l.current,u.current]){if(!f)continue;const d=Fn(f);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function Gr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function _r(e){return c.useMemo(()=>({draggable:{..._e.draggable,...e?.draggable},droppable:{..._e.droppable,...e?.droppable},dragOverlay:{..._e.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Jr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=c.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Z(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=nn(f,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const h=rn(u);h&&h.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const gn=c.createContext({...q,scaleX:1,scaleY:1});var de;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(de||(de={}));const Qr=c.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:f=Yr,collisionDetection:d=tr,measuring:h,modifiers:g,...b}=t;const v=c.useReducer(Kr,void 0,Vr),[p,y]=v,[w,m]=Vn(),[R,S]=c.useState(de.Uninitialized),E=R===de.Initialized,{draggable:{active:D,nodes:C,translate:N},droppable:{containers:O}}=p,I=D!=null?C.get(D):null,V=c.useRef({initial:null,translated:null}),K=c.useMemo(()=>{var j;return D!=null?{id:D,data:(j=I?.data)!=null?j:Ur,rect:V}:null},[D,I]),G=c.useRef(null),[Ce,Ye]=c.useState(null),[$,Ue]=c.useState(null),ee=je(b,Object.values(b)),Re=Xe("DndDescribedBy",s),We=c.useMemo(()=>O.getEnabled(),[O]),z=_r(h),{droppableRects:te,measureDroppableContainers:fe,measuringScheduled:Se}=Nr(We,{dragging:E,dependencies:[N.x,N.y],config:z.droppable}),U=Ir(C,D),He=c.useMemo(()=>$?ht($):null,[$]),ie=Mn(),ne=Tr(U,z.draggable.measure);Jr({activeNode:D!=null?C.get(D):null,config:ie.layoutShiftCompensation,initialRect:ne,measure:z.draggable.measure});const M=Wt(U,z.draggable.measure,ne),Ee=Wt(U?U.parentElement:null),_=c.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=O.getNodeFor((n=_.current.over)==null?void 0:n.id),re=Xr({measure:z.dragOverlay.measure}),ge=(r=re.nodeRef.current)!=null?r:U,ve=E?(o=re.rect)!=null?o:M:null,Mt=!!(re.nodeRef.current&&re.rect),It=Lr(Mt?null:M),it=fn(ge?B(ge):null),se=jr(E?he??U:null),Ve=$r(se),Ke=Gr(g,{transform:{x:N.x-It.x,y:N.y-It.y,scaleX:1,scaleY:1},activatorEvent:$,active:K,activeNodeRect:M,containerNodeRect:Ee,draggingNodeRect:ve,over:_.current.over,overlayNodeRect:re.rect,scrollableAncestors:se,scrollableAncestorRects:Ve,windowRect:it}),At=He?ye(He,N):null,Nt=zr(se),wn=Vt(Nt),xn=Vt(Nt,[M]),pe=ye(Ke,wn),be=ve?or(ve,Ke):null,Me=K&&be?d({active:K,collisionRect:be,droppableRects:te,droppableContainers:We,pointerCoordinates:At}):null,Tt=tn(Me,"id"),[ae,Ot]=c.useState(null),Dn=Mt?Ke:ye(Ke,xn),Cn=nr(Dn,(i=ae?.rect)!=null?i:null,M),st=c.useRef(null),kt=c.useCallback((j,F)=>{let{sensor:X,options:ce}=F;if(G.current==null)return;const W=C.get(G.current);if(!W)return;const Y=j.nativeEvent,J=new X({active:G.current,activeNode:W,event:Y,options:ce,context:_,onAbort(L){if(!C.get(L))return;const{onDragAbort:Q}=ee.current,oe={id:L};Q?.(oe),w({type:"onDragAbort",event:oe})},onPending(L,le,Q,oe){if(!C.get(L))return;const{onDragPending:Ae}=ee.current,ue={id:L,constraint:le,initialCoordinates:Q,offset:oe};Ae?.(ue),w({type:"onDragPending",event:ue})},onStart(L){const le=G.current;if(le==null)return;const Q=C.get(le);if(!Q)return;const{onDragStart:oe}=ee.current,Ie={activatorEvent:Y,active:{id:le,data:Q.data,rect:V}};Te.unstable_batchedUpdates(()=>{oe?.(Ie),S(de.Initializing),y({type:T.DragStart,initialCoordinates:L,active:le}),w({type:"onDragStart",event:Ie}),Ye(st.current),Ue(Y)})},onMove(L){y({type:T.DragMove,coordinates:L})},onEnd:me(T.DragEnd),onCancel:me(T.DragCancel)});st.current=J;function me(L){return async function(){const{active:Q,collisions:oe,over:Ie,scrollAdjustedTranslate:Ae}=_.current;let ue=null;if(Q&&Ae){const{cancelDrop:Ne}=ee.current;ue={activatorEvent:Y,active:Q,collisions:oe,delta:Ae,over:Ie},L===T.DragEnd&&typeof Ne=="function"&&await Promise.resolve(Ne(ue))&&(L=T.DragCancel)}G.current=null,Te.unstable_batchedUpdates(()=>{y({type:L}),S(de.Uninitialized),Ot(null),Ye(null),Ue(null),st.current=null;const Ne=L===T.DragEnd?"onDragEnd":"onDragCancel";if(ue){const at=ee.current[Ne];at?.(ue),w({type:Ne,event:ue})}})}}},[C]),Rn=c.useCallback((j,F)=>(X,ce)=>{const W=X.nativeEvent,Y=C.get(ce);if(G.current!==null||!Y||W.dndKit||W.defaultPrevented)return;const J={active:Y};j(X,F.options,J)===!0&&(W.dndKit={capturedBy:F.sensor},G.current=ce,kt(X,F))},[C,kt]),Lt=Ar(f,Rn);Pr(f),Z(()=>{M&&R===de.Initializing&&S(de.Initialized)},[M,R]),c.useEffect(()=>{const{onDragMove:j}=ee.current,{active:F,activatorEvent:X,collisions:ce,over:W}=_.current;if(!F||!X)return;const Y={active:F,activatorEvent:X,collisions:ce,delta:{x:pe.x,y:pe.y},over:W};Te.unstable_batchedUpdates(()=>{j?.(Y),w({type:"onDragMove",event:Y})})},[pe.x,pe.y]),c.useEffect(()=>{const{active:j,activatorEvent:F,collisions:X,droppableContainers:ce,scrollAdjustedTranslate:W}=_.current;if(!j||G.current==null||!F||!W)return;const{onDragOver:Y}=ee.current,J=ce.get(Tt),me=J&&J.rect.current?{id:J.id,rect:J.rect.current,data:J.data,disabled:J.disabled}:null,L={active:j,activatorEvent:F,collisions:X,delta:{x:W.x,y:W.y},over:me};Te.unstable_batchedUpdates(()=>{Ot(me),Y?.(L),w({type:"onDragOver",event:L})})},[Tt]),Z(()=>{_.current={activatorEvent:$,active:K,activeNode:U,collisionRect:be,collisions:Me,droppableRects:te,draggableNodes:C,draggingNode:ge,draggingNodeRect:ve,droppableContainers:O,over:ae,scrollableAncestors:se,scrollAdjustedTranslate:pe},V.current={initial:ve,translated:be}},[K,U,Me,be,C,ge,ve,te,O,ae,se,pe]),Sr({...ie,delta:N,draggingRect:be,pointerCoordinates:At,scrollableAncestors:se,scrollableAncestorRects:Ve});const Sn=c.useMemo(()=>({active:K,activeNode:U,activeNodeRect:M,activatorEvent:$,collisions:Me,containerNodeRect:Ee,dragOverlay:re,draggableNodes:C,droppableContainers:O,droppableRects:te,over:ae,measureDroppableContainers:fe,scrollableAncestors:se,scrollableAncestorRects:Ve,measuringConfiguration:z,measuringScheduled:Se,windowRect:it}),[K,U,M,$,Me,Ee,re,C,O,te,ae,fe,se,Ve,z,Se,it]),En=c.useMemo(()=>({activatorEvent:$,activators:Lt,active:K,activeNodeRect:M,ariaDescribedById:{draggable:Re},dispatch:y,draggableNodes:C,over:ae,measureDroppableContainers:fe}),[$,Lt,K,M,y,Re,C,ae,fe]);return P.createElement(Qt.Provider,{value:m},P.createElement(ot.Provider,{value:En},P.createElement(hn.Provider,{value:Sn},P.createElement(gn.Provider,{value:Cn},u)),P.createElement(qr,{disabled:a?.restoreFocus===!1})),P.createElement(Gn,{...a,hiddenTextDescribedById:Re}));function Mn(){const j=Ce?.autoScrollEnabled===!1,F=typeof l=="object"?l.enabled===!1:l===!1,X=E&&!j&&!F;return typeof l=="object"?{...l,enabled:X}:{enabled:X}}}),Zr=c.createContext(null),qt="button",eo="Draggable";function to(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Xe(eo),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:h}=c.useContext(ot),{role:g=qt,roleDescription:b="draggable",tabIndex:v=0}=o??{},p=l?.id===t,y=c.useContext(p?gn:Zr),[w,m]=Je(),[R,S]=Je(),E=Br(s,t),D=je(n);Z(()=>(d.set(t,{id:t,key:i,node:w,activatorNode:R,data:D}),()=>{const N=d.get(t);N&&N.key===i&&d.delete(t)}),[d,t]);const C=c.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&g===qt?!0:void 0,"aria-roledescription":b,"aria-describedby":f.draggable}),[r,g,v,p,b,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:C,isDragging:p,listeners:r?void 0:E,node:w,over:h,setNodeRef:m,setActivatorNodeRef:S,transform:y}}function no(){return c.useContext(hn)}const ro="Droppable",oo={timeout:25};function io(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Xe(ro),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(ot),f=c.useRef({disabled:n}),d=c.useRef(!1),h=c.useRef(null),g=c.useRef(null),{disabled:b,updateMeasurementsFor:v,timeout:p}={...oo,...o},y=je(v??r),w=c.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),g.current=null},p)},[p]),m=rt({callback:w,disabled:b||!s}),R=c.useCallback((C,N)=>{m&&(N&&(m.unobserve(N),d.current=!1),C&&m.observe(C))},[m]),[S,E]=Je(R),D=je(t);return c.useEffect(()=>{!m||!S.current||(m.disconnect(),d.current=!1,m.observe(S.current))},[S,m]),c.useEffect(()=>(a({type:T.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:h,data:D}}),()=>a({type:T.UnregisterDroppable,key:i,id:r})),[r]),c.useEffect(()=>{n!==f.current.disabled&&(a({type:T.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:l?.id===r,node:S,over:l,setNodeRef:E}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function so(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function qe(e){return e!==null&&e>=0}function ao(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function co(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const vn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Et(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},Ge={scaleX:1,scaleY:1},lo=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(a.top+a.height):u.top-a.top,...Ge}:null}const l=uo(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...Ge}:o<n&&o>=s?{x:0,y:a.height+l,...Ge}:{x:0,y:0,...Ge}};function uo(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const pn="Sortable",bn=P.createContext({activeIndex:-1,containerId:pn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vn,disabled:{draggable:!1,droppable:!1}});function fo(e){let{children:t,id:n,items:r,strategy:o=vn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:f}=no(),d=Xe(pn,n),h=a.rect!==null,g=c.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),b=s!=null,v=s?g.indexOf(s.id):-1,p=u?g.indexOf(u.id):-1,y=c.useRef(g),w=!ao(g,y.current),m=p!==-1&&v===-1||w,R=co(i);Z(()=>{w&&b&&f(g)},[w,g,b,f]),c.useEffect(()=>{y.current=g},[g]);const S=c.useMemo(()=>({activeIndex:v,containerId:d,disabled:R,disableTransforms:m,items:g,overIndex:p,useDragOverlay:h,sortedRects:so(g,l),strategy:o}),[v,d,R.draggable,R.droppable,m,g,p,l,h,o]);return P.createElement(bn.Provider,{value:S},t)}const ho=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},go=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},vo={duration:200,easing:"ease"},mn="transform",po=Pe.Transition.toString({property:mn,duration:0,easing:"linear"}),bo={roleDescription:"sortable"};function mo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=c.useState(null),a=c.useRef(n);return Z(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const u=De(r.current,{ignoreTransform:!0}),f={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(f.x||f.y)&&s(f)}}n!==a.current&&(a.current=n)},[t,n,r,o]),c.useEffect(()=>{i&&s(null)},[i]),i}function yo(e){let{animateLayoutChanges:t=go,attributes:n,disabled:r,data:o,getNewIndex:i=ho,id:s,strategy:a,resizeObserverConfig:l,transition:u=vo}=e;const{items:f,containerId:d,activeIndex:h,disabled:g,disableTransforms:b,sortedRects:v,overIndex:p,useDragOverlay:y,strategy:w}=c.useContext(bn),m=wo(r,g),R=f.indexOf(s),S=c.useMemo(()=>({sortable:{containerId:d,index:R,items:f},...o}),[d,o,R,f]),E=c.useMemo(()=>f.slice(f.indexOf(s)),[f,s]),{rect:D,node:C,isOver:N,setNodeRef:O}=io({id:s,data:S,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:I,activatorEvent:V,activeNodeRect:K,attributes:G,setNodeRef:Ce,listeners:Ye,isDragging:$,over:Ue,setActivatorNodeRef:ee,transform:Re}=to({id:s,data:S,attributes:{...bo,...n},disabled:m.draggable}),We=zn(O,Ce),z=!!I,te=z&&!b&&qe(h)&&qe(p),fe=!y&&$,Se=fe&&te?Re:null,He=te?Se??(a??w)({rects:v,activeNodeRect:K,activeIndex:h,overIndex:p,index:R}):null,ie=qe(h)&&qe(p)?i({id:s,items:f,activeIndex:h,overIndex:p}):R,ne=I?.id,M=c.useRef({activeId:ne,items:f,newIndex:ie,containerId:d}),Ee=f!==M.current.items,_=t({active:I,containerId:d,isDragging:$,isSorting:z,id:s,index:R,items:f,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),he=mo({disabled:!_,index:R,node:C,rect:D});return c.useEffect(()=>{z&&M.current.newIndex!==ie&&(M.current.newIndex=ie),d!==M.current.containerId&&(M.current.containerId=d),f!==M.current.items&&(M.current.items=f)},[z,ie,d,f]),c.useEffect(()=>{if(ne===M.current.activeId)return;if(ne&&!M.current.activeId){M.current.activeId=ne;return}const ge=setTimeout(()=>{M.current.activeId=ne},50);return()=>clearTimeout(ge)},[ne]),{active:I,activeIndex:h,attributes:G,data:S,rect:D,index:R,newIndex:ie,items:f,isOver:N,isSorting:z,isDragging:$,listeners:Ye,node:C,overIndex:p,over:Ue,setNodeRef:We,setActivatorNodeRef:ee,setDroppableNodeRef:O,setDraggableNodeRef:Ce,transform:he??He,transition:re()};function re(){if(he||Ee&&M.current.newIndex===R)return po;if(!(fe&&!xt(V)||!u)&&(z||_))return Pe.Transition.toString({...u,property:mn})}}function wo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function et(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const xo=[x.Down,x.Right,x.Up,x.Left],Do=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(xo.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];i.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const h=o.get(d.id);if(h)switch(e.code){case x.Down:r.top<h.top&&l.push(d);break;case x.Up:r.top>h.top&&l.push(d);break;case x.Left:r.left>h.left&&l.push(d);break;case x.Right:r.left<h.left&&l.push(d);break}});const u=Zn({collisionRect:r,droppableRects:o,droppableContainers:l});let f=tn(u,"id");if(f===s?.id&&u.length>1&&(f=u[1].id),f!=null){const d=i.get(n.id),h=i.get(f),g=h?o.get(h.id):null,b=h?.node.current;if(b&&g&&d&&h){const p=nt(b).some((E,D)=>a[D]!==E),y=yn(d,h),w=Co(d,h),m=p||!y?{x:0,y:0}:{x:w?r.width-g.width:0,y:w?r.height-g.height:0},R={x:g.left,y:g.top};return m.x&&m.y?R:ze(R,m)}}}};function yn(e,t){return!et(e)||!et(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Co(e,t){return!et(e)||!et(t)||!yn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Mo({onClose:e,orderedDescriptors:t,isPk:n,hiddenCols:r,visibleColumnCount:o,onToggle:i,onReorder:s,isCustomised:a,onReset:l}){const u=_n(zt(St,{activationConstraint:{distance:4}}),zt(Ct,{coordinateGetter:Do})),f=t.find(b=>n(b.name)),d=t.filter(b=>!n(b.name)),h=d.map(b=>b.name);function g(b){const{active:v,over:p}=b;if(!p||v.id===p.id)return;const y=h.indexOf(String(v.id)),w=h.indexOf(String(p.id));y===-1||w===-1||s(Et(h,y,w))}return A.jsxs(In,{title:"Layout",onClose:e,children:[A.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[A.jsx("p",{className:"text-xs text-gray-500",children:"Toggle to show or hide. Drag the handle to reorder (keyboard: Tab to a handle, then Space + arrow keys + Space to drop)."}),A.jsx(An,{isDirty:a,onReset:l,label:"Reset",disabledHint:"Layout is already at default",icon:A.jsx(jn,{className:"h-4 w-4","aria-hidden":!0}),title:"Reset to the default layout"})]}),A.jsxs("ul",{className:"space-y-1",children:[f?A.jsx(Ro,{label:f.label,tooltip:"The primary-key column always shows first."}):null,A.jsx(Qr,{sensors:u,collisionDetection:Qn,onDragEnd:g,children:A.jsx(fo,{items:h,strategy:lo,children:d.map(b=>{const v=!r.has(b.name),p=v&&o<=1;return A.jsx(So,{id:b.name,label:b.label,visible:v,disabled:p,onToggle:()=>i(b.name,o)},b.name)})})})]})]})}function Ro({label:e,tooltip:t}){return A.jsxs("li",{className:"flex items-center gap-2 rounded border border-transparent bg-gray-50 px-1 py-1","aria-label":`${e} (locked first)`,children:[A.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-gray-400",title:t,children:A.jsx(kn,{className:"h-3.5 w-3.5","aria-hidden":!0})}),A.jsxs("label",{className:"flex flex-1 items-center gap-2 text-sm text-gray-500",children:[A.jsx(Gt,{checked:!0,disabled:!0,onChange:()=>{}}),A.jsx("span",{title:t,children:e})]})]})}function So({id:e,label:t,visible:n,disabled:r,onToggle:o}){const{attributes:i,listeners:s,setNodeRef:a,setActivatorNodeRef:l,transform:u,transition:f,isDragging:d}=yo({id:e}),h={transform:Pe.Transform.toString(u),transition:f};return A.jsxs("li",{ref:a,style:h,className:["flex items-center gap-2 rounded border px-1 py-1",d?"z-10 border-blue-300 bg-white shadow-lg":"border-transparent hover:border-gray-200"].join(" "),children:[A.jsx("button",{ref:l,type:"button","aria-label":`Reorder ${t}`,title:`Drag to reorder ${t}`,className:"cursor-grab touch-none rounded p-0.5 text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 active:cursor-grabbing",...i,...s,children:A.jsx(Tn,{className:"h-4 w-4 shrink-0","aria-hidden":!0})}),A.jsxs("label",{className:`flex flex-1 items-center gap-2 text-sm ${r?"text-gray-400":"text-gray-800"}`,children:[A.jsx(Gt,{checked:n,disabled:r,onChange:o}),t]})]})}export{Mo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as d,d as l,j as e,C as h}from"./index-BhQX9Otw.js";const p=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],g=d("chevron-right",p);const y=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],j=d("copy",y);function N({raw:t,parsed:r}){const[s,c]=l.useState(!1);async function a(){try{await navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),2e3)}catch{}}return e.jsxs("div",{className:"relative w-full overflow-x-auto rounded border border-gray-200 bg-gray-50 p-3 font-mono text-xs leading-relaxed text-gray-800 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200",children:[e.jsx("button",{type:"button",onClick:a,"aria-label":"Copy JSON",title:s?"Copied":"Copy",className:"absolute right-2 top-2 inline-flex h-6 w-6 items-center justify-center rounded border border-gray-300 bg-white text-gray-600 hover:bg-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700",children:s?e.jsx(h,{className:"h-3.5 w-3.5 text-green-600","aria-hidden":!0}):e.jsx(j,{className:"h-3.5 w-3.5","aria-hidden":!0})}),e.jsx(o,{value:r,depth:0})]})}function o({value:t,depth:r}){return t===null?e.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"null"}):typeof t=="boolean"?e.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:t?"true":"false"}):typeof t=="number"?e.jsx("span",{className:"text-blue-700",children:String(t)}):typeof t=="string"?e.jsxs("span",{className:"text-green-700 dark:text-green-400",children:['"',t,'"']}):Array.isArray(t)?e.jsx(u,{value:t,depth:r}):typeof t=="object"?e.jsx(m,{value:t,depth:r}):e.jsx("span",{className:"text-gray-500",children:String(t)})}function m({value:t,depth:r}){const s=Object.keys(t),[c,a]=l.useState(r<2);return s.length===0?e.jsx("span",{className:"text-gray-500",children:"{}"}):e.jsx(x,{open:c,onToggle:()=>a(n=>!n),collapsedLabel:`{…} ${s.length} ${s.length===1?"key":"keys"}`,openBracket:"{",closeBracket:"}",depth:r,children:s.map((n,i)=>e.jsxs("div",{className:"pl-4",children:[e.jsxs("span",{className:"text-rose-700 dark:text-rose-400",children:['"',n,'"']}),e.jsx("span",{className:"text-gray-500",children:": "}),e.jsx(o,{value:t[n],depth:r+1}),i<s.length-1?e.jsx("span",{className:"text-gray-500",children:","}):null]},n))})}function u({value:t,depth:r}){const[s,c]=l.useState(r<2);return t.length===0?e.jsx("span",{className:"text-gray-500",children:"[]"}):e.jsx(x,{open:s,onToggle:()=>c(a=>!a),collapsedLabel:`[…] ${t.length} ${t.length===1?"item":"items"}`,openBracket:"[",closeBracket:"]",depth:r,children:t.map((a,n)=>e.jsxs("div",{className:"pl-4",children:[e.jsx(o,{value:a,depth:r+1}),n<t.length-1?e.jsx("span",{className:"text-gray-500",children:","}):null]},n))})}function x({open:t,onToggle:r,collapsedLabel:s,openBracket:c,closeBracket:a,depth:n,children:i}){return e.jsxs("span",{children:[e.jsx("button",{type:"button",onClick:r,"aria-expanded":t,className:"inline-flex items-center align-baseline text-gray-500 hover:text-gray-800 dark:hover:text-gray-200",children:e.jsx(g,{className:`h-3 w-3 shrink-0 transition-transform ${t?"rotate-90":""}`,"aria-hidden":!0})}),e.jsx("span",{className:"text-gray-500",children:c}),t?e.jsxs(e.Fragment,{children:[i,e.jsx("div",{className:n===0?"":"pl-0",children:e.jsx("span",{className:"text-gray-500",children:a})})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"px-1 text-gray-500",children:s}),e.jsx("span",{className:"text-gray-500",children:a})]})]})}export{N as default};
|