@vuu-ui/vuu-layout 0.5.18 → 0.5.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/package.json +3 -3
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Dr from"classnames";import{Button as io,useControlled as br}from"@salt-ds/core";import so from"classnames";import{useCallback as xr}from"react";import{jsx as Se,jsxs as Er}from"react/jsx-runtime";var te="vuuDrawer",ao=e=>typeof e=="string"?e:e+"px",Rr=(e,t,o)=>{let n=t!==void 0,r=o!==void 0;if(!(!e&&!r&&!n))return!r&&!n?e:{...e,"--drawer-size":n?ao(t):void 0,"--drawer-peek-size":r?ao(o):void 0}},lo=({children:e,className:t,clickToOpen:o,defaultOpen:n,sizeOpen:r,sizeClosed:i,style:s,open:a,position:l="left",inline:c,onClick:p,peekaboo:m=!1,toggleButton:u,...f})=>{let[h,g]=br({controlled:a,default:n!=null?n:!1,name:"Drawer",state:"open"}),y=so(te,t,`${te}-${l}`,{[`${te}-open`]:h,[`${te}-inline`]:c,[`${te}-over`]:!c,[`${te}-peekaboo`]:m}),d=xr(()=>{console.log("toggleDrawer"),g(!h)},[h,g]),b=Rr(s,r,i),E=o?d:p,R=()=>Se("div",{className:so("vuuToggleButton-container"),children:h?Se(io,{"aria-label":"close",onClick:d,"data-icon":"close",variant:"secondary"}):Se(io,{"aria-label":"open",onClick:d,"data-icon":"close",variant:"secondary"})});return Er("div",{...f,className:y,onClick:E,style:b,children:[u=="start"?R():null,Se("div",{className:`${te}-liner`,children:Se("div",{className:`${te}-content`,children:e})}),u=="end"?R():null]})};lo.displayName="Drawer";var ht=lo;import{partition as mo}from"@vuu-ui/vuu-utils";var co={},po={},oe={};function $(e){return co[e]===!0}function Sr(e){return po[e]===!0}var uo=e=>$(e)||Sr(e),pl=e=>!!oe[e];function I(e,t,o="component"){oe[e]=t,o==="container"?co[e]=!0:o==="view"&&(po[e]=!0)}import{jsx as vr,jsxs as Lr}from"react/jsx-runtime";var Tr=e=>e.type===ht,wr=({props:{position:e="left"}})=>e.match(/top|bottom/),gt=e=>{let{children:t,className:o,id:n,style:r}=e,i="hwChest",[s,a]=mo(t,Tr),[l,c]=mo(s,wr),p=l.length===0?"horizontal":c.length===0?"vertical":"both",m=Dr(i,o,`${i}-${p}`);return Lr("div",{className:m,id:n,style:r,children:[s,vr("div",{className:`${i}-content`,children:a})]})};gt.displayName="Chest";var Pr=gt;I("Chest",gt,"container");import{forwardRef as Mr}from"react";import{jsx as Cr}from"react/jsx-runtime";var yt=Mr(function({resizeable:t,...o},n){return Cr("div",{...o,className:"Component",ref:n})});yt.displayName="Component";var bt=yt;I("Component",yt);import le from"react";var Ar={},w=(e,t)=>{var n;let o=T(e);return(n=o[t])!=null?n:o[`data-${t}`]},T=e=>(e==null?void 0:e.props)||e||Ar,fo=e=>{let t=T(e);if(t.children){let{children:[o,...n]}=t;return n.length>0&&console.warn(`getChild expected a single child, found ${n.length+1}`),o}};function P(e){var t;if(e){let o=e.type;if(typeof o=="function"||typeof o=="object"){let n=o.displayName||o.name||((t=o.type)==null?void 0:t.name);if(typeof n=="string")return n}if(typeof e.type=="string")return e.type;if(e.constructor)return e.constructor.displayName;throw Error("typeOf unable to determine type of element")}}var kl=(e,t)=>P(e)===t;var zr=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)};function q(e,t){let{"data-path":o,path:n=o}=T(e);return t==="0"||t===n?null:V(e,zr(t),!0)}function Q(e,t){let{children:o,...n}=T(e);if(t(n))return e;if(le.Children.count(o)>0){let r=le.isValidElement(o)?[o]:o;for(let i of r){let s=Q(i,t);if(s)return s}}}function Ir(e,t){if(t===e)return null;let{path:o,children:n}=T(e),{idx:r,finalStep:i}=Y(o,w(t,"path"));return i?e:n===void 0||n[r]===void 0?null:Ir(n[r],t)}var kr=(e,t)=>{if(le.isValidElement(e)&&t==0)return e;if(Array.isArray(e))return e[t]};function ho(e,t){let o=t.split("."),n=[e],r=i=>le.isValidElement(i.props.children)?[i.props.children]:i.props.children;for(let i=0;i<o.length;i++){let s=parseInt(o[i]),a=n[s];if(i===o.length-1)return a;n=r(a)}}function V(e,t,o=!1){let{"data-path":n,path:r=n}=T(e);if(t.indexOf(r)!==0)throw Error(`pathUtils.followPath path ${t} is not within source path ${r}`);let i=t.slice(r.length+1);if(i==="")return e;let s=e,a=i.split(".");for(let l=0;l<a.length;l++){if(le.Children.count(s.props.children)===0){let c=`element at 0.${a.slice(0,l).join(".")} has no children, so cannot fulfill rest of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c);return}if(s=kr(s.props.children,parseInt(a[l])),s===void 0){let c=`model at 0.${a.slice(0,l).join(".")} has no children that fulfill next step of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c)}}return s}function Vl(e,t){let o=q(e,t),n=t.split(".").map(r=>parseInt(r,10));if(o){let r=n.pop(),{children:i}=o.props;if(i.length-1>r)return Fe(i[r+1]);{let s=n.pop(),a=q(e,w(o,"path"));if(a&&typeof s=="number"&&(n=a.props.path.split(".").map(l=>parseInt(l,10)),a.props.children.length-1>s)){let l=a.props.children[s+1];return $(P(l))?Fe(l):l}}}return Fe(e)}function Wl(e,t){let o=t.split(".").map(i=>parseInt(i,10)),n=o.pop(),r=q(e,t);if(r!=null&&typeof n=="number"){let{children:i}=r.props;if(n>0)return Ne(i[n-1]);for(;o.length>1;)if(n=o.pop(),r=q(e,w(r,"path")),n>0){let s=r.props.children[n-1];return $(P(s))?Ne(s):s}}return Ne(e)}function Fe(e){if($(P(e))){let{children:t}=e.props||e;return Fe(t[0])}return e}function Ne(e){if($(P(e))){let{children:t}=e.props||e;return Ne(t[t.length-1])}return e}function Y(e,t,o=!1){if(e===t)return{idx:-1,finalStep:!0};let n=`${e}.`;if(!t.startsWith(n))throw Error("pathUtils nextStep has strayed from the path");let r=o?0:1,i=t.replace(n,"").split(".").map(s=>parseInt(s,10));return{idx:i[0],finalStep:i.length===r}}function O(e,t,o){if(w(e,"path")===t)return e;let n=[];le.Children.forEach(e.props.children,(i,s)=>{w(i,"path")?n.push(O(i,`${t}.${s}`)):n.push(i)});let r=e.props["data-path"]?"data-path":"path";return le.cloneElement(e,{[r]:t,...o},n)}function Gl(e,t){typeof e=="function"?e(t):e&&(e.current=t)}var xt=e=>{if(typeof e!="number")throw Error(`"no support yet for flex value ${e}`);return{flexBasis:0,flexGrow:1,flexShrink:1}};var pe={north:1,east:2,south:4,west:8,header:16,centre:32,absolute:64},De={AFTER:"after",BEFORE:"before"},F=Object.freeze({North:ce("north"),East:ce("east"),South:ce("south"),West:ce("west"),Header:ce("header"),Centre:ce("centre"),Absolute:ce("absolute")});function ce(e){return Object.freeze({offset:e==="north"||e==="west"?0:e==="south"||e==="east"?1:NaN,valueOf:function(){return pe[e]},toString:function(){return e},North:e==="north",South:e==="south",East:e==="east",West:e==="west",Header:e==="header",Centre:e==="centre",NorthOrSouth:e==="north"||e==="south",EastOrWest:e==="east"||e==="west",NorthOrWest:e==="north"||e==="west",SouthOrEast:e==="east"||e==="south",Absolute:e==="absolute"})}var go=F.North,yo=F.South,Rt=F.East,Et=F.West,Br=F.Header,Or=F.Centre,he=class{static measure(t,o=[]){let n={};return Fr(t,n,o),n}static allBoxesContainingPoint(t,o,n,r,i){return Eo(t,o,n,r,i).reverse()}};function St(e,t,o,n=30){let r=o.right-o.left,i=o.bottom-o.top,s=e-o.left,a=t-o.top,l=0;return s<n&&(l+=8),s>r-n&&(l+=2),a<n&&(l+=1),a>i-n&&(l+=4),{pctX:s/r,pctY:a/i,closeToTheEdge:l}}function Dt(e,t,o,n){let{BEFORE:r,AFTER:i}=De,{pctX:s,pctY:a,closeToTheEdge:l}=St(e,t,o),c,p;if(n==="row")c=s<.5?Et:Rt;else if(o.header&&Ve(o.header,e,t))if(c=Br,o.Stack){let m=o.Stack.length;if(m===0)p={index:-1,left:o.left,positionRelativeToTab:i,width:0};else{let u=o.Stack.find(({left:f,right:h})=>e>=f&&e<=h);if(u){let f=u.right-u.left;p={index:o.Stack.indexOf(u),left:u.left,positionRelativeToTab:(e-u.left)/f<.5?r:i,width:f}}else p={left:o.Stack[m-1].right,width:0,index:m,positionRelativeToTab:i}}}else if(o.header.titleWidth){let m=o.header.titleWidth;p={index:-1,left:o.left,positionRelativeToTab:(e-o.left)/m<.5?r:i,width:m}}else p={left:o.left,width:0,positionRelativeToTab:r,index:-1};else c=Hr(e,t,o,s,a);return{position:c,x:e,y:t,closeToTheEdge:l,tab:p}}function Hr(e,t,o,n,r){let i=$r(o,.2);if(Ve(i,e,t))return Or;switch(`${r<.5?"north":"south"}${n<.5?"west":"east"}`){case"northwest":return n>r?go:Et;case"northeast":return 1-n>r?go:Rt;case"southeast":return n>r?Rt:yo;case"southwest":return 1-n>r?Et:yo;default:}}function $r({right:e,left:t,top:o,bottom:n},r){let i=(1-r)/2,s=(e-t)*i,a=(n-o)*i;return{left:t+s,top:o+a,right:e-s,bottom:n-a}}function Fr(e,t,o){let{id:n,"data-path":r,path:i=r}=T(e),s=P(e);if(n&&i){let[a,l]=Ro(e);bo(e,a,l,t),$(s)&&xo(e,t,o)}}function bo(e,t,o,n){let{"data-path":r,path:i=r,header:s}=T(e);n[i]=t;let a=P(e);if(s||a==="Stack"){let l=o.querySelector(".vuuHeader");if(l){let{top:c,left:p,right:m,bottom:u}=l.getBoundingClientRect();if(n[i].header={top:Math.round(c),left:Math.round(p),right:Math.round(m),bottom:Math.round(u)},a==="Stack")n[i].Stack=Array.from(l.querySelectorAll(".saltTab")).map(f=>f.getBoundingClientRect()).map(({left:f,right:h})=>({left:f,right:h}));else{let f=l.querySelector('[class^="vuuHeader-title"]'),{header:h}=n[i];f&&h&&(h.titleWidth=f.clientWidth)}}}return n[i]}function xo(e,t,o,n=0,r=0,i=0,s=0){let{children:a,"data-path":l,path:c=l,style:p,active:m=0}=T(e),u=P(e),f=u==="Flexbox",h=u==="Stack",g=f&&p.flexDirection==="column",y=f&&p.flexDirection==="row",b=(h?a.filter((R,S)=>S===m):a.filter(Nr)).map(R=>{let[S,x]=Ro(R);return[{...S,top:S.top-i,right:S.right+r,bottom:S.bottom+s,left:S.left-n},x,R]}),E=b.map(([R,S,x],D,v)=>{let C,B,L,k,M,A,z=v.length-1;y?(M=D===0?0:R.left-v[D-1][0].right,A=D===z?0:v[D+1][0].left-R.right,C=D===0||M===0?0:M,B=D===z||A===0?0:A-A/2,R.left-=C,R.right+=B,L=i,k=s):g&&(M=D===0?0:R.top-v[D-1][0].bottom,A=D===z?0:v[D+1][0].top-R.bottom,L=D===0||M===0?0:M,k=D===z||A===0?0:A-A/2,R.top-=L,R.bottom+=k,C=n,B=r);let Z=bo(x,R,S,t),W=P(x);return $(W)&&xo(x,t,o,C,B,L,k),Z});b.length&&(t[c].children=E)}function Nr(e){let{id:t}=T(e),o=document.getElementById(t);return o?o.dataset.dragging!=="true":(console.warn(`BoxModel: no element found with id #${t}`),!1)}function Ro(e){let{id:t}=T(e);if(t===void 0)throw Error("`BoxModel.measureComponentElement, component has no id");let o=document.getElementById(t);if(!o)throw Error("BoxModel.measureComponentElement, no DOM element found for component");let{top:n,left:r,right:i,bottom:s,height:a,width:l}=o.getBoundingClientRect(),c,p=P(e);if($(p)){let m=o.scrollHeight;m>a&&(c={id:t,scrollHeight:m,scrollTop:o.scrollTop})}return[{top:Math.round(n),left:Math.round(r),right:Math.round(i),bottom:Math.round(s),height:Math.round(a),width:Math.round(l),scrolling:c},o,e]}function Eo(e,t,o,n,r,i=[]){let{children:s,"data-path":a,path:l=a}=T(e),c=P(e),p=t[l];if(!Ve(p,o,n))return i;if(r&&r.length){if(r.includes(l))i.push(e);else if(!r.some(m=>m.startsWith(l)))return i}else i.push(e);if(!$(c)||p.header&&Ve(p.header,o,n))return i;p.scrolling&&Vr(p,o,n);for(let m=0;m<s.length;m++){if(c==="Stack"&&e.props.active!==m)continue;let u=Eo(s[m],t,o,n,r);if(u.length)return i.concat(u)}return i}function Ve(e,t,o){if(e)return t>=e.left&&t<e.right&&o>=e.top&&o<e.bottom}function Vr({top:e,bottom:t,scrolling:o},n,r){if(o){let{id:i,scrollTop:s,scrollHeight:a}=o,l=t-e;if(s===0&&t-r<50){let c=a-l;document.getElementById(i).scrollTo({left:0,top:c,behavior:"smooth"}),o.scrollTop=c}else if(s>0&&r-e<50)document.getElementById(i).scrollTo({left:0,top:0,behavior:"smooth"}),o.scrollTop=0;else return!1}else return!1}var Wr=.4,We=class{constructor(t,o,n,r,i){this.init(t,o,n,r,i)}init(t,o,n,r,i){let{left:s,top:a}=r,{pctX:l,pctY:c}=St(o,n,r),p=Wr,m=l*r.width,u=r.width-m,f=c*r.height,h=r.height-f,g=r.width*p,y=r.height*p,d=1-p,b=m*d,E=f*d,R=u*d,S=h*d;this.intrinsicSize=i,this.constraint={zone:{x:{lo:t.left,hi:t.right},y:{lo:t.top,hi:t.bottom}},pos:{x:{lo:t.left-b,hi:t.right-r.width+R},y:{lo:t.top-E,hi:t.bottom-r.height+S}},mouse:{x:{lo:t.left+g*l,hi:t.right-g*(1-l)},y:{lo:t.top+y*c,hi:t.bottom-y*(1-c)}}},this.x={pos:s,lo:!1,hi:!1,mousePos:o,mousePct:l},this.y={pos:a,lo:!1,hi:!1,mousePos:n,mousePct:c}}outOfBounds(){return this.x.lo||this.x.hi||this.y.lo||this.y.hi}inBounds(){return!this.outOfBounds()}dropX(){return this.dropXY("x")}dropY(){return this.dropXY("y")}hasIntrinsicSize(){var t,o;return((t=this==null?void 0:this.intrinsicSize)==null?void 0:t.height)&&((o=this==null?void 0:this.intrinsicSize)==null?void 0:o.width)}update(t,o){let n=this[t],r=this.constraint.mouse[t],i=this.constraint.pos[t],s=n.pos,a=o-n.mousePos;return a<0?n.lo||(o<r.lo?(n.lo=!0,n.pos=i.lo):n.hi?o<r.hi&&(n.hi=!1,n.pos+=a):n.pos+=a):a>0&&(n.hi||(o>r.hi?(n.hi=!0,n.pos=i.hi):n.lo?o>r.lo&&(n.lo=!1,n.pos+=a):n.pos+=a)),n.mousePos=o,s!==n.pos}dropXY(t){let o=this[t],n=this.constraint.zone[t];return o.lo?Math.max(n.lo,o.mousePos):o.hi?Math.min(o.mousePos,Math.round(n.hi)-1):o.mousePos}};var ac=e=>e.pos.tab&&P(e.component)==="Stack"&&e.pos.position.Header,{north:_r,south:Gr,east:Ur,west:Xr}=pe,Zr=Ur+Xr,Yr=_r+Gr,ne=class{constructor({component:t,pos:o,clientRect:n,nextDropTarget:r}){this.component=t,this.pos=o,this.clientRect=n,this.nextDropTarget=r,this.active=!1,this.dropRect=void 0}targetTabPos(t){let{left:o,width:n,positionRelativeToTab:r}=t;return r===De.BEFORE?o:o+n}getTargetDropOutline(t,o){if(this.pos.tab)return this.getDropTabOutline(t,this.pos.tab);if(o&&o.hasIntrinsicSize())return this.getIntrinsicDropRect(o);{let[n,r,i,s]=this.getDropRectOutline(t,o);return{l:n,t:r,r:i,b:s}}}getDropTabOutline(t,o){var d,b;let{clientRect:{top:n,left:r,right:i,bottom:s,header:a}}=this,l=0,c=Math.round(t/2)+l,p=Math.round(n),m=Math.round(r+c),u=Math.round(i-c),f=Math.round(s-c),h=this.targetTabPos(o),g=60,y=((d=a==null?void 0:a.bottom)!=null?d:0)-((b=a==null?void 0:a.top)!=null?b:0);return{l:m,t:p,r:u,b:f,tabLeft:h,tabWidth:g,tabHeight:y}}getIntrinsicDropRect(t){var g,y,d,b;let{pos:o,clientRect:n}=this,{x:r,y:i}=t,s=(y=(g=t.intrinsicSize)==null?void 0:g.height)!=null?y:0,a=(b=(d=t.intrinsicSize)==null?void 0:d.height)!=null?b:0;s&&s>n.height?(console.log("DropTarget: we're going to blow the gaff"),s=n.height):a&&a>n.width&&(console.log("DropTarget: we're going to blow the gaff"),a=n.width);let l=Math.min(n.right-a,Math.max(n.left,Math.round(o.x-r.mousePct*a))),c=Math.min(n.bottom-s,Math.max(n.top,Math.round(o.y-i.mousePct*s))),[p,m,u,f]=this.dropRect=[l,c,l+a,c+s],h=o.position.EastOrWest?[p,n.top,p,n.bottom,u,n.top,u,n.bottom]:[n.left,m,n.right,m,n.left,f,n.right,f];return{l:p,r:u,t:m,b:f,guideLines:h}}getDropRectOutline(t,o){var b,E,R;let{pos:n,clientRect:r}=this,{width:i,height:s,position:a}=n,{width:l,height:c}=(b=o==null?void 0:o.intrinsicSize)!=null?b:{},p=(E=c!=null?c:s)!=null?E:0,m=(R=l!=null?l:i)!=null?R:0;this.dropRect=void 0;let{top:u,left:f,right:h,bottom:g}=r,y=0,d=Math.round(t/2)+y;switch(a){case F.North:case F.Header:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,u+d,f+m-d,u+d+x]:[f+d,u+d,h-d,u+d+x]}case F.West:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[f+d,u+d,f-d+x,u+p+d]:[f+d,u+d,f-d+x,g-d]}case F.East:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[h-d-x,u+d,h-d,u+p+d]:[h-d-x,u+d,h-d,g-d]}case F.South:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,g-d-x,f+m-d,g-d]:[f+d,g-d-x,h-d,g-d]}case F.Centre:return[f+d,u+d,h-d,g-d];default:return console.warn(`DropTarget does not recognize position ${a}`),null}}activate(){return this.active=!0,this}toArray(){let t=this,o=[t];for(;t=t.nextDropTarget;)o.push(t);return o}static getActiveDropTarget(t){return t===null?null:t!=null&&t.active?t:ne.getActiveDropTarget(t.nextDropTarget)}};function Tt(e,t,o,n,r,i){var l;let s=null,a=he.allBoxesContainingPoint(o,n,e,t,i);if(a.length){let[c,...p]=a,{"data-path":m,path:u=m,"data-row-placeholder":f}=T(c),h=n[u],y=Dt(e,t,h,r&&f?"row":void 0),d=n[u],b=([E,...R])=>{var S,x;if(((S=y.position)==null?void 0:S.Header)||y.closeToTheEdge){let D=Jr(E,y,d,n,e,t);if(D){let[v,C]=D;return new ne({component:E,pos:v,clientRect:C,nextDropTarget:(x=b(R))!=null?x:null})}else if(R.length)return b(R)}};s=new ne({component:c,pos:y,clientRect:h,nextDropTarget:(l=b(p))!=null?l:null}).activate()}return s}function Jr(e,{closeToTheEdge:t,position:o},n,r,i,s){if(!e||e.type==="DraggableLayout")return;let a=r[e.props.path],l=t&pe.north,c=t&pe.east,p=t&pe.south,m=t&pe.west,u=(l||o.Header)&&Math.round(n.top)===Math.round(a.top),f=c&&Math.round(n.right)===Math.round(a.right),h=p&&Math.round(n.bottom)===Math.round(a.bottom),g=m&&Math.round(n.left)===Math.round(a.left);if(u||f||h||g){let{"data-path":y,path:d=y}=e.props,b=r[d],E=Dt(i,s,b);if((jr(e)||So(e))&&t&Zr)return E.width=120,[E,b];if((Kr(e)||So(e))&&(o.Header||t&Yr))return E.height=120,[E,b]}}function So(e){return P(e)==="Stack"}function jr(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function Kr(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="row"}import{PopupService as Pt}from"@vuu-ui/vuu-popups";import qr from"classnames";import{jsx as Do}from"react/jsx-runtime";function To(e,t=0,o=0){let{pos:n,clientRect:r}=e,i=20;return n.position.West?[r.left-o+i,n.y-t,"left"]:n.position.South?[n.x-o,r.bottom-t-i,"bottom"]:n.position.East?[r.right-o-i,n.y-t,"right"]:[n.x-o,r.top-t+i,"top"]}var wt="vuuDropMenu",wo=({className:e,dropTarget:t,onHover:o,orientation:n})=>{let r=t.toArray();return Do("div",{className:qr(wt,e,`${wt}-${n}`),onMouseLeave:()=>o(null),children:r.map((i,s)=>Do("div",{className:`${wt}-item`,"data-icon":s===0?"column-2A":"column-2B",onMouseEnter:()=>o(i)},s))})};import{jsx as ii}from"react/jsx-runtime";var vt=!1,Te=null,J=null,Qr=e=>Te=e,ei=([e,t])=>`M${e},${t}`,ti=([e,t])=>`L${e},${t}`,Po=([e,...t])=>`${ei(e)} ${t.map(ti)}Z`,oi=e=>{if(e){let[t,o,n,r,i,s,a,l]=e;return`M${t},${o} L${n},${r} M${i},${s} L${a},${l}`}else return""};function ni(){if(document.getElementById("hw-drag-canvas")===null){let e=document.getElementById("root"),t=document.createElement("div");t.id="hw-drag-canvas",t.innerHTML=`
|
|
1
|
+
import Dr from"classnames";import{Button as io,useControlled as br}from"@salt-ds/core";import so from"classnames";import{useCallback as xr}from"react";import{jsx as Se,jsxs as Er}from"react/jsx-runtime";var te="vuuDrawer",ao=e=>typeof e=="string"?e:e+"px",Rr=(e,t,o)=>{let n=t!==void 0,r=o!==void 0;if(!(!e&&!r&&!n))return!r&&!n?e:{...e,"--drawer-size":n?ao(t):void 0,"--drawer-peek-size":r?ao(o):void 0}},lo=({children:e,className:t,clickToOpen:o,defaultOpen:n,sizeOpen:r,sizeClosed:i,style:s,open:a,position:l="left",inline:c,onClick:p,peekaboo:m=!1,toggleButton:u,...f})=>{let[h,g]=br({controlled:a,default:n!=null?n:!1,name:"Drawer",state:"open"}),y=so(te,t,`${te}-${l}`,{[`${te}-open`]:h,[`${te}-inline`]:c,[`${te}-over`]:!c,[`${te}-peekaboo`]:m}),d=xr(()=>{console.log("toggleDrawer"),g(!h)},[h,g]),b=Rr(s,r,i),E=o?d:p,R=()=>Se("div",{className:so("vuuToggleButton-container"),children:h?Se(io,{"aria-label":"close",onClick:d,"data-icon":"close",variant:"secondary"}):Se(io,{"aria-label":"open",onClick:d,"data-icon":"close",variant:"secondary"})});return Er("div",{...f,className:y,onClick:E,style:b,children:[u=="start"?R():null,Se("div",{className:`${te}-liner`,children:Se("div",{className:`${te}-content`,children:e})}),u=="end"?R():null]})};lo.displayName="Drawer";var ht=lo;import{partition as mo}from"@vuu-ui/vuu-utils";var co={},po={},oe={};function $(e){return co[e]===!0}function Sr(e){return po[e]===!0}var uo=e=>$(e)||Sr(e),pl=e=>!!oe[e];function I(e,t,o="component"){oe[e]=t,o==="container"?co[e]=!0:o==="view"&&(po[e]=!0)}import{jsx as vr,jsxs as Lr}from"react/jsx-runtime";var Tr=e=>e.type===ht,wr=({props:{position:e="left"}})=>e.match(/top|bottom/),gt=e=>{let{children:t,className:o,id:n,style:r}=e,i="hwChest",[s,a]=mo(t,Tr),[l,c]=mo(s,wr),p=l.length===0?"horizontal":c.length===0?"vertical":"both",m=Dr(i,o,`${i}-${p}`);return Lr("div",{className:m,id:n,style:r,children:[s,vr("div",{className:`${i}-content`,children:a})]})};gt.displayName="Chest";var Pr=gt;I("Chest",gt,"container");import{forwardRef as Mr}from"react";import{jsx as Cr}from"react/jsx-runtime";var yt=Mr(function({resizeable:t,...o},n){return Cr("div",{...o,className:"Component",ref:n})});yt.displayName="Component";var bt=yt;I("Component",yt);import le from"react";var Ar={},w=(e,t)=>{var n;let o=T(e);return(n=o[t])!=null?n:o[`data-${t}`]},T=e=>(e==null?void 0:e.props)||e||Ar,fo=e=>{let t=T(e);if(t.children){let{children:[o,...n]}=t;return n.length>0&&console.warn(`getChild expected a single child, found ${n.length+1}`),o}};function P(e){var t;if(e){let o=e.type;if(typeof o=="function"||typeof o=="object"){let n=o.displayName||o.name||((t=o.type)==null?void 0:t.name);if(typeof n=="string")return n}if(typeof e.type=="string")return e.type;if(e.constructor)return e.constructor.displayName;throw Error("typeOf unable to determine type of element")}}var kl=(e,t)=>P(e)===t;var zr=e=>{let t=e.lastIndexOf(".");return t===-1?e:e.slice(0,t)};function q(e,t){let{"data-path":o,path:n=o}=T(e);return t==="0"||t===n?null:V(e,zr(t),!0)}function Q(e,t){let{children:o,...n}=T(e);if(t(n))return e;if(le.Children.count(o)>0){let r=le.isValidElement(o)?[o]:o;for(let i of r){let s=Q(i,t);if(s)return s}}}function Ir(e,t){if(t===e)return null;let{path:o,children:n}=T(e),{idx:r,finalStep:i}=Y(o,w(t,"path"));return i?e:n===void 0||n[r]===void 0?null:Ir(n[r],t)}var kr=(e,t)=>{if(le.isValidElement(e)&&t==0)return e;if(Array.isArray(e))return e[t]};function ho(e,t){let o=t.split("."),n=[e],r=i=>le.isValidElement(i.props.children)?[i.props.children]:i.props.children;for(let i=0;i<o.length;i++){let s=parseInt(o[i]),a=n[s];if(i===o.length-1)return a;n=r(a)}}function V(e,t,o=!1){let{"data-path":n,path:r=n}=T(e);if(t.indexOf(r)!==0)throw Error(`pathUtils.followPath path ${t} is not within source path ${r}`);let i=t.slice(r.length+1);if(i==="")return e;let s=e,a=i.split(".");for(let l=0;l<a.length;l++){if(le.Children.count(s.props.children)===0){let c=`element at 0.${a.slice(0,l).join(".")} has no children, so cannot fulfill rest of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c);return}if(s=kr(s.props.children,parseInt(a[l])),s===void 0){let c=`model at 0.${a.slice(0,l).join(".")} has no children that fulfill next step of path ${a.slice(l).join(".")}`;if(o)throw Error(c);console.warn(c)}}return s}function Vl(e,t){let o=q(e,t),n=t.split(".").map(r=>parseInt(r,10));if(o){let r=n.pop(),{children:i}=o.props;if(i.length-1>r)return Fe(i[r+1]);{let s=n.pop(),a=q(e,w(o,"path"));if(a&&typeof s=="number"&&(n=a.props.path.split(".").map(l=>parseInt(l,10)),a.props.children.length-1>s)){let l=a.props.children[s+1];return $(P(l))?Fe(l):l}}}return Fe(e)}function Wl(e,t){let o=t.split(".").map(i=>parseInt(i,10)),n=o.pop(),r=q(e,t);if(r!=null&&typeof n=="number"){let{children:i}=r.props;if(n>0)return Ne(i[n-1]);for(;o.length>1;)if(n=o.pop(),r=q(e,w(r,"path")),n>0){let s=r.props.children[n-1];return $(P(s))?Ne(s):s}}return Ne(e)}function Fe(e){if($(P(e))){let{children:t}=e.props||e;return Fe(t[0])}return e}function Ne(e){if($(P(e))){let{children:t}=e.props||e;return Ne(t[t.length-1])}return e}function Y(e,t,o=!1){if(e===t)return{idx:-1,finalStep:!0};let n=`${e}.`;if(!t.startsWith(n))throw Error("pathUtils nextStep has strayed from the path");let r=o?0:1,i=t.replace(n,"").split(".").map(s=>parseInt(s,10));return{idx:i[0],finalStep:i.length===r}}function O(e,t,o){if(w(e,"path")===t)return e;let n=[];le.Children.forEach(e.props.children,(i,s)=>{w(i,"path")?n.push(O(i,`${t}.${s}`)):n.push(i)});let r=e.props["data-path"]?"data-path":"path";return le.cloneElement(e,{[r]:t,...o},n)}function Gl(e,t){typeof e=="function"?e(t):e&&(e.current=t)}var xt=e=>{if(typeof e!="number")throw Error(`"no support yet for flex value ${e}`);return{flexBasis:0,flexGrow:1,flexShrink:1}};var pe={north:1,east:2,south:4,west:8,header:16,centre:32,absolute:64},De={AFTER:"after",BEFORE:"before"},F=Object.freeze({North:ce("north"),East:ce("east"),South:ce("south"),West:ce("west"),Header:ce("header"),Centre:ce("centre"),Absolute:ce("absolute")});function ce(e){return Object.freeze({offset:e==="north"||e==="west"?0:e==="south"||e==="east"?1:NaN,valueOf:function(){return pe[e]},toString:function(){return e},North:e==="north",South:e==="south",East:e==="east",West:e==="west",Header:e==="header",Centre:e==="centre",NorthOrSouth:e==="north"||e==="south",EastOrWest:e==="east"||e==="west",NorthOrWest:e==="north"||e==="west",SouthOrEast:e==="east"||e==="south",Absolute:e==="absolute"})}var go=F.North,yo=F.South,Rt=F.East,Et=F.West,Br=F.Header,Or=F.Centre,he=class{static measure(t,o=[]){let n={};return Fr(t,n,o),n}static allBoxesContainingPoint(t,o,n,r,i){return Eo(t,o,n,r,i).reverse()}};function St(e,t,o,n=30){let r=o.right-o.left,i=o.bottom-o.top,s=e-o.left,a=t-o.top,l=0;return s<n&&(l+=8),s>r-n&&(l+=2),a<n&&(l+=1),a>i-n&&(l+=4),{pctX:s/r,pctY:a/i,closeToTheEdge:l}}function Dt(e,t,o,n){let{BEFORE:r,AFTER:i}=De,{pctX:s,pctY:a,closeToTheEdge:l}=St(e,t,o),c,p;if(n==="row")c=s<.5?Et:Rt;else if(o.header&&Ve(o.header,e,t))if(c=Br,o.Stack){let m=o.Stack.length;if(m===0)p={index:-1,left:o.left,positionRelativeToTab:i,width:0};else{let u=o.Stack.find(({left:f,right:h})=>e>=f&&e<=h);if(u){let f=u.right-u.left;p={index:o.Stack.indexOf(u),left:u.left,positionRelativeToTab:(e-u.left)/f<.5?r:i,width:f}}else p={left:o.Stack[m-1].right,width:0,index:m,positionRelativeToTab:i}}}else if(o.header.titleWidth){let m=o.header.titleWidth;p={index:-1,left:o.left,positionRelativeToTab:(e-o.left)/m<.5?r:i,width:m}}else p={left:o.left,width:0,positionRelativeToTab:r,index:-1};else c=Hr(e,t,o,s,a);return{position:c,x:e,y:t,closeToTheEdge:l,tab:p}}function Hr(e,t,o,n,r){let i=$r(o,.2);if(Ve(i,e,t))return Or;switch(`${r<.5?"north":"south"}${n<.5?"west":"east"}`){case"northwest":return n>r?go:Et;case"northeast":return 1-n>r?go:Rt;case"southeast":return n>r?Rt:yo;case"southwest":return 1-n>r?Et:yo;default:}}function $r({right:e,left:t,top:o,bottom:n},r){let i=(1-r)/2,s=(e-t)*i,a=(n-o)*i;return{left:t+s,top:o+a,right:e-s,bottom:n-a}}function Fr(e,t,o){let{id:n,"data-path":r,path:i=r}=T(e),s=P(e);if(n&&i){let[a,l]=Ro(e);bo(e,a,l,t),$(s)&&xo(e,t,o)}}function bo(e,t,o,n){let{"data-path":r,path:i=r,header:s}=T(e);n[i]=t;let a=P(e);if(s||a==="Stack"){let l=o.querySelector(".vuuHeader");if(l){let{top:c,left:p,right:m,bottom:u}=l.getBoundingClientRect();if(n[i].header={top:Math.round(c),left:Math.round(p),right:Math.round(m),bottom:Math.round(u)},a==="Stack")n[i].Stack=Array.from(l.querySelectorAll(".saltTab")).map(f=>f.getBoundingClientRect()).map(({left:f,right:h})=>({left:f,right:h}));else{let f=l.querySelector('[class^="vuuHeader-title"]'),{header:h}=n[i];f&&h&&(h.titleWidth=f.clientWidth)}}}return n[i]}function xo(e,t,o,n=0,r=0,i=0,s=0){let{children:a,"data-path":l,path:c=l,style:p,active:m=0}=T(e),u=P(e),f=u==="Flexbox",h=u==="Stack",g=f&&p.flexDirection==="column",y=f&&p.flexDirection==="row",b=(h?a.filter((R,S)=>S===m):a.filter(Nr)).map(R=>{let[S,x]=Ro(R);return[{...S,top:S.top-i,right:S.right+r,bottom:S.bottom+s,left:S.left-n},x,R]}),E=b.map(([R,S,x],D,v)=>{let C,B,L,k,M,A,z=v.length-1;y?(M=D===0?0:R.left-v[D-1][0].right,A=D===z?0:v[D+1][0].left-R.right,C=D===0||M===0?0:M,B=D===z||A===0?0:A-A/2,R.left-=C,R.right+=B,L=i,k=s):g&&(M=D===0?0:R.top-v[D-1][0].bottom,A=D===z?0:v[D+1][0].top-R.bottom,L=D===0||M===0?0:M,k=D===z||A===0?0:A-A/2,R.top-=L,R.bottom+=k,C=n,B=r);let Z=bo(x,R,S,t),W=P(x);return $(W)&&xo(x,t,o,C,B,L,k),Z});b.length&&(t[c].children=E)}function Nr(e){let{id:t}=T(e),o=document.getElementById(t);return o?o.dataset.dragging!=="true":(console.warn(`BoxModel: no element found with id #${t}`),!1)}function Ro(e){let{id:t}=T(e);if(t===void 0)throw Error("`BoxModel.measureComponentElement, component has no id");let o=document.getElementById(t);if(!o)throw Error("BoxModel.measureComponentElement, no DOM element found for component");let{top:n,left:r,right:i,bottom:s,height:a,width:l}=o.getBoundingClientRect(),c,p=P(e);if($(p)){let m=o.scrollHeight;m>a&&(c={id:t,scrollHeight:m,scrollTop:o.scrollTop})}return[{top:Math.round(n),left:Math.round(r),right:Math.round(i),bottom:Math.round(s),height:Math.round(a),width:Math.round(l),scrolling:c},o,e]}function Eo(e,t,o,n,r,i=[]){let{children:s,"data-path":a,path:l=a}=T(e),c=P(e),p=t[l];if(!Ve(p,o,n))return i;if(r&&r.length){if(r.includes(l))i.push(e);else if(!r.some(m=>m.startsWith(l)))return i}else i.push(e);if(!$(c)||p.header&&Ve(p.header,o,n))return i;p.scrolling&&Vr(p,o,n);for(let m=0;m<s.length;m++){if(c==="Stack"&&e.props.active!==m)continue;let u=Eo(s[m],t,o,n,r);if(u.length)return i.concat(u)}return i}function Ve(e,t,o){if(e)return t>=e.left&&t<e.right&&o>=e.top&&o<e.bottom}function Vr({top:e,bottom:t,scrolling:o},n,r){if(o){let{id:i,scrollTop:s,scrollHeight:a}=o,l=t-e;if(s===0&&t-r<50){let c=a-l;document.getElementById(i).scrollTo({left:0,top:c,behavior:"smooth"}),o.scrollTop=c}else if(s>0&&r-e<50)document.getElementById(i).scrollTo({left:0,top:0,behavior:"smooth"}),o.scrollTop=0;else return!1}else return!1}var Wr=.4,We=class{constructor(t,o,n,r,i){this.init(t,o,n,r,i)}init(t,o,n,r,i){let{left:s,top:a}=r,{pctX:l,pctY:c}=St(o,n,r),p=Wr,m=l*r.width,u=r.width-m,f=c*r.height,h=r.height-f,g=r.width*p,y=r.height*p,d=1-p,b=m*d,E=f*d,R=u*d,S=h*d;this.intrinsicSize=i,this.constraint={zone:{x:{lo:t.left,hi:t.right},y:{lo:t.top,hi:t.bottom}},pos:{x:{lo:t.left-b,hi:t.right-r.width+R},y:{lo:t.top-E,hi:t.bottom-r.height+S}},mouse:{x:{lo:t.left+g*l,hi:t.right-g*(1-l)},y:{lo:t.top+y*c,hi:t.bottom-y*(1-c)}}},this.x={pos:s,lo:!1,hi:!1,mousePos:o,mousePct:l},this.y={pos:a,lo:!1,hi:!1,mousePos:n,mousePct:c}}outOfBounds(){return this.x.lo||this.x.hi||this.y.lo||this.y.hi}inBounds(){return!this.outOfBounds()}dropX(){return this.dropXY("x")}dropY(){return this.dropXY("y")}hasIntrinsicSize(){var t,o;return((t=this==null?void 0:this.intrinsicSize)==null?void 0:t.height)&&((o=this==null?void 0:this.intrinsicSize)==null?void 0:o.width)}update(t,o){let n=this[t],r=this.constraint.mouse[t],i=this.constraint.pos[t],s=n.pos,a=o-n.mousePos;return a<0?n.lo||(o<r.lo?(n.lo=!0,n.pos=i.lo):n.hi?o<r.hi&&(n.hi=!1,n.pos+=a):n.pos+=a):a>0&&(n.hi||(o>r.hi?(n.hi=!0,n.pos=i.hi):n.lo?o>r.lo&&(n.lo=!1,n.pos+=a):n.pos+=a)),n.mousePos=o,s!==n.pos}dropXY(t){let o=this[t],n=this.constraint.zone[t];return o.lo?Math.max(n.lo,o.mousePos):o.hi?Math.min(o.mousePos,Math.round(n.hi)-1):o.mousePos}};var ac=e=>e.pos.tab&&P(e.component)==="Stack"&&e.pos.position.Header,{north:_r,south:Gr,east:Ur,west:Xr}=pe,Zr=Ur+Xr,Yr=_r+Gr,ne=class{constructor({component:t,pos:o,clientRect:n,nextDropTarget:r}){this.component=t,this.pos=o,this.clientRect=n,this.nextDropTarget=r,this.active=!1,this.dropRect=void 0}targetTabPos(t){let{left:o,width:n,positionRelativeToTab:r}=t;return r===De.BEFORE?o:o+n}getTargetDropOutline(t,o){if(this.pos.tab)return this.getDropTabOutline(t,this.pos.tab);if(o&&o.hasIntrinsicSize())return this.getIntrinsicDropRect(o);{let[n,r,i,s]=this.getDropRectOutline(t,o);return{l:n,t:r,r:i,b:s}}}getDropTabOutline(t,o){var d,b;let{clientRect:{top:n,left:r,right:i,bottom:s,header:a}}=this,l=0,c=Math.round(t/2)+l,p=Math.round(n),m=Math.round(r+c),u=Math.round(i-c),f=Math.round(s-c),h=this.targetTabPos(o),g=60,y=((d=a==null?void 0:a.bottom)!=null?d:0)-((b=a==null?void 0:a.top)!=null?b:0);return{l:m,t:p,r:u,b:f,tabLeft:h,tabWidth:g,tabHeight:y}}getIntrinsicDropRect(t){var g,y,d,b;let{pos:o,clientRect:n}=this,{x:r,y:i}=t,s=(y=(g=t.intrinsicSize)==null?void 0:g.height)!=null?y:0,a=(b=(d=t.intrinsicSize)==null?void 0:d.height)!=null?b:0;s&&s>n.height?(console.log("DropTarget: we're going to blow the gaff"),s=n.height):a&&a>n.width&&(console.log("DropTarget: we're going to blow the gaff"),a=n.width);let l=Math.min(n.right-a,Math.max(n.left,Math.round(o.x-r.mousePct*a))),c=Math.min(n.bottom-s,Math.max(n.top,Math.round(o.y-i.mousePct*s))),[p,m,u,f]=this.dropRect=[l,c,l+a,c+s],h=o.position.EastOrWest?[p,n.top,p,n.bottom,u,n.top,u,n.bottom]:[n.left,m,n.right,m,n.left,f,n.right,f];return{l:p,r:u,t:m,b:f,guideLines:h}}getDropRectOutline(t,o){var b,E,R;let{pos:n,clientRect:r}=this,{width:i,height:s,position:a}=n,{width:l,height:c}=(b=o==null?void 0:o.intrinsicSize)!=null?b:{},p=(E=c!=null?c:s)!=null?E:0,m=(R=l!=null?l:i)!=null?R:0;this.dropRect=void 0;let{top:u,left:f,right:h,bottom:g}=r,y=0,d=Math.round(t/2)+y;switch(a){case F.North:case F.Header:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,u+d,f+m-d,u+d+x]:[f+d,u+d,h-d,u+d+x]}case F.West:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[f+d,u+d,f-d+x,u+p+d]:[f+d,u+d,f-d+x,g-d]}case F.East:{let S=Math.round((h-f)/2),x=m?Math.min(S,Math.round(m)):S;return p&&u+p<g?[h-d-x,u+d,h-d,u+p+d]:[h-d-x,u+d,h-d,g-d]}case F.South:{let S=Math.round((g-u)/2),x=p?Math.min(S,Math.round(p)):S;return m&&f+m<h?[f+d,g-d-x,f+m-d,g-d]:[f+d,g-d-x,h-d,g-d]}case F.Centre:return[f+d,u+d,h-d,g-d];default:return console.warn(`DropTarget does not recognize position ${a}`),null}}activate(){return this.active=!0,this}toArray(){let t=this,o=[t];for(;t=t.nextDropTarget;)o.push(t);return o}static getActiveDropTarget(t){return t===null?null:t!=null&&t.active?t:ne.getActiveDropTarget(t.nextDropTarget)}};function Tt(e,t,o,n,r,i){var l;let s=null,a=he.allBoxesContainingPoint(o,n,e,t,i);if(a.length){let[c,...p]=a,{"data-path":m,path:u=m,"data-row-placeholder":f}=T(c),h=n[u],y=Dt(e,t,h,r&&f?"row":void 0),d=n[u],b=([E,...R])=>{var S,x;if((S=y.position)!=null&&S.Header||y.closeToTheEdge){let D=Jr(E,y,d,n,e,t);if(D){let[v,C]=D;return new ne({component:E,pos:v,clientRect:C,nextDropTarget:(x=b(R))!=null?x:null})}else if(R.length)return b(R)}};s=new ne({component:c,pos:y,clientRect:h,nextDropTarget:(l=b(p))!=null?l:null}).activate()}return s}function Jr(e,{closeToTheEdge:t,position:o},n,r,i,s){if(!e||e.type==="DraggableLayout")return;let a=r[e.props.path],l=t&pe.north,c=t&pe.east,p=t&pe.south,m=t&pe.west,u=(l||o.Header)&&Math.round(n.top)===Math.round(a.top),f=c&&Math.round(n.right)===Math.round(a.right),h=p&&Math.round(n.bottom)===Math.round(a.bottom),g=m&&Math.round(n.left)===Math.round(a.left);if(u||f||h||g){let{"data-path":y,path:d=y}=e.props,b=r[d],E=Dt(i,s,b);if((jr(e)||So(e))&&t&Zr)return E.width=120,[E,b];if((Kr(e)||So(e))&&(o.Header||t&Yr))return E.height=120,[E,b]}}function So(e){return P(e)==="Stack"}function jr(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="column"}function Kr(e){return P(e)==="Flexbox"&&e.props.style.flexDirection==="row"}import{PopupService as Pt}from"@vuu-ui/vuu-popups";import qr from"classnames";import{jsx as Do}from"react/jsx-runtime";function To(e,t=0,o=0){let{pos:n,clientRect:r}=e,i=20;return n.position.West?[r.left-o+i,n.y-t,"left"]:n.position.South?[n.x-o,r.bottom-t-i,"bottom"]:n.position.East?[r.right-o-i,n.y-t,"right"]:[n.x-o,r.top-t+i,"top"]}var wt="vuuDropMenu",wo=({className:e,dropTarget:t,onHover:o,orientation:n})=>{let r=t.toArray();return Do("div",{className:qr(wt,e,`${wt}-${n}`),onMouseLeave:()=>o(null),children:r.map((i,s)=>Do("div",{className:`${wt}-item`,"data-icon":s===0?"column-2A":"column-2B",onMouseEnter:()=>o(i)},s))})};import{jsx as ii}from"react/jsx-runtime";var vt=!1,Te=null,J=null,Qr=e=>Te=e,ei=([e,t])=>`M${e},${t}`,ti=([e,t])=>`L${e},${t}`,Po=([e,...t])=>`${ei(e)} ${t.map(ti)}Z`,oi=e=>{if(e){let[t,o,n,r,i,s,a,l]=e;return`M${t},${o} L${n},${r} M${i},${s} L${a},${l}`}else return""};function ni(){if(document.getElementById("hw-drag-canvas")===null){let e=document.getElementById("root"),t=document.createElement("div");t.id="hw-drag-canvas",t.innerHTML=`
|
|
2
2
|
<svg width="100%" height="100%">
|
|
3
3
|
<path id="hw-drop-guides" />
|
|
4
4
|
<path
|
|
@@ -14,7 +14,7 @@ import Dr from"classnames";import{Button as io,useControlled as br}from"@salt-ds
|
|
|
14
14
|
/>
|
|
15
15
|
</path>
|
|
16
16
|
</svg>
|
|
17
|
-
`,document.body.insertBefore(t,e)}}var we=class{constructor(){this.currentPath=null;this.tabMode=null;ni()}prepare(t,o="full-view"){document.body.classList.add("drawing"),this.currentPath=null,this.tabMode=o;let n=this.getPoints(0,0,0,0),r=Po(n),i=document.getElementById("vuu-drop-outline");i==null||i.setAttribute("d",r),this.currentPath=r}clear(){Te=null,_e(),document.body.classList.remove("drawing"),Pt.hidePopup()}get hoverDropTarget(){return Te}getPoints(t,o,n,r,i=0,s=0,a=0){let l=this.tabMode==="tab-only";if(s===0)return[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o],[t+n,o],[t+n,o+r],[t,o+r]];if(l){let c=i;return[[c,o],[c,o],[c+s,o],[c+s,o],[c+s,o+a],[c+s,o+a],[c,o+a],[c,o+a]]}else return i===0?[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]:[[t,o+a],[t+i,o+a],[t+i,o],[t+i,o],[t+i,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]}draw(t,o){let r=vt;if(Te!==null)this.drawTarget(Te);else if(vt=t.nextDropTarget!=null,t.pos.tab?ri(t):J&&_e(),this.drawTarget(t,o),vt){let[i,s,a]=To(t);{let l=ii(wo,{dropTarget:t,onHover:Qr,orientation:a});Pt.showPopup({left:i,top:s,component:l})}}else Pt.hidePopup()}drawTarget(t,o){let r=t.getTargetDropOutline(6,o);if(r){let{l:i,t:s,r:a,b:l,tabLeft:c,tabWidth:p,tabHeight:m,guideLines:u}=r,f=a-i,h=l-s;if(this.currentPath){let E=document.getElementById("vuu-drop-outline");E==null||E.setAttribute("d",this.currentPath)}let g=this.getPoints(i,s,f,h,c,p,m),y=Po(g),d=document.getElementById("hw-drop-outline-animate");d==null||d.setAttribute("to",y),d==null||d.beginElement(),this.currentPath=y;let b=document.getElementById("hw-drop-guides");b==null||b.setAttribute("d",oi(u))}}},vo="transition:margin-left .4s ease-out;margin-left: 63px",Lo="transition:margin-left .4s ease-out;margin-left: 0px";function ri(e){var a,l;let{AFTER:t,BEFORE:o}=De,{clientRect:{Stack:n},pos:{tab:r}}=e,{id:i}=e.component.props,s=null;if(n&&r&&r.positionRelativeToTab!==t){let c=r.positionRelativeToTab===o?1:2,p=`:scope .hwTabstrip > .hwTabstrip-inner > .hwTab:nth-child(${r.index+c})`;s=(a=document.getElementById(i))==null?void 0:a.querySelector(p),s?(J===null||J!==s)&&(s.style.cssText=vo,J&&(J.style.cssText=Lo),J=s):_e()}else if((r==null?void 0:r.positionRelativeToTab)===o){if(J===null){let c=".vuuHeader-title";s=(l=document.getElementById(i))==null?void 0:l.querySelector(c),s.style.cssText=vo,J=s}}else _e()}function _e(){J&&(J.style.cssText=Lo,J=null)}var ee,Pe,re,Co,Ao,ie,Ge,ge=null,Mt,zo,ve,Io,Lt,Ue=null,si=3,Xe=new we,Mo=.4;function ai(e,t){return t?V(e,t):Q(e,o=>o.dropTarget)}var Ct={handleMousedown(e,t,o={}){ee=t,zo=o,Co=e.clientX,Ao=e.clientY,Lt=o.dragThreshold===void 0?si:o.dragThreshold,Lt===0?ee(e,0,0):(window.addEventListener("mousemove",Ze,!1),window.addEventListener("mouseup",Ye,!1),Ue=window.setTimeout(()=>{console.log("mousedownTimer fires"),window.removeEventListener("mousemove",Ze,!1),window.removeEventListener("mouseup",Ye,!1),ee==null||ee(e,0,0)},500)),e.preventDefault()},initDrag(e,t,{top:o,left:n,right:r,bottom:i},s,a,l,c){return{drag:Pe,drop:re}=a,li(e,t,{top:o,left:n,right:r,bottom:i},s,l,c)}};function Ze(e){let n=e.clientX-Co,r=e.clientY-Ao;Math.max(Math.abs(n),Math.abs(r))>Lt&&(window.removeEventListener("mousemove",Ze,!1),window.removeEventListener("mouseup",Ye,!1),ee==null||ee(e,n,r),ee=null)}function Ye(){Ue&&(window.clearTimeout(Ue),Ue=null),window.removeEventListener("mousemove",Ze,!1),window.removeEventListener("mouseup",Ye,!1)}function li(e,t,o,n,r,i){ie=ai(e,t);let{"data-path":s,path:a=s}=T(ie);i&&(Mt=i.map(u=>Q(e,f=>f.id===u)).map(u=>u.props.path)),ve=he.measure(ie,i),console.log({_measurements:ve});let l=ve[a];Ge=new We(l,n.x,n.y,o,r);let c=Math.round(Ge.x.mousePct*100),p=Math.round(Ge.y.mousePct*100);return window.addEventListener("mousemove",ko,!1),window.addEventListener("mouseup",Bo,!1),Io=!1,Xe.prepare(o,"tab-only"),zo.DoNotTransform?"transform:none":`transform:scale(${Mo},${Mo});transform-origin:${c}% ${p}%;`}function ko(e){let t=e.clientX,o=e.clientY,n=Ge,r=ge,i,s,a;n.update("x",t)&&(s=n.x.pos),n.update("y",o)&&(a=n.y.pos),s===void 0&&a===void 0||Pe==null||Pe(s,a),!(Io||ie===void 0)&&(n.inBounds()?i=Tt(t,o,ie,ve,n.hasIntrinsicSize(),Mt):i=Tt(n.dropX(),n.dropY(),ie,ve),r&&(i==null||i.box!==r.box)&&(ge=null),i&&(Xe.draw(i,n),ge=i))}function Bo(){ci()}function ci(){if(ge){let e=Xe.hoverDropTarget||ne.getActiveDropTarget(ge);re==null||re(e),ge=null}else re==null||re({component:ie,pos:{position:F.Absolute}});Pe=null,re=null,ie=void 0,Xe.clear(),Mt=void 0,window.removeEventListener("mousemove",ko,!1),window.removeEventListener("mouseup",Bo,!1)}import pi from"classnames";import{useRef as ui}from"react";import{jsx as mi}from"react/jsx-runtime";var Oo=function(t){let o=ui();o.current=t;let{className:n,id:r,style:i}=t,s=pi("DraggableLayout",n);return mi("div",{className:s,id:r,style:i,children:t.children})},Ho="DraggableLayout";Oo.displayName=Ho;I(Ho,Oo,"container");import{useForkRef as Bi}from"@salt-ds/core";import Oi from"classnames";import{forwardRef as Hi}from"react";import{getUniqueId as Li}from"@vuu-ui/vuu-utils";import ze,{useCallback as Qe,useMemo as Jo,useRef as et,useState as Mi}from"react";import di from"classnames";import{jsx as fi}from"react/jsx-runtime";var $o="vuuPlaceholder",Je=({className:e,closeable:t,flexFill:o,resizeable:n,shim:r,...i})=>fi("div",{className:di($o,e,{[`${$o}-shim`]:r}),...i,"data-placeholder":!0,"data-resizeable":!0});Je.displayName="Placeholder";I("Placeholder",Je);import hi from"classnames";import gi,{useCallback as Le,useRef as je,useState as yi}from"react";import{jsx as Fo}from"react/jsx-runtime";var No=gi.memo(function({column:t,index:o,onDrag:n,onDragEnd:r,onDragStart:i,style:s}){let a=je(),l=je(null),c=je(0),[p,m]=yi(!1),u=Le(({key:x,shiftKey:D})=>{let v=D?10:1;t&&x==="ArrowDown"?n(o,v):t&&x==="ArrowUp"||!t&&x==="ArrowLeft"?n(o,-v):!t&&x==="ArrowRight"&&n(o,v)},[t,o,n]),f=Le(x=>{let{key:D}=x;(t&&(D==="ArrowUp"||D==="ArrowDown")||!t&&(D==="ArrowLeft"||D==="ArrowRIght"))&&(i(o),u(x),h.current=u)},[t,u,o,i]),h=je(f),g=x=>h.current(x),y=Le(x=>{a.current=!0;let D=x[t?"clientY":"clientX"],v=D-c.current;D&&D!==c.current&&n(o,v),c.current=D},[t,o,n]),d=Le(()=>{var x;window.removeEventListener("mousemove",y,!1),window.removeEventListener("mouseup",d,!1),r(),m(!1),(x=l.current)==null||x.focus()},[y,r,m]),b=Le(x=>{c.current=t?x.clientY:x.clientX,i(o),window.addEventListener("mousemove",y,!1),window.addEventListener("mouseup",d,!1),x.preventDefault(),m(!0)},[t,y,d,o,i,m]),E=()=>{var x;a.current?a.current=!1:(x=l.current)==null||x.focus()},R=()=>{h.current=f},S=hi("Splitter","focusable",{active:p,column:t});return Fo("div",{className:S,"data-splitter":!0,ref:l,role:"separator",style:s,onBlur:R,onClick:E,onKeyDown:g,onMouseDown:b,tabIndex:0,children:Fo("div",{className:"grab-zone"})})});import{uuid as Vo}from"@vuu-ui/vuu-utils";import Wo from"react";var bi={"data-placeholder":!0,"data-resizeable":!0},Ke={},se="auto",At={flexBasis:0,flexGrow:1,flexShrink:1,height:se,width:se},_o={height:"width",width:"height"},Go=(e="row")=>e==="row"?["width","height","column"]:["height","width","row"],xi=e=>typeof e=="string"&&e.endsWith("%"),_=e=>{let{style:{width:t=se,height:o=se}=Ke}=e.props,n=typeof o=="number",r=typeof t=="number";return n&&r?{height:o,width:t}:n?{height:o}:r?{width:t}:void 0};function zt(e,t,o){let n=_o[t],{style:{[n]:r=se,...i}=Ke}=e.props;return o&&o[t]?{...i,...At,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...i,...At,[n]:r}}function Uo(e){let{style:{flex:t,flexGrow:o,flexShrink:n,flexBasis:r}=Ke}=e.props;return typeof t=="number"||r===0&&o===1&&n===1?!0:typeof r!="number"}function It(e,t,o){let n=_o[t],{style:{[t]:r=se,[n]:i=se,...s}=Ke}=e.props;return r!==se?xi(r)?{flexBasis:0,flexGrow:1,flexShrink:1,[t]:void 0,[n]:i}:{flexBasis:r,flexGrow:0,flexShrink:0,[t]:r,[n]:i}:o&&o[t]?{...s,...At,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...s,[n]:i}}function Me(e,t,o,n,r){let i=[],s=0,a;if(n&&r){let p,[m,u,f,h]=r;[p,a]=t==="column"?[u-n.top,n.bottom-h]:[m-n.left,n.right-f],p&&i.push(K(`${o}.${s++}`,p,{flexGrow:0,flexShrink:0}))}else a=!0;let{version:l=0,style:c}=T(e);return i.push(O(e,`${o}.${s++}`,{version:l+1,style:{...c,flexBasis:"auto",flexGrow:0,flexShrink:0}})),a&&i.push(K(`${o}.${s++}`,0,void 0,{[`data-${t}-placeholder`]:!0})),kt(t,{resizeable:!1,style:{flexBasis:"auto"}},i,o)}var Ri=(e,t)=>{if(!t)return e===0?1:0};function kt(e,t,o,n){let r=Vo(),{flexFill:i,style:s,resizeable:a=!0}=t,{flexBasis:l=i?void 0:"auto"}=s,c=Ri(l,i);return Wo.createElement(oe.Flexbox,{id:r,key:r,path:n,flexFill:i,style:{...s,flexDirection:e,flexBasis:l,flexGrow:c,flexShrink:c},resizeable:a},o)}var Ei={flexGrow:1,flexShrink:1};function K(e,t,o,n){let r=Vo();return Wo.createElement("div",{...bi,...n,"data-path":e,id:r,key:r,style:{...Ei,...o,flexBasis:t}})}var Si={},Ce=1,Ae=2,Di=e=>typeof e.intrinsicSize=="number",Ti=(e,t)=>{let o={};return e.forEach(n=>{o[n]=w(t,n)}),o},qe=(e,t,o)=>e.map((n,r)=>{var l;let i=w(n,"resizeable"),{[t]:s}=(l=_(n))!=null?l:Si,a=Uo(n);return o?{index:r,flexOpen:a,intrinsicSize:s,resizeable:i,...Ti(o,n)}:{index:r,flexOpen:a,intrinsicSize:s,resizeable:i}}),Xo=e=>{let t=e.length,o=e.every(Di),n=Array(t).fill(0);if(o&&(n[0]=Ae,n[t-1]=Ae),t<2)return n;for(let r=0,i=0;r<t-1;r++)e[r].resizeable&&!i&&(i=Ce),n[r]+=i;for(let r=t-1;r>0&&(n[r]&Ce&&(n[r]-=Ce),!e[r].resizeable);r--);return n},Zo=(e,t)=>{let o=Pi(e,t),n=vi(e,t),r=o!==-1&&n!==-1?[o,n]:void 0,i=wi(e,r);return[r,i]};function wi(e,t){if(t){let o=[];for(let n=0;n<e.length;n++)e[n].flexOpen&&!t.includes(n)&&o.push(n);return o}}function Pi(e,t){let o=t,n=!1;for(;o>=1&&!n;)o=o-1,n=Yo(e,o);return o}function vi(e,t){let o=t,n=!1,r=e.length;for(;o<r&&!n;)o=o+1,n=Yo(e,o);return o===r?-1:o}function Yo(e,t){let{placeholder:o,splitter:n,resizeable:r,intrinsicSize:i}=e[t];return Boolean(!n&&!i&&(o||r))}var Ci=e=>!e.splitter&&!e.placeholder,Ko=({children:e,onSplitterMoved:t,style:o})=>{let n=et(null),r=et(),i=et(),s=et([]),[,a]=Mi({}),l=y=>{i.current=y,a({})},c=(o==null?void 0:o.flexDirection)==="column",p=c?"height":"width",m=Jo(()=>Array.isArray(e)?e:ze.isValidElement(e)?[e]:[],[e]),u=Qe(y=>{let{current:d}=r;if(d){let[b,E]=Zo(d,y);b&&(b.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{size:D,minSize:v}=ki(S,p);d[R].currentSize=D,d[R].minSize=v}}),E&&E.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{[p]:D}=S.getBoundingClientRect();d[R].flexBasis=D}}))}},[p]),f=Qe((y,d)=>{i.current&&r.current&&l(zi(i.current,r.current,d,p))},[p]),h=Qe(()=>{let y=r.current;y&&(t==null||t(y.filter(Ci))),y==null||y.forEach(d=>{d.currentSize=void 0,d.flexBasis=void 0,d.flexOpen=!1})},[t]),g=Qe(y=>ze.createElement(No,{column:c,index:y,key:`splitter-${y}`,onDrag:f,onDragEnd:h,onDragStart:u}),[f,h,u,c]);return Jo(()=>{let[y,d]=Ai(m,p,g,s.current);r.current=d,i.current=y},[m,g,p]),{content:i.current||[],rootRef:n}};function Ai(e,t,o,n){let r=qe(e,t),i=Xo(r),s=[],a=[];for(let l=0;l<e.length;l++){let c=e[l];if(l===0&&i[l]&Ae&&(s.push(jo(l)),a.push({placeholder:!0,shim:!0})),c.key==null){let p=n[l]||(n[l]=Li());s.push(ze.cloneElement(c,{key:p}))}else s.push(c);a.push(r[l]),l>0&&i[l]&Ae?(s.push(jo(l)),a.push({placeholder:!0})):i[l]&Ce&&(s.push(o(s.length)),a.push({splitter:!0}))}return[s,a]}function zi(e,t,o,n){return Ii(t,o)?e.map((i,s)=>{let a=t[s],{currentSize:l,flexOpen:c,flexBasis:p}=a,m=l!==void 0;if(m||c){let{flexBasis:u}=i.props.style||{},f=m?a.currentSize:p;return f!==u?ze.cloneElement(i,{style:{...i.props.style,flexBasis:f,[n]:"auto"}}):i}else return i}):e}function Ii(e,t){let o=[];e.forEach((p,m)=>{p.currentSize!==void 0&&o.push(m)});let n=t<0?o[0]:o[1],{currentSize:r=0,minSize:i=0}=e[n];if(r===i)return!1;if(Math.abs(t)>r-i){let p=t<0?-1:1;t=Math.max(0,r-i)*p}let s=e[o[0]],{currentSize:a=0}=s;s.currentSize=a+t;let l=e[o[1]],{currentSize:c=0}=l;return l.currentSize=c-t,!0}function jo(e){return ze.createElement(Je,{shim:e===0,key:`placeholder-${e}`})}function ki(e,t){let{[t]:o}=e.getBoundingClientRect(),r=getComputedStyle(e).getPropertyValue(`min-${t}`),i=r.endsWith("px")?parseInt(r,10):0;return{size:o,minSize:i}}import{jsx as $i}from"react/jsx-runtime";var Bt="hwFlexbox",qo=Hi(function(t,o){let{breakPoints:n,children:r,column:i,className:s,flexFill:a,gap:l,fullPage:c,id:p,onSplitterMoved:m,resizeable:u,row:f,spacing:h,splitterSize:g,style:y,...d}=t,{content:b,rootRef:E}=Ko({children:r,onSplitterMoved:m,style:y}),R=Oi(Bt,s,{[`${Bt}-column`]:i,[`${Bt}-row`]:f,"flex-fill":a,"full-page":c});return $i("div",{...d,className:R,"data-resizeable":u||void 0,id:p,ref:Bi(E,o),style:{...y,gap:l,"--spacing":h},children:b})});qo.displayName="Flexbox";var Ot=qo;import{useCallback as ws}from"react";var ye={ADD:"add",BLUR:"blur",BLUR_SPLITTER:"blur-splitter",DRAG_START:"drag-start",DRAG_STARTED:"drag-started",DRAG_DROP:"drag-drop",FOCUS:"focus",FOCUS_SPLITTER:"focus-splitter",INITIALIZE:"initialize",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAR_OUT:"tear-out"};import{useCallback as _t,useContext as Cn,useEffect as Es,useRef as Ln,useState as Ss}from"react";import Tn from"react";import{uuid as an}from"@vuu-ui/vuu-utils";import Be from"react";import{uuid as on}from"@vuu-ui/vuu-utils";import Ie,{cloneElement as Fi}from"react";import{useCallback as be}from"react";var N=new Map,G=new Map,Qo=e=>N.get(e),en=e=>N.has(e),tn=(e,t)=>N.set(e,t),xe=()=>{let e=be((s,a)=>{let l=G.get(s);if(l)return a!==void 0&&l[a]!==void 0?l[a]:a!==void 0?void 0:l},[]),t=be((s,a,l)=>{if(a===void 0)G.set(s,l);else if(G.has(s)){let c=G.get(s);G.set(s,{...c,[a]:l})}else G.set(s,{[a]:l})},[]),o=be((s,a)=>{if(G.has(s)){if(a===void 0)G.delete(s);else if(G.get(s)[a]){let{[a]:c,...p}=G.get(s);Object.keys(p).length>0?G.set(s,p):G.delete(s)}}},[]),n=be((s,a)=>{let l=N.get(s);if(l)return a!==void 0?l[a]:l},[]),r=be((s,a,l)=>{if(a===void 0)N.set(s,l);else if(N.has(s)){let c=N.get(s);N.set(s,{...c,[a]:l})}else N.set(s,{[a]:l})},[]),i=be((s,a)=>{if(N.has(s)){if(a===void 0)N.delete(s);else if(N.get(s)[a]){let{[a]:c,...p}=N.get(s);Object.keys(p).length>0?N.set(s,p):N.delete(s)}}},[]);return{loadSessionState:e,loadState:n,saveSessionState:t,saveState:r,purgeState:i,purgeSessionState:o}};var nn=e=>e.flexDirection==="column"?["height","width"]:["width","height"],Ni={},ke=(e,t="0")=>{let[o,n]=Ft(P(e),e.props,t);return Ie.cloneElement(e,o,n)},$t=(e,t)=>{let o=P(e),[n,r]=Ft(o,e.props,"0",void 0,t);return Fi(e,n,r)};function Vi(e,t,o="0",n=null,r){var g,y;let{active:i=0,"data-path":s,path:a=s,id:l,style:c}=T(r),p=P(r)===e&&o===a,m=p?l:(g=t.id)!=null?g:on(),u=e==="Stack"?(y=t.active)!=null?y:i:void 0,f=m,h=p?c:_i(e,t,n);return uo(e)?{id:m,key:f,path:o,style:h,type:e,active:u}:{id:m,key:f,style:h,"data-path":o}}function Ft(e,t,o,n=null,r){var c,p;let i=Vi(e,t,o,n,r);if(t.layout&&!r)return[i,[tt(t.layout,`${o}.0`)]];let s=(p=r==null?void 0:r.children)!=null?p:(c=r==null?void 0:r.props)==null?void 0:c.children,l=t.dropTarget&&s?s:Wi(e,t.children,o,s);return[i,l]}function Wi(e,t,o="0",n){let r=Array.isArray(t)?t:Ie.isValidElement(t)?[t]:[];return $(e)?r.map((i,s)=>{let a=P(i),l=P(n==null?void 0:n[s]);if(!l||a===l){let[c,p]=Ft(a,i.props,`${o}.${s}`,e,n==null?void 0:n[s]);return Ie.cloneElement(i,c,p)}return n==null?void 0:n[s]}):t}var _i=(e,t,o)=>{let{style:n=Ni}=t;if(e==="Flexbox"&&(n={flexDirection:t.column?"column":"row",...n,display:"flex"}),n.flex){let{flex:r,...i}=n;n={...i,...xt(typeof r=="number"?r:0)}}else o==="Stack"?n={...n,...xt(1)}:o==="Flexbox"&&(n.width||n.height)&&n.flexBasis===void 0&&(n={...n,flexBasis:"auto",flexGrow:0,flexShrink:0});return n};function tt({id:e=on(),type:t,children:o,props:n,state:r},i){let s=t.match(/^[a-z]/)?t:oe[t];if(s===void 0)throw Error(`layoutUtils unable to create component from JSON, unknown type ${t}`);return r&&tn(e,r),Ie.createElement(s,{id:e,...n,key:e,path:i},o?o.map((a,l)=>tt(a,`${i}.${l}`)):void 0)}function rn(e){return sn(e)}function sn(e){let t=P(e),{id:o,children:n,type:r,...i}=T(e),s=en(o)?Qo(o):void 0;return{id:o,type:t,props:Gi(i),state:s,children:Ie.Children.map(n,sn)}}function Gi(e){if(e){let{path:t,...o}=e,n={};for(let[r,i]of Object.entries(o))n[r]=Ht(i);return n}}function Ht(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(Ht);if(typeof e=="object"&&e!==null){let t={};for(let[o,n]of Object.entries(e))t[o]=Ht(n);return t}}function ln(e,t){var s;let o=e.props.children,n=o.length,{index:r=-1,positionRelativeToTab:i="after"}=t.tab||{};return r===-1||r>=n?[o[n-1],"after"]:[(s=o[r])!=null?s:null,i]}function ot(e,t,o){let{active:n,children:r=[],path:i}=T(e),s=w(t,"path"),{idx:a,finalStep:l}=Y(i,s,!0),[c,p]=l?Ui(e,r,o):[n,r==null?void 0:r.map((u,f)=>f===a?ot(u,t,o):u)],m=P(e)==="Stack"?Array.isArray(c)?c[0]:c:n;return Be.cloneElement(e,{active:m},p)}function Ui(e,t,o){let n=w(e,"path"),r=t==null?void 0:t.length,{id:i=an()}=T(o);return r?[r,t.concat(O(o,`${n}.${r}`,{id:i,key:i}))]:[0,[O(o,`${n}.0`,{id:i})]]}function nt(e,t,o,n,r,i,s){let{active:a,children:l,path:c}=T(e),p=w(t,"path"),{idx:m,finalStep:u}=Y(c,p),[f,h]=u?Xi(e,l,m,o,n,r,i,s):[a,l.map((y,d)=>d===m?nt(y,t,o,n,r,i,s):y)],g=P(e)==="Stack"?f:a;return Be.cloneElement(e,{active:g},h)}function Xi(e,t,o,n,r,i,s,a){let l=_(n);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)?Yi(e,t,o,n,r,s,a):cn(e,t,o,n,r,(i==null?void 0:i.width)||(i==null?void 0:i.height),s)}var Zi=(e,t,{top:o,right:n,bottom:r,left:i},[s,a,l,c])=>{if(e==="column"&&t==="before")return a-o;if(e==="column")return r-c;if(e==="row"&&t==="before")return s-i;if(e==="row")return n-l};function Yi(e,t,o,n,r,i,s){let{style:{flexDirection:a}}=T(e),[l,c,p]=Go(a),{[c]:m,[l]:u}=_(n),f=w(t[o],"path"),h=Zi(a,r,i,s),[g,y]=m<i[c]?[Me(n,p,f,i,s),u]:[n,void 0],d=h?K(f,h,{flexGrow:0,flexShrink:0}):void 0;return m>i[c]&&(t=t.map(b=>{if(w(b,"placeholder"))return b;{let{[c]:E}=_(b);return E&&E<m?Me(b,p,w(b,"path")):b}})),cn(e,t,o,g,r,y,i,d)}function cn(e,t,o,n,r,i,s,a){let l=w(e,"path"),c=0,p=!t||t.length===0?[n]:t.reduce((m,u,f)=>{if(o===f){let[h,g]=Ji(e,u,n,s);r==="before"?a?m.push(a,g,h):m.push(g,h):a?m.push(h,g,a):m.push(h,g),c=m.indexOf(g)}else m.push(u);return m},[]).map((m,u)=>u<c?m:O(m,`${l}.${u}`));return[c,p]}function Ji(e,t,o,n){let r=an(),{version:i=0}=T(o);if(i+=1,P(e)==="Flexbox"){let[s]=nn(e.props.style),a=6,l={[s]:(n[s]-a)/2},c=It(t,s,l),p=It(o,s,l);return[Be.cloneElement(t,{style:c}),Be.cloneElement(o,{id:r,version:i,style:p})]}else{let{style:{left:s,top:a,flex:l,...c}={left:void 0,top:void 0,flex:void 0}}=T(o);return[t,Be.cloneElement(o,{id:r,version:i,style:c})]}}var U={ADD:"add",DRAG_START:"drag-start",DRAG_DROP:"drag-drop",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAROUT:"tearout"};import ue from"react";import rt from"react";function pn(e,{target:t,replacement:o}){return Nt(e,t,o)}function Nt(e,t,o){let n=w(t,"path"),r=w(t,"resizeable"),{style:i}=T(t),s=ke(rt.cloneElement(o,{resizeable:r,style:{...i,...o.props.style}}),n);return j(e,t,s)}function j(e,t,o,n){if(e===t)return o;let{idx:r,finalStep:i}=Y(w(e,"path"),w(t,"path")),s=e.props.children.slice();return i?n?n===ye.MINIMIZE?s[r]=ji(e,s[r]):n===ye.RESTORE&&(s[r]=Ki(s[r])):s[r]=o:s[r]=j(s[r],t,o,n),rt.cloneElement(e,void 0,s)}function ji(e,t){let{style:o}=T(e),{style:n}=T(t),{width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l,...c}=n,p={width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l},m={...c,flexBasis:0,flexGrow:0,flexShrink:0},u=o.flexDirection==="row"?"vertical":o.flexDirection==="column"?"horizontal":!1;return u?rt.cloneElement(t,{collapsed:u,restoreStyle:p,style:m}):t}function Ki(e){let{style:t,restoreStyle:o}=T(e),{flexBasis:n,flexShrink:r,flexGrow:i,...s}=t,a={...s,...o};return rt.cloneElement(e,{collapsed:!1,style:a,restoreStyle:void 0})}function Vt(e,{path:t}){let o=V(e,t),n=q(e,t);if(n===null)return e;let{children:r}=T(n);if(r.length>1&&mn(r,t)){let{style:{flexBasis:i,display:s,flexDirection:a,...l}}=T(n),c=w(n,"path"),p=j(e,n,K(c,i,l));for(;(n=q(p,c))&&w(n,"path")!=="0";){let{children:m}=T(n);if(mn(m)){c=w(n,"path");let{style:{flexBasis:u,display:f,flexDirection:h,...g}}=T(n);p=j(e,n,K(c,u,g))}else if(ts(m))p=hn(e,n);else break}return p}return dn(e,o)}function dn(e,t){let o=T(e),{children:n,path:r,preserve:i}=o,{active:s}=o,{idx:a,finalStep:l}=Y(r,w(t,"path")),c=P(e),p=n.slice();if(l){if(p.splice(a,1),s!==void 0&&s>=a&&(s=Math.max(0,s-1)),p.length===1&&!i&&r!=="0"&&c.match(/Flexbox|Stack/))return qi(e,p[0]);!p.some(Qi)&&p.some(fn)&&(p=es(p))}else p[a]=dn(p[a],t);return p=p.map((m,u)=>O(m,`${r}.${u}`)),ue.cloneElement(e,{active:s},p)}function qi(e,t){let o=P(e),{path:n,style:{flexBasis:r,flexGrow:i,flexShrink:s,width:a,height:l}}=T(e),c=O(t,n);if(n==="0")c=ue.cloneElement(c,{style:{...t.props.style,width:a,height:l}});else if(o==="Flexbox"){let p=e.props.style.flexDirection==="column"?"height":"width",{style:{[p]:m,...u}}=c.props;c=ue.cloneElement(c,{flexFill:void 0,style:{...u,flexGrow:i,flexShrink:s,flexBasis:r,width:a,height:l}})}return c}var Qi=e=>e.props.style.flexGrow>0,fn=e=>{let{width:t,height:o,flexGrow:n}=e.props.style;return n===0&&typeof t!="number"&&typeof o!="number"},es=e=>e.map(t=>fn(t)?ue.cloneElement(t,{style:{...t.props.style,flexGrow:1}}):t),ts=e=>{if(e&&e.length>0){let t=w(e[0],"placeholder"),o=!1;for(let n=1;n<e.length;n++){if(o=w(e[n],"placeholder"),t&&o)return!0;t=o}}},hn=(e,t)=>{let{children:o,path:n}=T(e),{idx:r,finalStep:i}=Y(n,w(t,"path")),s=o.slice();return i?s[r]=os(t):s[r]=hn(s[r],t),s=s.map((a,l)=>O(a,`${n}.${l}`)),ue.cloneElement(e,void 0,s)},os=e=>{let{children:t}=T(e),o=[],n=[];for(let i=0;i<t.length;i++)w(t[i],"placeholder")?n.push(t[i]):(n.length===1?o.push(n.pop()):n.length>0&&(o.push(un(n)),n.length=0),o.push(t[i]));n.length===1?o.push(n.pop()):n.length>0&&o.push(un(n));let r=w(e,"path");return ue.cloneElement(e,void 0,o.map((i,s)=>O(i,`${r}.${s}`)))},un=([e,...t])=>{let o=w(e,"style"),{flexBasis:n,flexGrow:r,flexShrink:i}=o;for(let{props:{style:s}}of t)n+=s.flexBasis,r=Math.max(r,s.flexGrow),i=Math.max(i,s.flexShrink);return ue.cloneElement(e,{style:{...o,flexBasis:n,flexGrow:r,flexShrink:i}})},mn=(e,t)=>e.every(o=>w(o,"placeholder")||t&&w(o,"path")===t);import gn from"react";function yn(e,{path:t,sizes:o}){let n=V(e,t,!0),{children:r,style:i}=T(n),s=i.flexDirection==="column"?"height":"width",a=ns(r,o,s),l=gn.cloneElement(n,void 0,a);return j(e,n,l)}function ns(e,t,o){return e.map((n,r)=>{let{style:{[o]:i,flexBasis:s}}=T(n),a=t[r],{currentSize:l,flexBasis:c}=a,m=l!==void 0?a.currentSize:c;return m===void 0||i===m||s===m?n:gn.cloneElement(n,{style:rs(n.props.style,o,m)})})}function rs(e,t,o){let n=typeof e[t]=="number",{flexShrink:r=1,flexGrow:i=1}=e;return{...e,[t]:n?o:"auto",flexBasis:n?"auto":o,flexShrink:r,flexGrow:i}}import{uuid as is}from"@vuu-ui/vuu-utils";import it from"react";var bn=e=>{let[t]=P(e);return t===t.toLowerCase()};function Oe(e,t,o,n,r,i){let{children:s,path:a}=T(e),l=w(t,"path"),{idx:c,finalStep:p}=Y(a,l),m=p?ss(e,s,t,o,n,r,i):s.map((u,f)=>f===c?Oe(u,t,o,n,r,i):u);return it.cloneElement(e,void 0,m)}function ss(e,t,o,n,r,i,s){let a=_(n);if((a==null?void 0:a.width)&&(a==null?void 0:a.height)){if(i===void 0||s===void 0)throw Error("wrap-layout-element, updateChildren clientRect and dropRect must both be available");return ls(t,o,n,r,i,s)}return as(e,t,o,n,r)}function as(e,t,o,n,r){var x;let{version:i=0}=T(n),s=w(o,"path"),{type:a,flexDirection:l,showTabs:c}=Rn(r),[p,m,u]=cs(a,o,n,l,r),f=xn(r),h=f?1:0,g={resizeable:!0,style:u,version:i+1},d={[bn(o)?"data-resizeable":"resizeable"]:!0,style:m},b=a==="Stack"?{showTabs:c}:void 0,E=a==="Flexbox"?{splitterSize:(x=P(e)==="Flexbox"&&e.props.splitterSize)!=null?x:void 0}:void 0,R=is(),S=it.createElement(oe[a],{active:h,id:R,key:R,path:w(o,"path"),flexFill:w(o,"flexFill"),...E,...b,style:p,resizeable:w(o,"resizeable")},f?[O(o,`${s}.0`,d),ke(it.cloneElement(n,g),`${s}.1`)]:[ke(it.cloneElement(n,g),`${s}.0`),O(o,`${s}.1`,d)]);return t.map(D=>D===o?S:D)}function ls(e,t,o,n,r,i){let{flexDirection:s}=Rn(n),a=s==="column"?"row":"column",l=xn(n),[c,p,m,u]=i,[f,h]=s==="column"?[p-r.top,r.bottom-u]:[c-r.left,r.right-m],g=w(t,"path"),y=0,d=bn(t)?"data-resizeable":"resizeable",b=[];f&&b.push(l?O(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:f,flexGrow:1,flexShrink:1}}):K(`${g}.${y++}`,f,{flexGrow:0,flexShrink:0})),b.push(Me(o,a,`${g}.${y++}`,r,i)),h&&b.push(l?K(`${g}.${y++}`,0):O(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:0,flexGrow:1,flexShrink:1}}));let E=kt(s,t.props,b,g);return e.map(R=>R===t?E:R)}function cs(e,t,o,n,r){let i={...t.props.style,flexDirection:n},s=e==="Flexbox"&&n==="column"?"height":"width",a=zt(o,s,r),l=zt(t,s);return[i,l,a]}var xn=e=>{var t;return e.position.SouthOrEast?!0:((t=e==null?void 0:e.tab)==null?void 0:t.positionRelativeToTab)==="before"?!1:!!e.position.Header};function Rn(e){return e.position.Header?{type:"Stack",flexDirection:"column",showTabs:!0}:{type:"Flexbox",flexDirection:e.position.EastOrWest?"row":"column"}}var wn=(e,t)=>{switch(t.type){case U.ADD:return fs(e,t);case U.DRAG_DROP:return ds(e,t);case U.MAXIMIZE:return ms(e,t);case U.REMOVE:return Vt(e,t);case U.REPLACE:return pn(e,t);case U.SET_TITLE:return us(e,t);case U.SPLITTER_RESIZE:return yn(e,t);case U.SWITCH_TAB:return ps(e,t);default:return e}},ps=(e,{path:t,nextIdx:o})=>{let n=V(e,t,!0),r=Tn.cloneElement(n,{active:o});return j(e,n,r)},us=(e,{path:t,title:o})=>{debugger;let n=V(e,t,!0),r=Tn.cloneElement(n,{title:o});return j(e,n,r)},ms=(e,{path:t,type:o})=>{if(t){let n=V(e,t,!0);return j(e,n,n,o)}else return e},ds=(e,t)=>{var h,g;let{draggedReactElement:o,dragInstructions:n,dropTarget:r}=t,i=r.component,{pos:s}=r,a=((h=s==null?void 0:s.position)==null?void 0:h.Header)&&P(i)==="Stack",{id:l,version:c}=T(o),p=_(o),m;if(a){let[y,d]=ln(i,s);y===void 0?m=ot(e,i,o):m=nt(e,y,o,d)}else!p&&((g=s==null?void 0:s.position)==null?void 0:g.Centre)?m=Nt(e,i,o):m=hs(e,r,o);if(n.DoNotRemove)return m;let u=Q(m,y=>y.id===l&&y.version===c),f=w(u,"path");return Vt(m,{path:f,type:"remove"})},fs=(e,{path:t,component:o})=>ot(e,V(e,t),o),hs=(e,t,o)=>{let{component:n,pos:r,clientRect:i,dropRect:s}=t,a=w(n,"path");if(a==="0.0")return Oe(e,n,o,r);let l=q(e,a);if(En(r,l)){let c=r.position.SouthOrEast?"after":"before";return nt(e,n,o,c,r,i,s)}if(!En(r,l))return Oe(e,n,o,r,i,s);if($(P(l)))return Oe(e,n,o,r);throw Error(`no support right now for position = ${r.position}`)},En=(e,t)=>e.position.Centre?Dn(t)||Sn(t):e.position.NorthOrSouth?Sn(t):e.position.EastOrWest?Dn(t):!1,Sn=e=>P(e)==="Flexbox"&&e.props.style.flexDirection==="column",Dn=e=>P(e)==="Flexbox"&&e.props.style.flexDirection!=="column";import{createContext as gs}from"react";var ys=e=>console.log(`dispatch ${e.type}, have you forgotten to provide a LayoutProvider ?`),He=gs({dispatchLayoutProvider:ys,version:-1});import{useCallback as st,useRef as Wt}from"react";var bs={},Pn=[0,0],xs=(e,t,o)=>{let n=document.createElement("div");n.className="vuuSimpleDraggableWrapper",n.classList.add("vuuSimpleDraggableWrapper","salt-theme","salt-density-medium"),n.dataset.dragging="true";let r=o!=null?o:document.createElement("div");r.id=t,n.appendChild(r),document.body.appendChild(n);let i=`top:${e.top}px;left:${e.left}px;width:${e.width}px;height:${e.height}px;`;return[n,i,e.left,e.top]},Rs=e=>{let{offsetParent:t}=e;if(t===null)return Pn;{let{left:o,top:n}=t.getBoundingClientRect();return[o,n]}},vn=(e,t)=>{let o=Wt(),n=Wt(),r=Wt(),i=st((c,p)=>{if(n.current&&r.current){let{dragOffsets:[m,u],targetPosition:f}=n.current,h=typeof c=="number"?c-m:f.left,g=typeof p=="number"?p-u:f.top;(h!==f.left||g!==f.top)&&(n.current.targetPosition.left=h,n.current.targetPosition.top=g,r.current.style.top=g+"px",r.current.style.left=h+"px")}},[]),s=st(c=>{if(n.current){let{dragInstructions:p,payload:m,originalCSS:u}=n.current;t({type:"drag-drop",draggedReactElement:m,dragInstructions:p,dropTarget:c}),console.log("[useLayoutDragDrop]",{dragInstructions:p}),r.current&&(p.RemoveDraggableOnDragEnd?document.body.removeChild(r.current):(r.current.style.cssText=u,delete r.current.dataset.dragging)),o.current=void 0,n.current=void 0,r.current=void 0}},[t]),a=st(c=>{if(o.current){let{payload:p,dragContainerPath:m,dragElement:u,dragRect:f,instructions:h=bs,path:g}=o.current,{current:y}=e,d={x:c.clientX,y:c.clientY},b=p!=null?p:V(y,g,!0),{id:E}=b.props,R=_(b),S="",x="",D="",v=-1,C=-1,B=Pn,L=document.getElementById(E);if(L===null)[L,x,v,C]=xs(f,E,u);else{B=Rs(L);let[k,M]=B,{width:A,height:z,left:Z,top:W}=L.getBoundingClientRect();v=Z-k,C=W-M,x=`width:${A}px;height:${z}px;left:${v}px;top:${C}px;z-index: 100;background-color:#ccc;opacity: 0.6;`,L.dataset.dragging="true",S=L.style.cssText}D=Ct.initDrag(e.current,m,f,d,{drag:i,drop:s},R),L.style.cssText=x+D,r.current=L,n.current={payload:b,originalCSS:S,dragRect:f,dragOffsets:B,dragInstructions:h,targetPosition:{left:v,top:C}}}},[i,s,e]);return st(c=>{let{evt:p,...m}=c;console.log("prepare to drag",{options:m}),o.current={...m,dragContainerPath:""},Ct.handleMousedown(p,a,m.instructions)},[a])};import{jsx as An}from"react/jsx-runtime";var Mn=e=>e.dropTarget,Ds=e=>["drag-drop","remove","set-title","splitter-resize","switch-tab"].includes(e.type),Pm=()=>{let e=Ts();return An("div",{children:`Context: ${e} `})},vm=e=>{let{children:t,layout:o,onLayoutChange:n}=e,r=Ln(void 0),i=Ln(t),[,s]=Ss(null),a=_t(m=>{if(n){let u=Q(m,Mn)||r.current,h=P(u)==="DraggableLayout"?T(u).children[0]:u,g=rn(h);n(g,"drag-root")}},[n]),l=_t((m,u=!1)=>{let f=wn(r.current,m);f!==r.current&&(r.current=f,s({}),!u&&Ds(m)&&a(f))},[a]),c=_t(m=>{switch(m.type){case"drag-start":{p(m);break}case"save":{a(r.current);break}default:{l(m);break}}},[l,a]),p=vn(r,c);return Es(()=>{if(o){let m=Q(r.current,Mn),u=fo(m),f=tt(o,`${m.props.path}.0`),h=u?{type:U.REPLACE,target:u,replacement:f}:{type:U.ADD,path:m.props.path,component:f};l(h,!0)}},[l,o]),r.current===void 0?r.current=$t(t):t!==i.current&&(r.current=$t(t,r.current),i.current=t),An(He.Provider,{value:{dispatchLayoutProvider:c,version:0},children:r.current})},X=()=>{let{dispatchLayoutProvider:e}=Cn(He);return e},Ts=()=>{console.log({LayoutProviderContext:He});let{version:e}=Cn(He);return e};import{jsx as Ps}from"react/jsx-runtime";var zn=function(t){let{path:o}=t,n=X(),r=ws(i=>{n({type:ye.SPLITTER_RESIZE,path:o,sizes:i})},[n,o]);return Ps(Ot,{...t,onSplitterMoved:r})};zn.displayName="Flexbox";I("Flexbox",zn,"container");import{useForkRef as Xs}from"@salt-ds/core";import Zs from"classnames";import{forwardRef as Ys}from"react";import{useCallback as $n,useEffect as zs,useRef as Xt,useState as Is}from"react";import{useCallback as vs,useLayoutEffect as In,useRef as Ls}from"react";var Wm=["height","width"],_m=["height"],Gm=["width"],me=new WeakMap,Bn=(e,t,o)=>{switch(o){case"height":return t.height;case"scrollHeight":return e.scrollHeight;case"scrollWidth":return e.scrollWidth;case"width":return t.width;default:return 0}},kn=new ResizeObserver(e=>{for(let t of e){let{target:o,contentRect:n}=t,r=me.get(o);if(r){let{onResize:i,measurements:s}=r,a=!1;for(let[l,c]of Object.entries(s)){let p=Bn(o,n,l);p!==c&&(a=!0,s[l]=p)}a&&i&&i(s)}}});function On(e,t,o,n=!1){let r=Ls(t),i=vs(s=>{let a=s.getBoundingClientRect();return r.current.reduce((l,c)=>(l[c]=Bn(s,a,c),l),{})},[]);In(()=>{let s=e.current,a=!1;async function l(){me.set(s,{measurements:{}}),a=!1;let{fonts:c}=document;if(c&&await c.ready,!a){let p=me.get(s);if(p){let m=i(s);p.measurements=m,kn.observe(s),n&&o(m)}}}if(s){if(me.has(s))throw Error("useResizeObserver attemping to observe same element twice");l()}return()=>{s&&me.has(s)&&(kn.unobserve(s),me.delete(s),a=!0)}},[e,i]),In(()=>{let s=e.current,a=me.get(s);if(a){if(r.current!==t){r.current=t;let l=i(s);a.measurements=l}a.onResize=o}},[t,i,e,o])}function Ms(e,t){let o=document.body.querySelector(`.${e}`),n={get:function(r,i){let s=r.getPropertyValue(`--${e}-breakpoint-${i}`);return s?parseInt(s):void 0}};return o?new Proxy(getComputedStyle(o),n):t!=null?t:{}}var Cs=([,e],[,t])=>t-e,Ut=e=>Object.entries(e).sort(Cs).map(([t,o],n,r)=>[t,o,n<r.length-1?r[n+1][1]:9999]),Gt=null,As=(e="salt")=>{let{xs:t,sm:o,md:n,lg:r,xl:i}=Ms(e);return Ut({xs:t,sm:o,md:n,lg:r,xl:i})},Hn=e=>(Gt===null&&(Gt=As(e)),Gt);var ks=[],Fn=({breakPoints:e,smallerThan:t},o)=>{let[n,r]=Is(t?!1:"lg"),i=Xt(document.body),s=Xt(e?Ut(e):Hn()),a=Xt("lg"),l=$n(p=>{if(s.current){for(let[m,u]of s.current)if(p>=u)return m}},[s]),c=$n(p=>{if(t){let m=s.current.find(([u])=>u===t);if(m){let[,,u]=m;return p<u}}else return l(p);return p},[t,l]);return On(o||i,s.current?["width"]:ks,({width:p})=>{let m=c(p);m!==a.current&&(a.current=m,r(m))},!0),zs(()=>{let p=o||i;if(p.current){let m=a.current;if(s.current){let{clientWidth:u}=p.current,f=c(u);a.current=f,f!==m&&r(f)}}},[r,c,o]),n};var Nn="data-collapsible",Bs={[Nn]:!0,"data-pad-start":!0,"data-pad-end":!0},Os=e=>{var t;return(t=Bs[e])!=null?t:!1},Hs=e=>e===Nn,$s={dynamic:"dynamic",instant:"instant",true:"instant"},Fs=e=>{var t;return(t=$s[e])!=null?t:"none"},Qm=e=>Object.keys(e).reduce((t,o)=>{let[n,r]=t;if(Os(o)){let i=Hs(o)?Fs(e[o]):e[o];n[o]=i,r[o]=void 0}return t},[{},{}]);import{getUniqueId as Ns}from"@vuu-ui/vuu-utils";import{cloneElement as Vs,isValidElement as Ws,useCallback as _s,useMemo as Vn,useRef as Zt}from"react";var Gs=["xs","sm","md","lg","xl"],Us=12,Wn=({children:e,cols:t,style:o})=>{let n=Zt(null),r=Zt(null),i=Zt(),s=t!=null?t:Us,l=(o==null?void 0:o.flexDirection)==="column"?"height":"width",c=Vn(()=>Array.isArray(e)?e:Ws(e)?[e]:[],[e]),p=_s((m,u)=>{let f=qe(m,u,Gs),h=[],g=[];for(let y=0;y<m.length;y++){let d=m[y],{style:{flex:b,...E}}=d.props;h.push(Vs(d,{key:Ns(),style:{...E,"--parent-col-count":s}})),g.push(f[y])}return[h,g]},[s]);return Vn(()=>{let[m,u]=p(c,l);r.current=u,i.current=m},[p,c,l]),{cols:s,content:i.current,rootRef:n}};import{jsx as Js}from"react/jsx-runtime";var at="hwFluidGrid",Yt=Ys(function(t,o){let{breakPoints:n,children:r,column:i,cols:s=12,className:a,flexFill:l,gap:c=3,fullPage:p,id:m,onSplitterMoved:u,resizeable:f,row:h,showGrid:g,spacing:y,splitterSize:d,style:b,...E}=t,{cols:R,content:S,rootRef:x}=Wn({children:r,cols:s,style:b}),D=Fn({breakPoints:n},x),v=Zs(at,a,{[`${at}-column`]:i,[`${at}-row`]:h,[`${at}-show-grid`]:g,"flex-fill":l,"full-page":p}),C={...b,"--spacing":y,"--grid-col-count":R,"--grid-gap":c};return Js("div",{...E,className:v,"data-breakpoint":D,"data-cols":R,"data-resizeable":f||void 0,id:m,ref:Xs(x,o),style:C,children:S})});Yt.displayName="FluidGrid";import{jsx as js}from"react/jsx-runtime";var _n=function(t){return js(Yt,{...t})};_n.displayName="FluidGrid";I("FluidGrid",_n,"container");import ca from"classnames";import pa,{useRef as ua,useState as er}from"react";import{useCallback as $e,useState as Ks}from"react";var lt=(e,t,o,n)=>{var y;let{loadSessionState:r,purgeSessionState:i,purgeState:s,saveSessionState:a}=xe(),[l,c]=Ks((y=r(e,"contributions"))!=null?y:[]),p=X(),m=$e((d,b)=>{let E=l.concat([{location:d,content:b}]);a(e,"contributions",E),c(E)},[l,e,a]),u=$e(()=>{i(e,"contributions"),c([])},[e,i]),f=$e(()=>{let d=r(e,"data-source");d&&d.unsubscribe(),i(e),s(e),p({type:"remove",path:o})},[p,e,r,i,s,o]),h=$e(async(d,b,E)=>{var S;d.stopPropagation();let R=(S=t.current)==null?void 0:S.getBoundingClientRect();return new Promise((x,D)=>{p({type:"drag-start",evt:d,path:b===void 0?o:`${o}.${b}`,dragRect:R,preDragActivity:E,dropTargets:n,resolveDragStart:x,rejectDragStart:D})})},[t,p,o,n]);return[$e(async(d,b)=>{var R;let{type:E}=d;switch(E){case"maximize":case"minimize":case"restore":return p({type:E,path:(R=d.path)!=null?R:o});case"remove":return f();case"mousedown":return console.log("2) ViewActionDispatch Hook dispatch Action mousedown"),h(b,d.index,d.preDragActivity);case"add-toolbar-contribution":return m(d.location,d.content);case"remove-toolbar-contribution":return u();default:return}},[p,o,f,h,m,u]),l]};import{useForkRef as na,useIdMemo as ra}from"@salt-ds/core";import ia from"classnames";import jt,{forwardRef as sa,useMemo as aa,useRef as Kn}from"react";import{useCallback as de,useMemo as Gn}from"react";var Un=({id:e,rootRef:t,path:o,dropTargets:n,title:r})=>{let i=X(),{loadState:s,loadSessionState:a,purgeState:l,saveState:c,saveSessionState:p}=xe(),[m,u]=lt(e,t,o,n),f=Gn(()=>{var x;return(x=s("view-title"))!=null?x:r},[s,r]),h=de(x=>{o&&i({type:"set-title",path:o,title:x})},[i,o]),g=Gn(()=>s(e),[e,s]),y=de(x=>s(e,x),[e,s]),d=de(x=>{l(e,x),i({type:"save"})},[e,i,l]),b=de((x,D)=>{c(e,D,x),i({type:"save"})},[e,i,c]),E=de(x=>a(e,x),[e,a]),R=de((x,D)=>p(e,D,x),[e,p]),S=de(({type:x,...D})=>{let{[x]:v}=D;b(v,x)},[b]);return{contributions:u,dispatchViewAction:m,load:y,loadSession:E,onConfigChange:S,onEditTitle:h,purge:d,restoredState:g,save:b,saveSession:R,title:f}};import{useResizeObserver as qs,WidthHeight as Qs}from"@heswell/salt-lab";import{useCallback as Xn,useRef as Zn}from"react";var ea=[],Yn=({mainRef:e,resize:t="responsive",rootRef:o})=>{let n=t==="defer",r=Zn({}),i=Zn(),s=Xn(()=>{e.current&&(e.current.style.height=r.current.height+"px",e.current.style.width=r.current.width+"px"),i.current=void 0},[e]),a=Xn(({height:l,width:c})=>{r.current.height=l,r.current.width=c,i.current!==null&&clearTimeout(i.current),i.current=window.setTimeout(s,40)},[s]);qs(o,n?Qs:ea,a,n)};import ta,{useContext as Jn}from"react";var oa={dispatch:null},ct=ta.createContext(oa),jn=()=>{var t;let e=Jn(ct);return(t=e==null?void 0:e.dispatch)!=null?t:null},Kd=()=>Jn(ct);import{jsx as Jt,jsxs as la}from"react/jsx-runtime";var qn=sa(function(t,o){let{children:n,className:r,collapsed:i,closeable:s,"data-resizeable":a,dropTargets:l,expanded:c,flexFill:p,id:m,header:u,orientation:f="horizontal",path:h,resize:g="responsive",resizeable:y=a,tearOut:d,style:b={},title:E,...R}=t,S=ra(m),x=Kn(null),D=Kn(null),{contributions:v,dispatchViewAction:C,load:B,loadSession:L,onConfigChange:k,onEditTitle:M,purge:A,restoredState:z,save:Z,saveSession:W,title:fe}=Un({id:S,rootRef:x,path:h,dropTargets:l,title:E});Yn({mainRef:D,resize:g,rootRef:x});let Ee="vuuView",hr=()=>jt.isValidElement(n)&&z?jt.cloneElement(n,z):n,gr=aa(()=>({dispatch:C,id:S,path:h,title:fe,load:B,loadSession:L,onConfigChange:k,purge:A,save:Z,saveSession:W}),[C,S,B,L,k,h,A,Z,W,fe]),yr=typeof u=="object"?u:{};return Jt("div",{...R,className:ia(Ee,r,{[`${Ee}-collapsed`]:i,[`${Ee}-expanded`]:c,[`${Ee}-resize-defer`]:g==="defer"}),"data-resizeable":y,id:S,ref:na(o,x),style:b,tabIndex:-1,children:la(ct.Provider,{value:gr,children:[u?Jt(Qn,{...yr,collapsed:i,contributions:v,expanded:c,closeable:s,onEditTitle:M,orientation:f,tearOut:d,title:fe}):null,Jt("div",{className:`${Ee}-main`,ref:D,children:hr()})]})})});qn.displayName="View";var ae=jt.memo(qn);ae.displayName="View";I("View",ae,"view");import{EditableLabel as ma,Toolbar as da,ToolbarButton as fa,ToolbarField as ha,Tooltray as tr}from"@heswell/salt-lab";import{CloseIcon as ga}from"@salt-ds/icons";import{jsx as Re,jsxs as ya}from"react/jsx-runtime";var Qn=({className:e,contributions:t,collapsed:o,closeable:n,onEditTitle:r,orientation:i="horizontal",style:s,title:a="Untitled"})=>{let l=ua(null),[c,p]=er(a),[m,u]=er(!1),f=jn(),h=L=>f==null?void 0:f({type:"remove"},L),g="vuuHeader",y=()=>{var L;(L=l.current)==null||L.focus()},d=L=>{L.stopPropagation()},E=ca(g,e,`${g}-${o||i}`),R=()=>{u(!0)},S=L=>{L.key==="Enter"&&u(!0)},x=(L="",k="",M=!0,A=!1)=>{var z;u(!1),A?p(L):k!==L&&(p(k),r==null||r(k)),M===!1&&((z=l.current)==null||z.focus())},D=L=>{f==null||f({type:"mousedown"},L)},v=[],C=[],B=[];return a&&v.push(Re(ha,{className:"vuuHeader-title",children:Re(ma,{editing:m,value:c,onChange:p,onMouseDownCapture:y,onEnterEditMode:R,onExitEditMode:x,onKeyDown:S,ref:l,tabIndex:0},"title")},"title")),t==null||t.forEach((L,k)=>{C.push(pa.cloneElement(L.content,{key:k}))}),n&&B.push(ya(fa,{onClick:h,onMouseDown:d,children:[Re(ga,{})," Close"]},"close")),C.length>0&&v.push(Re(tr,{"data-align-end":!0,children:C},"contributions")),B.length>0&&v.push(Re(tr,{"data-align-end":!0,children:B},"actions")),Re(da,{className:E,orientation:i,style:s,onMouseDown:D,children:v})};import{uuid as ba}from"@vuu-ui/vuu-utils";import{List as xa,ListItem as Ra}from"@heswell/salt-lab";import or from"classnames";import{cloneElement as Ea,memo as Sa}from"react";import{jsx as Kt}from"react/jsx-runtime";var Da=e=>{let t=e.cloneNode(!0);return t.id="",delete t.dataset.idx,t},nr=Sa(({className:e,children:t,idx:o,resizeable:n,header:r,closeable:i,...s})=>Kt(Ra,{className:or("vuuPaletteItem",e),"data-draggable":!0,...s}));nr.displayName="PaletteItem";var Ta=({children:e,className:t,orientation:o="horizontal",...n})=>{let r=X(),i="vuuPalette";function s(a){var x;let c=a.target.closest(".vuuPaletteItem"),p=parseInt((x=c.dataset.idx)!=null?x:"-1");p!==-1&&console.log({children:e,idx:p,listItemElement:c});let{props:{caption:m,children:u,template:f,...h}}=e[p],{height:g,left:y,top:d,width:b}=c.getBoundingClientRect(),E=ba(),S=f?u:Kt(ae,{...{id:E,key:E},...h,title:h.label,children:u});r({dragRect:{left:y,top:d,right:y+b,bottom:d+150,width:b,height:g},dragElement:Da(c),evt:a.nativeEvent,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},path:"*",payload:S,type:"drag-start"})}return Kt(xa,{...n,borderless:!0,className:or(i,t,`${i}-${o}`),maxHeight:800,selected:null,children:e.map((a,l)=>a.type===nr?Ea(a,{key:l,onMouseDown:s}):a)})};I("Palette",Ta,"view");import{uuid as wa}from"@vuu-ui/vuu-utils";import{List as Pa,ListItem as va}from"@heswell/salt-lab";import La from"classnames";import{jsx as qt}from"react/jsx-runtime";var Ma="vuuPalette",ch=e=>{let{children:t,ViewProps:o,label:n,onMouseDown:r,template:i,...s}=e,a=X();return qt(va,{onMouseDown:c=>{let{left:p,top:m,width:u}=c.currentTarget.getBoundingClientRect(),f=wa(),g=i?t:qt(ae,{...{id:f,key:f},...o,title:e.label,children:t});a({type:"drag-start",evt:c.nativeEvent,path:"*",payload:g,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},dragRect:{left:p,top:m,right:p+u,bottom:m+150,width:u,height:100}})},...s,children:n})},Ca=({className:e,...t})=>qt(Pa,{...t,className:La(Ma,e),height:"100%",selectionStrategy:"none"});I("PaletteSalt",Ca,"view");import{Tab as Aa,Tabstrip as za,Toolbar as Ia,ToolbarField as ka}from"@heswell/salt-lab";import{useIdMemo as Ba}from"@salt-ds/core";import Oa from"classnames";import ut,{forwardRef as Ha,useCallback as $a}from"react";import{jsx as pt,jsxs as Wa}from"react/jsx-runtime";var rr="Tabs",Fa=()=>{},Na=(e,t)=>{var o,n;return(n=(o=e.props)==null?void 0:o.title)!=null?n:`Tab ${t+1}`},Va=e=>{let t=[];return ut.Children.forEach(e,o=>{ut.isValidElement(o)?t.push(o):console.warn("Stack has unexpected child element type")}),t},Qt=Ha(function({active:t=0,children:o,className:n,enableAddTab:r,enableCloseTabs:i,getTabIcon:s=Fa,getTabLabel:a=Na,id:l,keyBoardActivation:c="manual",onMouseDown:p,onTabAdd:m,onTabClose:u,onTabEdit:f,onTabSelectionChanged:h,showTabs:g,style:y,TabstripProps:d},b){var k;let E=Ba(l),R=M=>{h==null||h(M)},S=M=>{u==null||u(M)},x=()=>{m==null||m(ut.Children.count(o))},D=M=>{var W;let z=M.target.closest('[role^="tab"]');if((z==null?void 0:z.getAttribute("role"))==="tab"){let fe=parseInt((W=z.dataset.idx)!=null?W:"-1");if(fe===-1)throw Error("Stack: mousedown on tab with unknown index");p==null||p(M,fe)}},v=$a((M,A,z,Z)=>{f==null||f(Z,A)},[f]),C=()=>{var M;return ut.isValidElement(o)?o:Array.isArray(o)&&(M=o[t])!=null?M:null},B=()=>Va(o).map((M,A)=>{let z=`${E}-${A}`,{closeable:Z,id:W}=M.props;return pt(Aa,{ariaControls:`${z}-tab`,"data-icon":s(M,A),draggable:!0,id:z,label:a(M,A),closeable:Z,editable:(d==null?void 0:d.enableRenameTab)!==!1},W!=null?W:A)}),L=C();return Wa("div",{className:Oa(rr,n,{[`${rr}-horizontal`]:(d==null?void 0:d.orientation)==="vertical"}),style:y,id:E,ref:b,children:[g?pt(Ia,{className:"vuuTabHeader vuuHeader",orientation:d==null?void 0:d.orientation,children:pt(ka,{disableFocusRing:!0,"data-collapsible":"dynamic","data-priority":"3",style:{alignSelf:"flex-end"},children:pt(za,{...d,enableRenameTab:(d==null?void 0:d.enableRenameTab)!==!1,enableAddTab:r,enableCloseTab:i,keyBoardActivation:c,onActiveChange:R,onAddTab:x,onCloseTab:S,onExitEditMode:v,onMouseDown:D,activeTabIndex:(k=d==null?void 0:d.activeTabIndex)!=null?k:L===null?-1:t,children:B()})})}):null,L]})});Qt.displayName="Stack";import{useIdMemo as _a}from"@salt-ds/core";import Ga,{useRef as Ua}from"react";import{jsx as eo}from"react/jsx-runtime";var Xa=e=>eo(ae,{resizeable:!0,title:`Tab ${e}`,style:{flexGrow:1,flexShrink:0,flexBasis:0},header:!0,closeable:!0,children:eo(bt,{style:{flex:1}})}),ir=e=>{let t=Ua(null),o=X(),{loadState:n}=xe(),{createNewChild:r=Xa,id:i,onTabSelectionChanged:s,path:a,...l}=e,{children:c}=e,p=_a(i),[m]=lt(p,t,a);return eo(Qt,{...l,id:p,getTabLabel:(b,E)=>{let{id:R,title:S}=b.props;return n(R,"view-title")||S||`Tab ${E+1}`},onMouseDown:async(b,E)=>{let R;await m({type:"mousedown",index:E,preDragActivity:async()=>new Promise(D=>{console.log("preDragActivity: Ok, gonna release the drag"),R=D})},b)&&(R==null||R(void 0))},onTabAdd:(b,E=Ga.Children.count(c))=>{if(a){console.log("[StackLayout] handleTabAdd");let R=r(E);console.log({component:R}),o({type:"add",path:a,component:R})}},onTabClose:b=>{if(Array.isArray(c)){let{props:{"data-path":E,path:R=E}}=c[b];o({type:"remove",path:R})}},onTabEdit:(b,E)=>{o({type:"set-title",path:`${a}.${b}`,title:E})},onTabSelectionChanged:b=>{console.log(`StackLayout handleTabSelection nextTab = ${b}`),a&&(o({type:"switch-tab",path:a,nextIdx:b}),s==null||s(b))},ref:t})};ir.displayName="Stack";I("Stack",ir,"container");import sr,{useState as ar}from"react";import{jsx as to,jsxs as lr}from"react/jsx-runtime";var Jh=({children:e})=>{let[o,n]=ar(e),[r,i]=ar(e),s=l=>{let c=ho(o,l);i(c)},a=(l,c)=>{console.log(`change ${l} -> ${c}`);let p=sr.cloneElement(r,{style:{...r.props.style,[l]:c}});i(p),n(sr.cloneElement(o,{},p))};return lr("div",{"data-design-mode":`${!1}`,children:[o,to("br",{}),lr("div",{style:{display:"flex"},children:[to(cr,{height:300,managedStyle:r.props.style,width:300,onChange:a,style:void 0}),to(pr,{layout:o,onSelect:s,style:{width:300,height:300,backgroundColor:"#ccc"}})]})]})};import{FormField as mt,Input as dt}from"@heswell/salt-lab";import{jsx as H,jsxs as no}from"react/jsx-runtime";var ro={},Za={margin:{top:"marginTop",right:"marginRight",bottom:"marginBottom",left:"marginLeft"},border:{top:"borderTopWidth",right:"borderRightWidth",bottom:"borderBottomWidth",left:"borderLeftWidth"},padding:{top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"}},oo=({feature:e,children:t,style:o,onChange:n})=>no("div",{className:`LayoutBox layout-${e} layout-outer`,children:[no("div",{className:"layout-top",children:[H("span",{className:"layout-title",children:e}),H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.top,onChange:(r,i)=>n(e,"top",i)})})]}),no("div",{className:"layout-inner",children:[H("div",{className:"layout-left",children:H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.left,onChange:(r,i)=>n(e,"left",i)})})}),t,H("div",{className:"layout-right",children:H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.right,onChange:(r,i)=>n(e,"right",i)})})})]}),H("div",{className:"layout-bottom",children:H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.bottom,onChange:(r,i)=>n(e,"bottom",i)})})})]}),rg={margin:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0},ig={padding:!0,paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0},sg={border:!0,borderColor:!0,borderWidth:!0,borderTopWidth:!0,borderRightWidth:!0,borderBottomWidth:!0,borderLeftWidth:!0},ft="(\\d+)(?:px)?",Ya=`^(?:${ft}(?:\\s${ft}(?:\\s${ft}(?:\\s${ft})?)?)?)$`,ur=new RegExp(Ya),Ja=/^(?:(\d+)(?:px)\ssolid\s([a-zA-Z,0-9().]+))$/,cr=({height:e,managedStyle:t,onChange:o,style:n,width:r})=>{let i=mr(t),s=(E,R,S)=>{let x=parseInt(S||"0",10),D=Za[E][R];o(D,x)},{marginTop:a=0,marginRight:l=0,marginBottom:c=0,marginLeft:p=0}=i,{borderTopWidth:m=0,borderRightWidth:u=0,borderBottomWidth:f=0,borderLeftWidth:h=0}=i,{paddingTop:g=0,paddingRight:y=0,paddingBottom:d=0,paddingLeft:b=0}=i;return H("div",{className:"LayoutConfigurator",style:{width:r,height:e,...n},children:H(oo,{feature:"margin",style:{top:a,right:l,bottom:c,left:p},onChange:s,children:H(oo,{feature:"border",style:{top:m,right:u,bottom:f,left:h},onChange:s,children:H(oo,{feature:"padding",style:{top:g,right:y,bottom:d,left:b},onChange:s,children:H("div",{className:"layout-content"})})})})})};function ag(e=ro,t=ro){let{margin:o,marginTop:n,marginRight:r,marginBottom:i,marginLeft:s,padding:a,paddingTop:l,paddingRight:c,paddingBottom:p,paddingLeft:m,...u}=e;if(typeof o=="number")u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=o;else if(typeof o=="string"){let f=ur.exec(o);if(f===null)console.error(`Invalid css value for margin '${o}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.marginTop=parseInt(h,10),u.marginRight=parseInt(g,10),u.marginBottom=parseInt(y,10),u.marginLeft=parseInt(d,10)):b?(u.marginTop=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10),u.marginBottom=parseInt(y,10)):h&&g?(u.marginTop=u.marginBottom=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10)):u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=parseInt(h,10)}}if(typeof n=="number"&&(u.marginTop=n),typeof r=="number"&&(u.marginRight=r),typeof i=="number"&&(u.marginBottom=i),typeof s=="number"&&(u.marginLeft=s),typeof a=="number")u.paddingTop=u.paddingRight=u.paddingBottom=u.paddingLeft=a;else if(typeof a=="string"){let f=ur.exec(a);if(f===null)console.error(`Invalid css value for padding '${a}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.paddingTop=parseInt(h,10),u.paddingRight=parseInt(g,10),u.paddingBottom=parseInt(y,10),u.paddingLeft=parseInt(d,10)):b?(u.paddingTop=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10),u.paddingBottom=parseInt(y,10)):h&&g?(u.paddingTop=u.paddingBottom=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10)):u.paddingTop=u.paddingRight=u.paddingBottom=u.paddinggLeft=parseInt(h,10)}}return typeof l=="number"&&(u.paddingTop=l),typeof c=="number"&&(u.paddingRight=c),typeof p=="number"&&(u.paddingBottom=p),typeof m=="number"&&(u.paddingLeft=m),mr(u,t)}function mr(e=ro){let t={...e},o,{border:n,borderWidth:r,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,margin:p,marginTop:m,marginRight:u,marginBottom:f,marginLeft:h,padding:g,paddingTop:y,paddingRight:d,paddingBottom:b,paddingLeft:E,...R}=t,S={},x={};if(typeof p=="number"&&(t.marginTop=t.marginRight=t.marginBottom=t.marginLeft=p,S={marginTop:p,marginRight:p,marginBottom:p,marginLeft:p}),typeof g=="number"&&(t.paddingTop=t.paddingRight=t.paddingBottom=t.paddingLeft=g,x={paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g}),n||r||i||s||a||l){typeof n=="string"&&(o=Ja.exec(n))&&([,r,c]=o,r=parseInt(r,10)),r&&(i=i===void 0?r:i,s=s===void 0?r:s,a=a===void 0?r:a,l=l===void 0?r:l),c=c||"black";let D=`
|
|
17
|
+
`,document.body.insertBefore(t,e)}}var we=class{constructor(){this.currentPath=null;this.tabMode=null;ni()}prepare(t,o="full-view"){document.body.classList.add("drawing"),this.currentPath=null,this.tabMode=o;let n=this.getPoints(0,0,0,0),r=Po(n),i=document.getElementById("vuu-drop-outline");i==null||i.setAttribute("d",r),this.currentPath=r}clear(){Te=null,_e(),document.body.classList.remove("drawing"),Pt.hidePopup()}get hoverDropTarget(){return Te}getPoints(t,o,n,r,i=0,s=0,a=0){let l=this.tabMode==="tab-only";if(s===0)return[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o],[t+n,o],[t+n,o+r],[t,o+r]];if(l){let c=i;return[[c,o],[c,o],[c+s,o],[c+s,o],[c+s,o+a],[c+s,o+a],[c,o+a],[c,o+a]]}else return i===0?[[t,o+a],[t,o+a],[t,o],[t+s,o],[t+s,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]:[[t,o+a],[t+i,o+a],[t+i,o],[t+i,o],[t+i,o+a],[t+n,o+a],[t+n,o+r],[t,o+r]]}draw(t,o){let r=vt;if(Te!==null)this.drawTarget(Te);else if(vt=t.nextDropTarget!=null,t.pos.tab?ri(t):J&&_e(),this.drawTarget(t,o),vt){let[i,s,a]=To(t);{let l=ii(wo,{dropTarget:t,onHover:Qr,orientation:a});Pt.showPopup({left:i,top:s,component:l})}}else Pt.hidePopup()}drawTarget(t,o){let r=t.getTargetDropOutline(6,o);if(r){let{l:i,t:s,r:a,b:l,tabLeft:c,tabWidth:p,tabHeight:m,guideLines:u}=r,f=a-i,h=l-s;if(this.currentPath){let E=document.getElementById("vuu-drop-outline");E==null||E.setAttribute("d",this.currentPath)}let g=this.getPoints(i,s,f,h,c,p,m),y=Po(g),d=document.getElementById("hw-drop-outline-animate");d==null||d.setAttribute("to",y),d==null||d.beginElement(),this.currentPath=y;let b=document.getElementById("hw-drop-guides");b==null||b.setAttribute("d",oi(u))}}},vo="transition:margin-left .4s ease-out;margin-left: 63px",Lo="transition:margin-left .4s ease-out;margin-left: 0px";function ri(e){var a,l;let{AFTER:t,BEFORE:o}=De,{clientRect:{Stack:n},pos:{tab:r}}=e,{id:i}=e.component.props,s=null;if(n&&r&&r.positionRelativeToTab!==t){let c=r.positionRelativeToTab===o?1:2,p=`:scope .hwTabstrip > .hwTabstrip-inner > .hwTab:nth-child(${r.index+c})`;s=(a=document.getElementById(i))==null?void 0:a.querySelector(p),s?(J===null||J!==s)&&(s.style.cssText=vo,J&&(J.style.cssText=Lo),J=s):_e()}else if((r==null?void 0:r.positionRelativeToTab)===o){if(J===null){let c=".vuuHeader-title";s=(l=document.getElementById(i))==null?void 0:l.querySelector(c),s.style.cssText=vo,J=s}}else _e()}function _e(){J&&(J.style.cssText=Lo,J=null)}var ee,Pe,re,Co,Ao,ie,Ge,ge=null,Mt,zo,ve,Io,Lt,Ue=null,si=3,Xe=new we,Mo=.4;function ai(e,t){return t?V(e,t):Q(e,o=>o.dropTarget)}var Ct={handleMousedown(e,t,o={}){ee=t,zo=o,Co=e.clientX,Ao=e.clientY,Lt=o.dragThreshold===void 0?si:o.dragThreshold,Lt===0?ee(e,0,0):(window.addEventListener("mousemove",Ze,!1),window.addEventListener("mouseup",Ye,!1),Ue=window.setTimeout(()=>{console.log("mousedownTimer fires"),window.removeEventListener("mousemove",Ze,!1),window.removeEventListener("mouseup",Ye,!1),ee==null||ee(e,0,0)},500)),e.preventDefault()},initDrag(e,t,{top:o,left:n,right:r,bottom:i},s,a,l,c){return{drag:Pe,drop:re}=a,li(e,t,{top:o,left:n,right:r,bottom:i},s,l,c)}};function Ze(e){let n=e.clientX-Co,r=e.clientY-Ao;Math.max(Math.abs(n),Math.abs(r))>Lt&&(window.removeEventListener("mousemove",Ze,!1),window.removeEventListener("mouseup",Ye,!1),ee==null||ee(e,n,r),ee=null)}function Ye(){Ue&&(window.clearTimeout(Ue),Ue=null),window.removeEventListener("mousemove",Ze,!1),window.removeEventListener("mouseup",Ye,!1)}function li(e,t,o,n,r,i){ie=ai(e,t);let{"data-path":s,path:a=s}=T(ie);i&&(Mt=i.map(u=>Q(e,f=>f.id===u)).map(u=>u.props.path)),ve=he.measure(ie,i),console.log({_measurements:ve});let l=ve[a];Ge=new We(l,n.x,n.y,o,r);let c=Math.round(Ge.x.mousePct*100),p=Math.round(Ge.y.mousePct*100);return window.addEventListener("mousemove",ko,!1),window.addEventListener("mouseup",Bo,!1),Io=!1,Xe.prepare(o,"tab-only"),zo.DoNotTransform?"transform:none":`transform:scale(${Mo},${Mo});transform-origin:${c}% ${p}%;`}function ko(e){let t=e.clientX,o=e.clientY,n=Ge,r=ge,i,s,a;n.update("x",t)&&(s=n.x.pos),n.update("y",o)&&(a=n.y.pos),s===void 0&&a===void 0||Pe==null||Pe(s,a),!(Io||ie===void 0)&&(n.inBounds()?i=Tt(t,o,ie,ve,n.hasIntrinsicSize(),Mt):i=Tt(n.dropX(),n.dropY(),ie,ve),r&&(i==null||i.box!==r.box)&&(ge=null),i&&(Xe.draw(i,n),ge=i))}function Bo(){ci()}function ci(){if(ge){let e=Xe.hoverDropTarget||ne.getActiveDropTarget(ge);re==null||re(e),ge=null}else re==null||re({component:ie,pos:{position:F.Absolute}});Pe=null,re=null,ie=void 0,Xe.clear(),Mt=void 0,window.removeEventListener("mousemove",ko,!1),window.removeEventListener("mouseup",Bo,!1)}import pi from"classnames";import{useRef as ui}from"react";import{jsx as mi}from"react/jsx-runtime";var Oo=function(t){let o=ui();o.current=t;let{className:n,id:r,style:i}=t,s=pi("DraggableLayout",n);return mi("div",{className:s,id:r,style:i,children:t.children})},Ho="DraggableLayout";Oo.displayName=Ho;I(Ho,Oo,"container");import{useForkRef as Bi}from"@salt-ds/core";import Oi from"classnames";import{forwardRef as Hi}from"react";import{getUniqueId as Li}from"@vuu-ui/vuu-utils";import ze,{useCallback as Qe,useMemo as Jo,useRef as et,useState as Mi}from"react";import di from"classnames";import{jsx as fi}from"react/jsx-runtime";var $o="vuuPlaceholder",Je=({className:e,closeable:t,flexFill:o,resizeable:n,shim:r,...i})=>fi("div",{className:di($o,e,{[`${$o}-shim`]:r}),...i,"data-placeholder":!0,"data-resizeable":!0});Je.displayName="Placeholder";I("Placeholder",Je);import hi from"classnames";import gi,{useCallback as Le,useRef as je,useState as yi}from"react";import{jsx as Fo}from"react/jsx-runtime";var No=gi.memo(function({column:t,index:o,onDrag:n,onDragEnd:r,onDragStart:i,style:s}){let a=je(),l=je(null),c=je(0),[p,m]=yi(!1),u=Le(({key:x,shiftKey:D})=>{let v=D?10:1;t&&x==="ArrowDown"?n(o,v):t&&x==="ArrowUp"||!t&&x==="ArrowLeft"?n(o,-v):!t&&x==="ArrowRight"&&n(o,v)},[t,o,n]),f=Le(x=>{let{key:D}=x;(t&&(D==="ArrowUp"||D==="ArrowDown")||!t&&(D==="ArrowLeft"||D==="ArrowRIght"))&&(i(o),u(x),h.current=u)},[t,u,o,i]),h=je(f),g=x=>h.current(x),y=Le(x=>{a.current=!0;let D=x[t?"clientY":"clientX"],v=D-c.current;D&&D!==c.current&&n(o,v),c.current=D},[t,o,n]),d=Le(()=>{var x;window.removeEventListener("mousemove",y,!1),window.removeEventListener("mouseup",d,!1),r(),m(!1),(x=l.current)==null||x.focus()},[y,r,m]),b=Le(x=>{c.current=t?x.clientY:x.clientX,i(o),window.addEventListener("mousemove",y,!1),window.addEventListener("mouseup",d,!1),x.preventDefault(),m(!0)},[t,y,d,o,i,m]),E=()=>{var x;a.current?a.current=!1:(x=l.current)==null||x.focus()},R=()=>{h.current=f},S=hi("Splitter","focusable",{active:p,column:t});return Fo("div",{className:S,"data-splitter":!0,ref:l,role:"separator",style:s,onBlur:R,onClick:E,onKeyDown:g,onMouseDown:b,tabIndex:0,children:Fo("div",{className:"grab-zone"})})});import{uuid as Vo}from"@vuu-ui/vuu-utils";import Wo from"react";var bi={"data-placeholder":!0,"data-resizeable":!0},Ke={},se="auto",At={flexBasis:0,flexGrow:1,flexShrink:1,height:se,width:se},_o={height:"width",width:"height"},Go=(e="row")=>e==="row"?["width","height","column"]:["height","width","row"],xi=e=>typeof e=="string"&&e.endsWith("%"),_=e=>{let{style:{width:t=se,height:o=se}=Ke}=e.props,n=typeof o=="number",r=typeof t=="number";return n&&r?{height:o,width:t}:n?{height:o}:r?{width:t}:void 0};function zt(e,t,o){let n=_o[t],{style:{[n]:r=se,...i}=Ke}=e.props;return o&&o[t]?{...i,...At,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...i,...At,[n]:r}}function Uo(e){let{style:{flex:t,flexGrow:o,flexShrink:n,flexBasis:r}=Ke}=e.props;return typeof t=="number"||r===0&&o===1&&n===1?!0:typeof r!="number"}function It(e,t,o){let n=_o[t],{style:{[t]:r=se,[n]:i=se,...s}=Ke}=e.props;return r!==se?xi(r)?{flexBasis:0,flexGrow:1,flexShrink:1,[t]:void 0,[n]:i}:{flexBasis:r,flexGrow:0,flexShrink:0,[t]:r,[n]:i}:o&&o[t]?{...s,...At,flexBasis:o[t],flexGrow:0,flexShrink:0}:{...s,[n]:i}}function Me(e,t,o,n,r){let i=[],s=0,a;if(n&&r){let p,[m,u,f,h]=r;[p,a]=t==="column"?[u-n.top,n.bottom-h]:[m-n.left,n.right-f],p&&i.push(K(`${o}.${s++}`,p,{flexGrow:0,flexShrink:0}))}else a=!0;let{version:l=0,style:c}=T(e);return i.push(O(e,`${o}.${s++}`,{version:l+1,style:{...c,flexBasis:"auto",flexGrow:0,flexShrink:0}})),a&&i.push(K(`${o}.${s++}`,0,void 0,{[`data-${t}-placeholder`]:!0})),kt(t,{resizeable:!1,style:{flexBasis:"auto"}},i,o)}var Ri=(e,t)=>{if(!t)return e===0?1:0};function kt(e,t,o,n){let r=Vo(),{flexFill:i,style:s,resizeable:a=!0}=t,{flexBasis:l=i?void 0:"auto"}=s,c=Ri(l,i);return Wo.createElement(oe.Flexbox,{id:r,key:r,path:n,flexFill:i,style:{...s,flexDirection:e,flexBasis:l,flexGrow:c,flexShrink:c},resizeable:a},o)}var Ei={flexGrow:1,flexShrink:1};function K(e,t,o,n){let r=Vo();return Wo.createElement("div",{...bi,...n,"data-path":e,id:r,key:r,style:{...Ei,...o,flexBasis:t}})}var Si={},Ce=1,Ae=2,Di=e=>typeof e.intrinsicSize=="number",Ti=(e,t)=>{let o={};return e.forEach(n=>{o[n]=w(t,n)}),o},qe=(e,t,o)=>e.map((n,r)=>{var l;let i=w(n,"resizeable"),{[t]:s}=(l=_(n))!=null?l:Si,a=Uo(n);return o?{index:r,flexOpen:a,intrinsicSize:s,resizeable:i,...Ti(o,n)}:{index:r,flexOpen:a,intrinsicSize:s,resizeable:i}}),Xo=e=>{let t=e.length,o=e.every(Di),n=Array(t).fill(0);if(o&&(n[0]=Ae,n[t-1]=Ae),t<2)return n;for(let r=0,i=0;r<t-1;r++)e[r].resizeable&&!i&&(i=Ce),n[r]+=i;for(let r=t-1;r>0&&(n[r]&Ce&&(n[r]-=Ce),!e[r].resizeable);r--);return n},Zo=(e,t)=>{let o=Pi(e,t),n=vi(e,t),r=o!==-1&&n!==-1?[o,n]:void 0,i=wi(e,r);return[r,i]};function wi(e,t){if(t){let o=[];for(let n=0;n<e.length;n++)e[n].flexOpen&&!t.includes(n)&&o.push(n);return o}}function Pi(e,t){let o=t,n=!1;for(;o>=1&&!n;)o=o-1,n=Yo(e,o);return o}function vi(e,t){let o=t,n=!1,r=e.length;for(;o<r&&!n;)o=o+1,n=Yo(e,o);return o===r?-1:o}function Yo(e,t){let{placeholder:o,splitter:n,resizeable:r,intrinsicSize:i}=e[t];return Boolean(!n&&!i&&(o||r))}var Ci=e=>!e.splitter&&!e.placeholder,Ko=({children:e,onSplitterMoved:t,style:o})=>{let n=et(null),r=et(),i=et(),s=et([]),[,a]=Mi({}),l=y=>{i.current=y,a({})},c=(o==null?void 0:o.flexDirection)==="column",p=c?"height":"width",m=Jo(()=>Array.isArray(e)?e:ze.isValidElement(e)?[e]:[],[e]),u=Qe(y=>{let{current:d}=r;if(d){let[b,E]=Zo(d,y);b&&(b.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{size:D,minSize:v}=ki(S,p);d[R].currentSize=D,d[R].minSize=v}}),E&&E.forEach(R=>{var x;let S=(x=n.current)==null?void 0:x.childNodes[R];if(S){let{[p]:D}=S.getBoundingClientRect();d[R].flexBasis=D}}))}},[p]),f=Qe((y,d)=>{i.current&&r.current&&l(zi(i.current,r.current,d,p))},[p]),h=Qe(()=>{let y=r.current;y&&(t==null||t(y.filter(Ci))),y==null||y.forEach(d=>{d.currentSize=void 0,d.flexBasis=void 0,d.flexOpen=!1})},[t]),g=Qe(y=>ze.createElement(No,{column:c,index:y,key:`splitter-${y}`,onDrag:f,onDragEnd:h,onDragStart:u}),[f,h,u,c]);return Jo(()=>{let[y,d]=Ai(m,p,g,s.current);r.current=d,i.current=y},[m,g,p]),{content:i.current||[],rootRef:n}};function Ai(e,t,o,n){let r=qe(e,t),i=Xo(r),s=[],a=[];for(let l=0;l<e.length;l++){let c=e[l];if(l===0&&i[l]&Ae&&(s.push(jo(l)),a.push({placeholder:!0,shim:!0})),c.key==null){let p=n[l]||(n[l]=Li());s.push(ze.cloneElement(c,{key:p}))}else s.push(c);a.push(r[l]),l>0&&i[l]&Ae?(s.push(jo(l)),a.push({placeholder:!0})):i[l]&Ce&&(s.push(o(s.length)),a.push({splitter:!0}))}return[s,a]}function zi(e,t,o,n){return Ii(t,o)?e.map((i,s)=>{let a=t[s],{currentSize:l,flexOpen:c,flexBasis:p}=a,m=l!==void 0;if(m||c){let{flexBasis:u}=i.props.style||{},f=m?a.currentSize:p;return f!==u?ze.cloneElement(i,{style:{...i.props.style,flexBasis:f,[n]:"auto"}}):i}else return i}):e}function Ii(e,t){let o=[];e.forEach((p,m)=>{p.currentSize!==void 0&&o.push(m)});let n=t<0?o[0]:o[1],{currentSize:r=0,minSize:i=0}=e[n];if(r===i)return!1;if(Math.abs(t)>r-i){let p=t<0?-1:1;t=Math.max(0,r-i)*p}let s=e[o[0]],{currentSize:a=0}=s;s.currentSize=a+t;let l=e[o[1]],{currentSize:c=0}=l;return l.currentSize=c-t,!0}function jo(e){return ze.createElement(Je,{shim:e===0,key:`placeholder-${e}`})}function ki(e,t){let{[t]:o}=e.getBoundingClientRect(),r=getComputedStyle(e).getPropertyValue(`min-${t}`),i=r.endsWith("px")?parseInt(r,10):0;return{size:o,minSize:i}}import{jsx as $i}from"react/jsx-runtime";var Bt="hwFlexbox",qo=Hi(function(t,o){let{breakPoints:n,children:r,column:i,className:s,flexFill:a,gap:l,fullPage:c,id:p,onSplitterMoved:m,resizeable:u,row:f,spacing:h,splitterSize:g,style:y,...d}=t,{content:b,rootRef:E}=Ko({children:r,onSplitterMoved:m,style:y}),R=Oi(Bt,s,{[`${Bt}-column`]:i,[`${Bt}-row`]:f,"flex-fill":a,"full-page":c});return $i("div",{...d,className:R,"data-resizeable":u||void 0,id:p,ref:Bi(E,o),style:{...y,gap:l,"--spacing":h},children:b})});qo.displayName="Flexbox";var Ot=qo;import{useCallback as ws}from"react";var ye={ADD:"add",BLUR:"blur",BLUR_SPLITTER:"blur-splitter",DRAG_START:"drag-start",DRAG_STARTED:"drag-started",DRAG_DROP:"drag-drop",FOCUS:"focus",FOCUS_SPLITTER:"focus-splitter",INITIALIZE:"initialize",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAR_OUT:"tear-out"};import{useCallback as _t,useContext as Cn,useEffect as Es,useRef as Ln,useState as Ss}from"react";import Tn from"react";import{uuid as an}from"@vuu-ui/vuu-utils";import Be from"react";import{uuid as on}from"@vuu-ui/vuu-utils";import Ie,{cloneElement as Fi}from"react";import{useCallback as be}from"react";var N=new Map,G=new Map,Qo=e=>N.get(e),en=e=>N.has(e),tn=(e,t)=>N.set(e,t),xe=()=>{let e=be((s,a)=>{let l=G.get(s);if(l)return a!==void 0&&l[a]!==void 0?l[a]:a!==void 0?void 0:l},[]),t=be((s,a,l)=>{if(a===void 0)G.set(s,l);else if(G.has(s)){let c=G.get(s);G.set(s,{...c,[a]:l})}else G.set(s,{[a]:l})},[]),o=be((s,a)=>{if(G.has(s)){if(a===void 0)G.delete(s);else if(G.get(s)[a]){let{[a]:c,...p}=G.get(s);Object.keys(p).length>0?G.set(s,p):G.delete(s)}}},[]),n=be((s,a)=>{let l=N.get(s);if(l)return a!==void 0?l[a]:l},[]),r=be((s,a,l)=>{if(a===void 0)N.set(s,l);else if(N.has(s)){let c=N.get(s);N.set(s,{...c,[a]:l})}else N.set(s,{[a]:l})},[]),i=be((s,a)=>{if(N.has(s)){if(a===void 0)N.delete(s);else if(N.get(s)[a]){let{[a]:c,...p}=N.get(s);Object.keys(p).length>0?N.set(s,p):N.delete(s)}}},[]);return{loadSessionState:e,loadState:n,saveSessionState:t,saveState:r,purgeState:i,purgeSessionState:o}};var nn=e=>e.flexDirection==="column"?["height","width"]:["width","height"],Ni={},ke=(e,t="0")=>{let[o,n]=Ft(P(e),e.props,t);return Ie.cloneElement(e,o,n)},$t=(e,t)=>{let o=P(e),[n,r]=Ft(o,e.props,"0",void 0,t);return Fi(e,n,r)};function Vi(e,t,o="0",n=null,r){var g,y;let{active:i=0,"data-path":s,path:a=s,id:l,style:c}=T(r),p=P(r)===e&&o===a,m=p?l:(g=t.id)!=null?g:on(),u=e==="Stack"?(y=t.active)!=null?y:i:void 0,f=m,h=p?c:_i(e,t,n);return uo(e)?{id:m,key:f,path:o,style:h,type:e,active:u}:{id:m,key:f,style:h,"data-path":o}}function Ft(e,t,o,n=null,r){var c,p;let i=Vi(e,t,o,n,r);if(t.layout&&!r)return[i,[tt(t.layout,`${o}.0`)]];let s=(p=r==null?void 0:r.children)!=null?p:(c=r==null?void 0:r.props)==null?void 0:c.children,l=t.dropTarget&&s?s:Wi(e,t.children,o,s);return[i,l]}function Wi(e,t,o="0",n){let r=Array.isArray(t)?t:Ie.isValidElement(t)?[t]:[];return $(e)?r.map((i,s)=>{let a=P(i),l=P(n==null?void 0:n[s]);if(!l||a===l){let[c,p]=Ft(a,i.props,`${o}.${s}`,e,n==null?void 0:n[s]);return Ie.cloneElement(i,c,p)}return n==null?void 0:n[s]}):t}var _i=(e,t,o)=>{let{style:n=Ni}=t;if(e==="Flexbox"&&(n={flexDirection:t.column?"column":"row",...n,display:"flex"}),n.flex){let{flex:r,...i}=n;n={...i,...xt(typeof r=="number"?r:0)}}else o==="Stack"?n={...n,...xt(1)}:o==="Flexbox"&&(n.width||n.height)&&n.flexBasis===void 0&&(n={...n,flexBasis:"auto",flexGrow:0,flexShrink:0});return n};function tt({id:e=on(),type:t,children:o,props:n,state:r},i){let s=t.match(/^[a-z]/)?t:oe[t];if(s===void 0)throw Error(`layoutUtils unable to create component from JSON, unknown type ${t}`);return r&&tn(e,r),Ie.createElement(s,{id:e,...n,key:e,path:i},o?o.map((a,l)=>tt(a,`${i}.${l}`)):void 0)}function rn(e){return sn(e)}function sn(e){let t=P(e),{id:o,children:n,type:r,...i}=T(e),s=en(o)?Qo(o):void 0;return{id:o,type:t,props:Gi(i),state:s,children:Ie.Children.map(n,sn)}}function Gi(e){if(e){let{path:t,...o}=e,n={};for(let[r,i]of Object.entries(o))n[r]=Ht(i);return n}}function Ht(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(Ht);if(typeof e=="object"&&e!==null){let t={};for(let[o,n]of Object.entries(e))t[o]=Ht(n);return t}}function ln(e,t){var s;let o=e.props.children,n=o.length,{index:r=-1,positionRelativeToTab:i="after"}=t.tab||{};return r===-1||r>=n?[o[n-1],"after"]:[(s=o[r])!=null?s:null,i]}function ot(e,t,o){let{active:n,children:r=[],path:i}=T(e),s=w(t,"path"),{idx:a,finalStep:l}=Y(i,s,!0),[c,p]=l?Ui(e,r,o):[n,r==null?void 0:r.map((u,f)=>f===a?ot(u,t,o):u)],m=P(e)==="Stack"?Array.isArray(c)?c[0]:c:n;return Be.cloneElement(e,{active:m},p)}function Ui(e,t,o){let n=w(e,"path"),r=t==null?void 0:t.length,{id:i=an()}=T(o);return r?[r,t.concat(O(o,`${n}.${r}`,{id:i,key:i}))]:[0,[O(o,`${n}.0`,{id:i})]]}function nt(e,t,o,n,r,i,s){let{active:a,children:l,path:c}=T(e),p=w(t,"path"),{idx:m,finalStep:u}=Y(c,p),[f,h]=u?Xi(e,l,m,o,n,r,i,s):[a,l.map((y,d)=>d===m?nt(y,t,o,n,r,i,s):y)],g=P(e)==="Stack"?f:a;return Be.cloneElement(e,{active:g},h)}function Xi(e,t,o,n,r,i,s,a){let l=_(n);return l!=null&&l.width&&(l!=null&&l.height)?Yi(e,t,o,n,r,s,a):cn(e,t,o,n,r,(i==null?void 0:i.width)||(i==null?void 0:i.height),s)}var Zi=(e,t,{top:o,right:n,bottom:r,left:i},[s,a,l,c])=>{if(e==="column"&&t==="before")return a-o;if(e==="column")return r-c;if(e==="row"&&t==="before")return s-i;if(e==="row")return n-l};function Yi(e,t,o,n,r,i,s){let{style:{flexDirection:a}}=T(e),[l,c,p]=Go(a),{[c]:m,[l]:u}=_(n),f=w(t[o],"path"),h=Zi(a,r,i,s),[g,y]=m<i[c]?[Me(n,p,f,i,s),u]:[n,void 0],d=h?K(f,h,{flexGrow:0,flexShrink:0}):void 0;return m>i[c]&&(t=t.map(b=>{if(w(b,"placeholder"))return b;{let{[c]:E}=_(b);return E&&E<m?Me(b,p,w(b,"path")):b}})),cn(e,t,o,g,r,y,i,d)}function cn(e,t,o,n,r,i,s,a){let l=w(e,"path"),c=0,p=!t||t.length===0?[n]:t.reduce((m,u,f)=>{if(o===f){let[h,g]=Ji(e,u,n,s);r==="before"?a?m.push(a,g,h):m.push(g,h):a?m.push(h,g,a):m.push(h,g),c=m.indexOf(g)}else m.push(u);return m},[]).map((m,u)=>u<c?m:O(m,`${l}.${u}`));return[c,p]}function Ji(e,t,o,n){let r=an(),{version:i=0}=T(o);if(i+=1,P(e)==="Flexbox"){let[s]=nn(e.props.style),a=6,l={[s]:(n[s]-a)/2},c=It(t,s,l),p=It(o,s,l);return[Be.cloneElement(t,{style:c}),Be.cloneElement(o,{id:r,version:i,style:p})]}else{let{style:{left:s,top:a,flex:l,...c}={left:void 0,top:void 0,flex:void 0}}=T(o);return[t,Be.cloneElement(o,{id:r,version:i,style:c})]}}var U={ADD:"add",DRAG_START:"drag-start",DRAG_DROP:"drag-drop",MAXIMIZE:"maximize",MINIMIZE:"minimize",REMOVE:"remove",REPLACE:"replace",RESTORE:"restore",SAVE:"save",SET_TITLE:"set-title",SPLITTER_RESIZE:"splitter-resize",SWITCH_TAB:"switch-tab",TEAROUT:"tearout"};import ue from"react";import rt from"react";function pn(e,{target:t,replacement:o}){return Nt(e,t,o)}function Nt(e,t,o){let n=w(t,"path"),r=w(t,"resizeable"),{style:i}=T(t),s=ke(rt.cloneElement(o,{resizeable:r,style:{...i,...o.props.style}}),n);return j(e,t,s)}function j(e,t,o,n){if(e===t)return o;let{idx:r,finalStep:i}=Y(w(e,"path"),w(t,"path")),s=e.props.children.slice();return i?n?n===ye.MINIMIZE?s[r]=ji(e,s[r]):n===ye.RESTORE&&(s[r]=Ki(s[r])):s[r]=o:s[r]=j(s[r],t,o,n),rt.cloneElement(e,void 0,s)}function ji(e,t){let{style:o}=T(e),{style:n}=T(t),{width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l,...c}=n,p={width:r,height:i,flexBasis:s,flexShrink:a,flexGrow:l},m={...c,flexBasis:0,flexGrow:0,flexShrink:0},u=o.flexDirection==="row"?"vertical":o.flexDirection==="column"?"horizontal":!1;return u?rt.cloneElement(t,{collapsed:u,restoreStyle:p,style:m}):t}function Ki(e){let{style:t,restoreStyle:o}=T(e),{flexBasis:n,flexShrink:r,flexGrow:i,...s}=t,a={...s,...o};return rt.cloneElement(e,{collapsed:!1,style:a,restoreStyle:void 0})}function Vt(e,{path:t}){let o=V(e,t),n=q(e,t);if(n===null)return e;let{children:r}=T(n);if(r.length>1&&mn(r,t)){let{style:{flexBasis:i,display:s,flexDirection:a,...l}}=T(n),c=w(n,"path"),p=j(e,n,K(c,i,l));for(;(n=q(p,c))&&w(n,"path")!=="0";){let{children:m}=T(n);if(mn(m)){c=w(n,"path");let{style:{flexBasis:u,display:f,flexDirection:h,...g}}=T(n);p=j(e,n,K(c,u,g))}else if(ts(m))p=hn(e,n);else break}return p}return dn(e,o)}function dn(e,t){let o=T(e),{children:n,path:r,preserve:i}=o,{active:s}=o,{idx:a,finalStep:l}=Y(r,w(t,"path")),c=P(e),p=n.slice();if(l){if(p.splice(a,1),s!==void 0&&s>=a&&(s=Math.max(0,s-1)),p.length===1&&!i&&r!=="0"&&c.match(/Flexbox|Stack/))return qi(e,p[0]);!p.some(Qi)&&p.some(fn)&&(p=es(p))}else p[a]=dn(p[a],t);return p=p.map((m,u)=>O(m,`${r}.${u}`)),ue.cloneElement(e,{active:s},p)}function qi(e,t){let o=P(e),{path:n,style:{flexBasis:r,flexGrow:i,flexShrink:s,width:a,height:l}}=T(e),c=O(t,n);if(n==="0")c=ue.cloneElement(c,{style:{...t.props.style,width:a,height:l}});else if(o==="Flexbox"){let p=e.props.style.flexDirection==="column"?"height":"width",{style:{[p]:m,...u}}=c.props;c=ue.cloneElement(c,{flexFill:void 0,style:{...u,flexGrow:i,flexShrink:s,flexBasis:r,width:a,height:l}})}return c}var Qi=e=>e.props.style.flexGrow>0,fn=e=>{let{width:t,height:o,flexGrow:n}=e.props.style;return n===0&&typeof t!="number"&&typeof o!="number"},es=e=>e.map(t=>fn(t)?ue.cloneElement(t,{style:{...t.props.style,flexGrow:1}}):t),ts=e=>{if(e&&e.length>0){let t=w(e[0],"placeholder"),o=!1;for(let n=1;n<e.length;n++){if(o=w(e[n],"placeholder"),t&&o)return!0;t=o}}},hn=(e,t)=>{let{children:o,path:n}=T(e),{idx:r,finalStep:i}=Y(n,w(t,"path")),s=o.slice();return i?s[r]=os(t):s[r]=hn(s[r],t),s=s.map((a,l)=>O(a,`${n}.${l}`)),ue.cloneElement(e,void 0,s)},os=e=>{let{children:t}=T(e),o=[],n=[];for(let i=0;i<t.length;i++)w(t[i],"placeholder")?n.push(t[i]):(n.length===1?o.push(n.pop()):n.length>0&&(o.push(un(n)),n.length=0),o.push(t[i]));n.length===1?o.push(n.pop()):n.length>0&&o.push(un(n));let r=w(e,"path");return ue.cloneElement(e,void 0,o.map((i,s)=>O(i,`${r}.${s}`)))},un=([e,...t])=>{let o=w(e,"style"),{flexBasis:n,flexGrow:r,flexShrink:i}=o;for(let{props:{style:s}}of t)n+=s.flexBasis,r=Math.max(r,s.flexGrow),i=Math.max(i,s.flexShrink);return ue.cloneElement(e,{style:{...o,flexBasis:n,flexGrow:r,flexShrink:i}})},mn=(e,t)=>e.every(o=>w(o,"placeholder")||t&&w(o,"path")===t);import gn from"react";function yn(e,{path:t,sizes:o}){let n=V(e,t,!0),{children:r,style:i}=T(n),s=i.flexDirection==="column"?"height":"width",a=ns(r,o,s),l=gn.cloneElement(n,void 0,a);return j(e,n,l)}function ns(e,t,o){return e.map((n,r)=>{let{style:{[o]:i,flexBasis:s}}=T(n),a=t[r],{currentSize:l,flexBasis:c}=a,m=l!==void 0?a.currentSize:c;return m===void 0||i===m||s===m?n:gn.cloneElement(n,{style:rs(n.props.style,o,m)})})}function rs(e,t,o){let n=typeof e[t]=="number",{flexShrink:r=1,flexGrow:i=1}=e;return{...e,[t]:n?o:"auto",flexBasis:n?"auto":o,flexShrink:r,flexGrow:i}}import{uuid as is}from"@vuu-ui/vuu-utils";import it from"react";var bn=e=>{let[t]=P(e);return t===t.toLowerCase()};function Oe(e,t,o,n,r,i){let{children:s,path:a}=T(e),l=w(t,"path"),{idx:c,finalStep:p}=Y(a,l),m=p?ss(e,s,t,o,n,r,i):s.map((u,f)=>f===c?Oe(u,t,o,n,r,i):u);return it.cloneElement(e,void 0,m)}function ss(e,t,o,n,r,i,s){let a=_(n);if(a!=null&&a.width&&(a!=null&&a.height)){if(i===void 0||s===void 0)throw Error("wrap-layout-element, updateChildren clientRect and dropRect must both be available");return ls(t,o,n,r,i,s)}return as(e,t,o,n,r)}function as(e,t,o,n,r){var x;let{version:i=0}=T(n),s=w(o,"path"),{type:a,flexDirection:l,showTabs:c}=Rn(r),[p,m,u]=cs(a,o,n,l,r),f=xn(r),h=f?1:0,g={resizeable:!0,style:u,version:i+1},d={[bn(o)?"data-resizeable":"resizeable"]:!0,style:m},b=a==="Stack"?{showTabs:c}:void 0,E=a==="Flexbox"?{splitterSize:(x=P(e)==="Flexbox"&&e.props.splitterSize)!=null?x:void 0}:void 0,R=is(),S=it.createElement(oe[a],{active:h,id:R,key:R,path:w(o,"path"),flexFill:w(o,"flexFill"),...E,...b,style:p,resizeable:w(o,"resizeable")},f?[O(o,`${s}.0`,d),ke(it.cloneElement(n,g),`${s}.1`)]:[ke(it.cloneElement(n,g),`${s}.0`),O(o,`${s}.1`,d)]);return t.map(D=>D===o?S:D)}function ls(e,t,o,n,r,i){let{flexDirection:s}=Rn(n),a=s==="column"?"row":"column",l=xn(n),[c,p,m,u]=i,[f,h]=s==="column"?[p-r.top,r.bottom-u]:[c-r.left,r.right-m],g=w(t,"path"),y=0,d=bn(t)?"data-resizeable":"resizeable",b=[];f&&b.push(l?O(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:f,flexGrow:1,flexShrink:1}}):K(`${g}.${y++}`,f,{flexGrow:0,flexShrink:0})),b.push(Me(o,a,`${g}.${y++}`,r,i)),h&&b.push(l?K(`${g}.${y++}`,0):O(t,`${g}.${y++}`,{[d]:!0,style:{flexBasis:0,flexGrow:1,flexShrink:1}}));let E=kt(s,t.props,b,g);return e.map(R=>R===t?E:R)}function cs(e,t,o,n,r){let i={...t.props.style,flexDirection:n},s=e==="Flexbox"&&n==="column"?"height":"width",a=zt(o,s,r),l=zt(t,s);return[i,l,a]}var xn=e=>{var t;return e.position.SouthOrEast?!0:((t=e==null?void 0:e.tab)==null?void 0:t.positionRelativeToTab)==="before"?!1:!!e.position.Header};function Rn(e){return e.position.Header?{type:"Stack",flexDirection:"column",showTabs:!0}:{type:"Flexbox",flexDirection:e.position.EastOrWest?"row":"column"}}var wn=(e,t)=>{switch(t.type){case U.ADD:return fs(e,t);case U.DRAG_DROP:return ds(e,t);case U.MAXIMIZE:return ms(e,t);case U.REMOVE:return Vt(e,t);case U.REPLACE:return pn(e,t);case U.SET_TITLE:return us(e,t);case U.SPLITTER_RESIZE:return yn(e,t);case U.SWITCH_TAB:return ps(e,t);default:return e}},ps=(e,{path:t,nextIdx:o})=>{let n=V(e,t,!0),r=Tn.cloneElement(n,{active:o});return j(e,n,r)},us=(e,{path:t,title:o})=>{debugger;let n=V(e,t,!0),r=Tn.cloneElement(n,{title:o});return j(e,n,r)},ms=(e,{path:t,type:o})=>{if(t){let n=V(e,t,!0);return j(e,n,n,o)}else return e},ds=(e,t)=>{var h,g;let{draggedReactElement:o,dragInstructions:n,dropTarget:r}=t,i=r.component,{pos:s}=r,a=((h=s==null?void 0:s.position)==null?void 0:h.Header)&&P(i)==="Stack",{id:l,version:c}=T(o),p=_(o),m;if(a){let[y,d]=ln(i,s);y===void 0?m=ot(e,i,o):m=nt(e,y,o,d)}else!p&&((g=s==null?void 0:s.position)!=null&&g.Centre)?m=Nt(e,i,o):m=hs(e,r,o);if(n.DoNotRemove)return m;let u=Q(m,y=>y.id===l&&y.version===c),f=w(u,"path");return Vt(m,{path:f,type:"remove"})},fs=(e,{path:t,component:o})=>ot(e,V(e,t),o),hs=(e,t,o)=>{let{component:n,pos:r,clientRect:i,dropRect:s}=t,a=w(n,"path");if(a==="0.0")return Oe(e,n,o,r);let l=q(e,a);if(En(r,l)){let c=r.position.SouthOrEast?"after":"before";return nt(e,n,o,c,r,i,s)}if(!En(r,l))return Oe(e,n,o,r,i,s);if($(P(l)))return Oe(e,n,o,r);throw Error(`no support right now for position = ${r.position}`)},En=(e,t)=>e.position.Centre?Dn(t)||Sn(t):e.position.NorthOrSouth?Sn(t):e.position.EastOrWest?Dn(t):!1,Sn=e=>P(e)==="Flexbox"&&e.props.style.flexDirection==="column",Dn=e=>P(e)==="Flexbox"&&e.props.style.flexDirection!=="column";import{createContext as gs}from"react";var ys=e=>console.log(`dispatch ${e.type}, have you forgotten to provide a LayoutProvider ?`),He=gs({dispatchLayoutProvider:ys,version:-1});import{useCallback as st,useRef as Wt}from"react";var bs={},Pn=[0,0],xs=(e,t,o)=>{let n=document.createElement("div");n.className="vuuSimpleDraggableWrapper",n.classList.add("vuuSimpleDraggableWrapper","salt-theme","salt-density-medium"),n.dataset.dragging="true";let r=o!=null?o:document.createElement("div");r.id=t,n.appendChild(r),document.body.appendChild(n);let i=`top:${e.top}px;left:${e.left}px;width:${e.width}px;height:${e.height}px;`;return[n,i,e.left,e.top]},Rs=e=>{let{offsetParent:t}=e;if(t===null)return Pn;{let{left:o,top:n}=t.getBoundingClientRect();return[o,n]}},vn=(e,t)=>{let o=Wt(),n=Wt(),r=Wt(),i=st((c,p)=>{if(n.current&&r.current){let{dragOffsets:[m,u],targetPosition:f}=n.current,h=typeof c=="number"?c-m:f.left,g=typeof p=="number"?p-u:f.top;(h!==f.left||g!==f.top)&&(n.current.targetPosition.left=h,n.current.targetPosition.top=g,r.current.style.top=g+"px",r.current.style.left=h+"px")}},[]),s=st(c=>{if(n.current){let{dragInstructions:p,payload:m,originalCSS:u}=n.current;t({type:"drag-drop",draggedReactElement:m,dragInstructions:p,dropTarget:c}),console.log("[useLayoutDragDrop]",{dragInstructions:p}),r.current&&(p.RemoveDraggableOnDragEnd?document.body.removeChild(r.current):(r.current.style.cssText=u,delete r.current.dataset.dragging)),o.current=void 0,n.current=void 0,r.current=void 0}},[t]),a=st(c=>{if(o.current){let{payload:p,dragContainerPath:m,dragElement:u,dragRect:f,instructions:h=bs,path:g}=o.current,{current:y}=e,d={x:c.clientX,y:c.clientY},b=p!=null?p:V(y,g,!0),{id:E}=b.props,R=_(b),S="",x="",D="",v=-1,C=-1,B=Pn,L=document.getElementById(E);if(L===null)[L,x,v,C]=xs(f,E,u);else{B=Rs(L);let[k,M]=B,{width:A,height:z,left:Z,top:W}=L.getBoundingClientRect();v=Z-k,C=W-M,x=`width:${A}px;height:${z}px;left:${v}px;top:${C}px;z-index: 100;background-color:#ccc;opacity: 0.6;`,L.dataset.dragging="true",S=L.style.cssText}D=Ct.initDrag(e.current,m,f,d,{drag:i,drop:s},R),L.style.cssText=x+D,r.current=L,n.current={payload:b,originalCSS:S,dragRect:f,dragOffsets:B,dragInstructions:h,targetPosition:{left:v,top:C}}}},[i,s,e]);return st(c=>{let{evt:p,...m}=c;console.log("prepare to drag",{options:m}),o.current={...m,dragContainerPath:""},Ct.handleMousedown(p,a,m.instructions)},[a])};import{jsx as An}from"react/jsx-runtime";var Mn=e=>e.dropTarget,Ds=e=>["drag-drop","remove","set-title","splitter-resize","switch-tab"].includes(e.type),Pm=()=>{let e=Ts();return An("div",{children:`Context: ${e} `})},vm=e=>{let{children:t,layout:o,onLayoutChange:n}=e,r=Ln(void 0),i=Ln(t),[,s]=Ss(null),a=_t(m=>{if(n){let u=Q(m,Mn)||r.current,h=P(u)==="DraggableLayout"?T(u).children[0]:u,g=rn(h);n(g,"drag-root")}},[n]),l=_t((m,u=!1)=>{let f=wn(r.current,m);f!==r.current&&(r.current=f,s({}),!u&&Ds(m)&&a(f))},[a]),c=_t(m=>{switch(m.type){case"drag-start":{p(m);break}case"save":{a(r.current);break}default:{l(m);break}}},[l,a]),p=vn(r,c);return Es(()=>{if(o){let m=Q(r.current,Mn),u=fo(m),f=tt(o,`${m.props.path}.0`),h=u?{type:U.REPLACE,target:u,replacement:f}:{type:U.ADD,path:m.props.path,component:f};l(h,!0)}},[l,o]),r.current===void 0?r.current=$t(t):t!==i.current&&(r.current=$t(t,r.current),i.current=t),An(He.Provider,{value:{dispatchLayoutProvider:c,version:0},children:r.current})},X=()=>{let{dispatchLayoutProvider:e}=Cn(He);return e},Ts=()=>{console.log({LayoutProviderContext:He});let{version:e}=Cn(He);return e};import{jsx as Ps}from"react/jsx-runtime";var zn=function(t){let{path:o}=t,n=X(),r=ws(i=>{n({type:ye.SPLITTER_RESIZE,path:o,sizes:i})},[n,o]);return Ps(Ot,{...t,onSplitterMoved:r})};zn.displayName="Flexbox";I("Flexbox",zn,"container");import{useForkRef as Xs}from"@salt-ds/core";import Zs from"classnames";import{forwardRef as Ys}from"react";import{useCallback as $n,useEffect as zs,useRef as Xt,useState as Is}from"react";import{useCallback as vs,useLayoutEffect as In,useRef as Ls}from"react";var Wm=["height","width"],_m=["height"],Gm=["width"],me=new WeakMap,Bn=(e,t,o)=>{switch(o){case"height":return t.height;case"scrollHeight":return e.scrollHeight;case"scrollWidth":return e.scrollWidth;case"width":return t.width;default:return 0}},kn=new ResizeObserver(e=>{for(let t of e){let{target:o,contentRect:n}=t,r=me.get(o);if(r){let{onResize:i,measurements:s}=r,a=!1;for(let[l,c]of Object.entries(s)){let p=Bn(o,n,l);p!==c&&(a=!0,s[l]=p)}a&&i&&i(s)}}});function On(e,t,o,n=!1){let r=Ls(t),i=vs(s=>{let a=s.getBoundingClientRect();return r.current.reduce((l,c)=>(l[c]=Bn(s,a,c),l),{})},[]);In(()=>{let s=e.current,a=!1;async function l(){me.set(s,{measurements:{}}),a=!1;let{fonts:c}=document;if(c&&await c.ready,!a){let p=me.get(s);if(p){let m=i(s);p.measurements=m,kn.observe(s),n&&o(m)}}}if(s){if(me.has(s))throw Error("useResizeObserver attemping to observe same element twice");l()}return()=>{s&&me.has(s)&&(kn.unobserve(s),me.delete(s),a=!0)}},[e,i]),In(()=>{let s=e.current,a=me.get(s);if(a){if(r.current!==t){r.current=t;let l=i(s);a.measurements=l}a.onResize=o}},[t,i,e,o])}function Ms(e,t){let o=document.body.querySelector(`.${e}`),n={get:function(r,i){let s=r.getPropertyValue(`--${e}-breakpoint-${i}`);return s?parseInt(s):void 0}};return o?new Proxy(getComputedStyle(o),n):t!=null?t:{}}var Cs=([,e],[,t])=>t-e,Ut=e=>Object.entries(e).sort(Cs).map(([t,o],n,r)=>[t,o,n<r.length-1?r[n+1][1]:9999]),Gt=null,As=(e="salt")=>{let{xs:t,sm:o,md:n,lg:r,xl:i}=Ms(e);return Ut({xs:t,sm:o,md:n,lg:r,xl:i})},Hn=e=>(Gt===null&&(Gt=As(e)),Gt);var ks=[],Fn=({breakPoints:e,smallerThan:t},o)=>{let[n,r]=Is(t?!1:"lg"),i=Xt(document.body),s=Xt(e?Ut(e):Hn()),a=Xt("lg"),l=$n(p=>{if(s.current){for(let[m,u]of s.current)if(p>=u)return m}},[s]),c=$n(p=>{if(t){let m=s.current.find(([u])=>u===t);if(m){let[,,u]=m;return p<u}}else return l(p);return p},[t,l]);return On(o||i,s.current?["width"]:ks,({width:p})=>{let m=c(p);m!==a.current&&(a.current=m,r(m))},!0),zs(()=>{let p=o||i;if(p.current){let m=a.current;if(s.current){let{clientWidth:u}=p.current,f=c(u);a.current=f,f!==m&&r(f)}}},[r,c,o]),n};var Nn="data-collapsible",Bs={[Nn]:!0,"data-pad-start":!0,"data-pad-end":!0},Os=e=>{var t;return(t=Bs[e])!=null?t:!1},Hs=e=>e===Nn,$s={dynamic:"dynamic",instant:"instant",true:"instant"},Fs=e=>{var t;return(t=$s[e])!=null?t:"none"},Qm=e=>Object.keys(e).reduce((t,o)=>{let[n,r]=t;if(Os(o)){let i=Hs(o)?Fs(e[o]):e[o];n[o]=i,r[o]=void 0}return t},[{},{}]);import{getUniqueId as Ns}from"@vuu-ui/vuu-utils";import{cloneElement as Vs,isValidElement as Ws,useCallback as _s,useMemo as Vn,useRef as Zt}from"react";var Gs=["xs","sm","md","lg","xl"],Us=12,Wn=({children:e,cols:t,style:o})=>{let n=Zt(null),r=Zt(null),i=Zt(),s=t!=null?t:Us,l=(o==null?void 0:o.flexDirection)==="column"?"height":"width",c=Vn(()=>Array.isArray(e)?e:Ws(e)?[e]:[],[e]),p=_s((m,u)=>{let f=qe(m,u,Gs),h=[],g=[];for(let y=0;y<m.length;y++){let d=m[y],{style:{flex:b,...E}}=d.props;h.push(Vs(d,{key:Ns(),style:{...E,"--parent-col-count":s}})),g.push(f[y])}return[h,g]},[s]);return Vn(()=>{let[m,u]=p(c,l);r.current=u,i.current=m},[p,c,l]),{cols:s,content:i.current,rootRef:n}};import{jsx as Js}from"react/jsx-runtime";var at="hwFluidGrid",Yt=Ys(function(t,o){let{breakPoints:n,children:r,column:i,cols:s=12,className:a,flexFill:l,gap:c=3,fullPage:p,id:m,onSplitterMoved:u,resizeable:f,row:h,showGrid:g,spacing:y,splitterSize:d,style:b,...E}=t,{cols:R,content:S,rootRef:x}=Wn({children:r,cols:s,style:b}),D=Fn({breakPoints:n},x),v=Zs(at,a,{[`${at}-column`]:i,[`${at}-row`]:h,[`${at}-show-grid`]:g,"flex-fill":l,"full-page":p}),C={...b,"--spacing":y,"--grid-col-count":R,"--grid-gap":c};return Js("div",{...E,className:v,"data-breakpoint":D,"data-cols":R,"data-resizeable":f||void 0,id:m,ref:Xs(x,o),style:C,children:S})});Yt.displayName="FluidGrid";import{jsx as js}from"react/jsx-runtime";var _n=function(t){return js(Yt,{...t})};_n.displayName="FluidGrid";I("FluidGrid",_n,"container");import ca from"classnames";import pa,{useRef as ua,useState as er}from"react";import{useCallback as $e,useState as Ks}from"react";var lt=(e,t,o,n)=>{var y;let{loadSessionState:r,purgeSessionState:i,purgeState:s,saveSessionState:a}=xe(),[l,c]=Ks((y=r(e,"contributions"))!=null?y:[]),p=X(),m=$e((d,b)=>{let E=l.concat([{location:d,content:b}]);a(e,"contributions",E),c(E)},[l,e,a]),u=$e(()=>{i(e,"contributions"),c([])},[e,i]),f=$e(()=>{let d=r(e,"data-source");d&&d.unsubscribe(),i(e),s(e),p({type:"remove",path:o})},[p,e,r,i,s,o]),h=$e(async(d,b,E)=>{var S;d.stopPropagation();let R=(S=t.current)==null?void 0:S.getBoundingClientRect();return new Promise((x,D)=>{p({type:"drag-start",evt:d,path:b===void 0?o:`${o}.${b}`,dragRect:R,preDragActivity:E,dropTargets:n,resolveDragStart:x,rejectDragStart:D})})},[t,p,o,n]);return[$e(async(d,b)=>{var R;let{type:E}=d;switch(E){case"maximize":case"minimize":case"restore":return p({type:E,path:(R=d.path)!=null?R:o});case"remove":return f();case"mousedown":return console.log("2) ViewActionDispatch Hook dispatch Action mousedown"),h(b,d.index,d.preDragActivity);case"add-toolbar-contribution":return m(d.location,d.content);case"remove-toolbar-contribution":return u();default:return}},[p,o,f,h,m,u]),l]};import{useForkRef as na,useIdMemo as ra}from"@salt-ds/core";import ia from"classnames";import jt,{forwardRef as sa,useMemo as aa,useRef as Kn}from"react";import{useCallback as de,useMemo as Gn}from"react";var Un=({id:e,rootRef:t,path:o,dropTargets:n,title:r})=>{let i=X(),{loadState:s,loadSessionState:a,purgeState:l,saveState:c,saveSessionState:p}=xe(),[m,u]=lt(e,t,o,n),f=Gn(()=>{var x;return(x=s("view-title"))!=null?x:r},[s,r]),h=de(x=>{o&&i({type:"set-title",path:o,title:x})},[i,o]),g=Gn(()=>s(e),[e,s]),y=de(x=>s(e,x),[e,s]),d=de(x=>{l(e,x),i({type:"save"})},[e,i,l]),b=de((x,D)=>{c(e,D,x),i({type:"save"})},[e,i,c]),E=de(x=>a(e,x),[e,a]),R=de((x,D)=>p(e,D,x),[e,p]),S=de(({type:x,...D})=>{let{[x]:v}=D;b(v,x)},[b]);return{contributions:u,dispatchViewAction:m,load:y,loadSession:E,onConfigChange:S,onEditTitle:h,purge:d,restoredState:g,save:b,saveSession:R,title:f}};import{useResizeObserver as qs,WidthHeight as Qs}from"@heswell/salt-lab";import{useCallback as Xn,useRef as Zn}from"react";var ea=[],Yn=({mainRef:e,resize:t="responsive",rootRef:o})=>{let n=t==="defer",r=Zn({}),i=Zn(),s=Xn(()=>{e.current&&(e.current.style.height=r.current.height+"px",e.current.style.width=r.current.width+"px"),i.current=void 0},[e]),a=Xn(({height:l,width:c})=>{r.current.height=l,r.current.width=c,i.current!==null&&clearTimeout(i.current),i.current=window.setTimeout(s,40)},[s]);qs(o,n?Qs:ea,a,n)};import ta,{useContext as Jn}from"react";var oa={dispatch:null},ct=ta.createContext(oa),jn=()=>{var t;let e=Jn(ct);return(t=e==null?void 0:e.dispatch)!=null?t:null},Kd=()=>Jn(ct);import{jsx as Jt,jsxs as la}from"react/jsx-runtime";var qn=sa(function(t,o){let{children:n,className:r,collapsed:i,closeable:s,"data-resizeable":a,dropTargets:l,expanded:c,flexFill:p,id:m,header:u,orientation:f="horizontal",path:h,resize:g="responsive",resizeable:y=a,tearOut:d,style:b={},title:E,...R}=t,S=ra(m),x=Kn(null),D=Kn(null),{contributions:v,dispatchViewAction:C,load:B,loadSession:L,onConfigChange:k,onEditTitle:M,purge:A,restoredState:z,save:Z,saveSession:W,title:fe}=Un({id:S,rootRef:x,path:h,dropTargets:l,title:E});Yn({mainRef:D,resize:g,rootRef:x});let Ee="vuuView",hr=()=>jt.isValidElement(n)&&z?jt.cloneElement(n,z):n,gr=aa(()=>({dispatch:C,id:S,path:h,title:fe,load:B,loadSession:L,onConfigChange:k,purge:A,save:Z,saveSession:W}),[C,S,B,L,k,h,A,Z,W,fe]),yr=typeof u=="object"?u:{};return Jt("div",{...R,className:ia(Ee,r,{[`${Ee}-collapsed`]:i,[`${Ee}-expanded`]:c,[`${Ee}-resize-defer`]:g==="defer"}),"data-resizeable":y,id:S,ref:na(o,x),style:b,tabIndex:-1,children:la(ct.Provider,{value:gr,children:[u?Jt(Qn,{...yr,collapsed:i,contributions:v,expanded:c,closeable:s,onEditTitle:M,orientation:f,tearOut:d,title:fe}):null,Jt("div",{className:`${Ee}-main`,ref:D,children:hr()})]})})});qn.displayName="View";var ae=jt.memo(qn);ae.displayName="View";I("View",ae,"view");import{EditableLabel as ma,Toolbar as da,ToolbarButton as fa,ToolbarField as ha,Tooltray as tr}from"@heswell/salt-lab";import{CloseIcon as ga}from"@salt-ds/icons";import{jsx as Re,jsxs as ya}from"react/jsx-runtime";var Qn=({className:e,contributions:t,collapsed:o,closeable:n,onEditTitle:r,orientation:i="horizontal",style:s,title:a="Untitled"})=>{let l=ua(null),[c,p]=er(a),[m,u]=er(!1),f=jn(),h=L=>f==null?void 0:f({type:"remove"},L),g="vuuHeader",y=()=>{var L;(L=l.current)==null||L.focus()},d=L=>{L.stopPropagation()},E=ca(g,e,`${g}-${o||i}`),R=()=>{u(!0)},S=L=>{L.key==="Enter"&&u(!0)},x=(L="",k="",M=!0,A=!1)=>{var z;u(!1),A?p(L):k!==L&&(p(k),r==null||r(k)),M===!1&&((z=l.current)==null||z.focus())},D=L=>{f==null||f({type:"mousedown"},L)},v=[],C=[],B=[];return a&&v.push(Re(ha,{className:"vuuHeader-title",children:Re(ma,{editing:m,value:c,onChange:p,onMouseDownCapture:y,onEnterEditMode:R,onExitEditMode:x,onKeyDown:S,ref:l,tabIndex:0},"title")},"title")),t==null||t.forEach((L,k)=>{C.push(pa.cloneElement(L.content,{key:k}))}),n&&B.push(ya(fa,{onClick:h,onMouseDown:d,children:[Re(ga,{})," Close"]},"close")),C.length>0&&v.push(Re(tr,{"data-align-end":!0,children:C},"contributions")),B.length>0&&v.push(Re(tr,{"data-align-end":!0,children:B},"actions")),Re(da,{className:E,orientation:i,style:s,onMouseDown:D,children:v})};import{uuid as ba}from"@vuu-ui/vuu-utils";import{List as xa,ListItem as Ra}from"@heswell/salt-lab";import or from"classnames";import{cloneElement as Ea,memo as Sa}from"react";import{jsx as Kt}from"react/jsx-runtime";var Da=e=>{let t=e.cloneNode(!0);return t.id="",delete t.dataset.idx,t},nr=Sa(({className:e,children:t,idx:o,resizeable:n,header:r,closeable:i,...s})=>Kt(Ra,{className:or("vuuPaletteItem",e),"data-draggable":!0,...s}));nr.displayName="PaletteItem";var Ta=({children:e,className:t,orientation:o="horizontal",...n})=>{let r=X(),i="vuuPalette";function s(a){var x;let c=a.target.closest(".vuuPaletteItem"),p=parseInt((x=c.dataset.idx)!=null?x:"-1");p!==-1&&console.log({children:e,idx:p,listItemElement:c});let{props:{caption:m,children:u,template:f,...h}}=e[p],{height:g,left:y,top:d,width:b}=c.getBoundingClientRect(),E=ba(),S=f?u:Kt(ae,{...{id:E,key:E},...h,title:h.label,children:u});r({dragRect:{left:y,top:d,right:y+b,bottom:d+150,width:b,height:g},dragElement:Da(c),evt:a.nativeEvent,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},path:"*",payload:S,type:"drag-start"})}return Kt(xa,{...n,borderless:!0,className:or(i,t,`${i}-${o}`),maxHeight:800,selected:null,children:e.map((a,l)=>a.type===nr?Ea(a,{key:l,onMouseDown:s}):a)})};I("Palette",Ta,"view");import{uuid as wa}from"@vuu-ui/vuu-utils";import{List as Pa,ListItem as va}from"@heswell/salt-lab";import La from"classnames";import{jsx as qt}from"react/jsx-runtime";var Ma="vuuPalette",ch=e=>{let{children:t,ViewProps:o,label:n,onMouseDown:r,template:i,...s}=e,a=X();return qt(va,{onMouseDown:c=>{let{left:p,top:m,width:u}=c.currentTarget.getBoundingClientRect(),f=wa(),g=i?t:qt(ae,{...{id:f,key:f},...o,title:e.label,children:t});a({type:"drag-start",evt:c.nativeEvent,path:"*",payload:g,instructions:{DoNotRemove:!0,DoNotTransform:!0,RemoveDraggableOnDragEnd:!0,dragThreshold:10},dragRect:{left:p,top:m,right:p+u,bottom:m+150,width:u,height:100}})},...s,children:n})},Ca=({className:e,...t})=>qt(Pa,{...t,className:La(Ma,e),height:"100%",selectionStrategy:"none"});I("PaletteSalt",Ca,"view");import{Tab as Aa,Tabstrip as za,Toolbar as Ia,ToolbarField as ka}from"@heswell/salt-lab";import{useIdMemo as Ba}from"@salt-ds/core";import Oa from"classnames";import ut,{forwardRef as Ha,useCallback as $a}from"react";import{jsx as pt,jsxs as Wa}from"react/jsx-runtime";var rr="Tabs",Fa=()=>{},Na=(e,t)=>{var o,n;return(n=(o=e.props)==null?void 0:o.title)!=null?n:`Tab ${t+1}`},Va=e=>{let t=[];return ut.Children.forEach(e,o=>{ut.isValidElement(o)?t.push(o):console.warn("Stack has unexpected child element type")}),t},Qt=Ha(function({active:t=0,children:o,className:n,enableAddTab:r,enableCloseTabs:i,getTabIcon:s=Fa,getTabLabel:a=Na,id:l,keyBoardActivation:c="manual",onMouseDown:p,onTabAdd:m,onTabClose:u,onTabEdit:f,onTabSelectionChanged:h,showTabs:g,style:y,TabstripProps:d},b){var k;let E=Ba(l),R=M=>{h==null||h(M)},S=M=>{u==null||u(M)},x=()=>{m==null||m(ut.Children.count(o))},D=M=>{var W;let z=M.target.closest('[role^="tab"]');if((z==null?void 0:z.getAttribute("role"))==="tab"){let fe=parseInt((W=z.dataset.idx)!=null?W:"-1");if(fe===-1)throw Error("Stack: mousedown on tab with unknown index");p==null||p(M,fe)}},v=$a((M,A,z,Z)=>{f==null||f(Z,A)},[f]),C=()=>{var M;return ut.isValidElement(o)?o:Array.isArray(o)&&(M=o[t])!=null?M:null},B=()=>Va(o).map((M,A)=>{let z=`${E}-${A}`,{closeable:Z,id:W}=M.props;return pt(Aa,{ariaControls:`${z}-tab`,"data-icon":s(M,A),draggable:!0,id:z,label:a(M,A),closeable:Z,editable:(d==null?void 0:d.enableRenameTab)!==!1},W!=null?W:A)}),L=C();return Wa("div",{className:Oa(rr,n,{[`${rr}-horizontal`]:(d==null?void 0:d.orientation)==="vertical"}),style:y,id:E,ref:b,children:[g?pt(Ia,{className:"vuuTabHeader vuuHeader",orientation:d==null?void 0:d.orientation,children:pt(ka,{disableFocusRing:!0,"data-collapsible":"dynamic","data-priority":"3",style:{alignSelf:"flex-end"},children:pt(za,{...d,enableRenameTab:(d==null?void 0:d.enableRenameTab)!==!1,enableAddTab:r,enableCloseTab:i,keyBoardActivation:c,onActiveChange:R,onAddTab:x,onCloseTab:S,onExitEditMode:v,onMouseDown:D,activeTabIndex:(k=d==null?void 0:d.activeTabIndex)!=null?k:L===null?-1:t,children:B()})})}):null,L]})});Qt.displayName="Stack";import{useIdMemo as _a}from"@salt-ds/core";import Ga,{useRef as Ua}from"react";import{jsx as eo}from"react/jsx-runtime";var Xa=e=>eo(ae,{resizeable:!0,title:`Tab ${e}`,style:{flexGrow:1,flexShrink:0,flexBasis:0},header:!0,closeable:!0,children:eo(bt,{style:{flex:1}})}),ir=e=>{let t=Ua(null),o=X(),{loadState:n}=xe(),{createNewChild:r=Xa,id:i,onTabSelectionChanged:s,path:a,...l}=e,{children:c}=e,p=_a(i),[m]=lt(p,t,a);return eo(Qt,{...l,id:p,getTabLabel:(b,E)=>{let{id:R,title:S}=b.props;return n(R,"view-title")||S||`Tab ${E+1}`},onMouseDown:async(b,E)=>{let R;await m({type:"mousedown",index:E,preDragActivity:async()=>new Promise(D=>{console.log("preDragActivity: Ok, gonna release the drag"),R=D})},b)&&(R==null||R(void 0))},onTabAdd:(b,E=Ga.Children.count(c))=>{if(a){console.log("[StackLayout] handleTabAdd");let R=r(E);console.log({component:R}),o({type:"add",path:a,component:R})}},onTabClose:b=>{if(Array.isArray(c)){let{props:{"data-path":E,path:R=E}}=c[b];o({type:"remove",path:R})}},onTabEdit:(b,E)=>{o({type:"set-title",path:`${a}.${b}`,title:E})},onTabSelectionChanged:b=>{console.log(`StackLayout handleTabSelection nextTab = ${b}`),a&&(o({type:"switch-tab",path:a,nextIdx:b}),s==null||s(b))},ref:t})};ir.displayName="Stack";I("Stack",ir,"container");import sr,{useState as ar}from"react";import{jsx as to,jsxs as lr}from"react/jsx-runtime";var Jh=({children:e})=>{let[o,n]=ar(e),[r,i]=ar(e),s=l=>{let c=ho(o,l);i(c)},a=(l,c)=>{console.log(`change ${l} -> ${c}`);let p=sr.cloneElement(r,{style:{...r.props.style,[l]:c}});i(p),n(sr.cloneElement(o,{},p))};return lr("div",{"data-design-mode":`${!1}`,children:[o,to("br",{}),lr("div",{style:{display:"flex"},children:[to(cr,{height:300,managedStyle:r.props.style,width:300,onChange:a,style:void 0}),to(pr,{layout:o,onSelect:s,style:{width:300,height:300,backgroundColor:"#ccc"}})]})]})};import{FormField as mt,Input as dt}from"@heswell/salt-lab";import{jsx as H,jsxs as no}from"react/jsx-runtime";var ro={},Za={margin:{top:"marginTop",right:"marginRight",bottom:"marginBottom",left:"marginLeft"},border:{top:"borderTopWidth",right:"borderRightWidth",bottom:"borderBottomWidth",left:"borderLeftWidth"},padding:{top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"}},oo=({feature:e,children:t,style:o,onChange:n})=>no("div",{className:`LayoutBox layout-${e} layout-outer`,children:[no("div",{className:"layout-top",children:[H("span",{className:"layout-title",children:e}),H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.top,onChange:(r,i)=>n(e,"top",i)})})]}),no("div",{className:"layout-inner",children:[H("div",{className:"layout-left",children:H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.left,onChange:(r,i)=>n(e,"left",i)})})}),t,H("div",{className:"layout-right",children:H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.right,onChange:(r,i)=>n(e,"right",i)})})})]}),H("div",{className:"layout-bottom",children:H(mt,{className:"layout-input",style:{width:30},children:H(dt,{value:o.bottom,onChange:(r,i)=>n(e,"bottom",i)})})})]}),rg={margin:!0,marginTop:!0,marginRight:!0,marginBottom:!0,marginLeft:!0},ig={padding:!0,paddingTop:!0,paddingRight:!0,paddingBottom:!0,paddingLeft:!0},sg={border:!0,borderColor:!0,borderWidth:!0,borderTopWidth:!0,borderRightWidth:!0,borderBottomWidth:!0,borderLeftWidth:!0},ft="(\\d+)(?:px)?",Ya=`^(?:${ft}(?:\\s${ft}(?:\\s${ft}(?:\\s${ft})?)?)?)$`,ur=new RegExp(Ya),Ja=/^(?:(\d+)(?:px)\ssolid\s([a-zA-Z,0-9().]+))$/,cr=({height:e,managedStyle:t,onChange:o,style:n,width:r})=>{let i=mr(t),s=(E,R,S)=>{let x=parseInt(S||"0",10),D=Za[E][R];o(D,x)},{marginTop:a=0,marginRight:l=0,marginBottom:c=0,marginLeft:p=0}=i,{borderTopWidth:m=0,borderRightWidth:u=0,borderBottomWidth:f=0,borderLeftWidth:h=0}=i,{paddingTop:g=0,paddingRight:y=0,paddingBottom:d=0,paddingLeft:b=0}=i;return H("div",{className:"LayoutConfigurator",style:{width:r,height:e,...n},children:H(oo,{feature:"margin",style:{top:a,right:l,bottom:c,left:p},onChange:s,children:H(oo,{feature:"border",style:{top:m,right:u,bottom:f,left:h},onChange:s,children:H(oo,{feature:"padding",style:{top:g,right:y,bottom:d,left:b},onChange:s,children:H("div",{className:"layout-content"})})})})})};function ag(e=ro,t=ro){let{margin:o,marginTop:n,marginRight:r,marginBottom:i,marginLeft:s,padding:a,paddingTop:l,paddingRight:c,paddingBottom:p,paddingLeft:m,...u}=e;if(typeof o=="number")u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=o;else if(typeof o=="string"){let f=ur.exec(o);if(f===null)console.error(`Invalid css value for margin '${o}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.marginTop=parseInt(h,10),u.marginRight=parseInt(g,10),u.marginBottom=parseInt(y,10),u.marginLeft=parseInt(d,10)):b?(u.marginTop=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10),u.marginBottom=parseInt(y,10)):h&&g?(u.marginTop=u.marginBottom=parseInt(h,10),u.marginRight=u.marginLeft=parseInt(g,10)):u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=parseInt(h,10)}}if(typeof n=="number"&&(u.marginTop=n),typeof r=="number"&&(u.marginRight=r),typeof i=="number"&&(u.marginBottom=i),typeof s=="number"&&(u.marginLeft=s),typeof a=="number")u.paddingTop=u.paddingRight=u.paddingBottom=u.paddingLeft=a;else if(typeof a=="string"){let f=ur.exec(a);if(f===null)console.error(`Invalid css value for padding '${a}'`);else{let[,h,g,y,d]=f,b=h&&g&&y;b&&d?(u.paddingTop=parseInt(h,10),u.paddingRight=parseInt(g,10),u.paddingBottom=parseInt(y,10),u.paddingLeft=parseInt(d,10)):b?(u.paddingTop=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10),u.paddingBottom=parseInt(y,10)):h&&g?(u.paddingTop=u.paddingBottom=parseInt(h,10),u.paddingRight=u.paddingLeft=parseInt(g,10)):u.paddingTop=u.paddingRight=u.paddingBottom=u.paddinggLeft=parseInt(h,10)}}return typeof l=="number"&&(u.paddingTop=l),typeof c=="number"&&(u.paddingRight=c),typeof p=="number"&&(u.paddingBottom=p),typeof m=="number"&&(u.paddingLeft=m),mr(u,t)}function mr(e=ro){let t={...e},o,{border:n,borderWidth:r,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,margin:p,marginTop:m,marginRight:u,marginBottom:f,marginLeft:h,padding:g,paddingTop:y,paddingRight:d,paddingBottom:b,paddingLeft:E,...R}=t,S={},x={};if(typeof p=="number"&&(t.marginTop=t.marginRight=t.marginBottom=t.marginLeft=p,S={marginTop:p,marginRight:p,marginBottom:p,marginLeft:p}),typeof g=="number"&&(t.paddingTop=t.paddingRight=t.paddingBottom=t.paddingLeft=g,x={paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g}),n||r||i||s||a||l){typeof n=="string"&&(o=Ja.exec(n))&&([,r,c]=o,r=parseInt(r,10)),r&&(i=i===void 0?r:i,s=s===void 0?r:s,a=a===void 0?r:a,l=l===void 0?r:l),c=c||"black";let D=`
|
|
18
18
|
${c} ${l||0}px ${i||0}px 0 0 inset,
|
|
19
19
|
${c} ${-s||0}px ${-a||0}px 0 0 inset`;return{...R,...S,...x,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:a,borderLeftWidth:l,borderColor:c,borderStyle:"solid",boxShadow:D}}else return t}import ja from"react";import Ka from"classnames";import{Tree as qa}from"@heswell/salt-lab";import{jsx as dr}from"react/jsx-runtime";var Qa="hwLayoutTreeViewer",fr=(e,t="0")=>({label:P(e),path:t,childNodes:ja.Children.map(e.props.children,(o,n)=>fr(o,t?`${t}.${n}`:`${n}`))}),pr=({layout:e,onSelect:t,style:o})=>{let n=[fr(e)],r=(i,[{path:s}])=>{t(s)};return dr("div",{className:Ka(Qa),style:o,children:dr(qa,{source:n,groupSelection:"single",onSelectionChange:r})})};export{ye as Action,sg as BORDER_STYLES,Pr as Chest,bt as Component,oe as ComponentRegistry,Jh as ConfigWrapper,Ct as Draggable,Oo as DraggableLayout,ht as Drawer,wo as DropMenu,ne as DropTarget,Ot as Flexbox,zn as FlexboxLayout,Yt as FluidGrid,_n as FluidGridLayout,Qn as Header,_m as HeightOnly,cr as LayoutConfigurator,vm as LayoutProvider,He as LayoutProviderContext,Pm as LayoutProviderVersion,pr as LayoutTreeViewer,rg as MARGIN_STYLES,ig as PADDING_STYLES,Ta as Palette,nr as PaletteItem,ch as PaletteListItem,Ca as PaletteSalt,Je as Placeholder,Qt as Stack,ir as StackLayout,ae as View,ct as ViewContext,Wm as WidthHeight,Gm as WidthOnly,ag as XXXnormalizeStyles,To as computeMenuPosition,Ir as containerOf,xt as expandFlex,Qm as extractResponsiveProps,Q as findTarget,V as followPath,ho as followPathToComponent,q as followPathToParent,kr as getChild,fo as getChildProp,Qo as getPersistentState,w as getProp,T as getProps,en as hasPersistentState,Tt as identifyDropTarget,$ as isContainer,uo as isLayoutComponent,pl as isRegistered,Os as isResponsiveAttribute,ac as isTabstrip,kl as isTypeOf,Sr as isView,Vl as nextLeaf,Y as nextStep,Wl as previousLeaf,I as registerComponent,O as resetPath,tn as setPersistentState,Gl as setRef,P as typeOf,Fn as useBreakpoints,X as useLayoutProviderDispatch,Ts as useLayoutProviderVersion,xe as usePersistentState,On as useResizeObserver,lt as useViewActionDispatcher,Kd as useViewContext,jn as useViewDispatch};
|
|
20
20
|
//# sourceMappingURL=index.js.map
|