forked from sindresorhus/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
8195-6d92109b80fc4484.js.download
2 lines (2 loc) · 48.2 KB
/
8195-6d92109b80fc4484.js.download
1
2
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8195],{23755:function(e,t,n){var o=n(66383),r=n(52903),i=n(37168),d=n(2784);t.Z=function(e){var t=e.onClickOutside,n=e.children,a=(0,o.Z)((0,i.O)({onClickOutside:t}),1)[0],l=(0,d.useCallback)((function(e){"Escape"===e.key&&t(e)}),[t]);return(0,r.tZ)("div",{ref:a,onKeyDown:l,children:n})}},42457:function(e,t,n){var o=n(70865),r=n(92228),i=n(52903),d=n(28165),a=n(28316),l=n(28952),s=n(66266),c=n(55414),u=n(20110),f=n(87744),p=n(1639);function v(){var e=(0,r.Z)(["\n display: grid;\n grid-gap: 10px;\n grid-template-columns: 1fr;\n "]);return v=function(){return e},e}function h(){var e=(0,r.Z)(["\n display: flex;\n margin: auto;\n gap: 20px;\n "]);return h=function(){return e},e}var m=(0,d.iv)("text-align:center;display:grid;grid-gap:20px;min-width:min(50vw,688px);max-width:688px;","ConfirmationModal.tsx--rootStyles"),g=(0,f.uq)({mobile:(0,d.iv)(v()),tablet:(0,d.iv)(h())}),x=function(e){var t=e.bodyText,n=e.confirmationText,o=e.headerText,r=e.onClose,d=e.onConfirm;return(0,i.BX)("form",{css:m,"data-testid":"confirmation-folder-form",onSubmit:function(e){e.preventDefault(),e.stopPropagation(),d()},children:[(0,i.tZ)(c.x,{tag:"h1",type:"paragraph1Bold",children:o}),(0,i.tZ)(c.x,{type:"paragraph3",children:t}),(0,i.BX)("div",{css:g,children:[(0,i.tZ)(u.z,{color:"secondary",onClick:r,type:"button",children:"Cancel"}),(0,i.tZ)(u.z,{type:"submit",children:n})]})]})};t.Z=function(e){var t=(0,p.Z)("confirmation-modal");return(0,a.createPortal)((0,i.tZ)(l.u,{ariaLabel:"Confirmation modal ".concat(e.headerText),onClosed:e.onClose,children:(0,i.tZ)(s.hz,{children:(0,i.tZ)(x,(0,o.Z)({},e))})}),t)}},6237:function(e,t,n){var o=n(52903),r=n(2784),i=n(28316),d=n(1639),a=n(42457);t.Z=function(e){var t=e.folderTitle,n=e.onConfirm,l=e.onClose,s=(0,d.Z)("delete-folder-modal");return(0,i.createPortal)((0,o.tZ)(a.Z,{bodyText:(0,o.BX)(r.Fragment,{children:["Are you sure you want to delete your"," ",(0,o.tZ)("strong",{children:t||""})," folder? Any Zaps in this folder will be moved back to your ",(0,o.tZ)("strong",{children:"Home"})," folder."]}),confirmationText:"Delete folder",headerText:"Delete folder?",onClose:l,onConfirm:n}),s)}},71139:function(e,t,n){n.r(t),n.d(t,{FolderTree:function(){return Te},default:function(){return Ae},generateAriaControls:function(){return ke},generateUniqueFolderItemId:function(){return Fe}});var o=n(47842),r=n(26297),i=n(50930),d=n(52903),a=n(2784),l=n(31667),s=n(63399),c=n(28165),u=n(76635),f=n(70776),p=n(23094),v=n(3e3),h=n(66830),m=n(87593),g=n(7118),x=n(52008),b=n(90755),Z=n(4863),I=n(92228),S=n(20110),w=n(61854),y=n(87744),C=n(57504),F=n(47897),k=n(39097),N=n.n(k),T=n(73223);function A(){var e=(0,I.Z)(["\n flex: 1 1 auto;\n min-width: 0;\n position: relative;\n top: 2px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ","\n\n > span {\n flex: 1 1 auto !important;\n }\n "]);return A=function(){return e},e}function D(){var e=(0,I.Z)(["\n top: 0;\n "]);return D=function(){return e},e}var B=(0,c.iv)("display:flex;gap:10px;margin:0;min-width:0;","NestedFolderItemLink.tsx--buttonContentStyle"),M=(0,c.iv)('display:flex;align-items:center;& > a,button{&[class*="BaseButton"]{',v.ZT.paragraph3Medium," gap:10px !important;justify-content:flex-start !important;color:",f.w.neutral800," !important;border:2px solid transparent !important;width:100% !important;margin:0 !important;padding:0 5px !important;height:44px !important;border-radius:5px !important;&:hover{box-shadow:none !important;}&:focus,&:hover{outline:none;background-color:",f.w.acidWash," !important;&:before{display:none !important;}}outline:none !important;transition:all 0.2s !important;border:2px solid transparent !important;background-color:transparent !important;& > span{padding:0 !important;}}}","NestedFolderItemLink.tsx--linkStyle"),L=(0,c.iv)('button[class*="BaseButton"]{border:none !important;&:hover{box-shadow:none !important;}&:focus:before{display:none !important;}}',"NestedFolderItemLink.tsx--buttonResetStyle"),X=(0,c.iv)("outline:none !important;transition:background-color 0.2s !important;transition:border 0.2s !important;transition:box-shadow 0.2s !important;border:2px solid transparent !important;background-color:transparent !important;&:focus{box-shadow:0 0 0 2px ",f.w.blue80," !important;border:2px solid ",f.w.white," !important;}&:hover,&:focus{background-color:",f.w.acidWash," !important;color:",f.w.blueJeans," !important;outline:none !important;// use CSS instead of Icon.props for color to enable hover styling\n svg{fill:",f.w.blueJeans,"!important;}}","NestedFolderItemLink.tsx--hoverFocusStyle"),R=(0,c.iv)('[aria-label*="Folder actions for"]{background-color:inherit !important;box-shadow:none !important;}',L," > button{",X,"}","NestedFolderItemLink.tsx--menuStyle"),z=(0,y.uq)({mobile:(0,c.iv)(A(),v.ZT.paragraph3Semibold),tablet:(0,c.iv)(D())}),E=function(e){var t=e.href,n=e.describedBy,o=e.onClick,r=e.children;return t.length?(0,d.tZ)(N(),{href:t,"aria-describedby":n,onClick:o,shallow:!0,legacyBehavior:!1,children:r}):(0,d.tZ)(S.z,{type:"button",color:"secondary",href:t,"aria-describedby":n,onClick:o,children:r})},O=function(e){var t=e.elRef,n=e.folderDepth,o=e.handleClick,r=e.href,i=e.id,l=e.isActive,s=e.isShared,c=e.isTruncated,u=e.name,f=e.ownerId,p=e.parentId,v=e.rootId,h=e.setCurrentAction,m=e.isSidenav,g=e.textRef,b=(0,a.useCallback)((function(e){if(!m&&o&&i)return e.preventDefault(),o({folderDepth:n,href:r,id:i,isActive:l,isShared:s,ownerId:f,parentId:p,rootId:v,name:u})}),[i,o,m,n,r,s,l,u,f,p,v]),Z=(0,a.useMemo)((function(){return String(i)===String(T.K0)?"actionTrash":s?"team":"navFolder"}),[s,i]);return(0,d.BX)("div",{css:M,children:[(0,d.tZ)(E,{href:r,describedBy:c?"folder-".concat(i):void 0,onClick:b,children:(0,d.BX)("span",{css:B,children:[!v&&(0,d.tZ)(w.J,{color:"neutral600",name:Z,size:"25px"}),(0,d.tZ)("span",{css:z,"data-testid":"FolderItem-name-folder-".concat(i),ref:g,children:u})]})}),(0,d.tZ)("span",{css:R,"data-testid":"folder-actions-button-".concat(i),children:m&&!(0,C.Z)(i)&&(0,d.tZ)(F.Z,{folderDepth:n,folderId:i,isNested:!!(0,x.Z)(v),isShared:!!s,nestedFolderItemRef:t,ownerId:f,setCurrentAction:h,text:u})})]})},q=(0,a.memo)(O),P=(0,c.iv)("align-items:center;display:flex;flex-flow:row nowrap;grid-gap:1px;padding-left:3px;","NestedFolderItem.tsx--rootStyle"),_=(0,c.iv)('button[class*="BaseButton"]{border:none !important;&:hover{box-shadow:none !important;}&:focus:before{display:none !important;}}',"NestedFolderItem.tsx--buttonResetStyle"),H=(0,c.iv)("outline:none !important;transition:background-color 0.2s !important;transition:border 0.2s !important;transition:box-shadow 0.2s !important;border:2px solid transparent !important;background-color:transparent !important;&:focus{box-shadow:0 0 0 2px ",f.w.blue80," !important;border:2px solid ",f.w.white," !important;}&:hover,&:focus{background-color:",f.w.acidWash," !important;color:",f.w.blueJeans," !important;outline:none !important;// use CSS instead of Icon.props for color to enable hover styling\n svg{fill:",f.w.blueJeans,"!important;}}","NestedFolderItem.tsx--hoverFocusStyle"),U=(0,c.iv)("align-items:center;display:flex;height:30px;margin:5px;width:24px;",_," button{",H,"}","NestedFolderItem.tsx--caretStyle"),J=(0,c.iv)("button{&:focus{box-shadow:none !important;}}","NestedFolderItem.tsx--caretActiveStyle"),W=(0,c.iv)("svg{transform:rotate(0deg);}","NestedFolderItem.tsx--caretOpenStyle"),j=(0,c.iv)("svg{transform:rotate(270deg);}","NestedFolderItem.tsx--caretClosedStyle"),Q=(0,c.iv)("flex:1;min-width:0;border-radius:3px;> div{width:100% !important;}> a,div > a,button{",v.ZT.paragraph3Semibold," align-items:center !important;border-radius:3px !important;color:",f.w.neutral700,"!important;display:flex !important;flex-flow:row nowrap !important;flex:1 !important;gap:8px !important;max-width:100% !important;min-width:0 !important;padding:10px 10px 9px !important;text-decoration:none !important;&:focus{outline-color:",f.w.blueJeans," !important;outline-width:2px;background-color:",f.w.acidWash," !important;border-radius:5px !important;}&:hover{text-decoration:underline !important;color:",f.w.blueJeans," !important;}}","NestedFolderItem.tsx--nestedFolderItemRootStyle"),$=(0,c.iv)("> a,div > a,button{color:",f.w.blueJeans," !important;}","NestedFolderItem.tsx--nestedFolderItemRootActiveStyle"),Y=(0,c.iv)("margin-left:35px;","NestedFolderItem.tsx--itemNoChildrenStyle"),K={folderDepth1Style:(0,c.iv)("margin-left:36px;","NestedFolderItem.tsx--folderDepthStyles"),folderDepth2Style:(0,c.iv)("margin-left:72px;","NestedFolderItem.tsx--folderDepthStyles"),folderDepth3Style:(0,c.iv)("margin-left:108px;","NestedFolderItem.tsx--folderDepthStyles"),folderDepth4Style:(0,c.iv)("margin-left:130px;","NestedFolderItem.tsx--folderDepthStyles")},V=function(e){var t=e.ariaControls,n=e.folderDepth,o=void 0===n?0:n,r=e.href,i=e.id,l=e.isActive,s=e.isShared,c=e.hasChildren,u=void 0!==c&&c,f=e.onClick,p=e.ownerId,v=e.parentId,I=e.rootId,S=e.isSidenav,w=void 0===S||S,y=e.name,C=e.toggle,F=e.isOpen,k=(0,a.useState)(!1),N=k[0],T=k[1],A=(0,a.useState)(Z.x.none),D=A[0],B=A[1],M=(0,a.useRef)(null),L=(0,a.useRef)(null);(0,a.useEffect)((function(){T((0,g.S)(L))}),[y]);var X=(0,d.tZ)(q,{elRef:M,folderDepth:o,handleClick:f,href:r,id:i,isActive:l,isShared:s,isTruncated:N,name:y,ownerId:p,parentId:v,rootId:I,setCurrentAction:B,isSidenav:w,textRef:L});return(0,d.BX)("div",{css:[P,K["folderDepth".concat(o,"Style")]],ref:M,children:[u&&(0,d.tZ)("span",{css:[U,!!l&&J,F?W:j],"data-testid":"".concat(w?"sidenav":"modal","-").concat(y,"-arrow-caretIcon"),children:(0,d.tZ)(h.h,{type:"button",ariaExpanded:!!F,ariaControls:t,ariaLabel:F?"Hide subfolders for ".concat(y):"Show subfolders for ".concat(y),icon:"arrowSmallDown",onClick:C,size:"xsmall"})}),(0,d.BX)("div",{css:[Q,!!l&&$,!u&&Y],"data-testid":"FolderSectionItem",children:[N?(0,d.tZ)(m.p,{allowMultilineTooltip:!0,content:y,position:"southeast",tooltipId:"FolderSectionItem-nested-folder-".concat(i),children:function(){return X}}):X,D!==Z.x.none&&(0,d.tZ)(b.Z,{currentAction:D,folderId:(0,x.Z)(i),folderIsShared:!!s,folderParentId:(0,x.Z)(v),folderTitle:y,rootId:I,setCurrentAction:B})]})]})},G=(0,a.memo)(V),ee=n(38716),te=n(70865),ne=n(96670),oe=n(5163),re=n(85150),ie=function(e){var t=e.activeFolderId,n=e.folderAncestorIds,o=e.folders,i=e.highlightedFolderId,d=e.isSidenav,l=e.isSuperAdmin,s=e.memberId,c=e.moveFolderSearchQuery,f=e.onItemClick,p=e.searchQuery,v=e.selectedFolderId,h=(0,re.n)().isOpen;return(0,a.useCallback)((function(e){var a,m,g;return(0,oe.__generator)(this,(function(x){switch(x.label){case 0:for(a=function(){var o,a,g,x,b,Z,I,S,w,y,C,F,k,N,T;return(0,oe.__generator)(this,(function(A){switch(A.label){case 0:return o=m.pop(),a=o.node,g=a.children,x=void 0===g?[]:g,b=a.id,Z=a.text,I=a.href,S=o.nestingLevel,w=(0,r.Z)(o.node,["children","id","text","href"]),y=String(t)===String(b)&&!p&&d,C=String(b)===String(i),F=n.includes(b)||n.includes(String(i))||h(String(b))||!d&&c,k=(null===x||void 0===x?void 0:x.length)?x.map((function(e){return e.id})):[],[4,e?(0,ne.Z)((0,te.Z)({immediateChildIds:k,id:b,isLeaf:!(null===x||void 0===x?void 0:x.length),isOpenByDefault:F,name:Z,nestingLevel:S,children:x,isSidenav:d,href:d?I:void 0},w),{isActive:y,isHighlighted:C,onClick:(0,u.isFunction)(f)?f:void 0,isSelected:!!v&&String(v)===String(b),isSuperAdmin:l,memberId:s,moveFolderSearchQuery:c}):b];case 1:if(N=A.sent(),(null===x||void 0===x?void 0:x.length)&&(null===x||void 0===x?void 0:x.length)>0&&N)for(T=x.length-1;T>=0;T--)m.push({nestingLevel:S+1,node:x[T]});return[2]}}))},m=[],g=o.length-1;g>=0;g--)m.push({nestingLevel:0,node:o[g]});x.label=1;case 1:return m.length>0?[5,(0,oe.__values)(a())]:[3,3];case 2:return x.sent(),[3,1];case 3:return[2]}}))}),[t,n,o,h,d,l,s,c,f,p,v,i])},de=n(25120),ae=n(27459),le=function(e){var t=e.inheritedFolders,n=e.folderType,o=e.includeDefaultFolder,r=(0,ae.Z)({includeDefaultFolder:o}),d=r.sharedFolders,l=r.personalFolders;return(0,a.useMemo)((function(){return t||("personal"===n?l:"all"===n?(0,i.Z)(l).concat((0,i.Z)(d)):d)}),[l,d,t,n])},se=n(2569),ce=function(e){var t=e.activeFolderId,n=(0,ee.X8)(),o=!!t&&!(0,C.Z)(t),r=(0,a.useState)(!o),i=r[0],d=r[1],l=(0,se.Z)({accountId:n,folderId:t}),s=l.folderAncestors,c=l.folderAncestorsLoaded;(0,a.useEffect)((function(){c&&d(!0)}),[c]),(0,a.useEffect)((function(){d(!1)}),[t,n]);var u=(0,a.useMemo)((function(){return s.map((function(e){return e.id}))}),[s]);return{folderAncestorIds:u,hasLoadedAncestors:i,setHasLoadedAncestors:d}},ue=n(18911),fe=n(16536),pe=n(47497),ve=n(78581);var he=function(e){var t=(0,ve.FS)("create_folder");if(t){var n=t.name.replace("create_folder_","").replace("_start","");e.find((function(e){return e.name===decodeURIComponent(n)}))&&(0,ve.Nf)("create_folder_".concat(n))}},me=n(49182),ge=n(9882),xe=function(e){var t=e.activeFolderId,n=e.folderTreeWrapperHeight,o=e.isSidenav,r=e.tree,d=(0,ge.D)(),l=d.activeTab,s=d.setTab,c=d.sidebarTabActiveFolderId,u=d.setSidebarTabActiveFolderId,f=(0,ae.Z)(),p=f.personalFolders,v=f.sharedFolders;(0,a.useEffect)((function(){var e=(0,me.xN)((0,i.Z)(p).concat((0,i.Z)(v)),String(t));if(e&&t!==c&&o){var n=e.isShared?"shared":"personal";u(t),l!==n&&s(n)}}),[t,l,o,p,u,s,v,c]),(0,a.useEffect)((function(){t&&o&&(null===r||void 0===r?void 0:r.current)&&r.current.scrollToItem(String(t),"smart")}),[t,n,o,r])},be=(0,c.iv)("padding-left:2px;","FolderTree.tsx--treeStyle"),Ze=(0,c.iv)("width:calc(100% - 15px) !important;","FolderTree.tsx--nodeRootStyle"),Ie=(0,c.iv)("border-radius:3px;outline:none !important;transition:background-color 0.2s !important;transition:border 0.2s !important;transition:box-shadow 0.2s !important;border:2px solid transparent !important;background-color:transparent;&:focus{box-shadow:0 0 0 2px ",f.w.blue80," !important;border:2px solid ",f.w.white," !important;}&:hover,&:focus{background-color:",f.w.acidWash," !important;color:",f.w.blueJeans," !important;outline:none !important;// use CSS instead of Icon.props for color to enable hover styling\n svg{fill:",f.w.blueJeans,"!important;}}","FolderTree.tsx--hoverFocusStyle"),Se=(0,c.iv)("background-color:",f.w.acidWash," !important;color:",f.w.blueJeans," !important;svg{fill:",f.w.blueJeans," !important;}","FolderTree.tsx--activeItemStyle"),we=(0,c.F4)("0%{background-color:transparent;}5%{background-color:",f.w.acidWash,";}100%{background-color:transparent;}","FolderTree.tsx--highlightAnimation"),ye=(0,c.iv)("animation:10s ease-out ",we,";","FolderTree.tsx--highlightedItemStyle"),Ce=(0,c.iv)("border:2px solid ",f.w.blueJeans," !important;background:",f.w.acidWash," !important;","FolderTree.tsx--selectedItemStyle"),Fe=function(e,t){return"".concat(e?"sidenav":"modal","-folder-").concat(t)},ke=function(e,t){return t.map((function(t){return Fe(e,t)})).join(" ")},Ne=function(e){var t=e.data,n=t.immediateChildIds,i=t.id,l=t.isLeaf,s=t.name,c=t.nestingLevel,f=t.isSuperAdmin,v=t.memberId,h=t.isSidenav,m=e.isOpen,g=e.style,x=e.toggle,b=(0,r.Z)(e.data,["immediateChildIds","id","isLeaf","name","nestingLevel","isSuperAdmin","memberId","isSidenav"]),Z=(0,re.n)(),I=Z.setIsOpen,S=Z.isOpen,w=(0,ee.X8)(),y=m||S(i),C=(0,a.useCallback)((function(){h||(0,de.ZC)({accountId:w,isNested:!!b.parentId,isOpen:y}),I((0,o.Z)({},i,!y)),x()}),[I,x,y,i,b,w,h]),F=f?(0,ue.do)(i,v):(0,ue.do)(i),k=(0,a.useMemo)((function(){return ke(h,n)}),[h,n]),N=(0,a.useMemo)((function(){return Fe(h,i)}),[h,i]),T=(0,p.Zj)({id:"Folder-".concat((0,fe.F)(s),"-").concat(i,"-").concat(h),disabled:!h,data:{folderShared:b.isShared,folderName:s,folderId:i}}),A=T.setNodeRef,D=T.isOver,B=T.active;return(0,a.useEffect)((function(){"sidebar-drag"!==(null===B||void 0===B?void 0:B.id)&&D&&!y&&C()}),[D,y,C,B]),(0,d.tZ)("div",{style:g,css:[Ze,Ie,(b.isActive||D)&&Se,b.isSelected&&Ce,b.isHighlighted&&ye],id:N,ref:A,children:(0,d.tZ)(G,{ariaControls:k,folderDepth:c,id:i,name:s,href:(0,u.isUndefined)(b.onClick)?F:"",ownerId:b.ownerId,parentId:b.parentId,rootId:b.rootId,isActive:b.isActive,isShared:b.isShared,isOpen:y,toggle:C,hasChildren:!l,isSidenav:h,onClick:b.onClick})})},Te=function(e){var t=e.folders,n=e.folderTreeWrapperHeight,o=e.folderType,r=void 0===o?"all":o,c=e.includeDefaultFolder,u=e.isSidenav,f=void 0===u||u,p=e.isSuperAdmin,v=void 0!==p&&p,h=e.moveFolderSearchQuery,m=e.onItemClick,g=e.selectedFolderId,x=(0,a.useRef)(null),b=(0,pe.Z)(),Z=b.folderId,I=b.highlightedFolderId,S=b.search,w=b.memberId,y=(0,re.n)().setIsOpen;xe({activeFolderId:Z,folderTreeWrapperHeight:n,isSidenav:f,tree:x});var C=le({inheritedFolders:t,folderType:r,includeDefaultFolder:c});he(C);var F=ce({activeFolderId:Z}),k=F.folderAncestorIds,N=F.hasLoadedAncestors,T=F.setHasLoadedAncestors,A=ce({activeFolderId:I}),D=A.folderAncestorIds,B=A.hasLoadedAncestors,M=A.setHasLoadedAncestors,L=N&&B,X=ie({activeFolderId:Z,folderAncestorIds:k,folders:C,isSidenav:f,isSuperAdmin:v,memberId:w,moveFolderSearchQuery:h,onItemClick:m,searchQuery:S,selectedFolderId:g,highlightedFolderId:I}),R=(0,a.useCallback)((function(e){var t;return null===(t=x.current)||void 0===t?void 0:t.recomputeTree(e)}),[]);return(0,a.useEffect)((function(){var e=(0,i.Z)(k||[]).concat((0,i.Z)(D||[]));if(!L&&e.length){k.length&&T(!0),D.length&&M(!0);var t=e.reduce((function(e,t){return e[t]=!0,e}),{});R({opennessState:t,refreshNodes:!0,useDefaultOpenness:!1}),y(t)}}),[k,D,R,L,y,T,M]),(0,a.useEffect)((function(){f||R({refreshNodes:!!h,useDefaultOpenness:!0})}),[f,h,R]),(0,d.tZ)(s.Z,{defaultHeight:400,defaultWidth:300,style:{paddingLeft:"5px"},children:function(e){var t=e.height,n=e.width;return(0,d.tZ)(l.NC,{ref:x,treeWalker:X,itemSize:48,overscanCount:15,height:t,width:n,css:be,children:Ne})}})},Ae=Te},1083:function(e,t,n){var o,r;n.d(t,{Zq:function(){return r},sq:function(){return o}}),function(e){e.all="all",e.empty="",e.folder="folder",e.zap="zap",e.webhook="webhook"}(o||(o={})),function(e){e.empty="",e.personal="personal",e.shared="shared"}(r||(r={}))},38921:function(e,t,n){var o=n(70865),r=n(96670),i=n(66383),d=n(92228),a=n(50930),l=n(52903),s=n(28165),c=n(2784),u=n(76635),f=n(70776),p=n(28952),v=n(66266),h=n(55414),m=n(17688),g=n(42126),x=n(20271),b=n(20110),Z=n(38716),I=n(87744),S=n(28316),w=n(1639),y=n(67710),C=n(27459),F=n(71139),k=n(85150),N=n(25120),T=n(80327),A=n(38153),D=n(16181),B=n(49182),M=n(70882);function L(){var e=(0,d.Z)(["\n display: grid;\n grid-gap: 10px;\n "]);return L=function(){return e},e}function X(){var e=(0,d.Z)(["\n grid-gap: 10px;\n width: 600px;\n "]);return X=function(){return e},e}function R(){var e=(0,d.Z)(["\n height: 200px;\n gap: 10px;\n border: 1px solid ",";\n border-radius: 5px;\n padding: 10px 10px 10px 10px;\n "]);return R=function(){return e},e}function z(){var e=(0,d.Z)(["\n height: 350px;\n "]);return z=function(){return e},e}function E(){var e=(0,d.Z)(["\n display: grid;\n grid-gap: 20px;\n grid-template-columns: 1fr;\n padding: 10px 20px 10px 20px;\n "]);return E=function(){return e},e}function O(){var e=(0,d.Z)(["\n margin: auto;\n display: flex;\n padding: 10px 20px 10px 20px;\n gap: 20px;\n "]);return O=function(){return e},e}var q=(0,I.uq)({mobile:(0,s.iv)(L()),tablet:(0,s.iv)(X())}),P=(0,I.uq)({mobile:(0,s.iv)(R(),f.w.neutral300),tablet:(0,s.iv)(z())}),_=(0,I.uq)({mobile:(0,s.iv)(E()),tablet:(0,s.iv)(O())}),H=(0,s.iv)('div[class*="ModalContent"]{max-height:80vh !important;}',"MoveNestedFolderModal.tsx--modalContentStyle");function U(e){var t=e.currentItemId,n=e.currentItemIsShared,d=e.currentItemParentId,s=e.currentItemTitle,f=e.isBulk,p=e.onAccept,v=e.onClose,I=e.onConfirmMoveIntoSharedFolder,S=e.onConfirmMoveIntoTrash,w=e.onUnnest,L=e.selectedFullZaps,X=e.type,R=e.zapOwnedByUser,z=(0,Z.X8)(),E=(0,D.gn)().userId,O=(0,c.useRef)(null),H=(0,i.Z)((0,T.Z)(),1)[0],U=(0,c.useCallback)((0,u.debounce)((function(){(null===O||void 0===O?void 0:O.current)&&(O.current.scrollTop>0&&(0,N.G3)({accountId:z,isNested:!!d}))}),250),[O]),J=(0,c.useMemo)((function(){return f?s:'"'.concat(s,'" ').concat("folder"===X?" folder":"")}),[f,s,X]),W=(0,c.useState)(),j=W[0],Q=W[1],$=(0,c.useState)(!1),Y=$[0],K=$[1],V=(0,c.useState)(""),G=V[0],ee=V[1],te=(0,y.Z)().filterFolders,ne=(0,C.Z)({includeDefaultFolder:!0}),oe=ne.personalFolders,re=ne.sharedFolders,ie=(0,M.Z)().trashFolder,de=(0,c.useMemo)((function(){return"folder"===X?n?re:(0,a.Z)(oe).concat((0,a.Z)(re)):f?(null===L||void 0===L?void 0:L.every((function(e){return(0,A.V7)(e,E)})))?(0,a.Z)(oe).concat((0,a.Z)(re),[ie]):re:R?(0,a.Z)(oe).concat((0,a.Z)(re),[ie]):re}),[n,f,oe,L,re,ie,X,E,R]),ae=(0,c.useState)([]),le=ae[0],se=ae[1],ce=(0,c.useCallback)((0,u.debounce)((function(e){var t=te(de,e);ee(e),(0,N.gX)({accountId:z,isNested:!!d,searchString:e}),se(t)}),250),[te,de]),ue=(0,c.useCallback)((function(){v(),(0,N.ad)({accountId:z,isNested:!!d})}),[v,z,d]),fe=(0,c.useCallback)((function(e){(0,N.Ut)({accountId:z,destinationFolderName:e.text,isDestinationNested:!!e.parentId,isNested:!!d}),Q(e)}),[Q,z,d]),pe=(0,c.useMemo)((function(){return G?le:de}),[le,G,de]);(0,c.useEffect)((function(){K(!!(null===j||void 0===j?void 0:j.isShared))}),[null===j||void 0===j?void 0:j.isShared]);return(0,l.BX)("form",{css:q,"data-testid":"move-folder-form",onSubmit:function(e){var o,r;return e.preventDefault(),"zap"===X&&(null===j||void 0===j?void 0:j.isShared)&&I&&((null===L||void 0===L?void 0:L.some((function(e){var t;return!(null===(t=(0,B.xN)(re,e.folderId))||void 0===t?void 0:t.isShared)})))||!n)?I(null===j||void 0===j?void 0:j.id,null===j||void 0===j?void 0:j.name):j&&String(null===j||void 0===j?void 0:j.id)!==String(t)?"-1"===String(null===j||void 0===j?void 0:j.id)&&S?S():(o=null===j||void 0===j?void 0:j.id,r=null===j||void 0===j?void 0:j.name,o&&r&&(p(o,r),(0,N.pm)({accountId:z,isDestinationNested:!!(null===j||void 0===j?void 0:j.parentId),isNested:!!d}))):v(),!1},children:[(0,l.tZ)(h.x,{tag:"h1",textAlign:"center",type:"paragraph1Bold",children:"Move ".concat(J," to selected folder")}),(0,l.tZ)(m.g,{label:"Search",renderInput:function(e){return(0,l.tZ)(g.o,(0,r.Z)((0,o.Z)({},e),{ref:H,ariaControls:"folder-tree",type:"search",onChange:function(e){ce(e.target.value.toString())},placeholder:"Filter folders"}))}}),"folder"===X&&Y&&j&&(0,l.BX)(x.b,{layout:"banner",title:"You're sharing this folder with others.",children:["Moving ",s," into ",null===j||void 0===j?void 0:j.name," will make everything in ",s," visible to people who have access to"," ",null===j||void 0===j?void 0:j.name,"."]}),(0,l.tZ)("div",{css:P,onScroll:U,ref:O,children:pe.length?(0,l.tZ)(k.P,{id:"move-nested-folders",children:(0,l.tZ)(F.FolderTree,{folders:pe,isSidenav:!1,moveFolderSearchQuery:!!G,onItemClick:fe,selectedFolderId:null===j||void 0===j?void 0:j.id,includeDefaultFolder:!0})}):(0,l.tZ)(h.x,{children:"No folders found."})}),(0,l.BX)("div",{css:_,children:[(0,l.tZ)(b.z,{color:"secondary",onClick:ue,children:"Cancel"}),"folder"===X&&(0,u.isFunction)(w)&&(0,l.tZ)(b.z,{disabled:!d,type:"button",onClick:w,children:"Move to top level"}),(0,l.tZ)(b.z,{disabled:!j||"folder"===X&&String(null===j||void 0===j?void 0:j.id)===String(t)||String(null===j||void 0===j?void 0:j.id)===String(d),type:"submit",children:"Move to folder"})]})]})}t.Z=function(e){var t=(0,w.Z)("move-nested-folder-modal");return(0,S.createPortal)((0,l.tZ)("div",{css:H,children:(0,l.tZ)(p.u,{ariaLabel:"move ".concat(e.type),canScrollBody:!1,onClosed:e.onClose,children:(0,l.tZ)(v.hz,{children:(0,l.tZ)(U,(0,o.Z)({},e))})})}),t)}},47897:function(e,t,n){n.d(t,{Z:function(){return O}});var o=n(52903),r=n(66830),i=n(2784),d=n(92228),a=n(28165),l=n(28316),s=n(15504),c=n(74936),u=n(1639),f=n(53736),p=n(70776),v=n(75725),h=n(87593),m=n(38716),g=n(14725),x=n(50248),b=(0,a.iv)('// style tooltip so it lives outside nested folder item dropdown\n [class^="css-"][class*="-TooltipWrapper"][class$="--non-interactive"]{display:inherit !important;position:inherit !important;}[class^="css-"][class$="-Tooltip"]{border-radius:10px !important;padding:16px 14px !important;text-align:left !important;}',"NestedFolderItemDropdownItem.tsx--tooltipWrapperStyle"),Z=(0,a.iv)("button{&:hover,&:focus{background-color:",p.w.blue10,";color:",p.w.blue,";}}","NestedFolderItemDropdownItem.tsx--baseButtonStyle"),I=(0,a.iv)("background:transparent;border:0 none transparent;display:flex;align-items:center;gap:8px;box-sizing:border-box;height:44px;justify-content:flex-start;width:100%;border-radius:3px;color:",p.w.neutral700,";min-width:200px;padding:0 10px;","NestedFolderItemDropdownItem.tsx--itemStyle"),S=(0,a.iv)("button{&:hover,&:focus{background-color:",p.w.error100," !important;span{color:",p.w.error400," !important;}}}","NestedFolderItemDropdownItem.tsx--warningItemStyle"),w=(0,a.iv)("span{cursor:not-allowed !important;color:",p.w.neutral500," !important;}button{&:hover,&:focus{cursor:not-allowed !important;background-color:",p.w.blue10," !important;color:",p.w.neutral500," !important;span{color:",p.w.neutral500," !important;}}}","NestedFolderItemDropdownItem.tsx--disabledItemStyle"),y=function(e){var t=e.avroEvent,n=e.closeDropdown,r=e.disabled,d=e.href,a=e.id,l=e.onClick,s=e.text,c=e.toolTipPosition,u=e.toolTipText,f=e.trackUserInteraction,p=e.warningHighlight,y=(0,m.X8)(),C=(0,i.useCallback)((function(){(0,g.Z)({accountId:y,eventAction:"click",interactionName:"",optionSelected:t,systemName:"zap-management"})}),[y,t]);return(0,o.tZ)("div",{css:b,children:(0,o.tZ)(h.p,{allowMultilineTooltip:!0,content:u,position:c,tooltipId:"DropdownItem-tooltip-nested-".concat(a),children:function(){return(0,o.tZ)("div",{"data-testid":"dropdown-item-".concat(s),onClick:function(){t&&f&&C()},onKeyDown:(0,x.q)(["enter"],(function(){t&&f&&C()})),role:"button",css:[Z,!!p&&S,!!r&&w],children:(0,o.tZ)(v.s,{href:d,onClick:function(){n&&n(),l&&l()},role:"menuitem",children:(0,o.tZ)("span",{css:I,children:s})})})}})})},C=n(4863),F=n(43600),k=n(39386),N=n(25120),T=n(90285),A=n(47497),D=n(23755);function B(){var e=(0,d.Z)(["\n > div {\n top: ","px !important;\n left: ","px !important;\n }\n "]);return B=function(){return e},e}var M=(0,a.iv)("position:relative;","NestedFolderItemDropdown.tsx--rootStyle"),L=(0,a.iv)("> div{position:fixed !important;bottom:auto !important;right:auto !important;z-index:1000 !important;}","NestedFolderItemDropdown.tsx--fixedPositionStyle"),X=(0,a.F4)("0%{opacity:0;}100%{opacity:0.15;}","NestedFolderItemDropdown.tsx--overlayKeyframes"),R=(0,a.iv)("opacity:0.15;animation:",X," 0.5s;background:black;position:fixed;left:0;top:0;height:100vh;width:100vw;z-index:999;overflow:hidden;","NestedFolderItemDropdown.tsx--overlayStyle"),z=(0,a.iv)("padding:10px;& ul{padding:4px !important;// makes space for focus outlines}& ul li button,& ul li a{padding:0 !important;// we need this for the warning hover state,or we see the blue background behind the padding\n text-decoration:none;}","NestedFolderItemDropdown.tsx--listStyle"),E=function(e){var t=e.align,n=void 0===t?"left":t,r=e.ariaLabel,d=e.closeDropdown,p=e.folderDepth,v=e.folderId,h=e.id,g=e.isNested,x=e.isShared,b=e.nestedFolderItemRef,Z=e.ownerId,I=e.setCurrentAction,S=e.trackUserInteraction,w=void 0!==S&&S,X=(0,i.useRef)(null),E=(0,f.l)().createNotification,O=(0,A.Z)().memberId,q=(0,m.X8)(),P=(0,i.useCallback)((function(){I(C.x.rename),(0,N.iJ)({accountId:q,isNested:g})}),[I,q,g]),_=(0,i.useCallback)((function(){I(C.x.delete),(0,N.Cb)({accountId:q,isNested:g})}),[I,q,g]),H=(0,i.useCallback)((function(){I(C.x.create),(0,N.qj)({accountId:q,isNested:g})}),[I,q,g]),U=(0,i.useCallback)((function(){I(C.x.move),(0,N.P3)({accountId:q,isNested:g})}),[I,q,g]),J=(0,i.useCallback)((function(){p>=4?(0,T.Z)({accountId:q,createNotification:E}):H()}),[E,p,H,q]),W=(0,i.useCallback)((function(){I(x?C.x.shareFolder:C.x.shareFolderConfirmation)}),[I,x]),j=function(e){var t=e.handleShowCreateFolderModal,n=e.showDeleteFolder,o=e.showMoveFolder,r=e.showRenameFolder,d=e.showShareFolder,a=e.ownerId,l=e.memberId,s=e.folderId,c=e.isShared,u=(0,k.Z)({folderId:s}),f=(0,F.Z)({folder:u,ownerId:a,selectedMemberId:l}),p=f.canCreateSharedFolders,v=f.canCreateSubFolder,h=f.canMove,m=f.canShare,g=f.disabledDeleteMessage,x=f.disabledShareMessage;return(0,i.useMemo)((function(){return[h?{onClick:o,text:"Move"}:void 0,!v||c&&!p?void 0:{onClick:t,text:"New Folder"},{onClick:r,text:"Rename"},m?{onClick:x?null:d,text:"Share",disabled:Boolean(x),toolTipText:x}:void 0,{onClick:g?null:n,text:"Delete",warningHighlight:!0,disabled:Boolean(g),toolTipText:g}].filter((function(e){return Boolean(e)}))}),[p,v,h,m,g,x,t,c,n,o,r,d])}({folderId:v,ownerId:Z,memberId:O,isShared:x,handleShowCreateFolderModal:J,showDeleteFolder:_,showMoveFolder:U,showRenameFolder:P,showShareFolder:W}),Q=(0,u.Z)("nested-folder-item-overlay-".concat(h)),$=(0,i.useMemo)((function(){if(b){var e,t=document.body.getBoundingClientRect(),n=null===b||void 0===b||null===(e=b.current)||void 0===e?void 0:e.getBoundingClientRect(),o=((null===n||void 0===n?void 0:n.left)||0)-t.left+((null===n||void 0===n?void 0:n.width)||0)-228,r=((null===n||void 0===n?void 0:n.top)||0)-t.top+((null===n||void 0===n?void 0:n.height)||0);return r+204>t.height&&(r=r-204-((null===n||void 0===n?void 0:n.height)||0)),n?(0,a.iv)(B(),r,o):void 0}}),[b]);(0,i.useEffect)((function(){var e;(null===X||void 0===X?void 0:X.current)&&(null===(e=X.current.querySelector("button"))||void 0===e||e.focus())}),[]);var Y=(0,o.BX)(o.HY,{children:[(0,o.tZ)(D.Z,{onClickOutside:function(){b&&d()},children:(0,o.tZ)("div",{css:[M,b&&L,$],children:(0,o.tZ)(s.f,{align:n,position:"south",children:(0,o.tZ)("div",{css:z,ref:X,children:(0,o.tZ)(c.v,{ariaLabel:r,id:h,role:"menu",children:j.map((function(e){var t=e.avroEvent,n=e.disabled,r=e.href,i=e.onClick,a=e.text,l=e.toolTipText,s=e.warningHighlight;return(0,o.tZ)(y,{avroEvent:t,closeDropdown:d,disabled:n,href:r,id:"".concat(h,"-{icon}-").concat(a),onClick:i,text:a,toolTipText:l,toolTipPosition:b?"east":"west",trackUserInteraction:w,warningHighlight:s},"".concat(h,"-{icon}-").concat(a))}))})})})})}),!!b&&(0,o.tZ)("div",{css:R})]});return b?(0,l.createPortal)(Y,Q):Y},O=function(e){var t=e.folderDepth,n=e.folderId,d=e.isNested,a=e.isShared,l=e.nestedFolderItemRef,s=e.ownerId,c=e.setCurrentAction,u=e.text,f=(0,m.X8)(),p=(0,i.useRef)(null),v=(0,i.useState)(!1),h=v[0],g=v[1],x=(0,i.useState)(!1),b=x[0],Z=x[1];(0,i.useEffect)((function(){if(l){var e;if(!b&&h)if(g(!1),null===p||void 0===p?void 0:p.current)null===(e=p.current.querySelector("button"))||void 0===e||e.focus();b?(g(!0),document.body.setAttribute("style","position: fixed; width: 100vw;")):document.body.setAttribute("style","")}}),[b,h,l]);var I=(0,i.useCallback)((function(){Z(!b),(0,N.LZ)({accountId:f,isNested:d,isOpen:b})}),[f,d,Z,b]);return(0,o.tZ)("div",{ref:p,children:(0,o.BX)(D.Z,{onClickOutside:function(){!l&&b&&I()},children:[(0,o.tZ)(r.h,{ariaControls:"folder-actions-dropdown-".concat(n),ariaExpanded:b,ariaHaspopup:!0,ariaLabel:"Folder actions for ".concat(u),onClick:I,icon:"navMoreHoriz",size:"xsmall"}),b&&(0,o.tZ)(E,{align:"right",ariaLabel:"Folder actions menu",closeDropdown:I,folderDepth:t,folderId:n,id:"folder-actions-dropdown-".concat(n),isNested:d,isShared:!!a,nestedFolderItemRef:l,ownerId:s,setCurrentAction:c})]})})}},90755:function(e,t,n){var o=n(98788),r=n(47842),i=n(5163),d=n(52903),a=n(2784),l=n(5632),s=n(38716),c=n(29282),u=n(6237),f=n(38921),p=n(34757),v=n(42457),h=n(40205),m=n(4863),g=n(52008),x=n(18911),b=n(57504),Z=n(69237),I=n(25120),S=n(85150);t.Z=function(e){var t=e.currentAction,n=e.folderId,w=e.folderIsShared,y=e.folderParentId,C=e.folderTitle,F=e.rootId,k=e.setCurrentAction,N=(0,s.X8)(),T=(0,l.useRouter)(),A=T.push,D=T.asPath,B=(0,Z.Z)({accountId:N,folderId:n}),M=B.deleteFolder,L=B.deleteFolderAncestors,X=B.moveFolder,R=B.shareFolder,z=B.updateFolder,E=(0,S.n)().setIsOpen;(0,a.useEffect)((function(){t===m.x.move&&(0,I.y6)({accountId:N,isNested:!!y,isOpen:!0})}),[t,y,N]);var O=(0,a.useCallback)((function(){t===m.x.move&&(0,I.y6)({accountId:N,isNested:!!y,isOpen:!1}),k(m.x.none)}),[k,N,y,t]),q=(0,a.useCallback)(function(){var e=(0,o.Z)((function(e){return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,z((0,g.Z)(n),{title:e})];case 1:return t.sent(),k(m.x.none),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[n,k,z]),P=(0,a.useCallback)((0,o.Z)((function(){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,M((0,g.Z)(n))];case 1:return e=t.sent().data,k(m.x.none),D.includes(String((0,g.Z)(n)))&&e&&A&&A(y?(0,x.do)(y):(0,x.D)()),[2]}}))})),[M,A,n,k,y,D]),_=(0,a.useCallback)((function(){var e=Number(F)||Number(n);R(e,{isShared:!0}),k(m.x.none)}),[R,k,n,F]);return(0,d.BX)(a.Fragment,{children:[t===m.x.delete&&(0,d.tZ)(u.Z,{folderTitle:C,onClose:O,onConfirm:P}),t===m.x.rename&&(0,d.tZ)(p.Z,{currentTitle:C,onAccept:q,onClose:O}),t===m.x.create&&(0,d.tZ)(c.Z,{isShared:w,parentId:n,onClose:O,onAccept:function(){E&&E((0,r.Z)({},n.toString(),!0))},targetParentFolderName:C}),t===m.x.move&&(0,d.tZ)(f.Z,{onAccept:function(e){e&&X({folderId:(0,g.Z)(e),folderIds:[(0,g.Z)(n)]}),k(m.x.none)},onClose:O,onUnnest:function(){L((0,g.Z)(n)),k(m.x.none)},currentItemId:n,currentItemParentId:y,currentItemTitle:C,currentItemIsShared:w,type:"folder"}),t===m.x.shareFolderConfirmation&&(0,d.tZ)(v.Z,{bodyText:(0,d.BX)(a.Fragment,{children:["Are you sure you want to share your ",(0,d.tZ)("strong",{children:C})," ","folder?"]}),confirmationText:"Share folder",headerText:"Share folder?",onClose:O,onConfirm:_}),!!n&&!(0,b.Z)(n)&&t===m.x.shareFolder&&(0,d.tZ)(h.Z,{folderId:(0,g.Z)(n),parentFolderId:F,onClose:O})]})}},4863:function(e,t,n){var o;n.d(t,{x:function(){return o}}),function(e){e.create="create",e.delete="delete",e.move="move",e.none="none",e.rename="rename",e.shareFolder="shareFolder",e.shareFolderConfirmation="shareFolderConfirmation"}(o||(o={}))},90285:function(e,t,n){var o=n(52903),r=n(25120);t.Z=function(e){var t=e.accountId,n=e.createNotification;return(0,r.Yn)({accountId:t}),n({type:"warning",message:(0,o.tZ)("div",{children:"Subfolders are currently limited to 5 levels."})})}},34757:function(e,t,n){var o=n(70865),r=n(96670),i=n(66383),d=n(92228),a=n(52903),l=n(2784),s=n(28165),c=n(28316),u=n(28952),f=n(66266),p=n(55414),v=n(17688),h=n(42126),m=n(20110),g=n(87744),x=n(83766),b=n(1639),Z=n(80327);function I(){var e=(0,d.Z)(["\n display: grid;\n grid-gap: 10px;\n grid-template-columns: 1fr;\n "]);return I=function(){return e},e}function S(){var e=(0,d.Z)(["\n display: flex;\n margin: auto;\n gap: 20px;\n "]);return S=function(){return e},e}var w=(0,s.iv)("display:grid;grid-gap:20px;min-width:min(50vw,688px);max-width:688px;","RenameFolderModal.tsx--rootStyle"),y=(0,g.uq)({mobile:(0,s.iv)(I()),tablet:(0,s.iv)(S())}),C=(0,s.iv)('div[data-type="append"]{background-color:inherit !important;font-size:10px !important;font-weight:normal !important;justify-content:flex-end !important;line-height:0 !important;}',"RenameFolderModal.tsx--folderTitleInputStyle"),F=function(e){return"\nRename folder ".concat(e||"")};function k(e){var t=e.currentTitle,n=e.onClose,d=e.onAccept,s=(0,l.useState)(t||""),c=s[0],u=s[1],f=(0,i.Z)((0,Z.Z)(),1)[0];return(0,a.BX)("form",{css:w,"data-testid":"rename-folder-form",onSubmit:function(e){e.preventDefault(),d(c)},children:[(0,a.tZ)(p.x,{tag:"h1",textAlign:"center",type:"paragraph1Bold",children:F(t)}),(0,a.tZ)(v.g,{isRequired:!0,label:"Name",renderInput:function(e){return(0,a.tZ)("div",{css:C,children:(0,a.tZ)(h.o,(0,r.Z)((0,o.Z)({},e),{ref:f,appendContent:(0,a.tZ)(x.Z,{count:c.length,limit:255}),layout:"block",maxLength:255,value:c,onChange:function(e){return u(e.target.value)}}))})}}),(0,a.BX)("div",{css:y,children:[(0,a.tZ)(m.z,{color:"secondary",onClick:n,type:"button",children:"Cancel"}),(0,a.tZ)(m.z,{disabled:!(null===c||void 0===c?void 0:c.length),type:"submit",children:"Save"})]})]})}t.Z=function(e){var t=(0,b.Z)("rename-folder-modal");return(0,c.createPortal)((0,a.tZ)(u.u,{onClosed:e.onClose,ariaLabel:F(e.currentTitle),children:(0,a.tZ)(f.hz,{children:(0,a.tZ)(k,(0,o.Z)({},e))})}),t)}},40205:function(e,t,n){n.d(t,{Z:function(){return ie}});var o=n(70865),r=n(66383),i=n(92228),d=n(50930),a=n(52903),l=n(2784),s=n(28316),c=n(28165),u=n(59712),f=n(70776),p=n(28952),v=n(66266),h=n(55414),m=n(22211),g=n(20110),x=n(19928),b=n.n(x),Z=n(76635),I=n.n(Z),S=n(96670),w=n(41273),y=n(17688),C=n(25914),F=n(38716),k=n(3842);function N(){var e=(0,i.Z)(["\n query ShareSearch($accountId: Int!, $search: String) {\n searchShare(accountId: $accountId, search: $search) {\n description\n id\n imageUrl\n name\n role\n type\n }\n }\n"]);return N=function(){return e},e}var T=(0,n(60138).Ps)(N()),A=n(73223);var D=function(){var e=(0,r.Z)((0,k.t)(T),2),t=e[0],n=e[1],o=n.data;return{loading:n.loading,results:[{description:"",id:"all",imageUrl:A.Um,name:"Everyone",type:"team"}].concat((0,d.Z)((null===o||void 0===o?void 0:o.searchShare)||[])),search:t}},B=n(80327),M=(0,c.iv)("display:block;margin:5px;","SearchMemberInput.tsx--rootStyle"),L=function(e){var t=e.onSelect,n=e.ownerId,r=(0,l.useState)(""),i=r[0],d=r[1],s=(0,F.X8)(),c=D(),u=c.search,f=c.results,p=c.loading;(0,B.Z)({id:"folder-member-selector-input"});var v=(0,l.useCallback)((0,Z.debounce)((function(e){s&&u({variables:{accountId:s,search:e}})}),1e3),[]);(0,l.useEffect)((function(){v(i)}),[i,v]);var h=function(e){return f.find((function(t){return t.id===e}))},m=function(e){d(e)},g=function(e){var n=e.value,o=h(n);o&&t(o)},x=(0,l.useMemo)((function(){return(f||[]).filter((function(e){return e.id!==n})).map((function(e){var t=e.description,n=e.id,o=e.name;return{label:"".concat(o).concat(t?", ".concat(t):""),value:n}}))}),[JSON.stringify(f),n]),b=function(e){var t=e.label,n=e.value,o=h(n);return(0,a.tZ)(w.q,{name:"".concat(t," profile image"),url:null===o||void 0===o?void 0:o.imageUrl})},I=function(e){return e.label};return(0,a.tZ)("span",{css:M,children:(0,a.tZ)(y.g,{isRequired:!1,label:"Find people to share with",renderInput:function(e){return(0,a.tZ)(C.Z,(0,S.Z)((0,o.Z)({},e),{getLabelForItem:I,inputValue:i,id:"folder-member-selector",isBusy:p,items:x,menuAriaLabel:"List of members",onChange:g,onInputValueChange:m,placeholder:"Email, name, or team name",renderIcon:b,selectedItem:null}))}})})},X=n(87744),R=n(66830),z=(0,c.iv)("display:flex;justify-content:space-between;align-items:center;padding:5px 0;","ShareFolderMember.tsx--rootStyle"),E=(0,c.iv)("display:flex;align-items:center;gap:10px;","ShareFolderMember.tsx--leftStyle"),O=(0,c.iv)("display:flex;flex-flow:column nowrap;margin-top:-2px;overflow-x:hidden;","ShareFolderMember.tsx--textStyle"),q=function(e){var t=e.description,n=e.imageUrl,o=e.memberId,r=e.name,i=e.onRemove;return(0,a.BX)("span",{css:z,children:[(0,a.BX)("span",{css:E,children:[(0,a.tZ)(w.q,{name:r,size:40,url:n}),(0,a.BX)("span",{css:O,children:[(0,a.tZ)(h.x,{type:"smallPrint1",children:r}),(0,a.tZ)(h.x,{color:"neutral700",type:"smallPrint3",children:t})]})]}),!!i&&(0,a.tZ)(R.h,{color:"icon-secondary",icon:"formX",label:"Remove member sharing",onClick:function(e){e.preventDefault(),i&&i()},size:"xsmall",tooltipId:"".concat(o,"-remove-member-sharing"),tooltipPosition:"west"})]})},P=n(12954),_=n(99603),H=n(1639),U=n(39386);function J(){var e=(0,i.Z)(["\n display: grid;\n grid-gap: 15px;\n min-width: min(50vw, 400px);\n "]);return J=function(){return e},e}function W(){var e=(0,i.Z)(["\n grid-gap: 20px;\n max-width: 100%;\n "]);return W=function(){return e},e}function j(){var e=(0,i.Z)(["\n display: grid;\n grid-gap: 20px;\n grid-template-columns: 1fr;\n padding: 10px, 20px, 10px, 20px;\n "]);return j=function(){return e},e}function Q(){var e=(0,i.Z)(["\n margin: auto;\n display: flex;\n padding: 10px, 20px, 10px, 20px;\n gap: 20px;\n "]);return Q=function(){return e},e}function $(){var e=(0,i.Z)(["\n overflow-y: auto;\n max-height: 190px;\n "]);return $=function(){return e},e}var Y=(0,c.iv)("display:flex;flex-flow:column nowrap;justify-content:space-between;gap:15px;min-width:min(50vw,400px);overflow-y:auto;flex:1 1 auto;","ShareFolderModal.tsx--rootStyles"),K=(0,X.uq)({mobile:(0,c.iv)(J()),tablet:(0,c.iv)(W())}),V=(0,c.iv)("> div{max-height:none !important;max-width:550px !important;min-height:min(600px,50vh) !important;display:flex !important;}","ShareFolderModal.tsx--modalContentStyle"),G=(0,c.iv)("& + li{border-top:1px solid ",f.w.neutral300,";}","ShareFolderModal.tsx--shareFolderMemberStyle"),ee=(0,c.iv)("display:flex;flex-flow:column nowrap;gap:10px;","ShareFolderModal.tsx--infoTextStyle"),te=(0,c.iv)("display:flex;justify-content:center;","ShareFolderModal.tsx--loadingStyle"),ne=(0,X.uq)({mobile:(0,c.iv)(j()),tablet:(0,c.iv)(Q())}),oe=(0,X.uq)({mobile:(0,c.iv)($())});function re(e){var t,n=e.folderId,o=e.parentFolderId,i=e.onClose;(0,u.jj)("open ShareFolderModal");var s=(0,_.Z)({folderId:n}),c=s.folder,f=s.isLoading,p=(0,U.Z)({folderId:n}),v=(0,U.Z)({folderId:o}),x=(0,P.Z)({folderId:n}),Z=x.createFolderMembership,S=x.createFolderTeamship,w=x.deleteFolderMembership,y=x.deleteFolderTeamship,C=x.folderShares,F=(0,r.Z)(l.useState([]),2),k=F[0],N=F[1],T=(0,r.Z)(l.useState([]),2),A=T[0],D=T[1],B=(0,r.Z)(l.useState([]),2),M=B[0],X=B[1];l.useEffect((function(){C&&X(C)}),[c,C]);var R=l.useCallback((function(e){(null===C||void 0===C?void 0:C.some((function(t){return t.id===e.id})))&&D(I().uniqBy((0,d.Z)(A).concat([e]),"id")),"all"===e.id&&k.some((function(e){return"all"===e.id}))?X(null!==C&&void 0!==C?C:M):X(I().filter(M,(function(t){return t.id!==e.id}))),N(I().filter(k,(function(t){return t.id!==e.id})))}),[D,A,N,k,M,X,C]),z=l.useCallback((function(e){(null===C||void 0===C?void 0:C.some((function(t){return t.id===e.id})))||N(I().uniqBy((0,d.Z)(k).concat([e]),"id"));var t=I().filter(A,(function(t){return t.id!==e.id}));if(D(t),"all"===e.id)X([e]);else{(null===C||void 0===C?void 0:C.some((function(e){return"all"===e.id})))&&D(I().uniqBy([{id:"all"}].concat((0,d.Z)(t)),"id"));var n=I().filter(M,(function(e){return"all"!==e.id}));X(I().uniqBy((0,d.Z)(n).concat([e]),"id"))}}),[D,A,N,k,M,X,C]),E=l.useCallback((function(){var e=!0,t=!1,n=void 0;try{for(var o,r=A[Symbol.iterator]();!(e=(o=r.next()).done);e=!0){var d=o.value;"all"===d.id?y():"team"===d.type?y(d.id):w({memberId:d.id})}}catch(p){t=!0,n=p}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}var a=!0,l=!1,s=void 0;try{for(var c,u=k[Symbol.iterator]();!(a=(c=u.next()).done);a=!0){var f=c.value;"all"===f.id?S():"team"===f.type?S(f.id):Z({memberId:f.id})}}catch(p){l=!0,s=p}finally{try{a||null==u.return||u.return()}finally{if(l)throw s}}i()}),[Z,S,w,y,k,A,i]),O=(null===c||void 0===c?void 0:c.title)||(null===p||void 0===p?void 0:p.name)?'"'.concat((null===c||void 0===c?void 0:c.title)||(null===p||void 0===p?void 0:p.name),'"'):null;return(0,a.BX)("form",{css:Y,"data-testid":"share-folder-form",children:[(0,a.BX)("div",{css:K,children:[(0,a.tZ)(h.x,{tag:"h1",textAlign:"center",type:"paragraph1ShortBold",children:"Share ".concat(O," folder")}),o&&(0,a.BX)("div",{css:ee,children:[(0,a.tZ)(h.x,{tag:"p",children:"This folder is part of the ".concat(null===v||void 0===v?void 0:v.name," folder. Changing its sharing settings affects the ").concat(null===v||void 0===v?void 0:v.name," folder\u2019s sharing settings, and that of all of its subfolders.")}),(0,a.tZ)(h.x,{tag:"p",children:"Owners, Super Admins, and Admins have access to all shared folders."})]}),!o&&!!(null===p||void 0===p?void 0:p.children)&&(0,a.BX)("div",{css:ee,children:[!!(null===p||void 0===p?void 0:p.children.length)&&(0,a.tZ)(h.x,{tag:"p",children:"This folder contains subfolders. Changing its sharing settings will affect all subfolders."}),(0,a.tZ)(h.x,{tag:"p",children:"Owners, Super Admins, and Admins have access to all shared folders."})]}),f?(0,a.tZ)("div",{css:te,children:(0,a.tZ)(m.$,{size:"medium"})}):(0,a.tZ)(a.HY,{children:(0,a.BX)(a.HY,{children:[(0,a.tZ)("div",{children:(0,a.tZ)(L,{onSelect:z,ownerId:null===c||void 0===c||null===(t=c.owner)||void 0===t?void 0:t.id})}),(0,a.tZ)("div",{css:oe,children:(0,a.BX)("ul",{children:[!!(null===c||void 0===c?void 0:c.owner)&&!(null===M||void 0===M?void 0:M.some((function(e){return"all"===e.id})))&&(0,a.tZ)("li",{css:G,children:(0,a.tZ)(q,{description:"".concat(c.owner.email," (Owner)"),imageUrl:c.owner.imageUrl||"",name:c.owner.name})}),null===M||void 0===M?void 0:M.map((function(e){var t="";return"member"===e.type?t=e.email||e.description:e.memberCount||0===e.memberCount?t="".concat(e.memberCount," ").concat(b()("member",e.memberCount)):(null===e||void 0===e?void 0:e.description)&&(t=e.description),(0,a.tZ)("li",{css:G,children:(0,a.tZ)(q,{description:t,imageUrl:e.imageUrl||"",memberId:e.id,name:"all"===e.id?"Everyone":e.name,onRemove:function(){return R(e)}})},e.id)}))]})})]})})]}),(0,a.BX)("div",{css:ne,children:[(0,a.tZ)(g.z,{onClick:i,type:"button",color:"secondary",children:"Cancel"}),(0,a.tZ)(g.z,{onClick:E,type:"button",children:"Share Folder"})]})]})}var ie=function(e){var t=(0,H.Z)("share-folder-modal");return(0,s.createPortal)((0,a.tZ)(p.u,{ariaLabel:"Share folder",canScrollBody:!0,onClosed:e.onClose,children:(0,a.tZ)(v.hz,{children:(0,a.tZ)("div",{css:V,children:(0,a.tZ)(re,(0,o.Z)({},e))})})}),t)}},43600:function(e,t,n){var o=n(38716),r=n(16181),i=n(14033),d=n(52008),a=n(9466),l=n(39386);t.Z=function(e){var t,n,s,c=e.folder,u=e.ownerId,f=e.selectedMemberId,p=(0,d.Z)(null===c||void 0===c?void 0:c.id),v=(0,o.X8)(),h=(0,r.gn)(),m=h.allowImportExport,g=h.userId,x=h.roles,b=(0,i.Z)(),Z=b.canShareFolders,I=b.canCreateSharedFolders,S=(0,l.Z)({folderId:null===c||void 0===c?void 0:c.id}),w=Z,y=(0,l.Z)({folderId:null===S||void 0===S?void 0:S.rootId}),C=y?"This folder can't be shared because it is a subfolder. To change who it's shared with, edit ".concat((null===y||void 0===y?void 0:y.name)||"the root folder","'s sharing settings."):"",F=(null===c||void 0===c||null===(t=c.owner)||void 0===t?void 0:t.id)&&String(null===c||void 0===c||null===(n=c.owner)||void 0===n?void 0:n.id)===String(g)||String(u)===String(g)||(null===c||void 0===c?void 0:c.ownerId)&&String(null===c||void 0===c?void 0:c.ownerId)===String(g),k=!!m,N=!!(null===S||void 0===S||null===(s=S.children)||void 0===s?void 0:s.length),T="";((null===c||void 0===c?void 0:c.isShared)||(null===S||void 0===S?void 0:S.isShared))&&((null===c||void 0===c?void 0:c.zapCount)||(null===S||void 0===S?void 0:S.zapCount))&&(T="This folder can't be deleted because it contains Zaps. Please move these Zaps to another shared folder and try again."),N&&(T="This folder can't be deleted because it has subfolders. Please move your subfolders and try again.");var A,D=!!(null===x||void 0===x?void 0:x.some((function(e){return String(null===e||void 0===e?void 0:e.accountId)===String(v)&&("owner"===e.role||"super_admin"===e.role||"admin"===e.role)})));(F||D)&&(F||(null===c||void 0===c?void 0:c.isShared))||(T="This folder can't be deleted because you are not the owner. Contact ".concat((null===c||void 0===c||null===(A=c.owner)||void 0===A?void 0:A.name)||"folder owner"," to delete the folder."));var B=!(0,a.Z)(p)&&((null===c||void 0===c?void 0:c.isShared)||!f||f===String(g));return{canCreateSharedFolders:I,canCreateSubFolder:B,canCreateZap:B,canExport:k,canMove:B,canShare:w,disabledDeleteMessage:T,disabledShareMessage:C}}},2569:function(e,t,n){var o=n(2784),r=n(40794),i=n(61945),d=n(35591),a=n(57504);t.Z=function(e){var t=e.accountId,n=e.folderId,l=(0,o.useState)(!1),s=l[0],c=l[1];(0,o.useEffect)((function(){c(!1)}),[n]);var u=(0,r.a)(i.l,{notifyOnNetworkStatusChange:!0,onCompleted:function(){return c(!0)},onError:function(e){(0,d.Z)("FolderAncestors",e)},skip:!t||!n||(0,a.Z)(n),variables:{accountId:t,folderId:n}}),f=u.data,p=u.loading;return{folderAncestors:(0,o.useMemo)((function(){return(null===f||void 0===f?void 0:f.folderAncestors)||[]}),[f]),folderAncestorsLoading:p,folderAncestorsLoaded:s}}},67710:function(e,t,n){var o=n(70865),r=n(96670),i=n(49182),d=n(1083);t.Z=function(){var e=function(t,n){return t.reduce((function(t,i){var d,a=i.name.toLowerCase().includes(n.toLowerCase()),l=(null===(d=i.children)||void 0===d?void 0:d.length)?e(i.children,n):[];return(l.length||a)&&t.push((0,r.Z)((0,o.Z)({},i),{children:l})),t}),[])},t=function(e,n,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=!0,a=!1,l=void 0;try{for(var s,c=e[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value,f=u.name.toLowerCase().includes(n.toLowerCase()),p=o&&(o===d.Zq.shared&&u.isShared||o===d.Zq.personal&&!u.isShared);u.children&&t(u.children,n,o,r),!f||o&&!p||r.push(u)}}catch(v){a=!0,l=v}finally{try{i||null==c.return||c.return()}finally{if(a)throw l}}return r},n=function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t){var r=(0,i.xN)(e,String(t));return o.unshift(r),n(e,null===r||void 0===r?void 0:r.parentId,o)}return o};return{filterFolders:e,strictFilterFolders:t,findFolderAncestors:n}}},16536:function(e,t,n){n.d(t,{F:function(){return o}});var o=function(e){return e?e.split(" ").join("-"):""}}}]);
//# sourceMappingURL=8195-6d92109b80fc4484.js.map