@uniformdev/mesh-sdk-react 17.2.1-alpha.215 → 17.3.0

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.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enumerable:!0})};import{jsx as l}from"@emotion/react";import*as x from"react";import{createContext as Uo,useContext as Ao,useEffect as Go,useState as Bo}from"react";import{createContext as Mo,useContext as Vo}from"react";import{Theme as Do}from"@uniformdev/design-system";import{jsx as st,jsxs as zo}from"@emotion/react/jsx-runtime";var we=Mo(void 0),ha=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),zo(we.Provider,{value:r,children:[st(Do,{}),st(Ce,{children:e})]})},ct=()=>{let e=Vo(we);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function dt(){let{sdk:e}=ct();return e}import{jsx as Oo}from"@emotion/react/jsx-runtime";var lt=Uo(void 0),Ce=({children:e})=>{let r=dt(),[o,t]=Bo(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return Go(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),Oo(lt.Provider,{value:{location:o},children:e})},Pe=()=>{let e=Ao(lt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Ra(){let{location:e}=Pe();return e}import{initializeUniformMeshSDK as Ho}from"@uniformdev/mesh-sdk";import{useEffect as $o,useRef as Fo,useState as pt}from"react";var ut=({autoResizingDisabled:e}={})=>{let[r,o]=pt(),[t,n]=pt(),a=Fo(!1);return $o(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,Ho({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function Da(e){let{location:r}=Pe();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}import Xo,{useMemo as ke,useContext as qo}from"react";import{css as Ko}from"@emotion/react";import{Icon as No,InputSelect as Qo}from"@uniformdev/design-system";import{CgClose as Wo}from"react-icons/cg";import{Fragment as mt,jsxs as gt}from"@emotion/react/jsx-runtime";var ft=({value:e,text:r,loading:o})=>gt(mt,{children:[!!r&&r,!r&&gt(mt,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});import{css as Ge}from"@emotion/react";var vt=Ge`
1
+ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enumerable:!0})};import{jsx as l}from"@emotion/react";import*as x from"react";import{createContext as Uo,useContext as Ao,useEffect as Go,useState as Bo}from"react";import{createContext as Mo,useContext as Vo}from"react";import{Theme as Do}from"@uniformdev/design-system";import{jsx as st,jsxs as zo}from"@emotion/react/jsx-runtime";var we=Mo(void 0),ha=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),zo(we.Provider,{value:r,children:[st(Do,{}),st(Ce,{children:e})]})},ct=()=>{let e=Vo(we);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function dt(){let{sdk:e}=ct();return e}import{jsx as Oo}from"@emotion/react/jsx-runtime";var lt=Uo(void 0),Ce=({children:e})=>{let r=dt(),[o,t]=Bo(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return Go(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),Oo(lt.Provider,{value:{location:o},children:e})},Pe=()=>{let e=Ao(lt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Ra(){let{location:e}=Pe();return e}import{initializeUniformMeshSDK as Ho}from"@uniformdev/mesh-sdk";import{useEffect as $o,useRef as Fo,useState as pt}from"react";var mt=({autoResizingDisabled:e}={})=>{let[r,o]=pt(),[t,n]=pt(),a=Fo(!1);return $o(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,Ho({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function Da(e){let{location:r}=Pe();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}import Xo,{useMemo as ke,useContext as qo}from"react";import{css as Ko}from"@emotion/react";import{Icon as No,InputSelect as Qo}from"@uniformdev/design-system";import{CgClose as Wo}from"react-icons/cg";import{Fragment as ut,jsxs as gt}from"@emotion/react/jsx-runtime";var ft=({value:e,text:r,loading:o})=>gt(ut,{children:[!!r&&r,!r&&gt(ut,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});import{css as Ge}from"@emotion/react";var vt=Ge`
2
2
  align-items: center;
3
3
  background: var(--gray-100);
4
4
  border: 1px solid var(--gray-300);
@@ -15,13 +15,13 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
15
15
  border-left: 1px solid var(--gray-300);
16
16
  background: var(--gray-100);
17
17
  padding: var(--spacing-3);
18
- `;import{jsx as fe,jsxs as bt}from"@emotion/react/jsx-runtime";var St=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var v;let f=(v=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?v:[],m=(i,p)=>{i.preventDefault(),d(p)};return bt("div",{children:[fe(Qo,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...f.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Ko`
18
+ `;import{jsx as fe,jsxs as bt}from"@emotion/react/jsx-runtime";var St=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var v;let f=(v=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?v:[],u=(i,p)=>{i.preventDefault(),d(p)};return bt("div",{children:[fe(Qo,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...f.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Ko`
19
19
  margin-bottom: var(--spacing-base);
20
- `:""}),t==null?void 0:t.map(i=>{var p;return bt("div",{css:vt,children:[fe("span",{css:ht,children:fe(ft,{value:i,loading:o,text:(p=n.find(y=>y.id===i))==null?void 0:p.name})}),fe("button",{css:yt,title:"remove",onClick:y=>m(y,i),children:fe(No,{icon:Wo,iconColor:"currentColor",size:20})})]},i)})]})};import{jsx as xt}from"@emotion/react/jsx-runtime";var _o=e=>xt("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:xt("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"})}),Le=_o;import{jsx as wt}from"@emotion/react/jsx-runtime";var Zo=e=>wt("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:wt("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),Re=Zo;import{useAsyncFn as Yo,useDebounce as Jo}from"react-use";import{Input as Ct,InputSelect as Ie,mq as Te}from"@uniformdev/design-system";import{css as L}from"@emotion/react";import{jsx as w,jsxs as se}from"@emotion/react/jsx-runtime";var Pt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},ri=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:f,onGetProducts:m,sortOptions:v,sortOrderOptions:i,categoryLabel:p="Product Category",brandLabel:y="Brand",disableBrands:D,restrictToSingleCategory:ae=!1})=>{var E,u,V;let S=async s=>{r({...Pt,...e||{},...s})},b=ke(()=>({...Pt,...e||{}}),[e]),[ie,ue]=Yo(async s=>await m(s),[m]);Jo(async()=>{await ue({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let O=ke(()=>{let s=[];return t==null||t.forEach(z=>{let C=Rt(z,void 0);s.push(...C)}),s},[t]),_=ke(()=>[{value:"",label:"All categories"},...O.map(s=>({label:s.name,value:s.id}))],[O]),W=ke(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),me=s=>{if(!s)return;let z=(e==null?void 0:e.categories)||[];S({categories:[...z,s]})},Se=s=>{var z;S({categories:(z=e==null?void 0:e.categories)==null?void 0:z.filter(C=>C!==s)})},j=s=>{S({brand:s.target.value})},H=s=>{S({count:s||1})};return n?w("div",{children:"Loading..."}):w(kt.Provider,{value:{categories:t,logoIcon:f},children:se("div",{css:L`
20
+ `:""}),t==null?void 0:t.map(i=>{var p;return bt("div",{css:vt,children:[fe("span",{css:ht,children:fe(ft,{value:i,loading:o,text:(p=n.find(y=>y.id===i))==null?void 0:p.name})}),fe("button",{css:yt,title:"remove",onClick:y=>u(y,i),children:fe(No,{icon:Wo,iconColor:"currentColor",size:20})})]},i)})]})};import{jsx as xt}from"@emotion/react/jsx-runtime";var _o=e=>xt("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:xt("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"})}),Le=_o;import{jsx as wt}from"@emotion/react/jsx-runtime";var Zo=e=>wt("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:wt("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),Re=Zo;import{useAsyncFn as Yo,useDebounce as Jo}from"react-use";import{Input as Ct,InputSelect as Ie,mq as Te}from"@uniformdev/design-system";import{css as L}from"@emotion/react";import{jsx as w,jsxs as se}from"@emotion/react/jsx-runtime";var Pt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},ri=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:f,onGetProducts:u,sortOptions:v,sortOrderOptions:i,categoryLabel:p="Product Category",brandLabel:y="Brand",disableBrands:D,restrictToSingleCategory:ae=!1})=>{var E,m,V;let S=async s=>{r({...Pt,...e||{},...s})},b=ke(()=>({...Pt,...e||{}}),[e]),[ie,me]=Yo(async s=>await u(s),[u]);Jo(async()=>{await me({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let O=ke(()=>{let s=[];return t==null||t.forEach(z=>{let C=Rt(z,void 0);s.push(...C)}),s},[t]),_=ke(()=>[{value:"",label:"All categories"},...O.map(s=>({label:s.name,value:s.id}))],[O]),W=ke(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),ue=s=>{if(!s)return;let z=(e==null?void 0:e.categories)||[];S({categories:[...z,s]})},Se=s=>{var z;S({categories:(z=e==null?void 0:e.categories)==null?void 0:z.filter(C=>C!==s)})},j=s=>{S({brand:s.target.value})},H=s=>{S({count:s||1})};return n?w("div",{children:"Loading..."}):w(kt.Provider,{value:{categories:t,logoIcon:f},children:se("div",{css:L`
21
21
  > :not(:last-child) {
22
22
  margin-bottom: var(--spacing-md);
23
23
  }
24
- `,children:[ae?w(Ie,{id:"selection-field-product-category",label:p,disabled:n,value:(u=(E=b.categories)==null?void 0:E[0])!=null?u:"",options:_,onChange:s=>{S({categories:s.target.value===""?[]:[s.target.value]})}}):w(St,{loading:a||!1,id:"selection-field-product-category",label:p,onAdd:me,onRemove:Se,selectedValues:b.categories,values:O}),se("div",{css:L`
24
+ `,children:[ae?w(Ie,{id:"selection-field-product-category",label:p,disabled:n,value:(m=(E=b.categories)==null?void 0:E[0])!=null?m:"",options:_,onChange:s=>{S({categories:s.target.value===""?[]:[s.target.value]})}}):w(St,{loading:a||!1,id:"selection-field-product-category",label:p,onAdd:ue,onRemove:Se,selectedValues:b.categories,values:O}),se("div",{css:L`
25
25
  display: flex;
26
26
  flex-wrap: wrap;
27
27
  column-gap: var(--spacing-lg);
@@ -145,7 +145,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
145
145
  `,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),q("ul",{css:[Ht`
146
146
  max-height: 24rem;
147
147
  overflow-x: auto;
148
- `,jo],children:e==null?void 0:e.map((t,n)=>{var f,m;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(f=r.find(v=>v.id===a.id))==null?void 0:f.name;return q("li",{css:zt,children:X("div",{css:Ut,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?q("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:At,"data-test-id":"product-image"}):q("div",{css:Gt}),X("h4",{css:Bt,"data-test-id":"product-name",children:[t.title||t.name,d&&q("span",{css:Ot,children:d})]}),t&&X($t,{children:[X("p",{css:Be,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,q("br",{})]}),t.price!==void 0?X("p",{css:Be,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?X("a",{css:Mt,href:(m=t.editLink)!=null?m:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[q("span",{css:Vt,children:"Edit"}),o?q($,{src:o,alt:"Logo",css:Dt}):null]}):null]})]})},`product-${t.id}`)})})]})};import Nn,{useContext as Qn,useMemo as Wn,useRef as _n}from"react";import*as G from"react";var He={};Eo(He,{Caution:()=>Kt,Checkmark:()=>Ee,ChevronDown:()=>Me,Close:()=>Wt,Danger:()=>Zt,ExclamationPoint:()=>qt,Info:()=>Ve,Lightbulb:()=>jt,MagnifyingGlass:()=>tr,MaximizeAlt:()=>or,Minus:()=>Re,MoreVerticalAlt:()=>he,Plus:()=>Le});import{jsx as Ft}from"@emotion/react/jsx-runtime";var en=e=>Ft("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:Ft("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"})}),Kt=en;import{jsx as Nt}from"@emotion/react/jsx-runtime";var tn=e=>Nt("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:Nt("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"})}),Ee=tn;import{jsx as Qt}from"@emotion/react/jsx-runtime";var rn=e=>Qt("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:Qt("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"})}),Me=rn;import{jsx as Oe,jsxs as nn}from"@emotion/react/jsx-runtime";var on=e=>Oe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:nn("g",{fillRule:"evenodd",children:[Oe("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"}),Oe("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"})]})}),Wt=on;import{jsx as _t}from"@emotion/react/jsx-runtime";var an=e=>_t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:_t("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"})}),Zt=an;import{jsx as Xt}from"@emotion/react/jsx-runtime";var sn=e=>Xt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:Xt("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"})}),qt=sn;import{jsx as Yt,jsxs as dn}from"@emotion/react/jsx-runtime";var cn=e=>dn("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[Yt("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"}),Yt("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"})]}),Ve=cn;import{jsx as Jt}from"@emotion/react/jsx-runtime";var ln=e=>Jt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:Jt("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"})}),jt=ln;import{jsx as ve,jsxs as er}from"@emotion/react/jsx-runtime";var pn=e=>er("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[er("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[ve("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"}),ve("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"})]}),ve("defs",{children:ve("clipPath",{id:"magnifying-glass_svg__a",children:ve("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),tr=pn;import{jsx as rr}from"@emotion/react/jsx-runtime";var un=e=>rr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:rr("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"})}),or=un;import{jsx as nr}from"@emotion/react/jsx-runtime";var mn=e=>nr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:nr("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"})}),he=mn;import{useThrottle as Rn}from"react-use";import{v4 as kn}from"uuid";import{useState as fn,useRef as mr,useEffect as vn}from"react";function De(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}import{format as hn}from"timeago.js";import{css as U}from"@emotion/react";import{mq as gn}from"@uniformdev/design-system";var ar=U`
148
+ `,jo],children:e==null?void 0:e.map((t,n)=>{var f,u;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(f=r.find(v=>v.id===a.id))==null?void 0:f.name;return q("li",{css:zt,children:X("div",{css:Ut,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?q("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:At,"data-test-id":"product-image"}):q("div",{css:Gt}),X("h4",{css:Bt,"data-test-id":"product-name",children:[t.title||t.name,d&&q("span",{css:Ot,children:d})]}),t&&X($t,{children:[X("p",{css:Be,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,q("br",{})]}),t.price!==void 0?X("p",{css:Be,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?X("a",{css:Mt,href:(u=t.editLink)!=null?u:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[q("span",{css:Vt,children:"Edit"}),o?q($,{src:o,alt:"Logo",css:Dt}):null]}):null]})]})},`product-${t.id}`)})})]})};import Nn,{useContext as Qn,useMemo as Wn,useRef as _n}from"react";import*as G from"react";var He={};Eo(He,{Caution:()=>Kt,Checkmark:()=>Ee,ChevronDown:()=>Me,Close:()=>Wt,Danger:()=>Zt,ExclamationPoint:()=>qt,Info:()=>Ve,Lightbulb:()=>jt,MagnifyingGlass:()=>tr,MaximizeAlt:()=>or,Minus:()=>Re,MoreVerticalAlt:()=>he,Plus:()=>Le});import{jsx as Ft}from"@emotion/react/jsx-runtime";var en=e=>Ft("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",role:"img",...e,children:Ft("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"})}),Kt=en;import{jsx as Nt}from"@emotion/react/jsx-runtime";var tn=e=>Nt("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:Nt("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"})}),Ee=tn;import{jsx as Qt}from"@emotion/react/jsx-runtime";var rn=e=>Qt("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",role:"img",...e,children:Qt("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"})}),Me=rn;import{jsx as Oe,jsxs as nn}from"@emotion/react/jsx-runtime";var on=e=>Oe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",role:"img",...e,children:nn("g",{fillRule:"evenodd",children:[Oe("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"}),Oe("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"})]})}),Wt=on;import{jsx as _t}from"@emotion/react/jsx-runtime";var an=e=>_t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:_t("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"})}),Zt=an;import{jsx as Xt}from"@emotion/react/jsx-runtime";var sn=e=>Xt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",role:"img",...e,children:Xt("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"})}),qt=sn;import{jsx as Yt,jsxs as dn}from"@emotion/react/jsx-runtime";var cn=e=>dn("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:[Yt("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"}),Yt("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"})]}),Ve=cn;import{jsx as Jt}from"@emotion/react/jsx-runtime";var ln=e=>Jt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:Jt("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"})}),jt=ln;import{jsx as ve,jsxs as er}from"@emotion/react/jsx-runtime";var pn=e=>er("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:[er("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[ve("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"}),ve("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"})]}),ve("defs",{children:ve("clipPath",{id:"magnifying-glass_svg__a",children:ve("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),tr=pn;import{jsx as rr}from"@emotion/react/jsx-runtime";var mn=e=>rr("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:rr("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"})}),or=mn;import{jsx as nr}from"@emotion/react/jsx-runtime";var un=e=>nr("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:nr("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"})}),he=un;import{useThrottle as Rn}from"react-use";import{v4 as kn}from"uuid";import{useState as fn,useRef as ur,useEffect as vn}from"react";function De(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}import{format as hn}from"timeago.js";import{css as U}from"@emotion/react";import{mq as gn}from"@uniformdev/design-system";var ar=U`
149
149
  border: 1px solid var(--gray-200);
150
150
  background: var(--gray-50);
151
151
  border-radius: var(--rounded-base);
@@ -188,7 +188,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
188
188
  `,ye=U`
189
189
  font-weight: var(--fw-bold);
190
190
  margin-right: var(--spacing-sm);
191
- `,ur=U`
191
+ `,mr=U`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  gap: var(--spacing-sm);
@@ -213,11 +213,11 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
213
213
  &:hover {
214
214
  background: var(--gray-50);
215
215
  }
216
- `;import{css as Y}from"@emotion/react";import{Icon as gr}from"@uniformdev/design-system";import{CgClose as yn,CgInfo as bn}from"react-icons/cg";import{Fragment as Sn,jsx as K,jsxs as R}from"@emotion/react/jsx-runtime";var fr=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var v;let n=mr(null),a=mr(null),[d,f]=fn(!1);vn(()=>{let i=y=>{n.current&&!n.current.contains(y.target)&&a.current&&!a.current.contains(y.target)&&f(!1)},p=()=>{f(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let m=()=>{var i;if(f(!d),a.current&&n.current){let p=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),y=a.current.offsetWidth;a.current.style.top=`${p.top+30}px`,a.current.style.left=`${p.left-y+30}px`}};return K("div",{css:ar,children:R("div",{css:ir,children:[R("div",{css:sr,children:[R("div",{css:cr,children:[K("h4",{css:[dr,e.popoverData?Y`
216
+ `;import{css as Y}from"@emotion/react";import{Icon as gr}from"@uniformdev/design-system";import{CgClose as yn,CgInfo as bn}from"react-icons/cg";import{Fragment as Sn,jsx as K,jsxs as R}from"@emotion/react/jsx-runtime";var fr=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var v;let n=ur(null),a=ur(null),[d,f]=fn(!1);vn(()=>{let i=y=>{n.current&&!n.current.contains(y.target)&&a.current&&!a.current.contains(y.target)&&f(!1)},p=()=>{f(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let u=()=>{var i;if(f(!d),a.current&&n.current){let p=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),y=a.current.offsetWidth;a.current.style.top=`${p.top+30}px`,a.current.style.left=`${p.left-y+30}px`}};return K("div",{css:ar,children:R("div",{css:ir,children:[R("div",{css:sr,children:[R("div",{css:cr,children:[K("h4",{css:[dr,e.popoverData?Y`
217
217
  margin-bottom: var(--spacing-sm);
218
218
  `:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?R(Sn,{children:[K("button",{type:"button",ref:n,css:Y`
219
219
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
220
- `,"aria-controls":"path-details","aria-expanded":d,onClick:m,children:K(gr,{icon:bn,iconColor:"gray",size:24,css:Y`
220
+ `,"aria-controls":"path-details","aria-expanded":d,onClick:u,children:K(gr,{icon:bn,iconColor:"gray",size:24,css:Y`
221
221
  opacity: var(--opacity-75);
222
222
  `})}),K("div",{id:"path-details","aria-hidden":!d,ref:a,css:[pr,d?Y`
223
223
  visibility: visible;
@@ -229,7 +229,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
229
229
  order: 1;
230
230
  `],children:[R("span",{css:[ye,Y`
231
231
  order: 1;
232
- `],children:[i,":"]}),p]},i)):null]}),R("div",{css:ur,children:[e.editLink?R("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(De(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:$e,children:[K("span",{css:te,children:"Edit"}),K($,{src:r,css:lr,alt:"Logo"})]}):null,R("button",{type:"button",onClick:()=>{o(e)},css:$e,children:[K("span",{css:te,children:"Unlink"}),K(gr,{icon:yn,iconColor:"red",size:16})]})]})]})},e.id)};import{useState as xn,useRef as xr,useEffect as wn}from"react";import{css as re}from"@emotion/react";var vr=re`
232
+ `],children:[i,":"]}),p]},i)):null]}),R("div",{css:mr,children:[e.editLink?R("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(De(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:$e,children:[K("span",{css:te,children:"Edit"}),K($,{src:r,css:lr,alt:"Logo"})]}):null,R("button",{type:"button",onClick:()=>{o(e)},css:$e,children:[K("span",{css:te,children:"Unlink"}),K(gr,{icon:yn,iconColor:"red",size:16})]})]})]})},e.id)};import{useState as xn,useRef as xr,useEffect as wn}from"react";import{css as re}from"@emotion/react";var vr=re`
233
233
  cursor: pointer;
234
234
  padding: var(--spacing-sm);
235
235
  position: relative;
@@ -260,11 +260,11 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
260
260
  `,Sr=re`
261
261
  position: absolute;
262
262
  inset: 0 var(--spacing-sm) 0 auto;
263
- `;import{css as wr}from"@emotion/react";import{Fragment as Cn,jsx as Cr,jsxs as oe}from"@emotion/react/jsx-runtime";var Pr=({result:e,isSelected:r,triggerSelection:o})=>{let t=xr(null),n=xr(null),[a,d]=xn(!1);wn(()=>{function m(v){t.current&&!t.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&d(!1)}return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[n]);let f=m=>{m.stopPropagation(),d(!a)};return oe("div",{css:[vr,r?yr:void 0,e.popoverData?hr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?oe(Cn,{children:[Cr("button",{type:"button",ref:t,css:Sr,"aria-controls":"path-details",onClick:m=>f(m),"aria-expanded":a,children:Cr(Ve,{width:24,height:24})}),oe("div",{id:"path-details","aria-hidden":!a,ref:n,css:[br,a?wr`
263
+ `;import{css as wr}from"@emotion/react";import{Fragment as Cn,jsx as Cr,jsxs as oe}from"@emotion/react/jsx-runtime";var Pr=({result:e,isSelected:r,triggerSelection:o})=>{let t=xr(null),n=xr(null),[a,d]=xn(!1);wn(()=>{function u(v){t.current&&!t.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&d(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[n]);let f=u=>{u.stopPropagation(),d(!a)};return oe("div",{css:[vr,r?yr:void 0,e.popoverData?hr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?oe(Cn,{children:[Cr("button",{type:"button",ref:t,css:Sr,"aria-controls":"path-details",onClick:u=>f(u),"aria-expanded":a,children:Cr(Ve,{width:24,height:24})}),oe("div",{id:"path-details","aria-hidden":!a,ref:n,css:[br,a?wr`
264
264
  visibility: visible;
265
265
  `:wr`
266
266
  visibility: hidden;
267
- `],children:[e.metadata&&Object.entries(e.metadata).map(([m,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[m,":"]}),v]},i)),Object.entries(e.popoverData).map(([m,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[m,":"]}),v]},i))]})]}):null]},e.id)};import{Droppable as In,DragDropContext as Tn,Draggable as En}from"react-beautiful-dnd";import{css as P}from"@emotion/react";var Lr=P`
267
+ `],children:[e.metadata&&Object.entries(e.metadata).map(([u,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[u,":"]}),v]},i)),Object.entries(e.popoverData).map(([u,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[u,":"]}),v]},i))]})]}):null]},e.id)};import{Droppable as In,DragDropContext as Tn,Draggable as En}from"react-beautiful-dnd";import{css as P}from"@emotion/react";var Lr=P`
268
268
  background: var(--white);
269
269
  border: 1px solid var(--gray-300);
270
270
  border-radius: var(--rounded-base);
@@ -352,7 +352,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
352
352
  `,Qe=P`
353
353
  width: calc(var(--spacing-lg) + var(--spacing-xs));
354
354
  height: calc(var(--spacing-lg) + var(--spacing-xs));
355
- `;import{css as N}from"@emotion/react";import{InputSelect as Mn,scrollbarStyles as Vn,Button as We,Callout as Dn,InputKeywordSearch as zn,LoadingIndicator as Un,Menu as An,MenuItem as Gn,LoadingOverlay as Bn}from"@uniformdev/design-system";import{useState as Pn,useEffect as Ar,useRef as Ln}from"react";function Gr(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=Pn("IDLE"),a=Ln(void 0);return Ar(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),Ar(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}import{Fragment as Hn,jsx as g,jsxs as A}from"@emotion/react/jsx-runtime";var On=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),g(Dn,{type:"info",children:o})},Br=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:f,rowComponent:m,selectedItemComponent:v,totalResults:i,cursor:p,resultsLoading:y,requireContentType:D,onAddNew:ae,onEditClosed:S,onCancel:b,noResultsComponent:ie,helpComponent:ue,onSort:O,typeSelectorLabel:_="Content Type Select",typeSelectorAllTypesOptionText:W="All content types",loadingIndicatorDelay:me=1e3})=>{var nt,at,it;let j=()=>D?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[H,E]=G.useState(""),[u,V]=G.useState(j),[s,z]=G.useState(!1),[C,ee]=G.useState([]),[fo,et]=G.useState(!1),Ae=G.useRef(`x${kn()}`),xe=Rn(H,750);G.useEffect(()=>{e(xe,{count:5,offset:0,contentType:u==="any"?void 0:u})},[xe,u]);let vo=Gr(y,{delay:me}),ho=c=>{C.some(h=>h.id===c.id)?ee(h=>h.filter(Z=>Z.id!==c.id)):ee(d?h=>[...h,c]:[c])},yo=t==null?void 0:t.map(c=>c.id+c.title).join(",");G.useEffect(()=>{Array.isArray(t)&&ee(t)},[yo]);let bo=()=>{V(j()),E(""),ee(t!=null&&t.length?t:[])},So=()=>{z(c=>!c),s||bo()},tt=c=>{let h=(C==null?void 0:C.filter(Z=>Z.id!==c.id))||[];ee(h),a(h,"")},xo=c=>{c.preventDefault(),a(C,u),z(!1)},wo=c=>{c.preventDefault(),z(!1),b&&b()},Co=()=>{e(xe,{count:5,offset:(r==null?void 0:r.length)||0,contentType:u==="any"?void 0:u,cursor:p}),et(!0);let c=setTimeout(()=>{et(!1)},750);return()=>clearTimeout(c)},Po=!(t==null?void 0:t.length)||d,Lo=m||Pr,rt=v||fr,Ro=ie||On,ot=n&&typeof n!="string"?n:null,ko=ot?g(ot,{css:Qe}):g("img",{src:n,alt:"Logo",css:Qe}),Io=c=>{var h,Z;if(c.destination&&c.source.droppableId===((h=c.destination)==null?void 0:h.droppableId)){let M=[...t||[]],[ge]=(Z=M==null?void 0:M.splice(c.source.index,1))!=null?Z:[];return M==null||M.splice(c.destination.index,0,ge),O&&(ee(M),O==null||O(M)),M}};return g("div",{css:N`
355
+ `;import{css as N}from"@emotion/react";import{InputSelect as Mn,scrollbarStyles as Vn,Button as We,Callout as Dn,InputKeywordSearch as zn,LoadingIndicator as Un,Menu as An,MenuItem as Gn,LoadingOverlay as Bn}from"@uniformdev/design-system";import{useState as Pn,useEffect as Ar,useRef as Ln}from"react";function Gr(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=Pn("IDLE"),a=Ln(void 0);return Ar(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),Ar(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}import{Fragment as Hn,jsx as g,jsxs as A}from"@emotion/react/jsx-runtime";var On=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),g(Dn,{type:"info",children:o})},Br=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:f,rowComponent:u,selectedItemComponent:v,totalResults:i,cursor:p,resultsLoading:y,requireContentType:D,onAddNew:ae,onEditClosed:S,onCancel:b,noResultsComponent:ie,helpComponent:me,onSort:O,typeSelectorLabel:_="Content Type Select",typeSelectorAllTypesOptionText:W="All content types",loadingIndicatorDelay:ue=1e3})=>{var nt,at,it;let j=()=>D?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[H,E]=G.useState(""),[m,V]=G.useState(j),[s,z]=G.useState(!1),[C,ee]=G.useState([]),[fo,et]=G.useState(!1),Ae=G.useRef(`x${kn()}`),xe=Rn(H,750);G.useEffect(()=>{e(xe,{count:5,offset:0,contentType:m==="any"?void 0:m})},[xe,m]);let vo=Gr(y,{delay:ue}),ho=c=>{C.some(h=>h.id===c.id)?ee(h=>h.filter(Z=>Z.id!==c.id)):ee(d?h=>[...h,c]:[c])},yo=t==null?void 0:t.map(c=>c.id+c.title).join(",");G.useEffect(()=>{Array.isArray(t)&&ee(t)},[yo]);let bo=()=>{V(j()),E(""),ee(t!=null&&t.length?t:[])},So=()=>{z(c=>!c),s||bo()},tt=c=>{let h=(C==null?void 0:C.filter(Z=>Z.id!==c.id))||[];ee(h),a(h,"")},xo=c=>{c.preventDefault(),a(C,m),z(!1)},wo=c=>{c.preventDefault(),z(!1),b&&b()},Co=()=>{e(xe,{count:5,offset:(r==null?void 0:r.length)||0,contentType:m==="any"?void 0:m,cursor:p}),et(!0);let c=setTimeout(()=>{et(!1)},750);return()=>clearTimeout(c)},Po=!(t==null?void 0:t.length)||d,Lo=u||Pr,rt=v||fr,Ro=ie||On,ot=n&&typeof n!="string"?n:null,ko=ot?g(ot,{css:Qe}):g("img",{src:n,alt:"Logo",css:Qe}),Io=c=>{var h,Z;if(c.destination&&c.source.droppableId===((h=c.destination)==null?void 0:h.droppableId)){let M=[...t||[]],[ge]=(Z=M==null?void 0:M.splice(c.source.index,1))!=null?Z:[];return M==null||M.splice(c.destination.index,0,ge),O&&(ee(M),O==null||O(M)),M}};return g("div",{css:N`
356
356
  width: 100%;
357
357
  `,children:A("div",{css:N`
358
358
  position: relative;
@@ -361,13 +361,13 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
361
361
  margin-left: var(--spacing-base);
362
362
  `,children:"Select"}),g("span",{css:Mr,children:g(Me,{css:[Vr,s?N`
363
363
  transform: rotate(180deg);
364
- `:void 0]})})]})}),A("div",{id:`entry-search-config-${Ae.current}`,"aria-hidden":!s,css:[Ir,s?void 0:Tr],children:[ue||null,A("div",{css:N`
364
+ `:void 0]})})]})}),A("div",{id:`entry-search-config-${Ae.current}`,"aria-hidden":!s,css:[Ir,s?void 0:Tr],children:[me||null,A("div",{css:N`
365
365
  display: flex;
366
366
  gap: calc(var(--spacing-base) - 0.25rem);
367
367
  margin-bottom: var(--spacing-base);
368
- `,children:[g(Mn,{onChange:c=>V(c.target.value),value:u,label:_,showLabel:!1,options:[...D?[]:[{value:"any",label:W}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),g("div",{css:N`
368
+ `,children:[g(Mn,{onChange:c=>V(c.target.value),value:m,label:_,showLabel:!1,options:[...D?[]:[{value:"any",label:W}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),g("div",{css:N`
369
369
  flex-grow: 1;
370
- `,children:g(zn,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:E,disabledFieldSubmission:!0,value:H})})]}),A("div",{css:[Er,Vn],id:Ae.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[g(Bn,{isActive:vo}),Array.isArray(r)&&r.length>0?r.map(c=>g(Lo,{isSelected:C.some(h=>h.id===c.id),result:c,triggerSelection:()=>ho(c)},c.id)):g(Ro,{searchText:xe||H,selectedContentType:(at=(nt=o==null?void 0:o.find(c=>c.id===u))==null?void 0:nt.name)!=null?at:u}),!y&&typeof i!="undefined"&&r&&(r==null?void 0:r.length)<i&&g("button",{type:"button",css:kr,onClick:Co,children:fo?g(Un,{}):"Load More"})]}),A("div",{css:N`
370
+ `,children:g(zn,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:E,disabledFieldSubmission:!0,value:H})})]}),A("div",{css:[Er,Vn],id:Ae.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[g(Bn,{isActive:vo}),Array.isArray(r)&&r.length>0?r.map(c=>g(Lo,{isSelected:C.some(h=>h.id===c.id),result:c,triggerSelection:()=>ho(c)},c.id)):g(Ro,{searchText:xe||H,selectedContentType:(at=(nt=o==null?void 0:o.find(c=>c.id===m))==null?void 0:nt.name)!=null?at:m}),!y&&typeof i!="undefined"&&r&&(r==null?void 0:r.length)<i&&g("button",{type:"button",css:kr,onClick:Co,children:fo?g(Un,{}):"Load More"})]}),A("div",{css:N`
371
371
  display: flex;
372
372
  justify-content: space-between;
373
373
  `,children:[g("div",{children:ae&&((it=o==null?void 0:o.length)!=null?it:0)>0?g(An,{menuLabel:"Add new menu",menuTrigger:g(We,{buttonType:"secondary",children:"Add New"}),children:o==null?void 0:o.map(c=>g(Gn,{css:N`
@@ -412,7 +412,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
412
412
  width: 1.5rem;
413
413
  color: var(--brand-secondary-3);
414
414
  margin-left: auto;
415
- `;import{css as Wr}from"@emotion/react";import{jsx as ce,jsxs as _e}from"@emotion/react/jsx-runtime";function _r({result:e,isSelected:r,triggerSelection:o}){var f;let{categories:t,logoIcon:n}=ze(),[a]=e.categories||[{id:"",name:""}],d=typeof a=="undefined"||!t||(f=t.find(m=>m.id===a.id))==null?void 0:f.name;return ce("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Or],children:_e("div",{css:[Hr,r?$r:void 0],children:[e.thumbnailUrl?ce("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Wr`
415
+ `;import{css as Wr}from"@emotion/react";import{jsx as ce,jsxs as _e}from"@emotion/react/jsx-runtime";function _r({result:e,isSelected:r,triggerSelection:o}){var f;let{categories:t,logoIcon:n}=ze(),[a]=e.categories||[{id:"",name:""}],d=typeof a=="undefined"||!t||(f=t.find(u=>u.id===a.id))==null?void 0:f.name;return ce("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Or],children:_e("div",{css:[Hr,r?$r:void 0],children:[e.thumbnailUrl?ce("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Wr`
416
416
  background-color: var(--gray-200);
417
417
  width: 3rem;
418
418
  height: 3rem;
@@ -501,7 +501,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
501
501
  margin-right: var(--spacing-xs);
502
502
  `,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?Q("li",{children:[B("span",{css:de`
503
503
  margin-right: var(--spacing-xs);
504
- `,children:"Price:"}),B("span",{children:e.price})]}):null]})]})]}),Q("div",{css:jr,children:[e.editLink?Q("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:Xe,children:[B("span",{css:qe,children:"Edit"}),B($,{src:t,alt:"Logo",css:Jr})]}):null,Q("button",{type:"button",onClick:()=>{r==null||r(e)},css:Xe,children:[B("span",{css:qe,children:"Unlink"}),B($n,{icon:Kn,iconColor:"red",size:16})]})]})]})},e.id)}import{Callout as Zn}from"@uniformdev/design-system";import{useAsync as Xn,useAsyncFn as qn}from"react-use";import{jsx as Ye,jsxs as Yn}from"@emotion/react/jsx-runtime";function Js({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:f,rowComponent:m,errorComponent:v,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D="All categories",typeSelectorLabel:ae="Select Category"}){var j,H;let{value:S,loading:b,error:ie}=Xn(async()=>await o(),[o]),ue=S==null?void 0:S.map(E=>E.id).join(","),O=Wn(()=>S?S.map(u=>({id:u.id,name:u.name})):void 0,[ue]),_=_n(),[W,me]=qn(async(E,u)=>{let V=await t({text:E,options:{limit:u==null?void 0:u.count,offset:u==null?void 0:u.offset,categoryId:u==null?void 0:u.contentType,cursor:u==null?void 0:u.cursor}});return(u==null?void 0:u.offset)===0&&(_.current=[]),(_.current=_.current||[]).push(...V.products),V},[t]),Se=async E=>{await r(E)};return ie||W.error?Ye(v||(({categoriesError:u,searchError:V})=>Yn(Zn,{type:"error",children:["There was an error: ",(u==null?void 0:u.message)||(V==null?void 0:V.message)]})),{categoriesError:ie,searchError:W.error}):Ye(to.Provider,{value:{categories:S,logoIcon:n},children:Ye(Br,{search:me,results:_.current,logoIcon:n,selectedItems:e,select:Se,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:O,selectedItemComponent:f||eo,rowComponent:m||_r,totalResults:(j=W.value)==null?void 0:j.total,cursor:(H=W.value)==null?void 0:H.cursor,resultsLoading:W.loading||b,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D,typeSelectorLabel:ae})})}var to=Nn.createContext(void 0),ze=()=>{let e=Qn(to);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};import{css as k}from"@emotion/react";import{mq as Jn}from"@uniformdev/design-system";var ro=k`
504
+ `,children:"Price:"}),B("span",{children:e.price})]}):null]})]})]}),Q("div",{css:jr,children:[e.editLink?Q("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:Xe,children:[B("span",{css:qe,children:"Edit"}),B($,{src:t,alt:"Logo",css:Jr})]}):null,Q("button",{type:"button",onClick:()=>{r==null||r(e)},css:Xe,children:[B("span",{css:qe,children:"Unlink"}),B($n,{icon:Kn,iconColor:"red",size:16})]})]})]})},e.id)}import{Callout as Zn}from"@uniformdev/design-system";import{useAsync as Xn,useAsyncFn as qn}from"react-use";import{jsx as Ye,jsxs as Yn}from"@emotion/react/jsx-runtime";function Js({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:f,rowComponent:u,errorComponent:v,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D="All categories",typeSelectorLabel:ae="Select Category"}){var j,H;let{value:S,loading:b,error:ie}=Xn(async()=>await o(),[o]),me=S==null?void 0:S.map(E=>E.id).join(","),O=Wn(()=>S?S.map(m=>({id:m.id,name:m.name})):void 0,[me]),_=_n(),[W,ue]=qn(async(E,m)=>{let V=await t({text:E,options:{limit:m==null?void 0:m.count,offset:m==null?void 0:m.offset,categoryId:m==null?void 0:m.contentType,cursor:m==null?void 0:m.cursor}});return(m==null?void 0:m.offset)===0&&(_.current=[]),(_.current=_.current||[]).push(...V.products),V},[t]),Se=async E=>{await r(E)};return ie||W.error?Ye(v||(({categoriesError:m,searchError:V})=>Yn(Zn,{type:"error",children:["There was an error: ",(m==null?void 0:m.message)||(V==null?void 0:V.message)]})),{categoriesError:ie,searchError:W.error}):Ye(to.Provider,{value:{categories:S,logoIcon:n},children:Ye(Br,{search:ue,results:_.current,logoIcon:n,selectedItems:e,select:Se,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:O,selectedItemComponent:f||eo,rowComponent:u||_r,totalResults:(j=W.value)==null?void 0:j.total,cursor:(H=W.value)==null?void 0:H.cursor,resultsLoading:W.loading||b,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D,typeSelectorLabel:ae})})}var to=Nn.createContext(void 0),ze=()=>{let e=Qn(to);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};import{css as k}from"@emotion/react";import{mq as Jn}from"@uniformdev/design-system";var ro=k`
505
505
  border: 1px solid var(--gray-200);
506
506
  background: var(--gray-50);
507
507
  border-radius: var(--rounded-base);
@@ -574,7 +574,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
574
574
  display: flex;
575
575
  margin-top: var(--spacing-sm);
576
576
  gap: var(--spacing-sm);
577
- `,uo=k`
577
+ `,mo=k`
578
578
  background: none;
579
579
  outline: none;
580
580
  border: none;
@@ -584,9 +584,9 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
584
584
  max-width: 100%;
585
585
  min-width: 100px;
586
586
  height: auto;
587
- `;import{useState as jn,useRef as mo,useEffect as ea}from"react";import{CgInfo as ta,CgClose as ra}from"react-icons/cg";import{format as oa}from"timeago.js";import{css as pe}from"@emotion/react";import{Icon as go}from"@uniformdev/design-system";import{Fragment as aa,jsx as I,jsxs as T}from"@emotion/react/jsx-runtime";function uc({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=mo(null),d=mo(null),[f,m]=jn(!1);ea(()=>{let p=D=>{a.current&&!a.current.contains(D.target)&&d.current&&!d.current.contains(D.target)&&m(!1)},y=()=>{m(!1)};return window.addEventListener("resize",y,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",y,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[d]);let v=()=>{var p;if(m(!f),d.current&&a.current){let y=(p=a==null?void 0:a.current)==null?void 0:p.getBoundingClientRect();d.current.style.top=`${y.top+30}px`}},i=n!=null?n:na;return I("div",{css:[ro,pe`
587
+ `;import{useState as jn,useRef as uo,useEffect as ea}from"react";import{CgInfo as ta,CgClose as ra}from"react-icons/cg";import{format as oa}from"timeago.js";import{css as pe}from"@emotion/react";import{Icon as go}from"@uniformdev/design-system";import{Fragment as aa,jsx as I,jsxs as T}from"@emotion/react/jsx-runtime";function mc({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=uo(null),d=uo(null),[f,u]=jn(!1);ea(()=>{let p=D=>{a.current&&!a.current.contains(D.target)&&d.current&&!d.current.contains(D.target)&&u(!1)},y=()=>{u(!1)};return window.addEventListener("resize",y,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",y,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[d]);let v=()=>{var p;if(u(!f),d.current&&a.current){let y=(p=a==null?void 0:a.current)==null?void 0:p.getBoundingClientRect();d.current.style.top=`${y.top+30}px`}},i=n!=null?n:na;return I("div",{css:[ro,pe`
588
588
  margin: 0 0 1rem 0;
589
- `],children:T("div",{css:oo,children:[T("div",{css:no,children:[T("div",{css:ao,children:[I("h4",{css:[io],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?T(aa,{children:[I("button",{type:"button",ref:a,css:uo,"aria-controls":"path-details","aria-expanded":f,onClick:v,children:I(go,{icon:ta,iconColor:"gray",size:24,css:pe`
589
+ `],children:T("div",{css:oo,children:[T("div",{css:no,children:[T("div",{css:ao,children:[I("h4",{css:[io],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?T(aa,{children:[I("button",{type:"button",ref:a,css:mo,"aria-controls":"path-details","aria-expanded":f,onClick:v,children:I(go,{icon:ta,iconColor:"gray",size:24,css:pe`
590
590
  opacity: var(--opacity-75);
591
591
  `})}),I("div",{id:"path-details","aria-hidden":!f,ref:d,css:[co,f?pe`
592
592
  visibility: visible;
@@ -596,4 +596,4 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
596
596
  order: 1;
597
597
  `],children:[T("span",{css:[Ue,pe`
598
598
  order: 1;
599
- `],children:[o,":"]}),t]},o)):null,e.createdDate?T("li",{css:le,children:[I("span",{css:Ue,children:"Date:"}),oa(e.createdDate)]}):null]})]}):null}import{LoadingIndicator as ia,Theme as sa}from"@uniformdev/design-system";import{jsx as be,jsxs as ca}from"@emotion/react/jsx-runtime";var yc=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=ut();if(t||!a){let d=r;return d?be(d,{}):be(ia,{})}if(n){let d=o;if(d)return be(d,{error:n});throw n}return ca(we.Provider,{value:{sdk:a},children:[be(sa,{}),be(Ce,{children:e})]})};export*from"@uniformdev/mesh-sdk";import{Button as Ic,Callout as Tc,LoadingIndicator as Ec,LoadingOverlay as Mc,Menu as Vc,MenuItem as Dc,Input as zc,InputSelect as Uc,InputToggle as Ac,Theme as Gc,InputKeywordSearch as Bc,Heading as Oc,ScrollableList as Hc,ScrollableListItem as $c,Textarea as Fc,Switch as Kc,Label as Nc,AddListButton as Qc}from"@uniformdev/design-system";export{Qc as AddListButton,Ic as Button,Tc as Callout,uc as DamSelectedItem,Pr as DefaultSearchRow,fr as DefaultSelectedItem,Br as EntrySearch,Oc as Heading,He as Icons,zc as Input,Uc as InputSelect,Ac as InputToggle,Bc as KeywordSearchInput,Nc as Label,Ec as LoadingIndicator,Mc as LoadingOverlay,Vc as Menu,Dc as MenuItem,yc as MeshApp,Tt as ProductPreviewList,ri as ProductQuery,kt as ProductQueryContext,Js as ProductSearch,to as ProductSearchContext,_r as ProductSearchRow,eo as ProductSelectedItem,ft as ResolvableLoadingValue,Hc as ScrollableList,$c as ScrollableListItem,St as SelectionField,Kc as Switch,Fc as Textarea,Gc as Theme,lt as UniformMeshLocationContext,Ce as UniformMeshLocationContextProvider,we as UniformMeshSdkContext,ha as UniformMeshSdkContextProvider,Qe as badgeIcon,je as damSelectItemImage,ro as damSelectedItemContainer,ao as damSelectedItemCopy,no as damSelectedItemDetails,so as damSelectedItemIcon,uo as damSelectedItemInfoBtn,oo as damSelectedItemInner,Je as damSelectedItemLinkBtn,lo as damSelectedItemLinkContainer,po as damSelectedItemMediaContainer,co as damSelectedItemPopover,Ue as damSelectedItemPopoverLabel,le as damSelectedItemSmallText,io as damSelectedItemTitle,Dr as draggableContainer,Ne as draggableIcon,Ur as draggableIconOffset,zr as draggableIconWrapper,Rr as entrySearchBtn,Ir as entrySearchConfig,Tr as entrySearchConfigHidden,kr as entrySearchLoadMoreBtn,Er as entrySearchResultList,Mr as entrySearchSelectIcon,Vr as entrySearchSelectImg,is as entrySearchSelectInput,ss as entrySearchSelectOption,Lr as entrySearchWrapper,Qr as productSearchRowActiveIcon,Kr as productSearchRowCategory,Or as productSearchRowContainer,Hr as productSearchRowContent,$r as productSearchRowContentActive,Nr as productSearchRowDetails,Fr as productSearchRowTitle,Xr as productSelectedItemContainer,Yr as productSelectedItemContent,qr as productSelectedItemDetails,Jr as productSelectedItemIcon,Ze as productSelectedItemImage,jr as productSelectedItemLinkContainer,Xe as productedSelectedItemLinkBtn,qe as productedSelectedItemSmallText,Sr as searchRowBtn,vr as searchRowContainer,yr as searchRowContainerActive,hr as searchRowContainerWithPopover,br as searchRowPopover,Ke as searchRowText,Fe as searchRowTextSmall,$e as selectItemLinkBtn,ur as selectItemLinkContainer,pr as selectItemPopover,ye as selectItemPopoverLabel,te as selectItemSmallText,ar as selectedItemContainer,cr as selectedItemCopy,sr as selectedItemDetails,lr as selectedItemIcon,ir as selectedItemInner,dr as selectedItemTitle,ut as useInitializeUniformMeshSdk,Da as useMeshLocation,It as useProductQueryContext,ze as useProductSearchContext,Ra as useUniformMeshLocation,Pe as useUniformMeshLocationContext,dt as useUniformMeshSdk,ct as useUniformMeshSdkContext};
599
+ `],children:[o,":"]}),t]},o)):null,e.createdDate?T("li",{css:le,children:[I("span",{css:Ue,children:"Date:"}),oa(e.createdDate)]}):null]})]}):null}import{LoadingIndicator as ia,Theme as sa}from"@uniformdev/design-system";import{jsx as be,jsxs as ca}from"@emotion/react/jsx-runtime";var yc=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=mt();if(t||!a){let d=r;return d?be(d,{}):be(ia,{})}if(n){let d=o;if(d)return be(d,{error:n});throw n}return ca(we.Provider,{value:{sdk:a},children:[be(sa,{}),be(Ce,{children:e})]})};export*from"@uniformdev/mesh-sdk";import{Button as Ic,Callout as Tc,LoadingIndicator as Ec,LoadingOverlay as Mc,Menu as Vc,MenuItem as Dc,Input as zc,InputSelect as Uc,InputToggle as Ac,Theme as Gc,InputKeywordSearch as Bc,Heading as Oc,ScrollableList as Hc,ScrollableListItem as $c,Textarea as Fc,Switch as Kc,Label as Nc,AddListButton as Qc}from"@uniformdev/design-system";export{Qc as AddListButton,Ic as Button,Tc as Callout,mc as DamSelectedItem,Pr as DefaultSearchRow,fr as DefaultSelectedItem,Br as EntrySearch,Oc as Heading,He as Icons,zc as Input,Uc as InputSelect,Ac as InputToggle,Bc as KeywordSearchInput,Nc as Label,Ec as LoadingIndicator,Mc as LoadingOverlay,Vc as Menu,Dc as MenuItem,yc as MeshApp,Tt as ProductPreviewList,ri as ProductQuery,kt as ProductQueryContext,Js as ProductSearch,to as ProductSearchContext,_r as ProductSearchRow,eo as ProductSelectedItem,ft as ResolvableLoadingValue,Hc as ScrollableList,$c as ScrollableListItem,St as SelectionField,Kc as Switch,Fc as Textarea,Gc as Theme,lt as UniformMeshLocationContext,Ce as UniformMeshLocationContextProvider,we as UniformMeshSdkContext,ha as UniformMeshSdkContextProvider,Qe as badgeIcon,je as damSelectItemImage,ro as damSelectedItemContainer,ao as damSelectedItemCopy,no as damSelectedItemDetails,so as damSelectedItemIcon,mo as damSelectedItemInfoBtn,oo as damSelectedItemInner,Je as damSelectedItemLinkBtn,lo as damSelectedItemLinkContainer,po as damSelectedItemMediaContainer,co as damSelectedItemPopover,Ue as damSelectedItemPopoverLabel,le as damSelectedItemSmallText,io as damSelectedItemTitle,Dr as draggableContainer,Ne as draggableIcon,Ur as draggableIconOffset,zr as draggableIconWrapper,Rr as entrySearchBtn,Ir as entrySearchConfig,Tr as entrySearchConfigHidden,kr as entrySearchLoadMoreBtn,Er as entrySearchResultList,Mr as entrySearchSelectIcon,Vr as entrySearchSelectImg,is as entrySearchSelectInput,ss as entrySearchSelectOption,Lr as entrySearchWrapper,Qr as productSearchRowActiveIcon,Kr as productSearchRowCategory,Or as productSearchRowContainer,Hr as productSearchRowContent,$r as productSearchRowContentActive,Nr as productSearchRowDetails,Fr as productSearchRowTitle,Xr as productSelectedItemContainer,Yr as productSelectedItemContent,qr as productSelectedItemDetails,Jr as productSelectedItemIcon,Ze as productSelectedItemImage,jr as productSelectedItemLinkContainer,Xe as productedSelectedItemLinkBtn,qe as productedSelectedItemSmallText,Sr as searchRowBtn,vr as searchRowContainer,yr as searchRowContainerActive,hr as searchRowContainerWithPopover,br as searchRowPopover,Ke as searchRowText,Fe as searchRowTextSmall,$e as selectItemLinkBtn,mr as selectItemLinkContainer,pr as selectItemPopover,ye as selectItemPopoverLabel,te as selectItemSmallText,ar as selectedItemContainer,cr as selectedItemCopy,sr as selectedItemDetails,lr as selectedItemIcon,ir as selectedItemInner,dr as selectedItemTitle,mt as useInitializeUniformMeshSdk,Da as useMeshLocation,It as useProductQueryContext,ze as useProductSearchContext,Ra as useUniformMeshLocation,Pe as useUniformMeshLocationContext,dt as useUniformMeshSdk,ct as useUniformMeshSdkContext};
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Wo=Object.create;var Oe=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Xo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var Gr=(e,r)=>{for(var o in r)Oe(e,o,{get:r[o],enumerable:!0})},Be=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Zo(r))!qo.call(e,n)&&n!==o&&Oe(e,n,{get:()=>r[n],enumerable:!(t=_o(r,n))||t.enumerable});return e},F=(e,r,o)=>(Be(e,r,"default"),o&&Be(o,r,"default")),He=(e,r,o)=>(o=e!=null?Wo(Xo(e)):{},Be(r||!e||!e.__esModule?Oe(o,"default",{value:e,enumerable:!0}):o,e)),Yo=e=>Be(Oe({},"__esModule",{value:!0}),e);var O={};Gr(O,{AddListButton:()=>m.AddListButton,Button:()=>m.Button,Callout:()=>m.Callout,DamSelectedItem:()=>xn,DefaultSearchRow:()=>Kt,DefaultSelectedItem:()=>At,EntrySearch:()=>tr,Heading:()=>m.Heading,Icons:()=>Je,Input:()=>m.Input,InputSelect:()=>m.InputSelect,InputToggle:()=>m.InputToggle,KeywordSearchInput:()=>m.InputKeywordSearch,Label:()=>m.Label,LoadingIndicator:()=>m.LoadingIndicator,LoadingOverlay:()=>m.LoadingOverlay,Menu:()=>m.Menu,MenuItem:()=>m.MenuItem,MeshApp:()=>Cn,ProductPreviewList:()=>Pt,ProductQuery:()=>nn,ProductQueryContext:()=>wt,ProductSearch:()=>Sn,ProductSearchContext:()=>yr,ProductSearchRow:()=>lr,ProductSelectedItem:()=>hr,ResolvableLoadingValue:()=>St,ScrollableList:()=>m.ScrollableList,ScrollableListItem:()=>m.ScrollableListItem,SelectionField:()=>xt,Switch:()=>m.Switch,Textarea:()=>m.Textarea,Theme:()=>m.Theme,UniformMeshLocationContext:()=>yt,UniformMeshLocationContextProvider:()=>Ie,UniformMeshSdkContext:()=>ke,UniformMeshSdkContextProvider:()=>Jo,badgeIcon:()=>at,damSelectItemImage:()=>ut,damSelectedItemContainer:()=>br,damSelectedItemCopy:()=>wr,damSelectedItemDetails:()=>xr,damSelectedItemIcon:()=>Pr,damSelectedItemInfoBtn:()=>Ir,damSelectedItemInner:()=>Sr,damSelectedItemLinkBtn:()=>pt,damSelectedItemLinkContainer:()=>Rr,damSelectedItemMediaContainer:()=>kr,damSelectedItemPopover:()=>Lr,damSelectedItemPopoverLabel:()=>Ue,damSelectedItemSmallText:()=>ve,damSelectedItemTitle:()=>Cr,draggableContainer:()=>Jt,draggableIcon:()=>nt,draggableIconOffset:()=>er,draggableIconWrapper:()=>jt,entrySearchBtn:()=>Qt,entrySearchConfig:()=>_t,entrySearchConfigHidden:()=>Zt,entrySearchLoadMoreBtn:()=>Wt,entrySearchResultList:()=>Xt,entrySearchSelectIcon:()=>qt,entrySearchSelectImg:()=>Yt,entrySearchSelectInput:()=>hn,entrySearchSelectOption:()=>yn,entrySearchWrapper:()=>Nt,productSearchRowActiveIcon:()=>cr,productSearchRowCategory:()=>ir,productSearchRowContainer:()=>rr,productSearchRowContent:()=>or,productSearchRowContentActive:()=>nr,productSearchRowDetails:()=>sr,productSearchRowTitle:()=>ar,productSelectedItemContainer:()=>ur,productSelectedItemContent:()=>gr,productSelectedItemDetails:()=>mr,productSelectedItemIcon:()=>fr,productSelectedItemImage:()=>it,productSelectedItemLinkContainer:()=>vr,productedSelectedItemLinkBtn:()=>st,productedSelectedItemSmallText:()=>ct,searchRowBtn:()=>$t,searchRowContainer:()=>Gt,searchRowContainerActive:()=>Ot,searchRowContainerWithPopover:()=>Bt,searchRowPopover:()=>Ht,searchRowText:()=>ot,searchRowTextSmall:()=>rt,selectItemLinkBtn:()=>et,selectItemLinkContainer:()=>zt,selectItemPopover:()=>Dt,selectItemPopoverLabel:()=>we,selectItemSmallText:()=>ae,selectedItemContainer:()=>kt,selectedItemCopy:()=>Et,selectedItemDetails:()=>Tt,selectedItemIcon:()=>Vt,selectedItemInner:()=>It,selectedItemTitle:()=>Mt,useInitializeUniformMeshSdk:()=>bt,useMeshLocation:()=>tn,useProductQueryContext:()=>Ct,useProductSearchContext:()=>De,useUniformMeshLocation:()=>en,useUniformMeshLocationContext:()=>Te,useUniformMeshSdk:()=>ht,useUniformMeshSdkContext:()=>vt});module.exports=Yo(O);var l=require("@emotion/react"),R=He(require("react"));var re=require("react");var Fe=require("react");var Br=require("@uniformdev/design-system"),$e=require("@emotion/react/jsx-runtime"),ke=(0,Fe.createContext)(void 0),Jo=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),(0,$e.jsxs)(ke.Provider,{value:r,children:[(0,$e.jsx)(Br.Theme,{}),(0,$e.jsx)(Ie,{children:e})]})},vt=()=>{let e=(0,Fe.useContext)(ke);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function ht(){let{sdk:e}=vt();return e}var jo=require("@emotion/react/jsx-runtime"),yt=(0,re.createContext)(void 0),Ie=({children:e})=>{let r=ht(),[o,t]=(0,re.useState)(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return(0,re.useEffect)(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),(0,jo.jsx)(yt.Provider,{value:{location:o},children:e})},Te=()=>{let e=(0,re.useContext)(yt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function en(){let{location:e}=Te();return e}var Or=require("@uniformdev/mesh-sdk"),pe=require("react"),bt=({autoResizingDisabled:e}={})=>{let[r,o]=(0,pe.useState)(),[t,n]=(0,pe.useState)(),a=(0,pe.useRef)(!1);return(0,pe.useEffect)(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,(0,Or.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function tn(e){let{location:r}=Te();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}var Y=He(require("react"));var Kr=require("@emotion/react"),Ne=require("@uniformdev/design-system"),Nr=require("react-icons/cg");var Ee=require("@emotion/react/jsx-runtime"),St=({value:e,text:r,loading:o})=>(0,Ee.jsxs)(Ee.Fragment,{children:[!!r&&r,!r&&(0,Ee.jsxs)(Ee.Fragment,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});var Ke=require("@emotion/react"),Hr=Ke.css`
1
+ "use strict";var Wo=Object.create;var Oe=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Xo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var Gr=(e,r)=>{for(var o in r)Oe(e,o,{get:r[o],enumerable:!0})},Be=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Zo(r))!qo.call(e,n)&&n!==o&&Oe(e,n,{get:()=>r[n],enumerable:!(t=_o(r,n))||t.enumerable});return e},F=(e,r,o)=>(Be(e,r,"default"),o&&Be(o,r,"default")),He=(e,r,o)=>(o=e!=null?Wo(Xo(e)):{},Be(r||!e||!e.__esModule?Oe(o,"default",{value:e,enumerable:!0}):o,e)),Yo=e=>Be(Oe({},"__esModule",{value:!0}),e);var O={};Gr(O,{AddListButton:()=>u.AddListButton,Button:()=>u.Button,Callout:()=>u.Callout,DamSelectedItem:()=>xn,DefaultSearchRow:()=>Kt,DefaultSelectedItem:()=>At,EntrySearch:()=>tr,Heading:()=>u.Heading,Icons:()=>Je,Input:()=>u.Input,InputSelect:()=>u.InputSelect,InputToggle:()=>u.InputToggle,KeywordSearchInput:()=>u.InputKeywordSearch,Label:()=>u.Label,LoadingIndicator:()=>u.LoadingIndicator,LoadingOverlay:()=>u.LoadingOverlay,Menu:()=>u.Menu,MenuItem:()=>u.MenuItem,MeshApp:()=>Cn,ProductPreviewList:()=>Pt,ProductQuery:()=>nn,ProductQueryContext:()=>wt,ProductSearch:()=>Sn,ProductSearchContext:()=>yr,ProductSearchRow:()=>lr,ProductSelectedItem:()=>hr,ResolvableLoadingValue:()=>St,ScrollableList:()=>u.ScrollableList,ScrollableListItem:()=>u.ScrollableListItem,SelectionField:()=>xt,Switch:()=>u.Switch,Textarea:()=>u.Textarea,Theme:()=>u.Theme,UniformMeshLocationContext:()=>yt,UniformMeshLocationContextProvider:()=>Ie,UniformMeshSdkContext:()=>ke,UniformMeshSdkContextProvider:()=>Jo,badgeIcon:()=>at,damSelectItemImage:()=>mt,damSelectedItemContainer:()=>br,damSelectedItemCopy:()=>wr,damSelectedItemDetails:()=>xr,damSelectedItemIcon:()=>Pr,damSelectedItemInfoBtn:()=>Ir,damSelectedItemInner:()=>Sr,damSelectedItemLinkBtn:()=>pt,damSelectedItemLinkContainer:()=>Rr,damSelectedItemMediaContainer:()=>kr,damSelectedItemPopover:()=>Lr,damSelectedItemPopoverLabel:()=>Ue,damSelectedItemSmallText:()=>ve,damSelectedItemTitle:()=>Cr,draggableContainer:()=>Jt,draggableIcon:()=>nt,draggableIconOffset:()=>er,draggableIconWrapper:()=>jt,entrySearchBtn:()=>Qt,entrySearchConfig:()=>_t,entrySearchConfigHidden:()=>Zt,entrySearchLoadMoreBtn:()=>Wt,entrySearchResultList:()=>Xt,entrySearchSelectIcon:()=>qt,entrySearchSelectImg:()=>Yt,entrySearchSelectInput:()=>hn,entrySearchSelectOption:()=>yn,entrySearchWrapper:()=>Nt,productSearchRowActiveIcon:()=>cr,productSearchRowCategory:()=>ir,productSearchRowContainer:()=>rr,productSearchRowContent:()=>or,productSearchRowContentActive:()=>nr,productSearchRowDetails:()=>sr,productSearchRowTitle:()=>ar,productSelectedItemContainer:()=>mr,productSelectedItemContent:()=>gr,productSelectedItemDetails:()=>ur,productSelectedItemIcon:()=>fr,productSelectedItemImage:()=>it,productSelectedItemLinkContainer:()=>vr,productedSelectedItemLinkBtn:()=>st,productedSelectedItemSmallText:()=>ct,searchRowBtn:()=>$t,searchRowContainer:()=>Gt,searchRowContainerActive:()=>Ot,searchRowContainerWithPopover:()=>Bt,searchRowPopover:()=>Ht,searchRowText:()=>ot,searchRowTextSmall:()=>rt,selectItemLinkBtn:()=>et,selectItemLinkContainer:()=>zt,selectItemPopover:()=>Dt,selectItemPopoverLabel:()=>we,selectItemSmallText:()=>ae,selectedItemContainer:()=>kt,selectedItemCopy:()=>Et,selectedItemDetails:()=>Tt,selectedItemIcon:()=>Vt,selectedItemInner:()=>It,selectedItemTitle:()=>Mt,useInitializeUniformMeshSdk:()=>bt,useMeshLocation:()=>tn,useProductQueryContext:()=>Ct,useProductSearchContext:()=>De,useUniformMeshLocation:()=>en,useUniformMeshLocationContext:()=>Te,useUniformMeshSdk:()=>ht,useUniformMeshSdkContext:()=>vt});module.exports=Yo(O);var l=require("@emotion/react"),R=He(require("react"));var re=require("react");var Fe=require("react");var Br=require("@uniformdev/design-system"),$e=require("@emotion/react/jsx-runtime"),ke=(0,Fe.createContext)(void 0),Jo=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),(0,$e.jsxs)(ke.Provider,{value:r,children:[(0,$e.jsx)(Br.Theme,{}),(0,$e.jsx)(Ie,{children:e})]})},vt=()=>{let e=(0,Fe.useContext)(ke);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function ht(){let{sdk:e}=vt();return e}var jo=require("@emotion/react/jsx-runtime"),yt=(0,re.createContext)(void 0),Ie=({children:e})=>{let r=ht(),[o,t]=(0,re.useState)(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return(0,re.useEffect)(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),(0,jo.jsx)(yt.Provider,{value:{location:o},children:e})},Te=()=>{let e=(0,re.useContext)(yt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function en(){let{location:e}=Te();return e}var Or=require("@uniformdev/mesh-sdk"),pe=require("react"),bt=({autoResizingDisabled:e}={})=>{let[r,o]=(0,pe.useState)(),[t,n]=(0,pe.useState)(),a=(0,pe.useRef)(!1);return(0,pe.useEffect)(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,(0,Or.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function tn(e){let{location:r}=Te();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}var Y=He(require("react"));var Kr=require("@emotion/react"),Ne=require("@uniformdev/design-system"),Nr=require("react-icons/cg");var Ee=require("@emotion/react/jsx-runtime"),St=({value:e,text:r,loading:o})=>(0,Ee.jsxs)(Ee.Fragment,{children:[!!r&&r,!r&&(0,Ee.jsxs)(Ee.Fragment,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});var Ke=require("@emotion/react"),Hr=Ke.css`
2
2
  align-items: center;
3
3
  background: var(--gray-100);
4
4
  border: 1px solid var(--gray-300);
@@ -15,13 +15,13 @@
15
15
  border-left: 1px solid var(--gray-300);
16
16
  background: var(--gray-100);
17
17
  padding: var(--spacing-3);
18
- `;var oe=require("@emotion/react/jsx-runtime"),xt=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var S;let h=(S=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?S:[],v=(i,u)=>{i.preventDefault(),d(u)};return(0,oe.jsxs)("div",{children:[(0,oe.jsx)(Ne.InputSelect,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...h.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Kr.css`
18
+ `;var oe=require("@emotion/react/jsx-runtime"),xt=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var S;let h=(S=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?S:[],v=(i,m)=>{i.preventDefault(),d(m)};return(0,oe.jsxs)("div",{children:[(0,oe.jsx)(Ne.InputSelect,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...h.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Kr.css`
19
19
  margin-bottom: var(--spacing-base);
20
- `:""}),t==null?void 0:t.map(i=>{var u;return(0,oe.jsxs)("div",{css:Hr,children:[(0,oe.jsx)("span",{css:$r,children:(0,oe.jsx)(St,{value:i,loading:o,text:(u=n.find(w=>w.id===i))==null?void 0:u.name})}),(0,oe.jsx)("button",{css:Fr,title:"remove",onClick:w=>v(w,i),children:(0,oe.jsx)(Ne.Icon,{icon:Nr.CgClose,iconColor:"currentColor",size:20})})]},i)})]})};var Qr=require("@emotion/react/jsx-runtime"),rn=e=>(0,Qr.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Qr.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"})}),Qe=rn;var Wr=require("@emotion/react/jsx-runtime"),on=e=>(0,Wr.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Wr.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=on;var _e=require("react-use"),U=require("@uniformdev/design-system"),M=require("@emotion/react"),y=require("@emotion/react/jsx-runtime"),_r={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},nn=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:h,onGetProducts:v,sortOptions:S,sortOrderOptions:i,categoryLabel:u="Product Category",brandLabel:w="Brand",disableBrands:H,restrictToSingleCategory:Se=!1})=>{var D,g,A;let L=async s=>{r({..._r,...e||{},...s})},C=(0,Y.useMemo)(()=>({..._r,...e||{}}),[e]),[xe,Pe]=(0,_e.useAsyncFn)(async s=>await v(s),[v]);(0,_e.useDebounce)(async()=>{await Pe({brand:C.brand,categories:C.categories,keyword:C.keyword,sort:C.sort,sortOrder:C.sortOrder,count:C.count})},250,[C]);let W=(0,Y.useMemo)(()=>{let s=[];return t==null||t.forEach($=>{let T=Xr($,void 0);s.push(...T)}),s},[t]),ee=(0,Y.useMemo)(()=>[{value:"",label:"All categories"},...W.map(s=>({label:s.name,value:s.id}))],[W]),q=(0,Y.useMemo)(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),Le=s=>{if(!s)return;let $=(e==null?void 0:e.categories)||[];L({categories:[...$,s]})},Ae=s=>{var $;L({categories:($=e==null?void 0:e.categories)==null?void 0:$.filter(T=>T!==s)})},de=s=>{L({brand:s.target.value})},_=s=>{L({count:s||1})};return n?(0,y.jsx)("div",{children:"Loading..."}):(0,y.jsx)(wt.Provider,{value:{categories:t,logoIcon:h},children:(0,y.jsxs)("div",{css:M.css`
20
+ `:""}),t==null?void 0:t.map(i=>{var m;return(0,oe.jsxs)("div",{css:Hr,children:[(0,oe.jsx)("span",{css:$r,children:(0,oe.jsx)(St,{value:i,loading:o,text:(m=n.find(w=>w.id===i))==null?void 0:m.name})}),(0,oe.jsx)("button",{css:Fr,title:"remove",onClick:w=>v(w,i),children:(0,oe.jsx)(Ne.Icon,{icon:Nr.CgClose,iconColor:"currentColor",size:20})})]},i)})]})};var Qr=require("@emotion/react/jsx-runtime"),rn=e=>(0,Qr.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:(0,Qr.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"})}),Qe=rn;var Wr=require("@emotion/react/jsx-runtime"),on=e=>(0,Wr.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:(0,Wr.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=on;var _e=require("react-use"),U=require("@uniformdev/design-system"),M=require("@emotion/react"),y=require("@emotion/react/jsx-runtime"),_r={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},nn=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:h,onGetProducts:v,sortOptions:S,sortOrderOptions:i,categoryLabel:m="Product Category",brandLabel:w="Brand",disableBrands:H,restrictToSingleCategory:Se=!1})=>{var D,g,A;let L=async s=>{r({..._r,...e||{},...s})},C=(0,Y.useMemo)(()=>({..._r,...e||{}}),[e]),[xe,Pe]=(0,_e.useAsyncFn)(async s=>await v(s),[v]);(0,_e.useDebounce)(async()=>{await Pe({brand:C.brand,categories:C.categories,keyword:C.keyword,sort:C.sort,sortOrder:C.sortOrder,count:C.count})},250,[C]);let W=(0,Y.useMemo)(()=>{let s=[];return t==null||t.forEach($=>{let T=Xr($,void 0);s.push(...T)}),s},[t]),ee=(0,Y.useMemo)(()=>[{value:"",label:"All categories"},...W.map(s=>({label:s.name,value:s.id}))],[W]),q=(0,Y.useMemo)(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),Le=s=>{if(!s)return;let $=(e==null?void 0:e.categories)||[];L({categories:[...$,s]})},Ae=s=>{var $;L({categories:($=e==null?void 0:e.categories)==null?void 0:$.filter(T=>T!==s)})},de=s=>{L({brand:s.target.value})},_=s=>{L({count:s||1})};return n?(0,y.jsx)("div",{children:"Loading..."}):(0,y.jsx)(wt.Provider,{value:{categories:t,logoIcon:h},children:(0,y.jsxs)("div",{css:M.css`
21
21
  > :not(:last-child) {
22
22
  margin-bottom: var(--spacing-md);
23
23
  }
24
- `,children:[Se?(0,y.jsx)(U.InputSelect,{id:"selection-field-product-category",label:u,disabled:n,value:(g=(D=C.categories)==null?void 0:D[0])!=null?g:"",options:ee,onChange:s=>{L({categories:s.target.value===""?[]:[s.target.value]})}}):(0,y.jsx)(xt,{loading:a||!1,id:"selection-field-product-category",label:u,onAdd:Le,onRemove:Ae,selectedValues:C.categories,values:W}),(0,y.jsxs)("div",{css:M.css`
24
+ `,children:[Se?(0,y.jsx)(U.InputSelect,{id:"selection-field-product-category",label:m,disabled:n,value:(g=(D=C.categories)==null?void 0:D[0])!=null?g:"",options:ee,onChange:s=>{L({categories:s.target.value===""?[]:[s.target.value]})}}):(0,y.jsx)(xt,{loading:a||!1,id:"selection-field-product-category",label:m,onAdd:Le,onRemove:Ae,selectedValues:C.categories,values:W}),(0,y.jsxs)("div",{css:M.css`
25
25
  display: flex;
26
26
  flex-wrap: wrap;
27
27
  column-gap: var(--spacing-lg);
@@ -145,7 +145,7 @@
145
145
  `,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),(0,k.jsx)("ul",{css:[Rt.css`
146
146
  max-height: 24rem;
147
147
  overflow-x: auto;
148
- `,io.scrollbarStyles],children:e==null?void 0:e.map((t,n)=>{var h,v;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(h=r.find(S=>S.id===a.id))==null?void 0:h.name;return(0,k.jsx)("li",{css:eo,children:(0,k.jsxs)("div",{css:to,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?(0,k.jsx)("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:ro,"data-test-id":"product-image"}):(0,k.jsx)("div",{css:oo}),(0,k.jsxs)("h4",{css:no,"data-test-id":"product-name",children:[t.title||t.name,d&&(0,k.jsx)("span",{css:ao,children:d})]}),t&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("p",{css:Lt,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,(0,k.jsx)("br",{})]}),t.price!==void 0?(0,k.jsxs)("p",{css:Lt,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?(0,k.jsxs)("a",{css:Yr,href:(v=t.editLink)!=null?v:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[(0,k.jsx)("span",{css:Jr,children:"Edit"}),o?(0,k.jsx)(Z,{src:o,alt:"Logo",css:jr}):null]}):null]})]})},`product-${t.id}`)})})]})};var ce=He(require("react"));var Q=He(require("react"));var Je={};Gr(Je,{Caution:()=>co,Checkmark:()=>Ze,ChevronDown:()=>Xe,Close:()=>uo,Danger:()=>go,ExclamationPoint:()=>vo,Info:()=>Ye,Lightbulb:()=>yo,MagnifyingGlass:()=>bo,MaximizeAlt:()=>xo,Minus:()=>We,MoreVerticalAlt:()=>Ve,Plus:()=>Qe});var so=require("@emotion/react/jsx-runtime"),an=e=>(0,so.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:(0,so.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"})}),co=an;var lo=require("@emotion/react/jsx-runtime"),sn=e=>(0,lo.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,lo.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"})}),Ze=sn;var po=require("@emotion/react/jsx-runtime"),cn=e=>(0,po.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,po.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"})}),Xe=cn;var Me=require("@emotion/react/jsx-runtime"),dn=e=>(0,Me.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:(0,Me.jsxs)("g",{fillRule:"evenodd",children:[(0,Me.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,Me.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"})]})}),uo=dn;var mo=require("@emotion/react/jsx-runtime"),ln=e=>(0,mo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,mo.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"})}),go=ln;var fo=require("@emotion/react/jsx-runtime"),pn=e=>(0,fo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:(0,fo.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"})}),vo=pn;var qe=require("@emotion/react/jsx-runtime"),un=e=>(0,qe.jsxs)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[(0,qe.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,qe.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"})]}),Ye=un;var ho=require("@emotion/react/jsx-runtime"),mn=e=>(0,ho.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,ho.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"})}),yo=mn;var ne=require("@emotion/react/jsx-runtime"),gn=e=>(0,ne.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,ne.jsxs)("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[(0,ne.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,ne.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,ne.jsx)("defs",{children:(0,ne.jsx)("clipPath",{id:"magnifying-glass_svg__a",children:(0,ne.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),bo=gn;var So=require("@emotion/react/jsx-runtime"),fn=e=>(0,So.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,So.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"})}),xo=fn;var wo=require("@emotion/react/jsx-runtime"),vn=e=>(0,wo.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,wo.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"})}),Ve=vn;var Ro=require("react-use"),ko=require("uuid");var ue=require("react");function je(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}var Po=require("timeago.js");var G=require("@emotion/react"),Co=require("@uniformdev/design-system"),kt=G.css`
148
+ `,io.scrollbarStyles],children:e==null?void 0:e.map((t,n)=>{var h,v;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(h=r.find(S=>S.id===a.id))==null?void 0:h.name;return(0,k.jsx)("li",{css:eo,children:(0,k.jsxs)("div",{css:to,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?(0,k.jsx)("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:ro,"data-test-id":"product-image"}):(0,k.jsx)("div",{css:oo}),(0,k.jsxs)("h4",{css:no,"data-test-id":"product-name",children:[t.title||t.name,d&&(0,k.jsx)("span",{css:ao,children:d})]}),t&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("p",{css:Lt,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,(0,k.jsx)("br",{})]}),t.price!==void 0?(0,k.jsxs)("p",{css:Lt,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?(0,k.jsxs)("a",{css:Yr,href:(v=t.editLink)!=null?v:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[(0,k.jsx)("span",{css:Jr,children:"Edit"}),o?(0,k.jsx)(Z,{src:o,alt:"Logo",css:jr}):null]}):null]})]})},`product-${t.id}`)})})]})};var ce=He(require("react"));var Q=He(require("react"));var Je={};Gr(Je,{Caution:()=>co,Checkmark:()=>Ze,ChevronDown:()=>Xe,Close:()=>mo,Danger:()=>go,ExclamationPoint:()=>vo,Info:()=>Ye,Lightbulb:()=>yo,MagnifyingGlass:()=>bo,MaximizeAlt:()=>xo,Minus:()=>We,MoreVerticalAlt:()=>Ve,Plus:()=>Qe});var so=require("@emotion/react/jsx-runtime"),an=e=>(0,so.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",role:"img",...e,children:(0,so.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"})}),co=an;var lo=require("@emotion/react/jsx-runtime"),sn=e=>(0,lo.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:(0,lo.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"})}),Ze=sn;var po=require("@emotion/react/jsx-runtime"),cn=e=>(0,po.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",role:"img",...e,children:(0,po.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"})}),Xe=cn;var Me=require("@emotion/react/jsx-runtime"),dn=e=>(0,Me.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",role:"img",...e,children:(0,Me.jsxs)("g",{fillRule:"evenodd",children:[(0,Me.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,Me.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"})]})}),mo=dn;var uo=require("@emotion/react/jsx-runtime"),ln=e=>(0,uo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:(0,uo.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"})}),go=ln;var fo=require("@emotion/react/jsx-runtime"),pn=e=>(0,fo.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",role:"img",...e,children:(0,fo.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"})}),vo=pn;var qe=require("@emotion/react/jsx-runtime"),mn=e=>(0,qe.jsxs)("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:[(0,qe.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,qe.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"})]}),Ye=mn;var ho=require("@emotion/react/jsx-runtime"),un=e=>(0,ho.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:(0,ho.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"})}),yo=un;var ne=require("@emotion/react/jsx-runtime"),gn=e=>(0,ne.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:[(0,ne.jsxs)("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[(0,ne.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,ne.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,ne.jsx)("defs",{children:(0,ne.jsx)("clipPath",{id:"magnifying-glass_svg__a",children:(0,ne.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),bo=gn;var So=require("@emotion/react/jsx-runtime"),fn=e=>(0,So.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:(0,So.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"})}),xo=fn;var wo=require("@emotion/react/jsx-runtime"),vn=e=>(0,wo.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:(0,wo.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"})}),Ve=vn;var Ro=require("react-use"),ko=require("uuid");var me=require("react");function je(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}var Po=require("timeago.js");var G=require("@emotion/react"),Co=require("@uniformdev/design-system"),kt=G.css`
149
149
  border: 1px solid var(--gray-200);
150
150
  background: var(--gray-50);
151
151
  border-radius: var(--rounded-base);
@@ -213,7 +213,7 @@
213
213
  &:hover {
214
214
  background: var(--gray-50);
215
215
  }
216
- `;var J=require("@emotion/react");var Ut=require("@uniformdev/design-system"),tt=require("react-icons/cg"),b=require("@emotion/react/jsx-runtime"),At=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var S;let n=(0,ue.useRef)(null),a=(0,ue.useRef)(null),[d,h]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{let i=w=>{n.current&&!n.current.contains(w.target)&&a.current&&!a.current.contains(w.target)&&h(!1)},u=()=>{h(!1)};return window.addEventListener("resize",u,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",u,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let v=()=>{var i;if(h(!d),a.current&&n.current){let u=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),w=a.current.offsetWidth;a.current.style.top=`${u.top+30}px`,a.current.style.left=`${u.left-w+30}px`}};return(0,b.jsx)("div",{css:kt,children:(0,b.jsxs)("div",{css:It,children:[(0,b.jsxs)("div",{css:Tt,children:[(0,b.jsxs)("div",{css:Et,children:[(0,b.jsx)("h4",{css:[Mt,e.popoverData?J.css`
216
+ `;var J=require("@emotion/react");var Ut=require("@uniformdev/design-system"),tt=require("react-icons/cg"),b=require("@emotion/react/jsx-runtime"),At=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var S;let n=(0,me.useRef)(null),a=(0,me.useRef)(null),[d,h]=(0,me.useState)(!1);(0,me.useEffect)(()=>{let i=w=>{n.current&&!n.current.contains(w.target)&&a.current&&!a.current.contains(w.target)&&h(!1)},m=()=>{h(!1)};return window.addEventListener("resize",m,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",m,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let v=()=>{var i;if(h(!d),a.current&&n.current){let m=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),w=a.current.offsetWidth;a.current.style.top=`${m.top+30}px`,a.current.style.left=`${m.left-w+30}px`}};return(0,b.jsx)("div",{css:kt,children:(0,b.jsxs)("div",{css:It,children:[(0,b.jsxs)("div",{css:Tt,children:[(0,b.jsxs)("div",{css:Et,children:[(0,b.jsx)("h4",{css:[Mt,e.popoverData?J.css`
217
217
  margin-bottom: var(--spacing-sm);
218
218
  `:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{type:"button",ref:n,css:J.css`
219
219
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
@@ -223,13 +223,13 @@
223
223
  visibility: visible;
224
224
  `:J.css`
225
225
  visibility: hidden;
226
- `],children:Object.entries(e.popoverData).map(([i,u],w)=>(0,b.jsxs)("div",{css:ae,children:[(0,b.jsxs)("span",{css:we,children:[i,":"]}),u]},w))})]}):null]}),e.createdDate&&(0,b.jsxs)("div",{css:ae,children:[(0,b.jsx)("span",{css:we,children:"Created:"}),(0,Po.format)((S=e.createdDate)!=null?S:0)]}),e.metadata?Object.entries(e.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,u])=>(0,b.jsxs)("div",{css:[ae,J.css`
226
+ `],children:Object.entries(e.popoverData).map(([i,m],w)=>(0,b.jsxs)("div",{css:ae,children:[(0,b.jsxs)("span",{css:we,children:[i,":"]}),m]},w))})]}):null]}),e.createdDate&&(0,b.jsxs)("div",{css:ae,children:[(0,b.jsx)("span",{css:we,children:"Created:"}),(0,Po.format)((S=e.createdDate)!=null?S:0)]}),e.metadata?Object.entries(e.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,m])=>(0,b.jsxs)("div",{css:[ae,J.css`
227
227
  order: 1;
228
- `],children:[(0,b.jsxs)("span",{css:we,children:[i,":"]}),u]},i)):null,e.metadata?Object.entries(e.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,u])=>(0,b.jsxs)("div",{css:[ae,J.css`
228
+ `],children:[(0,b.jsxs)("span",{css:we,children:[i,":"]}),m]},i)):null,e.metadata?Object.entries(e.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,m])=>(0,b.jsxs)("div",{css:[ae,J.css`
229
229
  order: 1;
230
230
  `],children:[(0,b.jsxs)("span",{css:[we,J.css`
231
231
  order: 1;
232
- `],children:[i,":"]}),u]},i)):null]}),(0,b.jsxs)("div",{css:zt,children:[e.editLink?(0,b.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(je(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:et,children:[(0,b.jsx)("span",{css:ae,children:"Edit"}),(0,b.jsx)(Z,{src:r,css:Vt,alt:"Logo"})]}):null,(0,b.jsxs)("button",{type:"button",onClick:()=>{o(e)},css:et,children:[(0,b.jsx)("span",{css:ae,children:"Unlink"}),(0,b.jsx)(Ut.Icon,{icon:tt.CgClose,iconColor:"red",size:16})]})]})]})},e.id)};var me=require("react");var ie=require("@emotion/react"),Gt=ie.css`
232
+ `],children:[i,":"]}),m]},i)):null]}),(0,b.jsxs)("div",{css:zt,children:[e.editLink?(0,b.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(je(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:et,children:[(0,b.jsx)("span",{css:ae,children:"Edit"}),(0,b.jsx)(Z,{src:r,css:Vt,alt:"Logo"})]}):null,(0,b.jsxs)("button",{type:"button",onClick:()=>{o(e)},css:et,children:[(0,b.jsx)("span",{css:ae,children:"Unlink"}),(0,b.jsx)(Ut.Icon,{icon:tt.CgClose,iconColor:"red",size:16})]})]})]})},e.id)};var ue=require("react");var ie=require("@emotion/react"),Gt=ie.css`
233
233
  cursor: pointer;
234
234
  padding: var(--spacing-sm);
235
235
  position: relative;
@@ -260,7 +260,7 @@
260
260
  `,$t=ie.css`
261
261
  position: absolute;
262
262
  inset: 0 var(--spacing-sm) 0 auto;
263
- `;var Ft=require("@emotion/react"),B=require("@emotion/react/jsx-runtime"),Kt=({result:e,isSelected:r,triggerSelection:o})=>{let t=(0,me.useRef)(null),n=(0,me.useRef)(null),[a,d]=(0,me.useState)(!1);(0,me.useEffect)(()=>{function v(S){t.current&&!t.current.contains(S.target)&&n.current&&!n.current.contains(S.target)&&d(!1)}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[n]);let h=v=>{v.stopPropagation(),d(!a)};return(0,B.jsxs)("div",{css:[Gt,r?Ot:void 0,e.popoverData?Bt:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("button",{type:"button",ref:t,css:$t,"aria-controls":"path-details",onClick:v=>h(v),"aria-expanded":a,children:(0,B.jsx)(Ye,{width:24,height:24})}),(0,B.jsxs)("div",{id:"path-details","aria-hidden":!a,ref:n,css:[Ht,a?Ft.css`
263
+ `;var Ft=require("@emotion/react"),B=require("@emotion/react/jsx-runtime"),Kt=({result:e,isSelected:r,triggerSelection:o})=>{let t=(0,ue.useRef)(null),n=(0,ue.useRef)(null),[a,d]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{function v(S){t.current&&!t.current.contains(S.target)&&n.current&&!n.current.contains(S.target)&&d(!1)}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[n]);let h=v=>{v.stopPropagation(),d(!a)};return(0,B.jsxs)("div",{css:[Gt,r?Ot:void 0,e.popoverData?Bt:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("button",{type:"button",ref:t,css:$t,"aria-controls":"path-details",onClick:v=>h(v),"aria-expanded":a,children:(0,B.jsx)(Ye,{width:24,height:24})}),(0,B.jsxs)("div",{id:"path-details","aria-hidden":!a,ref:n,css:[Ht,a?Ft.css`
264
264
  visibility: visible;
265
265
  `:Ft.css`
266
266
  visibility: hidden;
@@ -352,7 +352,7 @@
352
352
  `,at=E.css`
353
353
  width: calc(var(--spacing-lg) + var(--spacing-xs));
354
354
  height: calc(var(--spacing-lg) + var(--spacing-xs));
355
- `;var N=require("@emotion/react"),I=require("@uniformdev/design-system");var ge=require("react");function Lo(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=(0,ge.useState)("IDLE"),a=(0,ge.useRef)(void 0);return(0,ge.useEffect)(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),(0,ge.useEffect)(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}var p=require("@emotion/react/jsx-runtime"),bn=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),(0,p.jsx)(I.Callout,{type:"info",children:o})},tr=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:h,rowComponent:v,selectedItemComponent:S,totalResults:i,cursor:u,resultsLoading:w,requireContentType:H,onAddNew:Se,onEditClosed:L,onCancel:C,noResultsComponent:xe,helpComponent:Pe,onSort:W,typeSelectorLabel:ee="Content Type Select",typeSelectorAllTypesOptionText:q="All content types",loadingIndicatorDelay:Le=1e3})=>{var zr,Ur,Ar;let de=()=>H?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[_,D]=Q.useState(""),[g,A]=Q.useState(de),[s,$]=Q.useState(!1),[T,le]=Q.useState([]),[Vo,Er]=Q.useState(!1),ft=Q.useRef(`x${(0,ko.v4)()}`),Ge=(0,Ro.useThrottle)(_,750);Q.useEffect(()=>{e(Ge,{count:5,offset:0,contentType:g==="any"?void 0:g})},[Ge,g]);let Do=Lo(w,{delay:Le}),zo=c=>{T.some(x=>x.id===c.id)?le(x=>x.filter(te=>te.id!==c.id)):le(d?x=>[...x,c]:[c])},Uo=t==null?void 0:t.map(c=>c.id+c.title).join(",");Q.useEffect(()=>{Array.isArray(t)&&le(t)},[Uo]);let Ao=()=>{A(de()),D(""),le(t!=null&&t.length?t:[])},Go=()=>{$(c=>!c),s||Ao()},Mr=c=>{let x=(T==null?void 0:T.filter(te=>te.id!==c.id))||[];le(x),a(x,"")},Bo=c=>{c.preventDefault(),a(T,g),$(!1)},Oo=c=>{c.preventDefault(),$(!1),C&&C()},Ho=()=>{e(Ge,{count:5,offset:(r==null?void 0:r.length)||0,contentType:g==="any"?void 0:g,cursor:u}),Er(!0);let c=setTimeout(()=>{Er(!1)},750);return()=>clearTimeout(c)},$o=!(t==null?void 0:t.length)||d,Fo=v||Kt,Vr=S||At,Ko=xe||bn,Dr=n&&typeof n!="string"?n:null,No=Dr?(0,p.jsx)(Dr,{css:at}):(0,p.jsx)("img",{src:n,alt:"Logo",css:at}),Qo=c=>{var x,te;if(c.destination&&c.source.droppableId===((x=c.destination)==null?void 0:x.droppableId)){let z=[...t||[]],[Re]=(te=z==null?void 0:z.splice(c.source.index,1))!=null?te:[];return z==null||z.splice(c.destination.index,0,Re),W&&(le(z),W==null||W(z)),z}};return(0,p.jsx)("div",{css:N.css`
355
+ `;var N=require("@emotion/react"),I=require("@uniformdev/design-system");var ge=require("react");function Lo(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=(0,ge.useState)("IDLE"),a=(0,ge.useRef)(void 0);return(0,ge.useEffect)(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),(0,ge.useEffect)(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}var p=require("@emotion/react/jsx-runtime"),bn=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),(0,p.jsx)(I.Callout,{type:"info",children:o})},tr=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:h,rowComponent:v,selectedItemComponent:S,totalResults:i,cursor:m,resultsLoading:w,requireContentType:H,onAddNew:Se,onEditClosed:L,onCancel:C,noResultsComponent:xe,helpComponent:Pe,onSort:W,typeSelectorLabel:ee="Content Type Select",typeSelectorAllTypesOptionText:q="All content types",loadingIndicatorDelay:Le=1e3})=>{var zr,Ur,Ar;let de=()=>H?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[_,D]=Q.useState(""),[g,A]=Q.useState(de),[s,$]=Q.useState(!1),[T,le]=Q.useState([]),[Vo,Er]=Q.useState(!1),ft=Q.useRef(`x${(0,ko.v4)()}`),Ge=(0,Ro.useThrottle)(_,750);Q.useEffect(()=>{e(Ge,{count:5,offset:0,contentType:g==="any"?void 0:g})},[Ge,g]);let Do=Lo(w,{delay:Le}),zo=c=>{T.some(x=>x.id===c.id)?le(x=>x.filter(te=>te.id!==c.id)):le(d?x=>[...x,c]:[c])},Uo=t==null?void 0:t.map(c=>c.id+c.title).join(",");Q.useEffect(()=>{Array.isArray(t)&&le(t)},[Uo]);let Ao=()=>{A(de()),D(""),le(t!=null&&t.length?t:[])},Go=()=>{$(c=>!c),s||Ao()},Mr=c=>{let x=(T==null?void 0:T.filter(te=>te.id!==c.id))||[];le(x),a(x,"")},Bo=c=>{c.preventDefault(),a(T,g),$(!1)},Oo=c=>{c.preventDefault(),$(!1),C&&C()},Ho=()=>{e(Ge,{count:5,offset:(r==null?void 0:r.length)||0,contentType:g==="any"?void 0:g,cursor:m}),Er(!0);let c=setTimeout(()=>{Er(!1)},750);return()=>clearTimeout(c)},$o=!(t==null?void 0:t.length)||d,Fo=v||Kt,Vr=S||At,Ko=xe||bn,Dr=n&&typeof n!="string"?n:null,No=Dr?(0,p.jsx)(Dr,{css:at}):(0,p.jsx)("img",{src:n,alt:"Logo",css:at}),Qo=c=>{var x,te;if(c.destination&&c.source.droppableId===((x=c.destination)==null?void 0:x.droppableId)){let z=[...t||[]],[Re]=(te=z==null?void 0:z.splice(c.source.index,1))!=null?te:[];return z==null||z.splice(c.destination.index,0,Re),W&&(le(z),W==null||W(z)),z}};return(0,p.jsx)("div",{css:N.css`
356
356
  width: 100%;
357
357
  `,children:(0,p.jsxs)("div",{css:N.css`
358
358
  position: relative;
@@ -420,13 +420,13 @@
420
420
  `}):(0,X.jsx)(Z,{src:n,alt:"Logo",css:dr.css`
421
421
  height: 2.25rem;
422
422
  width: 2.25rem;
423
- `}),(0,X.jsxs)("h4",{css:[ar],children:[e.title,d?(0,X.jsx)("span",{css:[ir],children:d}):null]}),(0,X.jsxs)("p",{css:[sr],children:["SKU: ",e.sku||e.id,e.price!==void 0?(0,X.jsx)("span",{children:e.price}):null]}),r?(0,X.jsx)(Ze,{css:[cr]}):null]})},e.id)}var j=require("@emotion/react"),pr=require("@uniformdev/design-system"),ur=j.css`
423
+ `}),(0,X.jsxs)("h4",{css:[ar],children:[e.title,d?(0,X.jsx)("span",{css:[ir],children:d}):null]}),(0,X.jsxs)("p",{css:[sr],children:["SKU: ",e.sku||e.id,e.price!==void 0?(0,X.jsx)("span",{children:e.price}):null]}),r?(0,X.jsx)(Ze,{css:[cr]}):null]})},e.id)}var j=require("@emotion/react"),pr=require("@uniformdev/design-system"),mr=j.css`
424
424
  border: 1px solid var(--gray-200);
425
425
  border-radius: var(--rounded-base);
426
426
  background: var(--gray-50);
427
427
  display: flex;
428
428
  width: 100%;
429
- `,mr=j.css`
429
+ `,ur=j.css`
430
430
  align-items: center;
431
431
  display: flex;
432
432
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
@@ -480,7 +480,7 @@
480
480
  min-width: 200px;
481
481
  justify-content: end;
482
482
  }
483
- `;var fe=require("@emotion/react"),dt=require("@uniformdev/design-system"),Io=require("react-icons/cg"),P=require("@emotion/react/jsx-runtime");function hr({selectedItem:e,onDeselect:r}){var d;let{categories:o,logoIcon:t}=De(),[n]=e.categories||[{id:"",name:""}],a=typeof n=="undefined"||!o||(d=o.find(h=>h.id===n.id))==null?void 0:d.name;return(0,P.jsx)("div",{css:[ur],children:(0,P.jsxs)("article",{css:[mr],children:[(0,P.jsxs)("div",{css:[gr],children:[e.thumbnailUrl?(0,P.jsx)("img",{src:e.thumbnailUrl,alt:a,css:[it],loading:"lazy"}):(0,P.jsx)("div",{css:[it]}),(0,P.jsxs)("div",{css:fe.css`
483
+ `;var fe=require("@emotion/react"),dt=require("@uniformdev/design-system"),Io=require("react-icons/cg"),P=require("@emotion/react/jsx-runtime");function hr({selectedItem:e,onDeselect:r}){var d;let{categories:o,logoIcon:t}=De(),[n]=e.categories||[{id:"",name:""}],a=typeof n=="undefined"||!o||(d=o.find(h=>h.id===n.id))==null?void 0:d.name;return(0,P.jsx)("div",{css:[mr],children:(0,P.jsxs)("article",{css:[ur],children:[(0,P.jsxs)("div",{css:[gr],children:[e.thumbnailUrl?(0,P.jsx)("img",{src:e.thumbnailUrl,alt:a,css:[it],loading:"lazy"}):(0,P.jsx)("div",{css:[it]}),(0,P.jsxs)("div",{css:fe.css`
484
484
  > :not(:last-child) {
485
485
  margin-bottom: var(--spacing-xs);
486
486
  }
@@ -501,7 +501,7 @@
501
501
  margin-right: var(--spacing-xs);
502
502
  `,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?(0,P.jsxs)("li",{children:[(0,P.jsx)("span",{css:fe.css`
503
503
  margin-right: var(--spacing-xs);
504
- `,children:"Price:"}),(0,P.jsx)("span",{children:e.price})]}):null]})]})]}),(0,P.jsxs)("div",{css:vr,children:[e.editLink?(0,P.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:st,children:[(0,P.jsx)("span",{css:ct,children:"Edit"}),(0,P.jsx)(Z,{src:t,alt:"Logo",css:fr})]}):null,(0,P.jsxs)("button",{type:"button",onClick:()=>{r==null||r(e)},css:st,children:[(0,P.jsx)("span",{css:ct,children:"Unlink"}),(0,P.jsx)(dt.Icon,{icon:Io.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}var To=require("@uniformdev/design-system"),lt=require("react-use"),ze=require("@emotion/react/jsx-runtime");function Sn({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:h,rowComponent:v,errorComponent:S,helpComponent:i,noResultsComponent:u,onSort:w,typeSelectorAllTypesOptionText:H="All categories",typeSelectorLabel:Se="Select Category"}){var de,_;let{value:L,loading:C,error:xe}=(0,lt.useAsync)(async()=>await o(),[o]),Pe=L==null?void 0:L.map(D=>D.id).join(","),W=(0,ce.useMemo)(()=>L?L.map(g=>({id:g.id,name:g.name})):void 0,[Pe]),ee=(0,ce.useRef)(),[q,Le]=(0,lt.useAsyncFn)(async(D,g)=>{let A=await t({text:D,options:{limit:g==null?void 0:g.count,offset:g==null?void 0:g.offset,categoryId:g==null?void 0:g.contentType,cursor:g==null?void 0:g.cursor}});return(g==null?void 0:g.offset)===0&&(ee.current=[]),(ee.current=ee.current||[]).push(...A.products),A},[t]),Ae=async D=>{await r(D)};return xe||q.error?(0,ze.jsx)(S||(({categoriesError:g,searchError:A})=>(0,ze.jsxs)(To.Callout,{type:"error",children:["There was an error: ",(g==null?void 0:g.message)||(A==null?void 0:A.message)]})),{categoriesError:xe,searchError:q.error}):(0,ze.jsx)(yr.Provider,{value:{categories:L,logoIcon:n},children:(0,ze.jsx)(tr,{search:Le,results:ee.current,logoIcon:n,selectedItems:e,select:Ae,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:W,selectedItemComponent:h||hr,rowComponent:v||lr,totalResults:(de=q.value)==null?void 0:de.total,cursor:(_=q.value)==null?void 0:_.cursor,resultsLoading:q.loading||C,helpComponent:i,noResultsComponent:u,onSort:w,typeSelectorAllTypesOptionText:H,typeSelectorLabel:Se})})}var yr=ce.default.createContext(void 0),De=()=>{let e=(0,ce.useContext)(yr);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};var V=require("@emotion/react"),Eo=require("@uniformdev/design-system"),br=V.css`
504
+ `,children:"Price:"}),(0,P.jsx)("span",{children:e.price})]}):null]})]})]}),(0,P.jsxs)("div",{css:vr,children:[e.editLink?(0,P.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:st,children:[(0,P.jsx)("span",{css:ct,children:"Edit"}),(0,P.jsx)(Z,{src:t,alt:"Logo",css:fr})]}):null,(0,P.jsxs)("button",{type:"button",onClick:()=>{r==null||r(e)},css:st,children:[(0,P.jsx)("span",{css:ct,children:"Unlink"}),(0,P.jsx)(dt.Icon,{icon:Io.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}var To=require("@uniformdev/design-system"),lt=require("react-use"),ze=require("@emotion/react/jsx-runtime");function Sn({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:h,rowComponent:v,errorComponent:S,helpComponent:i,noResultsComponent:m,onSort:w,typeSelectorAllTypesOptionText:H="All categories",typeSelectorLabel:Se="Select Category"}){var de,_;let{value:L,loading:C,error:xe}=(0,lt.useAsync)(async()=>await o(),[o]),Pe=L==null?void 0:L.map(D=>D.id).join(","),W=(0,ce.useMemo)(()=>L?L.map(g=>({id:g.id,name:g.name})):void 0,[Pe]),ee=(0,ce.useRef)(),[q,Le]=(0,lt.useAsyncFn)(async(D,g)=>{let A=await t({text:D,options:{limit:g==null?void 0:g.count,offset:g==null?void 0:g.offset,categoryId:g==null?void 0:g.contentType,cursor:g==null?void 0:g.cursor}});return(g==null?void 0:g.offset)===0&&(ee.current=[]),(ee.current=ee.current||[]).push(...A.products),A},[t]),Ae=async D=>{await r(D)};return xe||q.error?(0,ze.jsx)(S||(({categoriesError:g,searchError:A})=>(0,ze.jsxs)(To.Callout,{type:"error",children:["There was an error: ",(g==null?void 0:g.message)||(A==null?void 0:A.message)]})),{categoriesError:xe,searchError:q.error}):(0,ze.jsx)(yr.Provider,{value:{categories:L,logoIcon:n},children:(0,ze.jsx)(tr,{search:Le,results:ee.current,logoIcon:n,selectedItems:e,select:Ae,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:W,selectedItemComponent:h||hr,rowComponent:v||lr,totalResults:(de=q.value)==null?void 0:de.total,cursor:(_=q.value)==null?void 0:_.cursor,resultsLoading:q.loading||C,helpComponent:i,noResultsComponent:m,onSort:w,typeSelectorAllTypesOptionText:H,typeSelectorLabel:Se})})}var yr=ce.default.createContext(void 0),De=()=>{let e=(0,ce.useContext)(yr);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};var V=require("@emotion/react"),Eo=require("@uniformdev/design-system"),br=V.css`
505
505
  border: 1px solid var(--gray-200);
506
506
  background: var(--gray-50);
507
507
  border-radius: var(--rounded-base);
@@ -579,21 +579,21 @@
579
579
  outline: none;
580
580
  border: none;
581
581
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
582
- `,ut=V.css`
582
+ `,mt=V.css`
583
583
  display: block;
584
584
  max-width: 100%;
585
585
  min-width: 100px;
586
586
  height: auto;
587
- `;var ye=require("react");var mt=require("react-icons/cg"),Mo=require("timeago.js");var he=require("@emotion/react");var Tr=require("@uniformdev/design-system"),f=require("@emotion/react/jsx-runtime");function xn({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=(0,ye.useRef)(null),d=(0,ye.useRef)(null),[h,v]=(0,ye.useState)(!1);(0,ye.useEffect)(()=>{let u=H=>{a.current&&!a.current.contains(H.target)&&d.current&&!d.current.contains(H.target)&&v(!1)},w=()=>{v(!1)};return window.addEventListener("resize",w,!0),document.addEventListener("scroll",u,!0),document.addEventListener("mousedown",u),()=>{window.removeEventListener("resize",w,!0),document.removeEventListener("scroll",u,!0),document.removeEventListener("mousedown",u)}},[d]);let S=()=>{var u;if(v(!h),d.current&&a.current){let w=(u=a==null?void 0:a.current)==null?void 0:u.getBoundingClientRect();d.current.style.top=`${w.top+30}px`}},i=n!=null?n:wn;return(0,f.jsx)("div",{css:[br,he.css`
587
+ `;var ye=require("react");var ut=require("react-icons/cg"),Mo=require("timeago.js");var he=require("@emotion/react");var Tr=require("@uniformdev/design-system"),f=require("@emotion/react/jsx-runtime");function xn({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=(0,ye.useRef)(null),d=(0,ye.useRef)(null),[h,v]=(0,ye.useState)(!1);(0,ye.useEffect)(()=>{let m=H=>{a.current&&!a.current.contains(H.target)&&d.current&&!d.current.contains(H.target)&&v(!1)},w=()=>{v(!1)};return window.addEventListener("resize",w,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",w,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[d]);let S=()=>{var m;if(v(!h),d.current&&a.current){let w=(m=a==null?void 0:a.current)==null?void 0:m.getBoundingClientRect();d.current.style.top=`${w.top+30}px`}},i=n!=null?n:wn;return(0,f.jsx)("div",{css:[br,he.css`
588
588
  margin: 0 0 1rem 0;
589
- `],children:(0,f.jsxs)("div",{css:Sr,children:[(0,f.jsxs)("div",{css:xr,children:[(0,f.jsxs)("div",{css:wr,children:[(0,f.jsx)("h4",{css:[Cr],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",ref:a,css:Ir,"aria-controls":"path-details","aria-expanded":h,onClick:S,children:(0,f.jsx)(Tr.Icon,{icon:mt.CgInfo,iconColor:"gray",size:24,css:he.css`
589
+ `],children:(0,f.jsxs)("div",{css:Sr,children:[(0,f.jsxs)("div",{css:xr,children:[(0,f.jsxs)("div",{css:wr,children:[(0,f.jsx)("h4",{css:[Cr],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",ref:a,css:Ir,"aria-controls":"path-details","aria-expanded":h,onClick:S,children:(0,f.jsx)(Tr.Icon,{icon:ut.CgInfo,iconColor:"gray",size:24,css:he.css`
590
590
  opacity: var(--opacity-75);
591
591
  `})}),(0,f.jsx)("div",{id:"path-details","aria-hidden":!h,ref:d,css:[Lr,h?he.css`
592
592
  visibility: visible;
593
593
  `:he.css`
594
594
  visibility: hidden;
595
- `],children:Object.entries(e.popoverData).map(([u,w],H)=>(0,f.jsxs)("div",{css:ve,children:[(0,f.jsxs)("span",{css:Ue,children:[u,":"]}),w]},H))})]}):null]}),(0,f.jsx)(i,{item:e})]}),(0,f.jsxs)("div",{css:Rr,children:[e.editLink?typeof e.editLink=="string"?(0,f.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:u=>{o&&(je(u.currentTarget.href,()=>o(e)),u.preventDefault())},css:pt,children:[(0,f.jsx)("span",{css:ve,children:"Edit"}),t?(0,f.jsx)(Z,{src:t,css:Pr,alt:"Logo"}):null]}):e.editLink:null,(0,f.jsxs)("button",{type:"button",onClick:()=>{r(e)},css:pt,children:[(0,f.jsx)("span",{css:ve,children:"Unlink"}),(0,f.jsx)(Tr.Icon,{icon:mt.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}function wn({item:e}){let r=null;return e.previewUrl&&typeof e.previewUrl=="string"?e.type==="image"?r=(0,f.jsx)("img",{src:e.previewUrl,alt:e.id,width:"200",css:ut}):e.type==="video"&&(r=(0,f.jsx)("video",{src:e.previewUrl,title:e.id,width:"200",controls:!0,css:ut})):e.previewUrl&&typeof e.previewUrl!="string"&&(r=e.previewUrl),r||e.metadata?(0,f.jsxs)("div",{css:kr,children:[r?(0,f.jsx)("div",{children:r}):null,(0,f.jsxs)("ul",{children:[e.metadata?Object.entries(e.metadata).map(([o,t])=>(0,f.jsxs)("li",{css:[ve,he.css`
595
+ `],children:Object.entries(e.popoverData).map(([m,w],H)=>(0,f.jsxs)("div",{css:ve,children:[(0,f.jsxs)("span",{css:Ue,children:[m,":"]}),w]},H))})]}):null]}),(0,f.jsx)(i,{item:e})]}),(0,f.jsxs)("div",{css:Rr,children:[e.editLink?typeof e.editLink=="string"?(0,f.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:m=>{o&&(je(m.currentTarget.href,()=>o(e)),m.preventDefault())},css:pt,children:[(0,f.jsx)("span",{css:ve,children:"Edit"}),t?(0,f.jsx)(Z,{src:t,css:Pr,alt:"Logo"}):null]}):e.editLink:null,(0,f.jsxs)("button",{type:"button",onClick:()=>{r(e)},css:pt,children:[(0,f.jsx)("span",{css:ve,children:"Unlink"}),(0,f.jsx)(Tr.Icon,{icon:ut.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}function wn({item:e}){let r=null;return e.previewUrl&&typeof e.previewUrl=="string"?e.type==="image"?r=(0,f.jsx)("img",{src:e.previewUrl,alt:e.id,width:"200",css:mt}):e.type==="video"&&(r=(0,f.jsx)("video",{src:e.previewUrl,title:e.id,width:"200",controls:!0,css:mt})):e.previewUrl&&typeof e.previewUrl!="string"&&(r=e.previewUrl),r||e.metadata?(0,f.jsxs)("div",{css:kr,children:[r?(0,f.jsx)("div",{children:r}):null,(0,f.jsxs)("ul",{children:[e.metadata?Object.entries(e.metadata).map(([o,t])=>(0,f.jsxs)("li",{css:[ve,he.css`
596
596
  order: 1;
597
597
  `],children:[(0,f.jsxs)("span",{css:[Ue,he.css`
598
598
  order: 1;
599
- `],children:[o,":"]}),t]},o)):null,e.createdDate?(0,f.jsxs)("li",{css:ve,children:[(0,f.jsx)("span",{css:Ue,children:"Date:"}),(0,Mo.format)(e.createdDate)]}):null]})]}):null}var gt=require("@uniformdev/design-system");var be=require("@emotion/react/jsx-runtime"),Cn=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=bt();if(t||!a){let d=r;return d?(0,be.jsx)(d,{}):(0,be.jsx)(gt.LoadingIndicator,{})}if(n){let d=o;if(d)return(0,be.jsx)(d,{error:n});throw n}return(0,be.jsxs)(ke.Provider,{value:{sdk:a},children:[(0,be.jsx)(gt.Theme,{}),(0,be.jsx)(Ie,{children:e})]})};F(O,require("@uniformdev/mesh-sdk"),module.exports);var m=require("@uniformdev/design-system");0&&(module.exports={AddListButton,Button,Callout,DamSelectedItem,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,KeywordSearchInput,Label,LoadingIndicator,LoadingOverlay,Menu,MenuItem,MeshApp,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Switch,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,badgeIcon,damSelectItemImage,damSelectedItemContainer,damSelectedItemCopy,damSelectedItemDetails,damSelectedItemIcon,damSelectedItemInfoBtn,damSelectedItemInner,damSelectedItemLinkBtn,damSelectedItemLinkContainer,damSelectedItemMediaContainer,damSelectedItemPopover,damSelectedItemPopoverLabel,damSelectedItemSmallText,damSelectedItemTitle,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemIcon,productSelectedItemImage,productSelectedItemLinkContainer,productedSelectedItemLinkBtn,productedSelectedItemSmallText,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowContainerWithPopover,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useMeshLocation,useProductQueryContext,useProductSearchContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});
599
+ `],children:[o,":"]}),t]},o)):null,e.createdDate?(0,f.jsxs)("li",{css:ve,children:[(0,f.jsx)("span",{css:Ue,children:"Date:"}),(0,Mo.format)(e.createdDate)]}):null]})]}):null}var gt=require("@uniformdev/design-system");var be=require("@emotion/react/jsx-runtime"),Cn=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=bt();if(t||!a){let d=r;return d?(0,be.jsx)(d,{}):(0,be.jsx)(gt.LoadingIndicator,{})}if(n){let d=o;if(d)return(0,be.jsx)(d,{error:n});throw n}return(0,be.jsxs)(ke.Provider,{value:{sdk:a},children:[(0,be.jsx)(gt.Theme,{}),(0,be.jsx)(Ie,{children:e})]})};F(O,require("@uniformdev/mesh-sdk"),module.exports);var u=require("@uniformdev/design-system");0&&(module.exports={AddListButton,Button,Callout,DamSelectedItem,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,KeywordSearchInput,Label,LoadingIndicator,LoadingOverlay,Menu,MenuItem,MeshApp,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Switch,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,badgeIcon,damSelectItemImage,damSelectedItemContainer,damSelectedItemCopy,damSelectedItemDetails,damSelectedItemIcon,damSelectedItemInfoBtn,damSelectedItemInner,damSelectedItemLinkBtn,damSelectedItemLinkContainer,damSelectedItemMediaContainer,damSelectedItemPopover,damSelectedItemPopoverLabel,damSelectedItemSmallText,damSelectedItemTitle,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemIcon,productSelectedItemImage,productSelectedItemLinkContainer,productedSelectedItemLinkBtn,productedSelectedItemSmallText,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowContainerWithPopover,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useMeshLocation,useProductQueryContext,useProductSearchContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enumerable:!0})};import{jsx as l}from"@emotion/react";import*as x from"react";import{createContext as Uo,useContext as Ao,useEffect as Go,useState as Bo}from"react";import{createContext as Mo,useContext as Vo}from"react";import{Theme as Do}from"@uniformdev/design-system";import{jsx as st,jsxs as zo}from"@emotion/react/jsx-runtime";var we=Mo(void 0),ha=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),zo(we.Provider,{value:r,children:[st(Do,{}),st(Ce,{children:e})]})},ct=()=>{let e=Vo(we);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function dt(){let{sdk:e}=ct();return e}import{jsx as Oo}from"@emotion/react/jsx-runtime";var lt=Uo(void 0),Ce=({children:e})=>{let r=dt(),[o,t]=Bo(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return Go(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),Oo(lt.Provider,{value:{location:o},children:e})},Pe=()=>{let e=Ao(lt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Ra(){let{location:e}=Pe();return e}import{initializeUniformMeshSDK as Ho}from"@uniformdev/mesh-sdk";import{useEffect as $o,useRef as Fo,useState as pt}from"react";var ut=({autoResizingDisabled:e}={})=>{let[r,o]=pt(),[t,n]=pt(),a=Fo(!1);return $o(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,Ho({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function Da(e){let{location:r}=Pe();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}import Xo,{useMemo as ke,useContext as qo}from"react";import{css as Ko}from"@emotion/react";import{Icon as No,InputSelect as Qo}from"@uniformdev/design-system";import{CgClose as Wo}from"react-icons/cg";import{Fragment as mt,jsxs as gt}from"@emotion/react/jsx-runtime";var ft=({value:e,text:r,loading:o})=>gt(mt,{children:[!!r&&r,!r&&gt(mt,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});import{css as Ge}from"@emotion/react";var vt=Ge`
1
+ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enumerable:!0})};import{jsx as l}from"@emotion/react";import*as x from"react";import{createContext as Uo,useContext as Ao,useEffect as Go,useState as Bo}from"react";import{createContext as Mo,useContext as Vo}from"react";import{Theme as Do}from"@uniformdev/design-system";import{jsx as st,jsxs as zo}from"@emotion/react/jsx-runtime";var we=Mo(void 0),ha=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),zo(we.Provider,{value:r,children:[st(Do,{}),st(Ce,{children:e})]})},ct=()=>{let e=Vo(we);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function dt(){let{sdk:e}=ct();return e}import{jsx as Oo}from"@emotion/react/jsx-runtime";var lt=Uo(void 0),Ce=({children:e})=>{let r=dt(),[o,t]=Bo(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return Go(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),Oo(lt.Provider,{value:{location:o},children:e})},Pe=()=>{let e=Ao(lt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Ra(){let{location:e}=Pe();return e}import{initializeUniformMeshSDK as Ho}from"@uniformdev/mesh-sdk";import{useEffect as $o,useRef as Fo,useState as pt}from"react";var mt=({autoResizingDisabled:e}={})=>{let[r,o]=pt(),[t,n]=pt(),a=Fo(!1);return $o(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,Ho({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function Da(e){let{location:r}=Pe();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}import Xo,{useMemo as ke,useContext as qo}from"react";import{css as Ko}from"@emotion/react";import{Icon as No,InputSelect as Qo}from"@uniformdev/design-system";import{CgClose as Wo}from"react-icons/cg";import{Fragment as ut,jsxs as gt}from"@emotion/react/jsx-runtime";var ft=({value:e,text:r,loading:o})=>gt(ut,{children:[!!r&&r,!r&&gt(ut,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});import{css as Ge}from"@emotion/react";var vt=Ge`
2
2
  align-items: center;
3
3
  background: var(--gray-100);
4
4
  border: 1px solid var(--gray-300);
@@ -15,13 +15,13 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
15
15
  border-left: 1px solid var(--gray-300);
16
16
  background: var(--gray-100);
17
17
  padding: var(--spacing-3);
18
- `;import{jsx as fe,jsxs as bt}from"@emotion/react/jsx-runtime";var St=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var v;let f=(v=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?v:[],m=(i,p)=>{i.preventDefault(),d(p)};return bt("div",{children:[fe(Qo,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...f.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Ko`
18
+ `;import{jsx as fe,jsxs as bt}from"@emotion/react/jsx-runtime";var St=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var v;let f=(v=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?v:[],u=(i,p)=>{i.preventDefault(),d(p)};return bt("div",{children:[fe(Qo,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...f.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Ko`
19
19
  margin-bottom: var(--spacing-base);
20
- `:""}),t==null?void 0:t.map(i=>{var p;return bt("div",{css:vt,children:[fe("span",{css:ht,children:fe(ft,{value:i,loading:o,text:(p=n.find(y=>y.id===i))==null?void 0:p.name})}),fe("button",{css:yt,title:"remove",onClick:y=>m(y,i),children:fe(No,{icon:Wo,iconColor:"currentColor",size:20})})]},i)})]})};import{jsx as xt}from"@emotion/react/jsx-runtime";var _o=e=>xt("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:xt("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"})}),Le=_o;import{jsx as wt}from"@emotion/react/jsx-runtime";var Zo=e=>wt("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:wt("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),Re=Zo;import{useAsyncFn as Yo,useDebounce as Jo}from"react-use";import{Input as Ct,InputSelect as Ie,mq as Te}from"@uniformdev/design-system";import{css as L}from"@emotion/react";import{jsx as w,jsxs as se}from"@emotion/react/jsx-runtime";var Pt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},ri=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:f,onGetProducts:m,sortOptions:v,sortOrderOptions:i,categoryLabel:p="Product Category",brandLabel:y="Brand",disableBrands:D,restrictToSingleCategory:ae=!1})=>{var E,u,V;let S=async s=>{r({...Pt,...e||{},...s})},b=ke(()=>({...Pt,...e||{}}),[e]),[ie,ue]=Yo(async s=>await m(s),[m]);Jo(async()=>{await ue({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let O=ke(()=>{let s=[];return t==null||t.forEach(z=>{let C=Rt(z,void 0);s.push(...C)}),s},[t]),_=ke(()=>[{value:"",label:"All categories"},...O.map(s=>({label:s.name,value:s.id}))],[O]),W=ke(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),me=s=>{if(!s)return;let z=(e==null?void 0:e.categories)||[];S({categories:[...z,s]})},Se=s=>{var z;S({categories:(z=e==null?void 0:e.categories)==null?void 0:z.filter(C=>C!==s)})},j=s=>{S({brand:s.target.value})},H=s=>{S({count:s||1})};return n?w("div",{children:"Loading..."}):w(kt.Provider,{value:{categories:t,logoIcon:f},children:se("div",{css:L`
20
+ `:""}),t==null?void 0:t.map(i=>{var p;return bt("div",{css:vt,children:[fe("span",{css:ht,children:fe(ft,{value:i,loading:o,text:(p=n.find(y=>y.id===i))==null?void 0:p.name})}),fe("button",{css:yt,title:"remove",onClick:y=>u(y,i),children:fe(No,{icon:Wo,iconColor:"currentColor",size:20})})]},i)})]})};import{jsx as xt}from"@emotion/react/jsx-runtime";var _o=e=>xt("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:xt("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"})}),Le=_o;import{jsx as wt}from"@emotion/react/jsx-runtime";var Zo=e=>wt("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:wt("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),Re=Zo;import{useAsyncFn as Yo,useDebounce as Jo}from"react-use";import{Input as Ct,InputSelect as Ie,mq as Te}from"@uniformdev/design-system";import{css as L}from"@emotion/react";import{jsx as w,jsxs as se}from"@emotion/react/jsx-runtime";var Pt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},ri=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:f,onGetProducts:u,sortOptions:v,sortOrderOptions:i,categoryLabel:p="Product Category",brandLabel:y="Brand",disableBrands:D,restrictToSingleCategory:ae=!1})=>{var E,m,V;let S=async s=>{r({...Pt,...e||{},...s})},b=ke(()=>({...Pt,...e||{}}),[e]),[ie,me]=Yo(async s=>await u(s),[u]);Jo(async()=>{await me({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let O=ke(()=>{let s=[];return t==null||t.forEach(z=>{let C=Rt(z,void 0);s.push(...C)}),s},[t]),_=ke(()=>[{value:"",label:"All categories"},...O.map(s=>({label:s.name,value:s.id}))],[O]),W=ke(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),ue=s=>{if(!s)return;let z=(e==null?void 0:e.categories)||[];S({categories:[...z,s]})},Se=s=>{var z;S({categories:(z=e==null?void 0:e.categories)==null?void 0:z.filter(C=>C!==s)})},j=s=>{S({brand:s.target.value})},H=s=>{S({count:s||1})};return n?w("div",{children:"Loading..."}):w(kt.Provider,{value:{categories:t,logoIcon:f},children:se("div",{css:L`
21
21
  > :not(:last-child) {
22
22
  margin-bottom: var(--spacing-md);
23
23
  }
24
- `,children:[ae?w(Ie,{id:"selection-field-product-category",label:p,disabled:n,value:(u=(E=b.categories)==null?void 0:E[0])!=null?u:"",options:_,onChange:s=>{S({categories:s.target.value===""?[]:[s.target.value]})}}):w(St,{loading:a||!1,id:"selection-field-product-category",label:p,onAdd:me,onRemove:Se,selectedValues:b.categories,values:O}),se("div",{css:L`
24
+ `,children:[ae?w(Ie,{id:"selection-field-product-category",label:p,disabled:n,value:(m=(E=b.categories)==null?void 0:E[0])!=null?m:"",options:_,onChange:s=>{S({categories:s.target.value===""?[]:[s.target.value]})}}):w(St,{loading:a||!1,id:"selection-field-product-category",label:p,onAdd:ue,onRemove:Se,selectedValues:b.categories,values:O}),se("div",{css:L`
25
25
  display: flex;
26
26
  flex-wrap: wrap;
27
27
  column-gap: var(--spacing-lg);
@@ -145,7 +145,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
145
145
  `,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),q("ul",{css:[Ht`
146
146
  max-height: 24rem;
147
147
  overflow-x: auto;
148
- `,jo],children:e==null?void 0:e.map((t,n)=>{var f,m;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(f=r.find(v=>v.id===a.id))==null?void 0:f.name;return q("li",{css:zt,children:X("div",{css:Ut,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?q("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:At,"data-test-id":"product-image"}):q("div",{css:Gt}),X("h4",{css:Bt,"data-test-id":"product-name",children:[t.title||t.name,d&&q("span",{css:Ot,children:d})]}),t&&X($t,{children:[X("p",{css:Be,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,q("br",{})]}),t.price!==void 0?X("p",{css:Be,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?X("a",{css:Mt,href:(m=t.editLink)!=null?m:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[q("span",{css:Vt,children:"Edit"}),o?q($,{src:o,alt:"Logo",css:Dt}):null]}):null]})]})},`product-${t.id}`)})})]})};import Nn,{useContext as Qn,useMemo as Wn,useRef as _n}from"react";import*as G from"react";var He={};Eo(He,{Caution:()=>Kt,Checkmark:()=>Ee,ChevronDown:()=>Me,Close:()=>Wt,Danger:()=>Zt,ExclamationPoint:()=>qt,Info:()=>Ve,Lightbulb:()=>jt,MagnifyingGlass:()=>tr,MaximizeAlt:()=>or,Minus:()=>Re,MoreVerticalAlt:()=>he,Plus:()=>Le});import{jsx as Ft}from"@emotion/react/jsx-runtime";var en=e=>Ft("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:Ft("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"})}),Kt=en;import{jsx as Nt}from"@emotion/react/jsx-runtime";var tn=e=>Nt("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:Nt("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"})}),Ee=tn;import{jsx as Qt}from"@emotion/react/jsx-runtime";var rn=e=>Qt("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:Qt("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"})}),Me=rn;import{jsx as Oe,jsxs as nn}from"@emotion/react/jsx-runtime";var on=e=>Oe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:nn("g",{fillRule:"evenodd",children:[Oe("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"}),Oe("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"})]})}),Wt=on;import{jsx as _t}from"@emotion/react/jsx-runtime";var an=e=>_t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:_t("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"})}),Zt=an;import{jsx as Xt}from"@emotion/react/jsx-runtime";var sn=e=>Xt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:Xt("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"})}),qt=sn;import{jsx as Yt,jsxs as dn}from"@emotion/react/jsx-runtime";var cn=e=>dn("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[Yt("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"}),Yt("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"})]}),Ve=cn;import{jsx as Jt}from"@emotion/react/jsx-runtime";var ln=e=>Jt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:Jt("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"})}),jt=ln;import{jsx as ve,jsxs as er}from"@emotion/react/jsx-runtime";var pn=e=>er("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[er("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[ve("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"}),ve("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"})]}),ve("defs",{children:ve("clipPath",{id:"magnifying-glass_svg__a",children:ve("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),tr=pn;import{jsx as rr}from"@emotion/react/jsx-runtime";var un=e=>rr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:rr("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"})}),or=un;import{jsx as nr}from"@emotion/react/jsx-runtime";var mn=e=>nr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:nr("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"})}),he=mn;import{useThrottle as Rn}from"react-use";import{v4 as kn}from"uuid";import{useState as fn,useRef as mr,useEffect as vn}from"react";function De(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}import{format as hn}from"timeago.js";import{css as U}from"@emotion/react";import{mq as gn}from"@uniformdev/design-system";var ar=U`
148
+ `,jo],children:e==null?void 0:e.map((t,n)=>{var f,u;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(f=r.find(v=>v.id===a.id))==null?void 0:f.name;return q("li",{css:zt,children:X("div",{css:Ut,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?q("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:At,"data-test-id":"product-image"}):q("div",{css:Gt}),X("h4",{css:Bt,"data-test-id":"product-name",children:[t.title||t.name,d&&q("span",{css:Ot,children:d})]}),t&&X($t,{children:[X("p",{css:Be,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,q("br",{})]}),t.price!==void 0?X("p",{css:Be,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?X("a",{css:Mt,href:(u=t.editLink)!=null?u:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[q("span",{css:Vt,children:"Edit"}),o?q($,{src:o,alt:"Logo",css:Dt}):null]}):null]})]})},`product-${t.id}`)})})]})};import Nn,{useContext as Qn,useMemo as Wn,useRef as _n}from"react";import*as G from"react";var He={};Eo(He,{Caution:()=>Kt,Checkmark:()=>Ee,ChevronDown:()=>Me,Close:()=>Wt,Danger:()=>Zt,ExclamationPoint:()=>qt,Info:()=>Ve,Lightbulb:()=>jt,MagnifyingGlass:()=>tr,MaximizeAlt:()=>or,Minus:()=>Re,MoreVerticalAlt:()=>he,Plus:()=>Le});import{jsx as Ft}from"@emotion/react/jsx-runtime";var en=e=>Ft("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",role:"img",...e,children:Ft("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"})}),Kt=en;import{jsx as Nt}from"@emotion/react/jsx-runtime";var tn=e=>Nt("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:Nt("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"})}),Ee=tn;import{jsx as Qt}from"@emotion/react/jsx-runtime";var rn=e=>Qt("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",role:"img",...e,children:Qt("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"})}),Me=rn;import{jsx as Oe,jsxs as nn}from"@emotion/react/jsx-runtime";var on=e=>Oe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",role:"img",...e,children:nn("g",{fillRule:"evenodd",children:[Oe("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"}),Oe("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"})]})}),Wt=on;import{jsx as _t}from"@emotion/react/jsx-runtime";var an=e=>_t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:_t("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"})}),Zt=an;import{jsx as Xt}from"@emotion/react/jsx-runtime";var sn=e=>Xt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",role:"img",...e,children:Xt("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"})}),qt=sn;import{jsx as Yt,jsxs as dn}from"@emotion/react/jsx-runtime";var cn=e=>dn("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:[Yt("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"}),Yt("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"})]}),Ve=cn;import{jsx as Jt}from"@emotion/react/jsx-runtime";var ln=e=>Jt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:Jt("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"})}),jt=ln;import{jsx as ve,jsxs as er}from"@emotion/react/jsx-runtime";var pn=e=>er("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:[er("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[ve("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"}),ve("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"})]}),ve("defs",{children:ve("clipPath",{id:"magnifying-glass_svg__a",children:ve("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),tr=pn;import{jsx as rr}from"@emotion/react/jsx-runtime";var mn=e=>rr("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:rr("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"})}),or=mn;import{jsx as nr}from"@emotion/react/jsx-runtime";var un=e=>nr("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:nr("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"})}),he=un;import{useThrottle as Rn}from"react-use";import{v4 as kn}from"uuid";import{useState as fn,useRef as ur,useEffect as vn}from"react";function De(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}import{format as hn}from"timeago.js";import{css as U}from"@emotion/react";import{mq as gn}from"@uniformdev/design-system";var ar=U`
149
149
  border: 1px solid var(--gray-200);
150
150
  background: var(--gray-50);
151
151
  border-radius: var(--rounded-base);
@@ -188,7 +188,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
188
188
  `,ye=U`
189
189
  font-weight: var(--fw-bold);
190
190
  margin-right: var(--spacing-sm);
191
- `,ur=U`
191
+ `,mr=U`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  gap: var(--spacing-sm);
@@ -213,11 +213,11 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
213
213
  &:hover {
214
214
  background: var(--gray-50);
215
215
  }
216
- `;import{css as Y}from"@emotion/react";import{Icon as gr}from"@uniformdev/design-system";import{CgClose as yn,CgInfo as bn}from"react-icons/cg";import{Fragment as Sn,jsx as K,jsxs as R}from"@emotion/react/jsx-runtime";var fr=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var v;let n=mr(null),a=mr(null),[d,f]=fn(!1);vn(()=>{let i=y=>{n.current&&!n.current.contains(y.target)&&a.current&&!a.current.contains(y.target)&&f(!1)},p=()=>{f(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let m=()=>{var i;if(f(!d),a.current&&n.current){let p=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),y=a.current.offsetWidth;a.current.style.top=`${p.top+30}px`,a.current.style.left=`${p.left-y+30}px`}};return K("div",{css:ar,children:R("div",{css:ir,children:[R("div",{css:sr,children:[R("div",{css:cr,children:[K("h4",{css:[dr,e.popoverData?Y`
216
+ `;import{css as Y}from"@emotion/react";import{Icon as gr}from"@uniformdev/design-system";import{CgClose as yn,CgInfo as bn}from"react-icons/cg";import{Fragment as Sn,jsx as K,jsxs as R}from"@emotion/react/jsx-runtime";var fr=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var v;let n=ur(null),a=ur(null),[d,f]=fn(!1);vn(()=>{let i=y=>{n.current&&!n.current.contains(y.target)&&a.current&&!a.current.contains(y.target)&&f(!1)},p=()=>{f(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let u=()=>{var i;if(f(!d),a.current&&n.current){let p=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),y=a.current.offsetWidth;a.current.style.top=`${p.top+30}px`,a.current.style.left=`${p.left-y+30}px`}};return K("div",{css:ar,children:R("div",{css:ir,children:[R("div",{css:sr,children:[R("div",{css:cr,children:[K("h4",{css:[dr,e.popoverData?Y`
217
217
  margin-bottom: var(--spacing-sm);
218
218
  `:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?R(Sn,{children:[K("button",{type:"button",ref:n,css:Y`
219
219
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
220
- `,"aria-controls":"path-details","aria-expanded":d,onClick:m,children:K(gr,{icon:bn,iconColor:"gray",size:24,css:Y`
220
+ `,"aria-controls":"path-details","aria-expanded":d,onClick:u,children:K(gr,{icon:bn,iconColor:"gray",size:24,css:Y`
221
221
  opacity: var(--opacity-75);
222
222
  `})}),K("div",{id:"path-details","aria-hidden":!d,ref:a,css:[pr,d?Y`
223
223
  visibility: visible;
@@ -229,7 +229,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
229
229
  order: 1;
230
230
  `],children:[R("span",{css:[ye,Y`
231
231
  order: 1;
232
- `],children:[i,":"]}),p]},i)):null]}),R("div",{css:ur,children:[e.editLink?R("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(De(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:$e,children:[K("span",{css:te,children:"Edit"}),K($,{src:r,css:lr,alt:"Logo"})]}):null,R("button",{type:"button",onClick:()=>{o(e)},css:$e,children:[K("span",{css:te,children:"Unlink"}),K(gr,{icon:yn,iconColor:"red",size:16})]})]})]})},e.id)};import{useState as xn,useRef as xr,useEffect as wn}from"react";import{css as re}from"@emotion/react";var vr=re`
232
+ `],children:[i,":"]}),p]},i)):null]}),R("div",{css:mr,children:[e.editLink?R("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(De(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:$e,children:[K("span",{css:te,children:"Edit"}),K($,{src:r,css:lr,alt:"Logo"})]}):null,R("button",{type:"button",onClick:()=>{o(e)},css:$e,children:[K("span",{css:te,children:"Unlink"}),K(gr,{icon:yn,iconColor:"red",size:16})]})]})]})},e.id)};import{useState as xn,useRef as xr,useEffect as wn}from"react";import{css as re}from"@emotion/react";var vr=re`
233
233
  cursor: pointer;
234
234
  padding: var(--spacing-sm);
235
235
  position: relative;
@@ -260,11 +260,11 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
260
260
  `,Sr=re`
261
261
  position: absolute;
262
262
  inset: 0 var(--spacing-sm) 0 auto;
263
- `;import{css as wr}from"@emotion/react";import{Fragment as Cn,jsx as Cr,jsxs as oe}from"@emotion/react/jsx-runtime";var Pr=({result:e,isSelected:r,triggerSelection:o})=>{let t=xr(null),n=xr(null),[a,d]=xn(!1);wn(()=>{function m(v){t.current&&!t.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&d(!1)}return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[n]);let f=m=>{m.stopPropagation(),d(!a)};return oe("div",{css:[vr,r?yr:void 0,e.popoverData?hr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?oe(Cn,{children:[Cr("button",{type:"button",ref:t,css:Sr,"aria-controls":"path-details",onClick:m=>f(m),"aria-expanded":a,children:Cr(Ve,{width:24,height:24})}),oe("div",{id:"path-details","aria-hidden":!a,ref:n,css:[br,a?wr`
263
+ `;import{css as wr}from"@emotion/react";import{Fragment as Cn,jsx as Cr,jsxs as oe}from"@emotion/react/jsx-runtime";var Pr=({result:e,isSelected:r,triggerSelection:o})=>{let t=xr(null),n=xr(null),[a,d]=xn(!1);wn(()=>{function u(v){t.current&&!t.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&d(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[n]);let f=u=>{u.stopPropagation(),d(!a)};return oe("div",{css:[vr,r?yr:void 0,e.popoverData?hr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?oe(Cn,{children:[Cr("button",{type:"button",ref:t,css:Sr,"aria-controls":"path-details",onClick:u=>f(u),"aria-expanded":a,children:Cr(Ve,{width:24,height:24})}),oe("div",{id:"path-details","aria-hidden":!a,ref:n,css:[br,a?wr`
264
264
  visibility: visible;
265
265
  `:wr`
266
266
  visibility: hidden;
267
- `],children:[e.metadata&&Object.entries(e.metadata).map(([m,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[m,":"]}),v]},i)),Object.entries(e.popoverData).map(([m,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[m,":"]}),v]},i))]})]}):null]},e.id)};import{Droppable as In,DragDropContext as Tn,Draggable as En}from"react-beautiful-dnd";import{css as P}from"@emotion/react";var Lr=P`
267
+ `],children:[e.metadata&&Object.entries(e.metadata).map(([u,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[u,":"]}),v]},i)),Object.entries(e.popoverData).map(([u,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[u,":"]}),v]},i))]})]}):null]},e.id)};import{Droppable as In,DragDropContext as Tn,Draggable as En}from"react-beautiful-dnd";import{css as P}from"@emotion/react";var Lr=P`
268
268
  background: var(--white);
269
269
  border: 1px solid var(--gray-300);
270
270
  border-radius: var(--rounded-base);
@@ -352,7 +352,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
352
352
  `,Qe=P`
353
353
  width: calc(var(--spacing-lg) + var(--spacing-xs));
354
354
  height: calc(var(--spacing-lg) + var(--spacing-xs));
355
- `;import{css as N}from"@emotion/react";import{InputSelect as Mn,scrollbarStyles as Vn,Button as We,Callout as Dn,InputKeywordSearch as zn,LoadingIndicator as Un,Menu as An,MenuItem as Gn,LoadingOverlay as Bn}from"@uniformdev/design-system";import{useState as Pn,useEffect as Ar,useRef as Ln}from"react";function Gr(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=Pn("IDLE"),a=Ln(void 0);return Ar(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),Ar(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}import{Fragment as Hn,jsx as g,jsxs as A}from"@emotion/react/jsx-runtime";var On=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),g(Dn,{type:"info",children:o})},Br=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:f,rowComponent:m,selectedItemComponent:v,totalResults:i,cursor:p,resultsLoading:y,requireContentType:D,onAddNew:ae,onEditClosed:S,onCancel:b,noResultsComponent:ie,helpComponent:ue,onSort:O,typeSelectorLabel:_="Content Type Select",typeSelectorAllTypesOptionText:W="All content types",loadingIndicatorDelay:me=1e3})=>{var nt,at,it;let j=()=>D?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[H,E]=G.useState(""),[u,V]=G.useState(j),[s,z]=G.useState(!1),[C,ee]=G.useState([]),[fo,et]=G.useState(!1),Ae=G.useRef(`x${kn()}`),xe=Rn(H,750);G.useEffect(()=>{e(xe,{count:5,offset:0,contentType:u==="any"?void 0:u})},[xe,u]);let vo=Gr(y,{delay:me}),ho=c=>{C.some(h=>h.id===c.id)?ee(h=>h.filter(Z=>Z.id!==c.id)):ee(d?h=>[...h,c]:[c])},yo=t==null?void 0:t.map(c=>c.id+c.title).join(",");G.useEffect(()=>{Array.isArray(t)&&ee(t)},[yo]);let bo=()=>{V(j()),E(""),ee(t!=null&&t.length?t:[])},So=()=>{z(c=>!c),s||bo()},tt=c=>{let h=(C==null?void 0:C.filter(Z=>Z.id!==c.id))||[];ee(h),a(h,"")},xo=c=>{c.preventDefault(),a(C,u),z(!1)},wo=c=>{c.preventDefault(),z(!1),b&&b()},Co=()=>{e(xe,{count:5,offset:(r==null?void 0:r.length)||0,contentType:u==="any"?void 0:u,cursor:p}),et(!0);let c=setTimeout(()=>{et(!1)},750);return()=>clearTimeout(c)},Po=!(t==null?void 0:t.length)||d,Lo=m||Pr,rt=v||fr,Ro=ie||On,ot=n&&typeof n!="string"?n:null,ko=ot?g(ot,{css:Qe}):g("img",{src:n,alt:"Logo",css:Qe}),Io=c=>{var h,Z;if(c.destination&&c.source.droppableId===((h=c.destination)==null?void 0:h.droppableId)){let M=[...t||[]],[ge]=(Z=M==null?void 0:M.splice(c.source.index,1))!=null?Z:[];return M==null||M.splice(c.destination.index,0,ge),O&&(ee(M),O==null||O(M)),M}};return g("div",{css:N`
355
+ `;import{css as N}from"@emotion/react";import{InputSelect as Mn,scrollbarStyles as Vn,Button as We,Callout as Dn,InputKeywordSearch as zn,LoadingIndicator as Un,Menu as An,MenuItem as Gn,LoadingOverlay as Bn}from"@uniformdev/design-system";import{useState as Pn,useEffect as Ar,useRef as Ln}from"react";function Gr(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=Pn("IDLE"),a=Ln(void 0);return Ar(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),Ar(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}import{Fragment as Hn,jsx as g,jsxs as A}from"@emotion/react/jsx-runtime";var On=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),g(Dn,{type:"info",children:o})},Br=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:f,rowComponent:u,selectedItemComponent:v,totalResults:i,cursor:p,resultsLoading:y,requireContentType:D,onAddNew:ae,onEditClosed:S,onCancel:b,noResultsComponent:ie,helpComponent:me,onSort:O,typeSelectorLabel:_="Content Type Select",typeSelectorAllTypesOptionText:W="All content types",loadingIndicatorDelay:ue=1e3})=>{var nt,at,it;let j=()=>D?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[H,E]=G.useState(""),[m,V]=G.useState(j),[s,z]=G.useState(!1),[C,ee]=G.useState([]),[fo,et]=G.useState(!1),Ae=G.useRef(`x${kn()}`),xe=Rn(H,750);G.useEffect(()=>{e(xe,{count:5,offset:0,contentType:m==="any"?void 0:m})},[xe,m]);let vo=Gr(y,{delay:ue}),ho=c=>{C.some(h=>h.id===c.id)?ee(h=>h.filter(Z=>Z.id!==c.id)):ee(d?h=>[...h,c]:[c])},yo=t==null?void 0:t.map(c=>c.id+c.title).join(",");G.useEffect(()=>{Array.isArray(t)&&ee(t)},[yo]);let bo=()=>{V(j()),E(""),ee(t!=null&&t.length?t:[])},So=()=>{z(c=>!c),s||bo()},tt=c=>{let h=(C==null?void 0:C.filter(Z=>Z.id!==c.id))||[];ee(h),a(h,"")},xo=c=>{c.preventDefault(),a(C,m),z(!1)},wo=c=>{c.preventDefault(),z(!1),b&&b()},Co=()=>{e(xe,{count:5,offset:(r==null?void 0:r.length)||0,contentType:m==="any"?void 0:m,cursor:p}),et(!0);let c=setTimeout(()=>{et(!1)},750);return()=>clearTimeout(c)},Po=!(t==null?void 0:t.length)||d,Lo=u||Pr,rt=v||fr,Ro=ie||On,ot=n&&typeof n!="string"?n:null,ko=ot?g(ot,{css:Qe}):g("img",{src:n,alt:"Logo",css:Qe}),Io=c=>{var h,Z;if(c.destination&&c.source.droppableId===((h=c.destination)==null?void 0:h.droppableId)){let M=[...t||[]],[ge]=(Z=M==null?void 0:M.splice(c.source.index,1))!=null?Z:[];return M==null||M.splice(c.destination.index,0,ge),O&&(ee(M),O==null||O(M)),M}};return g("div",{css:N`
356
356
  width: 100%;
357
357
  `,children:A("div",{css:N`
358
358
  position: relative;
@@ -361,13 +361,13 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
361
361
  margin-left: var(--spacing-base);
362
362
  `,children:"Select"}),g("span",{css:Mr,children:g(Me,{css:[Vr,s?N`
363
363
  transform: rotate(180deg);
364
- `:void 0]})})]})}),A("div",{id:`entry-search-config-${Ae.current}`,"aria-hidden":!s,css:[Ir,s?void 0:Tr],children:[ue||null,A("div",{css:N`
364
+ `:void 0]})})]})}),A("div",{id:`entry-search-config-${Ae.current}`,"aria-hidden":!s,css:[Ir,s?void 0:Tr],children:[me||null,A("div",{css:N`
365
365
  display: flex;
366
366
  gap: calc(var(--spacing-base) - 0.25rem);
367
367
  margin-bottom: var(--spacing-base);
368
- `,children:[g(Mn,{onChange:c=>V(c.target.value),value:u,label:_,showLabel:!1,options:[...D?[]:[{value:"any",label:W}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),g("div",{css:N`
368
+ `,children:[g(Mn,{onChange:c=>V(c.target.value),value:m,label:_,showLabel:!1,options:[...D?[]:[{value:"any",label:W}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),g("div",{css:N`
369
369
  flex-grow: 1;
370
- `,children:g(zn,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:E,disabledFieldSubmission:!0,value:H})})]}),A("div",{css:[Er,Vn],id:Ae.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[g(Bn,{isActive:vo}),Array.isArray(r)&&r.length>0?r.map(c=>g(Lo,{isSelected:C.some(h=>h.id===c.id),result:c,triggerSelection:()=>ho(c)},c.id)):g(Ro,{searchText:xe||H,selectedContentType:(at=(nt=o==null?void 0:o.find(c=>c.id===u))==null?void 0:nt.name)!=null?at:u}),!y&&typeof i!="undefined"&&r&&(r==null?void 0:r.length)<i&&g("button",{type:"button",css:kr,onClick:Co,children:fo?g(Un,{}):"Load More"})]}),A("div",{css:N`
370
+ `,children:g(zn,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:E,disabledFieldSubmission:!0,value:H})})]}),A("div",{css:[Er,Vn],id:Ae.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[g(Bn,{isActive:vo}),Array.isArray(r)&&r.length>0?r.map(c=>g(Lo,{isSelected:C.some(h=>h.id===c.id),result:c,triggerSelection:()=>ho(c)},c.id)):g(Ro,{searchText:xe||H,selectedContentType:(at=(nt=o==null?void 0:o.find(c=>c.id===m))==null?void 0:nt.name)!=null?at:m}),!y&&typeof i!="undefined"&&r&&(r==null?void 0:r.length)<i&&g("button",{type:"button",css:kr,onClick:Co,children:fo?g(Un,{}):"Load More"})]}),A("div",{css:N`
371
371
  display: flex;
372
372
  justify-content: space-between;
373
373
  `,children:[g("div",{children:ae&&((it=o==null?void 0:o.length)!=null?it:0)>0?g(An,{menuLabel:"Add new menu",menuTrigger:g(We,{buttonType:"secondary",children:"Add New"}),children:o==null?void 0:o.map(c=>g(Gn,{css:N`
@@ -412,7 +412,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
412
412
  width: 1.5rem;
413
413
  color: var(--brand-secondary-3);
414
414
  margin-left: auto;
415
- `;import{css as Wr}from"@emotion/react";import{jsx as ce,jsxs as _e}from"@emotion/react/jsx-runtime";function _r({result:e,isSelected:r,triggerSelection:o}){var f;let{categories:t,logoIcon:n}=ze(),[a]=e.categories||[{id:"",name:""}],d=typeof a=="undefined"||!t||(f=t.find(m=>m.id===a.id))==null?void 0:f.name;return ce("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Or],children:_e("div",{css:[Hr,r?$r:void 0],children:[e.thumbnailUrl?ce("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Wr`
415
+ `;import{css as Wr}from"@emotion/react";import{jsx as ce,jsxs as _e}from"@emotion/react/jsx-runtime";function _r({result:e,isSelected:r,triggerSelection:o}){var f;let{categories:t,logoIcon:n}=ze(),[a]=e.categories||[{id:"",name:""}],d=typeof a=="undefined"||!t||(f=t.find(u=>u.id===a.id))==null?void 0:f.name;return ce("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Or],children:_e("div",{css:[Hr,r?$r:void 0],children:[e.thumbnailUrl?ce("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Wr`
416
416
  background-color: var(--gray-200);
417
417
  width: 3rem;
418
418
  height: 3rem;
@@ -501,7 +501,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
501
501
  margin-right: var(--spacing-xs);
502
502
  `,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?Q("li",{children:[B("span",{css:de`
503
503
  margin-right: var(--spacing-xs);
504
- `,children:"Price:"}),B("span",{children:e.price})]}):null]})]})]}),Q("div",{css:jr,children:[e.editLink?Q("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:Xe,children:[B("span",{css:qe,children:"Edit"}),B($,{src:t,alt:"Logo",css:Jr})]}):null,Q("button",{type:"button",onClick:()=>{r==null||r(e)},css:Xe,children:[B("span",{css:qe,children:"Unlink"}),B($n,{icon:Kn,iconColor:"red",size:16})]})]})]})},e.id)}import{Callout as Zn}from"@uniformdev/design-system";import{useAsync as Xn,useAsyncFn as qn}from"react-use";import{jsx as Ye,jsxs as Yn}from"@emotion/react/jsx-runtime";function Js({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:f,rowComponent:m,errorComponent:v,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D="All categories",typeSelectorLabel:ae="Select Category"}){var j,H;let{value:S,loading:b,error:ie}=Xn(async()=>await o(),[o]),ue=S==null?void 0:S.map(E=>E.id).join(","),O=Wn(()=>S?S.map(u=>({id:u.id,name:u.name})):void 0,[ue]),_=_n(),[W,me]=qn(async(E,u)=>{let V=await t({text:E,options:{limit:u==null?void 0:u.count,offset:u==null?void 0:u.offset,categoryId:u==null?void 0:u.contentType,cursor:u==null?void 0:u.cursor}});return(u==null?void 0:u.offset)===0&&(_.current=[]),(_.current=_.current||[]).push(...V.products),V},[t]),Se=async E=>{await r(E)};return ie||W.error?Ye(v||(({categoriesError:u,searchError:V})=>Yn(Zn,{type:"error",children:["There was an error: ",(u==null?void 0:u.message)||(V==null?void 0:V.message)]})),{categoriesError:ie,searchError:W.error}):Ye(to.Provider,{value:{categories:S,logoIcon:n},children:Ye(Br,{search:me,results:_.current,logoIcon:n,selectedItems:e,select:Se,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:O,selectedItemComponent:f||eo,rowComponent:m||_r,totalResults:(j=W.value)==null?void 0:j.total,cursor:(H=W.value)==null?void 0:H.cursor,resultsLoading:W.loading||b,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D,typeSelectorLabel:ae})})}var to=Nn.createContext(void 0),ze=()=>{let e=Qn(to);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};import{css as k}from"@emotion/react";import{mq as Jn}from"@uniformdev/design-system";var ro=k`
504
+ `,children:"Price:"}),B("span",{children:e.price})]}):null]})]})]}),Q("div",{css:jr,children:[e.editLink?Q("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:Xe,children:[B("span",{css:qe,children:"Edit"}),B($,{src:t,alt:"Logo",css:Jr})]}):null,Q("button",{type:"button",onClick:()=>{r==null||r(e)},css:Xe,children:[B("span",{css:qe,children:"Unlink"}),B($n,{icon:Kn,iconColor:"red",size:16})]})]})]})},e.id)}import{Callout as Zn}from"@uniformdev/design-system";import{useAsync as Xn,useAsyncFn as qn}from"react-use";import{jsx as Ye,jsxs as Yn}from"@emotion/react/jsx-runtime";function Js({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:f,rowComponent:u,errorComponent:v,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D="All categories",typeSelectorLabel:ae="Select Category"}){var j,H;let{value:S,loading:b,error:ie}=Xn(async()=>await o(),[o]),me=S==null?void 0:S.map(E=>E.id).join(","),O=Wn(()=>S?S.map(m=>({id:m.id,name:m.name})):void 0,[me]),_=_n(),[W,ue]=qn(async(E,m)=>{let V=await t({text:E,options:{limit:m==null?void 0:m.count,offset:m==null?void 0:m.offset,categoryId:m==null?void 0:m.contentType,cursor:m==null?void 0:m.cursor}});return(m==null?void 0:m.offset)===0&&(_.current=[]),(_.current=_.current||[]).push(...V.products),V},[t]),Se=async E=>{await r(E)};return ie||W.error?Ye(v||(({categoriesError:m,searchError:V})=>Yn(Zn,{type:"error",children:["There was an error: ",(m==null?void 0:m.message)||(V==null?void 0:V.message)]})),{categoriesError:ie,searchError:W.error}):Ye(to.Provider,{value:{categories:S,logoIcon:n},children:Ye(Br,{search:ue,results:_.current,logoIcon:n,selectedItems:e,select:Se,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:O,selectedItemComponent:f||eo,rowComponent:u||_r,totalResults:(j=W.value)==null?void 0:j.total,cursor:(H=W.value)==null?void 0:H.cursor,resultsLoading:W.loading||b,helpComponent:i,noResultsComponent:p,onSort:y,typeSelectorAllTypesOptionText:D,typeSelectorLabel:ae})})}var to=Nn.createContext(void 0),ze=()=>{let e=Qn(to);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};import{css as k}from"@emotion/react";import{mq as Jn}from"@uniformdev/design-system";var ro=k`
505
505
  border: 1px solid var(--gray-200);
506
506
  background: var(--gray-50);
507
507
  border-radius: var(--rounded-base);
@@ -574,7 +574,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
574
574
  display: flex;
575
575
  margin-top: var(--spacing-sm);
576
576
  gap: var(--spacing-sm);
577
- `,uo=k`
577
+ `,mo=k`
578
578
  background: none;
579
579
  outline: none;
580
580
  border: none;
@@ -584,9 +584,9 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
584
584
  max-width: 100%;
585
585
  min-width: 100px;
586
586
  height: auto;
587
- `;import{useState as jn,useRef as mo,useEffect as ea}from"react";import{CgInfo as ta,CgClose as ra}from"react-icons/cg";import{format as oa}from"timeago.js";import{css as pe}from"@emotion/react";import{Icon as go}from"@uniformdev/design-system";import{Fragment as aa,jsx as I,jsxs as T}from"@emotion/react/jsx-runtime";function uc({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=mo(null),d=mo(null),[f,m]=jn(!1);ea(()=>{let p=D=>{a.current&&!a.current.contains(D.target)&&d.current&&!d.current.contains(D.target)&&m(!1)},y=()=>{m(!1)};return window.addEventListener("resize",y,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",y,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[d]);let v=()=>{var p;if(m(!f),d.current&&a.current){let y=(p=a==null?void 0:a.current)==null?void 0:p.getBoundingClientRect();d.current.style.top=`${y.top+30}px`}},i=n!=null?n:na;return I("div",{css:[ro,pe`
587
+ `;import{useState as jn,useRef as uo,useEffect as ea}from"react";import{CgInfo as ta,CgClose as ra}from"react-icons/cg";import{format as oa}from"timeago.js";import{css as pe}from"@emotion/react";import{Icon as go}from"@uniformdev/design-system";import{Fragment as aa,jsx as I,jsxs as T}from"@emotion/react/jsx-runtime";function mc({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=uo(null),d=uo(null),[f,u]=jn(!1);ea(()=>{let p=D=>{a.current&&!a.current.contains(D.target)&&d.current&&!d.current.contains(D.target)&&u(!1)},y=()=>{u(!1)};return window.addEventListener("resize",y,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",y,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[d]);let v=()=>{var p;if(u(!f),d.current&&a.current){let y=(p=a==null?void 0:a.current)==null?void 0:p.getBoundingClientRect();d.current.style.top=`${y.top+30}px`}},i=n!=null?n:na;return I("div",{css:[ro,pe`
588
588
  margin: 0 0 1rem 0;
589
- `],children:T("div",{css:oo,children:[T("div",{css:no,children:[T("div",{css:ao,children:[I("h4",{css:[io],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?T(aa,{children:[I("button",{type:"button",ref:a,css:uo,"aria-controls":"path-details","aria-expanded":f,onClick:v,children:I(go,{icon:ta,iconColor:"gray",size:24,css:pe`
589
+ `],children:T("div",{css:oo,children:[T("div",{css:no,children:[T("div",{css:ao,children:[I("h4",{css:[io],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?T(aa,{children:[I("button",{type:"button",ref:a,css:mo,"aria-controls":"path-details","aria-expanded":f,onClick:v,children:I(go,{icon:ta,iconColor:"gray",size:24,css:pe`
590
590
  opacity: var(--opacity-75);
591
591
  `})}),I("div",{id:"path-details","aria-hidden":!f,ref:d,css:[co,f?pe`
592
592
  visibility: visible;
@@ -596,4 +596,4 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
596
596
  order: 1;
597
597
  `],children:[T("span",{css:[Ue,pe`
598
598
  order: 1;
599
- `],children:[o,":"]}),t]},o)):null,e.createdDate?T("li",{css:le,children:[I("span",{css:Ue,children:"Date:"}),oa(e.createdDate)]}):null]})]}):null}import{LoadingIndicator as ia,Theme as sa}from"@uniformdev/design-system";import{jsx as be,jsxs as ca}from"@emotion/react/jsx-runtime";var yc=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=ut();if(t||!a){let d=r;return d?be(d,{}):be(ia,{})}if(n){let d=o;if(d)return be(d,{error:n});throw n}return ca(we.Provider,{value:{sdk:a},children:[be(sa,{}),be(Ce,{children:e})]})};export*from"@uniformdev/mesh-sdk";import{Button as Ic,Callout as Tc,LoadingIndicator as Ec,LoadingOverlay as Mc,Menu as Vc,MenuItem as Dc,Input as zc,InputSelect as Uc,InputToggle as Ac,Theme as Gc,InputKeywordSearch as Bc,Heading as Oc,ScrollableList as Hc,ScrollableListItem as $c,Textarea as Fc,Switch as Kc,Label as Nc,AddListButton as Qc}from"@uniformdev/design-system";export{Qc as AddListButton,Ic as Button,Tc as Callout,uc as DamSelectedItem,Pr as DefaultSearchRow,fr as DefaultSelectedItem,Br as EntrySearch,Oc as Heading,He as Icons,zc as Input,Uc as InputSelect,Ac as InputToggle,Bc as KeywordSearchInput,Nc as Label,Ec as LoadingIndicator,Mc as LoadingOverlay,Vc as Menu,Dc as MenuItem,yc as MeshApp,Tt as ProductPreviewList,ri as ProductQuery,kt as ProductQueryContext,Js as ProductSearch,to as ProductSearchContext,_r as ProductSearchRow,eo as ProductSelectedItem,ft as ResolvableLoadingValue,Hc as ScrollableList,$c as ScrollableListItem,St as SelectionField,Kc as Switch,Fc as Textarea,Gc as Theme,lt as UniformMeshLocationContext,Ce as UniformMeshLocationContextProvider,we as UniformMeshSdkContext,ha as UniformMeshSdkContextProvider,Qe as badgeIcon,je as damSelectItemImage,ro as damSelectedItemContainer,ao as damSelectedItemCopy,no as damSelectedItemDetails,so as damSelectedItemIcon,uo as damSelectedItemInfoBtn,oo as damSelectedItemInner,Je as damSelectedItemLinkBtn,lo as damSelectedItemLinkContainer,po as damSelectedItemMediaContainer,co as damSelectedItemPopover,Ue as damSelectedItemPopoverLabel,le as damSelectedItemSmallText,io as damSelectedItemTitle,Dr as draggableContainer,Ne as draggableIcon,Ur as draggableIconOffset,zr as draggableIconWrapper,Rr as entrySearchBtn,Ir as entrySearchConfig,Tr as entrySearchConfigHidden,kr as entrySearchLoadMoreBtn,Er as entrySearchResultList,Mr as entrySearchSelectIcon,Vr as entrySearchSelectImg,is as entrySearchSelectInput,ss as entrySearchSelectOption,Lr as entrySearchWrapper,Qr as productSearchRowActiveIcon,Kr as productSearchRowCategory,Or as productSearchRowContainer,Hr as productSearchRowContent,$r as productSearchRowContentActive,Nr as productSearchRowDetails,Fr as productSearchRowTitle,Xr as productSelectedItemContainer,Yr as productSelectedItemContent,qr as productSelectedItemDetails,Jr as productSelectedItemIcon,Ze as productSelectedItemImage,jr as productSelectedItemLinkContainer,Xe as productedSelectedItemLinkBtn,qe as productedSelectedItemSmallText,Sr as searchRowBtn,vr as searchRowContainer,yr as searchRowContainerActive,hr as searchRowContainerWithPopover,br as searchRowPopover,Ke as searchRowText,Fe as searchRowTextSmall,$e as selectItemLinkBtn,ur as selectItemLinkContainer,pr as selectItemPopover,ye as selectItemPopoverLabel,te as selectItemSmallText,ar as selectedItemContainer,cr as selectedItemCopy,sr as selectedItemDetails,lr as selectedItemIcon,ir as selectedItemInner,dr as selectedItemTitle,ut as useInitializeUniformMeshSdk,Da as useMeshLocation,It as useProductQueryContext,ze as useProductSearchContext,Ra as useUniformMeshLocation,Pe as useUniformMeshLocationContext,dt as useUniformMeshSdk,ct as useUniformMeshSdkContext};
599
+ `],children:[o,":"]}),t]},o)):null,e.createdDate?T("li",{css:le,children:[I("span",{css:Ue,children:"Date:"}),oa(e.createdDate)]}):null]})]}):null}import{LoadingIndicator as ia,Theme as sa}from"@uniformdev/design-system";import{jsx as be,jsxs as ca}from"@emotion/react/jsx-runtime";var yc=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=mt();if(t||!a){let d=r;return d?be(d,{}):be(ia,{})}if(n){let d=o;if(d)return be(d,{error:n});throw n}return ca(we.Provider,{value:{sdk:a},children:[be(sa,{}),be(Ce,{children:e})]})};export*from"@uniformdev/mesh-sdk";import{Button as Ic,Callout as Tc,LoadingIndicator as Ec,LoadingOverlay as Mc,Menu as Vc,MenuItem as Dc,Input as zc,InputSelect as Uc,InputToggle as Ac,Theme as Gc,InputKeywordSearch as Bc,Heading as Oc,ScrollableList as Hc,ScrollableListItem as $c,Textarea as Fc,Switch as Kc,Label as Nc,AddListButton as Qc}from"@uniformdev/design-system";export{Qc as AddListButton,Ic as Button,Tc as Callout,mc as DamSelectedItem,Pr as DefaultSearchRow,fr as DefaultSelectedItem,Br as EntrySearch,Oc as Heading,He as Icons,zc as Input,Uc as InputSelect,Ac as InputToggle,Bc as KeywordSearchInput,Nc as Label,Ec as LoadingIndicator,Mc as LoadingOverlay,Vc as Menu,Dc as MenuItem,yc as MeshApp,Tt as ProductPreviewList,ri as ProductQuery,kt as ProductQueryContext,Js as ProductSearch,to as ProductSearchContext,_r as ProductSearchRow,eo as ProductSelectedItem,ft as ResolvableLoadingValue,Hc as ScrollableList,$c as ScrollableListItem,St as SelectionField,Kc as Switch,Fc as Textarea,Gc as Theme,lt as UniformMeshLocationContext,Ce as UniformMeshLocationContextProvider,we as UniformMeshSdkContext,ha as UniformMeshSdkContextProvider,Qe as badgeIcon,je as damSelectItemImage,ro as damSelectedItemContainer,ao as damSelectedItemCopy,no as damSelectedItemDetails,so as damSelectedItemIcon,mo as damSelectedItemInfoBtn,oo as damSelectedItemInner,Je as damSelectedItemLinkBtn,lo as damSelectedItemLinkContainer,po as damSelectedItemMediaContainer,co as damSelectedItemPopover,Ue as damSelectedItemPopoverLabel,le as damSelectedItemSmallText,io as damSelectedItemTitle,Dr as draggableContainer,Ne as draggableIcon,Ur as draggableIconOffset,zr as draggableIconWrapper,Rr as entrySearchBtn,Ir as entrySearchConfig,Tr as entrySearchConfigHidden,kr as entrySearchLoadMoreBtn,Er as entrySearchResultList,Mr as entrySearchSelectIcon,Vr as entrySearchSelectImg,is as entrySearchSelectInput,ss as entrySearchSelectOption,Lr as entrySearchWrapper,Qr as productSearchRowActiveIcon,Kr as productSearchRowCategory,Or as productSearchRowContainer,Hr as productSearchRowContent,$r as productSearchRowContentActive,Nr as productSearchRowDetails,Fr as productSearchRowTitle,Xr as productSelectedItemContainer,Yr as productSelectedItemContent,qr as productSelectedItemDetails,Jr as productSelectedItemIcon,Ze as productSelectedItemImage,jr as productSelectedItemLinkContainer,Xe as productedSelectedItemLinkBtn,qe as productedSelectedItemSmallText,Sr as searchRowBtn,vr as searchRowContainer,yr as searchRowContainerActive,hr as searchRowContainerWithPopover,br as searchRowPopover,Ke as searchRowText,Fe as searchRowTextSmall,$e as selectItemLinkBtn,mr as selectItemLinkContainer,pr as selectItemPopover,ye as selectItemPopoverLabel,te as selectItemSmallText,ar as selectedItemContainer,cr as selectedItemCopy,sr as selectedItemDetails,lr as selectedItemIcon,ir as selectedItemInner,dr as selectedItemTitle,mt as useInitializeUniformMeshSdk,Da as useMeshLocation,It as useProductQueryContext,ze as useProductSearchContext,Ra as useUniformMeshLocation,Pe as useUniformMeshLocationContext,dt as useUniformMeshSdk,ct as useUniformMeshSdkContext};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "17.2.1-alpha.215+8334897bd",
3
+ "version": "17.3.0",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -44,8 +44,8 @@
44
44
  "storybook:publish": "pnpm build && pnpm build-storybook -o ./out"
45
45
  },
46
46
  "dependencies": {
47
- "@uniformdev/design-system": "^17.2.1-alpha.215+8334897bd",
48
- "@uniformdev/mesh-sdk": "^17.2.1-alpha.215+8334897bd",
47
+ "@uniformdev/design-system": "^17.3.0",
48
+ "@uniformdev/mesh-sdk": "^17.3.0",
49
49
  "react-beautiful-dnd": "13.1.1",
50
50
  "react-icons": "4.4.0",
51
51
  "react-use": "17.4.0",
@@ -58,8 +58,8 @@
58
58
  "react-dom": ">=16.8"
59
59
  },
60
60
  "devDependencies": {
61
- "@babel/core": "7.18.13",
62
- "@babel/preset-env": "7.18.10",
61
+ "@babel/core": "7.19.3",
62
+ "@babel/preset-env": "7.19.3",
63
63
  "@babel/preset-react": "7.18.6",
64
64
  "@babel/preset-typescript": "7.18.6",
65
65
  "@emotion/babel-preset-css-prop": "11.10.0",
@@ -68,7 +68,7 @@
68
68
  "@storybook/addon-essentials": "6.5.12",
69
69
  "@storybook/addon-postcss": "2.0.0",
70
70
  "@storybook/react": "6.5.12",
71
- "@svgr/cli": "6.3.1",
71
+ "@svgr/cli": "6.4.0",
72
72
  "@types/react": "18.0.21",
73
73
  "@types/react-beautiful-dnd": "13.1.2",
74
74
  "@types/uuid": "8.3.4",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "8334897bd5562a42a47f4d099444e466039cb391"
85
+ "gitHead": "4b7411414239d033ceea81c61360995e4920a3f3"
86
86
  }