@uniformdev/mesh-sdk-react 13.0.1-alpha.133 → 13.0.1-alpha.311

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Rr=Object.getPrototypeOf,kr=Object.prototype.hasOwnProperty;var Ot=t=>ve(t,"__esModule",{value:!0});var Ht=(t,n)=>{for(var r in n)ve(t,r,{get:n[r],enumerable:!0})},k=(t,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Pr(n))!kr.call(t,a)&&(r||a!=="default")&&ve(t,a,{get:()=>n[a],enumerable:!(o=Cr(n,a))||o.enumerable});return t},$=(t,n)=>k(Ot(ve(t!=null?wr(Rr(t)):{},"default",!n&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),xr=(t=>(n,r)=>t&&t.get(n)||(r=k(Ot({}),n,1),t&&t.set(n,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var I={};Ht(I,{Button:()=>v.Button,Callout:()=>v.Callout,DefaultSearchRow:()=>at,DefaultSelectedItem:()=>je,EntrySearch:()=>ht,Heading:()=>v.Heading,Icons:()=>Pe,Input:()=>v.Input,InputSelect:()=>v.InputSelect,InputToggle:()=>v.InputToggle,KeywordSearchInput:()=>v.InputKeywordSearch,LoadingIndicator:()=>v.LoadingIndicator,LoadingOverlay:()=>v.LoadingOverlay,Menu:()=>v.Menu,MenuItem:()=>v.MenuItem,ProductPreviewList:()=>$e,ProductQuery:()=>Dr,ProductQueryContext:()=>He,ProductSearch:()=>qr,ProductSearchContext:()=>It,ProductSearchRow:()=>xt,ProductSelectedItem:()=>Et,ResolvableLoadingValue:()=>Be,ScrollableList:()=>v.ScrollableList,ScrollableListItem:()=>v.ScrollableListItem,SelectionField:()=>Oe,Theme:()=>v.Theme,UniformMeshLocationContext:()=>Te,UniformMeshLocationContextProvider:()=>De,UniformMeshSdkContext:()=>ze,UniformMeshSdkContextProvider:()=>Vr,badgeIcon:()=>Me,draggableContainer:()=>gt,draggableIcon:()=>Le,draggableIconOffset:()=>vt,draggableIconWrapper:()=>ft,entrySearchBtn:()=>st,entrySearchConfig:()=>dt,entrySearchConfigHidden:()=>lt,entrySearchLoadMoreBtn:()=>ct,entrySearchResultList:()=>pt,entrySearchSelectIcon:()=>mt,entrySearchSelectImg:()=>ut,entrySearchSelectInput:()=>Nr,entrySearchSelectOption:()=>_r,entrySearchWrapper:()=>it,productSearchRowActiveIcon:()=>Rt,productSearchRowCategory:()=>Ct,productSearchRowContainer:()=>bt,productSearchRowContent:()=>yt,productSearchRowContentActive:()=>St,productSearchRowDetails:()=>Pt,productSearchRowTitle:()=>wt,productSelectedItemContainer:()=>Lt,productSelectedItemContent:()=>Vt,productSelectedItemDetails:()=>Mt,productSelectedItemImage:()=>Ve,searchRowBtn:()=>ot,searchRowContainer:()=>et,searchRowContainerActive:()=>tt,searchRowPopover:()=>rt,searchRowText:()=>xe,searchRowTextSmall:()=>ke,selectItemLinkBtn:()=>Re,selectItemLinkContainer:()=>Ye,selectItemPopover:()=>Xe,selectItemPopoverLabel:()=>ce,selectItemSmallText:()=>N,selectedItemCloseIcon:()=>Je,selectedItemContainer:()=>Qe,selectedItemCopy:()=>Ze,selectedItemDetails:()=>_e,selectedItemIcon:()=>We,selectedItemInner:()=>Ne,selectedItemTitle:()=>qe,useInitializeUniformMeshSdk:()=>Mr,useProductQueryContext:()=>Fe,useProductSearchContext:()=>de,useUniformMeshLocation:()=>Lr,useUniformMeshLocationContext:()=>Ge,useUniformMeshSdk:()=>Er,useUniformMeshSdkContext:()=>Ue});var e=require("@emotion/react"),M=$(require("react"));var j=require("react"),Te=(0,j.createContext)(void 0),De=({children:t})=>{let[n,r]=(0,j.useState)(),o;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let a=n||window.UniformMeshSDK.getCurrentLocation();o={location:{getValue:a.getValue,getMetadata:a.getMetadata,setValue:async d=>{await a.setValue(d),r(window.UniformMeshSDK.getCurrentLocation())}}}}return(0,e.jsx)(Te.Provider,{value:o},t)},Ge=()=>{let t=(0,j.useContext)(Te);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function Lr(){let{location:t}=Ge();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata()}}var Ft=require("@uniformdev/mesh-sdk"),ie=require("react"),Mr=({autoResizingDisabled:t}={})=>{let[n,r]=(0,ie.useState)(),[o,a]=(0,ie.useState)();return(0,ie.useEffect)(()=>{typeof window=="undefined"||o||(typeof window.UniformMeshSDK=="undefined"?(0,Ft.initializeUniformMeshSDK)({autoResizingDisabled:t}).then(d=>{a(d)}).catch(d=>{r(d)}):a(window.UniformMeshSDK))},[t]),{initializing:!o&&!n,error:n,sdk:o}};var he=require("react");var $t=require("@uniformdev/design-system"),ze=(0,he.createContext)(void 0),Vr=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),(0,e.jsx)(ze.Provider,{value:n},(0,e.jsx)($t.Theme,null),(0,e.jsx)(De,null,t))},Ue=()=>{let t=(0,he.useContext)(ze);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Er(){let{sdk:t}=Ue();return t}var Ke=$(require("react"));var K=$(require("react"));var ee=require("@emotion/react"),Kt=require("@uniformdev/design-system");var Ae=$(require("react")),Be=({value:t,text:n,loading:r})=>(0,e.jsx)(Ae.default.Fragment,null,!!n&&n,!n&&(0,e.jsx)(Ae.default.Fragment,null,r&&`${t} (Loading...)`,!r&&`${t} (Unresolvable)`));var Oe=({name:t,loading:n,selectedValues:r,values:o,onAdd:a,onRemove:d})=>{var h;let f=(h=o==null?void 0:o.filter(m=>!(r!=null&&r.includes(m.id.toString()))))!=null?h:[],b=(m,c)=>{m.preventDefault(),d(c)};return(0,e.jsx)("div",null,(0,e.jsx)(Kt.InputSelect,{id:"product-query",name:"product-query",label:t,onChange:m=>a(m.target.value),disabled:n,options:[{value:"",label:"Add..."},...f.map(m=>({value:m.id,label:m.name||m.id}))],css:Array.isArray(r)&&r.length>0?ee.css`
1
+ var Cr=Object.create;var be=Object.defineProperty;var Pr=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var kr=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty;var Kt=(t,n)=>{for(var o in n)be(t,o,{get:n[o],enumerable:!0})},he=(t,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Rr(n))!xr.call(t,i)&&i!==o&&be(t,i,{get:()=>n[i],enumerable:!(r=Pr(n,i))||r.enumerable});return t},z=(t,n,o)=>(he(t,n,"default"),o&&he(o,n,"default")),K=(t,n,o)=>(o=t!=null?Cr(kr(t)):{},he(n||!t||!t.__esModule?be(o,"default",{value:t,enumerable:!0}):o,t)),Lr=t=>he(be({},"__esModule",{value:!0}),t);var D={};Kt(D,{Button:()=>p.Button,Callout:()=>p.Callout,DefaultSearchRow:()=>dt,DefaultSelectedItem:()=>ot,EntrySearch:()=>wt,Heading:()=>p.Heading,Icons:()=>ke,Input:()=>p.Input,InputSelect:()=>p.InputSelect,InputToggle:()=>p.InputToggle,KeywordSearchInput:()=>p.InputKeywordSearch,LoadingIndicator:()=>p.LoadingIndicator,LoadingOverlay:()=>p.LoadingOverlay,Menu:()=>p.Menu,MenuItem:()=>p.MenuItem,ProductPreviewList:()=>_e,ProductQuery:()=>Gr,ProductQueryContext:()=>Qe,ProductSearch:()=>qr,ProductSearchContext:()=>zt,ProductSearchRow:()=>Et,ProductSelectedItem:()=>Gt,ResolvableLoadingValue:()=>$e,ScrollableList:()=>p.ScrollableList,ScrollableListItem:()=>p.ScrollableListItem,SelectionField:()=>Ke,Textarea:()=>p.Textarea,Theme:()=>p.Theme,UniformMeshLocationContext:()=>Ue,UniformMeshLocationContextProvider:()=>Ae,UniformMeshSdkContext:()=>Oe,UniformMeshSdkContextProvider:()=>Er,badgeIcon:()=>Ee,draggableContainer:()=>bt,draggableIcon:()=>Ve,draggableIconOffset:()=>St,draggableIconWrapper:()=>yt,entrySearchBtn:()=>pt,entrySearchConfig:()=>ut,entrySearchConfigHidden:()=>gt,entrySearchLoadMoreBtn:()=>mt,entrySearchResultList:()=>ft,entrySearchSelectIcon:()=>vt,entrySearchSelectImg:()=>ht,entrySearchSelectInput:()=>_r,entrySearchSelectOption:()=>Zr,entrySearchWrapper:()=>lt,productSearchRowActiveIcon:()=>Mt,productSearchRowCategory:()=>xt,productSearchRowContainer:()=>Ct,productSearchRowContent:()=>Pt,productSearchRowContentActive:()=>Rt,productSearchRowDetails:()=>Lt,productSearchRowTitle:()=>kt,productSelectedItemContainer:()=>Tt,productSelectedItemContent:()=>Dt,productSelectedItemDetails:()=>It,productSelectedItemImage:()=>Te,searchRowBtn:()=>st,searchRowContainer:()=>nt,searchRowContainerActive:()=>at,searchRowPopover:()=>it,searchRowText:()=>Me,searchRowTextSmall:()=>Le,selectItemLinkBtn:()=>xe,selectItemLinkContainer:()=>rt,selectItemPopover:()=>tt,selectItemPopoverLabel:()=>le,selectItemSmallText:()=>_,selectedItemCloseIcon:()=>et,selectedItemContainer:()=>We,selectedItemCopy:()=>Xe,selectedItemDetails:()=>Je,selectedItemIcon:()=>je,selectedItemInner:()=>qe,selectedItemTitle:()=>Ye,useInitializeUniformMeshSdk:()=>Vr,useProductQueryContext:()=>Ne,useProductSearchContext:()=>pe,useUniformMeshLocation:()=>Mr,useUniformMeshLocationContext:()=>Be,useUniformMeshSdk:()=>Tr,useUniformMeshSdkContext:()=>He});module.exports=Lr(D);var e=require("@emotion/react"),V=K(require("react"));var te=require("react"),Ue=(0,te.createContext)(void 0),Ae=({children:t})=>{let[n,o]=(0,te.useState)(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let i=n||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:i.getValue,getMetadata:i.getMetadata,setValue:async d=>{await i.setValue(d),o(window.UniformMeshSDK.getCurrentLocation())}}}}return(0,e.jsx)(Ue.Provider,{value:r},t)},Be=()=>{let t=(0,te.useContext)(Ue);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function Mr(){let{location:t}=Be();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata()}}var Qt=require("@uniformdev/mesh-sdk"),ce=require("react"),Vr=({autoResizingDisabled:t}={})=>{let[n,o]=(0,ce.useState)(),[r,i]=(0,ce.useState)();return(0,ce.useEffect)(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?(0,Qt.initializeUniformMeshSDK)({autoResizingDisabled:t}).then(d=>{i(d)}).catch(d=>{o(d)}):i(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};var ye=require("react");var Nt=require("@uniformdev/design-system"),Oe=(0,ye.createContext)(void 0),Er=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),(0,e.jsx)(Oe.Provider,{value:n},(0,e.jsx)(Nt.Theme,null),(0,e.jsx)(Ae,null,t))},He=()=>{let t=(0,ye.useContext)(Oe);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Tr(){let{sdk:t}=He();return t}var Ze=K(require("react"));var Q=K(require("react"));var re=require("@emotion/react"),_t=require("@uniformdev/design-system");var Fe=K(require("react")),$e=({value:t,text:n,loading:o})=>(0,e.jsx)(Fe.default.Fragment,null,!!n&&n,!n&&(0,e.jsx)(Fe.default.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Ke=({id:t,label:n,loading:o,selectedValues:r,values:i,onAdd:d,onRemove:m})=>{var b;let g=(b=i==null?void 0:i.filter(s=>!(r!=null&&r.includes(s.id.toString()))))!=null?b:[],f=(s,v)=>{s.preventDefault(),m(v)};return(0,e.jsx)("div",null,(0,e.jsx)(_t.InputSelect,{id:t,name:t,label:n,onChange:s=>d(s.target.value),disabled:o,options:[{value:"",label:"Add..."},...g.map(s=>({value:s.id,label:s.name||s.id}))],css:Array.isArray(r)&&r.length>0?re.css`
2
2
  margin-bottom: var(--spacing-base);
3
- `:""}),r==null?void 0:r.map(m=>{var c;return(0,e.jsx)("div",{css:ee.css`
3
+ `:""}),r==null?void 0:r.map(s=>{var v;return(0,e.jsx)("div",{css:re.css`
4
4
  font-size: var(--fs-sm);
5
5
  display: inline-flex;
6
6
  align-items: center;
@@ -9,67 +9,67 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
9
9
  border: 1px solid var(--gray-300);
10
10
  margin-bottom: var(--spacing-sm);
11
11
  margin-right: var(--spacing-sm);
12
- `,key:m},(0,e.jsx)("span",{css:ee.css`
12
+ `,key:s},(0,e.jsx)("span",{css:re.css`
13
13
  padding: var(--spacing-3);
14
14
  color: var(--gray-800);
15
- `},(0,e.jsx)(Be,{value:m,loading:n,text:(c=o.find(u=>u.id===m))==null?void 0:c.name})),(0,e.jsx)("button",{css:ee.css`
15
+ `},(0,e.jsx)($e,{value:s,loading:o,text:(v=i.find(C=>C.id===s))==null?void 0:v.name})),(0,e.jsx)("button",{css:re.css`
16
16
  padding: var(--spacing-3);
17
17
  border-left: 1px solid var(--gray-300);
18
- `,title:"remove",onClick:u=>b(u,m)},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",css:ee.css`
18
+ `,title:"remove",onClick:C=>f(C,s)},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",css:re.css`
19
19
  height: 1.25rem;
20
20
  width: 1.25rem;
21
21
  pointer-events: none;
22
22
  display: block;
23
- `,viewBox:"0 0 20 20",fill:"currentColor"},(0,e.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var Ir=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})),be=Ir;var Tr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),ye=Tr;var Se=require("react-use"),V=require("@uniformdev/design-system"),C=require("@emotion/react"),Qt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Dr=({value:t,setValue:n,brands:r,categories:o,loading:a,categoriesLoading:d,brandsLoading:f,logoIcon:b,onGetProducts:h,sortOptions:m,sortOrderOptions:c})=>{var U;let u=async s=>{n({...Qt,...t||{},...s})},g=(0,K.useMemo)(()=>({...Qt,...t||{}}),[t]),[J,T]=(0,Se.useAsyncFn)(async s=>await h(s),[h]);(0,Se.useDebounce)(async()=>{await T({brand:g.brand,categories:g.categories,keyword:g.keyword,sort:g.sort,sortOrder:g.sortOrder,count:g.count})},250,[g]);let X=(0,K.useMemo)(()=>{let s=[];return o==null||o.forEach(p=>{let A=_t(p,void 0);s.push(...A)}),s},[o]),H=(0,K.useMemo)(()=>(r==null?void 0:r.map(s=>({id:s.id.toString(),name:s.name})))||[],[r]),F=s=>{let p=(t==null?void 0:t.categories)||[];u({categories:[...p,s]})},q=s=>{var p;u({categories:(p=t==null?void 0:t.categories)==null?void 0:p.filter(A=>A!==s)})},me=s=>{u({brand:s.target.value})},z=s=>{u({count:s||1})};return a?(0,e.jsx)("div",null,"Loading..."):(0,e.jsx)(He.Provider,{value:{categories:o,logoIcon:b}},(0,e.jsx)("div",{css:C.css`
23
+ `,viewBox:"0 0 20 20",fill:"currentColor"},(0,e.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var Ir=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})),Se=Ir;var Dr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),we=Dr;var Ce=require("react-use"),E=require("@uniformdev/design-system"),P=require("@emotion/react"),Zt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Gr=({value:t,setValue:n,brands:o,categories:r,loading:i,categoriesLoading:d,brandsLoading:m,logoIcon:g,onGetProducts:f,sortOptions:b,sortOrderOptions:s,categoryLabel:v="Product Category",brandLabel:C="Brand",disableBrands:X})=>{var G;let k=async a=>{n({...Zt,...t||{},...a})},h=(0,Q.useMemo)(()=>({...Zt,...t||{}}),[t]),[ie,Y]=(0,Ce.useAsyncFn)(async a=>await f(a),[f]);(0,Ce.useDebounce)(async()=>{await Y({brand:h.brand,categories:h.categories,keyword:h.keyword,sort:h.sort,sortOrder:h.sortOrder,count:h.count})},250,[h]);let q=(0,Q.useMemo)(()=>{let a=[];return r==null||r.forEach(S=>{let B=qt(S,void 0);a.push(...B)}),a},[r]),F=(0,Q.useMemo)(()=>(o==null?void 0:o.map(a=>({id:a.id.toString(),name:a.name})))||[],[o]),$=a=>{let S=(t==null?void 0:t.categories)||[];k({categories:[...S,a]})},ue=a=>{var S;k({categories:(S=t==null?void 0:t.categories)==null?void 0:S.filter(B=>B!==a)})},j=a=>{k({brand:a.target.value})},U=a=>{k({count:a||1})};return i?(0,e.jsx)("div",null,"Loading..."):(0,e.jsx)(Qe.Provider,{value:{categories:r,logoIcon:g}},(0,e.jsx)("div",{css:P.css`
24
24
  > :not(:last-child) {
25
25
  margin-bottom: var(--spacing-md);
26
26
  }
27
- `},(0,e.jsx)(Oe,{loading:d||!1,name:"Product Category",onAdd:F,onRemove:q,selectedValues:g.categories,values:X}),(0,e.jsx)("div",{css:C.css`
27
+ `},(0,e.jsx)(Ke,{loading:d||!1,id:"selection-field-product-category",label:v,onAdd:$,onRemove:ue,selectedValues:h.categories,values:q}),(0,e.jsx)("div",{css:P.css`
28
28
  display: flex;
29
29
  flex-wrap: wrap;
30
30
  column-gap: var(--spacing-lg);
31
31
  row-gap: var(--spacing-md);
32
- ${(0,V.mq)("md")} {
32
+ ${(0,E.mq)("md")} {
33
33
  flex-wrap: nowrap;
34
34
  }
35
- `},(0,e.jsx)("div",{css:C.css`
36
- width: 50%;
37
- flex-grow: 1;
38
- `},(0,e.jsx)(V.InputSelect,{id:"brand",name:"brand",label:"Brand",disabled:f,value:g.brand,onChange:me,options:[{value:"",label:"Select a brand"},...H.map(s=>({value:s.id,label:s.name}))]})),(0,e.jsx)("div",{css:C.css`
35
+ `},X?null:(0,e.jsx)("div",{css:P.css`
36
+ width: 50%;
37
+ `},(0,e.jsx)(E.InputSelect,{id:"brand",name:"brand",label:C,disabled:m,value:h.brand,onChange:j,options:[{value:"",label:"Choose..."},...F.map(a=>({value:a.id,label:a.name}))]})),(0,e.jsx)("div",{css:P.css`
39
38
  flex-grow: 1;
40
39
  position: relative;
41
- `},(0,e.jsx)(V.Input,{id:"count",name:"count",type:"number",min:1,step:1,value:g.count,onChange:s=>z(s.target.valueAsNumber),label:"Count"}),(0,e.jsx)("div",{css:C.css`
42
- position: absolute;
43
- bottom: var(--spacing-sm);
44
- right: var(--spacing-sm);
45
- display: flex;
46
- gap: var(--spacing-sm);
47
- `},(0,e.jsx)(Nt,{onCountChange:()=>z(g.count-1),countIcon:"decrement",disabled:g.count===1}),(0,e.jsx)(Nt,{onCountChange:()=>z(g.count+1),countIcon:"increment"})))),(0,e.jsx)("div",{css:C.css`
40
+ `},(0,e.jsx)(E.Input,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:h.keyword,placeholder:"Enter keyword",onChange:a=>k({keyword:a.target.value})}))),(0,e.jsx)("div",{css:P.css`
48
41
  display: flex;
49
42
  flex-wrap: wrap;
50
43
  column-gap: var(--spacing-lg);
51
44
  row-gap: var(--spacing-md);
52
- ${(0,V.mq)("md")} {
45
+ ${(0,E.mq)("md")} {
53
46
  flex-wrap: nowrap;
54
47
  }
55
- `},(0,e.jsx)("div",{css:C.css`
48
+ `},(0,e.jsx)("div",{css:P.css`
56
49
  width: 100%;
57
- ${(0,V.mq)("md")} {
50
+ ${(0,E.mq)("md")} {
58
51
  width: 33.333333%;
59
52
  }
60
- `},(0,e.jsx)(V.Input,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:g.keyword,placeholder:"Enter keyword",onChange:s=>u({keyword:s.target.value})})),Array.isArray(m)&&m.length>0?(0,e.jsx)("div",{css:C.css`
53
+ position: relative;
54
+ `},(0,e.jsx)(E.Input,{id:"count",name:"count",type:"number",min:1,step:1,value:h.count,onChange:a=>U(a.target.valueAsNumber),label:"Count"}),(0,e.jsx)("div",{css:P.css`
55
+ position: absolute;
56
+ bottom: var(--spacing-sm);
57
+ right: var(--spacing-sm);
58
+ display: flex;
59
+ gap: var(--spacing-sm);
60
+ `},(0,e.jsx)(Wt,{onCountChange:()=>U(h.count-1),countIcon:"decrement",disabled:h.count===1}),(0,e.jsx)(Wt,{onCountChange:()=>U(h.count+1),countIcon:"increment"}))),Array.isArray(b)&&b.length>0?(0,e.jsx)("div",{css:P.css`
61
61
  flex-grow: 1;
62
- ${(0,V.mq)("md")} {
62
+ ${(0,E.mq)("md")} {
63
63
  width: 33.333333%;
64
64
  }
65
- `},(0,e.jsx)(V.InputSelect,{id:"sort",name:"sort",label:"Sort",value:g.sort,onChange:s=>u({sort:s.target.value}),options:[{value:"",label:"Select a sort"},...m.map(s=>({value:s.sortKey,label:s.name}))]})):null,Array.isArray(c)&&c.length>0?(0,e.jsx)("div",{css:C.css`
65
+ `},(0,e.jsx)(E.InputSelect,{id:"sort",name:"sort",label:"Sort",value:h.sort,onChange:a=>k({sort:a.target.value}),options:[{value:"",label:"Select a sort"},...b.map(a=>({value:a.sortKey,label:a.name}))]})):null,Array.isArray(s)&&s.length>0?(0,e.jsx)("div",{css:P.css`
66
66
  flex-grow: 1;
67
- `},(0,e.jsx)(V.InputSelect,{id:"sort-order",name:"sort-order",label:"Sort Order",value:g.sortOrder,onChange:s=>u({sortOrder:s.target.value}),options:c.map(s=>({value:s.sortOrderKey,label:s.name}))})):null),(0,e.jsx)("div",null,(0,e.jsx)("h3",{css:C.css`
67
+ `},(0,e.jsx)(E.InputSelect,{id:"sort-order",name:"sort-order",label:"Sort Order",value:h.sortOrder,onChange:a=>k({sortOrder:a.target.value}),options:s.map(a=>({value:a.sortOrderKey,label:a.name}))})):null),(0,e.jsx)("div",null,(0,e.jsx)("h3",{css:P.css`
68
68
  font-size: var(--fs-md);
69
69
  line-height: var(--spacing-md);
70
70
  font-weight: var(--fw-bold);
71
71
  margin-bottom: var(--spacing-xs);
72
- `},"Result Preview"),(0,e.jsx)($e,{products:(U=J.value)==null?void 0:U.products}))))};function _t(t,n){var d;let r=[],o=n?`${n.name} > `:"",a={id:t.id.toString(),name:`${o}${t.name}`};return r.push(a),(d=t.children)==null||d.forEach(f=>{let b=_t(f,a);r.push(...b)}),r}function Nt({onCountChange:t,countIcon:n,disabled:r}){return(0,e.jsx)("button",{css:C.css`
72
+ `},"Result Preview"),(0,e.jsx)(_e,{products:(G=ie.value)==null?void 0:G.products}))))};function qt(t,n){var d;let o=[],r=n?`${n.name} > `:"",i={id:t.id.toString(),name:`${r}${t.name}`};return o.push(i),(d=t.children)==null||d.forEach(m=>{let g=qt(m,i);o.push(...g)}),o}function Wt({onCountChange:t,countIcon:n,disabled:o}){return(0,e.jsx)("button",{css:P.css`
73
73
  width: 2.25rem;
74
74
  height: 2.25rem;
75
75
  border: 1px solid var(--gray-300);
@@ -81,58 +81,58 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
81
81
  &:hover {
82
82
  background-color: var(--gray-200);
83
83
  }
84
- ${r?C.css`
84
+ ${o?P.css`
85
85
  cursor: not-allowed;
86
86
  opacity: 0.3;
87
87
  `:""}
88
- `,onClick:t,disabled:r},n==="increment"?(0,e.jsx)(be,{css:C.css`
88
+ `,onClick:t,disabled:o},n==="increment"?(0,e.jsx)(Se,{css:P.css`
89
89
  width: 1rem;
90
90
  height: 1rem;
91
- `}):(0,e.jsx)(ye,{css:C.css`
91
+ `}):(0,e.jsx)(we,{css:P.css`
92
92
  width: 1rem;
93
93
  height: 1rem;
94
- `}))}var He=K.default.createContext(void 0),Fe=()=>{let t=(0,K.useContext)(He);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function Q({src:t,alt:n,className:r}){let o=t&&typeof t!="string"?t:null;return o?(0,e.jsx)(o,{className:r}):(0,e.jsx)("img",{src:t,alt:n,className:r})}var P=require("@emotion/react"),Zt=require("@uniformdev/design-system"),$e=({products:t})=>{let{categories:n,logoIcon:r}=Fe();return(0,e.jsx)(Ke.default.Fragment,null,(0,e.jsx)("p",{css:P.css`
94
+ `}))}var Qe=Q.default.createContext(void 0),Ne=()=>{let t=(0,Q.useContext)(Qe);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function N({src:t,alt:n,className:o}){let r=t&&typeof t!="string"?t:null;return r?(0,e.jsx)(r,{className:o}):(0,e.jsx)("img",{src:t,alt:n,className:o})}var R=require("@emotion/react"),Jt=require("@uniformdev/design-system"),_e=({products:t})=>{let{categories:n,logoIcon:o}=Ne();return(0,e.jsx)(Ze.default.Fragment,null,(0,e.jsx)("p",{css:R.css`
95
95
  margin-bottom: var(--spacing-base);
96
- `},"Matching ",(t==null?void 0:t.length)||0," products"),(0,e.jsx)("ul",{css:[P.css`
96
+ `},"Matching ",(t==null?void 0:t.length)||0," products"),(0,e.jsx)("ul",{css:[R.css`
97
97
  max-height: 24rem;
98
98
  overflow-x: auto;
99
- `,Zt.scrollbarStyles]},t==null?void 0:t.map((o,a)=>{var b;let[d]=(o==null?void 0:o.categories)||[],f=typeof d=="undefined"||!n||(b=n.find(h=>h.id===d.id))==null?void 0:b.name;return(0,e.jsx)("li",{key:`product-${o.id}`,css:P.css`
99
+ `,Jt.scrollbarStyles]},t==null?void 0:t.map((r,i)=>{var g;let[d]=(r==null?void 0:r.categories)||[],m=typeof d=="undefined"||!n||(g=n.find(f=>f.id===d.id))==null?void 0:g.name;return(0,e.jsx)("li",{key:`product-${r.id}`,css:R.css`
100
100
  border: 1px solid var(--gray-300);
101
101
  border-radius: var(--rounded-md);
102
102
  background-color: var(--gray-100);
103
103
  margin: var(--spacing-base) 0;
104
- `},(0,e.jsx)("div",{css:P.css`
104
+ `},(0,e.jsx)("div",{css:R.css`
105
105
  padding: var(--spacing-sm);
106
106
  display: flex;
107
107
  flex-grow: 1;
108
108
  margin-right: var(--spacing-sm);
109
109
  gap: var(--spacing-base);
110
110
  align-items: center;
111
- `},o.thumbnailUrl?(0,e.jsx)("img",{src:o.thumbnailUrl,alt:o.name||`Product ${a}`,css:P.css`
111
+ `},r.thumbnailUrl?(0,e.jsx)("img",{src:r.thumbnailUrl,alt:r.name||`Product ${i}`,css:R.css`
112
112
  background-color: var(--gray-200);
113
113
  width: 3.5rem;
114
114
  height: 3.5rem;
115
115
  object-fit: cover;
116
- `}):(0,e.jsx)("div",{css:P.css`
116
+ `}):(0,e.jsx)("div",{css:R.css`
117
117
  height: 3.5rem;
118
118
  width: 3.5rem;
119
119
  background-color: var(--gray-100);
120
- `}),(0,e.jsx)("h4",{css:P.css`
120
+ `}),(0,e.jsx)("h4",{css:R.css`
121
121
  font-weight: var(--fw-bold);
122
122
  width: 33.333333%;
123
123
  font-size: var(--fs-sm);
124
- `},o.name,f&&(0,e.jsx)("span",{css:P.css`
124
+ `},r.name,m&&(0,e.jsx)("span",{css:R.css`
125
125
  display: block;
126
126
  font-weight: var(--fw-regular);
127
- `},f)),o&&(0,e.jsx)(Ke.default.Fragment,null,(0,e.jsx)("p",{css:P.css`
127
+ `},m)),r&&(0,e.jsx)(Ze.default.Fragment,null,(0,e.jsx)("p",{css:R.css`
128
128
  margin-right: var(--spacing-lg);
129
129
  font-size: var(--fs-sm);
130
- `},"SKU: ",o.sku," ",o.id,(0,e.jsx)("br",null)),o.price&&(0,e.jsx)("p",{css:P.css`
130
+ `},"SKU: ",r.sku," ",r.id,(0,e.jsx)("br",null)),r.price&&(0,e.jsx)("p",{css:R.css`
131
131
  margin-right: var(--spacing-lg);
132
132
  font-size: var(--fs-sm);
133
- `},o.price&&(0,e.jsx)("span",{css:P.css`
133
+ `},r.price&&(0,e.jsx)("span",{css:R.css`
134
134
  display: block;
135
- `},"Price: ",o.price)),(0,e.jsx)("a",{css:P.css`
135
+ `},"Price: ",r.price)),(0,e.jsx)("a",{css:R.css`
136
136
  display: inline-flex;
137
137
  justify-content: space-between;
138
138
  align-items: center;
@@ -144,19 +144,19 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
144
144
  &:hover {
145
145
  background-color: var(--gray-100);
146
146
  }
147
- `,href:o.url,title:`Goto ${o.name}`,target:"__blank",rel:"noopener"},(0,e.jsx)("span",{css:P.css`
147
+ `,href:r.url,title:`Goto ${r.name}`,target:"__blank",rel:"noopener"},(0,e.jsx)("span",{css:R.css`
148
148
  font-size: var(--fs-sm);
149
149
  margin-right: var(--spacing-sm);
150
- `},"Edit"),r?(0,e.jsx)(Q,{src:r,alt:"Logo",css:P.css`
150
+ `},"Edit"),o?(0,e.jsx)(N,{src:o,alt:"Logo",css:R.css`
151
151
  width: 2.25rem;
152
152
  height: 2.25rem;
153
- `}):null))))})))};var Z=$(require("react"));var G=$(require("react"));var Pe={};Ht(Pe,{Caution:()=>qt,Checkmark:()=>we,ChevronDown:()=>Ce,Close:()=>te,Danger:()=>Wt,ExclamationPoint:()=>Jt,Info:()=>re,Lightbulb:()=>Xt,MagnifyingGlass:()=>Yt,MaximizeAlt:()=>jt,Minus:()=>ye,MoreVerticalAlt:()=>se,Plus:()=>be});var Gr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),qt=Gr;var zr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),we=zr;var Ur=t=>(0,e.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},(0,e.jsx)("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),Ce=Ur;var Ar=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},(0,e.jsx)("g",{fillRule:"evenodd"},(0,e.jsx)("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),(0,e.jsx)("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),te=Ar;var Br=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),Wt=Br;var Or=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),Jt=Or;var Hr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),re=Hr;var Fr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),Xt=Fr;var $r=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("g",{clipPath:"url(#magnifying-glass_svg__a)"},(0,e.jsx)("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),(0,e.jsx)("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),(0,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"magnifying-glass_svg__a"},(0,e.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),Yt=$r;var Kr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),jt=Kr;var Qr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),se=Qr;var or=require("react-use"),nr=require("uuid");var B=$(require("react"));function er(t,n){let r=window.open(t,"_blank"),o=setInterval(()=>{r!=null&&r.closed&&(clearInterval(o),n())},500)}var rr=require("timeago.js");var x=require("@emotion/react"),tr=require("@uniformdev/design-system"),Qe=x.css`
153
+ `}):null))))})))};var W=K(require("react"));var I=K(require("react"));var ke={};Kt(ke,{Caution:()=>Xt,Checkmark:()=>Pe,ChevronDown:()=>Re,Close:()=>oe,Danger:()=>Yt,ExclamationPoint:()=>jt,Info:()=>ne,Lightbulb:()=>er,MagnifyingGlass:()=>tr,MaximizeAlt:()=>rr,Minus:()=>we,MoreVerticalAlt:()=>de,Plus:()=>Se});var zr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),Xt=zr;var Ur=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),Pe=Ur;var Ar=t=>(0,e.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},(0,e.jsx)("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),Re=Ar;var Br=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},(0,e.jsx)("g",{fillRule:"evenodd"},(0,e.jsx)("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),(0,e.jsx)("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),oe=Br;var Or=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),Yt=Or;var Hr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),jt=Hr;var Fr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),ne=Fr;var $r=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),er=$r;var Kr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("g",{clipPath:"url(#magnifying-glass_svg__a)"},(0,e.jsx)("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),(0,e.jsx)("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),(0,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"magnifying-glass_svg__a"},(0,e.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),tr=Kr;var Qr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),rr=Qr;var Nr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),de=Nr;var ir=require("react-use"),sr=require("uuid");var O=K(require("react"));function or(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}var ar=require("timeago.js");var L=require("@emotion/react"),nr=require("@uniformdev/design-system"),We=L.css`
154
154
  border: 1px solid var(--gray-200);
155
155
  background: var(--gray-50);
156
156
  border-radius: var(--rounded-base);
157
157
  display: flex;
158
158
  width: 100%;
159
- `,Ne=x.css`
159
+ `,qe=L.css`
160
160
  align-items: center;
161
161
  display: flex;
162
162
  flex-grow: 1;
@@ -164,24 +164,24 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
164
164
  margin-inline: 0 var(--spacing-sm);
165
165
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
166
166
  position: relative;
167
- `,_e=x.css`
167
+ `,Je=L.css`
168
168
  flex-grow: 1;
169
- `,Ze=x.css`
169
+ `,Xe=L.css`
170
170
  align-items: start;
171
171
  display: inline-flex;
172
172
  position: relative;
173
- `,qe=x.css`
173
+ `,Ye=L.css`
174
174
  color: var(--brand-secondary-1);
175
175
  font-size: var(--fs-base);
176
176
  font-weight: var(--fw-bold);
177
177
  line-height: 1;
178
- `,We=x.css`
178
+ `,je=L.css`
179
179
  width: 1.5rem;
180
180
  height: 1.5rem;
181
- `,Je=x.css`
181
+ `,et=L.css`
182
182
  width: 1rem;
183
183
  height: 1rem;
184
- `,Xe=x.css`
184
+ `,tt=L.css`
185
185
  background: var(--white);
186
186
  border-radius: var(--rounded-base);
187
187
  border-left: 4px solid var(--brand-secondary-3);
@@ -189,20 +189,20 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
189
189
  padding: var(--spacing-base);
190
190
  z-index: var(--z-10);
191
191
  width: max-content;
192
- `,N=x.css`
192
+ `,_=L.css`
193
193
  font-size: var(--fs-sm);
194
- `,ce=x.css`
194
+ `,le=L.css`
195
195
  font-weight: var(--fw-bold);
196
196
  margin-right: var(--spacing-sm);
197
- `,Ye=x.css`
197
+ `,rt=L.css`
198
198
  display: flex;
199
199
  flex-direction: column;
200
200
  gap: var(--spacing-sm);
201
201
 
202
- ${(0,tr.mq)("md")} {
202
+ ${(0,nr.mq)("md")} {
203
203
  flex-direction: row;
204
204
  }
205
- `,Re=x.css`
205
+ `,xe=L.css`
206
206
  align-items: center;
207
207
  background: var(--white);
208
208
  border-radius: var(--rounded-base);
@@ -215,40 +215,40 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
215
215
  &:hover {
216
216
  background: var(--gray-50);
217
217
  }
218
- `;var D=require("@emotion/react");var je=({selectedItem:t,logoIcon:n,onDeselect:r,onEditClosed:o})=>{var m;let a=(0,B.useRef)(null),d=(0,B.useRef)(null),[f,b]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let c=g=>{a.current&&!a.current.contains(g.target)&&d.current&&!d.current.contains(g.target)&&b(!1)},u=()=>{b(!1)};return window.addEventListener("resize",u,!0),document.addEventListener("scroll",c,!0),document.addEventListener("mousedown",c),()=>{window.removeEventListener("resize",u,!0),document.removeEventListener("scroll",c,!0),document.removeEventListener("mousedown",c)}},[d]);let h=()=>{var c;if(b(!f),d.current&&a.current){let u=(c=a==null?void 0:a.current)==null?void 0:c.getBoundingClientRect();d.current.style.top=`${u.top+30}px`}};return(0,e.jsx)("div",{css:Qe,key:t.id},(0,e.jsx)("div",{css:Ne},(0,e.jsx)("div",{css:_e},(0,e.jsx)("div",{css:Ze},(0,e.jsx)("h4",{css:[qe,t.popoverData?D.css`
218
+ `;var A=require("@emotion/react");var ot=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var b;let i=(0,O.useRef)(null),d=(0,O.useRef)(null),[m,g]=(0,O.useState)(!1);(0,O.useEffect)(()=>{let s=C=>{i.current&&!i.current.contains(C.target)&&d.current&&!d.current.contains(C.target)&&g(!1)},v=()=>{g(!1)};return window.addEventListener("resize",v,!0),document.addEventListener("scroll",s,!0),document.addEventListener("mousedown",s),()=>{window.removeEventListener("resize",v,!0),document.removeEventListener("scroll",s,!0),document.removeEventListener("mousedown",s)}},[d]);let f=()=>{var s;if(g(!m),d.current&&i.current){let v=(s=i==null?void 0:i.current)==null?void 0:s.getBoundingClientRect();d.current.style.top=`${v.top+30}px`}};return(0,e.jsx)("div",{css:We,key:t.id},(0,e.jsx)("div",{css:qe},(0,e.jsx)("div",{css:Je},(0,e.jsx)("div",{css:Xe},(0,e.jsx)("h4",{css:[Ye,t.popoverData?A.css`
219
219
  margin-bottom: var(--spacing-sm);
220
- `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?(0,e.jsx)(B.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:a,css:D.css`
220
+ `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?(0,e.jsx)(O.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:i,css:A.css`
221
221
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
222
- `,"aria-controls":"path-details","aria-expanded":f,onClick:h},(0,e.jsx)(re,{width:24,height:24,css:D.css`
222
+ `,"aria-controls":"path-details","aria-expanded":m,onClick:f},(0,e.jsx)(ne,{width:24,height:24,css:A.css`
223
223
  color: var(--gray-400);
224
- `})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!f,ref:d,css:[Xe,f?D.css`
224
+ `})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!m,ref:d,css:[tt,m?A.css`
225
225
  visibility: visible;
226
- `:D.css`
226
+ `:A.css`
227
227
  visibility: hidden;
228
- `]},Object.entries(t.popoverData).map(([c,u],g)=>(0,e.jsx)("div",{css:N,key:g},(0,e.jsx)("span",{css:ce},c,":"),u)))):null),t.createdDate&&(0,e.jsx)("div",{css:N},(0,e.jsx)("span",{css:ce},"Created:"),(0,rr.format)((m=t.createdDate)!=null?m:0)),(0,e.jsx)("div",{css:D.css`
228
+ `]},Object.entries(t.popoverData).map(([s,v],C)=>(0,e.jsx)("div",{css:_,key:C},(0,e.jsx)("span",{css:le},s,":"),v)))):null),t.createdDate&&(0,e.jsx)("div",{css:_},(0,e.jsx)("span",{css:le},"Created:"),(0,ar.format)((b=t.createdDate)!=null?b:0)),(0,e.jsx)("div",{css:A.css`
229
229
  display: flex;
230
230
  gap: var(--spacing-base);
231
- `},t.metadata?Object.entries(t.metadata).filter(([c])=>["type","status"].includes(c.toLocaleLowerCase())).map(([c,u])=>(0,e.jsx)("span",{css:N,key:c},u)):null),t.metadata?Object.entries(t.metadata).filter(([c])=>!["type","status"].includes(c.toLocaleLowerCase())).map(([c,u])=>(0,e.jsx)("div",{css:[N,D.css`
231
+ `},t.metadata?Object.entries(t.metadata).filter(([s])=>["type","status"].includes(s.toLocaleLowerCase())).map(([s,v])=>(0,e.jsx)("span",{css:_,key:s},v)):null),t.metadata?Object.entries(t.metadata).filter(([s])=>!["type","status"].includes(s.toLocaleLowerCase())).map(([s,v])=>(0,e.jsx)("div",{css:[_,A.css`
232
232
  order: 1;
233
- `],key:c},(0,e.jsx)("span",{css:[ce,D.css`
233
+ `],key:s},(0,e.jsx)("span",{css:[le,A.css`
234
234
  order: 1;
235
- `]},c,":"),u)):null),(0,e.jsx)("div",{css:Ye},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:c=>{o&&(er(c.currentTarget.href,()=>o(t)),c.preventDefault())},css:Re},(0,e.jsx)("span",{css:N},"Edit"),(0,e.jsx)(Q,{src:n,css:We,alt:"Logo"})):null,(0,e.jsx)("button",{type:"button",onClick:c=>{c.preventDefault(),r(t)},css:Re},(0,e.jsx)("span",{css:N},"Unlink"),(0,e.jsx)(te,{css:[Je,D.css`
235
+ `]},s,":"),v)):null),(0,e.jsx)("div",{css:rt},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:s=>{r&&(or(s.currentTarget.href,()=>r(t)),s.preventDefault())},css:xe},(0,e.jsx)("span",{css:_},"Edit"),(0,e.jsx)(N,{src:n,css:je,alt:"Logo"})):null,(0,e.jsx)("button",{type:"button",onClick:s=>{s.preventDefault(),o(t)},css:xe},(0,e.jsx)("span",{css:_},"Unlink"),(0,e.jsx)(oe,{css:[et,A.css`
236
236
  color: var(--brand-secondary-5);
237
- `]})))))};var O=$(require("react"));var W=require("@emotion/react"),et=W.css`
237
+ `]})))))};var H=K(require("react"));var J=require("@emotion/react"),nt=J.css`
238
238
  cursor: pointer;
239
239
  padding: var(--spacing-sm);
240
240
  position: relative;
241
241
  transition: background-color var(--duration-fast) var(--timing-ease-out),
242
242
  color var(--duration-fast) var(--timing-ease-out);
243
- `,tt=W.css`
243
+ `,at=J.css`
244
244
  background: var(--brand-secondary-3);
245
245
  color: var(--white);
246
- `,ke=W.css`
246
+ `,Le=J.css`
247
247
  font-size: var(--fs-xs);
248
- `,xe=W.css`
248
+ `,Me=J.css`
249
249
  font-weight: var(--fw-bold);
250
250
  margin-right: var(--spacing-sm);
251
- `,rt=W.css`
251
+ `,it=J.css`
252
252
  background: var(--white);
253
253
  border-left: 4px solid var(--brand-secondary-3);
254
254
  border-radius: var(--rounded-base);
@@ -260,20 +260,20 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
260
260
  right: var(--spacing-xl);
261
261
  z-index: var(--z-10);
262
262
  width: max-content;
263
- `,ot=W.css`
263
+ `,st=J.css`
264
264
  position: absolute;
265
265
  inset: 0 var(--spacing-sm) 0 auto;
266
- `;var nt=require("@emotion/react"),at=({result:t,isSelected:n,triggerSelection:r})=>{let o=(0,O.useRef)(null),a=(0,O.useRef)(null),[d,f]=(0,O.useState)(!1);(0,O.useEffect)(()=>{function h(m){o.current&&!o.current.contains(m.target)&&a.current&&!a.current.contains(m.target)&&f(!1)}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[a]);let b=h=>{h.stopPropagation(),f(!d)};return(0,e.jsx)("div",{key:t.id,css:[et,n?tt:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>r()},t.title,t.popoverData&&n?(0,e.jsx)(O.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:o,css:ot,"aria-controls":"path-details",onClick:h=>b(h),"aria-expanded":d},(0,e.jsx)(re,{width:24,height:24})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!d,ref:a,css:[rt,d?nt.css`
266
+ `;var ct=require("@emotion/react"),dt=({result:t,isSelected:n,triggerSelection:o})=>{let r=(0,H.useRef)(null),i=(0,H.useRef)(null),[d,m]=(0,H.useState)(!1);(0,H.useEffect)(()=>{function f(b){r.current&&!r.current.contains(b.target)&&i.current&&!i.current.contains(b.target)&&m(!1)}return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[i]);let g=f=>{f.stopPropagation(),m(!d)};return(0,e.jsx)("div",{key:t.id,css:[nt,n?at:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?(0,e.jsx)(H.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:r,css:st,"aria-controls":"path-details",onClick:f=>g(f),"aria-expanded":d},(0,e.jsx)(ne,{width:24,height:24})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!d,ref:i,css:[it,d?ct.css`
267
267
  visibility: visible;
268
- `:nt.css`
268
+ `:ct.css`
269
269
  visibility: hidden;
270
- `]},t.metadata&&Object.entries(t.metadata).map(([h,m],c)=>(0,e.jsx)("div",{css:ke,key:c},(0,e.jsx)("span",{css:xe},h,":"),m)),Object.entries(t.popoverData).map(([h,m],c)=>(0,e.jsx)("div",{css:ke,key:c},(0,e.jsx)("span",{css:xe},h,":"),m)))):null)};var oe=require("react-beautiful-dnd");var w=require("@emotion/react"),it=w.css`
270
+ `]},t.metadata&&Object.entries(t.metadata).map(([f,b],s)=>(0,e.jsx)("div",{css:Le,key:s},(0,e.jsx)("span",{css:Me},f,":"),b)),Object.entries(t.popoverData).map(([f,b],s)=>(0,e.jsx)("div",{css:Le,key:s},(0,e.jsx)("span",{css:Me},f,":"),b)))):null)};var ae=require("react-beautiful-dnd");var w=require("@emotion/react"),lt=w.css`
271
271
  background: var(--white);
272
272
  border: 1px solid var(--gray-300);
273
273
  border-radius: var(--rounded-base);
274
274
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
275
- margin-block: 0 var(--spacing-base);
276
- `,st=w.css`
275
+ margin-bottom: var(--spacing-base);
276
+ `,pt=w.css`
277
277
  align-items: center;
278
278
  display: flex;
279
279
  position: relative;
@@ -281,7 +281,7 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
281
281
  width: 100%;
282
282
  background-color: transparent;
283
283
  border: 0;
284
- `,ct=w.css`
284
+ `,mt=w.css`
285
285
  color: var(--brand-secondary-1);
286
286
  display: block;
287
287
  font-weight: var(--fw-bold);
@@ -297,20 +297,15 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
297
297
  background: var(--gray-100);
298
298
  outline: none;
299
299
  }
300
- `,dt=w.css`
300
+ `,ut=w.css`
301
301
  background: var(--white);
302
302
  border: 1px solid var(--gray-300);
303
303
  border-radius: var(--rounded-base);
304
304
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
305
- `,lt=w.css`
306
- border: none;
307
- position: absolute;
308
- padding: 0;
309
- clip: rect(0, 0, 0, 0);
310
- height: 1px;
311
- width: 1px;
312
- overflow: hidden;
313
- `,pt=w.css`
305
+ display: block;
306
+ `,gt=w.css`
307
+ display: none;
308
+ `,ft=w.css`
314
309
  overflow-y: auto;
315
310
  max-height: 16rem;
316
311
  margin-bottom: var(--spacing-base);
@@ -318,174 +313,173 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
318
313
  & > :not(:last-child) {
319
314
  border-bottom: 1px solid var(--gray-200);
320
315
  }
321
- `,Nr=w.css`
316
+ `,_r=w.css`
322
317
  background-color: var(--gray-50);
323
318
  max-width: 33.33%;
324
- `,mt=w.css`
319
+ `,vt=w.css`
325
320
  align-items: center;
326
321
  display: flex;
327
322
  position: absolute;
328
323
  inset: 0 0 0 auto;
329
324
  pointer-events: none;
330
325
  padding-right: var(--spacing-sm);
331
- `,ut=w.css`
326
+ `,ht=w.css`
332
327
  color: var(--brand-secondary-1);
333
328
  width: 1.25rem;
334
329
  height: 1.25rem;
335
330
  transition: transform var(--duration-fast) var(--timing-ease-out);
336
331
  transform: rotate(0);
337
- `,_r=w.css`
332
+ `,Zr=w.css`
338
333
  background: var(--white);
339
334
  color: var(--brand-secondary-1);
340
- `,gt=w.css`
335
+ `,bt=w.css`
341
336
  position: relative;
342
337
  margin-block: var(--spacing-sm) 0;
343
338
 
344
339
  &:hover > span {
345
340
  opacity: 0.3;
346
341
  }
347
- `,ft=w.css`
342
+ `,yt=w.css`
348
343
  align-items: center;
349
344
  display: flex;
350
345
  position: absolute;
351
346
  inset: 0 auto 0 0;
352
347
  margin-block: auto;
353
348
  opacity: 0;
354
- `,Le=w.css`
349
+ `,Ve=w.css`
355
350
  color: var(--brand-secondary-1);
356
- `,vt=w.css`
351
+ `,St=w.css`
357
352
  position: absolute;
358
353
  left: 0.375rem;
359
- `,Me=w.css`
354
+ `,Ee=w.css`
360
355
  width: calc(var(--spacing-lg) + var(--spacing-xs));
361
356
  height: calc(var(--spacing-lg) + var(--spacing-xs));
362
- `;var E=require("@emotion/react"),S=require("@uniformdev/design-system"),Zr=({searchText:t,selectedContentType:n})=>{let r="No content found";return n&&(r=`No ${n} content was found`),t&&(r=`${r} for keyword '${t}'.`),(0,e.jsx)(S.Callout,{type:"info"},r)},ht=({search:t,results:n,contentTypes:r,selectedItems:o,logoIcon:a,select:d,multiSelect:f,multiSelectId:b,rowComponent:h,selectedItemComponent:m,totalResults:c,resultsLoading:u,requireContentType:g,onAddNew:J,onEditClosed:T,onCancel:X,noResultsComponent:H,helpComponent:F,onSort:q})=>{var Ut,At,Bt;let z=()=>g?Array.isArray(r)&&r.length>0?r[0].id:"":"any",[U,s]=G.useState(""),[p,A]=G.useState(z),[ne,Ee]=G.useState(!1),[ue,ge]=G.useState([]),[cr,Tt]=G.useState(!1),fe=(0,or.useThrottle)(U,750);G.useEffect(()=>{t(fe,{count:5,offset:0,contentType:p==="any"?void 0:p})},[fe,p]);let dr=i=>{ue.includes(i.id)?ge(y=>y.filter(Y=>Y!==i.id)):ge(f?y=>[...y,i==null?void 0:i.id]:[i.id])},lr=()=>{A(z()),s(""),ge(o!=null&&o.length?o.map(i=>i.id):[])},pr=()=>{Ee(i=>!i),ne||lr()},Dt=i=>{d((o==null?void 0:o.filter(y=>y.id!==i.id).map(y=>y.id))||[],"")},mr=i=>{i.preventDefault(),d(ue,p),Ee(!1)},ur=i=>{i.preventDefault(),Ee(!1),X&&X()},gr=i=>{i.preventDefault(),t(fe,{count:5,offset:(n==null?void 0:n.length)||0,contentType:p==="any"?void 0:p}),Tt(!0);let y=setTimeout(()=>{Tt(!1)},750);return()=>clearTimeout(y)},Ie=G.useRef((0,nr.v4)()),fr=!(o==null?void 0:o.length)||f,vr=h||at,Gt=m||je,hr=H||Zr,zt=a&&typeof a!="string"?a:null,br=zt?(0,e.jsx)(zt,{css:Me}):(0,e.jsx)("img",{src:a,alt:"CMS logo",css:Me}),yr=i=>{var y,Y;if(i.destination&&i.source.droppableId===((y=i.destination)==null?void 0:y.droppableId)){let L=[...o||[]],[ae]=(Y=L==null?void 0:L.splice(i.source.index,1))!=null?Y:[];return L==null||L.splice(i.destination.index,0,ae),q==null||q(L.map(Sr=>Sr.id)),L}};return(0,e.jsx)("div",{css:E.css`
357
+ `;var T=require("@emotion/react"),y=require("@uniformdev/design-system"),Wr=({searchText:t,selectedContentType:n})=>{let o="No content found";return n&&(o=`No ${n} content was found`),t&&(o=`${o} for keyword '${t}'.`),(0,e.jsx)(y.Callout,{type:"info"},o)},wt=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:i,select:d,multiSelect:m,multiSelectId:g,rowComponent:f,selectedItemComponent:b,totalResults:s,resultsLoading:v,requireContentType:C,onAddNew:X,onEditClosed:k,onCancel:h,noResultsComponent:ie,helpComponent:Y,onSort:q,typeSelectorLabel:F="Content Type Select",typeSelectorAllTypesOptionText:$="All content types"})=>{var Ht,Ft,$t;let j=()=>C?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[U,G]=I.useState(""),[a,S]=I.useState(j),[B,Ge]=I.useState(!1),[ge,fe]=I.useState([]),[lr,Ut]=I.useState(!1),ve=(0,ir.useThrottle)(U,750);I.useEffect(()=>{t(ve,{count:5,offset:0,contentType:a==="any"?void 0:a})},[ve,a]);let pr=c=>{ge.some(u=>u.id===c.id)?fe(u=>u.filter(ee=>ee.id!==c.id)):fe(m?u=>[...u,c]:[c])},mr=()=>{S(j()),G(""),fe(r!=null&&r.length?r:[])},ur=()=>{Ge(c=>!c),B||mr()},At=c=>{d((r==null?void 0:r.filter(u=>u.id!==c.id))||[],"")},gr=c=>{c.preventDefault(),d(ge,a),Ge(!1)},fr=c=>{c.preventDefault(),Ge(!1),h&&h()},vr=c=>{c.preventDefault(),t(ve,{count:5,offset:(n==null?void 0:n.length)||0,contentType:a==="any"?void 0:a}),Ut(!0);let u=setTimeout(()=>{Ut(!1)},750);return()=>clearTimeout(u)},ze=I.useRef((0,sr.v4)()),hr=!(r==null?void 0:r.length)||m,br=f||dt,Bt=b||ot,yr=ie||Wr,Ot=i&&typeof i!="string"?i:null,Sr=Ot?(0,e.jsx)(Ot,{css:Ee}):(0,e.jsx)("img",{src:i,alt:"Logo",css:Ee}),wr=c=>{var u,ee;if(c.destination&&c.source.droppableId===((u=c.destination)==null?void 0:u.droppableId)){let M=[...r||[]],[se]=(ee=M==null?void 0:M.splice(c.source.index,1))!=null?ee:[];return M==null||M.splice(c.destination.index,0,se),q==null||q(M),M}};return(0,e.jsx)("div",{css:T.css`
363
358
  width: 100%;
364
- `},(0,e.jsx)("div",{css:E.css`
359
+ `},(0,e.jsx)("div",{css:T.css`
365
360
  position: relative;
366
361
  margin-block: var(--spacing-base);
367
- `},fr&&(0,e.jsx)("div",null,(0,e.jsx)("div",{css:it,"data-test-id":"component-search"},(0,e.jsx)("button",{css:st,onClick:pr,type:"button","aria-haspopup":!0,"aria-expanded":ne,"aria-controls":`entry-search-config-${Ie.current}`},br,(0,e.jsx)("span",{css:E.css`
362
+ `},hr&&(0,e.jsx)(I.Fragment,null,(0,e.jsx)("div",{css:lt,"data-test-id":"component-search"},(0,e.jsx)("button",{css:pt,onClick:ur,type:"button","aria-haspopup":!0,"aria-expanded":B,"aria-controls":`entry-search-config-${ze.current}`},Sr,(0,e.jsx)("span",{css:T.css`
368
363
  margin-left: var(--spacing-base);
369
- `},"Select"),(0,e.jsx)("span",{css:mt},(0,e.jsx)(Ce,{css:[ut,ne?E.css`
364
+ `},"Select"),(0,e.jsx)("span",{css:vt},(0,e.jsx)(Re,{css:[ht,B?T.css`
370
365
  transform: rotate(180deg);
371
- `:void 0]})))),(0,e.jsx)("div",{id:`entry-search-config-${Ie.current}`,"aria-hidden":!ne,css:[dt,ne?void 0:lt]},F||null,(0,e.jsx)("div",{css:E.css`
366
+ `:void 0]})))),(0,e.jsx)("div",{id:`entry-search-config-${ze.current}`,"aria-hidden":!B,css:[ut,B?void 0:gt]},Y||null,(0,e.jsx)("div",{css:T.css`
372
367
  display: flex;
373
368
  gap: calc(var(--spacing-base) - 0.25rem);
374
369
  margin-bottom: var(--spacing-base);
375
- `},(0,e.jsx)(S.InputSelect,{onChange:i=>A(i.target.value),value:p,label:"Content Type Select",showLabel:!1,options:[...g?[]:[{value:"any",label:"All content types"}],...r?r.map(i=>({value:i.id,label:i.name})):[]]}),(0,e.jsx)("div",{css:E.css`
370
+ `},(0,e.jsx)(y.InputSelect,{onChange:c=>S(c.target.value),value:a,label:F,showLabel:!1,options:[...C?[]:[{value:"any",label:$}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),(0,e.jsx)("div",{css:T.css`
376
371
  flex-grow: 1;
377
- `},(0,e.jsx)(S.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:s,disabledFieldSubmission:!0,value:U}))),(0,e.jsx)("div",{css:[pt,S.scrollbarStyles],id:Ie.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},!u&&Array.isArray(n)?n.map(i=>(0,e.jsx)(vr,{key:i.id,isSelected:ue.includes(i.id),result:i,triggerSelection:()=>dr(i)})):u?null:(0,e.jsx)(hr,{searchText:fe||U,selectedContentType:(At=(Ut=r==null?void 0:r.find(i=>i.id===p))==null?void 0:Ut.name)!=null?At:p}),!u&&typeof c!="undefined"&&n&&(n==null?void 0:n.length)<c&&(0,e.jsx)("button",{css:ct,onClick:gr},cr?(0,e.jsx)(S.LoadingIndicator,null):"Load More"),u&&!(n!=null&&n.length)?(0,e.jsx)("div",{css:E.css`
372
+ `},(0,e.jsx)(y.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:G,disabledFieldSubmission:!0,value:U}))),(0,e.jsx)("div",{css:[ft,y.scrollbarStyles],id:ze.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},!v&&Array.isArray(n)?n.map(c=>(0,e.jsx)(br,{key:c.id,isSelected:ge.some(u=>u.id===c.id),result:c,triggerSelection:()=>pr(c)})):v?null:(0,e.jsx)(yr,{searchText:ve||U,selectedContentType:(Ft=(Ht=o==null?void 0:o.find(c=>c.id===a))==null?void 0:Ht.name)!=null?Ft:a}),!v&&typeof s!="undefined"&&n&&(n==null?void 0:n.length)<s&&(0,e.jsx)("button",{css:mt,onClick:vr},lr?(0,e.jsx)(y.LoadingIndicator,null):"Load More"),v&&!(n!=null&&n.length)?(0,e.jsx)("div",{css:T.css`
378
373
  padding: var(--spacing-base);
379
374
  text-align: center;
380
375
  width: 100%;
381
- `},(0,e.jsx)(S.LoadingIndicator,null)):null),(0,e.jsx)("div",{css:E.css`
376
+ `},(0,e.jsx)(y.LoadingIndicator,null)):null),(0,e.jsx)("div",{css:T.css`
382
377
  display: flex;
383
378
  justify-content: space-between;
384
- `},(0,e.jsx)("div",null,J&&((Bt=r==null?void 0:r.length)!=null?Bt:0)>0?(0,e.jsx)(S.Menu,{menuLabel:"Add new menu",menuTrigger:(0,e.jsx)(S.Button,{buttonType:"secondary"},"Add New")},r==null?void 0:r.map(i=>(0,e.jsx)(S.MenuItem,{key:i.id,css:E.css`
379
+ `},(0,e.jsx)("div",null,X&&(($t=o==null?void 0:o.length)!=null?$t:0)>0?(0,e.jsx)(y.Menu,{menuLabel:"Add new menu",menuTrigger:(0,e.jsx)(y.Button,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>(0,e.jsx)(y.MenuItem,{key:c.id,css:T.css`
385
380
  background: var(--white);
386
381
  color: var(--brand-secondary-1);
387
- `,onClick:()=>J(i)},i.name))):null),(0,e.jsx)("div",{css:E.css`
382
+ `,onClick:()=>X(c)},c.name))):null),(0,e.jsx)("div",{css:T.css`
388
383
  display: flex;
389
384
  gap: var(--spacing-base);
390
- `},(0,e.jsx)(S.Button,{buttonType:"unimportant",onClick:ur},"Cancel"),(0,e.jsx)(S.Button,{disabled:!ue.length,onClick:mr,"data-test-id":"entry-accept-button"},"Accept"))))),f?(0,e.jsx)(oe.DragDropContext,{onDragEnd:i=>yr(i)},(0,e.jsx)(oe.Droppable,{droppableId:b||"canvas-multi-select"},i=>(0,e.jsx)("div",{...i.droppableProps,ref:i.innerRef,css:E.css`
385
+ `},(0,e.jsx)(y.Button,{buttonType:"unimportant",onClick:fr},"Cancel"),(0,e.jsx)(y.Button,{disabled:!ge.length,onClick:gr,"data-test-id":"entry-accept-button"},"Accept"))))),m?(0,e.jsx)(ae.DragDropContext,{onDragEnd:c=>wr(c)},(0,e.jsx)(ae.Droppable,{droppableId:g||"canvas-multi-select"},c=>(0,e.jsx)("div",{...c.droppableProps,ref:c.innerRef,css:T.css`
391
386
  margin-block: var(--spacing-sm) 0;
392
- `},o==null?void 0:o.map((y,Y)=>{if(y!=null&&y.id)return(0,e.jsx)(oe.Draggable,{key:y.id,draggableId:y.id,index:Y},L=>(0,e.jsx)("div",{css:gt,ref:L.innerRef,...L.draggableProps,...L.dragHandleProps},(0,e.jsx)("span",{css:ft},(0,e.jsx)(se,{css:[Le,vt],width:24,height:24}),(0,e.jsx)(se,{css:Le,width:24,height:24})),(0,e.jsx)(Gt,{key:`selected-item-${y.id}`,logoIcon:a,selectedItem:y,onDeselect:ae=>Dt(ae),onEditClosed:T?ae=>T(ae):void 0})))}),i.placeholder))):o==null?void 0:o.map(i=>(0,e.jsx)(Gt,{key:`selected-item-${i.id}`,logoIcon:a,selectedItem:i,onDeselect:y=>Dt(y),onEditClosed:T?y=>T(y):void 0}))))};var _=require("@emotion/react"),bt=_.css`
387
+ `},r==null?void 0:r.map((u,ee)=>{if(u!=null&&u.id)return(0,e.jsx)(ae.Draggable,{key:u.id,draggableId:u.id,index:ee},M=>(0,e.jsx)("div",{css:bt,ref:M.innerRef,...M.draggableProps,...M.dragHandleProps},(0,e.jsx)("span",{css:yt},(0,e.jsx)(de,{css:[Ve,St],width:24,height:24}),(0,e.jsx)(de,{css:Ve,width:24,height:24})),(0,e.jsx)(Bt,{key:`selected-item-${u.id}`,logoIcon:i,selectedItem:u,onDeselect:se=>At(se),onEditClosed:k?se=>k(se):void 0})))}),c.placeholder))):r==null?void 0:r.map(c=>(0,e.jsx)(Bt,{key:`selected-item-${c.id}`,logoIcon:i,selectedItem:c,onDeselect:u=>At(u),onEditClosed:k?u=>k(u):void 0}))))};var Z=require("@emotion/react"),Ct=Z.css`
393
388
  cursor: pointer;
394
389
  padding: var(--spacing-sm) 0;
395
390
  margin-right: var(--spacing-sm);
396
391
  position: relative;
397
392
  transition: background-color var(--duration-fast) var(--timing-ease-out),
398
393
  color var(--duration-fast) var(--timing-ease-out);
399
- `,yt=_.css`
394
+ `,Pt=Z.css`
400
395
  border: 2px solid transparent;
401
396
  border-radius: var(--rounded-base);
402
397
  display: flex;
403
398
  align-items: center;
404
399
  gap: var(--spacing-base);
405
400
  padding: var(--spacing-sm) var(--spacing-xs);
406
- `,St=_.css`
401
+ `,Rt=Z.css`
407
402
  background-color: var(--green-50);
408
- `,wt=_.css`
403
+ `,kt=Z.css`
409
404
  font-size: var(--fs-sm);
410
405
  font-weight: var(--fw-bold);
411
406
  width: 50%;
412
- `,Ct=_.css`
407
+ `,xt=Z.css`
413
408
  font-weight: var(--fw-normal);
414
409
  display: block;
415
- `,Pt=_.css`
410
+ `,Lt=Z.css`
416
411
  font-size: var(--fs-sm);
417
412
  > * {
418
413
  display: block;
419
414
  }
420
- `,Rt=_.css`
415
+ `,Mt=Z.css`
421
416
  display: block;
422
417
  height: 1.5rem;
423
418
  width: 1.5rem;
424
419
  color: var(--brand-secondary-3);
425
420
  margin-left: auto;
426
- `;var kt=require("@emotion/react");function xt({result:t,isSelected:n,triggerSelection:r}){var b;let{categories:o,logoIcon:a}=de(),[d]=t.categories||[{id:"",name:""}],f=typeof d=="undefined"||!o||(b=o.find(h=>h.id===d.id))==null?void 0:b.name;return(0,e.jsx)("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>r(),css:[bt]},(0,e.jsx)("div",{css:[yt,n?St:void 0]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:kt.css`
421
+ `;var Vt=require("@emotion/react");function Et({result:t,isSelected:n,triggerSelection:o}){var g;let{categories:r,logoIcon:i}=pe(),[d]=t.categories||[{id:"",name:""}],m=typeof d=="undefined"||!r||(g=r.find(f=>f.id===d.id))==null?void 0:g.name;return(0,e.jsx)("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Ct]},(0,e.jsx)("div",{css:[Pt,n?Rt:void 0]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:Vt.css`
427
422
  background-color: var(--gray-200);
428
423
  width: 3rem;
429
424
  height: 3rem;
430
425
  object-fit: cover;
431
- `}):(0,e.jsx)(Q,{src:a,alt:"Logo",css:kt.css`
426
+ `}):(0,e.jsx)(N,{src:i,alt:"Logo",css:Vt.css`
432
427
  height: 2.25rem;
433
428
  width: 2.25rem;
434
- `}),(0,e.jsx)("h4",{css:[wt]},t.title,f?(0,e.jsx)("span",{css:[Ct]},f):null),(0,e.jsx)("p",{css:[Pt]},"SKU: ",t.id,t.price&&(0,e.jsx)("span",null,t.price)),n?(0,e.jsx)(we,{css:[Rt]}):null))}var le=require("@emotion/react"),ar=require("@uniformdev/design-system"),Lt=le.css`
429
+ `}),(0,e.jsx)("h4",{css:[kt]},t.title,m?(0,e.jsx)("span",{css:[xt]},m):null),(0,e.jsx)("p",{css:[Lt]},"SKU: ",t.id,t.price&&(0,e.jsx)("span",null,t.price)),n?(0,e.jsx)(Pe,{css:[Mt]}):null))}var me=require("@emotion/react"),cr=require("@uniformdev/design-system"),Tt=me.css`
435
430
  display: flex;
436
431
  width: 100%;
437
432
  border: 1px solid var(--gray-300);
438
433
  border-radius: var(--rounded-base);
439
434
  background-color: var(--gray-100);
440
435
  margin: var(--spacing-base) 0;
441
- `,Mt=le.css`
436
+ `,It=me.css`
442
437
  padding: var(--spacing-base) 0 var(--spacing-base) var(--spacing-lg);
443
438
  display: flex;
444
439
  flex-grow: 1;
445
440
  align-items: center;
446
441
  margin-right: var(--spacing-sm);
447
442
  gap: var(--spacing-base);
448
- `,Vt=le.css`
443
+ `,Dt=me.css`
449
444
  display: flex;
450
445
  align-items: center;
451
446
  gap: var(--spacing-sm);
452
- margin-bottom: var(--spacing-sm);
453
- ${(0,ar.mq)("lg")} {
447
+ ${(0,cr.mq)("lg")} {
454
448
  width: 50%;
455
449
  margin-bottom: 0;
456
450
  }
457
- `,Ve=le.css`
451
+ `,Te=me.css`
458
452
  background-color: var(--gray-200);
459
453
  width: 3.5rem;
460
454
  height: 3.5rem;
461
455
  object-fit: cover;
462
- `;var R=require("@emotion/react"),ir=require("@uniformdev/design-system");function Et({selectedItem:t,onDeselect:n}){var f;let{categories:r,logoIcon:o}=de(),[a]=t.categories||[{id:"",name:""}],d=typeof a=="undefined"||!r||(f=r.find(b=>b.id===a.id))==null?void 0:f.name;return(0,e.jsx)("div",{css:[Lt],key:t.id},(0,e.jsx)("article",{css:[Mt]},(0,e.jsx)("div",{css:[Vt]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:d,css:[Ve],loading:"lazy"}):(0,e.jsx)("div",{css:[Ve]}),(0,e.jsx)("div",{css:R.css`
456
+ `;var x=require("@emotion/react"),dr=require("@uniformdev/design-system");function Gt({selectedItem:t,onDeselect:n}){var m;let{categories:o,logoIcon:r}=pe(),[i]=t.categories||[{id:"",name:""}],d=typeof i=="undefined"||!o||(m=o.find(g=>g.id===i.id))==null?void 0:m.name;return(0,e.jsx)("div",{css:[Tt],key:t.id},(0,e.jsx)("article",{css:[It]},(0,e.jsx)("div",{css:[Dt]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:d,css:[Te],loading:"lazy"}):(0,e.jsx)("div",{css:[Te]}),(0,e.jsx)("div",{css:x.css`
463
457
  > :not(:last-child) {
464
458
  margin-bottom: var(--spacing-xs);
465
459
  }
466
- `},(0,e.jsx)("h4",{css:R.css`
460
+ `},(0,e.jsx)("h4",{css:x.css`
467
461
  font-weight: var(--fw-bold);
468
- `},t.title||t.id||"",d&&(0,e.jsx)("span",{css:R.css`
462
+ `},t.title||t.id||"",d&&(0,e.jsx)("span",{css:x.css`
469
463
  display: block;
470
464
  font-weight: var(--fw-regular);
471
- `},d)),(0,e.jsx)("ul",{css:R.css`
465
+ `},d)),(0,e.jsx)("ul",{css:x.css`
472
466
  font-size: var(--fs-sm);
473
467
  display: flex;
474
468
  gap: var(--spacing-base);
475
- `},(0,e.jsx)("li",null,(0,e.jsx)("span",{css:R.css`
469
+ `},(0,e.jsx)("li",null,(0,e.jsx)("span",{css:x.css`
476
470
  margin-right: var(--spacing-xs);
477
- `},"SKU:"),t.id),t.price&&(0,e.jsx)("li",null,(0,e.jsx)("span",{css:R.css`
471
+ `},"SKU:"),t.id),t.price&&(0,e.jsx)("li",null,(0,e.jsx)("span",{css:x.css`
478
472
  margin-right: var(--spacing-xs);
479
- `},"Price:"),(0,e.jsx)("span",null,t.price))))),(0,e.jsx)("div",{css:R.css`
473
+ `},"Price:"),(0,e.jsx)("span",null,t.price))))),(0,e.jsx)("div",{css:x.css`
480
474
  display: flex;
481
475
  flex-wrap: wrap;
482
476
  gap: var(--spacing-sm);
483
477
  justify-content: flex-end;
484
478
  margin-left: auto;
485
- ${(0,ir.mq)("md")} {
479
+ ${(0,dr.mq)("md")} {
486
480
  align-items: center;
487
481
  }
488
- `},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",css:R.css`
482
+ `},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",css:x.css`
489
483
  display: inline-flex;
490
484
  justify-content: space-between;
491
485
  align-items: center;
@@ -496,14 +490,14 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
496
490
  &:hover {
497
491
  background-color: var(--gray-100);
498
492
  }
499
- `},(0,e.jsx)("span",{css:R.css`
493
+ `},(0,e.jsx)("span",{css:x.css`
500
494
  margin-right: var(--spacing-sm);
501
495
  font-size: var(--fs-sm);
502
- `},"Edit"),(0,e.jsx)(Q,{src:o,alt:"Logo",css:R.css`
496
+ `},"Edit"),(0,e.jsx)(N,{src:r,alt:"Logo",css:x.css`
503
497
  width: 1.75rem;
504
498
  height: 1.75rem;
505
499
  display: block;
506
- `})):null,(0,e.jsx)("button",{type:"button",onClick:b=>{b.preventDefault(),n==null||n(t)},css:R.css`
500
+ `})):null,(0,e.jsx)("button",{type:"button",onClick:g=>{g.preventDefault(),n==null||n(t)},css:x.css`
507
501
  display: flex;
508
502
  justify-content: space-between;
509
503
  align-items: center;
@@ -512,11 +506,12 @@ var wr=Object.create;var ve=Object.defineProperty;var Cr=Object.getOwnPropertyDe
512
506
  border: 2px solid var(--gray-400);
513
507
  height: 2.5rem;
514
508
  padding: 0 var(--spacing-base);
509
+ gap: var(--spacing-sm);
515
510
  &:hover {
516
511
  background-color: var(--gray-100);
517
512
  }
518
- `},(0,e.jsx)("span",{css:R.css`
513
+ `},(0,e.jsx)("span",{css:x.css`
519
514
  font-size: var(--fs-sm);
520
- `},"Unlink"),(0,e.jsx)(te,{css:R.css`
515
+ `},"Unlink"),(0,e.jsx)(oe,{css:x.css`
521
516
  color: var(--brand-secondary-5);
522
- `})))))}var sr=require("@uniformdev/design-system"),pe=require("react-use");function qr({value:t,setValue:n,onGetSelectedProducts:r,onGetCategories:o,onSearchProducts:a,logoIcon:d,multiSelect:f,multiSelectId:b,selectedItemComponent:h,rowComponent:m}){var z,U;let{value:c,loading:u,error:g}=(0,pe.useAsync)(async()=>await o(),[o]),{value:J,error:T}=(0,pe.useAsync)(async()=>{if(!t)return;let s=await r({ids:t});return Array.isArray(s)?s:void 0},[r,t]),X=(0,Z.useMemo)(()=>c?c.map(p=>({id:p.id,name:p.name})):void 0,[c]),H=(0,Z.useRef)(),[F,q]=(0,pe.useAsyncFn)(async(s,p)=>{let A=await a({text:s,options:{limit:p==null?void 0:p.count,offset:p==null?void 0:p.offset,categoryId:p==null?void 0:p.contentType}});return(p==null?void 0:p.offset)===0&&(H.current=[]),(H.current=H.current||[]).push(...A.products),A},[a]),me=async s=>{s&&await n(s)};return u?(0,e.jsx)(sr.LoadingIndicator,null):g||T||F.error?(0,e.jsx)("div",null,"There was an error:"," ",(g==null?void 0:g.message)||(T==null?void 0:T.message)||((z=F.error)==null?void 0:z.message)):(0,e.jsx)(It.Provider,{value:{categories:c,logoIcon:d}},(0,e.jsx)(ht,{search:q,results:H.current,logoIcon:d,selectedItems:J,select:me,multiSelectId:b||"product-search-multi-select",multiSelect:f,contentTypes:X,selectedItemComponent:h||Et,rowComponent:m||xt,totalResults:(U=F.value)==null?void 0:U.total,resultsLoading:F.loading}))}var It=Z.default.createContext(void 0),de=()=>{let t=(0,Z.useContext)(It);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};k(I,require("@uniformdev/mesh-sdk"));var v=require("@uniformdev/design-system");module.exports=xr(I);0&&(module.exports={Button,Callout,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,KeywordSearchInput,LoadingIndicator,LoadingOverlay,Menu,MenuItem,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,badgeIcon,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemImage,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemCloseIcon,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useProductQueryContext,useProductSearchContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});
517
+ `})))))}var Ie=require("@uniformdev/design-system"),De=require("react-use");function qr({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:i,multiSelect:d,multiSelectId:m,selectedItemComponent:g,rowComponent:f,errorComponent:b,helpComponent:s,noResultsComponent:v,onSort:C,typeSelectorAllTypesOptionText:X="All categories",typeSelectorLabel:k="Select Category"}){var U;let{value:h,loading:ie,error:Y}=(0,De.useAsync)(async()=>await o(),[o]),q=(0,W.useMemo)(()=>h?h.map(a=>({id:a.id,name:a.name})):void 0,[h]),F=(0,W.useRef)(),[$,ue]=(0,De.useAsyncFn)(async(G,a)=>{let S=await r({text:G,options:{limit:a==null?void 0:a.count,offset:a==null?void 0:a.offset,categoryId:a==null?void 0:a.contentType}});return(a==null?void 0:a.offset)===0&&(F.current=[]),(F.current=F.current||[]).push(...S.products),S},[r]),j=async G=>{await n(G)};return ie?(0,e.jsx)(Ie.LoadingIndicator,null):Y||$.error?(0,e.jsx)(b||(({categoriesError:a,searchError:S})=>(0,e.jsx)(Ie.Callout,{type:"error"},"There was an error: ",(a==null?void 0:a.message)||(S==null?void 0:S.message))),{categoriesError:Y,searchError:$.error}):(0,e.jsx)(zt.Provider,{value:{categories:h,logoIcon:i}},(0,e.jsx)(wt,{search:ue,results:F.current,logoIcon:i,selectedItems:t,select:j,multiSelectId:m||"product-search-multi-select",multiSelect:d,contentTypes:q,selectedItemComponent:g||Gt,rowComponent:f||Et,totalResults:(U=$.value)==null?void 0:U.total,resultsLoading:$.loading,helpComponent:s,noResultsComponent:v,onSort:C,typeSelectorAllTypesOptionText:X,typeSelectorLabel:k}))}var zt=W.default.createContext(void 0),pe=()=>{let t=(0,W.useContext)(zt);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};z(D,require("@uniformdev/mesh-sdk"),module.exports);var p=require("@uniformdev/design-system");0&&(module.exports={Button,Callout,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,KeywordSearchInput,LoadingIndicator,LoadingOverlay,Menu,MenuItem,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,badgeIcon,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemImage,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemCloseIcon,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useProductQueryContext,useProductSearchContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});