@reltio/remotes 1.4.1576 → 1.4.1578

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/2125.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2125],{49965:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(24328),a=r.n(n),l=r(96479);function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,n.forwardRef)(((r,n)=>(0,l.S)()?a().createElement(e,o({},r,{ref:n})):t&&a().createElement(t,o({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}},19592:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(22385),s=r(98989);const c=(0,r(79692).Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{const t=c(),{expanded:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return a().createElement(i.Z,u({icon:s.Z,size:"XXS",disableRipple:!0,iconClassName:o()(t.expandIcon,{[t.expanded]:r}),className:o()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},l))}},92778:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(15223),s=r(94079);const c=(0,r(79692).Z)({toolbar:{minHeight:"48px",padding:"8px 24px",lineHeight:"28px"},title:{fontSize:"18px",fontWeight:"normal",lineHeight:"inherit",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{title:t="",children:r=null,classes:n={}}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","children","classes"]);const p=c();return a().createElement(i.Z,u({className:n.root,classes:{root:p.toolbar}},l),a().createElement(s.Typography,{className:n.title,classes:{root:p.title},variant:"h6"},o().text(t)),r)}},9371:(e,t,r)=>{r.d(t,{J:()=>Y});var n=r(24328),a=r.n(n),l=r(94079),o=r(52730),i=r(2507),s=r.n(i),c=r(43054),u=r(86051),p=r(55847),m=r(8818),d=r(71153),g=r.n(d),b=r(50914),h=r(88832),f=r(31274),y=r(31039);const x=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},v=e=>`${s().date(e,"LT")} ${s().date(e,"LL")}`,E=e=>`comment/${e.commentId}`,w=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,O=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r};var C=r(79692);const N=(0,C.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const S=e=>{let{comment:t,className:r}=e;const i=N(),c=(0,o.useSelector)(u.ZP.selectors.getEntity),p=(0,o.useSelector)(u.ZP.selectors.getMetadata),m=(0,n.useContext)(f.X);return a().createElement(l.Box,{className:r},(()=>{switch(t.objectType){case h.q7e.ENTITY_ATTRIBUTE:{const e=(0,h.AFK)(t.objectId,c.type),r=(0,h.zeJ)(p,e);return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected attribute:")),a().createElement(l.Typography,{className:i.label},null==r?void 0:r.label))}case h.q7e.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,b.startsWith)("configuration/relationTypes")),r=(0,h.AFK)(t.objectId,e),n=(0,h.zeJ)(p,r);return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected attribute:")),a().createElement(l.Typography,{className:i.label},null==n?void 0:n.label))}case h.q7e.ENTITY:return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected profile:")),a().createElement(y.Z,{className:g()(i.label,i.link),value:(0,h.wwR)(c)},(0,h.idV)(c.label)));case h.q7e.RELATION:{const e=x(t,c.uri),r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T(e,t,r[t])}))}return e}({},m[e]||{},{uri:e});return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected relation:")),a().createElement(l.Typography,{className:i.label},a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(c)},(0,h.idV)(c.label)),e&&a().createElement(a().Fragment,null,` ${s().text("to")} `,a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(r)},r.label?(0,h.idV)(r.label):(0,h.BTI)(r)))))}case h.q7e.POTENTIAL_MATCH:{var e;const r=x(t,c.uri),n={uri:r,label:null===(e=m[r])||void 0===e?void 0:e.label};return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected potential match:")),a().createElement(l.Typography,{className:i.label},a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(c)},(0,h.idV)(c.label)),r&&a().createElement(a().Fragment,null,` ${s().text("and")} `,a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(n)},n.label?(0,h.idV)(n.label):(0,h.BTI)(n)))))}default:return null}})())};var k=r(49759);const A=(0,C.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),P=e=>{let{comment:t,className:r}=e;const o=A(),i=(0,n.useContext)(k.s);return a().createElement(l.Typography,{className:g()(o.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let l="",o=!1;for(let i=0;i<=e.length;i++){const s=e[i],c=e[i+1],u=i===e.length-1;l+=s,s===n&&0===i&&(o=!0),o&&t.includes(l.slice(n.length))&&(o=!1,a.push(r(l)),l=""),c===n&&(o=!0,a.push(l),l=""),u&&a.push(l)}return a}(t.content,t.namedUsers,(e=>{const t=i.find((t=>t.username===e.slice(1)));return t?a().createElement(l.Link,{href:`mailto:${t.email}`},e):e})).map(((e,t)=>a().createElement(n.Fragment,{key:t},e))))};var Z=r(43434);const j=(0,C.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function I(){return I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},I.apply(this,arguments)}const L=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const l=j();return a().createElement(Z.Z,I({},n,{className:g()(l.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var D=r(41564),V=r(2271);const R=(0,C.Z)((e=>({root:{width:"100%",backgroundColor:"#fff",fontFamily:"Roboto","&__control":{fontSize:"13px"},"&__highlighter":{padding:"10px 22px",border:"1px solid transparent !important"},"&__input":{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},"&__suggestions":{padding:"8px 0",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},"&__suggestions__list":{maxHeight:"200px",overflowY:"scroll"},"&__suggestions__item":{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function U(){return U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},U.apply(this,arguments)}const B=e=>{let{onChange:t,className:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className"]);const o=R(),i=(0,n.useContext)(k.s);return a().createElement(V.r,U({},l,{onChange:(e,r,n,a)=>{t(r,n,(0,b.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:g()(o.root,r)}),a().createElement(V.p,{trigger:"+",data:i.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention}))},M=(0,C.Z)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{maxWidth:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),z=e=>{switch(e){case"open":return s().text("Reply...");case"resolved":return s().text("Adding a comment will re-open this");default:return""}},_=e=>{let{inputRef:t,className:r,uri:i,relatedObjectUris:c,objectType:p,popperRef:m,comment:d,reply:h,isEditingComment:f,isEditingReply:y,onCancel:x}=e;const v=f||y,C=M({isEditing:v}),[N,T]=(0,n.useState)(!1),S=(0,o.useSelector)(u.ZP.selectors.getUserName),{createReply:k,createComment:A,sending:P,editComment:Z,editReply:j,getCommentState:I,updateCommentState:V,clearCommentState:R}=(0,n.useContext)(D.h),U=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,b.isNil)(t)?"comment/new":n?E(t):a?w(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:d,reply:h,isEditingComment:f,isEditingReply:y}),_=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const l=n?t:a?r:null,{content:o="",namedUsers:i=[]}=l||{};return{value:O(o,i),plainTextValue:o,mentions:i}})({comment:d,reply:h,isEditingComment:f,isEditingReply:y}),{value:F=_.value,plainTextValue:H=_.plainTextValue,mentions:W=_.mentions}=I(i,U),q=""!==F.trim(),$=N||q,Y=null==d?void 0:d.status,G=()=>{null==x||x(),R(i,U)};(0,n.useEffect)((()=>{m&&m.current.update()}),[m,$]);const X=v?"small":"medium";return a().createElement(l.Box,{className:g()(C.root,r)},a().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,b.cond)([[(0,b.always)(!d),()=>A({content:H,namedUsers:W,objectType:p,uri:i,relatedObjectUris:c})],[(0,b.always)(f),()=>Z({content:H,namedUsers:W,commentId:d.commentId,objectType:p,replies:d.replies,relatedObjectUris:c,uri:i})],[(0,b.always)(y),()=>j({content:H,namedUsers:W,commentId:d.commentId,replyId:h.replyId})],[b.T,()=>k({content:H,namedUsers:W,commentId:d.commentId,action:"open"===d.status?"none":"reopen",uri:i})]])().then(G).catch(console.log)),className:C.form},a().createElement(l.Box,{className:C.main},!v&&a().createElement(L,{classes:{root:C.avatar}},S),a().createElement(B,{className:C.textField,disabled:P,onChange:(e,t,r)=>V(i,U,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:F,onFocus:()=>T(!0),onBlur:()=>T(!1),placeholder:z(Y)})),$&&a().createElement(l.Box,{className:C.buttons},a().createElement(l.Button,{className:C.button,variant:"contained",color:"primary",disabled:!q||P,type:"submit",size:X},((e,t,r)=>t||r?s().text("Edit"):"open"===e||"resolved"===e?s().text("Reply"):s().text("Comment"))(Y,f,y)),a().createElement(l.Button,{disabled:P,onClick:()=>G(),className:C.button,variant:"outlined",color:"primary",size:X},s().text("Cancel")))))},F=(0,C.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),H=e=>{let{onReply:t,className:r,uri:i,comment:d,relatedObjectUris:g,objectType:b}=e;const h=F(),f=(0,n.useRef)(),y=(0,o.useSelector)(u.ZP.selectors.getUserName),{commentId:x,createdBy:w,createdTime:O,status:C}=d,N="resolved"===C,T=w===y,{resolveThread:k,reOpenThread:A,sending:Z,deleteComment:j,updateCommentState:I,getCommentState:V}=(0,n.useContext)(D.h),R=E(d),{isEditing:U}=V(i,R),B=(0,n.useCallback)((e=>I(i,R,{isEditing:e})),[R,I,i]);(0,n.useEffect)((()=>{U&&f.current.focus()}),[U]);const M=(0,n.useMemo)((()=>N?[{text:s().text("Delete"),onClick:()=>j({uri:i,commentId:x})}]:[{text:s().text("Edit"),onClick:()=>B(!0)},{text:s().text("Delete"),onClick:()=>j({uri:i,commentId:x})}]),[x,j,N,B,i]),z=a().createElement(_,{inputRef:f,uri:i,relatedObjectUris:g,objectType:b,onCancel:()=>B(!1),isEditingComment:U,comment:d});return a().createElement(l.Box,{className:r},a().createElement(l.Box,{className:h.header},a().createElement(L,{classes:{root:h.avatar}},w),a().createElement(l.Box,{width:"100%"},a().createElement(l.Typography,{className:h.username},w)),a().createElement(l.Typography,{className:h.createdAt},v(O)),T&&a().createElement(p.Z,{buttonComponent:m.k,buttonProps:{icon:c.Z,tooltipTitle:s().text("Open menu")},popoverProps:{PopoverClasses:{root:h.dropdownMenu}},menuItems:M,menuId:"collaboration-comment-menu"})),a().createElement(l.Box,{className:h.body},a().createElement(S,{comment:d,className:h.commentTarget}),U?z:a().createElement(P,{comment:d,className:h.message}),a().createElement(l.Box,{className:h.buttons},a().createElement(l.Link,{className:h.button,onClick:t,component:"button"},s().text("Reply")),!N&&a().createElement(l.Link,{disabled:Z,className:h.button,onClick:()=>{k({commentId:x,uri:i})},component:"button"},s().text("Resolve")),N&&a().createElement(l.Link,{disabled:Z,className:h.button,onClick:()=>{A({commentId:x,uri:i})},component:"button"},s().text("Re-open")))))},W=(0,C.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),q=e=>{let{className:t,reply:r,uri:i,comment:d,popperRef:b}=e;const h=(0,n.useRef)(),{createdBy:f,action:y,createdTime:x}=r,E=f===(0,o.useSelector)(u.ZP.selectors.getUserName)&&"resolved"!==d.status,{deleteReply:O,updateCommentState:C,getCommentState:N}=(0,n.useContext)(D.h),T=w(d,r),{isEditing:S}=N(i,T),k=(0,n.useCallback)((e=>C(i,T,{isEditing:e})),[T,C,i]);(0,n.useEffect)((()=>{S&&h.current.focus()}),[S]);const A=W(),Z=(0,n.useMemo)((()=>[{text:s().text("Edit"),onClick:()=>k(!0)},{text:s().text("Delete"),onClick:()=>O({uri:i,commentId:d.commentId,reply:r})}]),[O,i,d.commentId,r,k]),j=a().createElement(_,{inputRef:h,popperRef:b,uri:i,onCancel:()=>k(!1),isEditingReply:S,reply:r,comment:d});return a().createElement(l.Box,{className:g()(A.root,t)},a().createElement(L,{classes:{root:A.avatar}},f),a().createElement(l.Box,{flexGrow:1},a().createElement(l.Box,{className:A.header},a().createElement(l.Typography,{className:A.username},f),"resolve"===y&&a().createElement(l.Typography,{className:A.marked},s().text("Marked as resolved")),"reopen"===y&&a().createElement(l.Typography,{className:A.marked},s().text("Re-opened"))),"resolve"!==y&&(S?j:a().createElement(P,{className:A.message,comment:r})),a().createElement(l.Typography,{className:A.createdAt},v(x))),E&&a().createElement(p.Z,{buttonComponent:m.k,buttonProps:{icon:c.Z,tooltipTitle:s().text("Open menu")},menuItems:Z,menuId:"collaboration-comment-menu"}))},$=(0,C.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),Y=(0,n.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:o,classes:i,popperRef:s,messagesRef:c,comment:u}=e;const p=(0,n.useRef)(),m=$({classes:i}),d=a().createElement(_,{className:m.sendMessageArea,inputRef:p,popperRef:s,uri:t,relatedObjectUris:r,objectType:o,comment:u});return a().createElement(l.Box,{className:m.root},u&&a().createElement(a().Fragment,null,a().createElement("div",{className:m.messages,ref:c},a().createElement(H,{comment:u,uri:t,onReply:()=>{p.current.focus()},className:m.comment,relatedObjectUris:r,objectType:o}),a().createElement(l.Box,{className:m.replies},u.replies.map((e=>a().createElement(q,{key:e.replyId,className:m.repliedComment,reply:e,uri:t,comment:u}))))),d),!u&&d)}))},94646:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(79692),s=r(19603);const c=(0,i.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${s.U}:hover &`]:{visibility:"visible"}},showAlways:{}})));var u=r(20562),p=r(41564),m=r(78101),d=r(2507),g=r.n(d),b=r(94079);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}const f=e=>a().createElement("svg",h({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),y=(0,i.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}},childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}))),x=a().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const l=y();return a().createElement(b.Tooltip,{title:g().text("Show comment")},a().createElement("div",{ref:t,className:l.root,onClick:n},a().createElement(f,{className:l.icon}),a().createElement("div",{className:l.childrenWrapper},r)))}));x.displayName="CommentButton";const v=x;function E(){return E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E.apply(this,arguments)}const w=e=>a().createElement("svg",E({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),O=e=>{let{className:t,onClick:r}=e;const n=y();return a().createElement(b.Tooltip,{title:g().text("Add comment")},a().createElement("div",{className:o()(n.root,t),onClick:r},a().createElement(w,{className:n.icon})))};var C=r(27291),N=r(9371),T=r(8818),S=r(59601);const k=(0,i.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),A=e=>{let{uri:t,relatedObjectUris:r,objectType:l,anchorEl:o,onClose:i,open:s,comment:c}=e;const[u,m]=(0,n.useState)(0),d=k({scrollWidth:u,hasScroll:0!==u}),h=(0,n.useRef)(null),{resolveThread:f,loading:y,sending:x}=(0,n.useContext)(p.h),v=1+(null==c?void 0:c.replies.length);return a().createElement(S.Z,{popperRef:h,anchorEl:o,open:s,placement:"right-start",onClose:i,className:d.popper},a().createElement(b.Box,{className:d.header},a().createElement(b.Box,{className:d.headerInfo},a().createElement(b.Typography,{className:d.title},g().text("Comments")),c&&!y&&a().createElement(b.Typography,{className:d.counter},g().number(v)," ",1===v?g().text("item"):g().text("items"))),c&&!y&&a().createElement(T.k,{className:d.resolveButton,size:"S",onClick:()=>{f({commentId:c.commentId,uri:t})},disabled:x,showForDisabled:!0,tooltipTitle:g().text("Resolve"),icon:C.Z,color:"primary"})),!y&&a().createElement(N.J,{popperRef:h,messagesRef:e=>{e&&m(e.offsetWidth-e.clientWidth)},classes:{root:d.collaborationItem,replies:d.replies,sendMessageArea:d.sendMessageArea,messages:d.messages,comment:d.comment},uri:t,relatedObjectUris:r,objectType:l,comment:c}))},P=e=>{let{className:t,uri:r,objectType:l,relatedObjectUris:i,onChangePopupVisibility:s,allowOnlyOneComment:d=!1,showAlways:g=!1}=e;const b=c(),[h,f]=(0,n.useState)(null),[y,x]=(0,n.useState)(!1),E=y&&Boolean(h),{currentComment:w,commentsMap:C,getComment:N,clearCurrentComment:T,objectTypes:S}=(0,n.useContext)(p.h),k=!!C&&(!S||S.includes(l)),P=((null==C?void 0:C[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),Z=!d||d&&0===P.length,j=null===w&&E;(0,u.D)((()=>{s&&s(E)}),[E]);const I=(0,n.useContext)(m.A),L=(0,n.useMemo)((()=>I?[...i,...I]:i),[I,i]);return k&&a().createElement("div",{className:o()(b.root,t)},Z&&a().createElement(O,{className:o()(b.addButton,{[b.showAlways]:g||j}),onClick:e=>{f(e.currentTarget),x(!0)}}),P.map((e=>{let{replies:t,commentId:r}=e;return a().createElement(v,{ref:r===(null==w?void 0:w.commentId)?f:null,key:r,onClick:()=>(e=>{N(e),x(!0)})(r)},1+t)})),a().createElement(A,{anchorEl:h,open:E,onClose:()=>{f(null),T(),x(!1)},uri:r,relatedObjectUris:L,objectType:l,comment:w}))}},6521:(e,t,r)=>{r.d(t,{l:()=>s});var n=r(13896),a=r(58651),l=r(24328),o=r.n(l);const i=(0,n.createDndContext)(a.default),s=e=>{const t=(e=>{const t=(0,l.useRef)(i);return e.children?o().createElement(n.DndProvider,{manager:t.current.dragDropManager},e.children):null})(e);return o().createElement(o().Fragment,null,t)}},55847:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(50914),s=r(94079),c=r(48348),u=r(20562),p=r(83348),m=r(79692),d=r(41128);const g=(0,m.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,d.U1)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,d.U1)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"},menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),b=(0,p.Z)(s.MenuItem),h=(0,n.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=i.identity}=e;const l=g(),{disabled:o,text:c,tooltip:u,onClick:p,id:m="",selectable:d,selected:h}=r;return a().createElement(b,{tooltipTitle:u,showForDisabled:!0,classes:{root:l.menuItem},onClick:e=>{n(e),p(e)},disabled:o,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${m}`},d&&a().createElement(s.Checkbox,{checked:h,color:"primary"}),a().createElement(s.Typography,{classes:{root:l.menuText}},c))}));h.displayName="MenuItemRenderer";const f=h;function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(this,arguments)}function x(e){let{className:t,menuId:r,buttonComponent:l=s.Button,buttonContent:p,menuItems:m=[],buttonProps:d={},popoverProps:b={},onMenuOpen:h=i.identity,onMenuClose:x=i.identity,MenuItemRenderer:v=f}=e;const E=l,w=g(),O=(0,n.useRef)(),[C,N]=(0,n.useState)(!1);(0,u.D)((()=>{C?h():x()}),[C]);const T=(0,n.useCallback)((e=>{null==e||e.stopPropagation(),N((e=>!e))}),[]);return a().createElement(a().Fragment,null,a().createElement(E,y({ref:O,className:o()(w.buttonRoot,{[w.selected]:C},t),onClick:T,"aria-pressed":C,"aria-controls":C?r:void 0,"aria-haspopup":"true"},d),p),a().createElement(c.Z,y({id:r,variant:"menu",open:C,autoFocus:!1,classes:{paper:w.paper},anchorEl:O.current,onClose:T,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:C}},b),m.map(((e,t)=>a().createElement(v,{item:e,key:t,onMenuClose:T})))))}x.displayName="DropDownMenuButton";const v=x},76134:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(94079),s=r(73086);const c=e=>{let{className:t,message:r}=e;const n=(0,s.y)();return r?a().createElement(i.Typography,{variant:"caption",className:o()(n.caption,t)},r):null}},26579:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(71153),a=r.n(n),l=r(76134),o=r(42494),i=r(94079),s=r(24328),c=r.n(s),u=r(73086);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}const m=(0,s.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:s}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const d=(0,u.y)(),g=!!t;return c().createElement(o.Z,p({className:a()(d.wrapper,n,null==s?void 0:s.root),error:!0},m),r,g&&c().createElement(i.FormHelperText,{className:a()(d.helperText,null==s?void 0:s.helperText)},c().createElement(l.Z,{message:t})))}))},73086:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(79692).Z)((e=>({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"},caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}})))},27952:(e,t,r)=>{r.d(t,{f:()=>h,Z:()=>f});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(80079);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}const c=e=>a().createElement("svg",s({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("path",{d:"M0 0h24v24H0z"}),a().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"})));var u=r(88832);const p=(0,r(79692).Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},m.apply(this,arguments)}const d="loading",g="loaded",b="error",h={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},f=(0,n.memo)((e=>{const{src:t,className:r,containerClassName:l,size:s=h.SMALL,overlay:f=null}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),x=s||h.SMALL,v=p(x),[E,w]=(0,n.useState)(d);(0,n.useEffect)((()=>{w(d)}),[t]);const O=E===d,C=E===g;return E===b?a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(i.Z,{className:v.defaultImage})):a().createElement("div",{className:o()(v.root,l)},!(0,u.O27)(t)&&a().createElement("img",m({src:t,className:o()(v.image,r,{[v.hideImage]:O}),onLoad:()=>{w(g)},onError:()=>{w(b)},alt:"image"},y)),O&&a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(c,{className:v.defaultImage})),C&&f)}))},97193:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(50914),s=r(71153),c=r.n(s),u=r(94079),p=r(43054),m=r(22385),d=r(55847),g=r(52669),b=r(81556),h=r(79692);const f=(0,h.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),y=e=>{let{checked:t,className:r,onClick:n}=e;const l=f(),o=t?b.Z:g.Z;return a().createElement(o,{className:c()(l.root,r),onClick:n})};var x=r(97989),v=r(31276);const E=(0,h.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),w=(0,n.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:l=!1,selectionMode:s=!1,onDeselect:g=v.ZT,onSelect:b=v.ZT,onShareLink:h,onSetAsDefault:f,onDelete:w,onDownload:O=v.ZT,onClick:C}=e,N=E(),[T,S]=(0,n.useState)(!1),k=(0,n.useMemo)((()=>[{text:o().text("Share link"),onClick:h},{text:o().text("Set as default"),onClick:f},{text:o().text("Delete"),onClick:w}].filter((0,i.prop)("onClick"))),[h,f,w]),A=e=>()=>(0,i.ifElse)((0,i.equals)(!0),g,b)(e),P=r&&(l||T||s),Z=!s&&!l&&T,j=r&&l;return a().createElement("div",{className:c()(N.overlay,{[N.selected]:l,[N.selectionMode]:s}),onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),onClick:s?A(l):e=>{e.currentTarget===e.target&&C()}},P&&a().createElement(y,{className:N.checkedIcon,checked:l,onClick:A(l)}),Z&&a().createElement("div",{className:N.actions},a().createElement(m.Z,{onClick:O,className:N.actionButton,icon:x.Z}),a().createElement(d.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:m.Z,buttonProps:{icon:p.Z,className:c()(N.actionButton,N.dropDownMenuButton)},menuItems:k})),j&&a().createElement(u.Button,{className:N.button,variant:"outlined",onClick:g},o().text("Deselect")))}))},81853:(e,t,r)=>{r.d(t,{C:()=>h,A:()=>b});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(94079),s=r(87685),c=r(73115);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>a().createElement("svg",u({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),a().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},a().createElement("mask",{id:"Details_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Details_svg__a"})),a().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"})));var m=r(8818),d=r(83401);const g=(0,r(79692).Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let b;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(b||(b={}));const h=e=>{let{open:t,mode:r,children:l,header:u,onClose:h,onChangeMode:f}=e;const y=g(),x=(0,n.useMemo)((()=>[{id:b.GALLERY_MODE,title:o().text("Gallery"),Icon:c.Z},{id:b.DETAILS_MODE,title:o().text("Details"),Icon:p}]),[]);return a().createElement(i.Dialog,{classes:{paper:y.paper},open:t,BackdropProps:{className:y.backdrop},fullScreen:!0},a().createElement(i.AppBar,{classes:{colorPrimary:y.appBar}},a().createElement(i.Toolbar,{className:y.toolbar},a().createElement(i.Box,{className:y.headerLeft},a().createElement(m.k,{tooltipTitle:o().text("Close"),onClick:h,className:y.closeButton,iconClassName:y.closeIcon,icon:s.default}),null==u?void 0:u.left),a().createElement(i.Box,{className:y.headerCenter},a().createElement(d.Z,{modes:x,modeId:r,onChange:f,className:y.modeSwitcher})),a().createElement(i.Box,{className:y.headerRight},null==u?void 0:u.right))),a().createElement(i.DialogContent,{className:y.content},l))}},95470:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(24328),a=r.n(n),l=r(38529),o=r(71153),i=r.n(o);const s=(0,r(79692).Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=e=>{const t=s(),r=(0,l.useInRouterContext)(),{href:n,className:o}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),p=i()(t.link,o);return r&&n?a().createElement(l.Link,c({to:n.replace(window.location.origin,""),className:p},u)):a().createElement("a",c({href:n,className:p},u))}},59601:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(94079),s=r(66130);const c=(0,r(79692).Z)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{children:t,className:r,classes:l,transition:p}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const d=c(),g=p?i.Fade:a().Fragment,[b,h]=(0,n.useState)(null);return a().createElement(s.Z,u({className:o()(d.popper,r),modifiers:{preventOverflow:{boundariesElement:"viewport",padding:14},arrow:{enabled:!0,element:b}},transition:p,excludeAnchorFromBackdrop:!1},m),(e=>{let{TransitionProps:r}=e;return a().createElement(g,r,a().createElement(i.Paper,{className:o()(d.paper,null==l?void 0:l.root)},a().createElement("span",{className:o()(d.arrow,null==l?void 0:l.arrow),ref:h}),t))}))}},95629:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(55299),s=r(94079);const c=(0,r(79692).Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"15px"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{label:t,isRequired:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const p=c();return a().createElement(s.Typography,u({className:o()(p.label,n),component:"span"},l),t,r&&a().createElement(i.Z,null))}},95974:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l);const i="1px solid #AFD4E9",s=(0,r(79692).Z)({decorator:{marginLeft:8,borderLeft:i,"&:last-child":{borderLeft:"none","&:before":{borderLeft:i}},"&:before":{top:0,height:14,width:5,borderBottom:i,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),c=e=>{let{className:t,children:r,plain:n=!1,enabled:l=!1}=e;const i=s();return l?a().createElement("div",{className:o()(i.decorator,{[i.plain]:n},t)},a().createElement("div",{className:i.wrapper},r)):a().createElement(a().Fragment,null,r)}},98448:(e,t,r)=>{r.d(t,{Z:()=>g});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(94079),s=r(87451),c=r(83348);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>a().createElement("svg",u({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),m=(0,r(79692).Z)((()=>({container:{height:"15px",backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"}},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px"},icon:{width:"12px",height:"12px",marginRight:0}}))),d=(0,c.Z)(i.Chip),g=e=>{let{className:t,description:r}=e;const{showDescription:l}=(0,n.useContext)(s.Y),i=m();return r&&l?a().createElement(d,{tooltipTitle:r,tooltipPlacement:"bottom",icon:a().createElement(p,null),classes:{root:o()(i.container,t),label:i.label,icon:i.icon}}):null}},40932:(e,t,r)=>{r.d(t,{Z:()=>fe});var n=r(24328),a=r.n(n),l=r(52730),o=r(44443),i=r(94079),s=r(86051),c=r(88832),u=r(69891),p=r(50914),m=r(45203),d=r(15762),g=r(71153),b=r.n(g),h=r(27952),f=r(22385),y=r(79692);const x=(0,y.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}}))),v=(0,y.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),E=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:l}=e;const o=v(),s=(0,n.useRef)(null);return(0,n.useEffect)((()=>{if(null!=s&&s.current){const e=s.current.scrollLeft,t=s.current.offsetWidth+e,r=96*l+16*l+12;t<r?s.current.scroll&&(r>t+96+16?s.current.scroll(r,0):s.current.scroll(112+e,0)):e+96>r&&s.current.scroll&&s.current.scroll(r-96,0)}}),[l,s]),a().createElement("div",{ref:s,className:o.thumbnails},a().createElement(i.Grid,{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:o.gridContainer},t.map(((e,t)=>{let{uri:n,value:s}=e;return a().createElement(i.Grid,{item:!0,key:n},a().createElement(h.Z,{onClick:()=>r(t),className:b()(o.thumb,{[o.inactiveThumb]:l!==t}),src:(0,c.efz)({value:s})}))}))))},w=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}=e;const o=x(),i=r[n],s=(0,c.QXK)(i);return a().createElement("div",{className:b()(o.root,t)},a().createElement("div",{className:o.main},n>0&&a().createElement(f.Z,{icon:m.Z,className:b()(o.arrowButton,o.arrowButtonPrev),onClick:()=>{l(n-1)},size:"XL"}),a().createElement(h.Z,{containerClassName:o.mainImageContainer,className:o.mainImage,size:s&&h.f.OVERRIDE,src:s}),n!==r.length-1&&a().createElement(f.Z,{icon:d.Z,className:b()(o.arrowButton,o.arrowButtonNext),onClick:()=>{l(n+1)},size:"XL"})),a().createElement(E,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}))};var O=r(2507),C=r.n(O),N=r(33016),T=r(36138),S=r(90473),k=r(95038),A=r.n(k);const P={get CreationTime(){return C().text("Creation Time")},get CreationDate(){return C().text("Creation Date")},get Dimensions(){return C().text("Dimensions")},get MimeType(){return C().text("Mime Type")},get Size(){return C().text("Size")},get Url(){return C().text("Full image URL (S3)")},get UrlPreview(){return C().text("Preview image URL (S3)")},get UrlThumbnail(){return C().text("Small image URL (S3)")},get CdnUrl(){return C().text("Full image URL (CDN)")},get CdnUrlPreview(){return C().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return C().text("Small image URL (CDN)")}},Z=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,p.path)([t,0,"value"],e):"CreationDate"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?A()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?A()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,p.path)(["Height",0,"value"],e)&&(0,p.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${C().text("pixels")}`:"Size"===t&&(0,p.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},I=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,l=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?l:l.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},L=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=j(t.attributes);return I(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},D=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),V=(0,y.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},canAdd:{}}),R=e=>{let{attributeType:t,onAddAttributes:r,uri:l}=e;const o=V(),s=j(t.attributes),c=Boolean(r);return a().createElement(i.Box,null,a().createElement(i.Typography,{className:b()(o.title,{[o.canAdd]:c})},C().text("Meta info")),c&&a().createElement(n.Fragment,null,a().createElement(S.Z,{label:C().text("Attributes"),data:s,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:l}))))}}),a().createElement(i.Divider,{className:o.divider})))};var U=r(8683);const B=(0,y.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),M=e=>{let{title:t,content:r,isLink:n,children:l}=e;const o=B();return a().createElement("div",{className:o.root},a().createElement("span",{className:o.title},t),n?a().createElement("a",{className:o.link,href:r},C().text("link")):a().createElement("span",{className:o.content},r||l))},z=(0,y.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),_=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const o=z(),c=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),u=(p=t,m=n,I(Object.keys(P),m).map((e=>Z(p,e)?{title:P[e],value:Z(p,e),isLink:D(e)}:null)).filter(Boolean));var p,m;const d=L(t,r,n);return a().createElement(i.Box,{className:o.root},u.map((e=>{let{title:t,value:r,isLink:n}=e;return a().createElement(M,{key:t,isLink:n,title:t,content:r})})),c&&d.map((e=>{let{attrType:r,values:n}=e;return a().createElement(U.Z,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:o.title,contentClassName:o.content,parentUri:t.uri})})))};var F=r(72045);const H=(0,y.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),W=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:l,onDeleteAttribute:o,onChangeAttribute:s,onAddAttributes:u,onCancel:p,onApply:m,mode:d}=e;const g=H(),b=L(n,t,r),h=0!==b.length||0===b.length&&l;return a().createElement(i.Box,{className:g.root},a().createElement(i.Box,{className:g.form},b.map((e=>{let{attrType:t,values:r}=e;return a().createElement(F.ZP,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,c.ZiX)(n.uri),mode:d,drawLines:!1,onDeleteAttribute:o,onChangeAttribute:s,onAddAttributes:u})}))),h&&a().createElement(a().Fragment,null,a().createElement(i.Divider,{className:g.divider}),a().createElement(i.Box,{className:g.actions},a().createElement(i.Button,{disabled:!l,onClick:p,className:g.cancelButton},C().text("Cancel")),a().createElement(i.Button,{disabled:!l,onClick:m,color:"primary"},C().text("Apply")))))};var q=r(47898);const $={palette:{type:"dark",primary:c.rSc.palette.primary,secondary:c.rSc.palette.secondary}},Y=(0,N.Z)($),G=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:o}=e;const{addAttributes:u,changeAttribute:m,deleteAttribute:d,clearLocalChanges:g,applyLocalChanges:b,attributeValue:h,hasChanges:f}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const a=(0,l.useDispatch)(),o=(0,n.useContext)(q.m),[i,u]=(0,n.useState)(t);(0,n.useEffect)((()=>{u(t)}),[t]);const m=!(0,p.equals)(i,t),d=(0,n.useCallback)((e=>{u((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,c.tPT)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),g=(0,n.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;u((e=>(0,c.ww$)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),b=(0,n.useCallback)((e=>{let{attributeType:t,uri:r}=e;u((e=>(0,c.d$I)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:d,changeAttribute:g,deleteAttribute:b,clearLocalChanges:(0,n.useCallback)((()=>{u(t)}),[t]),applyLocalChanges:(0,n.useCallback)((()=>{a(s.N5.actions.modifyAttribute({value:i,attributeType:r,uri:i.uri,viewId:o}))}),[i,r,o,a]),attributeValue:i,hasChanges:m}})({attributeType:r,initialAttributeValue:o}),y=(0,l.useSelector)(s.ZP.selectors.getMode),x=(0,l.useSelector)(s.ZP.selectors.getIsEditableMode);return a().createElement(T.ThemeProvider,{theme:Y},a().createElement(i.Box,null,a().createElement(R,{attributeType:r,uri:null==h?void 0:h.uri,onAddAttributes:x?u:void 0}),a().createElement(_,{attributeType:r,attributeValue:h,imageAttributeFieldsOrder:t}),x&&a().createElement(W,{mode:y,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:h,hasChanges:f,onDeleteAttribute:d,onChangeAttribute:m,onAddAttributes:u,onCancel:g,onApply:b})))},X=(0,y.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),K=e=>{let{className:t,attributeValue:r,handleSetAsDefault:o,attributeType:c}=e;const u=X(),p=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},m=(0,l.useSelector)((e=>s.ZP.selectors.getModifiedEntity(e,null==p?void 0:p.uri)))||{},d=(0,l.useSelector)(s.ZP.selectors.getIsViewMode)?p:m,g=(0,l.useSelector)(s.ZP.selectors.getImageAttributesFieldsOrder)||{},h=g[null==p?void 0:p.type]||(null==g?void 0:g.default)||{},[f,y]=(0,n.useState)(!1);(0,n.useEffect)((()=>{y((null==d?void 0:d.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,d]);const x=(0,n.useCallback)((()=>{o(r.uri)}),[null==r?void 0:r.uri]);return a().createElement(i.Box,{className:b()(u.root,t)},a().createElement(i.Box,{className:u.header},a().createElement(i.Typography,{className:u.headerTitle},C().text("Details"))),a().createElement(i.Box,{className:u.bodyWrapper},a().createElement(i.Box,{className:u.body},a().createElement(i.FormControlLabel,{classes:{root:u.formControlLabel,label:u.checkboxLabel},control:a().createElement(i.Checkbox,{className:u.checkbox,checked:f,onChange:x,color:"default"}),label:C().text("Set as default")}),a().createElement(G,{attributeType:c,imageAttributeFieldsOrder:h,attributeValue:r}))))},J=(0,y.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),Q=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:l,handleSetAsDefault:o,attributeType:s}=e;const[c,u]=(0,n.useState)(0);(0,n.useEffect)((()=>{p(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const p=(0,n.useCallback)((e=>{var r;u(e),l(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),m=J();return a().createElement(i.Box,{className:m.root},a().createElement(w,{attributeValueIndex:c,setAttributeValueIndex:p,attributeValues:t,className:m.main}),a().createElement(K,{handleSetAsDefault:o,attributeValue:t[c],className:m.details,attributeType:s}))};var ee=r(81853),te=r(97193);const re=(0,y.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),ne=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:l,onShareLink:o,onSetAsDefault:s,onDownload:c,onClickImage:u,onDelete:p}=e;const m=re(),d=e=>a().createElement(te.Z,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>l(e),onShareLink:()=>o(e),onSetAsDefault:()=>s(e),onDownload:()=>c(e),onClick:()=>u(e),onDelete:p?()=>p(e):void 0,canBeSelected:!0});return a().createElement(i.Box,{className:m.root},a().createElement(i.Grid,{container:!0},t.map((e=>{let{id:t,src:r}=e;return a().createElement(i.Grid,{key:t,classes:{item:m.item},item:!0},a().createElement(h.Z,{size:h.f.LARGE,onClick:()=>u(t),src:r,overlay:d(t)}))}))))},ae=(0,y.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),le=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:l}=e;const o=ae(),s=t.length===r.length;return a().createElement(i.Link,{component:"button",underline:"none",classes:{button:o.selectButton},onClick:s?l:n},s?C().text("Clear selection"):C().text("Select all images"))};var oe=r(94438),ie=r(22983),se=r(35292),ce=r(97989),ue=r(8818);const pe=(0,y.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),me=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:l}=e;const o=pe();return a().createElement(a().Fragment,null,n&&a().createElement(i.Button,{variant:"contained",color:"primary",onClick:n,startIcon:a().createElement(oe.Z,null)},C().text("Upload")),t&&n&&a().createElement("div",{className:o.divider}),t&&a().createElement(ue.k,{className:o.downloadButton,tooltipTitle:C().text("Download selected items"),icon:ce.Z,onClick:t}),r&&a().createElement(ue.k,{className:o.shareButton,tooltipTitle:C().text("Copy link"),icon:se.Z,onClick:r}),l&&a().createElement(ue.k,{className:o.deleteButton,tooltipTitle:C().text("Delete selected items"),icon:ie.Z,onClick:l}))},de=e=>{let{attributeValues:t,open:r,onClose:o,currentAttributeValueUri:i,setCurrentAttributeValueUri:u,attributeType:m,onDownload:d,onShareLink:g,onSetAsDefault:b,onUpload:h,onDeleteAttribute:f}=e;const[y,x]=(0,n.useState)([]),[v,E]=(0,n.useState)(ee.A.GALLERY_MODE),w=(0,l.useSelector)(s.ZP.selectors.getIsViewMode);(0,n.useEffect)((()=>{E(i?ee.A.DETAILS_MODE:ee.A.GALLERY_MODE)}),[i]);const O=t.map((e=>({src:(0,c.efz)(e),downloadURL:(0,c.Q5d)(e),id:e.uri}))),C=e=>{g(O.find((0,p.propEq)("id",e)).downloadURL)},N=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));b(r)},T=e=>{f({uri:e,attributeType:m})},S=v===ee.A.GALLERY_MODE,k=v===ee.A.DETAILS_MODE,A=y.length>0,P=k||S&&A,Z=!w&&P,j=!w&&(k||S&&!A),I=S&&A&&a().createElement(le,{items:O,selectedItems:y,onClearAll:()=>{x([])},onSelectAll:()=>{x((0,p.pluck)("id",O))}}),L=a().createElement(me,{onDelete:Z?()=>{(S?y:[i]).forEach((e=>{T(e)})),y.length&&x([])}:void 0,onDownload:P?()=>{const e=S?(0,p.pipe)((0,p.filter)((e=>{let{id:t}=e;return y.includes(t)})),(0,p.pluck)("downloadURL"))(O):[O.find((0,p.propEq)("id",i)).downloadURL];d(e)}:void 0,onShare:k?()=>{C(i)}:void 0,onUpload:j?h:void 0});return a().createElement(ee.C,{mode:v,open:r,onChangeMode:E,header:{left:I,right:L},onClose:o},S&&a().createElement(ne,{items:O,selectedItems:y,onSelectImage:e=>{x((t=>[...t,e]))},onDeselectImage:e=>{x((t=>t.filter((t=>t!==e))))},onShareLink:C,onSetAsDefault:N,onDownload:e=>{d([O.find((0,p.propEq)("id",e)).downloadURL])},onClickImage:e=>{u(e),E(ee.A.DETAILS_MODE)},onDelete:w?void 0:T}),k&&a().createElement(Q,{handleSetAsDefault:N,setCurrentAttributeValueUri:u,currentAttributeValueUri:i,attributeValues:t,attributeType:m}))};var ge=r(95117);const be=(0,y.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,i.fade)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function he(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fe=e=>{let{attributeType:t,attributeValues:r=[],renderImage:p,overlay:m=!1,countFixedItems:d=0,children:g,onUpload:b,onDeleteAttribute:h,imageSize:f=ge.By,paging:y,parentUri:x,showNonOv:v,requestNextPageOfAttributeValues:E}=e;const w=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},O=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),C=(0,l.useDispatch)(),N=be(f);(0,n.useEffect)((()=>{if(y&&E){const e=v?y.totalOvValues:y.totalValues;e>r.length&&E({parentUri:x,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[y,E,t,x,r.length,v]);const T=(0,n.useRef)(),[S,k]=(0,n.useState)(0),[A,P]=(0,n.useState)(0),Z=(0,n.useContext)(u.P),[j,I]=(0,n.useState)(!1),[L,D]=(0,n.useState)(),V=(0,n.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=f,a=Math.floor((e+t)/(n+t))-d,l=e+t-(a+d)*(n+t)<ge.lc;k(a),r.length>a?P(r.length-a+(l?1:0)):P(0)}),[r.length,d,f]),R=(0,n.useCallback)((e=>{V(e),T.current=e}),[V]);(0,n.useEffect)((()=>{T.current&&V(T.current)}),[r.length,V]);const U=(0,n.useCallback)((e=>{Z||(D(e),I(!0))}),[Z]),B=(0,n.useCallback)((()=>{I(!1)}),[]),M=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),z=e=>navigator.clipboard.writeText(e),_=(0,n.useCallback)((e=>{O?(0,c.YL3)(w.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&C(s.N5.entity.actions.setDefaultProfilePic(e))})):C(s.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:w.uri,value:e}))}),[O,w.uri,C]),F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){he(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:U},m&&{onDownload:M,onShareLink:z,onSetAsDefault:_});return a().createElement(a().Fragment,null,a().createElement(o.Z,{handleWidth:!0,onResize:R}),a().createElement(de,{attributeValues:r,open:j,onClose:B,setCurrentAttributeValueUri:D,currentAttributeValueUri:L,attributeType:t,onDownload:M,onShareLink:z,onSetAsDefault:_,onUpload:b,onDeleteAttribute:h}),a().createElement("div",{className:N.imageBox},g,r.slice(0,S).map(p(F)),A>0&&a().createElement("div",{className:N.moreButtonContainer},a().createElement("div",{className:N.moreButton,onClick:()=>U()},a().createElement(i.Typography,{className:N.number},`+${A}`)))))}},95117:(e,t,r)=>{r.d(t,{lc:()=>o,By:()=>i});var n=r(27952);const a=n.f.SMALL.imageWidth,l=n.f.SMALL.imageHeight,o=8,i={imageMargin:4,imageWidth:a,imageHeight:l}},66410:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(52730),s=r(94079),c=r(88832),u=r(86051),p=r(72768),m=r(83348),d=r(3185),g=r(79692),b=r(41128);const h=(0,g.Z)((e=>({container:{height:"16px",borderColor:(0,b.U1)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),f=(0,m.Z)(s.Chip),y=e=>{let{className:t,attributeType:r,nonOvValues:l=[],nonOvTotal:s}=e;const m=h(),g=(0,i.useDispatch)(),b=((e,t)=>{var r;const n=null==t||null===(r=t[0])||void 0===r?void 0:r.uri,a=n?(0,c.Uk3)(n):null;return a&&(0,c.WgC)(a)?a:null==e?void 0:e.uri})((0,n.useContext)(d.u),l),y=(0,n.useCallback)((()=>{g(u.ui.actions.openEntity({uri:b,viewId:null,screen:"sources"}))}),[g,b]);if(!s)return null;const x=l.length?l.map(((e,t)=>a().createElement("div",{key:t},(0,c.YkM)(r)?(0,c.idV)(e.label):a().createElement(p.Z,{value:(0,c.kDl)(e),dataTypeDefinition:(0,c.PFL)(r),rich:!1})))):null;return a().createElement(f,{tooltipTitle:x,tooltipPlacement:"bottom",label:`+ ${s}`,variant:"outlined",onClick:b?y:void 0,classes:{root:o()(m.container,t),label:m.label}})}},84955:(e,t,r)=>{r.d(t,{m:()=>j});var n=r(24328),a=r.n(n),l=r(52730),o=r(94079),i=r(86051),s=r(88832),c=r(50914),u=r(60995);const p=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let l=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(l=l.filter((e=>a.includes(e.uri)))),l.reduce(((e,a)=>{const l=m(t[a.name],n,r);return l&&l.length&&(Array.isArray(l[0])?e.push({[a.uri]:l[0]}):e.push({[a.uri]:l})),e}),[])},m=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,l=(0,s.zeJ)(t,n.type);a&&"object"!=typeof a&&(0,s.OXP)(n)?e.push(d(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(p(l,a,r,t))}return e}),[])},d=(e,t)=>{switch(null==t?void 0:t.type){case s.oS0.TYPE_DATE:return new Date(e).getTime();case s.oS0.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}const b=e=>a().createElement("svg",g({width:11,height:11,viewBox:"0 0 11 11"},e),a().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));var h=r(2507),f=r.n(h),y=r(53180),x=r(31039),v=r(71153),E=r.n(v),w=r(72383),O=r(79692);const C=(0,O.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),N=(0,n.forwardRef)(((e,t)=>{let{value:r,attributeType:o,children:s,className:c,onClick:u}=e;const p=C(),m=(0,l.useSelector)(i.ZP.selectors.getUIPath),{generatePivotingUrl:d}=(0,n.useContext)(w.v),g=d({uiPath:m,uri:o.uri,value:JSON.stringify(r)});return a().createElement("a",{ref:t,href:g,onClick:e=>{u(),e.stopPropagation(),e.preventDefault()},className:E()(p.link,c)},s)}));N.displayName="PivotingUriLink";const T=N;var S=r(85229);const k=(0,O.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"31px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},icon:{margin:"auto 8px auto 0"},content:{color:e.palette.primary.main,cursor:"pointer"},seeAllButton:{cursor:"pointer"}}))),A=(0,O.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}});function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Z=e=>{let{value:t,attributeType:r,config:o={},generatedValue:c,onSeeAllClick:u}=e;const[p,m]=(0,n.useState)([]),[d,g]=(0,n.useState)(0),b=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},h=(0,S._)(),v=k(),E=(0,l.useSelector)(i.ZP.selectors.getGlobalSearchRequestOptions)||{},w=o.entityType||b.type,O=d>6;(0,n.useEffect)((()=>{const e=(0,s.BlA)({value:t,attributeType:r,entityType:w}),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){P(e,t,r[t])}))}return e}({max:6},E);h(Promise.all([(0,s.ZOr)(e,n),(0,s.j_Q)(e,n)])).then((e=>{const[t,{total:r}]=e;m(Array.isArray(t)?t:[]),g(r)})).catch((()=>{m([]),g(0)}))}),[]);const C=Boolean(o.label);return a().createElement("div",{className:v.container},a().createElement("div",{className:v.header},a().createElement("div",{className:v.title},f().text("Pivot profiles")),a().createElement("div",{className:v.divider}),a().createElement("div",{className:v.headerCount},f().number(d,"0,0")+" "+(1===d?f().text("item"):f().text("items")))),C&&a().createElement("div",{className:v.entityTypeLabel},o.label),a().createElement("div",{className:v.body},p.map((e=>a().createElement("div",{key:e.uri,className:v.entityContainer},a().createElement(y.Z,{entity:e,avatarClassName:v.profileIcon}),a().createElement(x.Z,{className:v.entityLabel,value:(0,s.wwR)(e)},(0,s.idV)(e.label)))))),O&&a().createElement("div",{className:v.footer},a().createElement(T,{value:c,attributeType:r,className:v.seeAllButton,onClick:u},f().text("See all"))))},j=e=>{let{value:t,attributeType:r,children:m,className:g}=e;const h=A(),f=k(),y=(0,l.useDispatch)(),x=(0,n.useContext)(u.J)||[],v=(0,s.QZu)(r),E=(0,l.useSelector)(i.ZP.selectors.getMetadata)||{},w=v?p(r,t.value,x,E):d(t.lookupCode||t.value,r),O=x.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(w)&&w.length||!Array.isArray(w)&&!(0,c.isNil)(w)),C=x.find((e=>{let{uri:t}=e;return t===r.uri})),N=O?Array.isArray(w)?w.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,s.nIW)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,w):void 0,S=()=>{y(i.ui.actions.openPivotingPerspective({value:N,attributeType:r}))};return O?a().createElement(o.Tooltip,{interactive:!0,arrow:!0,placement:"right-start",classes:h,title:a().createElement(Z,{value:w,generatedValue:N,attributeType:r,config:C.popup,onSeeAllClick:S})},a().createElement("span",{className:g},a().createElement(b,{className:f.icon}),a().createElement(T,{onClick:S,className:f.content,value:N,attributeType:r},m))):a().createElement(a().Fragment,null,m)}},96811:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(88832),o=r(33889),i=r(62630),s=r(2163);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=(0,n.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return a().createElement("div",{ref:t,className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showEmptyEditors:r,onAddAttributes:n,lazy:u,errors:p,crosswalks:m,showNonOv:d,expanded:g}=t,b=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"]);switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,c({isReltioCrosswalk:(0,l.KVV)(m,t.attributeValue)},b))}}}.build(e.attributeType,n))}));u.displayName="Attribute";const p=u},91262:(e,t,r)=>{r.d(t,{Z:()=>O});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(88832),u=r(50914),p=r(72045),m=r(95974),d=r(90473),g=r(78836),b=r(8261);var h=r(66784),f=r(17374),y=r(48852),x=r(94773);function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const w=e=>{let{parentAttributeType:t,attrTypes:r,entity:l,parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,drawLines:O,children:C,className:N,alwaysVisibleTypeUris:T=g.S,onAddAttributes:S,onChangeAttribute:k,onDeleteAttribute:A,additionalControlsRenderer:P,showNonOv:Z,highlightAttribute:j}=e;const{attributes:I={}}=l,[L,D]=(0,n.useState)({}),V=(0,n.useCallback)(((e,t)=>{D((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){E(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,n.useEffect)((()=>{D({})}),[o]);const R=(0,n.useMemo)((()=>t&&(0,c.Vg3)({attributeType:t,mode:y})),[t,y]),U=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,u.cond)([[c.kqr,(0,u.always)(t)],[(0,u.both)(c.kQw,(0,u.always)(n)),(0,u.always)(n)],[u.T,(0,u.always)(r)]])(e)})(e,t),l=(e=>(0,c.kqr)(e)?"uri":"name")(e);return!((e.singleValue||(0,c.ian)(e)||(0,c.VFZ)(e))&&((0,u.has)(e[l])(a)||r&&(null==n||!n[e.uri])))})))((0,n.useMemo)((()=>(0,c._kX)(y,r)),[r,y]),l,i,L),B=(0,n.useContext)(h.c),M=(0,n.useMemo)((()=>(0,c.Gtj)(r,y,l,i,Z,B)),[r,y,l,i,Z,B]),[z,_]=(0,n.useMemo)((()=>(0,b.A)(T,M)),[M,T]),F=(0,n.useCallback)((e=>{S(e.map((e=>({attributeType:e,parentUri:e===t?(0,c.JBA)(o):o})))),j((0,u.last)(e),x.g4.NewAttribute)}),[S,o,t]),H={enabled:O},W=(0,n.useMemo)((()=>({hasDeletionsMap:L,setHasDeletions:V})),[L,V]);return a().createElement("div",{className:N},C&&a().createElement(m.Z,H,C),a().createElement(m.Z,v({},H,{plain:!0}),U.length>0&&a().createElement(d.Z,{label:s().text("More attributes"),onApply:F,dense:O,data:U,parent:R&&t})),a().createElement(f.d.Provider,{value:W},_.concat(z).map((e=>{let{attrType:t,values:r}=e;return a().createElement(p.ZP,{key:`${t.uri}_${o}`,attributeType:t,drawLines:O,values:r,paging:(0,u.path)(["paging",t.uri],I),parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,onAddAttributes:S,onChangeAttribute:k,onDeleteAttribute:A,additionalControlsRenderer:P,showNonOv:Z})}))))};w.propTypes={parentAttributeType:o().object,attrTypes:o().array,entity:o().object,parentUri:o().string,children:o().node,showEmptyEditors:o().bool,mode:c.XGc,crosswalks:o().array,drawLines:o().bool,showNonOv:o().bool,className:o().string,alwaysVisibleTypeUris:o().array,onAddAttributes:o().func,onChangeAttribute:o().func,onDeleteAttribute:o().func,additionalControlsRenderer:o().func,highlightAttribute:o().func};const O=(0,y.l)(x.NY,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),w)},93140:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(88832),o=r(94079),i=r(50914),s=r(20614),c=r(2507),u=r.n(c);const p=e=>u().text("${value}",{value:1===e?u().text("value"):u().text("values")}),m=(0,i.has)("minValue"),d=(0,i.has)("maxValue"),g=(0,i.pipe)(d,i.not),b=(0,i.propSatisfies)((e=>1===e),"minValue"),h=e=>{let{minValue:t}=e;return u().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})},f=e=>{let{maxValue:t}=e;return u().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:u().number(t,"0"),maxValueCaption:p(t)})},y=(0,i.cond)([[i.isNil,(0,i.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return u().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})}],[(0,i.allPass)([b,d]),f],[(0,i.allPass)([b,g]),(0,i.always)("")],[(0,i.allPass)([m,d]),e=>{let{minValue:t,maxValue:r}=e;return u().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:h({minValue:t}),maxValue:u().number(r,"0"),maxValueCaption:p(r)})}],[d,f],[m,h],[i.T,(0,i.always)("")]]),x=e=>{let{cardinality:t}=e;const r=(0,s.y)();return a().createElement(o.Typography,{variant:"caption",className:r.caption},y(t))};x.propTypes={cardinality:l.oA3};const v=x},72045:(e,t,r)=>{r.d(t,{ZP:()=>ae});var n=r(52730),a=r(86051),l=r(88832),o=r(24328),i=r.n(o),s=r(50914),c=r(95974),u=r(71153),p=r.n(u),m=r(76134),d=r(95629),g=r(66410),b=r(12437),h=r(48554),f=r(96811),y=r(93140);const x=(0,s.filter)((0,s.propSatisfies)(l.ZiX,"uri"));var v=r(66784),E=r(11564),w=r(98448),O=r(79692);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const T={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},S=(0,O.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":C({},T,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),k=e=>{const t=S(),r=(0,o.useRef)(null),{scrollIntoRef:n}=e||{};return(0,o.useEffect)((()=>{e&&n(r)}),[e,n]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}};var A=r(20614);const P=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:u,drawLines:O,showEmptyEditors:C,errorMessage:N,errors:T,paging:S,crosswalks:P,showNonOv:Z,nonVisibleValues:j,highlightedError:I,highlightedAttribute:L,onAddAttributes:D,onDeleteAttribute:V,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:B,requestNextPageOfAttributeValues:M}=e;const z=(0,A.y)(),[_,F]=(0,o.useState)(t),[H,W]=(0,o.useState)(!1),{label:q,required:$,cardinality:Y,name:G,uri:X,description:K}=n,J=(0,l.KIu)(u),{ref:Q,errorClassName:ee}=(0,E.B)({highlightedError:I}),{ref:te,highlightedClassName:re}=k(L),ne=(0,o.useContext)(v.c),ae=(0,o.useMemo)((()=>null==ne?void 0:ne.includes(X)),[X,ne]),le=(0,l.O27)(r),oe=(!H&&C||$||ae)&&le,ie=(0,o.useRef)((0,l.gjI)({parentUri:a,attributeType:n})),se=(0,o.useCallback)((()=>{F(_+1);const e={parentUri:a,index:_,attributeType:n};return D(oe&&!(0,l.YkM)(n.type)?[e,e]:[e])}),[_,D,a,n,oe]),ce=(0,o.useCallback)((0,s.pipe)(V,s.T,W),[V,W]);if(le&&!oe)return null;if(oe&&le&&(r=[ie.current]),(0,l.O27)(r))return null;const ue=(x(r)||[]).length,pe=Z?"totalValues":"totalOvValues",me=(0,s.ifElse)((0,s.has)(pe),(0,s.pipe)((0,s.prop)(pe),(0,s.add)(ue)),(0,s.always)(r.length))(S),de=null!=S&&S.totalValues?S.totalValues-me:null==j?void 0:j.length,ge=t<me,be=ge&&_<me,he=ge&&_>=me,fe=r.slice(0,_),ye=fe?fe.length-1:0,xe=me-_;return i().createElement(c.Z,{enabled:O},i().createElement("div",{ref:Q,className:p()(z.wrapper,ee)},i().createElement("div",{className:z.titleWrapper},i().createElement(d.Z,{label:q,isRequired:$,className:z.title,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{description:K,className:z.description}),i().createElement(g.Z,{nonOvValues:j,attributeType:n,className:z.ovIcon,nonOvTotal:de})),J&&i().createElement(y.Z,{cardinality:Y}),J&&i().createElement(m.Z,{message:N,className:z.typeError}),i().createElement("div",{className:z.attributesWrapper},fe.map(((e,t)=>i().createElement(f.Z,{key:e.uri,attributeValue:e,attributeType:n,lazy:oe&&!$,showEmptyEditors:C,errors:T,ownError:(0,l.ADq)(e,t,n.uri,T),mode:u,crosswalks:P,onAddOneMore:ye===t?se:null,onAddAttributes:D,onDeleteAttribute:ce,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:B,className:0===t?re:null,ref:0===t?te:null,isEmptyEditor:oe}))),be&&i().createElement(h.Z,{moreNumber:(0,s.min)(t,xe),valueNumber:xe,onClick:()=>{r.length<me&&M({parentUri:a,attributeTypeUri:X,attributeTypeName:G,values:r,defaultMaxValues:t}),F(_+t)}}),he&&i().createElement(b.Z,{onClick:()=>{F(t)}}))))};P.displayName="AttributeRenderer";const Z=(0,o.memo)(P);var j=r(94079),I=r(31517),L=r(82455);const D=(0,O.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}});var V=r(22385),R=r(22983);const U={MultiValue:L.Z},B=e=>{let{values:t,onChange:r,onDelete:c}=e;const u=D(),p=(0,n.useSelector)(a.ZP.selectors.getMetadata),m=(0,n.useSelector)(a.ZP.selectors.getEntity),d=m.uri,g=(0,l.JvE)(p,m.type).map((e=>({value:e.uri,label:e.label}))),b=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=g.find((0,s.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,l.nIW)(e)}})),h=(0,o.useCallback)((e=>{const t=(null==e?void 0:e.map((0,s.prop)("value")))||[];r({value:t,attributeType:l.xPW.roles,uri:d})}),[d,r]),f=(0,o.useCallback)((()=>{c({uri:d,attributeType:l.xPW.roles})}),[d,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(I.Z,{label:"",height:40,isMulti:!0,options:g,value:b,onChange:h,components:U,classes:u,className:u.roleContainer}),!!c&&i().createElement(V.Z,{className:u.deleteButton,icon:R.Z,onClick:f,size:"L"}))};var M=r(39331);const z=(0,O.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}}),_=e=>e?`?filter=${(0,l.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",F=[{fieldName:"tags",orderType:"reversedCount"}],H=e=>(0,l.FK9)({query:_(e),body:F}).then((e=>Object.keys(e.tags))),W=e=>{let{className:t,values:r,onChange:s,onDelete:c}=e;const u=z(),p=(0,n.useSelector)(a.ZP.selectors.getEntityUri),m=(0,o.useCallback)((e=>{s({value:e,attributeType:l.xPW.tags,uri:p})}),[s,p]),d=(0,o.useCallback)((()=>{c({uri:p,attributeType:l.xPW.tags})}),[p,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(M.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:m,getSuggestions:H}),!!c&&i().createElement(V.Z,{className:u.deleteButton,icon:R.Z,onClick:d,size:"L"}))};var q=r(17374),$=r(48852);function Y(){return Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y.apply(this,arguments)}function G(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const X=(0,$.l)(q.d,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:c,onDeleteAttribute:u,onChangeAttribute:g,showEmptyEditors:b,hasDeletions:h,setHasDeletions:x,highlightedAttribute:v}=e,E=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const w=(0,A.y)(),{label:O,required:C,cardinality:N}=r,T=(0,l.KIu)(a),[S,P]=(0,o.useState)(!1),Z=(0,o.useCallback)((e=>{P(e),null==x||x(r.uri,e)}),[r.uri,x]),I=void 0!==h?h:S,L=(0,o.useCallback)((0,s.pipe)(u,s.T,Z),[u,Z]),D=(0,l.O27)(t),V=!I&&b&&D,R=(0,o.useRef)((0,l.gjI)({parentUri:n,attributeType:r})),{ref:U,highlightedClassName:M}=k(v);return(0,l.j2U)(r)&&D&&!V?null:i().createElement("div",{ref:U,className:p()(M,w.wrapper)},i().createElement(d.Z,{label:O,isRequired:C,className:p()(w.title,w.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),T&&i().createElement(y.Z,{cardinality:N}),T&&i().createElement(m.Z,{message:c}),i().createElement(j.Box,{className:w.attributesWrapper},(()=>{switch(r.uri){case l.xPW.tags.uri:return i().createElement(W,{values:t,onDelete:L,onChange:g});case l.xPW.roles.uri:return i().createElement(B,{values:t,onDelete:L,onChange:g});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){G(e,t,r[t])}))}return e}({},R.current,{value:t[0]||""});return i().createElement(f.Z,Y({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:L,onChangeAttribute:g},E))}}})()))}));var K=r(24338);const J=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,onDeleteAttribute:o,onChangeAttribute:s,requestNextPageOfAttributeValues:c,highlightedAttribute:u}=e;const m=(0,A.y)(),{label:g,description:b}=t,{ref:h,highlightedClassName:f}=k(u);return i().createElement("div",{ref:h,className:p()(m.wrapper,f)},i().createElement("div",{className:m.titleWrapper},i().createElement(d.Z,{className:m.title,label:g,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{className:m.description,description:b})),i().createElement(K.Z,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:o,parentUri:a,onChangeAttribute:s,requestNextPageOfAttributeValues:c,showNonOv:l}))};var Q,ee=r(94773);function te(){return te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},te.apply(this,arguments)}!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Q||(Q={}));const re=(0,$.l)(ee.NY,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:o}=e||{};return{highlightedAttribute:(0,ee.St)(o)&&a.uri===r.uri?e:null,highlightedError:(0,ee.Ie)(o)&&(0,l.Wah)(a,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:r,mode:n=l.ARY.Viewing,crosswalks:a,drawLines:o,paging:u={},parentUri:p,errors:m,errorMessage:d,max:g=1/0,showEmptyEditors:b,showNonOv:h,highlightedError:f,highlightedAttribute:y,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,requestNextPageOfAttributeValues:C}=e;const N=(0,s.partition)(l.OXP),[T,S]=N(t),k=h?t:T,A=h?[]:S,P={errorMessage:d,errors:m,mode:n,parentUri:p,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,showEmptyEditors:b,highlightedError:f,highlightedAttribute:y};return(()=>{switch((0,s.cond)([[l.kqr,(0,s.always)(Q.special)],[l.Or$,(0,s.always)(Q.imageLine)],[s.T,(0,s.always)(Q.default)]])(r)){case Q.special:return i().createElement(c.Z,{enabled:o},i().createElement(X,te({values:k,attributeType:r},P)));case Q.imageLine:return i().createElement(c.Z,{enabled:o},i().createElement(J,{attributeValues:k,attributeType:r,paging:u,onDeleteAttribute:v,parentUri:p,onChangeAttribute:E,requestNextPageOfAttributeValues:C,showNonOv:h,highlightedAttribute:y}));default:return i().createElement(Z,te({values:k,attributeType:r,max:g,paging:u,crosswalks:a,drawLines:o,requestNextPageOfAttributeValues:C,showNonOv:h,nonVisibleValues:A},P))}})()})),ne={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:a.N5.errors.actions.errorDeactivated},ae=(0,n.connect)(((e,t)=>{let{parentUri:r,attributeType:n,max:o}=t;return{errors:a.ZP.selectors.getActiveErrorsForAttributesPager(e,r,n),errorMessage:(0,l.tQX)(r,n,a.ZP.selectors.getProfileErrors(e)),max:o||a.ZP.selectors.getDefaultMaxValues(e)}}),ne)(re)},20614:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(79692).Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},description:{marginRight:"-9px"},attributesWrapper:{width:"100%",marginBottom:"10px"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",marginTop:"-1px",textIndent:0},titleWrapper:{flex:1,paddingBottom:"3px"}})))},47969:(e,t,r)=>{r.d(t,{Z:()=>N});var n=r(24328),a=r.n(n),l=r(50914),o=r(13980),i=r.n(o),s=r(71153),c=r.n(s),u=r(2507),p=r.n(u),m=r(88832),d=r(94079),g=r(22983),b=r(22385),h=r(19592),f=r(26579),y=r(91262),x=r(48852),v=r(94773),E=r(11564);const w=(0,r(79692).Z)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}})));function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const C=e=>{let{label:t,attributeTypesList:r,attributeType:l,attributeValue:o,children:i,errors:s,ownError:u,mode:x,metadata:v,crosswalks:O,lazy:C,showEmptyEditors:N,onAddOneMore:T,onAddAttributes:S,onDeleteAttribute:k,onChangeAttribute:A,additionalControlsRenderer:P,hideDeleteButton:Z,state:j,showNonOv:I,isHighlightedPath:L,highlightedError:D,expanded:V=!1}=e;const R=w(),U="deleted"===j,B="edited"===j,M=o.uri,z=(0,m.ZiX)(M),_=z||V,[F,H]=(0,n.useState)(_),{ref:W,errorClassName:q}=(0,E.B)({highlightedError:D});(0,n.useEffect)((()=>{L&&H(!0)}),[L]),(0,n.useEffect)((()=>{H(_)}),[_]);const $=(0,n.useMemo)((()=>(0,m.xv5)({attributeType:l,attributeValue:o,mode:x,metadata:v,isReltioCrosswalk:(0,m.KVV)(O,o)})),[l,o,x,v,O]),Y=!U&&!Z&&!!k&&$,G=(0,n.useMemo)((()=>(0,m.J6q)(o,s)),[s,o]);(0,n.useEffect)((()=>{G&&H(!0)}),[s,G]),(0,n.useEffect)((()=>{U&&H(!1)}),[U]);const X=(r||[]).some((e=>(0,m.kQw)(e))),K=(0,n.useMemo)((()=>({attributes:X?null:o.value,analyticsAttributes:X?o.value:null})),[o,X]),J=(0,m.e$p)(u)||G&&p().text("Has an incorrect value")||"";return C?a().createElement(d.Button,{variant:"text",color:"primary",onClick:T},"Create attribute"):a().createElement("div",{ref:W,className:c()(R.complexWrapper,q)},a().createElement("div",{className:R.editor},a().createElement("div",{className:R.titleContainer},a().createElement(h.Z,{onClick:()=>H((e=>!e)),expanded:F,className:R.expandButton,disabled:U}),a().createElement(f.Z,{errorMessage:J,classes:{helperText:R.errorWrapperHelperText}},a().createElement("div",{className:c()(R.label,{[R.deleted]:U}),"data-reltio-id":"reltio-attribute-complex-label"},t))),a().createElement("div",{className:R.actions},B&&a().createElement(d.Typography,{variant:"caption",className:R.editedLabel},"(",p().text("edited"),")"),P&&P({attributeType:l,attributeValue:o}),Y&&a().createElement(b.Z,{icon:g.Z,onClick:()=>k({uri:M,attributeType:l,attributeValue:o}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),F&&a().createElement(y.Z,{parentAttributeType:l,attrTypes:r,entity:K,showEmptyEditors:N||z,drawLines:!0,parentUri:M,mode:x,crosswalks:O,onAddAttributes:S,onChangeAttribute:A,onDeleteAttribute:k,additionalControlsRenderer:P,showNonOv:I},i))};C.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){O(e,t,r[t])}))}return e}({label:i().string,children:i().node,attributeTypesList:i().arrayOf(m.EMD),attributeValue:i().oneOfType([m.dMV,m.Rtp]),highlightedError:i().object,isHighlightedPath:i().bool},m.KVe);const N=(0,x.l)(v.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},o=(0,v.Ie)(a);return{highlightedError:o&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:o&&(0,l.pipe)((0,l.propOr)([],"path"),(0,l.any)((0,l.pathEq)(["value","uri"],r.uri)))(n)}}),C)},31588:(e,t,r)=>{r.d(t,{Z:()=>b});var n=r(52730),a=r(86051),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(91262),u=r(88832);const p=e=>e&&e.attributes,m=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=p,mode:a,onAddAttributes:i,onDeleteAttribute:s,onChangeAttribute:u}=e;const m=(0,l.useMemo)((()=>n(r)),[n,r]);return t?o().createElement(c.Z,{key:t.uri,attrTypes:m,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:i,onChangeAttribute:u,onDeleteAttribute:s}):null};m.propTypes={entityUri:s().string,parentUri:s().string,entity:s().object,entityType:s().object,attributeTypesSelectionStrategy:s().func,mode:u.XGc,onAddAttributes:s().func,onDeleteAttribute:s().func,onChangeAttribute:s().func};const d=m,g={onAddAttributes:a.N5.actions.addAttributes,onDeleteAttribute:a.N5.actions.removeAttribute,onChangeAttribute:a.N5.actions.modifyAttribute},b=(0,n.connect)(((e,t)=>({entity:t.entityUri&&a.ZP.selectors.getModifiedEntity(e,t.entityUri)})),g)(d)},81077:(e,t,r)=>{r.d(t,{Z:()=>$});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(50914),u=r(88832),p=r(24737),m=r(94079),d=r(34e3),g=r(95613),b=r(79692);const h=(0,b.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}}),f=(0,b.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),y=(0,b.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),x=(0,b.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}const E=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:l}=e;const o=h(),{uri:i,entityType:c,label:u,secondaryLabel:p}=l;return""!==i?a().createElement(m.MenuItem,v({className:o.entityContainer,ref:t,key:i,onClick:()=>n({label:u,uri:i,entityType:c})},r),a().createElement(d.Z,{className:o.entityAvatar,entityType:c}),a().createElement(g.Z,{value:`${u}${p?", "+p:""}`},a().createElement("span",{className:o.entityLabel},u,p&&a().createElement("span",{className:o.entitySecondaryLabel},", ",p)))):a().createElement(m.MenuItem,v({className:o.entityContainer,ref:t,key:i},r,{disabled:!0}),a().createElement("span",{className:o.emptyEntityLabel},s().text("No results found")))};E.propTypes={innerRef:o().oneOfType([o().oneOf([null]),o().func,o().shape({current:o().any.isRequired})]),innerProps:o().object.isRequired,selectOption:o().func.isRequired,data:o().shape({uri:o().string.isRequired,label:o().string.isRequired,entityType:u.pyR.isRequired})};const w=E;var O=r(71153),C=r.n(O),N=r(52730),T=r(86051),S=r(47898),k=r(72383);const A=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:l},children:o,data:i}=e,p=f(),d=(0,N.useDispatch)(),g=(0,n.useContext)(S.m),{generateEntityUrl:b}=(0,n.useContext)(k.v),h=(0,N.useSelector)(T.ZP.selectors.getUIPath),y=(0,u.ZiX)(i.entityUri)?{className:p.singleValue,component:"span"}:{className:C()(p.singleValue,p.linkValue),onMouseDown:e=>{e.stopPropagation(),l||(0,c.pipe)((0,c.always)({uri:i.entityUri,viewId:g}),T.ui.actions.openEntity,d)()},onClick:e=>e.preventDefault(),href:b({uiPath:h,uri:i.entityUri}),component:"a"};return!r&&a().createElement(m.Typography,y,(0,u.ZiX)(i.entityUri)?s().text(`New ${t.label} will be created`):(0,u.idV)(o))};A.propTypes={children:o().string,data:o().object.isRequired,selectProps:o().object.isRequired};const P=A;var Z=r(33375);const j=e=>{const{selectProps:{onClear:t}}=e,r=x();return a().createElement(m.IconButton,{onClick:t},a().createElement(Z.Z,{className:r.clearIcon}))};j.propTypes={selectProps:o().object.isRequired};const I=j;var L=r(31588),D=r(31276),V=r(81997),R=r(65549);const{Group:U}=V.F,B=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:l}=e,o=y();return a().createElement(U,e,a().createElement("div",{className:o.groupHeading},a().createElement("span",null,n.label),r&&a().createElement("span",{onClick:()=>r(t,n.entityType),className:o.addLabel},a().createElement(R.Z,{className:o.addIcon}),s().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),l)};B.propTypes={selectProps:o().object.isRequired,data:o().object,children:o().array};const M=B,z=(0,b.Z)({creatorWrapper:{marginTop:"20px"}});function _(){return _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_.apply(this,arguments)}function F(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){W(e,t,r[t])}))}return e}function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const q=e=>{let{entity:t={},entityTypesUris:r=[],mode:l,max:o,onChange:i,onCreate:m,metadata:d,globalSearchRequestOptions:g,attributeTypesSelectionStrategy:b,disableLinkClick:h=!1}=e,f=F(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const y=z(),[x,v]=(0,n.useState)(""),E=(0,n.useMemo)((()=>r.map((e=>(0,u.nt9)(d,e))).filter(u.oDv)),[r,d]),O=H({},g,{max:o}),C=m?(e,t)=>{m(t||r[0],e),v("")}:void 0,N=e=>{null!==e&&(v(""),i(e))},T=(0,n.useMemo)((()=>1!==E.length),[E]),S=((0,c.isEmpty)(t)?E[0]:(0,u.nt9)(d,t.entityType))||{},k=m&&s().text(`Create ${x?`"${x}" as `:""}new ${S.label}`),A=s().text(`Select ${1===E.length?`${E[0].label} `:""}profile`),Z=!(0,c.isEmpty)(t)&&(0,u.ZiX)(t.entityUri),j=T?{Group:M,GroupHeading:D.Vd}:{},V=Z?{ClearIndicator:I}:{},{TextFieldProps:R}=f,U=F(f,["TextFieldProps"]),B=(0,n.useMemo)((()=>H({},R||{},{"data-reltio-id":"reltio-entity-selector"})),[R]);return a().createElement(a().Fragment,null,a().createElement(p.Z,_({value:(0,c.isEmpty)(t)?void 0:t,inputValue:x,onInputChange:e=>{v(e)},getOptions:e=>(0,u.U10)(E,e,O).then(((e,t)=>r=>{const n=r.map((t=>H({},t,{label:(0,u.idV)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,c.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,l=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return l.length>1?l.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(E,m)),getOptionLabel:(0,c.prop)("entityLabel"),onChange:N,onCreate:C,onClear:()=>{N({})},label:A,createLabel:k,components:H({Option:w,SingleValue:P},j,V),currentEntityType:S,isClearable:!0,disableLinkClick:h,TextFieldProps:B},U)),Z&&a().createElement("div",{className:y.creatorWrapper},a().createElement(L.Z,{mode:l,attributeTypesSelectionStrategy:b,entityType:S,entityUri:t.entityUri})))};q.propTypes={entity:u.oZZ,entityTypesUris:o().arrayOf(o().string),max:o().number,mode:u.XGc,dispatch:o().func,metadata:u.pGS,onChange:o().func.isRequired,onCreate:o().func,attributeTypesSelectionStrategy:o().func,globalSearchRequestOptions:o().object,disableLinkClick:o().bool};const $=q},24338:(e,t,r)=>{r.d(t,{Z:()=>_});var n=r(24328),a=r.n(n),l=r(52730),o=r(94438),i=r(86051),s=r(88832),c=r(27952),u=r(97193),p=r(22385),m=r(2507),d=r.n(m),g=r(94079),b=r(99136),h=r(79692);const f=(0,h.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),y=e=>0===e.trim().length,x=e=>{let{onSend:t}=e;const r=f(),[l,o]=(0,n.useState)(""),[i,s]=(0,n.useState)(null);return a().createElement(g.Box,{className:r.root},a().createElement(g.Paper,{className:r.paper},a().createElement(g.InputBase,{value:l,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);o(t),r||y(t)?s(null):s(d().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:d().text("Paste an image URL here")}),a().createElement(g.Button,{disabled:Boolean(i)||y(l),variant:"outlined",color:"primary",onClick:()=>{t(l),o(""),s(null)}},d().text("Send"))),i&&a().createElement(g.Typography,{className:r.errorMessage},i))};var v=r(71153),E=r.n(v),w=r(13896),O=r(83997);const C=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],N=e=>{let{className:t,onAppendFile:r}=e;return a().createElement(a().Fragment,null,a().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:C.join(","),id:"upload-image-button",type:"file"}),a().createElement("label",{htmlFor:"upload-image-button"},a().createElement(g.Button,{className:t,variant:"contained",color:"primary",component:"span"},d().text("Select image"))))};function T(){return T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},T.apply(this,arguments)}const S=e=>a().createElement("svg",T({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},a().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),a().createElement("stop",{stopColor:"#000",offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},a().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),a().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),a().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),a().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),a().createElement("g",{mask:"url(#UploadIcon_svg__b)"},a().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},a().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),a().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),a().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),a().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),a().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),k=(0,h.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),A=e=>{let{onAppendFile:t,className:r}=e;const n=k(),[{canDrop:l,isOver:o},i]=(0,w.useDrop)({accept:[O.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),s=l&&o;return a().createElement("div",{ref:i,className:E()(n.root,{[n.isActive]:s},r)},a().createElement(S,{className:n.icon}),a().createElement(g.Typography,{className:n.title},d().text("Drag an image here")),a().createElement(g.Typography,{className:n.description},d().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),a().createElement(N,{onAppendFile:t}))},P=(0,h.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Z=e=>{let{children:t,className:r}=e;const n=P();return a().createElement(g.Box,{className:E()(n.root,r)},a().createElement(g.Box,{className:n.border}),a().createElement(g.Typography,{className:n.text},t),a().createElement(g.Box,{className:n.border}))};var j=r(87685),I=r(8818);const L=(0,h.Z)({closeIcon:{color:"#fff"}}),D=e=>{let{error:t,onClose:r}=e;const n=L();return a().createElement(g.Snackbar,{open:Boolean(t),onClose:r,message:t,action:a().createElement(I.k,{className:n.closeIcon,tooltipTitle:d().text("Close"),icon:j.default,onClick:r})})},V=(0,h.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}})));var R=r(6521);const U=e=>{let{open:t,onClose:r,onUpload:o}=e;const c=V(),u=(0,l.useSelector)(i.ZP.selectors.getImageServicePath),p=(0,l.useSelector)(i.ZP.selectors.getEnvironment),m=(0,l.useSelector)(i.ZP.selectors.getTenant),[h,f]=(0,n.useState)(!1),[y,v]=(0,n.useState)(null),E=e=>{f(!0),(0,s.Ixr)({image:e,imageServicePath:u,environment:p,tenant:m}).then((e=>{o(e),r()})).catch((e=>{v((0,s.xU7)(e,d().text("Something went wrong")))})).finally((()=>f(!1)))};return a().createElement(R.l,null,a().createElement(g.Dialog,{open:t,onClose:r,classes:{paper:c.dialogPaper}},a().createElement(g.Typography,{className:c.title},d().text("Add new image")),a().createElement(g.Box,{className:c.body},a().createElement(A,{className:c.targetBox,onAppendFile:e=>{if(!e)return v(d().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=C.includes(e.type);t>20?v(d().text("File size exceeds configured max file size.")):r?E(e):v(d().text("File format is not supported."))}}),a().createElement(Z,{className:c.divider},d().text("or")),a().createElement(x,{onSend:e=>{E(e)}})),h&&a().createElement(b.Z,null),a().createElement(D,{error:y,onClose:()=>v(null)})))};var B=r(40932),M=r(95117);const z=(0,h.Z)((()=>({root:{width:"100%",marginBottom:"10px"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),_=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:m,onChangeAttribute:d,requestNextPageOfAttributeValues:g,parentUri:b,paging:h,showNonOv:f,imageSize:y=M.By}=e;const x=z(y),v=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},E=(0,l.useSelector)((e=>i.ZP.selectors.getModifiedEntityDefaultProfilePic(e,v.uri))),w=(0,l.useDispatch)(),[O,C]=(0,n.useState)(!1),N=(0,n.useCallback)((()=>{C((e=>!e))}),[]),T=(0,n.useCallback)((e=>{const r=(0,s.hm5)(b,t.name),n={};for(const a in e){const l=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));l&&(n[a]=[{uri:(0,s.hm5)(r,l.name),ov:!0,value:e[a],type:l.uri}])}d({attributeType:t,uri:r,value:n})}),[d,b,t]),S=(0,n.useCallback)((e=>{if(m(e),E===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];w(i.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:v.uri,value:n||{}}))}}),[m,v,E,r]),k=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:l,onShareLink:o,onSetAsDefault:i}=e,c=(0,s.Q5d)(r),{uri:p}=r;return a().createElement(u.Z,{id:p,onShareLink:()=>o(c),onSetAsDefault:()=>i(r),onDelete:()=>S({uri:p,attributeType:t}),onDownload:()=>l([c]),onClick:()=>n(p)})};return a().createElement("div",{className:x.root},a().createElement(B.Z,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,s.efz)(t),{uri:n}=t,{onOpenImageGalleryDialog:l}=e;return a().createElement("div",{className:x.image,key:n},a().createElement(c.Z,{src:r,overlay:k(e,t),onClick:()=>l(n),size:{imageWidth:y.imageWidth,imageHeight:y.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:1,onUpload:N,onDeleteAttribute:S,imageSize:y,requestNextPageOfAttributeValues:g,paging:h,parentUri:b,showNonOv:f},a().createElement("div",{className:x.uploadContainer,onClick:N},a().createElement(p.Z,{className:x.uploadButton,iconClassName:x.uploadIcon,icon:o.Z}))),a().createElement(U,{open:O,onUpload:T,onClose:N}))}},90473:(e,t,r)=>{r.d(t,{Z:()=>N});var n=r(24328),a=r.n(n),l=r(94079),o=r(71153),i=r.n(o),s=r(50914),c=r(2507),u=r.n(c),p=r(7785),m=r(97820),d=r(65549),g=r(27239),b=r(54763),h=r(44890),f=r(88832),y=r(56656);const x=(0,s.curry)(((e,t)=>(0,s.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),v=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,s.pipe)(x(r),(0,s.sort)(n),(0,s.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var E,w=r(86051),O=r(52730);!function(e){e.parent="parent",e.attributes="attributes"}(E||(E={}));const C=(0,r(79692).Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),N=e=>{let{label:t,popupTitle:r=t,data:o,parent:c,dense:x,onApply:N}=e;const T=C(),S=(0,n.useRef)(),[k,A]=(0,n.useState)(!1),[P,Z]=(0,n.useState)(""),[j,I]=(0,n.useState)([]),{items:L,hasGroups:D,parentGroupLength:V,attributesGroupLength:R}=(e=>{let{data:t,parent:r,filter:a}=e;const l=Boolean(r),o=(0,O.useSelector)(w.ZP.selectors.getAttributesSortingStrategy),i=(0,n.useMemo)((()=>o===f.PYu.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[o]),s=(0,n.useMemo)((()=>l?v({attrTypes:[r],filter:a,sortingFn:i}):[]),[l,r,a,i]),c=(0,n.useMemo)((()=>l&&null!=s&&s.length?[{item:{id:E.parent,label:u().text("Parent")},items:s}]:[]),[l,s]),p=(0,n.useMemo)((()=>v({attrTypes:t,filter:a,sortingFn:i})),[t,a,i]),m=(0,n.useMemo)((()=>l&&null!=p&&p.length?[{item:{id:E.attributes,label:u().text("Attributes")},items:p}]:p),[l,p]),d=(0,n.useMemo)((()=>(0,y.LG)((c||[]).concat(m))),[c,m]),g=c.length,b=m.length;return{items:d,hasGroups:l,parentGroupLength:g,attributesGroupLength:b}})({data:o,parent:c,filter:P}),U=(0,n.useCallback)(((e,t)=>{I((0,s.ifElse)((0,s.always)(t),(0,s.append)(e),(0,s.reject)((0,s.propEq)("id",e.id)))(j))}),[j]),B=(0,n.useCallback)(((e,t)=>t.items?40:28),[]),M=(0,n.useCallback)((e=>{let{item:t}=e;U(t,(0,s.not)((0,s.any)((0,s.propEq)("id",t.id))(j)))}),[U,j]),{focusIndex:z,handleKeyDown:_}=(0,b.t)({items:L,open:k,onSelectFocusedItem:M,selectedItems:j}),F=(0,n.useRef)(null);F.current=z;const H=D?(V?1:0)+(R?1:0):0,W=L.length-H,q=Math.min(255,28*W+40*H),$=Math.max(140,q+112),Y=(0,n.useCallback)(((e,t,r)=>{var n;let{item:l,level:o=0}=t;const i=(0,s.any)((0,s.propEq)("id",l.id))(j),c=F.current===r;return a().createElement(p.Z,{key:l.uri,onClick:U,checked:i,level:o,data:l,label:a().createElement(g.Z,{text:l.label,highlight:P}),labelInText:l.label,style:e,isFocused:c,isRequired:!(null===(n=l.attrType)||void 0===n||!n.required),LogoIcon:l.LogoIcon})}),[P,U,j]),G=(0,n.useCallback)(((e,t)=>a().createElement(l.ListItem,{component:"div",className:T.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return a().createElement("div",{className:i()(T.moreAttributes,{[T.dense]:x})},a().createElement(l.Button,{color:"primary",onClick:()=>A(!k),ref:S,className:T.moreButton},a().createElement(d.Z,{classes:{root:T.icon}}),a().createElement("div",{className:T.buttonLabel},t)),a().createElement(m.Z,{open:k,className:i()(T.moreAttributesPopup,T.popupContainer),anchorEl:S.current,onClose:(0,s.pipe)((()=>{j.length>0&&N((0,s.pluck)("attrType",j))}),(()=>A(!1)),(()=>Z("")),(()=>I([]))),onSearch:Z,containerHeight:$,title:r,containerWidth:320,searchInputOnKeyDown:_},a().createElement(h.Z,{getItemSize:B,renderItem:Y,renderGroupTitle:G,items:L,height:q,focusIndex:z}),0===L.length&&a().createElement("div",{className:T.noResultsCaptionContainer},a().createElement(l.Typography,{variant:"caption",display:"block",gutterBottom:!0},u().text("No results found")))))}},62630:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(88832),o=r(47969);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}const s=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,l.Kxm)(t,r.dataLabelPattern);return a().createElement(o.Z,i({label:(0,l.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};s.propTypes=l.j2V;const c=(0,n.memo)(s)},2163:(e,t,r)=>{r.d(t,{Z:()=>T});var n=r(52730),a=r(86051),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(71153),u=r.n(c),p=r(50914),m=r(88832),d=r(47969),g=r(81077),b=r(26579),h=r(48852),f=r(94773),y=r(11564);const x=(0,r(79692).Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w(e,t,r[t])}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O=e=>{const t=x(),{modifiedEntity:r,metadata:n,globalSearchRequestOptions:a,onDeleteModifiedEntity:i,onUpdateModifiedEntity:s,onDeactivateError:c,highlightedError:h}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["modifiedEntity","metadata","globalSearchRequestOptions","onDeleteModifiedEntity","onUpdateModifiedEntity","onDeactivateError","highlightedError"]),{attributeValue:w,attributeType:O,mode:C,crosswalks:N,errors:T,onChangeAttribute:S}=f,k=(0,l.useRef)(w),{ref:A,errorClassName:P}=(0,y.B)({highlightedError:h,isSimple:!0}),Z=(0,m.CZ8)(w),j=(0,m.o96)(w),I=(0,m.Poc)(O),L=(0,m.nt9)(n,I),D=r?(0,m.Kxm)(r,L.dataLabelPattern):w.label,V=(0,l.useMemo)((()=>[I]),[I]),R=(0,l.useMemo)((()=>(0,m.EtK)(N,j)),[N,j]),U=(0,l.useMemo)((()=>(0,m.mbo)(w,T)),[w,T]),B=(0,l.useMemo)((()=>Z&&{entityUri:(0,m.ZTM)(Z),entityType:(0,m.uGi)(Z),entityLabel:w.label}),[Z,w.label]),M=(0,l.useMemo)((()=>(0,m.tF$)(O).map((e=>(0,m.zeJ)(n,e))).filter(p.identity)),[O,n]),z=(0,l.useCallback)((e=>(0,m.ct9)(O,e)),[O]),_=(0,l.useCallback)((e=>{r&&i(r.uri);const t=k.current,n=!(0,p.isEmpty)(e)&&e.uri===(0,m.bwT)(t),a=E({},w,{label:e.label,refEntity:n?t.refEntity:(0,m.fmQ)(e),refRelation:n?t.refRelation:(0,m.NBq)(w)});S({value:a,attributeType:O,uri:w.uri}),U&&c((0,m.iFp)(U))}),[w,O,r,S,i,c,U]),F=(0,l.useCallback)(((e,t)=>{const r=(0,p.pipe)(z,(0,m._kX)(C))(L),a=(0,m.pBq)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:n,mode:C});_(a),s(a)}),[z,C,L,n,_,s]),H=(0,l.useMemo)((()=>(0,m.yv0)({attributeType:O,attributeValue:w,mode:C,isReltioCrosswalk:(0,m.KVV)(N,w)})),[O,w,C,N]),W=(0,l.useMemo)((()=>(0,m.d89)(C,L)),[C,L]),q=(0,m.e$p)(U);return o().createElement(d.Z,v({},f,{label:(0,m.idV)(D),attributeTypesList:M,crosswalks:R,metadata:n}),o().createElement("div",{ref:A,className:P},o().createElement(b.Z,{errorMessage:q},o().createElement(g.Z,{className:u()(t.item,{[t.dense]:q||B&&(0,m.ZiX)(B.entityUri)}),entity:B||{},entityTypesUris:V,max:20,globalSearchRequestOptions:a,mode:C,isDisabled:!H,onChange:_,onCreate:W?F:void 0,metadata:n,attributeTypesSelectionStrategy:z}))))};O.propTypes=E({},m.NkU,{modifiedEntity:m.pyR,metadata:m.pGS,globalSearchRequestOptions:s().object,onDeleteModifiedEntity:s().func,onUpdateModifiedEntity:s().func,onDeactivateError:s().func,highlightedError:s().object});const C=(0,h.l)(f.NY,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:l}=e||{};return{highlightedError:(0,f.Ie)(l)&&(0,m.Wah)(a,r.uri,n.uri)?e:null}}),O),N={onDeleteModifiedEntity:a.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:a.N5.modifiedEntities.actions.entityCreated,onDeactivateError:a.N5.errors.actions.errorDeactivated},T=(0,n.connect)(((e,t)=>{const r=(0,m.bwT)(t.attributeValue);return{modifiedEntity:(0,m.ZiX)(r)?a.ZP.selectors.getModifiedEntity(e,r):null,metadata:a.ZP.selectors.getMetadata(e),globalSearchRequestOptions:a.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"])}}),N)(C)},33889:(e,t,r)=>{r.d(t,{Z:()=>V});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(52730),s=r(71153),c=r.n(s),u=r(50914),p=r(65549),m=r(22983),d=r(94079),g=r(2507),b=r.n(g),h=r(88832),f=r(72768),y=r(28117),x=r(26579),v=r(22385),E=r(40879),w=r(49965),O=r(86051);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const T={},S=(e,t,r)=>{const n=O.ZP.selectors.getDependentLookupsStructureNode(e,r);if(n){const r=t.uri,{parents:o,missedParentsAttributeTypes:i}=((e,t,r)=>{var n;const a=r.parents.flatMap((t=>{const r=O.ZP.selectors.getDependentLookupsStructureNode(e,t);return r.values.map((e=>C({},e,{type:t,dependentLookupCode:r.attrType.dependentLookupCode})))})),l=O.ZP.selectors.getModifiedEntities(e),o=O.ZP.selectors.getEntityUri(e),i=O.ZP.selectors.getAllRelationsToAddAndEdit(e),s=O.ZP.selectors.getMetadata(e),c=(0,h.vUy)({parentValues:a,valueUri:t,entityUri:o,modifiedEntities:l,connections:i}),p=(0,u.pipe)(h.uDV,(0,u.defaultTo)([]),(0,u.map)((0,u.pipe)((0,u.path)(["valueType","uri"]),h.u5q)),(0,u.prepend)(null===(n=l[o])||void 0===n?void 0:n.type),(0,u.reject)(u.isNil),u.uniq)({entityUri:o,entitiesMap:l,connections:i,metadata:s},t),m=r.parents.filter((e=>p.some((0,h.sOy)(e)))).map((t=>O.ZP.selectors.getDependentLookupsStructureNode(e,t).attrType)).filter((e=>!c.some((t=>{let{type:r,value:n}=t;return n&&r===e.uri}))));return{parents:Object.values(c.reduce(((e,t)=>{var r;const n=(e=>`${e.type}_${(0,h.JBA)(e.uri)}`)(t);return C({},e,{[n]:{type:t.dependentLookupCode,codeValues:(0,u.uniq)([t.value,...(null===(r=e[n])||void 0===r?void 0:r.codeValues)||[]]).filter(Boolean).sort()}})}),{})).filter((e=>!!e.codeValues.length)),missedParentsAttributeTypes:m}})(e,r,n),{isBlocked:s=!1}=O.ZP.selectors.getDependentLookupEditorState(e,r)||{},c=(a=i).length?b().text("Please select value for ${labels} ${attributes}.",{labels:(l=a.map((0,u.pipe)((0,u.prop)("label"),(e=>`'${e}'`))),l.reduce(((e,t,r)=>[e,t].join(r===l.length-1?` ${b().text("and")} `:", ")))),attributes:1===a.length?b().text("attribute"):b().text("attributes")}):"",p=!(null!=t&&t.lookupCode||null!=t&&t.value),m=p&&s&&b().text("Populating values...")||p&&c||"",d={parents:c?null:o,disabled:!!c&&p||s,placeholder:m};return m&&(d.value=null),((e,t)=>{const r=T[e];return(0,u.equals)(t,r)?r:((0,u.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),T[e]=t,t)})(r,d)}var a,l};var k=r(48852),A=r(26481),P=r(91186),Z=r(94773),j=r(11564);const I=(0,r(79692).Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function L(){return L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},L.apply(this,arguments)}const D=e=>{let{className:t,attributeValue:r,attributeType:l,isReltioCrosswalk:o,ownError:s,mode:g,onAddOneMore:w,onDeleteAttribute:C,onChangeAttribute:N,onDeactivateError:T,additionalControlsRenderer:k,state:Z,highlightedError:D,isEmptyEditor:V=!1}=e,R=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const U=I(),B="deleted"===Z,M="edited"===Z,z=(0,h.KIu)(g),_=(0,h.Vg3)({attributeType:l,mode:g}),F=(0,h.yv0)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),H=(0,h.xv5)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),W=F&&z,q=(0,h.e$p)(s),$=(0,i.useSelector)((e=>(0,h.QEi)(l)?S(e,r,null==l?void 0:l.uri):null)),{ref:Y,errorClassName:G}=(0,j.B)({highlightedError:D,isSimple:!0});(0,n.useEffect)((()=>{V&&(0,h.QEi)(l)&&!(0,u.has)("lookupCode",r)&&N({attributeType:l,uri:r.uri,value:r.value,silent:!0})}),[V]);const X=(0,n.useMemo)((()=>(0,h.PFL)(l)),[l]),K=(0,n.useMemo)((()=>(0,E.AG)(r,X)),[r,X]),J=(0,n.useCallback)((()=>{s&&T((0,h.iFp)(s))}),[s,T]),Q=(0,n.useCallback)((0,u.pipe)((0,E.pp)(r,l),N,J),[r,l,N,J]),ee=!!w&&_&&!l.singleValue,te=!B&&!!C&&H,re=!!q,ne=B?{disabled:!0}:{},ae=(0,n.useContext)(A.j),{autopopulationContextValue:le}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:a}=e;const l=(0,i.useDispatch)(),o=(0,i.useSelector)(O.ZP.selectors.getLookupAutocomplete),s=t&&(0,h.Vmh)(o,r),c=s?a:null,{isTouched:u=!1}=(0,i.useSelector)((e=>s&&O.ZP.selectors.getDependentLookupEditorState(e,a)))||{},p=(0,n.useCallback)((e=>{l(O.N5.dependentLookups.actions.dependentLookupsEditorTouched({uri:e,isTouched:!0}))}),[l]);return{autopopulationContextValue:(0,n.useMemo)((()=>c?{id:c,isTouched:u,onTouch:p}:null),[c,u,p])}})({enabled:ae&&(0,h.QEi)(l),attributeTypeUri:null==l?void 0:l.uri,valueUri:r.uri});return a().createElement("div",{ref:Y,className:c()(U.editor,t,G)},a().createElement(x.Z,{errorMessage:q,className:U.errorWrapper},a().createElement("div",{className:c()(U["editor-value"],{[U.deleted]:B},{[U["editor-read-only-value"]]:!W}),"data-reltio-id":"reltio-attribute-value"},W?a().createElement(P.m.Provider,{value:le},a().createElement(y.Z,L({fieldName:(0,h.Tde)(l.uri),value:K,dataTypeDefinition:X,error:re,onChange:Q,fullWidth:!0},$,R,ne))):a().createElement(f.Z,{value:(0,h.kDl)(r),dataTypeDefinition:X}))),a().createElement("div",{className:U["editor-actions"]},M&&a().createElement(d.Typography,{variant:"caption",className:U.editedLabel},"(",b().text("edited"),")"),ee&&a().createElement(v.Z,{icon:p.Z,onClick:w,size:"L",className:c()(U.addButton,U.button)}),k&&k({attributeType:l,attributeValue:r}),te&&a().createElement(v.Z,{className:U.button,icon:m.Z,onClick:()=>{C({uri:r.uri,attributeType:l}),(0,h.PcX)(s)!==h.NIO.missed&&J()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))};D.propTypes={className:o().string,attributeValue:h.cNQ,attributeType:h.EMD,ownError:h.wfT,isReltioCrosswalk:o().bool,state:o().oneOf(["deleted","edited"]),mode:h.XGc,onAddOneMore:o().func,onDeleteAttribute:o().func,onChangeAttribute:o().func,onDeactivateError:o().func,additionalControlsRenderer:o().func,highlightedError:o().object,isEmptyEditor:o().bool};const V=(0,w.Z)((0,k.l)(Z.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:(0,Z.Ie)(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),D),(()=>{const e=I();return a().createElement("div",{className:e.placeholder})}))},40879:(e,t,r)=>{r.d(t,{AG:()=>i,Ho:()=>s,pp:()=>c});var n=r(95038),a=r.n(n),l=r(88832),o=r(50914);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t}=arguments.length>1?arguments[1]:void 0;const{value:r,lookupCode:n}=e;switch(t){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.gxP)(r);case l.oS0.TYPE_DATE:return r&&l.P6Y.dates.toLocalDate(r)||null;case l.oS0.TYPE_LOCAL_DATE:case l.oS0.TYPE_TIMESTAMP:case l.oS0.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case l.oS0.TYPE_DEPENDENT_LOOKUP:case l.oS0.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}},s=(e,t)=>{const{type:r}=(0,l.PFL)(e);switch(r){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case l.oS0.TYPE_DATE:return t&&a()(t).format("YYYY-MM-DD")||"";case l.oS0.TYPE_TIMESTAMP:return t&&a()(t).format()||"";case l.oS0.TYPE_ACTIVENESS_DATE:case l.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},c=(0,o.curry)(((e,t,r)=>({value:s(t,r),uri:e.uri,attributeType:t})))},17374:(e,t,r)=>{r.d(t,{d:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},66784:(e,t,r)=>{r.d(t,{c:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},8261:(e,t,r)=>{r.d(t,{U:()=>l,A:()=>o});var n=r(50914),a=r(88832);const l=(e,t,r,l)=>{const o=(0,n.pipe)(a.nt9,(0,n.defaultTo)({}),(0,n.props)(["attributes","analyticsAttributes"]),(0,n.reject)(n.isNil),n.flatten,(0,n.concat)(n.__,(0,n.pipe)(n.values,(0,n.reject)((0,n.propEq)("uri",a.xPW.id.uri)))(a.xPW)))(e,t);return r.length?o.filter((e=>{let{uri:t}=e;return r.includes(t)})):o.filter((e=>{let{uri:t}=e;return!l.includes(t)}))},o=(e,t)=>(0,n.partition)((0,n.pipe)((0,n.path)(["attrType","uri"]),(0,n.includes)(n.__,e)),t)},12437:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(96971),a=r(94079),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(9125);const u=e=>{let{onClick:t}=e;const r=(0,c.y)();return o().createElement(a.Link,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},o().createElement(n.Z,{className:r["svg-icon__root"]}),s().text("Show less"))}},48554:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(4426),a=r(94079),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(9125);const u=e=>{let{moreNumber:t,valueNumber:r,onClick:l}=e;const i=(0,c.y)();return o().createElement(a.Link,{component:"button",variant:"caption",className:i.link,onClick:l,underline:"none"},o().createElement(n.Z,{className:i["svg-icon__root"]}),t&&r?s().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):s().text("Show more"))}},9125:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(79692).Z)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}})},81303:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(88832),o=r(12068),i=r(28751),s=r(22544);const c=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,t)}}}.build(t,e)}},80931:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(50914),o=r(88832),i=r(95974),s=r(8683),c=r(48554),u=r(12437),p=r(78836),m=r(8261);const d=(0,n.memo)((e=>{let{attrTypes:t,entity:r,parentUri:d,drawLines:g,children:b,className:h,max:f,alwaysVisibleTypeUris:y=p.S,showNonOv:x}=e;const[v,E]=(0,n.useState)(f||1/0),w=(0,n.useMemo)((()=>(0,o.fyF)(t,r,x)),[t,r,x]),[O,C]=(0,n.useMemo)((()=>(0,m.A)(y,w)),[w,y]),N=C.slice(0,v),T=f&&N.length<C.length,S=f&&N.length>=C.length&&f<N.length,k={enabled:g};return a().createElement("div",{className:h},b&&a().createElement(i.Z,k,b),N.concat(O).map((e=>{let{attrType:t,values:n}=e;return a().createElement(s.Z,{key:t.uri,attributeType:t,drawLines:g,values:n,paging:(0,l.path)(["paging",t.uri],r.attributes),parentUri:d,showNonOv:x})})),T&&a().createElement(c.Z,{onClick:()=>{E(1/0)}}),S&&a().createElement(u.Z,{onClick:()=>{E(f)}}))}))},8683:(e,t,r)=>{r.d(t,{Z:()=>Q});var n=r(52730),a=r(86051),l=r(71153),o=r.n(l),i=r(24328),s=r.n(i),c=r(50914),u=r(88832),p=r(79692);function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){d(e,t,r[t])}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const g="13px",b="15px",h={titleRow:{display:"block",minHeight:"16px",textIndent:"-1em",paddingLeft:"1em"},title:{whiteSpace:"nowrap"},ovIcon:{marginLeft:"8px",marginRight:"-3px",marginTop:"-1px",textIndent:0},descriptionIcon:{marginTop:"-1px",textIndent:0,marginRight:"-10px"}},f=(0,p.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),y=(0,p.Z)(m({wrapper:{fontSize:g,lineHeight:b,flex:1},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginBottom:"-3px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)"}},h)),x=(0,p.Z)(m({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:g,lineHeight:b},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"}},h,{titleRow:m({},h.titleRow,{marginBottom:"3px"})}));var v=r(95974),E=r(19603),w=r(94646),O=r(95629),C=r(66410),N=r(98448),T=r(81303);const S=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showNonOv:i,totalNonVisibleValues:c}=e;const p=y(),{label:m,description:d}=n,g=(0,u.xdS)(n)?u.q7e.RELATION_ATTRIBUTE:u.q7e.ENTITY_ATTRIBUTE;return s().createElement("div",{className:o()(p.collaborationWrapper,E.U)},s().createElement("div",{className:o()(p.titleRow,p.wrapper)},s().createElement(O.Z,{label:m,className:o()(p.title,a),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:d,className:p.descriptionIcon}),s().createElement(C.Z,{nonOvValues:r,attributeType:n,className:p.ovIcon,nonOvTotal:c}),s().createElement(T.Z,{className:o()(p.attribute,l),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),s().createElement(w.Z,{uri:t.uri,relatedObjectUris:(0,u.wp9)(g,{uri:t.uri}),objectType:g}))};var k=r(48554),A=r(12437);const P=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:u,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g,totalNonVisibleValues:b}=e;const h=x(),[f,y]=(0,i.useState)(t),v=t<a,E=v&&f<a,w=v&&f>=a,{label:S,description:P}=l,Z=r.slice(0,f),j=a-f;return s().createElement("div",{className:h.wrapper},s().createElement("div",{className:h.titleRow},s().createElement(O.Z,{label:S,className:o()(h.title,m),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:P}),s().createElement(C.Z,{nonOvValues:n,attributeType:l,className:h.ovIcon,nonOvTotal:b})),s().createElement("div",{className:h.attributes},Z.map((e=>s().createElement(T.Z,{key:e.uri,className:o()(h.attribute,d),attributeValue:e,attributeType:l,showNonOv:g})))),E&&s().createElement(k.Z,{moreNumber:(0,c.min)(t,j),valueNumber:j,onClick:()=>{r.length<a&&p({parentUri:u,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),y(f+t)}}),w&&s().createElement(A.Z,{onClick:()=>{y(t)}}))};var Z=r(20404);const j=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return s().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>s().createElement(i.Fragment,{key:e},s().createElement(n,{value:e}),t<r.length-1&&", "))))};var I=r(26005);function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){D(e,t,r[t])}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V=(0,p.Z)({insertAttribute:L({width:"fit-content"},u.zXF[u.Y1q.insertAttribute]),deleteAttribute:L({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},u.zXF[u.Y1q.deleteAttribute])}),R=e=>{let{value:t}=e;const r=V(),l=(0,n.useSelector)(a.ZP.selectors.getMetadata),{appearance:o}=(0,i.useContext)(I.m),c=(0,u.YNv)("roles",t,o),p=(0,u.o_F)(c);return s().createElement("span",{className:r[p]},(0,u.xqc)(l,t))},U=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:R})};var B=r(95470),M=r(3185),z=r(72383);const _=e=>{let{value:t}=e;const r=V(),l=(0,n.useSelector)(a.ZP.selectors.getUIPath),o=(0,n.useSelector)(a.ZP.selectors.getEntity),c=(0,i.useContext)(M.u),{appearance:p}=(0,i.useContext)(I.m),{generateTagUrl:m}=(0,i.useContext)(z.v),d=(0,u.YNv)("tags",t,p),g=(0,u.o_F)(d),b=c||o;return s().createElement(B.Z,{className:r[g],href:m({uiPath:l,tag:t,entityUri:b.dataTenant?(0,u.Nsy)(b):b.uri})},t)},F=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:_})},H=e=>{let{values:t,attributeType:r}=e;const n=y(),{label:a}=r;return s().createElement("div",{className:o()(n.titleRow,n.wrapper)},(l=n.titleIcon,r.uri===u.xPW.tags.uri?s().createElement(Z.Z,{className:l}):null),s().createElement(O.Z,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case u.xPW.tags.uri:return s().createElement(F,{className:e,values:t});case u.xPW.roles.uri:return s().createElement(U,{className:e,values:t});default:return s().createElement(T.Z,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(n.attribute));var l};var W=r(13074);const q=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,requestNextPageOfAttributeValues:o}=e;const i=x(),{label:c,description:u}=t;return s().createElement(s().Fragment,null,s().createElement("div",{className:i.titleRow},s().createElement(O.Z,{className:i.title,label:c,"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{className:i.descriptionIcon,description:u})),s().createElement(W.Z,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:l}))},$="oneLine",Y="multiLine",G="imageLine",X="special",K=(0,i.memo)((e=>{let{values:t,attributeType:r,drawLines:n,paging:a={},parentUri:l,max:i=1/0,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g}=e;const b=f(),h=(0,c.partition)(u.OXP);if(!t||!t.length)return null;const[y,x]=h(t),E=g?t:y,w=g?[]:x,O=g?"totalValues":"totalOvValues",C=(0,c.ifElse)((0,c.has)(O),(0,c.prop)(O),(0,c.always)(E.length))(a),N=null!=a&&a.totalValues?a.totalValues-C:w.length,T=1===C&&!(0,u.YkM)(r);return s().createElement(v.Z,{enabled:n,className:o()({[b.paddingWrapperWithLines]:n})},s().createElement("div",{className:o()({[b.paddingWrapper]:!n})},(()=>{switch((0,c.cond)([[u.kqr,(0,c.always)(X)],[u.Or$,(0,c.always)(G)],[(0,c.always)(T),(0,c.always)($)],[c.T,(0,c.always)(Y)]])(r)){case $:return s().createElement(S,{value:E[0],nonVisibleValues:w,totalNonVisibleValues:N,attributeType:r,titleClassName:m,contentClassName:d,showNonOv:g});case Y:return s().createElement(P,{values:E,nonVisibleValues:w,totalVisibleValues:C,totalNonVisibleValues:N,attributeType:r,parentUri:l,max:i,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g});case G:return s().createElement(q,{attributeValues:E,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:p,showNonOv:g});case X:return s().createElement(H,{values:E,attributeType:r})}})()))})),J={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues},Q=(0,n.connect)(((e,t)=>{let{max:r}=t;return{max:r||a.ZP.selectors.getDefaultMaxValues(e)}}),J)(K)},83303:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(71153),s=r.n(i),c=r(88832),u=r(94079),p=r(80931),m=r(19592),d=r(94646),g=r(43600),b=r(96464),h=r(19603);const f=(0,r(79692).Z)({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",paddingTop:"1px",marginLeft:"2px"},spacer:{flex:1}});function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const x=e=>{let{attributeTypesList:t,attributeValue:r,label:l,expanded:o=!1,children:i,showNonOv:x,attributeType:v,LabelRenderer:E,RightSlot:w}=e;const O=f(),C=(0,b.V)(),N=r.uri,[T,S]=(0,n.useState)(!1),{highlightedValuesUris:k=[],highlightedClassName:A}=(0,n.useContext)(g.j);(0,n.useEffect)((()=>{S(o)}),[o]);const P=(t||[]).some((e=>(0,c.kQw)(e))),Z=(0,n.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}({attributes:P?null:r.value,analyticsAttributes:P?r.value:null},(0,c.kqr)(v)?r.value:{})),[r,P,v]),j=(0,c.xdS)(v)?c.q7e.RELATION_ATTRIBUTE:c.q7e.ENTITY_ATTRIBUTE;return a().createElement("div",{className:O.complexContainer},a().createElement("div",{className:s()(O.labelContainer,h.U)},a().createElement(m.Z,{onClick:()=>S((e=>!e)),expanded:T}),E?a().createElement(E,{attributeType:v,attributeValue:r}):a().createElement(a().Fragment,null,a().createElement(u.Typography,{component:"span",variant:"body2",classes:{body2:O.label},className:s()({[A]:k.includes(r.uri),[C.ovFalse]:!(0,c.OXP)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},l),a().createElement("div",{className:O.spacer}),w&&a().createElement(w,{attributeType:v,attributeValue:r}),a().createElement(d.Z,{uri:r.uri,relatedObjectUris:(0,c.wp9)(j,{uri:r.uri}),objectType:j}))),T&&a().createElement(p.Z,{attrTypes:t,entity:Z,drawLines:!0,parentUri:N,showNonOv:x},i))};x.propTypes={children:o().node,label:o().oneOfType([o().string,o().node]),attributeTypesList:o().arrayOf(c.EMD),attributeValue:o().oneOfType([c.dMV,c.Rtp]),expanded:o().bool,showNonOv:o().bool,attributeType:c.EMD,LabelRenderer:o().elementType,RightSlot:o().elementType};const v=x},13074:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(88832),o=r(71153),i=r.n(o),s=r(26005),c=r(27952),u=r(40932),p=r(95117);const m=(0,r(79692).Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,l.m5F)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:l.zXF[l.Y1q.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:l.zXF[l.Y1q.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),d=e=>{let{attributeType:t,attributeValues:r=[],paging:o,parentUri:d,requestNextPageOfAttributeValues:g,showNonOv:b,imageSize:h=p.By}=e;const f=m(h),{appearance:y}=(0,n.useContext)(s.m);return a().createElement(u.Z,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,l.efz)(e),{uri:n}=e,o=(0,l.IFm)(n,y),s=(0,l.o_F)(o);return a().createElement("div",{className:i()(f.image,{[f[s+"Image"]]:s}),key:n,"data-reltio-id":"reltio-attribute-value"},a().createElement(c.Z,{onClick:()=>t(n),className:f[s],src:r,size:{imageWidth:h.imageWidth,imageHeight:h.imageHeight}}))}},imageSize:h,requestNextPageOfAttributeValues:g,paging:o,parentUri:d,showNonOv:b})}},28751:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(94079),o=r(71153),i=r.n(o),s=r(88832),c=r(26005),u=r(83303),p=r(84955),m=r(48771);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(79692).Z)({label:{textDecoration:"none"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.updateAttribute]),insertAttribute:d({width:"fit-content"},s.zXF[s.Y1q.insertAttribute]),deleteAttribute:d({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}const f=e=>{let{attributeValue:t,attributeType:r}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const d=b(),{appearance:g}=(0,n.useContext)(c.m),f=(0,n.useMemo)((()=>{const e=(0,s.IFm)(t.uri,g),n=(0,s.o_F)(e),o=t.label?t.label:(0,s.Kxm)(t,r.dataLabelPattern);return a().createElement(p.m,{className:d.pivotingTooltip,value:t,attributeType:r},a().createElement(l.Box,{component:"span",className:i()(d[n],d.label)},a().createElement(m.Z,{text:(0,s.idV)(o)})))}),[g,d,t,r]);return a().createElement(u.Z,h({label:f,attributeValue:t,attributeTypesList:(0,s.EUG)({},r),attributeType:r},o))};f.propTypes=s.j2V;const y=(0,n.memo)(f)},22544:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(88832),s=r(86051),c=r(52730),u=r(26005),p=r(72383),m=r(83303),d=r(95470),g=r(48771),b=r(96464);function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){f(e,t,r[t])}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y=(0,r(79692).Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:h({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.updateAttribute]),insertAttribute:h({width:"fit-content"},i.zXF[i.Y1q.insertAttribute]),deleteAttribute:h({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.deleteAttribute])})));function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(this,arguments)}const v=(0,n.memo)((e=>{let{attributeValue:t,attributeType:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const h=(0,c.useSelector)(s.ZP.selectors.getMetadata),f=(0,c.useSelector)(s.ZP.selectors.getUIPath),v=y(),E=(0,b.V)(),w=(0,i.bwT)(t),O=(0,n.useMemo)((()=>(0,i.EUG)(h,r)),[r,h]),{appearance:C}=(0,n.useContext)(u.m),{generateEntityUrl:N}=(0,n.useContext)(p.v),T=(0,n.useMemo)((()=>{const e=(0,i.IFm)(t.uri,C),r=(0,i.o_F)(e),n=null!=w&&w.startsWith("changeRequests")?"dcrReview":"profile";return a().createElement(d.Z,{href:(0,i.O27)(C)?N({uiPath:f,uri:w,screen:n}):void 0,className:o()(v[r],{[E.ovFalse]:!(0,i.OXP)(t)})},a().createElement(g.Z,{text:(0,i.idV)(t.label)}),t.relationshipLabel&&a().createElement("span",{className:v.relationshipLabel},a().createElement(g.Z,{text:t.relationshipLabel})))}),[t,C,f,w,v,E.ovFalse,N]);return a().createElement(m.Z,x({attributeTypesList:O,attributeValue:t,label:T,attributeType:r},l))}))},12068:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(88832),o=r(71153),i=r.n(o),s=r(19603),c=r(26005),u=r(94646),p=r(72768),m=r(84955);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(79692).Z)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},l.zXF[l.Y1q.updateAttribute],{"& > a":{color:l.zXF[l.Y1q.updateAttribute].color}}),insertAttribute:d({width:"fit-content"},l.zXF[l.Y1q.insertAttribute],{"& > a":{color:l.zXF[l.Y1q.insertAttribute].color}}),deleteAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},l.zXF[l.Y1q.deleteAttribute],{"& > a":{color:l.zXF[l.Y1q.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"}});var h=r(43600),f=r(96464);const y=e=>{let{className:t,attributeType:r=null,attributeValue:o,inlined:d}=e;const g=b(),y=(0,f.V)(),{highlightedValuesUris:x=[],highlightedClassName:v}=(0,n.useContext)(h.j),{appearance:E}=(0,n.useContext)(c.m),w=(0,l.IFm)(o.uri,E),O=(0,l.o_F)(w),C=a().createElement(p.Z,{value:(0,l.kDl)(o),dataTypeDefinition:(0,l.PFL)(r)}),N=(0,l.xdS)(r)?l.q7e.RELATION_ATTRIBUTE:l.q7e.ENTITY_ATTRIBUTE;return d||O?a().createElement("div",{className:i()(t,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri,className:i()({[g.multilineAttribute]:!d})},a().createElement("span",{className:i()(g[O],{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C))):a().createElement("div",{className:i()(t,g.root,s.U,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri},a().createElement("span",{className:i()(g.attributeValue,{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C)),a().createElement(u.Z,{className:g.commentsContainer,uri:o.uri,relatedObjectUris:(0,l.wp9)(N,{uri:o.uri}),objectType:N}))}},96464:(e,t,r)=>{r.d(t,{V:()=>n});const n=(0,r(79692).Z)((e=>({ovFalse:e.inactive})))},78836:(e,t,r)=>{r.d(t,{S:()=>a});var n=r(88832);const a=[n.xPW.roles.uri,n.xPW.tags.uri]},19603:(e,t,r)=>{r.d(t,{U:()=>n});const n="commentsContainerVisibilityArea"},7142:(e,t,r)=>{r.d(t,{g:()=>i});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l);const i=a().createContext({enabled:!1,queueSizeThreshold:0});i.Provider.propTypes={value:o().shape({enabled:o().bool,queueSizeThreshold:o().number})},i.displayName="AsyncMountContext"},69891:(e,t,r)=>{r.d(t,{P:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="BlockImageGalleryDialogContext"},41564:(e,t,r)=>{r.d(t,{h:()=>s,e:()=>c});var n=r(24328),a=r.n(n),l=r(17554),o=r(49759);const i=()=>{},s=a().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:i,clearCommentState:i,getCommentState:()=>({}),getComment:i,getComments:()=>new Promise(i),getCommentsCount:i,createComment:()=>new Promise(i),editComment:()=>new Promise(i),createReply:()=>new Promise(i),resolveThread:i,reOpenThread:i,clearCurrentComment:i,deleteComment:i,sending:!1,loading:!1,pageToken:null,deleteReply:i,editReply:()=>new Promise(i)});s.displayName="CollaborationContext";const c=e=>{let{collaboration:t,children:r}=e;const n=(0,l.U)();return a().createElement(s.Provider,{value:t},a().createElement(o.s.Provider,{value:n},r))}},31274:(e,t,r)=>{r.d(t,{X:()=>a});var n=r(24328);const a=r.n(n)().createContext({});a.displayName="EntitiesMapContext"},3185:(e,t,r)=>{r.d(t,{u:()=>a});var n=r(24328);const a=r.n(n)().createContext(null);a.displayName="EntityContext"},87451:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(24328);const a=r.n(n)().createContext({showDescription:!1,showNavigateToGraph:!0});a.displayName="FeaturesContext"},43600:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext({highlightedValuesUris:[],highlightedClassName:""});a.displayName="HighlightedValuesContext"},26005:(e,t,r)=>{r.d(t,{m:()=>a});var n=r(24328);const a=r.n(n)().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});a.displayName="HistoryDiffContext"},60995:(e,t,r)=>{r.d(t,{J:()=>a});var n=r(24328);const a=r.n(n)().createContext([])},26481:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="ProfilePerspectiveViewContext"},78101:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="RelatedObjectUrisContext"},94773:(e,t,r)=>{r.d(t,{g4:()=>o,Ie:()=>i,St:()=>s,NY:()=>c,fy:()=>u});var n=r(24328),a=r.n(n),l=r(31276);let o;!function(e){e.Error="Error",e.NewAttribute="NewAttribute"}(o||(o={}));const i=e=>e===o.Error,s=e=>e===o.NewAttribute,c=a().createContext({element:null,type:null,highlightError:l.ZT,highlightAttribute:l.ZT,scrollIntoRef:l.ZT}),u=e=>{let{children:t}=e;const[r,l]=(0,n.useState)(null),i=(0,n.useRef)(null),s=(0,n.useCallback)((e=>{e.current.scrollIntoView({behavior:"smooth",block:"center"}),i&&clearTimeout(i.current),i.current=setTimeout((()=>{l(null)}),2e3)}),[]),u=(0,n.useCallback)((e=>{l({value:e,type:o.Error})}),[]),p=(0,n.useCallback)((e=>{setTimeout((()=>l({value:e,type:o.NewAttribute})),300)}),[]),m=(0,n.useMemo)((()=>({element:null==r?void 0:r.value,highlightError:u,highlightAttribute:p,scrollIntoRef:s,type:null==r?void 0:r.type})),[r,s]);return a().createElement(c.Provider,{value:m},t)}},49759:(e,t,r)=>{r.d(t,{s:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="UsersContext"},96479:(e,t,r)=>{r.d(t,{S:()=>o});var n=r(24328),a=r(7142);let l=0;const o=()=>{const e=(0,n.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,n.useContext)(a.g),[o,i]=(0,n.useState)(!t||t&&l<r);e.current&&l++;const s=(0,n.useRef)();return(0,n.useEffect)((()=>{if(l--,!o)return s.current=setTimeout((()=>{i(!0)}),0),()=>clearTimeout(s.current)}),[]),e.current=!1,o}},11564:(e,t,r)=>{r.d(t,{B:()=>d});var n=r(24328),a=r(50914),l=r(71153),o=r.n(l),i=r(88832),s=r(79692);function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){u(e,t,r[t])}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},m=(0,s.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":c({},p,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":c({},p,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),d=e=>{let{highlightedError:t,isSimple:r=!1}=e;const l=m(),s=(0,n.useRef)(null),{element:c,scrollIntoRef:u}=t||{},p=(0,n.useMemo)((()=>(0,a.propOr)(i.Wkf.ERROR,"severity")(c)),[c]),d=o()({[l.highlightError]:p===i.Wkf.ERROR,[l.highlightWarning]:p===i.Wkf.WARNING,[l.simpleAttribute]:r});return(0,n.useEffect)((()=>{t&&u(s)}),[t,u]),t?{ref:s,errorClassName:d}:{ref:s}}},17554:(e,t,r)=>{r.d(t,{U:()=>s});var n=r(24328),a=r(52730),l=r(88832),o=r(86051);const i=(0,r(36631).Z)(((e,t)=>(0,l.kz_)({tenant:e,servicesPath:t}))),s=()=>{const[e,t]=(0,n.useState)([]),r=(0,a.useSelector)(o.ZP.selectors.getTenant),l=(0,a.useSelector)(o.ZP.selectors.getServicesPath),s=e=>{console.warn("Users error",e),t([])};return(0,n.useEffect)((()=>{i(r,l).then((e=>t(e))).catch(s)}),[r,l]),e}},97989:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(24328),a=r.n(n);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}const o=e=>a().createElement("svg",l({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),a().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"Download_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Download_svg__a"})),a().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})))}}]);
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2125],{49965:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(24328),a=r.n(n),l=r(96479);function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,n.forwardRef)(((r,n)=>(0,l.S)()?a().createElement(e,o({},r,{ref:n})):t&&a().createElement(t,o({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}},19592:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(22385),s=r(98989);const c=(0,r(79692).Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{const t=c(),{expanded:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return a().createElement(i.Z,u({icon:s.Z,size:"XXS",disableRipple:!0,iconClassName:o()(t.expandIcon,{[t.expanded]:r}),className:o()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},l))}},92778:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(15223),s=r(94079);const c=(0,r(79692).Z)({toolbar:{minHeight:"48px",padding:"8px 24px",lineHeight:"28px"},title:{fontSize:"18px",fontWeight:"normal",lineHeight:"inherit",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{title:t="",children:r=null,classes:n={}}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","children","classes"]);const p=c();return a().createElement(i.Z,u({className:n.root,classes:{root:p.toolbar}},l),a().createElement(s.Typography,{className:n.title,classes:{root:p.title},variant:"h6"},o().text(t)),r)}},9371:(e,t,r)=>{r.d(t,{J:()=>Y});var n=r(24328),a=r.n(n),l=r(94079),o=r(52730),i=r(2507),s=r.n(i),c=r(43054),u=r(86051),p=r(55847),m=r(8818),d=r(71153),g=r.n(d),b=r(50914),h=r(88832),f=r(31274),y=r(31039);const x=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},v=e=>`${s().date(e,"LT")} ${s().date(e,"LL")}`,E=e=>`comment/${e.commentId}`,w=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,O=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r};var C=r(79692);const N=(0,C.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const S=e=>{let{comment:t,className:r}=e;const i=N(),c=(0,o.useSelector)(u.ZP.selectors.getEntity),p=(0,o.useSelector)(u.ZP.selectors.getMetadata),m=(0,n.useContext)(f.X);return a().createElement(l.Box,{className:r},(()=>{switch(t.objectType){case h.q7e.ENTITY_ATTRIBUTE:{const e=(0,h.AFK)(t.objectId,c.type),r=(0,h.zeJ)(p,e);return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected attribute:")),a().createElement(l.Typography,{className:i.label},null==r?void 0:r.label))}case h.q7e.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,b.startsWith)("configuration/relationTypes")),r=(0,h.AFK)(t.objectId,e),n=(0,h.zeJ)(p,r);return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected attribute:")),a().createElement(l.Typography,{className:i.label},null==n?void 0:n.label))}case h.q7e.ENTITY:return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected profile:")),a().createElement(y.Z,{className:g()(i.label,i.link),value:(0,h.wwR)(c)},(0,h.idV)(c.label)));case h.q7e.RELATION:{const e=x(t,c.uri),r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T(e,t,r[t])}))}return e}({},m[e]||{},{uri:e});return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected relation:")),a().createElement(l.Typography,{className:i.label},a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(c)},(0,h.idV)(c.label)),e&&a().createElement(a().Fragment,null,` ${s().text("to")} `,a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(r)},r.label?(0,h.idV)(r.label):(0,h.BTI)(r)))))}case h.q7e.POTENTIAL_MATCH:{var e;const r=x(t,c.uri),n={uri:r,label:null===(e=m[r])||void 0===e?void 0:e.label};return a().createElement(a().Fragment,null,a().createElement(l.Typography,{className:i.title},s().text("Selected potential match:")),a().createElement(l.Typography,{className:i.label},a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(c)},(0,h.idV)(c.label)),r&&a().createElement(a().Fragment,null,` ${s().text("and")} `,a().createElement(y.Z,{className:i.link,value:(0,h.wwR)(n)},n.label?(0,h.idV)(n.label):(0,h.BTI)(n)))))}default:return null}})())};var k=r(49759);const A=(0,C.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),P=e=>{let{comment:t,className:r}=e;const o=A(),i=(0,n.useContext)(k.s);return a().createElement(l.Typography,{className:g()(o.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let l="",o=!1;for(let i=0;i<=e.length;i++){const s=e[i],c=e[i+1],u=i===e.length-1;l+=s,s===n&&0===i&&(o=!0),o&&t.includes(l.slice(n.length))&&(o=!1,a.push(r(l)),l=""),c===n&&(o=!0,a.push(l),l=""),u&&a.push(l)}return a}(t.content,t.namedUsers,(e=>{const t=i.find((t=>t.username===e.slice(1)));return t?a().createElement(l.Link,{href:`mailto:${t.email}`},e):e})).map(((e,t)=>a().createElement(n.Fragment,{key:t},e))))};var Z=r(43434);const j=(0,C.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function I(){return I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},I.apply(this,arguments)}const L=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const l=j();return a().createElement(Z.Z,I({},n,{className:g()(l.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var D=r(41564),V=r(2271);const R=(0,C.Z)((e=>({root:{width:"100%",backgroundColor:"#fff",fontFamily:"Roboto","&__control":{fontSize:"13px"},"&__highlighter":{padding:"10px 22px",border:"1px solid transparent !important"},"&__input":{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},"&__suggestions":{padding:"8px 0",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},"&__suggestions__list":{maxHeight:"200px",overflowY:"scroll"},"&__suggestions__item":{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function U(){return U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},U.apply(this,arguments)}const B=e=>{let{onChange:t,className:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className"]);const o=R(),i=(0,n.useContext)(k.s);return a().createElement(V.r,U({},l,{onChange:(e,r,n,a)=>{t(r,n,(0,b.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:g()(o.root,r)}),a().createElement(V.p,{trigger:"+",data:i.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention}))},M=(0,C.Z)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{maxWidth:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),z=e=>{switch(e){case"open":return s().text("Reply...");case"resolved":return s().text("Adding a comment will re-open this");default:return""}},_=e=>{let{inputRef:t,className:r,uri:i,relatedObjectUris:c,objectType:p,popperRef:m,comment:d,reply:h,isEditingComment:f,isEditingReply:y,onCancel:x}=e;const v=f||y,C=M({isEditing:v}),[N,T]=(0,n.useState)(!1),S=(0,o.useSelector)(u.ZP.selectors.getUserName),{createReply:k,createComment:A,sending:P,editComment:Z,editReply:j,getCommentState:I,updateCommentState:V,clearCommentState:R}=(0,n.useContext)(D.h),U=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,b.isNil)(t)?"comment/new":n?E(t):a?w(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:d,reply:h,isEditingComment:f,isEditingReply:y}),_=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const l=n?t:a?r:null,{content:o="",namedUsers:i=[]}=l||{};return{value:O(o,i),plainTextValue:o,mentions:i}})({comment:d,reply:h,isEditingComment:f,isEditingReply:y}),{value:F=_.value,plainTextValue:H=_.plainTextValue,mentions:W=_.mentions}=I(i,U),q=""!==F.trim(),$=N||q,Y=null==d?void 0:d.status,G=()=>{null==x||x(),R(i,U)};(0,n.useEffect)((()=>{m&&m.current.update()}),[m,$]);const X=v?"small":"medium";return a().createElement(l.Box,{className:g()(C.root,r)},a().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,b.cond)([[(0,b.always)(!d),()=>A({content:H,namedUsers:W,objectType:p,uri:i,relatedObjectUris:c})],[(0,b.always)(f),()=>Z({content:H,namedUsers:W,commentId:d.commentId,objectType:p,replies:d.replies,relatedObjectUris:c,uri:i})],[(0,b.always)(y),()=>j({content:H,namedUsers:W,commentId:d.commentId,replyId:h.replyId})],[b.T,()=>k({content:H,namedUsers:W,commentId:d.commentId,action:"open"===d.status?"none":"reopen",uri:i})]])().then(G).catch(console.log)),className:C.form},a().createElement(l.Box,{className:C.main},!v&&a().createElement(L,{classes:{root:C.avatar}},S),a().createElement(B,{className:C.textField,disabled:P,onChange:(e,t,r)=>V(i,U,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:F,onFocus:()=>T(!0),onBlur:()=>T(!1),placeholder:z(Y)})),$&&a().createElement(l.Box,{className:C.buttons},a().createElement(l.Button,{className:C.button,variant:"contained",color:"primary",disabled:!q||P,type:"submit",size:X},((e,t,r)=>t||r?s().text("Edit"):"open"===e||"resolved"===e?s().text("Reply"):s().text("Comment"))(Y,f,y)),a().createElement(l.Button,{disabled:P,onClick:()=>G(),className:C.button,variant:"outlined",color:"primary",size:X},s().text("Cancel")))))},F=(0,C.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),H=e=>{let{onReply:t,className:r,uri:i,comment:d,relatedObjectUris:g,objectType:b}=e;const h=F(),f=(0,n.useRef)(),y=(0,o.useSelector)(u.ZP.selectors.getUserName),{commentId:x,createdBy:w,createdTime:O,status:C}=d,N="resolved"===C,T=w===y,{resolveThread:k,reOpenThread:A,sending:Z,deleteComment:j,updateCommentState:I,getCommentState:V}=(0,n.useContext)(D.h),R=E(d),{isEditing:U}=V(i,R),B=(0,n.useCallback)((e=>I(i,R,{isEditing:e})),[R,I,i]);(0,n.useEffect)((()=>{U&&f.current.focus()}),[U]);const M=(0,n.useMemo)((()=>N?[{text:s().text("Delete"),onClick:()=>j({uri:i,commentId:x})}]:[{text:s().text("Edit"),onClick:()=>B(!0)},{text:s().text("Delete"),onClick:()=>j({uri:i,commentId:x})}]),[x,j,N,B,i]),z=a().createElement(_,{inputRef:f,uri:i,relatedObjectUris:g,objectType:b,onCancel:()=>B(!1),isEditingComment:U,comment:d});return a().createElement(l.Box,{className:r},a().createElement(l.Box,{className:h.header},a().createElement(L,{classes:{root:h.avatar}},w),a().createElement(l.Box,{width:"100%"},a().createElement(l.Typography,{className:h.username},w)),a().createElement(l.Typography,{className:h.createdAt},v(O)),T&&a().createElement(p.Z,{buttonComponent:m.k,buttonProps:{icon:c.Z,tooltipTitle:s().text("Open menu")},popoverProps:{PopoverClasses:{root:h.dropdownMenu}},menuItems:M,menuId:"collaboration-comment-menu"})),a().createElement(l.Box,{className:h.body},a().createElement(S,{comment:d,className:h.commentTarget}),U?z:a().createElement(P,{comment:d,className:h.message}),a().createElement(l.Box,{className:h.buttons},a().createElement(l.Link,{className:h.button,onClick:t,component:"button"},s().text("Reply")),!N&&a().createElement(l.Link,{disabled:Z,className:h.button,onClick:()=>{k({commentId:x,uri:i})},component:"button"},s().text("Resolve")),N&&a().createElement(l.Link,{disabled:Z,className:h.button,onClick:()=>{A({commentId:x,uri:i})},component:"button"},s().text("Re-open")))))},W=(0,C.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),q=e=>{let{className:t,reply:r,uri:i,comment:d,popperRef:b}=e;const h=(0,n.useRef)(),{createdBy:f,action:y,createdTime:x}=r,E=f===(0,o.useSelector)(u.ZP.selectors.getUserName)&&"resolved"!==d.status,{deleteReply:O,updateCommentState:C,getCommentState:N}=(0,n.useContext)(D.h),T=w(d,r),{isEditing:S}=N(i,T),k=(0,n.useCallback)((e=>C(i,T,{isEditing:e})),[T,C,i]);(0,n.useEffect)((()=>{S&&h.current.focus()}),[S]);const A=W(),Z=(0,n.useMemo)((()=>[{text:s().text("Edit"),onClick:()=>k(!0)},{text:s().text("Delete"),onClick:()=>O({uri:i,commentId:d.commentId,reply:r})}]),[O,i,d.commentId,r,k]),j=a().createElement(_,{inputRef:h,popperRef:b,uri:i,onCancel:()=>k(!1),isEditingReply:S,reply:r,comment:d});return a().createElement(l.Box,{className:g()(A.root,t)},a().createElement(L,{classes:{root:A.avatar}},f),a().createElement(l.Box,{flexGrow:1},a().createElement(l.Box,{className:A.header},a().createElement(l.Typography,{className:A.username},f),"resolve"===y&&a().createElement(l.Typography,{className:A.marked},s().text("Marked as resolved")),"reopen"===y&&a().createElement(l.Typography,{className:A.marked},s().text("Re-opened"))),"resolve"!==y&&(S?j:a().createElement(P,{className:A.message,comment:r})),a().createElement(l.Typography,{className:A.createdAt},v(x))),E&&a().createElement(p.Z,{buttonComponent:m.k,buttonProps:{icon:c.Z,tooltipTitle:s().text("Open menu")},menuItems:Z,menuId:"collaboration-comment-menu"}))},$=(0,C.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),Y=(0,n.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:o,classes:i,popperRef:s,messagesRef:c,comment:u}=e;const p=(0,n.useRef)(),m=$({classes:i}),d=a().createElement(_,{className:m.sendMessageArea,inputRef:p,popperRef:s,uri:t,relatedObjectUris:r,objectType:o,comment:u});return a().createElement(l.Box,{className:m.root},u&&a().createElement(a().Fragment,null,a().createElement("div",{className:m.messages,ref:c},a().createElement(H,{comment:u,uri:t,onReply:()=>{p.current.focus()},className:m.comment,relatedObjectUris:r,objectType:o}),a().createElement(l.Box,{className:m.replies},u.replies.map((e=>a().createElement(q,{key:e.replyId,className:m.repliedComment,reply:e,uri:t,comment:u}))))),d),!u&&d)}))},94646:(e,t,r)=>{r.d(t,{Z:()=>P});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(79692),s=r(19603);const c=(0,i.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${s.U}:hover &`]:{visibility:"visible"}},showAlways:{}})));var u=r(20562),p=r(41564),m=r(78101),d=r(2507),g=r.n(d),b=r(94079);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}const f=e=>a().createElement("svg",h({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),y=(0,i.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}},childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}))),x=a().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const l=y();return a().createElement(b.Tooltip,{title:g().text("Show comment")},a().createElement("div",{ref:t,className:l.root,onClick:n},a().createElement(f,{className:l.icon}),a().createElement("div",{className:l.childrenWrapper},r)))}));x.displayName="CommentButton";const v=x;function E(){return E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E.apply(this,arguments)}const w=e=>a().createElement("svg",E({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),O=e=>{let{className:t,onClick:r}=e;const n=y();return a().createElement(b.Tooltip,{title:g().text("Add comment")},a().createElement("div",{className:o()(n.root,t),onClick:r},a().createElement(w,{className:n.icon})))};var C=r(27291),N=r(9371),T=r(8818),S=r(59601);const k=(0,i.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),A=e=>{let{uri:t,relatedObjectUris:r,objectType:l,anchorEl:o,onClose:i,open:s,comment:c}=e;const[u,m]=(0,n.useState)(0),d=k({scrollWidth:u,hasScroll:0!==u}),h=(0,n.useRef)(null),{resolveThread:f,loading:y,sending:x}=(0,n.useContext)(p.h),v=1+(null==c?void 0:c.replies.length);return a().createElement(S.Z,{popperRef:h,anchorEl:o,open:s,placement:"right-start",onClose:i,className:d.popper},a().createElement(b.Box,{className:d.header},a().createElement(b.Box,{className:d.headerInfo},a().createElement(b.Typography,{className:d.title},g().text("Comments")),c&&!y&&a().createElement(b.Typography,{className:d.counter},g().number(v)," ",1===v?g().text("item"):g().text("items"))),c&&!y&&a().createElement(T.k,{className:d.resolveButton,size:"S",onClick:()=>{f({commentId:c.commentId,uri:t})},disabled:x,showForDisabled:!0,tooltipTitle:g().text("Resolve"),icon:C.Z,color:"primary"})),!y&&a().createElement(N.J,{popperRef:h,messagesRef:e=>{e&&m(e.offsetWidth-e.clientWidth)},classes:{root:d.collaborationItem,replies:d.replies,sendMessageArea:d.sendMessageArea,messages:d.messages,comment:d.comment},uri:t,relatedObjectUris:r,objectType:l,comment:c}))},P=e=>{let{className:t,uri:r,objectType:l,relatedObjectUris:i,onChangePopupVisibility:s,allowOnlyOneComment:d=!1,showAlways:g=!1}=e;const b=c(),[h,f]=(0,n.useState)(null),[y,x]=(0,n.useState)(!1),E=y&&Boolean(h),{currentComment:w,commentsMap:C,getComment:N,clearCurrentComment:T,objectTypes:S}=(0,n.useContext)(p.h),k=!!C&&(!S||S.includes(l)),P=((null==C?void 0:C[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),Z=!d||d&&0===P.length,j=null===w&&E;(0,u.D)((()=>{s&&s(E)}),[E]);const I=(0,n.useContext)(m.A),L=(0,n.useMemo)((()=>I?[...i,...I]:i),[I,i]);return k&&a().createElement("div",{className:o()(b.root,t)},Z&&a().createElement(O,{className:o()(b.addButton,{[b.showAlways]:g||j}),onClick:e=>{f(e.currentTarget),x(!0)}}),P.map((e=>{let{replies:t,commentId:r}=e;return a().createElement(v,{ref:r===(null==w?void 0:w.commentId)?f:null,key:r,onClick:()=>(e=>{N(e),x(!0)})(r)},1+t)})),a().createElement(A,{anchorEl:h,open:E,onClose:()=>{f(null),T(),x(!1)},uri:r,relatedObjectUris:L,objectType:l,comment:w}))}},6521:(e,t,r)=>{r.d(t,{l:()=>s});var n=r(13896),a=r(58651),l=r(24328),o=r.n(l);const i=(0,n.createDndContext)(a.default),s=e=>{const t=(e=>{const t=(0,l.useRef)(i);return e.children?o().createElement(n.DndProvider,{manager:t.current.dragDropManager},e.children):null})(e);return o().createElement(o().Fragment,null,t)}},55847:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(50914),s=r(94079),c=r(48348),u=r(20562),p=r(83348),m=r(79692),d=r(41128);const g=(0,m.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,d.U1)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,d.U1)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"},menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),b=(0,p.Z)(s.MenuItem),h=(0,n.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=i.identity}=e;const l=g(),{disabled:o,text:c,tooltip:u,onClick:p,id:m="",selectable:d,selected:h}=r;return a().createElement(b,{tooltipTitle:u,showForDisabled:!0,classes:{root:l.menuItem},onClick:e=>{n(e),p(e)},disabled:o,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${m}`},d&&a().createElement(s.Checkbox,{checked:h,color:"primary"}),a().createElement(s.Typography,{classes:{root:l.menuText}},c))}));h.displayName="MenuItemRenderer";const f=h;function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(this,arguments)}function x(e){let{className:t,menuId:r,buttonComponent:l=s.Button,buttonContent:p,menuItems:m=[],buttonProps:d={},popoverProps:b={},onMenuOpen:h=i.identity,onMenuClose:x=i.identity,MenuItemRenderer:v=f}=e;const E=l,w=g(),O=(0,n.useRef)(),[C,N]=(0,n.useState)(!1);(0,u.D)((()=>{C?h():x()}),[C]);const T=(0,n.useCallback)((e=>{null==e||e.stopPropagation(),N((e=>!e))}),[]);return a().createElement(a().Fragment,null,a().createElement(E,y({ref:O,className:o()(w.buttonRoot,{[w.selected]:C},t),onClick:T,"aria-pressed":C,"aria-controls":C?r:void 0,"aria-haspopup":"true"},d),p),a().createElement(c.Z,y({id:r,variant:"menu",open:C,autoFocus:!1,classes:{paper:w.paper},anchorEl:O.current,onClose:T,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:C}},b),m.map(((e,t)=>a().createElement(v,{item:e,key:t,onMenuClose:T})))))}x.displayName="DropDownMenuButton";const v=x},76134:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(94079),s=r(73086);const c=e=>{let{className:t,message:r}=e;const n=(0,s.y)();return r?a().createElement(i.Typography,{variant:"caption",className:o()(n.caption,t)},r):null}},26579:(e,t,r)=>{r.d(t,{Z:()=>m});var n=r(71153),a=r.n(n),l=r(76134),o=r(42494),i=r(94079),s=r(24328),c=r.n(s),u=r(73086);function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(this,arguments)}const m=(0,s.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:s}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const d=(0,u.y)(),g=!!t;return c().createElement(o.Z,p({className:a()(d.wrapper,n,null==s?void 0:s.root),error:!0},m),r,g&&c().createElement(i.FormHelperText,{className:a()(d.helperText,null==s?void 0:s.helperText)},c().createElement(l.Z,{message:t})))}))},73086:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(79692).Z)((e=>({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"},caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}})))},27952:(e,t,r)=>{r.d(t,{f:()=>h,Z:()=>f});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(80079);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}const c=e=>a().createElement("svg",s({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("path",{d:"M0 0h24v24H0z"}),a().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"})));var u=r(88832);const p=(0,r(79692).Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},m.apply(this,arguments)}const d="loading",g="loaded",b="error",h={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},f=(0,n.memo)((e=>{const{src:t,className:r,containerClassName:l,size:s=h.SMALL,overlay:f=null}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),x=s||h.SMALL,v=p(x),[E,w]=(0,n.useState)(d);(0,n.useEffect)((()=>{w(d)}),[t]);const O=E===d,C=E===g;return E===b?a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(i.Z,{className:v.defaultImage})):a().createElement("div",{className:o()(v.root,l)},!(0,u.O27)(t)&&a().createElement("img",m({src:t,className:o()(v.image,r,{[v.hideImage]:O}),onLoad:()=>{w(g)},onError:()=>{w(b)},alt:"image"},y)),O&&a().createElement("div",m({className:o()(v.defaultContainer,v.image,r)},y),a().createElement(c,{className:v.defaultImage})),C&&f)}))},97193:(e,t,r)=>{r.d(t,{Z:()=>w});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(50914),s=r(71153),c=r.n(s),u=r(94079),p=r(43054),m=r(22385),d=r(55847),g=r(52669),b=r(81556),h=r(79692);const f=(0,h.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),y=e=>{let{checked:t,className:r,onClick:n}=e;const l=f(),o=t?b.Z:g.Z;return a().createElement(o,{className:c()(l.root,r),onClick:n})};var x=r(97989),v=r(31276);const E=(0,h.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),w=(0,n.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:l=!1,selectionMode:s=!1,onDeselect:g=v.ZT,onSelect:b=v.ZT,onShareLink:h,onSetAsDefault:f,onDelete:w,onDownload:O=v.ZT,onClick:C}=e,N=E(),[T,S]=(0,n.useState)(!1),k=(0,n.useMemo)((()=>[{text:o().text("Share link"),onClick:h},{text:o().text("Set as default"),onClick:f},{text:o().text("Delete"),onClick:w}].filter((0,i.prop)("onClick"))),[h,f,w]),A=e=>()=>(0,i.ifElse)((0,i.equals)(!0),g,b)(e),P=r&&(l||T||s),Z=!s&&!l&&T,j=r&&l;return a().createElement("div",{className:c()(N.overlay,{[N.selected]:l,[N.selectionMode]:s}),onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),onClick:s?A(l):e=>{e.currentTarget===e.target&&C()}},P&&a().createElement(y,{className:N.checkedIcon,checked:l,onClick:A(l)}),Z&&a().createElement("div",{className:N.actions},a().createElement(m.Z,{onClick:O,className:N.actionButton,icon:x.Z}),a().createElement(d.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:m.Z,buttonProps:{icon:p.Z,className:c()(N.actionButton,N.dropDownMenuButton)},menuItems:k})),j&&a().createElement(u.Button,{className:N.button,variant:"outlined",onClick:g},o().text("Deselect")))}))},81853:(e,t,r)=>{r.d(t,{C:()=>h,A:()=>b});var n=r(24328),a=r.n(n),l=r(2507),o=r.n(l),i=r(94079),s=r(87685),c=r(73115);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>a().createElement("svg",u({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),a().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},a().createElement("mask",{id:"Details_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Details_svg__a"})),a().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"})));var m=r(8818),d=r(83401);const g=(0,r(79692).Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let b;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(b||(b={}));const h=e=>{let{open:t,mode:r,children:l,header:u,onClose:h,onChangeMode:f}=e;const y=g(),x=(0,n.useMemo)((()=>[{id:b.GALLERY_MODE,title:o().text("Gallery"),Icon:c.Z},{id:b.DETAILS_MODE,title:o().text("Details"),Icon:p}]),[]);return a().createElement(i.Dialog,{classes:{paper:y.paper},open:t,BackdropProps:{className:y.backdrop},fullScreen:!0},a().createElement(i.AppBar,{classes:{colorPrimary:y.appBar}},a().createElement(i.Toolbar,{className:y.toolbar},a().createElement(i.Box,{className:y.headerLeft},a().createElement(m.k,{tooltipTitle:o().text("Close"),onClick:h,className:y.closeButton,iconClassName:y.closeIcon,icon:s.default}),null==u?void 0:u.left),a().createElement(i.Box,{className:y.headerCenter},a().createElement(d.Z,{modes:x,modeId:r,onChange:f,className:y.modeSwitcher})),a().createElement(i.Box,{className:y.headerRight},null==u?void 0:u.right))),a().createElement(i.DialogContent,{className:y.content},l))}},95470:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(24328),a=r.n(n),l=r(38529),o=r(71153),i=r.n(o);const s=(0,r(79692).Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=e=>{const t=s(),r=(0,l.useInRouterContext)(),{href:n,className:o}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),p=i()(t.link,o);return r&&n?a().createElement(l.Link,c({to:n.replace(window.location.origin,""),className:p},u)):a().createElement("a",c({href:n,className:p},u))}},59601:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(94079),s=r(66130);const c=(0,r(79692).Z)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{children:t,className:r,classes:l,transition:p}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const d=c(),g=p?i.Fade:a().Fragment,[b,h]=(0,n.useState)(null);return a().createElement(s.Z,u({className:o()(d.popper,r),modifiers:{preventOverflow:{boundariesElement:"viewport",padding:14},arrow:{enabled:!0,element:b}},transition:p,excludeAnchorFromBackdrop:!1},m),(e=>{let{TransitionProps:r}=e;return a().createElement(g,r,a().createElement(i.Paper,{className:o()(d.paper,null==l?void 0:l.root)},a().createElement("span",{className:o()(d.arrow,null==l?void 0:l.arrow),ref:h}),t))}))}},95629:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(55299),s=r(94079);const c=(0,r(79692).Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"15px"}});function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>{let{label:t,isRequired:r,className:n}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const p=c();return a().createElement(s.Typography,u({className:o()(p.label,n),component:"span"},l),t,r&&a().createElement(i.Z,null))}},95974:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l);const i="1px solid #AFD4E9",s=(0,r(79692).Z)({decorator:{marginLeft:8,borderLeft:i,"&:last-child":{borderLeft:"none","&:before":{borderLeft:i}},"&:before":{top:0,height:14,width:5,borderBottom:i,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),c=e=>{let{className:t,children:r,plain:n=!1,enabled:l=!1}=e;const i=s();return l?a().createElement("div",{className:o()(i.decorator,{[i.plain]:n},t)},a().createElement("div",{className:i.wrapper},r)):a().createElement(a().Fragment,null,r)}},98448:(e,t,r)=>{r.d(t,{Z:()=>g});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(94079),s=r(87451),c=r(83348);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}const p=e=>a().createElement("svg",u({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),m=(0,r(79692).Z)((()=>({container:{height:"15px",backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"}},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px"},icon:{width:"12px",height:"12px",marginRight:0}}))),d=(0,c.Z)(i.Chip),g=e=>{let{className:t,description:r}=e;const{showDescription:l}=(0,n.useContext)(s.Y),i=m();return r&&l?a().createElement(d,{tooltipTitle:r,tooltipPlacement:"bottom",icon:a().createElement(p,null),classes:{root:o()(i.container,t),label:i.label,icon:i.icon}}):null}},40932:(e,t,r)=>{r.d(t,{Z:()=>fe});var n=r(24328),a=r.n(n),l=r(52730),o=r(44443),i=r(94079),s=r(86051),c=r(88832),u=r(69891),p=r(50914),m=r(45203),d=r(15762),g=r(71153),b=r.n(g),h=r(27952),f=r(22385),y=r(79692);const x=(0,y.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}}))),v=(0,y.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),E=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:l}=e;const o=v(),s=(0,n.useRef)(null);return(0,n.useEffect)((()=>{if(null!=s&&s.current){const e=s.current.scrollLeft,t=s.current.offsetWidth+e,r=96*l+16*l+12;t<r?s.current.scroll&&(r>t+96+16?s.current.scroll(r,0):s.current.scroll(112+e,0)):e+96>r&&s.current.scroll&&s.current.scroll(r-96,0)}}),[l,s]),a().createElement("div",{ref:s,className:o.thumbnails},a().createElement(i.Grid,{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:o.gridContainer},t.map(((e,t)=>{let{uri:n,value:s}=e;return a().createElement(i.Grid,{item:!0,key:n},a().createElement(h.Z,{onClick:()=>r(t),className:b()(o.thumb,{[o.inactiveThumb]:l!==t}),src:(0,c.efz)({value:s})}))}))))},w=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}=e;const o=x(),i=r[n],s=(0,c.QXK)(i);return a().createElement("div",{className:b()(o.root,t)},a().createElement("div",{className:o.main},n>0&&a().createElement(f.Z,{icon:m.Z,className:b()(o.arrowButton,o.arrowButtonPrev),onClick:()=>{l(n-1)},size:"XL"}),a().createElement(h.Z,{containerClassName:o.mainImageContainer,className:o.mainImage,size:s&&h.f.OVERRIDE,src:s}),n!==r.length-1&&a().createElement(f.Z,{icon:d.Z,className:b()(o.arrowButton,o.arrowButtonNext),onClick:()=>{l(n+1)},size:"XL"})),a().createElement(E,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:l}))};var O=r(2507),C=r.n(O),N=r(33016),T=r(36138),S=r(90473),k=r(95038),A=r.n(k);const P={get CreationTime(){return C().text("Creation Time")},get CreationDate(){return C().text("Creation Date")},get Dimensions(){return C().text("Dimensions")},get MimeType(){return C().text("Mime Type")},get Size(){return C().text("Size")},get Url(){return C().text("Full image URL (S3)")},get UrlPreview(){return C().text("Preview image URL (S3)")},get UrlThumbnail(){return C().text("Small image URL (S3)")},get CdnUrl(){return C().text("Full image URL (CDN)")},get CdnUrlPreview(){return C().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return C().text("Small image URL (CDN)")}},Z=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,p.path)([t,0,"value"],e):"CreationDate"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?A()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,p.path)(["CreationTimestamp",0,"value"],e)?A()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,p.path)(["Height",0,"value"],e)&&(0,p.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${C().text("pixels")}`:"Size"===t&&(0,p.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},I=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,l=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?l:l.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},L=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=j(t.attributes);return I(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},D=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),V=(0,y.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},canAdd:{}}),R=e=>{let{attributeType:t,onAddAttributes:r,uri:l}=e;const o=V(),s=j(t.attributes),c=Boolean(r);return a().createElement(i.Box,null,a().createElement(i.Typography,{className:b()(o.title,{[o.canAdd]:c})},C().text("Meta info")),c&&a().createElement(n.Fragment,null,a().createElement(S.Z,{label:C().text("Attributes"),data:s,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:l}))))}}),a().createElement(i.Divider,{className:o.divider})))};var U=r(8683);const B=(0,y.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),M=e=>{let{title:t,content:r,isLink:n,children:l}=e;const o=B();return a().createElement("div",{className:o.root},a().createElement("span",{className:o.title},t),n?a().createElement("a",{className:o.link,href:r},C().text("link")):a().createElement("span",{className:o.content},r||l))},z=(0,y.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),_=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const o=z(),c=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),u=(p=t,m=n,I(Object.keys(P),m).map((e=>Z(p,e)?{title:P[e],value:Z(p,e),isLink:D(e)}:null)).filter(Boolean));var p,m;const d=L(t,r,n);return a().createElement(i.Box,{className:o.root},u.map((e=>{let{title:t,value:r,isLink:n}=e;return a().createElement(M,{key:t,isLink:n,title:t,content:r})})),c&&d.map((e=>{let{attrType:r,values:n}=e;return a().createElement(U.Z,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:o.title,contentClassName:o.content,parentUri:t.uri})})))};var F=r(72045);const H=(0,y.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),W=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:l,onDeleteAttribute:o,onChangeAttribute:s,onAddAttributes:u,onCancel:p,onApply:m,mode:d}=e;const g=H(),b=L(n,t,r),h=0!==b.length||0===b.length&&l;return a().createElement(i.Box,{className:g.root},a().createElement(i.Box,{className:g.form},b.map((e=>{let{attrType:t,values:r}=e;return a().createElement(F.ZP,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,c.ZiX)(n.uri),mode:d,drawLines:!1,onDeleteAttribute:o,onChangeAttribute:s,onAddAttributes:u})}))),h&&a().createElement(a().Fragment,null,a().createElement(i.Divider,{className:g.divider}),a().createElement(i.Box,{className:g.actions},a().createElement(i.Button,{disabled:!l,onClick:p,className:g.cancelButton},C().text("Cancel")),a().createElement(i.Button,{disabled:!l,onClick:m,color:"primary"},C().text("Apply")))))};var q=r(47898);const $={palette:{type:"dark",primary:c.rSc.palette.primary,secondary:c.rSc.palette.secondary}},Y=(0,N.Z)($),G=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:o}=e;const{addAttributes:u,changeAttribute:m,deleteAttribute:d,clearLocalChanges:g,applyLocalChanges:b,attributeValue:h,hasChanges:f}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const a=(0,l.useDispatch)(),o=(0,n.useContext)(q.m),[i,u]=(0,n.useState)(t);(0,n.useEffect)((()=>{u(t)}),[t]);const m=!(0,p.equals)(i,t),d=(0,n.useCallback)((e=>{u((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,c.tPT)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),g=(0,n.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;u((e=>(0,c.ww$)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),b=(0,n.useCallback)((e=>{let{attributeType:t,uri:r}=e;u((e=>(0,c.d$I)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:d,changeAttribute:g,deleteAttribute:b,clearLocalChanges:(0,n.useCallback)((()=>{u(t)}),[t]),applyLocalChanges:(0,n.useCallback)((()=>{a(s.N5.actions.modifyAttribute({value:i,attributeType:r,uri:i.uri,viewId:o}))}),[i,r,o,a]),attributeValue:i,hasChanges:m}})({attributeType:r,initialAttributeValue:o}),y=(0,l.useSelector)(s.ZP.selectors.getMode),x=(0,l.useSelector)(s.ZP.selectors.getIsEditableMode);return a().createElement(T.ThemeProvider,{theme:Y},a().createElement(i.Box,null,a().createElement(R,{attributeType:r,uri:null==h?void 0:h.uri,onAddAttributes:x?u:void 0}),a().createElement(_,{attributeType:r,attributeValue:h,imageAttributeFieldsOrder:t}),x&&a().createElement(W,{mode:y,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:h,hasChanges:f,onDeleteAttribute:d,onChangeAttribute:m,onAddAttributes:u,onCancel:g,onApply:b})))},X=(0,y.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),K=e=>{let{className:t,attributeValue:r,handleSetAsDefault:o,attributeType:c}=e;const u=X(),p=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},m=(0,l.useSelector)((e=>s.ZP.selectors.getModifiedEntity(e,null==p?void 0:p.uri)))||{},d=(0,l.useSelector)(s.ZP.selectors.getIsViewMode)?p:m,g=(0,l.useSelector)(s.ZP.selectors.getImageAttributesFieldsOrder)||{},h=g[null==p?void 0:p.type]||(null==g?void 0:g.default)||{},[f,y]=(0,n.useState)(!1);(0,n.useEffect)((()=>{y((null==d?void 0:d.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,d]);const x=(0,n.useCallback)((()=>{o(r.uri)}),[null==r?void 0:r.uri]);return a().createElement(i.Box,{className:b()(u.root,t)},a().createElement(i.Box,{className:u.header},a().createElement(i.Typography,{className:u.headerTitle},C().text("Details"))),a().createElement(i.Box,{className:u.bodyWrapper},a().createElement(i.Box,{className:u.body},a().createElement(i.FormControlLabel,{classes:{root:u.formControlLabel,label:u.checkboxLabel},control:a().createElement(i.Checkbox,{className:u.checkbox,checked:f,onChange:x,color:"default"}),label:C().text("Set as default")}),a().createElement(G,{attributeType:c,imageAttributeFieldsOrder:h,attributeValue:r}))))},J=(0,y.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),Q=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:l,handleSetAsDefault:o,attributeType:s}=e;const[c,u]=(0,n.useState)(0);(0,n.useEffect)((()=>{p(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const p=(0,n.useCallback)((e=>{var r;u(e),l(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),m=J();return a().createElement(i.Box,{className:m.root},a().createElement(w,{attributeValueIndex:c,setAttributeValueIndex:p,attributeValues:t,className:m.main}),a().createElement(K,{handleSetAsDefault:o,attributeValue:t[c],className:m.details,attributeType:s}))};var ee=r(81853),te=r(97193);const re=(0,y.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),ne=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:l,onShareLink:o,onSetAsDefault:s,onDownload:c,onClickImage:u,onDelete:p}=e;const m=re(),d=e=>a().createElement(te.Z,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>l(e),onShareLink:()=>o(e),onSetAsDefault:()=>s(e),onDownload:()=>c(e),onClick:()=>u(e),onDelete:p?()=>p(e):void 0,canBeSelected:!0});return a().createElement(i.Box,{className:m.root},a().createElement(i.Grid,{container:!0},t.map((e=>{let{id:t,src:r}=e;return a().createElement(i.Grid,{key:t,classes:{item:m.item},item:!0},a().createElement(h.Z,{size:h.f.LARGE,onClick:()=>u(t),src:r,overlay:d(t)}))}))))},ae=(0,y.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),le=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:l}=e;const o=ae(),s=t.length===r.length;return a().createElement(i.Link,{component:"button",underline:"none",classes:{button:o.selectButton},onClick:s?l:n},s?C().text("Clear selection"):C().text("Select all images"))};var oe=r(94438),ie=r(22983),se=r(35292),ce=r(97989),ue=r(8818);const pe=(0,y.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),me=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:l}=e;const o=pe();return a().createElement(a().Fragment,null,n&&a().createElement(i.Button,{variant:"contained",color:"primary",onClick:n,startIcon:a().createElement(oe.Z,null)},C().text("Upload")),t&&n&&a().createElement("div",{className:o.divider}),t&&a().createElement(ue.k,{className:o.downloadButton,tooltipTitle:C().text("Download selected items"),icon:ce.Z,onClick:t}),r&&a().createElement(ue.k,{className:o.shareButton,tooltipTitle:C().text("Copy link"),icon:se.Z,onClick:r}),l&&a().createElement(ue.k,{className:o.deleteButton,tooltipTitle:C().text("Delete selected items"),icon:ie.Z,onClick:l}))},de=e=>{let{attributeValues:t,open:r,onClose:o,currentAttributeValueUri:i,setCurrentAttributeValueUri:u,attributeType:m,onDownload:d,onShareLink:g,onSetAsDefault:b,onUpload:h,onDeleteAttribute:f}=e;const[y,x]=(0,n.useState)([]),[v,E]=(0,n.useState)(ee.A.GALLERY_MODE),w=(0,l.useSelector)(s.ZP.selectors.getIsViewMode);(0,n.useEffect)((()=>{E(i?ee.A.DETAILS_MODE:ee.A.GALLERY_MODE)}),[i]);const O=t.map((e=>({src:(0,c.efz)(e),downloadURL:(0,c.Q5d)(e),id:e.uri}))),C=e=>{g(O.find((0,p.propEq)("id",e)).downloadURL)},N=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));b(r)},T=e=>{f({uri:e,attributeType:m})},S=v===ee.A.GALLERY_MODE,k=v===ee.A.DETAILS_MODE,A=y.length>0,P=k||S&&A,Z=!w&&P,j=!w&&(k||S&&!A),I=S&&A&&a().createElement(le,{items:O,selectedItems:y,onClearAll:()=>{x([])},onSelectAll:()=>{x((0,p.pluck)("id",O))}}),L=a().createElement(me,{onDelete:Z?()=>{(S?y:[i]).forEach((e=>{T(e)})),y.length&&x([])}:void 0,onDownload:P?()=>{const e=S?(0,p.pipe)((0,p.filter)((e=>{let{id:t}=e;return y.includes(t)})),(0,p.pluck)("downloadURL"))(O):[O.find((0,p.propEq)("id",i)).downloadURL];d(e)}:void 0,onShare:k?()=>{C(i)}:void 0,onUpload:j?h:void 0});return a().createElement(ee.C,{mode:v,open:r,onChangeMode:E,header:{left:I,right:L},onClose:o},S&&a().createElement(ne,{items:O,selectedItems:y,onSelectImage:e=>{x((t=>[...t,e]))},onDeselectImage:e=>{x((t=>t.filter((t=>t!==e))))},onShareLink:C,onSetAsDefault:N,onDownload:e=>{d([O.find((0,p.propEq)("id",e)).downloadURL])},onClickImage:e=>{u(e),E(ee.A.DETAILS_MODE)},onDelete:w?void 0:T}),k&&a().createElement(Q,{handleSetAsDefault:N,setCurrentAttributeValueUri:u,currentAttributeValueUri:i,attributeValues:t,attributeType:m}))};var ge=r(95117);const be=(0,y.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,i.fade)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function he(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fe=e=>{let{attributeType:t,attributeValues:r=[],renderImage:p,overlay:m=!1,countFixedItems:d=0,children:g,onUpload:b,onDeleteAttribute:h,imageSize:f=ge.By,paging:y,parentUri:x,showNonOv:v,requestNextPageOfAttributeValues:E}=e;const w=(0,l.useSelector)(s.ZP.selectors.getEntity)||{},O=(0,l.useSelector)(s.ZP.selectors.getIsViewMode),C=(0,l.useDispatch)(),N=be(f);(0,n.useEffect)((()=>{if(y&&E){const e=v?y.totalOvValues:y.totalValues;e>r.length&&E({parentUri:x,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[y,E,t,x,r.length,v]);const T=(0,n.useRef)(),[S,k]=(0,n.useState)(0),[A,P]=(0,n.useState)(0),Z=(0,n.useContext)(u.P),[j,I]=(0,n.useState)(!1),[L,D]=(0,n.useState)(),V=(0,n.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=f,a=Math.floor((e+t)/(n+t))-d,l=e+t-(a+d)*(n+t)<ge.lc;k(a),r.length>a?P(r.length-a+(l?1:0)):P(0)}),[r.length,d,f]),R=(0,n.useCallback)((e=>{V(e),T.current=e}),[V]);(0,n.useEffect)((()=>{T.current&&V(T.current)}),[r.length,V]);const U=(0,n.useCallback)((e=>{Z||(D(e),I(!0))}),[Z]),B=(0,n.useCallback)((()=>{I(!1)}),[]),M=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),z=e=>navigator.clipboard.writeText(e),_=(0,n.useCallback)((e=>{O?(0,c.YL3)(w.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&C(s.N5.entity.actions.setDefaultProfilePic(e))})):C(s.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:w.uri,value:e}))}),[O,w.uri,C]),F=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){he(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:U},m&&{onDownload:M,onShareLink:z,onSetAsDefault:_});return a().createElement(a().Fragment,null,a().createElement(o.Z,{handleWidth:!0,onResize:R}),a().createElement(de,{attributeValues:r,open:j,onClose:B,setCurrentAttributeValueUri:D,currentAttributeValueUri:L,attributeType:t,onDownload:M,onShareLink:z,onSetAsDefault:_,onUpload:b,onDeleteAttribute:h}),a().createElement("div",{className:N.imageBox},g,r.slice(0,S).map(p(F)),A>0&&a().createElement("div",{className:N.moreButtonContainer},a().createElement("div",{className:N.moreButton,onClick:()=>U()},a().createElement(i.Typography,{className:N.number},`+${A}`)))))}},95117:(e,t,r)=>{r.d(t,{lc:()=>o,By:()=>i});var n=r(27952);const a=n.f.SMALL.imageWidth,l=n.f.SMALL.imageHeight,o=8,i={imageMargin:4,imageWidth:a,imageHeight:l}},66410:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(52730),s=r(94079),c=r(88832),u=r(86051),p=r(72768),m=r(83348),d=r(3185),g=r(79692),b=r(41128);const h=(0,g.Z)((e=>({container:{height:"16px",borderColor:(0,b.U1)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),f=(0,m.Z)(s.Chip),y=e=>{let{className:t,attributeType:r,nonOvValues:l=[],nonOvTotal:s}=e;const m=h(),g=(0,i.useDispatch)(),b=((e,t)=>{var r;const n=null==t||null===(r=t[0])||void 0===r?void 0:r.uri,a=n?(0,c.Uk3)(n):null;return a&&(0,c.WgC)(a)?a:null==e?void 0:e.uri})((0,n.useContext)(d.u),l),y=(0,n.useCallback)((()=>{g(u.ui.actions.openEntity({uri:b,viewId:null,screen:"sources"}))}),[g,b]);if(!s)return null;const x=l.length?l.map(((e,t)=>a().createElement("div",{key:t},(0,c.YkM)(r)?(0,c.idV)(e.label):a().createElement(p.Z,{value:(0,c.kDl)(e),dataTypeDefinition:(0,c.PFL)(r),rich:!1})))):null;return a().createElement(f,{tooltipTitle:x,tooltipPlacement:"bottom",label:`+ ${s}`,variant:"outlined",onClick:b?y:void 0,classes:{root:o()(m.container,t),label:m.label}})}},84955:(e,t,r)=>{r.d(t,{m:()=>j});var n=r(24328),a=r.n(n),l=r(52730),o=r(94079),i=r(86051),s=r(88832),c=r(50914),u=r(60995);const p=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let l=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(l=l.filter((e=>a.includes(e.uri)))),l.reduce(((e,a)=>{const l=m(t[a.name],n,r);return l&&l.length&&(Array.isArray(l[0])?e.push({[a.uri]:l[0]}):e.push({[a.uri]:l})),e}),[])},m=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,l=(0,s.zeJ)(t,n.type);a&&"object"!=typeof a&&(0,s.OXP)(n)?e.push(d(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(p(l,a,r,t))}return e}),[])},d=(e,t)=>{switch(null==t?void 0:t.type){case s.oS0.TYPE_DATE:return new Date(e).getTime();case s.oS0.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}const b=e=>a().createElement("svg",g({width:11,height:11,viewBox:"0 0 11 11"},e),a().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));var h=r(2507),f=r.n(h),y=r(53180),x=r(31039),v=r(71153),E=r.n(v),w=r(72383),O=r(79692);const C=(0,O.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),N=(0,n.forwardRef)(((e,t)=>{let{value:r,attributeType:o,children:s,className:c,onClick:u}=e;const p=C(),m=(0,l.useSelector)(i.ZP.selectors.getUIPath),{generatePivotingUrl:d}=(0,n.useContext)(w.v),g=d({uiPath:m,uri:o.uri,value:JSON.stringify(r)});return a().createElement("a",{ref:t,href:g,onClick:e=>{u(),e.stopPropagation(),e.preventDefault()},className:E()(p.link,c)},s)}));N.displayName="PivotingUriLink";const T=N;var S=r(85229);const k=(0,O.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"31px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},icon:{margin:"auto 8px auto 0"},content:{color:e.palette.primary.main,cursor:"pointer"},seeAllButton:{cursor:"pointer"}}))),A=(0,O.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}});function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Z=e=>{let{value:t,attributeType:r,config:o={},generatedValue:c,onSeeAllClick:u}=e;const[p,m]=(0,n.useState)([]),[d,g]=(0,n.useState)(0),b=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},h=(0,S._)(),v=k(),E=(0,l.useSelector)(i.ZP.selectors.getGlobalSearchRequestOptions)||{},w=o.entityType||b.type,O=d>6;(0,n.useEffect)((()=>{const e=(0,s.BlA)({value:t,attributeType:r,entityType:w}),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){P(e,t,r[t])}))}return e}({max:6},E);h(Promise.all([(0,s.ZOr)(e,n),(0,s.j_Q)(e,n)])).then((e=>{const[t,{total:r}]=e;m(Array.isArray(t)?t:[]),g(r)})).catch((()=>{m([]),g(0)}))}),[]);const C=Boolean(o.label);return a().createElement("div",{className:v.container},a().createElement("div",{className:v.header},a().createElement("div",{className:v.title},f().text("Pivot profiles")),a().createElement("div",{className:v.divider}),a().createElement("div",{className:v.headerCount},f().number(d,"0,0")+" "+(1===d?f().text("item"):f().text("items")))),C&&a().createElement("div",{className:v.entityTypeLabel},o.label),a().createElement("div",{className:v.body},p.map((e=>a().createElement("div",{key:e.uri,className:v.entityContainer},a().createElement(y.Z,{entity:e,avatarClassName:v.profileIcon}),a().createElement(x.Z,{className:v.entityLabel,value:(0,s.wwR)(e)},(0,s.idV)(e.label)))))),O&&a().createElement("div",{className:v.footer},a().createElement(T,{value:c,attributeType:r,className:v.seeAllButton,onClick:u},f().text("See all"))))},j=e=>{let{value:t,attributeType:r,children:m,className:g}=e;const h=A(),f=k(),y=(0,l.useDispatch)(),x=(0,n.useContext)(u.J)||[],v=(0,s.QZu)(r),E=(0,l.useSelector)(i.ZP.selectors.getMetadata)||{},w=v?p(r,t.value,x,E):d(t.lookupCode||t.value,r),O=x.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(w)&&w.length||!Array.isArray(w)&&!(0,c.isNil)(w)),C=x.find((e=>{let{uri:t}=e;return t===r.uri})),N=O?Array.isArray(w)?w.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,s.nIW)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,w):void 0,S=()=>{y(i.ui.actions.openPivotingPerspective({value:N,attributeType:r}))};return O?a().createElement(o.Tooltip,{interactive:!0,arrow:!0,placement:"right-start",classes:h,title:a().createElement(Z,{value:w,generatedValue:N,attributeType:r,config:C.popup,onSeeAllClick:S})},a().createElement("span",{className:g},a().createElement(b,{className:f.icon}),a().createElement(T,{onClick:S,className:f.content,value:N,attributeType:r},m))):a().createElement(a().Fragment,null,m)}},96811:(e,t,r)=>{r.d(t,{Z:()=>p});var n=r(24328),a=r.n(n),l=r(88832),o=r(33889),i=r(62630),s=r(2163);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}const u=(0,n.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return a().createElement("div",{ref:t,className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showEmptyEditors:r,onAddAttributes:n,lazy:u,errors:p,crosswalks:m,showNonOv:d,expanded:g}=t,b=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"]);switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,c({isReltioCrosswalk:(0,l.KVV)(m,t.attributeValue)},b))}}}.build(e.attributeType,n))}));u.displayName="Attribute";const p=u},91262:(e,t,r)=>{r.d(t,{Z:()=>O});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(88832),u=r(50914),p=r(72045),m=r(95974),d=r(90473),g=r(78836),b=r(8261);var h=r(66784),f=r(17374),y=r(48852),x=r(94773);function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const w=e=>{let{parentAttributeType:t,attrTypes:r,entity:l,parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,drawLines:O,children:C,className:N,alwaysVisibleTypeUris:T=g.S,onAddAttributes:S,onChangeAttribute:k,onDeleteAttribute:A,additionalControlsRenderer:P,showNonOv:Z,highlightAttribute:j}=e;const{attributes:I={}}=l,[L,D]=(0,n.useState)({}),V=(0,n.useCallback)(((e,t)=>{D((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){E(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,n.useEffect)((()=>{D({})}),[o]);const R=(0,n.useMemo)((()=>t&&(0,c.Vg3)({attributeType:t,mode:y})),[t,y]),U=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,u.cond)([[c.kqr,(0,u.always)(t)],[(0,u.both)(c.kQw,(0,u.always)(n)),(0,u.always)(n)],[u.T,(0,u.always)(r)]])(e)})(e,t),l=(e=>(0,c.kqr)(e)?"uri":"name")(e);return!((e.singleValue||(0,c.ian)(e)||(0,c.VFZ)(e))&&((0,u.has)(e[l])(a)||r&&(null==n||!n[e.uri])))})))((0,n.useMemo)((()=>(0,c._kX)(y,r)),[r,y]),l,i,L),B=(0,n.useContext)(h.c),M=(0,n.useMemo)((()=>(0,c.Gtj)(r,y,l,i,Z,B)),[r,y,l,i,Z,B]),[z,_]=(0,n.useMemo)((()=>(0,b.A)(T,M)),[M,T]),F=(0,n.useCallback)((e=>{S(e.map((e=>({attributeType:e,parentUri:e===t?(0,c.JBA)(o):o})))),j((0,u.last)(e),x.g4.NewAttribute)}),[S,o,t]),H={enabled:O},W=(0,n.useMemo)((()=>({hasDeletionsMap:L,setHasDeletions:V})),[L,V]);return a().createElement("div",{className:N},C&&a().createElement(m.Z,H,C),a().createElement(m.Z,v({},H,{plain:!0}),U.length>0&&a().createElement(d.Z,{label:s().text("More attributes"),onApply:F,dense:O,data:U,parent:R&&t})),a().createElement(f.d.Provider,{value:W},_.concat(z).map((e=>{let{attrType:t,values:r}=e;return a().createElement(p.ZP,{key:`${t.uri}_${o}`,attributeType:t,drawLines:O,values:r,paging:(0,u.path)(["paging",t.uri],I),parentUri:o,showEmptyEditors:i,mode:y,crosswalks:w,onAddAttributes:S,onChangeAttribute:k,onDeleteAttribute:A,additionalControlsRenderer:P,showNonOv:Z})}))))};w.propTypes={parentAttributeType:o().object,attrTypes:o().array,entity:o().object,parentUri:o().string,children:o().node,showEmptyEditors:o().bool,mode:c.XGc,crosswalks:o().array,drawLines:o().bool,showNonOv:o().bool,className:o().string,alwaysVisibleTypeUris:o().array,onAddAttributes:o().func,onChangeAttribute:o().func,onDeleteAttribute:o().func,additionalControlsRenderer:o().func,highlightAttribute:o().func};const O=(0,y.l)(x.NY,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),w)},93140:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(88832),o=r(94079),i=r(50914),s=r(20614),c=r(2507),u=r.n(c);const p=e=>u().text("${value}",{value:1===e?u().text("value"):u().text("values")}),m=(0,i.has)("minValue"),d=(0,i.has)("maxValue"),g=(0,i.pipe)(d,i.not),b=(0,i.propSatisfies)((e=>1===e),"minValue"),h=e=>{let{minValue:t}=e;return u().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})},f=e=>{let{maxValue:t}=e;return u().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:u().number(t,"0"),maxValueCaption:p(t)})},y=(0,i.cond)([[i.isNil,(0,i.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return u().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:u().number(t,"0"),minValueCaption:p(t)})}],[(0,i.allPass)([b,d]),f],[(0,i.allPass)([b,g]),(0,i.always)("")],[(0,i.allPass)([m,d]),e=>{let{minValue:t,maxValue:r}=e;return u().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:h({minValue:t}),maxValue:u().number(r,"0"),maxValueCaption:p(r)})}],[d,f],[m,h],[i.T,(0,i.always)("")]]),x=e=>{let{cardinality:t}=e;const r=(0,s.y)();return a().createElement(o.Typography,{variant:"caption",className:r.caption},y(t))};x.propTypes={cardinality:l.oA3};const v=x},72045:(e,t,r)=>{r.d(t,{ZP:()=>ae});var n=r(52730),a=r(86051),l=r(88832),o=r(24328),i=r.n(o),s=r(50914),c=r(95974),u=r(71153),p=r.n(u),m=r(76134),d=r(95629),g=r(66410),b=r(12437),h=r(48554),f=r(96811),y=r(93140);const x=(0,s.filter)((0,s.propSatisfies)(l.ZiX,"uri"));var v=r(66784),E=r(11564),w=r(98448),O=r(79692);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const T={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},S=(0,O.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":C({},T,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),k=e=>{const t=S(),r=(0,o.useRef)(null),{scrollIntoRef:n}=e||{};return(0,o.useEffect)((()=>{e&&n(r)}),[e,n]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}};var A=r(20614);const P=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:u,drawLines:O,showEmptyEditors:C,errorMessage:N,errors:T,paging:S,crosswalks:P,showNonOv:Z,nonVisibleValues:j,highlightedError:I,highlightedAttribute:L,onAddAttributes:D,onDeleteAttribute:V,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:B,requestNextPageOfAttributeValues:M}=e;const z=(0,A.y)(),[_,F]=(0,o.useState)(t),[H,W]=(0,o.useState)(!1),{label:q,required:$,cardinality:Y,name:G,uri:X,description:K}=n,J=(0,l.KIu)(u),{ref:Q,errorClassName:ee}=(0,E.B)({highlightedError:I}),{ref:te,highlightedClassName:re}=k(L),ne=(0,o.useContext)(v.c),ae=(0,o.useMemo)((()=>null==ne?void 0:ne.includes(X)),[X,ne]),le=(0,l.O27)(r),oe=(!H&&C||$||ae)&&le,ie=(0,o.useRef)((0,l.gjI)({parentUri:a,attributeType:n})),se=(0,o.useCallback)((()=>{F(_+1);const e={parentUri:a,index:_,attributeType:n};return D(oe&&!(0,l.YkM)(n.type)?[e,e]:[e])}),[_,D,a,n,oe]),ce=(0,o.useCallback)((0,s.pipe)(V,s.T,W),[V,W]);if(le&&!oe)return null;if(oe&&le&&(r=[ie.current]),(0,l.O27)(r))return null;const ue=(x(r)||[]).length,pe=Z?"totalValues":"totalOvValues",me=(0,s.ifElse)((0,s.has)(pe),(0,s.pipe)((0,s.prop)(pe),(0,s.add)(ue)),(0,s.always)(r.length))(S),de=null!=S&&S.totalValues?S.totalValues-me:null==j?void 0:j.length,ge=t<me,be=ge&&_<me,he=ge&&_>=me,fe=r.slice(0,_),ye=fe?fe.length-1:0,xe=me-_;return i().createElement(c.Z,{enabled:O},i().createElement("div",{ref:Q,className:p()(z.wrapper,ee)},i().createElement("div",{className:z.titleWrapper},i().createElement(d.Z,{label:q,isRequired:$,className:z.title,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{description:K,className:z.description}),i().createElement(g.Z,{nonOvValues:j,attributeType:n,className:z.ovIcon,nonOvTotal:de})),J&&i().createElement(y.Z,{cardinality:Y}),J&&i().createElement(m.Z,{message:N,className:z.typeError}),i().createElement("div",{className:z.attributesWrapper},fe.map(((e,t)=>i().createElement(f.Z,{key:e.uri,attributeValue:e,attributeType:n,lazy:oe&&!$,showEmptyEditors:C,errors:T,ownError:(0,l.ADq)(e,t,n.uri,T),mode:u,crosswalks:P,onAddOneMore:ye===t?se:null,onAddAttributes:D,onDeleteAttribute:ce,onChangeAttribute:R,onDeactivateError:U,additionalControlsRenderer:B,className:0===t?re:null,ref:0===t?te:null,isEmptyEditor:oe}))),be&&i().createElement(h.Z,{moreNumber:(0,s.min)(t,xe),valueNumber:xe,onClick:()=>{r.length<me&&M({parentUri:a,attributeTypeUri:X,attributeTypeName:G,values:r,defaultMaxValues:t}),F(_+t)}}),he&&i().createElement(b.Z,{onClick:()=>{F(t)}}))))};P.displayName="AttributeRenderer";const Z=(0,o.memo)(P);var j=r(94079),I=r(31517),L=r(82455);const D=(0,O.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}});var V=r(22385),R=r(22983);const U={MultiValue:L.Z},B=e=>{let{values:t,onChange:r,onDelete:c}=e;const u=D(),p=(0,n.useSelector)(a.ZP.selectors.getMetadata),m=(0,n.useSelector)(a.ZP.selectors.getEntity),d=m.uri,g=(0,l.JvE)(p,m.type).map((e=>({value:e.uri,label:e.label}))),b=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=g.find((0,s.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,l.nIW)(e)}})),h=(0,o.useCallback)((e=>{const t=(null==e?void 0:e.map((0,s.prop)("value")))||[];r({value:t,attributeType:l.xPW.roles,uri:d})}),[d,r]),f=(0,o.useCallback)((()=>{c({uri:d,attributeType:l.xPW.roles})}),[d,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(I.Z,{label:"",height:40,isMulti:!0,options:g,value:b,onChange:h,components:U,classes:u,className:u.roleContainer}),!!c&&i().createElement(V.Z,{className:u.deleteButton,icon:R.Z,onClick:f,size:"L"}))};var M=r(39331);const z=(0,O.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}}),_=e=>e?`?filter=${(0,l.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",F=[{fieldName:"tags",orderType:"reversedCount"}],H=e=>(0,l.FK9)({query:_(e),body:F}).then((e=>Object.keys(e.tags))),W=e=>{let{className:t,values:r,onChange:s,onDelete:c}=e;const u=z(),p=(0,n.useSelector)(a.ZP.selectors.getEntityUri),m=(0,o.useCallback)((e=>{s({value:e,attributeType:l.xPW.tags,uri:p})}),[s,p]),d=(0,o.useCallback)((()=>{c({uri:p,attributeType:l.xPW.tags})}),[p,c]);return i().createElement("div",{className:u.container,"data-reltio-id":"reltio-attribute-value"},i().createElement(M.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:m,getSuggestions:H}),!!c&&i().createElement(V.Z,{className:u.deleteButton,icon:R.Z,onClick:d,size:"L"}))};var q=r(17374),$=r(48852);function Y(){return Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y.apply(this,arguments)}function G(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const X=(0,$.l)(q.d,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:c,onDeleteAttribute:u,onChangeAttribute:g,showEmptyEditors:b,hasDeletions:h,setHasDeletions:x,highlightedAttribute:v}=e,E=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const w=(0,A.y)(),{label:O,required:C,cardinality:N}=r,T=(0,l.KIu)(a),[S,P]=(0,o.useState)(!1),Z=(0,o.useCallback)((e=>{P(e),null==x||x(r.uri,e)}),[r.uri,x]),I=void 0!==h?h:S,L=(0,o.useCallback)((0,s.pipe)(u,s.T,Z),[u,Z]),D=(0,l.O27)(t),V=!I&&b&&D,R=(0,o.useRef)((0,l.gjI)({parentUri:n,attributeType:r})),{ref:U,highlightedClassName:M}=k(v);return(0,l.j2U)(r)&&D&&!V?null:i().createElement("div",{ref:U,className:p()(M,w.wrapper)},i().createElement(d.Z,{label:O,isRequired:C,className:p()(w.title,w.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),T&&i().createElement(y.Z,{cardinality:N}),T&&i().createElement(m.Z,{message:c}),i().createElement(j.Box,{className:w.attributesWrapper},(()=>{switch(r.uri){case l.xPW.tags.uri:return i().createElement(W,{values:t,onDelete:L,onChange:g});case l.xPW.roles.uri:return i().createElement(B,{values:t,onDelete:L,onChange:g});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){G(e,t,r[t])}))}return e}({},R.current,{value:t[0]||""});return i().createElement(f.Z,Y({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:L,onChangeAttribute:g},E))}}})()))}));var K=r(24338);const J=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,onDeleteAttribute:o,onChangeAttribute:s,requestNextPageOfAttributeValues:c,highlightedAttribute:u}=e;const m=(0,A.y)(),{label:g,description:b}=t,{ref:h,highlightedClassName:f}=k(u);return i().createElement("div",{ref:h,className:p()(m.wrapper,f)},i().createElement("div",{className:m.titleWrapper},i().createElement(d.Z,{className:m.title,label:g,"data-reltio-id":"reltio-attribute-label"}),i().createElement(w.Z,{className:m.description,description:b})),i().createElement(K.Z,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:o,parentUri:a,onChangeAttribute:s,requestNextPageOfAttributeValues:c,showNonOv:l}))};var Q,ee=r(94773);function te(){return te=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},te.apply(this,arguments)}!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Q||(Q={}));const re=(0,$.l)(ee.NY,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:o}=e||{};return{highlightedAttribute:(0,ee.St)(o)&&a.uri===r.uri?e:null,highlightedError:(0,ee.Ie)(o)&&(0,l.Wah)(a,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:r,mode:n=l.ARY.Viewing,crosswalks:a,drawLines:o,paging:u={},parentUri:p,errors:m,errorMessage:d,max:g=1/0,showEmptyEditors:b,showNonOv:h,highlightedError:f,highlightedAttribute:y,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,requestNextPageOfAttributeValues:C}=e;const N=(0,s.partition)(l.OXP),[T,S]=N(t),k=h?t:T,A=h?[]:S,P={errorMessage:d,errors:m,mode:n,parentUri:p,onAddAttributes:x,onDeleteAttribute:v,onChangeAttribute:E,onDeactivateError:w,additionalControlsRenderer:O,showEmptyEditors:b,highlightedError:f,highlightedAttribute:y};return(()=>{switch((0,s.cond)([[l.kqr,(0,s.always)(Q.special)],[l.Or$,(0,s.always)(Q.imageLine)],[s.T,(0,s.always)(Q.default)]])(r)){case Q.special:return i().createElement(c.Z,{enabled:o},i().createElement(X,te({values:k,attributeType:r},P)));case Q.imageLine:return i().createElement(c.Z,{enabled:o},i().createElement(J,{attributeValues:k,attributeType:r,paging:u,onDeleteAttribute:v,parentUri:p,onChangeAttribute:E,requestNextPageOfAttributeValues:C,showNonOv:h,highlightedAttribute:y}));default:return i().createElement(Z,te({values:k,attributeType:r,max:g,paging:u,crosswalks:a,drawLines:o,requestNextPageOfAttributeValues:C,showNonOv:h,nonVisibleValues:A},P))}})()})),ne={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:a.N5.errors.actions.errorDeactivated},ae=(0,n.connect)(((e,t)=>{let{parentUri:r,attributeType:n,max:o}=t;return{errors:a.ZP.selectors.getActiveErrorsForAttributesPager(e,r,n),errorMessage:(0,l.tQX)(r,n,a.ZP.selectors.getProfileErrors(e)),max:o||a.ZP.selectors.getDefaultMaxValues(e)}}),ne)(re)},20614:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(79692).Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},description:{marginRight:"-9px"},attributesWrapper:{width:"100%",marginBottom:"10px"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",marginTop:"-1px",textIndent:0},titleWrapper:{flex:1,paddingBottom:"3px"}})))},47969:(e,t,r)=>{r.d(t,{Z:()=>N});var n=r(24328),a=r.n(n),l=r(50914),o=r(13980),i=r.n(o),s=r(71153),c=r.n(s),u=r(2507),p=r.n(u),m=r(88832),d=r(94079),g=r(22983),b=r(22385),h=r(19592),f=r(26579),y=r(91262),x=r(48852),v=r(94773),E=r(11564);const w=(0,r(79692).Z)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}})));function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const C=e=>{let{label:t,attributeTypesList:r,attributeType:l,attributeValue:o,children:i,errors:s,ownError:u,mode:x,metadata:v,crosswalks:O,lazy:C,showEmptyEditors:N,onAddOneMore:T,onAddAttributes:S,onDeleteAttribute:k,onChangeAttribute:A,additionalControlsRenderer:P,hideDeleteButton:Z,state:j,showNonOv:I,isHighlightedPath:L,highlightedError:D,expanded:V=!1}=e;const R=w(),U="deleted"===j,B="edited"===j,M=o.uri,z=(0,m.ZiX)(M),_=z||V,[F,H]=(0,n.useState)(_),{ref:W,errorClassName:q}=(0,E.B)({highlightedError:D});(0,n.useEffect)((()=>{L&&H(!0)}),[L]),(0,n.useEffect)((()=>{H(_)}),[_]);const $=(0,n.useMemo)((()=>(0,m.xv5)({attributeType:l,attributeValue:o,mode:x,metadata:v,isReltioCrosswalk:(0,m.KVV)(O,o)})),[l,o,x,v,O]),Y=!U&&!Z&&!!k&&$,G=(0,n.useMemo)((()=>(0,m.J6q)(o,s)),[s,o]);(0,n.useEffect)((()=>{G&&H(!0)}),[s,G]),(0,n.useEffect)((()=>{U&&H(!1)}),[U]);const X=(r||[]).some((e=>(0,m.kQw)(e))),K=(0,n.useMemo)((()=>({attributes:X?null:o.value,analyticsAttributes:X?o.value:null})),[o,X]),J=(0,m.e$p)(u)||G&&p().text("Has an incorrect value")||"";return C?a().createElement(d.Button,{variant:"text",color:"primary",onClick:T},"Create attribute"):a().createElement("div",{ref:W,className:c()(R.complexWrapper,q)},a().createElement("div",{className:R.editor},a().createElement("div",{className:R.titleContainer},a().createElement(h.Z,{onClick:()=>H((e=>!e)),expanded:F,className:R.expandButton,disabled:U}),a().createElement(f.Z,{errorMessage:J,classes:{helperText:R.errorWrapperHelperText}},a().createElement("div",{className:c()(R.label,{[R.deleted]:U}),"data-reltio-id":"reltio-attribute-complex-label"},t))),a().createElement("div",{className:R.actions},B&&a().createElement(d.Typography,{variant:"caption",className:R.editedLabel},"(",p().text("edited"),")"),P&&P({attributeType:l,attributeValue:o}),Y&&a().createElement(b.Z,{icon:g.Z,onClick:()=>k({uri:M,attributeType:l,attributeValue:o}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),F&&a().createElement(y.Z,{parentAttributeType:l,attrTypes:r,entity:K,showEmptyEditors:N||z,drawLines:!0,parentUri:M,mode:x,crosswalks:O,onAddAttributes:S,onChangeAttribute:A,onDeleteAttribute:k,additionalControlsRenderer:P,showNonOv:I},i))};C.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){O(e,t,r[t])}))}return e}({label:i().string,children:i().node,attributeTypesList:i().arrayOf(m.EMD),attributeValue:i().oneOfType([m.dMV,m.Rtp]),highlightedError:i().object,isHighlightedPath:i().bool},m.KVe);const N=(0,x.l)(v.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},o=(0,v.Ie)(a);return{highlightedError:o&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:o&&(0,l.pipe)((0,l.propOr)([],"path"),(0,l.any)((0,l.pathEq)(["value","uri"],r.uri)))(n)}}),C)},31588:(e,t,r)=>{r.d(t,{Z:()=>b});var n=r(52730),a=r(86051),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(91262),u=r(88832);const p=e=>e&&e.attributes,m=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=p,mode:a,onAddAttributes:i,onDeleteAttribute:s,onChangeAttribute:u}=e;const m=(0,l.useMemo)((()=>n(r)),[n,r]);return t?o().createElement(c.Z,{key:t.uri,attrTypes:m,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:i,onChangeAttribute:u,onDeleteAttribute:s}):null};m.propTypes={entityUri:s().string,parentUri:s().string,entity:s().object,entityType:s().object,attributeTypesSelectionStrategy:s().func,mode:u.XGc,onAddAttributes:s().func,onDeleteAttribute:s().func,onChangeAttribute:s().func};const d=m,g={onAddAttributes:a.N5.actions.addAttributes,onDeleteAttribute:a.N5.actions.removeAttribute,onChangeAttribute:a.N5.actions.modifyAttribute},b=(0,n.connect)(((e,t)=>({entity:t.entityUri&&a.ZP.selectors.getModifiedEntity(e,t.entityUri)})),g)(d)},81077:(e,t,r)=>{r.d(t,{Z:()=>$});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(2507),s=r.n(i),c=r(50914),u=r(88832),p=r(24737),m=r(94079),d=r(34e3),g=r(95613),b=r(79692);const h=(0,b.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}}),f=(0,b.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),y=(0,b.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),x=(0,b.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}const E=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:l}=e;const o=h(),{uri:i,entityType:c,label:u,secondaryLabel:p}=l;return""!==i?a().createElement(m.MenuItem,v({className:o.entityContainer,ref:t,key:i,onClick:()=>n({label:u,uri:i,entityType:c})},r),a().createElement(d.Z,{className:o.entityAvatar,entityType:c}),a().createElement(g.Z,{value:`${u}${p?", "+p:""}`},a().createElement("span",{className:o.entityLabel},u,p&&a().createElement("span",{className:o.entitySecondaryLabel},", ",p)))):a().createElement(m.MenuItem,v({className:o.entityContainer,ref:t,key:i},r,{disabled:!0}),a().createElement("span",{className:o.emptyEntityLabel},s().text("No results found")))};E.propTypes={innerRef:o().oneOfType([o().oneOf([null]),o().func,o().shape({current:o().any.isRequired})]),innerProps:o().object.isRequired,selectOption:o().func.isRequired,data:o().shape({uri:o().string.isRequired,label:o().string.isRequired,entityType:u.pyR.isRequired})};const w=E;var O=r(71153),C=r.n(O),N=r(52730),T=r(86051),S=r(47898),k=r(72383);const A=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:l},children:o,data:i}=e,p=f(),d=(0,N.useDispatch)(),g=(0,n.useContext)(S.m),{generateEntityUrl:b}=(0,n.useContext)(k.v),h=(0,N.useSelector)(T.ZP.selectors.getUIPath),y=(0,u.ZiX)(i.entityUri)?{className:p.singleValue,component:"span"}:{className:C()(p.singleValue,p.linkValue),onMouseDown:e=>{e.stopPropagation(),l||(0,c.pipe)((0,c.always)({uri:i.entityUri,viewId:g}),T.ui.actions.openEntity,d)()},onClick:e=>e.preventDefault(),href:b({uiPath:h,uri:i.entityUri}),component:"a"};return!r&&a().createElement(m.Typography,y,(0,u.ZiX)(i.entityUri)?s().text(`New ${t.label} will be created`):(0,u.idV)(o))};A.propTypes={children:o().string,data:o().object.isRequired,selectProps:o().object.isRequired};const P=A;var Z=r(33375);const j=e=>{const{selectProps:{onClear:t}}=e,r=x();return a().createElement(m.IconButton,{onClick:t},a().createElement(Z.Z,{className:r.clearIcon}))};j.propTypes={selectProps:o().object.isRequired};const I=j;var L=r(31588),D=r(31276),V=r(81997),R=r(65549);const{Group:U}=V.F,B=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:l}=e,o=y();return a().createElement(U,e,a().createElement("div",{className:o.groupHeading},a().createElement("span",null,n.label),r&&a().createElement("span",{onClick:()=>r(t,n.entityType),className:o.addLabel},a().createElement(R.Z,{className:o.addIcon}),s().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),l)};B.propTypes={selectProps:o().object.isRequired,data:o().object,children:o().array};const M=B,z=(0,b.Z)({creatorWrapper:{marginTop:"20px"}});function _(){return _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_.apply(this,arguments)}function F(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){W(e,t,r[t])}))}return e}function W(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const q=e=>{let{entity:t={},entityTypesUris:r=[],mode:l,max:o,onChange:i,onCreate:m,metadata:d,globalSearchRequestOptions:g,attributeTypesSelectionStrategy:b,disableLinkClick:h=!1}=e,f=F(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const y=z(),[x,v]=(0,n.useState)(""),E=(0,n.useMemo)((()=>r.map((e=>(0,u.nt9)(d,e))).filter(u.oDv)),[r,d]),O=H({},g,{max:o}),C=m?(e,t)=>{m(t||r[0],e),v("")}:void 0,N=e=>{null!==e&&(v(""),i(e))},T=(0,n.useMemo)((()=>1!==E.length),[E]),S=((0,c.isEmpty)(t)?E[0]:(0,u.nt9)(d,t.entityType))||{},k=m&&s().text(`Create ${x?`"${x}" as `:""}new ${S.label}`),A=s().text(`Select ${1===E.length?`${E[0].label} `:""}profile`),Z=!(0,c.isEmpty)(t)&&(0,u.ZiX)(t.entityUri),j=T?{Group:M,GroupHeading:D.Vd}:{},V=Z?{ClearIndicator:I}:{},{TextFieldProps:R}=f,U=F(f,["TextFieldProps"]),B=(0,n.useMemo)((()=>H({},R||{},{"data-reltio-id":"reltio-entity-selector"})),[R]);return a().createElement(a().Fragment,null,a().createElement(p.Z,_({value:(0,c.isEmpty)(t)?void 0:t,inputValue:x,onInputChange:e=>{v(e)},getOptions:e=>(0,u.U10)(E,e,O).then(((e,t)=>r=>{const n=r.map((t=>H({},t,{label:(0,u.idV)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,c.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,l=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return l.length>1?l.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(E,m)),getOptionLabel:(0,c.prop)("entityLabel"),onChange:N,onCreate:C,onClear:()=>{N({})},label:A,createLabel:k,components:H({Option:w,SingleValue:P},j,V),currentEntityType:S,isClearable:!0,disableLinkClick:h,TextFieldProps:B},U)),Z&&a().createElement("div",{className:y.creatorWrapper},a().createElement(L.Z,{mode:l,attributeTypesSelectionStrategy:b,entityType:S,entityUri:t.entityUri})))};q.propTypes={entity:u.oZZ,entityTypesUris:o().arrayOf(o().string),max:o().number,mode:u.XGc,dispatch:o().func,metadata:u.pGS,onChange:o().func.isRequired,onCreate:o().func,attributeTypesSelectionStrategy:o().func,globalSearchRequestOptions:o().object,disableLinkClick:o().bool};const $=q},24338:(e,t,r)=>{r.d(t,{Z:()=>_});var n=r(24328),a=r.n(n),l=r(52730),o=r(94438),i=r(86051),s=r(88832),c=r(27952),u=r(97193),p=r(22385),m=r(2507),d=r.n(m),g=r(94079),b=r(99136),h=r(79692);const f=(0,h.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),y=e=>0===e.trim().length,x=e=>{let{onSend:t}=e;const r=f(),[l,o]=(0,n.useState)(""),[i,s]=(0,n.useState)(null);return a().createElement(g.Box,{className:r.root},a().createElement(g.Paper,{className:r.paper},a().createElement(g.InputBase,{value:l,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);o(t),r||y(t)?s(null):s(d().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:d().text("Paste an image URL here")}),a().createElement(g.Button,{disabled:Boolean(i)||y(l),variant:"outlined",color:"primary",onClick:()=>{t(l),o(""),s(null)}},d().text("Send"))),i&&a().createElement(g.Typography,{className:r.errorMessage},i))};var v=r(71153),E=r.n(v),w=r(13896),O=r(83997);const C=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],N=e=>{let{className:t,onAppendFile:r}=e;return a().createElement(a().Fragment,null,a().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:C.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),a().createElement("label",{htmlFor:"upload-image-button"},a().createElement(g.Button,{className:t,variant:"contained",color:"primary",component:"span"},d().text("Select image"))))};function T(){return T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},T.apply(this,arguments)}const S=e=>a().createElement("svg",T({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},a().createElement("stop",{stopColor:"#FFF",offset:"0%"}),a().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),a().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},a().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),a().createElement("stop",{stopColor:"#000",offset:"100%"})),a().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},a().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),a().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),a().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),a().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),a().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),a().createElement("g",{mask:"url(#UploadIcon_svg__b)"},a().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},a().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),a().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),a().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),a().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),a().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),k=(0,h.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),A=e=>{let{onAppendFile:t,className:r}=e;const n=k(),[{canDrop:l,isOver:o},i]=(0,w.useDrop)({accept:[O.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),s=l&&o;return a().createElement("div",{ref:i,className:E()(n.root,{[n.isActive]:s},r)},a().createElement(S,{className:n.icon}),a().createElement(g.Typography,{className:n.title},d().text("Drag an image here")),a().createElement(g.Typography,{className:n.description},d().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),a().createElement(N,{onAppendFile:t}))},P=(0,h.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Z=e=>{let{children:t,className:r}=e;const n=P();return a().createElement(g.Box,{className:E()(n.root,r)},a().createElement(g.Box,{className:n.border}),a().createElement(g.Typography,{className:n.text},t),a().createElement(g.Box,{className:n.border}))};var j=r(87685),I=r(8818);const L=(0,h.Z)({closeIcon:{color:"#fff"}}),D=e=>{let{error:t,onClose:r}=e;const n=L();return a().createElement(g.Snackbar,{open:Boolean(t),onClose:r,message:t,action:a().createElement(I.k,{className:n.closeIcon,tooltipTitle:d().text("Close"),icon:j.default,onClick:r})})},V=(0,h.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}})));var R=r(6521);const U=e=>{let{open:t,onClose:r,onUpload:o}=e;const c=V(),u=(0,l.useSelector)(i.ZP.selectors.getImageServicePath),p=(0,l.useSelector)(i.ZP.selectors.getEnvironment),m=(0,l.useSelector)(i.ZP.selectors.getTenant),[h,f]=(0,n.useState)(!1),[y,v]=(0,n.useState)(null),E=e=>{f(!0),(0,s.Ixr)({image:e,imageServicePath:u,environment:p,tenant:m}).then((e=>{o(e),r()})).catch((e=>{v((0,s.xU7)(e,d().text("Something went wrong")))})).finally((()=>f(!1)))};return a().createElement(R.l,null,a().createElement(g.Dialog,{open:t,onClose:r,classes:{paper:c.dialogPaper}},a().createElement(g.Typography,{className:c.title},d().text("Add new image")),a().createElement(g.Box,{className:c.body},a().createElement(A,{className:c.targetBox,onAppendFile:e=>{if(!e)return v(d().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=C.includes(e.type);t>20?v(d().text("File size exceeds configured max file size.")):r?E(e):v(d().text("File format is not supported."))}}),a().createElement(Z,{className:c.divider},d().text("or")),a().createElement(x,{onSend:e=>{E(e)}})),h&&a().createElement(b.Z,null),a().createElement(D,{error:y,onClose:()=>v(null)})))};var B=r(40932),M=r(95117);const z=(0,h.Z)((()=>({root:{width:"100%",marginBottom:"10px"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),_=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:m,onChangeAttribute:d,requestNextPageOfAttributeValues:g,parentUri:b,paging:h,showNonOv:f,imageSize:y=M.By}=e;const x=z(y),v=(0,l.useSelector)(i.ZP.selectors.getEntity)||{},E=(0,l.useSelector)((e=>i.ZP.selectors.getModifiedEntityDefaultProfilePic(e,v.uri))),w=(0,l.useDispatch)(),[O,C]=(0,n.useState)(!1),N=(0,n.useCallback)((()=>{C((e=>!e))}),[]),T=(0,n.useCallback)((e=>{const r=(0,s.hm5)(b,t.name),n={};for(const a in e){const l=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));l&&(n[a]=[{uri:(0,s.hm5)(r,l.name),ov:!0,value:e[a],type:l.uri}])}d({attributeType:t,uri:r,value:n})}),[d,b,t]),S=(0,n.useCallback)((e=>{if(m(e),E===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];w(i.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:v.uri,value:n||{}}))}}),[m,v,E,r]),k=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:l,onShareLink:o,onSetAsDefault:i}=e,c=(0,s.Q5d)(r),{uri:p}=r;return a().createElement(u.Z,{id:p,onShareLink:()=>o(c),onSetAsDefault:()=>i(r),onDelete:()=>S({uri:p,attributeType:t}),onDownload:()=>l([c]),onClick:()=>n(p)})};return a().createElement("div",{className:x.root},a().createElement(B.Z,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,s.efz)(t),{uri:n}=t,{onOpenImageGalleryDialog:l}=e;return a().createElement("div",{className:x.image,key:n},a().createElement(c.Z,{src:r,overlay:k(e,t),onClick:()=>l(n),size:{imageWidth:y.imageWidth,imageHeight:y.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:1,onUpload:N,onDeleteAttribute:S,imageSize:y,requestNextPageOfAttributeValues:g,paging:h,parentUri:b,showNonOv:f},a().createElement("div",{className:x.uploadContainer,onClick:N},a().createElement(p.Z,{className:x.uploadButton,iconClassName:x.uploadIcon,icon:o.Z}))),a().createElement(U,{open:O,onUpload:T,onClose:N}))}},90473:(e,t,r)=>{r.d(t,{Z:()=>N});var n=r(24328),a=r.n(n),l=r(94079),o=r(71153),i=r.n(o),s=r(50914),c=r(2507),u=r.n(c),p=r(7785),m=r(97820),d=r(65549),g=r(27239),b=r(54763),h=r(44890),f=r(88832),y=r(56656);const x=(0,s.curry)(((e,t)=>(0,s.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),v=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,s.pipe)(x(r),(0,s.sort)(n),(0,s.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var E,w=r(86051),O=r(52730);!function(e){e.parent="parent",e.attributes="attributes"}(E||(E={}));const C=(0,r(79692).Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),N=e=>{let{label:t,popupTitle:r=t,data:o,parent:c,dense:x,onApply:N}=e;const T=C(),S=(0,n.useRef)(),[k,A]=(0,n.useState)(!1),[P,Z]=(0,n.useState)(""),[j,I]=(0,n.useState)([]),{items:L,hasGroups:D,parentGroupLength:V,attributesGroupLength:R}=(e=>{let{data:t,parent:r,filter:a}=e;const l=Boolean(r),o=(0,O.useSelector)(w.ZP.selectors.getAttributesSortingStrategy),i=(0,n.useMemo)((()=>o===f.PYu.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[o]),s=(0,n.useMemo)((()=>l?v({attrTypes:[r],filter:a,sortingFn:i}):[]),[l,r,a,i]),c=(0,n.useMemo)((()=>l&&null!=s&&s.length?[{item:{id:E.parent,label:u().text("Parent")},items:s}]:[]),[l,s]),p=(0,n.useMemo)((()=>v({attrTypes:t,filter:a,sortingFn:i})),[t,a,i]),m=(0,n.useMemo)((()=>l&&null!=p&&p.length?[{item:{id:E.attributes,label:u().text("Attributes")},items:p}]:p),[l,p]),d=(0,n.useMemo)((()=>(0,y.LG)((c||[]).concat(m))),[c,m]),g=c.length,b=m.length;return{items:d,hasGroups:l,parentGroupLength:g,attributesGroupLength:b}})({data:o,parent:c,filter:P}),U=(0,n.useCallback)(((e,t)=>{I((0,s.ifElse)((0,s.always)(t),(0,s.append)(e),(0,s.reject)((0,s.propEq)("id",e.id)))(j))}),[j]),B=(0,n.useCallback)(((e,t)=>t.items?40:28),[]),M=(0,n.useCallback)((e=>{let{item:t}=e;U(t,(0,s.not)((0,s.any)((0,s.propEq)("id",t.id))(j)))}),[U,j]),{focusIndex:z,handleKeyDown:_}=(0,b.t)({items:L,open:k,onSelectFocusedItem:M,selectedItems:j}),F=(0,n.useRef)(null);F.current=z;const H=D?(V?1:0)+(R?1:0):0,W=L.length-H,q=Math.min(255,28*W+40*H),$=Math.max(140,q+112),Y=(0,n.useCallback)(((e,t,r)=>{var n;let{item:l,level:o=0}=t;const i=(0,s.any)((0,s.propEq)("id",l.id))(j),c=F.current===r;return a().createElement(p.Z,{key:l.uri,onClick:U,checked:i,level:o,data:l,label:a().createElement(g.Z,{text:l.label,highlight:P}),labelInText:l.label,style:e,isFocused:c,isRequired:!(null===(n=l.attrType)||void 0===n||!n.required),LogoIcon:l.LogoIcon})}),[P,U,j]),G=(0,n.useCallback)(((e,t)=>a().createElement(l.ListItem,{component:"div",className:T.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return a().createElement("div",{className:i()(T.moreAttributes,{[T.dense]:x})},a().createElement(l.Button,{color:"primary",onClick:()=>A(!k),ref:S,className:T.moreButton},a().createElement(d.Z,{classes:{root:T.icon}}),a().createElement("div",{className:T.buttonLabel},t)),a().createElement(m.Z,{open:k,className:i()(T.moreAttributesPopup,T.popupContainer),anchorEl:S.current,onClose:(0,s.pipe)((()=>{j.length>0&&N((0,s.pluck)("attrType",j))}),(()=>A(!1)),(()=>Z("")),(()=>I([]))),onSearch:Z,containerHeight:$,title:r,containerWidth:320,searchInputOnKeyDown:_},a().createElement(h.Z,{getItemSize:B,renderItem:Y,renderGroupTitle:G,items:L,height:q,focusIndex:z}),0===L.length&&a().createElement("div",{className:T.noResultsCaptionContainer},a().createElement(l.Typography,{variant:"caption",display:"block",gutterBottom:!0},u().text("No results found")))))}},62630:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(88832),o=r(47969);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}const s=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,l.Kxm)(t,r.dataLabelPattern);return a().createElement(o.Z,i({label:(0,l.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};s.propTypes=l.j2V;const c=(0,n.memo)(s)},2163:(e,t,r)=>{r.d(t,{Z:()=>T});var n=r(52730),a=r(86051),l=r(24328),o=r.n(l),i=r(13980),s=r.n(i),c=r(71153),u=r.n(c),p=r(50914),m=r(88832),d=r(47969),g=r(81077),b=r(26579),h=r(48852),f=r(94773),y=r(11564);const x=(0,r(79692).Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){w(e,t,r[t])}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O=e=>{const t=x(),{modifiedEntity:r,metadata:n,globalSearchRequestOptions:a,onDeleteModifiedEntity:i,onUpdateModifiedEntity:s,onDeactivateError:c,highlightedError:h}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["modifiedEntity","metadata","globalSearchRequestOptions","onDeleteModifiedEntity","onUpdateModifiedEntity","onDeactivateError","highlightedError"]),{attributeValue:w,attributeType:O,mode:C,crosswalks:N,errors:T,onChangeAttribute:S}=f,k=(0,l.useRef)(w),{ref:A,errorClassName:P}=(0,y.B)({highlightedError:h,isSimple:!0}),Z=(0,m.CZ8)(w),j=(0,m.o96)(w),I=(0,m.Poc)(O),L=(0,m.nt9)(n,I),D=r?(0,m.Kxm)(r,L.dataLabelPattern):w.label,V=(0,l.useMemo)((()=>[I]),[I]),R=(0,l.useMemo)((()=>(0,m.EtK)(N,j)),[N,j]),U=(0,l.useMemo)((()=>(0,m.mbo)(w,T)),[w,T]),B=(0,l.useMemo)((()=>Z&&{entityUri:(0,m.ZTM)(Z),entityType:(0,m.uGi)(Z),entityLabel:w.label}),[Z,w.label]),M=(0,l.useMemo)((()=>(0,m.tF$)(O).map((e=>(0,m.zeJ)(n,e))).filter(p.identity)),[O,n]),z=(0,l.useCallback)((e=>(0,m.ct9)(O,e)),[O]),_=(0,l.useCallback)((e=>{r&&i(r.uri);const t=k.current,n=!(0,p.isEmpty)(e)&&e.uri===(0,m.bwT)(t),a=E({},w,{label:e.label,refEntity:n?t.refEntity:(0,m.fmQ)(e),refRelation:n?t.refRelation:(0,m.NBq)(w)});S({value:a,attributeType:O,uri:w.uri}),U&&c((0,m.iFp)(U))}),[w,O,r,S,i,c,U]),F=(0,l.useCallback)(((e,t)=>{const r=(0,p.pipe)(z,(0,m._kX)(C))(L),a=(0,m.pBq)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:n,mode:C});_(a),s(a)}),[z,C,L,n,_,s]),H=(0,l.useMemo)((()=>(0,m.yv0)({attributeType:O,attributeValue:w,mode:C,isReltioCrosswalk:(0,m.KVV)(N,w)})),[O,w,C,N]),W=(0,l.useMemo)((()=>(0,m.d89)(C,L)),[C,L]),q=(0,m.e$p)(U);return o().createElement(d.Z,v({},f,{label:(0,m.idV)(D),attributeTypesList:M,crosswalks:R,metadata:n}),o().createElement("div",{ref:A,className:P},o().createElement(b.Z,{errorMessage:q},o().createElement(g.Z,{className:u()(t.item,{[t.dense]:q||B&&(0,m.ZiX)(B.entityUri)}),entity:B||{},entityTypesUris:V,max:20,globalSearchRequestOptions:a,mode:C,isDisabled:!H,onChange:_,onCreate:W?F:void 0,metadata:n,attributeTypesSelectionStrategy:z}))))};O.propTypes=E({},m.NkU,{modifiedEntity:m.pyR,metadata:m.pGS,globalSearchRequestOptions:s().object,onDeleteModifiedEntity:s().func,onUpdateModifiedEntity:s().func,onDeactivateError:s().func,highlightedError:s().object});const C=(0,h.l)(f.NY,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:l}=e||{};return{highlightedError:(0,f.Ie)(l)&&(0,m.Wah)(a,r.uri,n.uri)?e:null}}),O),N={onDeleteModifiedEntity:a.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:a.N5.modifiedEntities.actions.entityCreated,onDeactivateError:a.N5.errors.actions.errorDeactivated},T=(0,n.connect)(((e,t)=>{const r=(0,m.bwT)(t.attributeValue);return{modifiedEntity:(0,m.ZiX)(r)?a.ZP.selectors.getModifiedEntity(e,r):null,metadata:a.ZP.selectors.getMetadata(e),globalSearchRequestOptions:a.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"])}}),N)(C)},33889:(e,t,r)=>{r.d(t,{Z:()=>V});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(52730),s=r(71153),c=r.n(s),u=r(50914),p=r(65549),m=r(22983),d=r(94079),g=r(2507),b=r.n(g),h=r(88832),f=r(72768),y=r(28117),x=r(26579),v=r(22385),E=r(40879),w=r(49965),O=r(86051);function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){N(e,t,r[t])}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const T={},S=(e,t,r)=>{const n=O.ZP.selectors.getDependentLookupsStructureNode(e,r);if(n){const r=t.uri,{parents:o,missedParentsAttributeTypes:i}=((e,t,r)=>{var n;const a=r.parents.flatMap((t=>{const r=O.ZP.selectors.getDependentLookupsStructureNode(e,t);return r.values.map((e=>C({},e,{type:t,dependentLookupCode:r.attrType.dependentLookupCode})))})),l=O.ZP.selectors.getModifiedEntities(e),o=O.ZP.selectors.getEntityUri(e),i=O.ZP.selectors.getAllRelationsToAddAndEdit(e),s=O.ZP.selectors.getMetadata(e),c=(0,h.vUy)({parentValues:a,valueUri:t,entityUri:o,modifiedEntities:l,connections:i}),p=(0,u.pipe)(h.uDV,(0,u.defaultTo)([]),(0,u.map)((0,u.pipe)((0,u.path)(["valueType","uri"]),h.u5q)),(0,u.prepend)(null===(n=l[o])||void 0===n?void 0:n.type),(0,u.reject)(u.isNil),u.uniq)({entityUri:o,entitiesMap:l,connections:i,metadata:s},t),m=r.parents.filter((e=>p.some((0,h.sOy)(e)))).map((t=>O.ZP.selectors.getDependentLookupsStructureNode(e,t).attrType)).filter((e=>!c.some((t=>{let{type:r,value:n}=t;return n&&r===e.uri}))));return{parents:Object.values(c.reduce(((e,t)=>{var r;const n=(e=>`${e.type}_${(0,h.JBA)(e.uri)}`)(t);return C({},e,{[n]:{type:t.dependentLookupCode,codeValues:(0,u.uniq)([t.value,...(null===(r=e[n])||void 0===r?void 0:r.codeValues)||[]]).filter(Boolean).sort()}})}),{})).filter((e=>!!e.codeValues.length)),missedParentsAttributeTypes:m}})(e,r,n),{isBlocked:s=!1}=O.ZP.selectors.getDependentLookupEditorState(e,r)||{},c=(a=i).length?b().text("Please select value for ${labels} ${attributes}.",{labels:(l=a.map((0,u.pipe)((0,u.prop)("label"),(e=>`'${e}'`))),l.reduce(((e,t,r)=>[e,t].join(r===l.length-1?` ${b().text("and")} `:", ")))),attributes:1===a.length?b().text("attribute"):b().text("attributes")}):"",p=!(null!=t&&t.lookupCode||null!=t&&t.value),m=p&&s&&b().text("Populating values...")||p&&c||"",d={parents:c?null:o,disabled:!!c&&p||s,placeholder:m};return m&&(d.value=null),((e,t)=>{const r=T[e];return(0,u.equals)(t,r)?r:((0,u.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),T[e]=t,t)})(r,d)}var a,l};var k=r(48852),A=r(26481),P=r(91186),Z=r(94773),j=r(11564);const I=(0,r(79692).Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function L(){return L=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},L.apply(this,arguments)}const D=e=>{let{className:t,attributeValue:r,attributeType:l,isReltioCrosswalk:o,ownError:s,mode:g,onAddOneMore:w,onDeleteAttribute:C,onChangeAttribute:N,onDeactivateError:T,additionalControlsRenderer:k,state:Z,highlightedError:D,isEmptyEditor:V=!1}=e,R=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const U=I(),B="deleted"===Z,M="edited"===Z,z=(0,h.KIu)(g),_=(0,h.Vg3)({attributeType:l,mode:g}),F=(0,h.yv0)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),H=(0,h.xv5)({attributeType:l,attributeValue:r,mode:g,isReltioCrosswalk:o}),W=F&&z,q=(0,h.e$p)(s),$=(0,i.useSelector)((e=>(0,h.QEi)(l)?S(e,r,null==l?void 0:l.uri):null)),{ref:Y,errorClassName:G}=(0,j.B)({highlightedError:D,isSimple:!0});(0,n.useEffect)((()=>{V&&(0,h.QEi)(l)&&!(0,u.has)("lookupCode",r)&&N({attributeType:l,uri:r.uri,value:r.value,silent:!0})}),[V]);const X=(0,n.useMemo)((()=>(0,h.PFL)(l)),[l]),K=(0,n.useMemo)((()=>(0,E.AG)(r,X)),[r,X]),J=(0,n.useCallback)((()=>{s&&T((0,h.iFp)(s))}),[s,T]),Q=(0,n.useCallback)((0,u.pipe)((0,E.pp)(r,l),N,J),[r,l,N,J]),ee=!!w&&_&&!l.singleValue,te=!B&&!!C&&H,re=!!q,ne=B?{disabled:!0}:{},ae=(0,n.useContext)(A.j),{autopopulationContextValue:le}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:a}=e;const l=(0,i.useDispatch)(),o=(0,i.useSelector)(O.ZP.selectors.getLookupAutocomplete),s=t&&(0,h.Vmh)(o,r),c=s?a:null,{isTouched:u=!1}=(0,i.useSelector)((e=>s&&O.ZP.selectors.getDependentLookupEditorState(e,a)))||{},p=(0,n.useCallback)((e=>{l(O.N5.dependentLookups.actions.dependentLookupsEditorTouched({uri:e,isTouched:!0}))}),[l]);return{autopopulationContextValue:(0,n.useMemo)((()=>c?{id:c,isTouched:u,onTouch:p}:null),[c,u,p])}})({enabled:ae&&(0,h.QEi)(l),attributeTypeUri:null==l?void 0:l.uri,valueUri:r.uri});return a().createElement("div",{ref:Y,className:c()(U.editor,t,G)},a().createElement(x.Z,{errorMessage:q,className:U.errorWrapper},a().createElement("div",{className:c()(U["editor-value"],{[U.deleted]:B},{[U["editor-read-only-value"]]:!W}),"data-reltio-id":"reltio-attribute-value"},W?a().createElement(P.m.Provider,{value:le},a().createElement(y.Z,L({fieldName:(0,h.Tde)(l.uri),value:K,dataTypeDefinition:X,error:re,onChange:Q,fullWidth:!0},$,R,ne))):a().createElement(f.Z,{value:(0,h.kDl)(r),dataTypeDefinition:X}))),a().createElement("div",{className:U["editor-actions"]},M&&a().createElement(d.Typography,{variant:"caption",className:U.editedLabel},"(",b().text("edited"),")"),ee&&a().createElement(v.Z,{icon:p.Z,onClick:w,size:"L",className:c()(U.addButton,U.button)}),k&&k({attributeType:l,attributeValue:r}),te&&a().createElement(v.Z,{className:U.button,icon:m.Z,onClick:()=>{C({uri:r.uri,attributeType:l}),(0,h.PcX)(s)!==h.NIO.missed&&J()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))};D.propTypes={className:o().string,attributeValue:h.cNQ,attributeType:h.EMD,ownError:h.wfT,isReltioCrosswalk:o().bool,state:o().oneOf(["deleted","edited"]),mode:h.XGc,onAddOneMore:o().func,onDeleteAttribute:o().func,onChangeAttribute:o().func,onDeactivateError:o().func,additionalControlsRenderer:o().func,highlightedError:o().object,isEmptyEditor:o().bool};const V=(0,w.Z)((0,k.l)(Z.NY,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:(0,Z.Ie)(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),D),(()=>{const e=I();return a().createElement("div",{className:e.placeholder})}))},40879:(e,t,r)=>{r.d(t,{AG:()=>i,Ho:()=>s,pp:()=>c});var n=r(95038),a=r.n(n),l=r(88832),o=r(50914);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t}=arguments.length>1?arguments[1]:void 0;const{value:r,lookupCode:n}=e;switch(t){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,l.gxP)(r);case l.oS0.TYPE_DATE:return r&&l.P6Y.dates.toLocalDate(r)||null;case l.oS0.TYPE_LOCAL_DATE:case l.oS0.TYPE_TIMESTAMP:case l.oS0.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case l.oS0.TYPE_DEPENDENT_LOOKUP:case l.oS0.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}},s=(e,t)=>{const{type:r}=(0,l.PFL)(e);switch(r){case l.oS0.TYPE_BOOLEAN:case l.oS0.TYPE_BOOLEAN_RADIO:case l.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case l.oS0.TYPE_DATE:return t&&a()(t).format("YYYY-MM-DD")||"";case l.oS0.TYPE_TIMESTAMP:return t&&a()(t).format()||"";case l.oS0.TYPE_ACTIVENESS_DATE:case l.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},c=(0,o.curry)(((e,t,r)=>({value:s(t,r),uri:e.uri,attributeType:t})))},17374:(e,t,r)=>{r.d(t,{d:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},66784:(e,t,r)=>{r.d(t,{c:()=>a});var n=r(24328);const a=r.n(n)().createContext(null)},8261:(e,t,r)=>{r.d(t,{U:()=>l,A:()=>o});var n=r(50914),a=r(88832);const l=(e,t,r,l)=>{const o=(0,n.pipe)(a.nt9,(0,n.defaultTo)({}),(0,n.props)(["attributes","analyticsAttributes"]),(0,n.reject)(n.isNil),n.flatten,(0,n.concat)(n.__,(0,n.pipe)(n.values,(0,n.reject)((0,n.propEq)("uri",a.xPW.id.uri)))(a.xPW)))(e,t);return r.length?o.filter((e=>{let{uri:t}=e;return r.includes(t)})):o.filter((e=>{let{uri:t}=e;return!l.includes(t)}))},o=(e,t)=>(0,n.partition)((0,n.pipe)((0,n.path)(["attrType","uri"]),(0,n.includes)(n.__,e)),t)},12437:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(96971),a=r(94079),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(9125);const u=e=>{let{onClick:t}=e;const r=(0,c.y)();return o().createElement(a.Link,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},o().createElement(n.Z,{className:r["svg-icon__root"]}),s().text("Show less"))}},48554:(e,t,r)=>{r.d(t,{Z:()=>u});var n=r(4426),a=r(94079),l=r(24328),o=r.n(l),i=r(2507),s=r.n(i),c=r(9125);const u=e=>{let{moreNumber:t,valueNumber:r,onClick:l}=e;const i=(0,c.y)();return o().createElement(a.Link,{component:"button",variant:"caption",className:i.link,onClick:l,underline:"none"},o().createElement(n.Z,{className:i["svg-icon__root"]}),t&&r?s().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):s().text("Show more"))}},9125:(e,t,r)=>{r.d(t,{y:()=>n});const n=(0,r(79692).Z)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}})},81303:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(24328),a=r.n(n),l=r(88832),o=r(12068),i=r(28751),s=r(22544);const c=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case l.oS0.TYPE_NESTED:return a().createElement(i.Z,t);case l.oS0.TYPE_REFERENCE:return a().createElement(s.Z,t);default:return a().createElement(o.Z,t)}}}.build(t,e)}},80931:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(50914),o=r(88832),i=r(95974),s=r(8683),c=r(48554),u=r(12437),p=r(78836),m=r(8261);const d=(0,n.memo)((e=>{let{attrTypes:t,entity:r,parentUri:d,drawLines:g,children:b,className:h,max:f,alwaysVisibleTypeUris:y=p.S,showNonOv:x}=e;const[v,E]=(0,n.useState)(f||1/0),w=(0,n.useMemo)((()=>(0,o.fyF)(t,r,x)),[t,r,x]),[O,C]=(0,n.useMemo)((()=>(0,m.A)(y,w)),[w,y]),N=C.slice(0,v),T=f&&N.length<C.length,S=f&&N.length>=C.length&&f<N.length,k={enabled:g};return a().createElement("div",{className:h},b&&a().createElement(i.Z,k,b),N.concat(O).map((e=>{let{attrType:t,values:n}=e;return a().createElement(s.Z,{key:t.uri,attributeType:t,drawLines:g,values:n,paging:(0,l.path)(["paging",t.uri],r.attributes),parentUri:d,showNonOv:x})})),T&&a().createElement(c.Z,{onClick:()=>{E(1/0)}}),S&&a().createElement(u.Z,{onClick:()=>{E(f)}}))}))},8683:(e,t,r)=>{r.d(t,{Z:()=>Q});var n=r(52730),a=r(86051),l=r(71153),o=r.n(l),i=r(24328),s=r.n(i),c=r(50914),u=r(88832),p=r(79692);function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){d(e,t,r[t])}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const g="13px",b="15px",h={titleRow:{display:"block",minHeight:"16px",textIndent:"-1em",paddingLeft:"1em"},title:{whiteSpace:"nowrap"},ovIcon:{marginLeft:"8px",marginRight:"-3px",marginTop:"-1px",textIndent:0},descriptionIcon:{marginTop:"-1px",textIndent:0,marginRight:"-10px"}},f=(0,p.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),y=(0,p.Z)(m({wrapper:{fontSize:g,lineHeight:b,flex:1},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginBottom:"-3px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)"}},h)),x=(0,p.Z)(m({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:g,lineHeight:b},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"}},h,{titleRow:m({},h.titleRow,{marginBottom:"3px"})}));var v=r(95974),E=r(19603),w=r(94646),O=r(95629),C=r(66410),N=r(98448),T=r(81303);const S=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showNonOv:i,totalNonVisibleValues:c}=e;const p=y(),{label:m,description:d}=n,g=(0,u.xdS)(n)?u.q7e.RELATION_ATTRIBUTE:u.q7e.ENTITY_ATTRIBUTE;return s().createElement("div",{className:o()(p.collaborationWrapper,E.U)},s().createElement("div",{className:o()(p.titleRow,p.wrapper)},s().createElement(O.Z,{label:m,className:o()(p.title,a),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:d,className:p.descriptionIcon}),s().createElement(C.Z,{nonOvValues:r,attributeType:n,className:p.ovIcon,nonOvTotal:c}),s().createElement(T.Z,{className:o()(p.attribute,l),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),s().createElement(w.Z,{uri:t.uri,relatedObjectUris:(0,u.wp9)(g,{uri:t.uri}),objectType:g}))};var k=r(48554),A=r(12437);const P=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:u,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g,totalNonVisibleValues:b}=e;const h=x(),[f,y]=(0,i.useState)(t),v=t<a,E=v&&f<a,w=v&&f>=a,{label:S,description:P}=l,Z=r.slice(0,f),j=a-f;return s().createElement("div",{className:h.wrapper},s().createElement("div",{className:h.titleRow},s().createElement(O.Z,{label:S,className:o()(h.title,m),"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{description:P}),s().createElement(C.Z,{nonOvValues:n,attributeType:l,className:h.ovIcon,nonOvTotal:b})),s().createElement("div",{className:h.attributes},Z.map((e=>s().createElement(T.Z,{key:e.uri,className:o()(h.attribute,d),attributeValue:e,attributeType:l,showNonOv:g})))),E&&s().createElement(k.Z,{moreNumber:(0,c.min)(t,j),valueNumber:j,onClick:()=>{r.length<a&&p({parentUri:u,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),y(f+t)}}),w&&s().createElement(A.Z,{onClick:()=>{y(t)}}))};var Z=r(20404);const j=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return s().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>s().createElement(i.Fragment,{key:e},s().createElement(n,{value:e}),t<r.length-1&&", "))))};var I=r(26005);function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){D(e,t,r[t])}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V=(0,p.Z)({insertAttribute:L({width:"fit-content"},u.zXF[u.Y1q.insertAttribute]),deleteAttribute:L({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},u.zXF[u.Y1q.deleteAttribute])}),R=e=>{let{value:t}=e;const r=V(),l=(0,n.useSelector)(a.ZP.selectors.getMetadata),{appearance:o}=(0,i.useContext)(I.m),c=(0,u.YNv)("roles",t,o),p=(0,u.o_F)(c);return s().createElement("span",{className:r[p]},(0,u.xqc)(l,t))},U=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:R})};var B=r(95470),M=r(3185),z=r(72383);const _=e=>{let{value:t}=e;const r=V(),l=(0,n.useSelector)(a.ZP.selectors.getUIPath),o=(0,n.useSelector)(a.ZP.selectors.getEntity),c=(0,i.useContext)(M.u),{appearance:p}=(0,i.useContext)(I.m),{generateTagUrl:m}=(0,i.useContext)(z.v),d=(0,u.YNv)("tags",t,p),g=(0,u.o_F)(d),b=c||o;return s().createElement(B.Z,{className:r[g],href:m({uiPath:l,tag:t,entityUri:b.dataTenant?(0,u.Nsy)(b):b.uri})},t)},F=e=>{let{className:t,values:r}=e;return s().createElement(j,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:_})},H=e=>{let{values:t,attributeType:r}=e;const n=y(),{label:a}=r;return s().createElement("div",{className:o()(n.titleRow,n.wrapper)},(l=n.titleIcon,r.uri===u.xPW.tags.uri?s().createElement(Z.Z,{className:l}):null),s().createElement(O.Z,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case u.xPW.tags.uri:return s().createElement(F,{className:e,values:t});case u.xPW.roles.uri:return s().createElement(U,{className:e,values:t});default:return s().createElement(T.Z,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(n.attribute));var l};var W=r(13074);const q=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:l,requestNextPageOfAttributeValues:o}=e;const i=x(),{label:c,description:u}=t;return s().createElement(s().Fragment,null,s().createElement("div",{className:i.titleRow},s().createElement(O.Z,{className:i.title,label:c,"data-reltio-id":"reltio-attribute-label"}),s().createElement(N.Z,{className:i.descriptionIcon,description:u})),s().createElement(W.Z,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:l}))},$="oneLine",Y="multiLine",G="imageLine",X="special",K=(0,i.memo)((e=>{let{values:t,attributeType:r,drawLines:n,paging:a={},parentUri:l,max:i=1/0,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g}=e;const b=f(),h=(0,c.partition)(u.OXP);if(!t||!t.length)return null;const[y,x]=h(t),E=g?t:y,w=g?[]:x,O=g?"totalValues":"totalOvValues",C=(0,c.ifElse)((0,c.has)(O),(0,c.prop)(O),(0,c.always)(E.length))(a),N=null!=a&&a.totalValues?a.totalValues-C:w.length,T=1===C&&!(0,u.YkM)(r);return s().createElement(v.Z,{enabled:n,className:o()({[b.paddingWrapperWithLines]:n})},s().createElement("div",{className:o()({[b.paddingWrapper]:!n})},(()=>{switch((0,c.cond)([[u.kqr,(0,c.always)(X)],[u.Or$,(0,c.always)(G)],[(0,c.always)(T),(0,c.always)($)],[c.T,(0,c.always)(Y)]])(r)){case $:return s().createElement(S,{value:E[0],nonVisibleValues:w,totalNonVisibleValues:N,attributeType:r,titleClassName:m,contentClassName:d,showNonOv:g});case Y:return s().createElement(P,{values:E,nonVisibleValues:w,totalVisibleValues:C,totalNonVisibleValues:N,attributeType:r,parentUri:l,max:i,requestNextPageOfAttributeValues:p,titleClassName:m,contentClassName:d,showNonOv:g});case G:return s().createElement(q,{attributeValues:E,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:p,showNonOv:g});case X:return s().createElement(H,{values:E,attributeType:r})}})()))})),J={requestNextPageOfAttributeValues:a.N5.actions.requestNextPageOfAttributeValues},Q=(0,n.connect)(((e,t)=>{let{max:r}=t;return{max:r||a.ZP.selectors.getDefaultMaxValues(e)}}),J)(K)},83303:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l),i=r(71153),s=r.n(i),c=r(88832),u=r(94079),p=r(80931),m=r(19592),d=r(94646),g=r(43600),b=r(96464),h=r(19603);const f=(0,r(79692).Z)({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",paddingTop:"1px",marginLeft:"2px"},spacer:{flex:1}});function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const x=e=>{let{attributeTypesList:t,attributeValue:r,label:l,expanded:o=!1,children:i,showNonOv:x,attributeType:v,LabelRenderer:E,RightSlot:w}=e;const O=f(),C=(0,b.V)(),N=r.uri,[T,S]=(0,n.useState)(!1),{highlightedValuesUris:k=[],highlightedClassName:A}=(0,n.useContext)(g.j);(0,n.useEffect)((()=>{S(o)}),[o]);const P=(t||[]).some((e=>(0,c.kQw)(e))),Z=(0,n.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}({attributes:P?null:r.value,analyticsAttributes:P?r.value:null},(0,c.kqr)(v)?r.value:{})),[r,P,v]),j=(0,c.xdS)(v)?c.q7e.RELATION_ATTRIBUTE:c.q7e.ENTITY_ATTRIBUTE;return a().createElement("div",{className:O.complexContainer},a().createElement("div",{className:s()(O.labelContainer,h.U)},a().createElement(m.Z,{onClick:()=>S((e=>!e)),expanded:T}),E?a().createElement(E,{attributeType:v,attributeValue:r}):a().createElement(a().Fragment,null,a().createElement(u.Typography,{component:"span",variant:"body2",classes:{body2:O.label},className:s()({[A]:k.includes(r.uri),[C.ovFalse]:!(0,c.OXP)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},l),a().createElement("div",{className:O.spacer}),w&&a().createElement(w,{attributeType:v,attributeValue:r}),a().createElement(d.Z,{uri:r.uri,relatedObjectUris:(0,c.wp9)(j,{uri:r.uri}),objectType:j}))),T&&a().createElement(p.Z,{attrTypes:t,entity:Z,drawLines:!0,parentUri:N,showNonOv:x},i))};x.propTypes={children:o().node,label:o().oneOfType([o().string,o().node]),attributeTypesList:o().arrayOf(c.EMD),attributeValue:o().oneOfType([c.dMV,c.Rtp]),expanded:o().bool,showNonOv:o().bool,attributeType:c.EMD,LabelRenderer:o().elementType,RightSlot:o().elementType};const v=x},13074:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(24328),a=r.n(n),l=r(88832),o=r(71153),i=r.n(o),s=r(26005),c=r(27952),u=r(40932),p=r(95117);const m=(0,r(79692).Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,l.m5F)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:l.zXF[l.Y1q.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:l.zXF[l.Y1q.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${l.zXF[l.Y1q.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),d=e=>{let{attributeType:t,attributeValues:r=[],paging:o,parentUri:d,requestNextPageOfAttributeValues:g,showNonOv:b,imageSize:h=p.By}=e;const f=m(h),{appearance:y}=(0,n.useContext)(s.m);return a().createElement(u.Z,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,l.efz)(e),{uri:n}=e,o=(0,l.IFm)(n,y),s=(0,l.o_F)(o);return a().createElement("div",{className:i()(f.image,{[f[s+"Image"]]:s}),key:n,"data-reltio-id":"reltio-attribute-value"},a().createElement(c.Z,{onClick:()=>t(n),className:f[s],src:r,size:{imageWidth:h.imageWidth,imageHeight:h.imageHeight}}))}},imageSize:h,requestNextPageOfAttributeValues:g,paging:o,parentUri:d,showNonOv:b})}},28751:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(94079),o=r(71153),i=r.n(o),s=r(88832),c=r(26005),u=r(83303),p=r(84955),m=r(48771);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(79692).Z)({label:{textDecoration:"none"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.updateAttribute]),insertAttribute:d({width:"fit-content"},s.zXF[s.Y1q.insertAttribute]),deleteAttribute:d({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},s.zXF[s.Y1q.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(this,arguments)}const f=e=>{let{attributeValue:t,attributeType:r}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const d=b(),{appearance:g}=(0,n.useContext)(c.m),f=(0,n.useMemo)((()=>{const e=(0,s.IFm)(t.uri,g),n=(0,s.o_F)(e),o=t.label?t.label:(0,s.Kxm)(t,r.dataLabelPattern);return a().createElement(p.m,{className:d.pivotingTooltip,value:t,attributeType:r},a().createElement(l.Box,{component:"span",className:i()(d[n],d.label)},a().createElement(m.Z,{text:(0,s.idV)(o)})))}),[g,d,t,r]);return a().createElement(u.Z,h({label:f,attributeValue:t,attributeTypesList:(0,s.EUG)({},r),attributeType:r},o))};f.propTypes=s.j2V;const y=(0,n.memo)(f)},22544:(e,t,r)=>{r.d(t,{Z:()=>v});var n=r(24328),a=r.n(n),l=r(71153),o=r.n(l),i=r(88832),s=r(86051),c=r(52730),u=r(26005),p=r(72383),m=r(83303),d=r(95470),g=r(48771),b=r(96464);function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){f(e,t,r[t])}))}return e}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y=(0,r(79692).Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:h({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.updateAttribute]),insertAttribute:h({width:"fit-content"},i.zXF[i.Y1q.insertAttribute]),deleteAttribute:h({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},i.zXF[i.Y1q.deleteAttribute])})));function x(){return x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(this,arguments)}const v=(0,n.memo)((e=>{let{attributeValue:t,attributeType:r}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const h=(0,c.useSelector)(s.ZP.selectors.getMetadata),f=(0,c.useSelector)(s.ZP.selectors.getUIPath),v=y(),E=(0,b.V)(),w=(0,i.bwT)(t),O=(0,n.useMemo)((()=>(0,i.EUG)(h,r)),[r,h]),{appearance:C}=(0,n.useContext)(u.m),{generateEntityUrl:N}=(0,n.useContext)(p.v),T=(0,n.useMemo)((()=>{const e=(0,i.IFm)(t.uri,C),r=(0,i.o_F)(e),n=null!=w&&w.startsWith("changeRequests")?"dcrReview":"profile";return a().createElement(d.Z,{href:(0,i.O27)(C)?N({uiPath:f,uri:w,screen:n}):void 0,className:o()(v[r],{[E.ovFalse]:!(0,i.OXP)(t)})},a().createElement(g.Z,{text:(0,i.idV)(t.label)}),t.relationshipLabel&&a().createElement("span",{className:v.relationshipLabel},a().createElement(g.Z,{text:t.relationshipLabel})))}),[t,C,f,w,v,E.ovFalse,N]);return a().createElement(m.Z,x({attributeTypesList:O,attributeValue:t,label:T,attributeType:r},l))}))},12068:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(24328),a=r.n(n),l=r(88832),o=r(71153),i=r.n(o),s=r(19603),c=r(26005),u=r(94646),p=r(72768),m=r(84955);function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){g(e,t,r[t])}))}return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const b=(0,r(79692).Z)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},l.zXF[l.Y1q.updateAttribute],{"& > a":{color:l.zXF[l.Y1q.updateAttribute].color}}),insertAttribute:d({width:"fit-content"},l.zXF[l.Y1q.insertAttribute],{"& > a":{color:l.zXF[l.Y1q.insertAttribute].color}}),deleteAttribute:d({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},l.zXF[l.Y1q.deleteAttribute],{"& > a":{color:l.zXF[l.Y1q.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"}});var h=r(43600),f=r(96464);const y=e=>{let{className:t,attributeType:r=null,attributeValue:o,inlined:d}=e;const g=b(),y=(0,f.V)(),{highlightedValuesUris:x=[],highlightedClassName:v}=(0,n.useContext)(h.j),{appearance:E}=(0,n.useContext)(c.m),w=(0,l.IFm)(o.uri,E),O=(0,l.o_F)(w),C=a().createElement(p.Z,{value:(0,l.kDl)(o),dataTypeDefinition:(0,l.PFL)(r)}),N=(0,l.xdS)(r)?l.q7e.RELATION_ATTRIBUTE:l.q7e.ENTITY_ATTRIBUTE;return d||O?a().createElement("div",{className:i()(t,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri,className:i()({[g.multilineAttribute]:!d})},a().createElement("span",{className:i()(g[O],{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C))):a().createElement("div",{className:i()(t,g.root,s.U,{[v]:x.includes(o.uri)})},a().createElement(m.m,{value:o,attributeType:r,key:o.uri},a().createElement("span",{className:i()(g.attributeValue,{[y.ovFalse]:!(0,l.OXP)(o)}),"data-reltio-id":"reltio-attribute-value"},C)),a().createElement(u.Z,{className:g.commentsContainer,uri:o.uri,relatedObjectUris:(0,l.wp9)(N,{uri:o.uri}),objectType:N}))}},96464:(e,t,r)=>{r.d(t,{V:()=>n});const n=(0,r(79692).Z)((e=>({ovFalse:e.inactive})))},78836:(e,t,r)=>{r.d(t,{S:()=>a});var n=r(88832);const a=[n.xPW.roles.uri,n.xPW.tags.uri]},19603:(e,t,r)=>{r.d(t,{U:()=>n});const n="commentsContainerVisibilityArea"},7142:(e,t,r)=>{r.d(t,{g:()=>i});var n=r(24328),a=r.n(n),l=r(13980),o=r.n(l);const i=a().createContext({enabled:!1,queueSizeThreshold:0});i.Provider.propTypes={value:o().shape({enabled:o().bool,queueSizeThreshold:o().number})},i.displayName="AsyncMountContext"},69891:(e,t,r)=>{r.d(t,{P:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="BlockImageGalleryDialogContext"},41564:(e,t,r)=>{r.d(t,{h:()=>s,e:()=>c});var n=r(24328),a=r.n(n),l=r(17554),o=r(49759);const i=()=>{},s=a().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:i,clearCommentState:i,getCommentState:()=>({}),getComment:i,getComments:()=>new Promise(i),getCommentsCount:i,createComment:()=>new Promise(i),editComment:()=>new Promise(i),createReply:()=>new Promise(i),resolveThread:i,reOpenThread:i,clearCurrentComment:i,deleteComment:i,sending:!1,loading:!1,pageToken:null,deleteReply:i,editReply:()=>new Promise(i)});s.displayName="CollaborationContext";const c=e=>{let{collaboration:t,children:r}=e;const n=(0,l.U)();return a().createElement(s.Provider,{value:t},a().createElement(o.s.Provider,{value:n},r))}},31274:(e,t,r)=>{r.d(t,{X:()=>a});var n=r(24328);const a=r.n(n)().createContext({});a.displayName="EntitiesMapContext"},3185:(e,t,r)=>{r.d(t,{u:()=>a});var n=r(24328);const a=r.n(n)().createContext(null);a.displayName="EntityContext"},87451:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(24328);const a=r.n(n)().createContext({showDescription:!1,showNavigateToGraph:!0});a.displayName="FeaturesContext"},43600:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext({highlightedValuesUris:[],highlightedClassName:""});a.displayName="HighlightedValuesContext"},26005:(e,t,r)=>{r.d(t,{m:()=>a});var n=r(24328);const a=r.n(n)().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});a.displayName="HistoryDiffContext"},60995:(e,t,r)=>{r.d(t,{J:()=>a});var n=r(24328);const a=r.n(n)().createContext([])},26481:(e,t,r)=>{r.d(t,{j:()=>a});var n=r(24328);const a=r.n(n)().createContext(!1);a.displayName="ProfilePerspectiveViewContext"},78101:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="RelatedObjectUrisContext"},94773:(e,t,r)=>{r.d(t,{g4:()=>o,Ie:()=>i,St:()=>s,NY:()=>c,fy:()=>u});var n=r(24328),a=r.n(n),l=r(31276);let o;!function(e){e.Error="Error",e.NewAttribute="NewAttribute"}(o||(o={}));const i=e=>e===o.Error,s=e=>e===o.NewAttribute,c=a().createContext({element:null,type:null,highlightError:l.ZT,highlightAttribute:l.ZT,scrollIntoRef:l.ZT}),u=e=>{let{children:t}=e;const[r,l]=(0,n.useState)(null),i=(0,n.useRef)(null),s=(0,n.useCallback)((e=>{e.current.scrollIntoView({behavior:"smooth",block:"center"}),i&&clearTimeout(i.current),i.current=setTimeout((()=>{l(null)}),2e3)}),[]),u=(0,n.useCallback)((e=>{l({value:e,type:o.Error})}),[]),p=(0,n.useCallback)((e=>{setTimeout((()=>l({value:e,type:o.NewAttribute})),300)}),[]),m=(0,n.useMemo)((()=>({element:null==r?void 0:r.value,highlightError:u,highlightAttribute:p,scrollIntoRef:s,type:null==r?void 0:r.type})),[r,s]);return a().createElement(c.Provider,{value:m},t)}},49759:(e,t,r)=>{r.d(t,{s:()=>a});var n=r(24328);const a=r.n(n)().createContext([]);a.displayName="UsersContext"},96479:(e,t,r)=>{r.d(t,{S:()=>o});var n=r(24328),a=r(7142);let l=0;const o=()=>{const e=(0,n.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,n.useContext)(a.g),[o,i]=(0,n.useState)(!t||t&&l<r);e.current&&l++;const s=(0,n.useRef)();return(0,n.useEffect)((()=>{if(l--,!o)return s.current=setTimeout((()=>{i(!0)}),0),()=>clearTimeout(s.current)}),[]),e.current=!1,o}},11564:(e,t,r)=>{r.d(t,{B:()=>d});var n=r(24328),a=r(50914),l=r(71153),o=r.n(l),i=r(88832),s=r(79692);function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){u(e,t,r[t])}))}return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},m=(0,s.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":c({},p,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":c({},p,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),d=e=>{let{highlightedError:t,isSimple:r=!1}=e;const l=m(),s=(0,n.useRef)(null),{element:c,scrollIntoRef:u}=t||{},p=(0,n.useMemo)((()=>(0,a.propOr)(i.Wkf.ERROR,"severity")(c)),[c]),d=o()({[l.highlightError]:p===i.Wkf.ERROR,[l.highlightWarning]:p===i.Wkf.WARNING,[l.simpleAttribute]:r});return(0,n.useEffect)((()=>{t&&u(s)}),[t,u]),t?{ref:s,errorClassName:d}:{ref:s}}},17554:(e,t,r)=>{r.d(t,{U:()=>s});var n=r(24328),a=r(52730),l=r(88832),o=r(86051);const i=(0,r(36631).Z)(((e,t)=>(0,l.kz_)({tenant:e,servicesPath:t}))),s=()=>{const[e,t]=(0,n.useState)([]),r=(0,a.useSelector)(o.ZP.selectors.getTenant),l=(0,a.useSelector)(o.ZP.selectors.getServicesPath),s=e=>{console.warn("Users error",e),t([])};return(0,n.useEffect)((()=>{i(r,l).then((e=>t(e))).catch(s)}),[r,l]),e}},97989:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(24328),a=r.n(n);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}const o=e=>a().createElement("svg",l({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),a().createElement("defs",null,a().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),a().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"Download_svg__b",fill:"#fff"},a().createElement("use",{xlinkHref:"#Download_svg__a"})),a().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})))}}]);
2
2
  //# sourceMappingURL=2125.js.map