@overmap-ai/blocks 0.0.4 → 0.0.5
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/README.md +3 -3
- package/dist/Toast/ToastProvider.d.ts +3 -1
- package/dist/blocks.js +217 -214
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +2 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/package.json +90 -90
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(a,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("@radix-ui/themes/styles.css"),require("@radix-ui/colors"),require("@radix-ui/react-icons"),require("@radix-ui/themes"),require("react/jsx-runtime"),require("react"),require("@radix-ui/react-dialog"),require("re-resizable"),require("react-transition-group"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toast")):typeof define=="function"&&define.amd?define(["exports","@radix-ui/themes/styles.css","@radix-ui/colors","@radix-ui/react-icons","@radix-ui/themes","react/jsx-runtime","react","@radix-ui/react-dialog","re-resizable","react-transition-group","@radix-ui/react-toggle-group","@radix-ui/react-toast"],W):(a=typeof globalThis<"u"?globalThis:a||self,W(a.blocks={},null,a.colors,a.reactIcons,a.themes,a.jsxRuntime,a.React,a.RadixDialogPrimitive,a.reResizable,a.reactTransitionGroup,a.reactToggleGroup,a.RadixToast))})(this,function(a,W,ie,k,n,e,r,Pe,Y,le,ae,Z){"use strict";function ce(l){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const i in l)if(i!=="default"){const
|
|
1
|
+
(function(a,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("@radix-ui/themes/styles.css"),require("@radix-ui/colors"),require("@radix-ui/react-icons"),require("@radix-ui/themes"),require("react/jsx-runtime"),require("react"),require("@radix-ui/react-dialog"),require("re-resizable"),require("react-transition-group"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toast")):typeof define=="function"&&define.amd?define(["exports","@radix-ui/themes/styles.css","@radix-ui/colors","@radix-ui/react-icons","@radix-ui/themes","react/jsx-runtime","react","@radix-ui/react-dialog","re-resizable","react-transition-group","@radix-ui/react-toggle-group","@radix-ui/react-toast"],W):(a=typeof globalThis<"u"?globalThis:a||self,W(a.blocks={},null,a.colors,a.reactIcons,a.themes,a.jsxRuntime,a.React,a.RadixDialogPrimitive,a.reResizable,a.reactTransitionGroup,a.reactToggleGroup,a.RadixToast))})(this,function(a,W,ie,k,n,e,r,Pe,Y,le,ae,Z){"use strict";function ce(l){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const i in l)if(i!=="default"){const t=Object.getOwnPropertyDescriptor(l,i);Object.defineProperty(d,i,t.get?t:{enumerable:!0,get:()=>l[i]})}}return d.default=l,Object.freeze(d)}const H=ce(Pe),G=ce(Z);function Te(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var se={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(l){(function(){var d={}.hasOwnProperty;function i(){for(var o=[],c=0;c<arguments.length;c++){var t=arguments[c];if(t){var u=typeof t;if(u==="string"||u==="number")o.push(t);else if(Array.isArray(t)){if(t.length){var s=i.apply(null,t);s&&o.push(s)}}else if(u==="object"){if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]")){o.push(t.toString());continue}for(var p in t)d.call(t,p)&&t[p]&&o.push(p)}}}return o.join(" ")}l.exports?(i.default=i,l.exports=i):window.classNames=i})()})(se);var Oe=se.exports;const m=Te(Oe);function I(l,d){return r.useMemo(()=>{if(l!==void 0)if(typeof l=="object"){if(!("initial"in l))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(l).map(([i,o])=>[i,d[o]]))}else return d[l]},[d,l])}const De={success:"green",danger:"red",info:"gray"},T=l=>{const d=n.useThemeContext();if(l)return l==="primary"?d.accentColor:De[l]},xe=r.forwardRef(function({className:d,severity:i="primary",color:o,children:c,...t},u){const s=T(i);return e.jsx(n.Badge,{className:m("overmap-badge",d),ref:u,color:o||s,...t,children:c})}),ze=r.memo(xe),F={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},de={spin90Clockwise:F.hoverSpin90Clockwise,spin180Clockwise:F.hoverSpin180Clockwise,spin360Clockwise:F.hoverSpin360Clockwise},M={small:"1",medium:"2",large:"3"},ue=r.createContext({}),R=()=>r.useContext(ue),ke=r.forwardRef(function(d,i){const o=R(),{className:c,type:t="button",fluid:u=o.fluid??!1,size:s=o.size??"medium",severity:p=o.severity??"primary",hoverEffects:f=o.hoverEffects??[],variant:h=o.variant,...C}=d,b=T(p),y=f.map(g=>de[g]);return e.jsx(n.Button,{ref:i,type:t,className:m(c,y,{[F.fluid]:u}),color:b,size:I(s,M),variant:h,...C})}),V=r.memo(ke),je=r.forwardRef(function(d,i){const o=R(),{className:c,children:t,type:u="button",fluid:s=o.fluid??!1,size:p=o.size??"medium",severity:f=o.severity??"primary",hoverEffects:h=o.hoverEffects??[],variant:C=o.variant,...b}=d,y=T(f),g=(h==null?void 0:h.map(w=>de[w]))||[];return e.jsx(n.IconButton,{className:m(c,g,{[F.fluid]:s}),ref:i,color:y,size:I(p,M),variant:C,type:u,...b,children:t})}),ee=r.memo(je),Ie={merged:"_merged_2fzhq_1"},Ae={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},$e=r.forwardRef(function({className:d,merged:i=!1,children:o,gap:c,direction:t="row",severity:u,size:s="medium",variant:p,hoverEffects:f,fluid:h,...C},b){const y=I(s,Ae[t]),g=p==="ghost"?y:"0";return e.jsx(n.Flex,{className:m("overmap-button-group",d,{[Ie.merged]:i}),ref:b,gap:i?c??g:c??"2",direction:t,"data-direction":t,...C,children:e.jsx(ue.Provider,{value:{size:s,severity:u,variant:p,hoverEffects:f,fluid:h},children:o})})}),ne=r.memo($e),Me=r.memo(r.forwardRef((l,d)=>{const{children:i,border:o,before:c,after:t,size:u}=l,s=o?"surface":"ghost",p=I(u,M),f=c&&t?e.jsx(n.Inset,{side:"x",pt:"current",pb:"current",children:i}):c?e.jsx(n.Inset,{side:"bottom",pt:"current",children:i}):t?e.jsx(n.Inset,{side:"top",pb:"current",children:i}):e.jsx(n.Inset,{children:i}),h=e.jsxs(n.Card,{ref:d,size:p,variant:s,children:[c,f,t]});return s==="ghost"?e.jsx(n.Box,{p:"3",children:h}):h})),Ne=r.memo(r.forwardRef((l,d)=>{const{children:i,variant:o="outline",size:c,className:t,...u}=l,s=r.Children.count(i),p=o==="outline"||o==="surface",f=o==="outline"?"ghost":o==="surface"?"soft":o;return e.jsx(Me,{...u,border:p,size:c,children:e.jsx(ne,{size:c,severity:"info",variant:f,className:t,merged:!0,gap:"0",direction:"column",ref:d,children:r.Children.map(i,(h,C)=>e.jsxs(n.Flex,{direction:"column",children:[h,C<s-1&&e.jsx(we,{size:"4"})]},C))})})})),Be=r.memo(r.forwardRef((l,d)=>{const{variant:i}=R(),o=e.jsx(V,{ref:d,...l,variant:i});return i==="ghost"?e.jsx(n.Flex,{px:"2",py:"1",children:e.jsx(n.Box,{grow:"1",width:"100%",asChild:!0,children:o})}):o})),Ee={Root:Ne,Item:Be},Fe=r.memo(function(d){const{title:i,description:o,content:c,closeDialog:t}=d;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsxs(n.Flex,{justify:"between",children:[e.jsx(n.Dialog.Title,{mb:"0",children:i}),e.jsx(n.Dialog.Close,{children:e.jsx(n.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:e.jsx(k.Cross1Icon,{})})})]}),o&&e.jsx(n.Dialog.Description,{children:o})]}),c(t)]})}),Le=r.memo(r.forwardRef((l,d)=>{const{children:i,content:o,title:c,description:t,onOpen:u,defaultOpen:s,onCloseInterrupt:p,...f}=l,[h,C]=r.useState(s??!1),b=r.useCallback(g=>{if(g&&u)u();else if(!g&&p)return p(()=>C(!1));C(g)},[u,p]),y=r.useCallback(g=>{if(g!=null&&g.force)return C(!1);b(!1)},[b]);return e.jsxs(n.Dialog.Root,{open:h,onOpenChange:b,children:[e.jsx(n.Dialog.Trigger,{children:i}),e.jsx(n.Dialog.Content,{ref:d,...f,children:e.jsx(Fe,{closeDialog:y,content:o,title:c,description:t})})]})})),fe=l=>e.jsx(n.AlertDialog.Title,{mb:"0",...l}),We=l=>{const{title:d,description:i,actionText:o="Confirm",cancelText:c="Cancel",onAction:t,onCancel:u,severity:s}=l;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsx(fe,{children:d}),e.jsx(n.AlertDialog.Description,{children:i})]}),e.jsxs(n.Flex,{gap:"3",mt:"4",justify:"end",children:[e.jsx(n.AlertDialog.Cancel,{children:e.jsx(V,{variant:"soft",severity:"info",onClick:u,children:c})}),e.jsx(n.AlertDialog.Action,{children:e.jsx(V,{variant:"solid",severity:s,onClick:t,children:o})})]})]})},pe=r.memo(function(d){const{open:i,setOpen:o,children:c,...t}=d,u=r.useMemo(()=>({close:()=>o(!1),Title:fe,Description:n.AlertDialog.Description}),[o]);return e.jsxs(n.AlertDialog.Root,{open:i,onOpenChange:o,children:[e.jsx(n.AlertDialog.Content,{children:"content"in t?t.content(u):e.jsx(We,{...t})}),c]})}),re=r.createContext(()=>{throw new Error("No AlertDialogProvider found")}),He={content:()=>null},Ge=r.memo(function({children:d}){const[i,o]=r.useState(!1),[c,t]=r.useState(He),u=r.useCallback(s=>{if(i)throw new Error("AlertDialog is already open");t(s),o(!0)},[i]);return e.jsx(pe,{open:i,setOpen:o,...c,children:e.jsx(re.Provider,{value:u,children:d})})}),Ve=()=>r.useContext(re),qe=r.memo(function({severity:d,itemContent:i,closeOnSelect:o=!0,onSelect:c,...t}){const u=T(d),s=r.useCallback(p=>{o||p.preventDefault(),c&&c(p)},[o,c]);return e.jsx(n.DropdownMenu.Item,{onSelect:s,color:u,...t,children:i})}),Xe=r.memo(function({defaultOpen:d,open:i,onOpenChange:o,modal:c,trigger:t,label:u,severity:s="info",children:p,...f}){const h=T(s);return e.jsxs(n.DropdownMenu.Root,{defaultOpen:d,open:i,onOpenChange:o,modal:c,children:[e.jsx(n.DropdownMenu.Trigger,{children:t}),e.jsxs(n.DropdownMenu.Content,{color:h,...f,children:[u&&e.jsx(n.DropdownMenu.Label,{children:u}),p]})]})}),Ue=r.memo(function({separatorBelow:d=!1,separatorAbove:i=!1,children:o,...c}){return e.jsxs(e.Fragment,{children:[i&&e.jsx(n.DropdownMenu.Separator,{}),e.jsx(n.DropdownMenu.Group,{...c,children:o}),d&&e.jsx(n.DropdownMenu.Separator,{})]})}),Ke=r.memo(function({defaultOpen:d,open:i,onOpenChange:o,trigger:c,children:t,...u}){return e.jsxs(n.DropdownMenu.Sub,{defaultOpen:d,open:i,onOpenChange:o,children:[e.jsx(n.DropdownMenu.SubTrigger,{children:c}),e.jsx(n.DropdownMenu.SubContent,{...u,children:t})]})}),Qe={Root:Xe,ItemGroup:Ue,Item:qe,SubMenu:Ke},ge={fluid:"_fluid_7n1wr_1"},Je=r.forwardRef(function({className:d,fluid:i,size:o="medium",variant:c="surface",severity:t="primary",itemSeverity:u="info",placeholder:s="Select",side:p,items:f=[],value:h,id:C,...b},y){const g=I(o,M),w=T(t),v=T(u);return r.createElement(n.Select.Root,{size:g,...b,key:h===void 0?1:0,value:h},e.jsx(n.Select.Trigger,{className:m(d,{[ge.fluid]:i}),id:C,ref:y,variant:c,placeholder:s,color:w}),e.jsx(n.Select.Content,{side:p,className:ge.contentDefault,position:"popper",variant:c!=="surface"?"soft":"solid",color:v,children:f.map(({itemContent:P,value:$,...x})=>e.jsx(n.Select.Item,{className:"overmap-select-item",value:$,...x,children:P},$))}))}),Ye=r.memo(Je),he=r.memo(r.forwardRef((l,d)=>{const{checked:i,label:o,value:c,size:t="2"}=l;return e.jsx(n.Box,{asChild:!0,px:t,children:e.jsx(n.Select.Item,{value:c,ref:d,children:e.jsxs(n.Flex,{gap:t,align:"center",children:[e.jsx(n.Checkbox,{checked:i}),o]})})})})),q="__select_all__",Ze=r.memo(r.forwardRef((l,d)=>{const[i,o]=r.useState(!1),{placeholder:c,value:t,onValueChange:u,options:s,disabled:p,id:f,radius:h,variant:C,name:b}=l,y=I(l.size,M),g=T(l.severity),w=r.useMemo(()=>new Map(s.map(_=>[_.value,_.label])),[s]),v=t.length>4?`${t.length} options selected`:t.map(_=>w.get(_)).join(", "),P=r.useCallback(()=>o(!1),[]),$=r.useCallback(_=>{_&&o(!0)},[]),x=r.useCallback(_=>{let L;_===q?L=t.length===s.length?[]:s.map(E=>E.value):L=t.includes(_)?t.filter(X=>X!==_):[...t,_],u(L)},[u,s,t]);return r.useEffect(()=>{if(s.some(({value:_})=>_===q))throw new Error(`Cannot have an option with the value "${q}"`)},[s]),e.jsxs(n.Select.Root,{open:i,value:"",onOpenChange:$,onValueChange:x,disabled:p,size:y,name:b,autoComplete:"off",children:[e.jsx(n.Select.Trigger,{ref:d,id:f,radius:h,variant:C,color:g,placeholder:t.length>0?v:c,"data-placeholder":t.length>0?void 0:!0}),e.jsxs(n.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:P,onPointerDownOutside:P,children:[e.jsx(he,{value:q,label:"Select all",checked:t.length===s.length,size:y}),s.map(_=>e.jsx(he,{..._,checked:t.includes(_.value),size:y},_.value))]})]})})),Re={default:"_default_u936h_1"},en=r.forwardRef(function({className:d,severity:i="primary",icon:o,defaultChecked:c=!1,onCheckedChange:t,...u},s){const p=r.useRef(null),[f,h]=r.useState(u.checked?u.checked:c),[C,b]=r.useState(),y=T(i);r.useLayoutEffect(()=>{var P;const v=s||p;"current"in v&&v.current&&b((P=v.current)==null?void 0:P.querySelector("span.rt-SwitchThumb"))},[s]);const g=r.useCallback(v=>{h(v),t&&t(v)},[t]),w=u.checked?u.checked:f;return e.jsxs(e.Fragment,{children:[e.jsx(n.Switch,{className:m("overmap-switch",d,Re.default),ref:s||p,color:y,radius:"full",defaultChecked:c,onCheckedChange:g,...u}),e.jsx(n.Portal,{container:C,asChild:!0,children:o&&"checked"in o?w?o.checked:o.unchecked:o})]})}),nn=r.memo(en),N={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},rn=r.forwardRef(function({side:d="left",modal:i=!0,children:o,open:c,containerSelector:t,overlay:u=!0,resizable:s=!0,minWidth:p="300px",maxWidth:f="500px",...h},C){const b=d==="right",y=d==="left",[g,w]=r.useState();return r.useEffect(()=>{const v=t??'[data-is-root-theme="true"]',P=document.querySelector(v);if(P===void 0)throw new Error(`Could not find a container element using the following selector ${v}`);w(P)},[t]),e.jsx(H.Root,{open:c,modal:i,children:e.jsxs(H.Portal,{container:g,children:[u&&e.jsx(H.Overlay,{className:m(N.overlay)}),e.jsx(H.Content,{className:m("overmap-sidebar","rt-DialogContent",N.sidebarContent,{[N.left]:y,[N.right]:b}),ref:C,asChild:!0,...h,children:e.jsx(n.Box,{width:"auto",children:e.jsx(Y.Resizable,{minWidth:p,maxWidth:f,defaultSize:{width:"300px",height:"100%"},enable:{right:s&&y,left:s&&b},handleClasses:{left:N.resizeHandle,right:N.resizeHandle},handleComponent:{right:e.jsx(k.DragHandleDots2Icon,{}),left:e.jsx(k.DragHandleDots2Icon,{})},children:o})})})]})})}),on=r.memo(rn),B={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},tn=r.forwardRef(function({className:d,leftSlot:i,rightSlot:o,size:c="medium",showInputLength:t,value:u,variant:s,severity:p="primary",...f},h){const C=I(c,M),b=T(p),y=t||t===void 0&&f.maxLength!==void 0,g=u!==void 0?u.toString():void 0;return e.jsxs(n.TextField.Root,{className:m(B.wrapper,{[B.accommodateCharCount]:y}),size:C,variant:s,color:b,children:[i&&e.jsx(n.TextField.Slot,{children:i}),e.jsx(n.TextField.Input,{className:m(B.default,d,{[B.noLeftIcon]:!i,[B.noRightIcon]:!o}),ref:h,size:C,variant:s,color:b,...f}),o&&e.jsx(n.TextField.Slot,{children:o}),y&&e.jsx(n.Text,{as:"p",className:B.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${g==null?void 0:g.length}/${f.maxLength}`:`${g==null?void 0:g.length}`})]})}),ln=r.memo(tn),an={wrapper:"_wrapper_tmtz0_1"},cn=r.forwardRef(function({className:d,defaultOpen:i=!1,modal:o=!1,content:c,children:t,...u},s){return e.jsxs(n.Popover.Root,{defaultOpen:i,modal:o,children:[e.jsx(n.Popover.Trigger,{children:t}),e.jsx(n.Popover.Content,{ref:s,className:m("overmap-popover",d,an.wrapper),...u,children:c(n.Popover.Close)})]})}),sn=r.memo(cn),O={wrapper:"_wrapper_1mz2e_1",panelContent:"_panelContent_1mz2e_6",left:"_left_1mz2e_14",right:"_right_1mz2e_18",resizable:"_resizable_1mz2e_23",resizeHandle:"_resizeHandle_1mz2e_28",panelMainContent:"_panelMainContent_1mz2e_48"},Ce=200,A=150,dn=r.memo(function({children:d,showLeft:i,leftPanel:o,leftMinWidth:c=Ce,showRight:t,rightPanel:u,rightMinWidth:s=Ce,resizeable:p}){const f=r.useRef(null),h=r.useRef(null),[C,b]=r.useState(0),[y,g]=r.useState(),w=r.useRef(null),[v,P]=r.useState(0),[$,x]=r.useState(),_=r.useCallback((S,D,z)=>(j,me,Se,te)=>{if(!f.current)return;const K=S+te.width;z(f.current.clientWidth-K),D(()=>K)},[]),L=r.useCallback((S,D,z,j)=>_(C,b,x)(S,D,z,j),[_,C]),X=r.useCallback((S,D,z,j)=>_(v,P,g)(S,D,z,j),[_,v]),E=r.useCallback((S,D,z,j,me,Se,te,K)=>{if(!f.current)return;let Q=S;if(Q===0&&(Q=D,z(Q)),Se){const J=f.current.clientWidth-Q;K(J),me>J&&(te(J),j(f.current.clientWidth-J))}},[]),On=r.useCallback(()=>E(v,s,P,x,C,i,b,g),[E,C,s,v,i]),Dn=r.useCallback(()=>E(C,c,b,g,v,t,P,x),[E,c,C,v,t]),U=r.useCallback((S,D)=>{f.current&&S&&D(f.current.clientWidth)},[]),xn=r.useCallback(()=>U(i,g),[U,i]),zn=r.useCallback(()=>U(t,x),[U,t]),_e=r.useCallback(()=>{var S,D,z,j;f.current&&(g(f.current.clientWidth-(((S=w.current)==null?void 0:S.clientWidth)||0)),x(f.current.clientWidth-(((D=h.current)==null?void 0:D.clientWidth)||0)),b(((z=h.current)==null?void 0:z.clientWidth)||0),P(((j=w.current)==null?void 0:j.clientWidth)||0))},[]);r.useEffect(()=>{if(!f.current)return;const S=new ResizeObserver(_e);return S.observe(f.current),()=>{S.disconnect()}},[_e]);const kn=r.useMemo(()=>({entering:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[C]),jn=r.useMemo(()=>({entering:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[v]);return e.jsxs(n.Flex,{className:O.wrapper,style:{minWidth:`${c+s}px`},ref:f,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[e.jsx(le.Transition,{nodeRef:h,timeout:i?0:A,in:i,unmountOnExit:!0,onEntering:Dn,onExited:zn,children:S=>e.jsx(n.Box,{ref:h,className:m(O.panelContent,O.left),style:kn[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Y.Resizable,{className:O.resizable,size:{width:C,height:"100%"},onResizeStop:L,enable:{right:(p==null?void 0:p.left)!==void 0?p.left:!0},minWidth:c,maxWidth:y,handleClasses:{right:m(O.resizeHandle,O.left)},handleComponent:{right:e.jsx(k.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:o})})}),e.jsx(n.Box,{className:O.panelMainContent,width:"max-content",children:d}),e.jsx(le.Transition,{nodeRef:w,timeout:t?0:A,in:t,unmountOnExit:!0,onEntering:On,onExited:xn,children:S=>e.jsx(n.Box,{ref:w,className:m(O.panelContent,O.right),style:jn[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Y.Resizable,{className:O.resizable,size:{width:v,height:"100%"},onResizeStop:X,enable:{left:(p==null?void 0:p.right)!==void 0?p.right:!0},minWidth:s,maxWidth:$,handleClasses:{left:m(O.resizeHandle,O.right)},handleComponent:{left:e.jsx(k.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),un={charCount:"_charCount_17uut_1"},fn=r.forwardRef(function({className:d,showInputLength:i,inputLengthTemplate:o,value:c,severity:t="primary",resize:u,...s},p){const f=T(t),h=T("info"),C=i||i===void 0&&(s.maxLength!==void 0||s.minLength!==void 0),b=c!==void 0?c.toString():"",y=r.useMemo(()=>{if(o){let g=o.replace("{current}",b.length.toString());return s.minLength!==void 0&&(g=g.replace("{min}",s.minLength.toString())),s.maxLength!==void 0&&(g=g.replace("{max}",s.maxLength.toString())),g}return b.length},[o,s.maxLength,s.minLength,b.length]);return e.jsxs(e.Fragment,{children:[e.jsx(n.TextArea,{className:m("overmap-textarea",d),style:{resize:u},ref:p,value:c,color:f,...s}),C&&e.jsx(n.Text,{as:"p",className:un.charCount,color:h,align:"right",children:y})]})}),pn=r.memo(fn),gn=r.forwardRef(function({loop:d,type:i,rovingFocus:o,value:c,onValueChange:t,defaultValue:u,disabled:s,items:p,className:f,direction:h="row",...C},b){return e.jsx(ae.Root,{type:i,className:m("overmap-toggle-group",f),ref:b,value:c,onValueChange:t,disabled:s,orientation:h==="column"?"vertical":"horizontal",loop:d,rovingFocus:o,defaultValue:u,asChild:!0,children:e.jsx(ne,{direction:h,...C,children:p.map(({children:y,...g})=>r.createElement(ae.Item,{asChild:!0,...g,key:g.value},e.jsx(ee,{className:m("overmap-toggle-group-button"),"aria-label":g.value,variant:g.value===c?"solid":"soft",children:y})))})})}),hn=r.memo(gn),be={ToastViewport:"_ToastViewport_t8tlv_1",ToastRoot:"_ToastRoot_t8tlv_20",slideIn:"_slideIn_t8tlv_1",swipeOut:"_swipeOut_t8tlv_1"},Cn=r.forwardRef(function({title:d,description:i,icon:o,severity:c="primary",size:t,onClose:u,sensitivity:s,...p},f){const[h,C]=r.useState(!0),b=T(c),y=r.useCallback(g=>{!g&&u&&u(),C(g)},[u]);return e.jsx(G.Root,{asChild:!0,ref:f,...p,open:h,type:s,onOpenChange:y,children:e.jsx(n.Callout.Root,{className:be.ToastRoot,variant:"surface",color:b,size:t,children:e.jsxs(n.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[e.jsxs(n.Flex,{align:"center",gap:"4",children:[e.jsx(n.Callout.Icon,{children:o||e.jsx(k.InfoCircledIcon,{})}),e.jsxs(n.Flex,{direction:"column",gap:"0",children:[e.jsx(G.Title,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"medium",children:d})}),e.jsx(G.Description,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"light",children:i})})]})]}),e.jsx(G.Close,{asChild:!0,children:e.jsx(ee,{"aria-label":"Close",variant:"ghost",size:"small",severity:c,children:e.jsx(k.Cross2Icon,{})})})]})})})}),ye=r.memo(Cn),oe=r.createContext({}),bn=()=>{const l=r.useContext(oe);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},yn=240/60,ve=5e3,vn=l=>{if(l.duration&&l.duration>=ve)return l.duration;const d=l.severity==="danger"?1.5:1,i=l.description.split(" ").length+l.title.split(" ").length;return(ve+i/yn)*d},wn=r.memo(function({children:d,className:i,hotkey:o,...c}){const[t,u]=r.useState([]),s=r.useCallback((f,h,C)=>{u(b=>{const y=b.find(g=>g.id===f);return y&&h===0&&clearTimeout(y.timeout),b.filter(g=>g.id!==f)}),C&&C()},[]),p=r.useMemo(()=>{let f=0;const h=w=>{const v=vn(w),P=f.toString();f+=1;const $=setTimeout(()=>s(P,1,w.onClose),v);u(x=>[...x,{...w,timeout:$,duration:v,id:P}])};return{showToast:h,showPrimary:w=>h({...w,severity:"primary"}),showSuccess:w=>h({...w,severity:"success"}),showError:w=>h({...w,severity:"danger"}),showInfo:w=>h({...w,severity:"info"})}},[s]);return r.useEffect(()=>()=>{for(const{timeout:f}of t)clearTimeout(f)},[]),e.jsx(oe.Provider,{value:p,children:e.jsxs(Z.ToastProvider,{...c,children:[d,e.jsx(Z.ToastViewport,{className:m(i,be.ToastViewport),hotkey:o}),t.map(({id:f,onClose:h,...C})=>e.jsx(ye,{...C,onClose:()=>s(f,0,h)},f))]})})}),_n={noWrap:"_noWrap_1wpa5_1"},mn=r.memo(r.forwardRef(({className:l,noWrap:d,severity:i,as:o,...c},t)=>{const u=T(i);return e.jsx(n.Text,{ref:t,as:o,className:m(l,{[_n.noWrap]:d}),color:u,...c})})),cr="",Sn=r.memo(r.forwardRef((l,d)=>{const{panelBackground:i="solid",radius:o="full",...c}=l;return e.jsx(n.Theme,{panelBackground:i,radius:o,ref:d,...c})})),Pn={1:"max-content",2:"max-content",3:"max-content",4:"100%"},Tn=r.forwardRef(function({severity:d="info",weight:i="light",gap:o="1",text:c,orientation:t="horizontal",size:u,...s}){const p=I(u,Pn),f=T(d);return e.jsx(e.Fragment,{children:e.jsxs(n.Flex,{width:t==="horizontal"?p:"max-content",height:t==="vertical"?p:"max-content",direction:t==="vertical"?"column":"row",align:"center",gap:o,children:[e.jsx(n.Separator,{size:u,orientation:t,color:f,...s}),c&&e.jsxs(e.Fragment,{children:[e.jsx(n.Text,{as:"span",size:"1",weight:i,color:f,children:c}),e.jsx(n.Separator,{size:u,orientation:t,color:f,...s})]})]})})}),we=r.memo(Tn);Object.defineProperty(a,"AccessibleIcon",{enumerable:!0,get:()=>n.AccessibleIcon}),Object.defineProperty(a,"AspectRatio",{enumerable:!0,get:()=>n.AspectRatio}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:()=>n.Avatar}),Object.defineProperty(a,"Blockquote",{enumerable:!0,get:()=>n.Blockquote}),Object.defineProperty(a,"Box",{enumerable:!0,get:()=>n.Box}),Object.defineProperty(a,"Callout",{enumerable:!0,get:()=>n.Callout}),Object.defineProperty(a,"Card",{enumerable:!0,get:()=>n.Card}),Object.defineProperty(a,"Checkbox",{enumerable:!0,get:()=>n.Checkbox}),Object.defineProperty(a,"Code",{enumerable:!0,get:()=>n.Code}),Object.defineProperty(a,"Container",{enumerable:!0,get:()=>n.Container}),Object.defineProperty(a,"ContextMenu",{enumerable:!0,get:()=>n.ContextMenu}),Object.defineProperty(a,"Em",{enumerable:!0,get:()=>n.Em}),Object.defineProperty(a,"Flex",{enumerable:!0,get:()=>n.Flex}),Object.defineProperty(a,"Grid",{enumerable:!0,get:()=>n.Grid}),Object.defineProperty(a,"Heading",{enumerable:!0,get:()=>n.Heading}),Object.defineProperty(a,"HoverCard",{enumerable:!0,get:()=>n.HoverCard}),Object.defineProperty(a,"Inset",{enumerable:!0,get:()=>n.Inset}),Object.defineProperty(a,"Kbd",{enumerable:!0,get:()=>n.Kbd}),Object.defineProperty(a,"Link",{enumerable:!0,get:()=>n.Link}),Object.defineProperty(a,"Portal",{enumerable:!0,get:()=>n.Portal}),Object.defineProperty(a,"Quote",{enumerable:!0,get:()=>n.Quote}),Object.defineProperty(a,"RadioGroup",{enumerable:!0,get:()=>n.RadioGroup}),Object.defineProperty(a,"ScrollArea",{enumerable:!0,get:()=>n.ScrollArea}),Object.defineProperty(a,"Section",{enumerable:!0,get:()=>n.Section}),Object.defineProperty(a,"Slider",{enumerable:!0,get:()=>n.Slider}),Object.defineProperty(a,"Slot",{enumerable:!0,get:()=>n.Slot}),Object.defineProperty(a,"Strong",{enumerable:!0,get:()=>n.Strong}),Object.defineProperty(a,"Table",{enumerable:!0,get:()=>n.Table}),Object.defineProperty(a,"Tabs",{enumerable:!0,get:()=>n.Tabs}),Object.defineProperty(a,"TextField",{enumerable:!0,get:()=>n.TextField}),Object.defineProperty(a,"Theme",{enumerable:!0,get:()=>n.Theme}),Object.defineProperty(a,"Tooltip",{enumerable:!0,get:()=>n.Tooltip}),Object.defineProperty(a,"VisuallyHidden",{enumerable:!0,get:()=>n.VisuallyHidden}),Object.defineProperty(a,"updateThemeAppearanceClass",{enumerable:!0,get:()=>n.updateThemeAppearanceClass}),Object.defineProperty(a,"useThemeContext",{enumerable:!0,get:()=>n.useThemeContext}),a.AlertDialog=pe,a.AlertDialogContent=re,a.AlertDialogProvider=Ge,a.Badge=ze,a.Button=V,a.ButtonGroup=ne,a.ButtonList=Ee,a.DefaultTheme=Sn,a.Dialog=Le,a.DropdownMenu=Qe,a.IconButton=ee,a.Input=ln,a.LeftAndRightPanels=dn,a.MultiSelect=Ze,a.Popover=sn,a.Select=Ye,a.Separator=we,a.Sidebar=on,a.Switch=nn,a.Text=mn,a.TextArea=pn,a.Toast=ye,a.ToastContext=oe,a.ToastProvider=wn,a.ToggleGroup=hn,a.useAlertDialog=Ve,a.useSeverityColor=T,a.useToast=bn,Object.keys(ie).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>ie[l]})}),Object.keys(k).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>k[l]})}),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
*/(function(l){(function(){var d={}.hasOwnProperty;function i(){for(var t=[],c=0;c<arguments.length;c++){var o=arguments[c];if(o){var u=typeof o;if(u==="string"||u==="number")t.push(o);else if(Array.isArray(o)){if(o.length){var s=i.apply(null,o);s&&t.push(s)}}else if(u==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){t.push(o.toString());continue}for(var p in o)d.call(o,p)&&o[p]&&t.push(p)}}}return t.join(" ")}l.exports?(i.default=i,l.exports=i):window.classNames=i})()})(se);var Oe=se.exports;const m=Te(Oe);function I(l,d){return r.useMemo(()=>{if(l!==void 0)if(typeof l=="object"){if(!("initial"in l))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(l).map(([i,t])=>[i,d[t]]))}else return d[l]},[d,l])}const De={success:"green",danger:"red",info:"gray"},T=l=>{const d=n.useThemeContext();if(l)return l==="primary"?d.accentColor:De[l]},xe=r.forwardRef(function({className:d,severity:i="primary",color:t,children:c,...o},u){const s=T(i);return e.jsx(n.Badge,{className:m("overmap-badge",d),ref:u,color:t||s,...o,children:c})}),ze=r.memo(xe),F={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},de={spin90Clockwise:F.hoverSpin90Clockwise,spin180Clockwise:F.hoverSpin180Clockwise,spin360Clockwise:F.hoverSpin360Clockwise},M={small:"1",medium:"2",large:"3"},ue=r.createContext({}),R=()=>r.useContext(ue),ke=r.forwardRef(function(d,i){const t=R(),{className:c,type:o="button",fluid:u=t.fluid??!1,size:s=t.size??"medium",severity:p=t.severity??"primary",hoverEffects:f=t.hoverEffects??[],variant:h=t.variant,...C}=d,b=T(p),y=f.map(g=>de[g]);return e.jsx(n.Button,{ref:i,type:o,className:m(c,y,{[F.fluid]:u}),color:b,size:I(s,M),variant:h,...C})}),V=r.memo(ke),je=r.forwardRef(function(d,i){const t=R(),{className:c,children:o,type:u="button",fluid:s=t.fluid??!1,size:p=t.size??"medium",severity:f=t.severity??"primary",hoverEffects:h=t.hoverEffects??[],variant:C=t.variant,...b}=d,y=T(f),g=(h==null?void 0:h.map(w=>de[w]))||[];return e.jsx(n.IconButton,{className:m(c,g,{[F.fluid]:s}),ref:i,color:y,size:I(p,M),variant:C,type:u,...b,children:o})}),ee=r.memo(je),Ie={merged:"_merged_2fzhq_1"},Ae={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},$e=r.forwardRef(function({className:d,merged:i=!1,children:t,gap:c,direction:o="row",severity:u,size:s="medium",variant:p,hoverEffects:f,fluid:h,...C},b){const y=I(s,Ae[o]),g=p==="ghost"?y:"0";return e.jsx(n.Flex,{className:m("overmap-button-group",d,{[Ie.merged]:i}),ref:b,gap:i?c??g:c??"2",direction:o,"data-direction":o,...C,children:e.jsx(ue.Provider,{value:{size:s,severity:u,variant:p,hoverEffects:f,fluid:h},children:t})})}),ne=r.memo($e),Me=r.memo(r.forwardRef((l,d)=>{const{children:i,border:t,before:c,after:o,size:u}=l,s=t?"surface":"ghost",p=I(u,M),f=c&&o?e.jsx(n.Inset,{side:"x",pt:"current",pb:"current",children:i}):c?e.jsx(n.Inset,{side:"bottom",pt:"current",children:i}):o?e.jsx(n.Inset,{side:"top",pb:"current",children:i}):e.jsx(n.Inset,{children:i}),h=e.jsxs(n.Card,{ref:d,size:p,variant:s,children:[c,f,o]});return s==="ghost"?e.jsx(n.Box,{p:"3",children:h}):h})),Ne=r.memo(r.forwardRef((l,d)=>{const{children:i,variant:t="outline",size:c,className:o,...u}=l,s=r.Children.count(i),p=t==="outline"||t==="surface",f=t==="outline"?"ghost":t==="surface"?"soft":t;return e.jsx(Me,{...u,border:p,size:c,children:e.jsx(ne,{size:c,severity:"info",variant:f,className:o,merged:!0,gap:"0",direction:"column",ref:d,children:r.Children.map(i,(h,C)=>e.jsxs(n.Flex,{direction:"column",children:[h,C<s-1&&e.jsx(we,{size:"4"})]},C))})})})),Be=r.memo(r.forwardRef((l,d)=>{const{variant:i}=R(),t=e.jsx(V,{ref:d,...l,variant:i});return i==="ghost"?e.jsx(n.Flex,{px:"2",py:"1",children:e.jsx(n.Box,{grow:"1",width:"100%",asChild:!0,children:t})}):t})),Ee={Root:Ne,Item:Be},Fe=r.memo(function(d){const{title:i,description:t,content:c,closeDialog:o}=d;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsxs(n.Flex,{justify:"between",children:[e.jsx(n.Dialog.Title,{mb:"0",children:i}),e.jsx(n.Dialog.Close,{children:e.jsx(n.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:e.jsx(k.Cross1Icon,{})})})]}),t&&e.jsx(n.Dialog.Description,{children:t})]}),c(o)]})}),Le=r.memo(r.forwardRef((l,d)=>{const{children:i,content:t,title:c,description:o,onOpen:u,defaultOpen:s,onCloseInterrupt:p,...f}=l,[h,C]=r.useState(s??!1),b=r.useCallback(g=>{if(g&&u)u();else if(!g&&p)return p(()=>C(!1));C(g)},[u,p]),y=r.useCallback(g=>{if(g!=null&&g.force)return C(!1);b(!1)},[b]);return e.jsxs(n.Dialog.Root,{open:h,onOpenChange:b,children:[e.jsx(n.Dialog.Trigger,{children:i}),e.jsx(n.Dialog.Content,{ref:d,...f,children:e.jsx(Fe,{closeDialog:y,content:t,title:c,description:o})})]})})),fe=l=>e.jsx(n.AlertDialog.Title,{mb:"0",...l}),We=l=>{const{title:d,description:i,actionText:t="Confirm",cancelText:c="Cancel",onAction:o,onCancel:u,severity:s}=l;return e.jsxs(n.Flex,{direction:"column",gap:"2",children:[e.jsxs(n.Flex,{direction:"column",gap:"1",children:[e.jsx(fe,{children:d}),e.jsx(n.AlertDialog.Description,{children:i})]}),e.jsxs(n.Flex,{gap:"3",mt:"4",justify:"end",children:[e.jsx(n.AlertDialog.Cancel,{children:e.jsx(V,{variant:"soft",severity:"info",onClick:u,children:c})}),e.jsx(n.AlertDialog.Action,{children:e.jsx(V,{variant:"solid",severity:s,onClick:o,children:t})})]})]})},pe=r.memo(function(d){const{open:i,setOpen:t,children:c,...o}=d,u=r.useMemo(()=>({close:()=>t(!1),Title:fe,Description:n.AlertDialog.Description}),[t]);return e.jsxs(n.AlertDialog.Root,{open:i,onOpenChange:t,children:[e.jsx(n.AlertDialog.Content,{children:"content"in o?o.content(u):e.jsx(We,{...o})}),c]})}),re=r.createContext(()=>{throw new Error("No AlertDialogProvider found")}),He={content:()=>null},Ge=r.memo(function({children:d}){const[i,t]=r.useState(!1),[c,o]=r.useState(He),u=r.useCallback(s=>{if(i)throw new Error("AlertDialog is already open");o(s),t(!0)},[i]);return e.jsx(pe,{open:i,setOpen:t,...c,children:e.jsx(re.Provider,{value:u,children:d})})}),Ve=()=>r.useContext(re),qe=r.memo(function({severity:d,itemContent:i,closeOnSelect:t=!0,onSelect:c,...o}){const u=T(d),s=r.useCallback(p=>{t||p.preventDefault(),c&&c(p)},[t,c]);return e.jsx(n.DropdownMenu.Item,{onSelect:s,color:u,...o,children:i})}),Xe=r.memo(function({defaultOpen:d,open:i,onOpenChange:t,modal:c,trigger:o,label:u,severity:s="info",children:p,...f}){const h=T(s);return e.jsxs(n.DropdownMenu.Root,{defaultOpen:d,open:i,onOpenChange:t,modal:c,children:[e.jsx(n.DropdownMenu.Trigger,{children:o}),e.jsxs(n.DropdownMenu.Content,{color:h,...f,children:[u&&e.jsx(n.DropdownMenu.Label,{children:u}),p]})]})}),Ue=r.memo(function({separatorBelow:d=!1,separatorAbove:i=!1,children:t,...c}){return e.jsxs(e.Fragment,{children:[i&&e.jsx(n.DropdownMenu.Separator,{}),e.jsx(n.DropdownMenu.Group,{...c,children:t}),d&&e.jsx(n.DropdownMenu.Separator,{})]})}),Ke=r.memo(function({defaultOpen:d,open:i,onOpenChange:t,trigger:c,children:o,...u}){return e.jsxs(n.DropdownMenu.Sub,{defaultOpen:d,open:i,onOpenChange:t,children:[e.jsx(n.DropdownMenu.SubTrigger,{children:c}),e.jsx(n.DropdownMenu.SubContent,{...u,children:o})]})}),Qe={Root:Xe,ItemGroup:Ue,Item:qe,SubMenu:Ke},ge={fluid:"_fluid_7n1wr_1"},Je=r.forwardRef(function({className:d,fluid:i,size:t="medium",variant:c="surface",severity:o="primary",itemSeverity:u="info",placeholder:s="Select",side:p,items:f=[],value:h,id:C,...b},y){const g=I(t,M),w=T(o),v=T(u);return r.createElement(n.Select.Root,{size:g,...b,key:h===void 0?1:0,value:h},e.jsx(n.Select.Trigger,{className:m(d,{[ge.fluid]:i}),id:C,ref:y,variant:c,placeholder:s,color:w}),e.jsx(n.Select.Content,{side:p,className:ge.contentDefault,position:"popper",variant:c!=="surface"?"soft":"solid",color:v,children:f.map(({itemContent:P,value:$,...x})=>e.jsx(n.Select.Item,{className:"overmap-select-item",value:$,...x,children:P},$))}))}),Ye=r.memo(Je),he=r.memo(r.forwardRef((l,d)=>{const{checked:i,label:t,value:c,size:o="2"}=l;return e.jsx(n.Box,{asChild:!0,px:o,children:e.jsx(n.Select.Item,{value:c,ref:d,children:e.jsxs(n.Flex,{gap:o,align:"center",children:[e.jsx(n.Checkbox,{checked:i}),t]})})})})),q="__select_all__",Ze=r.memo(r.forwardRef((l,d)=>{const[i,t]=r.useState(!1),{placeholder:c,value:o,onValueChange:u,options:s,disabled:p,id:f,radius:h,variant:C,name:b}=l,y=I(l.size,M),g=T(l.severity),w=r.useMemo(()=>new Map(s.map(_=>[_.value,_.label])),[s]),v=o.length>4?`${o.length} options selected`:o.map(_=>w.get(_)).join(", "),P=r.useCallback(()=>t(!1),[]),$=r.useCallback(_=>{_&&t(!0)},[]),x=r.useCallback(_=>{let L;_===q?L=o.length===s.length?[]:s.map(E=>E.value):L=o.includes(_)?o.filter(X=>X!==_):[...o,_],u(L)},[u,s,o]);return r.useEffect(()=>{if(s.some(({value:_})=>_===q))throw new Error(`Cannot have an option with the value "${q}"`)},[s]),e.jsxs(n.Select.Root,{open:i,value:"",onOpenChange:$,onValueChange:x,disabled:p,size:y,name:b,autoComplete:"off",children:[e.jsx(n.Select.Trigger,{ref:d,id:f,radius:h,variant:C,color:g,placeholder:o.length>0?v:c,"data-placeholder":o.length>0?void 0:!0}),e.jsxs(n.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:P,onPointerDownOutside:P,children:[e.jsx(he,{value:q,label:"Select all",checked:o.length===s.length,size:y}),s.map(_=>e.jsx(he,{..._,checked:o.includes(_.value),size:y},_.value))]})]})})),Re={default:"_default_u936h_1"},en=r.forwardRef(function({className:d,severity:i="primary",icon:t,defaultChecked:c=!1,onCheckedChange:o,...u},s){const p=r.useRef(null),[f,h]=r.useState(u.checked?u.checked:c),[C,b]=r.useState(),y=T(i);r.useLayoutEffect(()=>{var P;const v=s||p;"current"in v&&v.current&&b((P=v.current)==null?void 0:P.querySelector("span.rt-SwitchThumb"))},[s]);const g=r.useCallback(v=>{h(v),o&&o(v)},[o]),w=u.checked?u.checked:f;return e.jsxs(e.Fragment,{children:[e.jsx(n.Switch,{className:m("overmap-switch",d,Re.default),ref:s||p,color:y,radius:"full",defaultChecked:c,onCheckedChange:g,...u}),e.jsx(n.Portal,{container:C,asChild:!0,children:t&&"checked"in t?w?t.checked:t.unchecked:t})]})}),nn=r.memo(en),N={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},rn=r.forwardRef(function({side:d="left",modal:i=!0,children:t,open:c,containerSelector:o,overlay:u=!0,resizable:s=!0,minWidth:p="300px",maxWidth:f="500px",...h},C){const b=d==="right",y=d==="left",[g,w]=r.useState();return r.useEffect(()=>{const v=o??'[data-is-root-theme="true"]',P=document.querySelector(v);if(P===void 0)throw new Error(`Could not find a container element using the following selector ${v}`);w(P)},[o]),e.jsx(H.Root,{open:c,modal:i,children:e.jsxs(H.Portal,{container:g,children:[u&&e.jsx(H.Overlay,{className:m(N.overlay)}),e.jsx(H.Content,{className:m("overmap-sidebar","rt-DialogContent",N.sidebarContent,{[N.left]:y,[N.right]:b}),ref:C,asChild:!0,...h,children:e.jsx(n.Box,{width:"auto",children:e.jsx(Y.Resizable,{minWidth:p,maxWidth:f,defaultSize:{width:"300px",height:"100%"},enable:{right:s&&y,left:s&&b},handleClasses:{left:N.resizeHandle,right:N.resizeHandle},handleComponent:{right:e.jsx(k.DragHandleDots2Icon,{}),left:e.jsx(k.DragHandleDots2Icon,{})},children:t})})})]})})}),tn=r.memo(rn),B={accommodateCharCount:"_accommodateCharCount_sr18k_1",wrapper:"_wrapper_sr18k_5",default:"_default_sr18k_9",noLeftIcon:"_noLeftIcon_sr18k_13",noRightIcon:"_noRightIcon_sr18k_17",charCount:"_charCount_sr18k_21"},on=r.forwardRef(function({className:d,leftSlot:i,rightSlot:t,size:c="medium",showInputLength:o,value:u,variant:s,severity:p="primary",...f},h){const C=I(c,M),b=T(p),y=o||o===void 0&&f.maxLength!==void 0,g=u!==void 0?u.toString():void 0;return e.jsxs(n.TextField.Root,{className:m(B.wrapper,{[B.accommodateCharCount]:y}),size:C,variant:s,color:b,children:[i&&e.jsx(n.TextField.Slot,{children:i}),e.jsx(n.TextField.Input,{className:m(B.default,d,{[B.noLeftIcon]:!i,[B.noRightIcon]:!t}),ref:h,size:C,variant:s,color:b,...f}),t&&e.jsx(n.TextField.Slot,{children:t}),y&&e.jsx(n.Text,{as:"p",className:B.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${g==null?void 0:g.length}/${f.maxLength}`:`${g==null?void 0:g.length}`})]})}),ln=r.memo(on),an={wrapper:"_wrapper_tmtz0_1"},cn=r.forwardRef(function({className:d,defaultOpen:i=!1,modal:t=!1,content:c,children:o,...u},s){return e.jsxs(n.Popover.Root,{defaultOpen:i,modal:t,children:[e.jsx(n.Popover.Trigger,{children:o}),e.jsx(n.Popover.Content,{ref:s,className:m("overmap-popover",d,an.wrapper),...u,children:c(n.Popover.Close)})]})}),sn=r.memo(cn),O={wrapper:"_wrapper_1mz2e_1",panelContent:"_panelContent_1mz2e_6",left:"_left_1mz2e_14",right:"_right_1mz2e_18",resizable:"_resizable_1mz2e_23",resizeHandle:"_resizeHandle_1mz2e_28",panelMainContent:"_panelMainContent_1mz2e_48"},Ce=200,A=150,dn=r.memo(function({children:d,showLeft:i,leftPanel:t,leftMinWidth:c=Ce,showRight:o,rightPanel:u,rightMinWidth:s=Ce,resizeable:p}){const f=r.useRef(null),h=r.useRef(null),[C,b]=r.useState(0),[y,g]=r.useState(),w=r.useRef(null),[v,P]=r.useState(0),[$,x]=r.useState(),_=r.useCallback((S,D,z)=>(j,me,Se,oe)=>{if(!f.current)return;const K=S+oe.width;z(f.current.clientWidth-K),D(()=>K)},[]),L=r.useCallback((S,D,z,j)=>_(C,b,x)(S,D,z,j),[_,C]),X=r.useCallback((S,D,z,j)=>_(v,P,g)(S,D,z,j),[_,v]),E=r.useCallback((S,D,z,j,me,Se,oe,K)=>{if(!f.current)return;let Q=S;if(Q===0&&(Q=D,z(Q)),Se){const J=f.current.clientWidth-Q;K(J),me>J&&(oe(J),j(f.current.clientWidth-J))}},[]),On=r.useCallback(()=>E(v,s,P,x,C,i,b,g),[E,C,s,v,i]),Dn=r.useCallback(()=>E(C,c,b,g,v,o,P,x),[E,c,C,v,o]),U=r.useCallback((S,D)=>{f.current&&S&&D(f.current.clientWidth)},[]),xn=r.useCallback(()=>U(i,g),[U,i]),zn=r.useCallback(()=>U(o,x),[U,o]),_e=r.useCallback(()=>{var S,D,z,j;f.current&&(g(f.current.clientWidth-(((S=w.current)==null?void 0:S.clientWidth)||0)),x(f.current.clientWidth-(((D=h.current)==null?void 0:D.clientWidth)||0)),b(((z=h.current)==null?void 0:z.clientWidth)||0),P(((j=w.current)==null?void 0:j.clientWidth)||0))},[]);r.useEffect(()=>{if(!f.current)return;const S=new ResizeObserver(_e);return S.observe(f.current),()=>{S.disconnect()}},[_e]);const kn=r.useMemo(()=>({entering:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${C}px)`,marginRight:`-${C}px`,transitionProperty:"transform, margin-right",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[C]),jn=r.useMemo(()=>({entering:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${A}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[v]);return e.jsxs(n.Flex,{className:O.wrapper,style:{minWidth:`${c+s}px`},ref:f,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[e.jsx(le.Transition,{nodeRef:h,timeout:i?0:A,in:i,unmountOnExit:!0,onEntering:Dn,onExited:zn,children:S=>e.jsx(n.Box,{ref:h,className:m(O.panelContent,O.left),style:kn[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Y.Resizable,{className:O.resizable,size:{width:C,height:"100%"},onResizeStop:L,enable:{right:(p==null?void 0:p.left)!==void 0?p.left:!0},minWidth:c,maxWidth:y,handleClasses:{right:m(O.resizeHandle,O.left)},handleComponent:{right:e.jsx(k.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:t})})}),e.jsx(n.Box,{className:O.panelMainContent,width:"max-content",children:d}),e.jsx(le.Transition,{nodeRef:w,timeout:o?0:A,in:o,unmountOnExit:!0,onEntering:On,onExited:xn,children:S=>e.jsx(n.Box,{ref:w,className:m(O.panelContent,O.right),style:jn[S],width:"auto",height:"100%",m:"0",p:"0",children:e.jsx(Y.Resizable,{className:O.resizable,size:{width:v,height:"100%"},onResizeStop:X,enable:{left:(p==null?void 0:p.right)!==void 0?p.right:!0},minWidth:s,maxWidth:$,handleClasses:{left:m(O.resizeHandle,O.right)},handleComponent:{left:e.jsx(k.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:u})})})]})}),un={charCount:"_charCount_17uut_1"},fn=r.forwardRef(function({className:d,showInputLength:i,inputLengthTemplate:t,value:c,severity:o="primary",resize:u,...s},p){const f=T(o),h=T("info"),C=i||i===void 0&&(s.maxLength!==void 0||s.minLength!==void 0),b=c!==void 0?c.toString():"",y=r.useMemo(()=>{if(t){let g=t.replace("{current}",b.length.toString());return s.minLength!==void 0&&(g=g.replace("{min}",s.minLength.toString())),s.maxLength!==void 0&&(g=g.replace("{max}",s.maxLength.toString())),g}return b.length},[t,s.maxLength,s.minLength,b.length]);return e.jsxs(e.Fragment,{children:[e.jsx(n.TextArea,{className:m("overmap-textarea",d),style:{resize:u},ref:p,value:c,color:f,...s}),C&&e.jsx(n.Text,{as:"p",className:un.charCount,color:h,align:"right",children:y})]})}),pn=r.memo(fn),gn=r.forwardRef(function({loop:d,type:i,rovingFocus:t,value:c,onValueChange:o,defaultValue:u,disabled:s,items:p,className:f,direction:h="row",...C},b){return e.jsx(ae.Root,{type:i,className:m("overmap-toggle-group",f),ref:b,value:c,onValueChange:o,disabled:s,orientation:h==="column"?"vertical":"horizontal",loop:d,rovingFocus:t,defaultValue:u,asChild:!0,children:e.jsx(ne,{direction:h,...C,children:p.map(({children:y,...g})=>r.createElement(ae.Item,{asChild:!0,...g,key:g.value},e.jsx(ee,{className:m("overmap-toggle-group-button"),"aria-label":g.value,variant:g.value===c?"solid":"soft",children:y})))})})}),hn=r.memo(gn),be={ToastViewport:"_ToastViewport_t8tlv_1",ToastRoot:"_ToastRoot_t8tlv_20",slideIn:"_slideIn_t8tlv_1",swipeOut:"_swipeOut_t8tlv_1"},Cn=r.forwardRef(function({title:d,description:i,icon:t,severity:c="primary",size:o,onClose:u,sensitivity:s,...p},f){const[h,C]=r.useState(!0),b=T(c),y=r.useCallback(g=>{!g&&u&&u(),C(g)},[u]);return e.jsx(G.Root,{asChild:!0,ref:f,...p,open:h,type:s,onOpenChange:y,children:e.jsx(n.Callout.Root,{className:be.ToastRoot,variant:"surface",color:b,size:o,children:e.jsxs(n.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[e.jsxs(n.Flex,{align:"center",gap:"4",children:[e.jsx(n.Callout.Icon,{children:t||e.jsx(k.InfoCircledIcon,{})}),e.jsxs(n.Flex,{direction:"column",gap:"0",children:[e.jsx(G.Title,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"medium",children:d})}),e.jsx(G.Description,{asChild:!0,children:e.jsx(n.Callout.Text,{weight:"light",children:i})})]})]}),e.jsx(G.Close,{asChild:!0,children:e.jsx(ee,{"aria-label":"Close",variant:"ghost",size:"small",severity:c,children:e.jsx(k.Cross2Icon,{})})})]})})})}),ye=r.memo(Cn),te=r.createContext({}),bn=()=>{const l=r.useContext(te);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},yn=240/60,ve=5e3,vn=l=>{if(l.duration&&l.duration>=ve)return l.duration;const d=l.severity==="danger"?1.5:1,i=l.description.split(" ").length+l.title.split(" ").length;return(ve+i/yn)*d};a.unsafeShowToast=void 0;const wn=r.memo(function({children:d,className:i,hotkey:t,...c}){const[o,u]=r.useState([]),s=r.useCallback((f,h,C)=>{u(b=>{const y=b.find(g=>g.id===f);return y&&h===0&&clearTimeout(y.timeout),b.filter(g=>g.id!==f)}),C&&C()},[]),p=r.useMemo(()=>{let f=0;const h=w=>{const v=vn(w),P=f.toString();f+=1;const $=setTimeout(()=>s(P,1,w.onClose),v);u(x=>[...x,{...w,timeout:$,duration:v,id:P}])},C=w=>h({...w,severity:"primary"}),b=w=>h({...w,severity:"success"}),y=w=>h({...w,severity:"danger"}),g=w=>h({...w,severity:"info"});return a.unsafeShowToast=h,{showToast:h,showPrimary:C,showSuccess:b,showError:y,showInfo:g}},[s]);return r.useEffect(()=>()=>{for(const{timeout:f}of o)clearTimeout(f)},[]),e.jsx(te.Provider,{value:p,children:e.jsxs(Z.ToastProvider,{...c,children:[d,e.jsx(Z.ToastViewport,{className:m(i,be.ToastViewport),hotkey:t}),o.map(({id:f,onClose:h,...C})=>e.jsx(ye,{...C,onClose:()=>s(f,0,h)},f))]})})}),_n={noWrap:"_noWrap_1wpa5_1"},mn=r.memo(r.forwardRef(({className:l,noWrap:d,severity:i,as:t,...c},o)=>{const u=T(i);return e.jsx(n.Text,{ref:o,as:t,className:m(l,{[_n.noWrap]:d}),color:u,...c})})),cr="",Sn=r.memo(r.forwardRef((l,d)=>{const{panelBackground:i="solid",radius:t="full",...c}=l;return e.jsx(n.Theme,{panelBackground:i,radius:t,ref:d,...c})})),Pn={1:"max-content",2:"max-content",3:"max-content",4:"100%"},Tn=r.forwardRef(function({severity:d="info",weight:i="light",gap:t="1",text:c,orientation:o="horizontal",size:u,...s}){const p=I(u,Pn),f=T(d);return e.jsx(e.Fragment,{children:e.jsxs(n.Flex,{width:o==="horizontal"?p:"max-content",height:o==="vertical"?p:"max-content",direction:o==="vertical"?"column":"row",align:"center",gap:t,children:[e.jsx(n.Separator,{size:u,orientation:o,color:f,...s}),c&&e.jsxs(e.Fragment,{children:[e.jsx(n.Text,{as:"span",size:"1",weight:i,color:f,children:c}),e.jsx(n.Separator,{size:u,orientation:o,color:f,...s})]})]})})}),we=r.memo(Tn);Object.defineProperty(a,"AccessibleIcon",{enumerable:!0,get:()=>n.AccessibleIcon}),Object.defineProperty(a,"AspectRatio",{enumerable:!0,get:()=>n.AspectRatio}),Object.defineProperty(a,"Avatar",{enumerable:!0,get:()=>n.Avatar}),Object.defineProperty(a,"Blockquote",{enumerable:!0,get:()=>n.Blockquote}),Object.defineProperty(a,"Box",{enumerable:!0,get:()=>n.Box}),Object.defineProperty(a,"Callout",{enumerable:!0,get:()=>n.Callout}),Object.defineProperty(a,"Card",{enumerable:!0,get:()=>n.Card}),Object.defineProperty(a,"Checkbox",{enumerable:!0,get:()=>n.Checkbox}),Object.defineProperty(a,"Code",{enumerable:!0,get:()=>n.Code}),Object.defineProperty(a,"Container",{enumerable:!0,get:()=>n.Container}),Object.defineProperty(a,"ContextMenu",{enumerable:!0,get:()=>n.ContextMenu}),Object.defineProperty(a,"Em",{enumerable:!0,get:()=>n.Em}),Object.defineProperty(a,"Flex",{enumerable:!0,get:()=>n.Flex}),Object.defineProperty(a,"Grid",{enumerable:!0,get:()=>n.Grid}),Object.defineProperty(a,"Heading",{enumerable:!0,get:()=>n.Heading}),Object.defineProperty(a,"HoverCard",{enumerable:!0,get:()=>n.HoverCard}),Object.defineProperty(a,"Inset",{enumerable:!0,get:()=>n.Inset}),Object.defineProperty(a,"Kbd",{enumerable:!0,get:()=>n.Kbd}),Object.defineProperty(a,"Link",{enumerable:!0,get:()=>n.Link}),Object.defineProperty(a,"Portal",{enumerable:!0,get:()=>n.Portal}),Object.defineProperty(a,"Quote",{enumerable:!0,get:()=>n.Quote}),Object.defineProperty(a,"RadioGroup",{enumerable:!0,get:()=>n.RadioGroup}),Object.defineProperty(a,"ScrollArea",{enumerable:!0,get:()=>n.ScrollArea}),Object.defineProperty(a,"Section",{enumerable:!0,get:()=>n.Section}),Object.defineProperty(a,"Slider",{enumerable:!0,get:()=>n.Slider}),Object.defineProperty(a,"Slot",{enumerable:!0,get:()=>n.Slot}),Object.defineProperty(a,"Strong",{enumerable:!0,get:()=>n.Strong}),Object.defineProperty(a,"Table",{enumerable:!0,get:()=>n.Table}),Object.defineProperty(a,"Tabs",{enumerable:!0,get:()=>n.Tabs}),Object.defineProperty(a,"TextField",{enumerable:!0,get:()=>n.TextField}),Object.defineProperty(a,"Theme",{enumerable:!0,get:()=>n.Theme}),Object.defineProperty(a,"Tooltip",{enumerable:!0,get:()=>n.Tooltip}),Object.defineProperty(a,"VisuallyHidden",{enumerable:!0,get:()=>n.VisuallyHidden}),Object.defineProperty(a,"updateThemeAppearanceClass",{enumerable:!0,get:()=>n.updateThemeAppearanceClass}),Object.defineProperty(a,"useThemeContext",{enumerable:!0,get:()=>n.useThemeContext}),a.AlertDialog=pe,a.AlertDialogContent=re,a.AlertDialogProvider=Ge,a.Badge=ze,a.Button=V,a.ButtonGroup=ne,a.ButtonList=Ee,a.DefaultTheme=Sn,a.Dialog=Le,a.DropdownMenu=Qe,a.IconButton=ee,a.Input=ln,a.LeftAndRightPanels=dn,a.MultiSelect=Ze,a.Popover=sn,a.Select=Ye,a.Separator=we,a.Sidebar=tn,a.Switch=nn,a.Text=mn,a.TextArea=pn,a.Toast=ye,a.ToastContext=te,a.ToastProvider=wn,a.ToggleGroup=hn,a.useAlertDialog=Ve,a.useSeverityColor=T,a.useToast=bn,Object.keys(ie).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>ie[l]})}),Object.keys(k).forEach(l=>{l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:()=>k[l]})}),Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
|
6
6
|
//# sourceMappingURL=blocks.umd.cjs.map
|