forked from sindresorhus/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
611-d211995d01468817.js.download
2 lines (2 loc) · 131 KB
/
611-d211995d01468817.js.download
1
2
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[611],{56101:function(e,n,t){var r=t(92228),i=t(52903),o=t(2784),a=t(28165),l=t(70776),d=t(55414),s=t(61854),c=t(26215),u=t(87744),p=t(18911);function h(){var e=(0,r.Z)(['\n align-items: center;\n display: flex;\n text-overflow: ellipsis;\n width: 100%;\n & span[class*="navFolderFill"] {\n padding-top: 2px !important;\n }\n ']);return h=function(){return e},e}function v(){var e=(0,r.Z)(["\n display: -webkit-box;\n -webkit-line-clamp: 2;\n white-space: normal;\n -webkit-box-align: start;\n "]);return v=function(){return e},e}var f=(0,u.uq)({mobile:(0,a.iv)(h()),zapTable:(0,a.iv)(v())}),m=(0,a.iv)("text-decoration:underline;a{&:hover,&:focus{text-decoration-color:transparent !important;color:",l.w.night," !important;text-decoration-color:",l.w.night," !important;transition:text-decoration-color 0.1s 0.2s,color 0.2s !important;}}","FolderAncestors.tsx--folderNameStyle");n.Z=function(e){var n=e.currentFolderId,t=e.currentFolderName,r=e.folderAncestors,a=e.showFolderIcon,l=void 0===a||a;return(0,i.tZ)("span",{css:f,children:(0,i.BX)(d.x,{type:"smallPrint1",children:[l&&(0,i.BX)(o.Fragment,{children:[(0,i.tZ)(s.J,{size:14,name:"navFolderFill"})," "]}),"in"," ",r.map((function(e,n){return(0,i.BX)(o.Fragment,{children:[(0,i.tZ)("span",{css:m,children:(0,i.tZ)(c.r,{name:e.name,href:(0,p.do)(e.id),children:e.name})},e.id),n!==r.length-1&&" > "]},e.id)})),t&&n?(0,i.BX)(o.Fragment,{children:[r.length?" > ":"",(0,i.tZ)("span",{css:m,children:(0,i.tZ)(c.r,{name:t,href:(0,p.do)(n),children:t})})]}):""]})})}},89921:function(e,n,t){var r=t(52903),i=t(70776),o=t(66830),a=t(28165),l=t(2784),d=(0,a.iv)("button,a{margin-left:auto !important;align-items:center !important;background:transparent !important;border-radius:10px !important;border:2px solid transparent !important;color:",i.w.neutral800," !important;display:flex !important;height:44px !important;justify-content:center !important;margin-left:auto !important;padding:0 !important;transition:background-color 0.3s !important;width:44px !important;&:hover,&:focus{color:",i.w.blueJeans," !important;background-color:",i.w.acidWash," !important;border:2px solid ",i.w.blueJeans," !important;outline:none !important;}}","TransparentIconButton.tsx--buttonStyle"),s=(0,l.forwardRef)((function(e,n){var t=e.ariaControls,i=e.ariaExpanded,a=e.ariaHasPopup,l=e.ariaLabel,s=e.dataTestId,c=e.href,u=e.iconName,p=e.onClick,h=e.showTooltip;return(0,r.tZ)("div",{css:d,ref:n,"data-testid":s,children:(0,r.tZ)(o.h,{icon:u,size:"small",href:c,onClick:p,ariaControls:t,ariaExpanded:i,ariaHaspopup:a,ariaLabel:l,label:h?l:"",tooltipPosition:"west"})})}));n.Z=s},39996:function(e,n,t){t.d(n,{Z:function(){return D}});var r=t(52903),i=t(2784),o=t(5632),a=t(47497),l=t(28165),d=t(38716),s=t(70776),c=t(3e3),u=t(61854),p=t(42126),h=t(20110),v=t(15504),f=t(74936),m=t(75725),g=t(78581),Z=t(23755),b=t(14725),w=(0,l.iv)("position:relative;left:-1px;> button{border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;&:focus,&:active{z-index:1 !important;}}","FolderZapSearchInputV2.tsx--magnifyButtonStyle"),x=(0,l.iv)("align-items:center;background:inherit;border:0;border-right:1px solid ",s.w.neutral600,";cursor:pointer;display:flex;height:100%;justify-content:center;width:100%;padding:0 8px;","FolderZapSearchInputV2.tsx--iconButtonStyle"),y=(0,l.iv)("display:flex;height:45px;* div{margin:0px !important;}","FolderZapSearchInputV2.tsx--textInputWrapperStyle"),I=(0,l.iv)('flex:1;position:relative;right:-1px;> div{border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;}* input{padding-left:9px !important;}&:focus,&:active,&:focus-within{[data-testid="FolderZapSearchOptions"]{border-right:1px solid ',s.w.blueJeans," !important;box-shadow:0 0 0 1px ",s.w.blueJeans,' !important;}}&:hover{[data-testid="FolderZapSearchOptions"]{border-right:1px solid ',s.w.blueJeans," !important;}}","FolderZapSearchInputV2.tsx--textInputStyle"),S=(0,l.iv)('position:relative;[data-testid="floating-box"]{width:100% !important;}',"FolderZapSearchInputV2.tsx--dropdownMenuStyle"),k=(0,l.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;}","FolderZapSearchInputV2.tsx--listStyle"),F=(0,l.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:",s.w.neutral700,";min-width:200px;padding:0 10px;","FolderZapSearchInputV2.tsx--itemStyle"),z=(0,l.iv)("display:flex;justify-content:center;align-items:center;",c.ZT.paragraph3Medium," &:hover,&:focus{background-color:",s.w.blue10,";color:",s.w.blueJeans,";& > span{color:inherit;}}padding:0 10px;","FolderZapSearchInputV2.tsx--menuItemStyle"),C=(0,l.iv)("align-items:center;background:inherit;border:none;cursor:pointer;display:flex;height:100%;justify-content:center;width:100%;","FolderZapSearchInputV2.tsx--clearButtonStyle"),T=(0,l.iv)(c.ZT.base,";",c.ZT.smallPrint1Bold,";align-items:center;background-color:",s.w.blue100,";border-radius:100px;color:",s.w.neutral800,";display:inline-flex;font-size:14px;font-weight:700;gap:5px;height:26px;justify-content:center;line-height:20px;padding:3px 8px;text-align:center;margin-left:9px;","FolderZapSearchInputV2.tsx--badgeStyle"),A=function(e){var n=e.searchQuery,t=e.setSearchQuery,l=(0,d.X8)(),s=(0,o.useRouter)(),c=(0,a.Z)(),A=c.searchType,D=c.setParams,B=(0,i.useState)(!1),_=B[0],E=B[1],M=(0,i.useState)(A||""),N=M[0],L=M[1],q=(0,i.useCallback)((function(){E(!_),(0,b.Z)({accountId:l,eventAction:_?"close":"open",interactionName:"search_type_interaction",optionSelected:"",systemName:"settings"})}),[l,_,E]),R=(0,i.useCallback)((function(){n&&(s.push({pathname:"/app/zaps",query:{search:n,searchType:N||"all"}}),(0,g.Ch)("search-".concat(encodeURI(n)))),_&&q()}),[q,_,s,n,N]),P=(0,i.useCallback)((function(e){"Enter"===e.key&&R()}),[R]),X=(0,i.useCallback)((function(e){var n=e.target.value;t(n)}),[t]),O=(0,i.useCallback)((function(e){e.preventDefault(),D({},["search","searchType"]),t(""),L("")}),[D,t]),U=(0,i.useCallback)((function(e){(0,b.Z)({accountId:l,eventAction:"click",interactionName:"search_type_interaction",optionSelected:e,systemName:"settings"})}),[l]),H=(0,i.useMemo)((function(){return[{searchType:"all",label:"All",icon:"miscWorld"},{searchType:"folder",label:"Folders",icon:"team"},{searchType:"zap",label:"Zaps",icon:"miscBoltAlt"}]}),[]),W=(0,i.useMemo)((function(){var e=H.find((function(e){return e.searchType===N}));return e?(0,r.BX)("span",{css:T,"aria-hidden":"true",children:[(0,r.tZ)(u.J,{name:e.icon,size:14}),e.label]}):null}),[N,H]);return(0,r.tZ)(i.Fragment,{children:(0,r.BX)(Z.Z,{onClickOutside:function(){_&&q()},children:[(0,r.BX)("div",{css:y,children:[(0,r.tZ)("div",{css:I,"data-testid":"FolderZapFolderZapSearchInputV2",children:(0,r.tZ)(p.o,{ariaLabel:"Input search term to search Zaps, folders or both",onChange:X,onKeyDown:P,renderIconBefore:function(e){var n=e.iconSize,t=e.isFocused,o=e.isHovered,a=t||o?void 0:"neutral600";return(0,r.BX)(i.Fragment,{children:[(0,r.tZ)("button",{"data-testid":"FolderZapSearchOptions",css:x,onClick:function(){return q()},"aria-haspopup":"listbox","aria-expanded":_,"aria-controls":"zap-folder-search-dropdown","aria-label":"Select if you would like to search for Zaps, folders, or both",children:(0,r.tZ)(u.J,{canAcceptPointerEvents:!1,color:a,name:_?"arrowSmallDown":"arrowSmallRight",size:n})}),N&&W]})},renderIconAfter:function(e){var t=e.iconSize,i=e.isFocused,o=e.isHovered,a=i||o?void 0:"neutral600";return n||N?(0,r.tZ)("button",{css:C,onClick:O,"aria-label":"Clear search",children:(0,r.tZ)(u.J,{canAcceptPointerEvents:!1,color:a,name:"formX",size:t})}):null},type:"search",value:n})}),(0,r.tZ)("div",{css:w,"data-testid":"FolderZapSearchButtonV2",children:(0,r.tZ)(h.z,{ariaLabel:"Search for ".concat("all"!==N&&N?"".concat(N,"s"):"Zaps and folders"),color:"primary-alt",iconBefore:"magnifyingGlass",id:"top-search-button",onClick:R,size:"small",children:"Search"})})]}),_&&(0,r.tZ)("div",{css:S,children:(0,r.tZ)(v.f,{align:"left",position:"south",children:(0,r.tZ)("div",{css:k,children:(0,r.tZ)(f.v,{ariaLabel:"Search by Zap, folder, or both",id:"zap-folder-search-dropdown",role:"listbox","aria-roledescription":"Select if you would like to search for Zaps, folders, or both",children:H.map((function(e){return(0,r.tZ)(m.s,{ariaLabel:e.label,isSelected:N===e.searchType,onClick:function(){L(e.searchType),q(),U(e.searchType)},role:"option",children:(0,r.BX)("div",{"data-testid":"zap-folder-search-dropdown-item-".concat(e.label),css:z,children:[(0,r.tZ)(u.J,{name:e.icon,size:"small"}),(0,r.tZ)("span",{css:[F],children:e.label})]})},"zap-folder-search-dropdown-item-".concat(e.label))}))})})})})]})})},D=function(){var e=(0,o.useRouter)(),n=(0,a.Z)().search,t=(0,i.useState)(n||""),l=t[0],d=t[1];return(0,i.useEffect)((function(){var n=function(e){!e.includes("search=")&&l&&d("")};return e.events.on("routeChangeComplete",n),function(){e.events.off("routeChangeComplete",n)}})),(0,r.tZ)(A,{setSearchQuery:d,searchQuery:l})}},25666:function(e,n,t){var r=t(52903),i=t(28165),o=t(70776),a=t(2784),l=(0,i.iv)("background-color:",o.w.peach,";","HighlightedText.tsx--highlightStyle");n.Z=function(e){var n=e.text,t=e.highlight,i=n.split(new RegExp("(".concat(t,")"),"gi")).map((function(e,n){return e.toLowerCase()===(null===t||void 0===t?void 0:t.toLowerCase())?(0,r.tZ)("mark",{css:l,children:e},n):e}));return(0,r.tZ)(a.Fragment,{children:t?i:n})}},84913:function(e,n,t){var r=t(92228),i=t(52903),o=t(28165),a=t(99570),l=t(61854),d=t(55414),s=t(26215),c=t(87744),u=t(59400);function p(){var e=(0,r.Z)(["\n max-width: 100%;\n align-self: center;\n margin-bottom: 10px;\n "]);return p=function(){return e},e}function h(){var e=(0,r.Z)(["\n max-width: 570px;\n "]);return h=function(){return e},e}function v(){var e=(0,r.Z)(["\n align-items: center;\n display: flex;\n flex-flow: column nowrap;\n gap: 15px;\n padding: 30px;\n word-break: break-word;\n "]);return v=function(){return e},e}function f(){var e=(0,r.Z)(["\n padding: 60px;\n gap: 30px;\n "]);return f=function(){return e},e}var m=(0,o.iv)("display:flex;flex-direction:column;margin:50px 0;width:100%;","NoSearchResults.tsx--rootStyle"),g=(0,o.iv)("display:flex;justify-content:flex-end;","NoSearchResults.tsx--feedbackStyle"),Z=(0,c.uq)({mobile:(0,o.iv)(p()),tablet:(0,o.iv)(h())}),b=(0,c.uq)({mobile:(0,o.iv)(v()),tablet:(0,o.iv)(f())});n.Z=function(e){var n=e.query,t=(0,u.Z)().isSearchServiceMVPEnabled;return(0,i.BX)("div",{css:m,children:[(0,i.tZ)("div",{css:Z,"data-testid":"EmptySearch-root",children:(0,i.tZ)(a.T,{borderColor:"neutral300",children:(0,i.BX)("div",{css:b,children:[(0,i.tZ)(l.J,{color:"neutral400",name:"magnifyingGlass",size:"50px"}),(0,i.tZ)(d.x,{tag:"p",textAlign:"center",type:"paragraph1",children:'No results found for "'.concat(n,'"')})]})})}),t&&(0,i.tZ)("div",{css:g,children:(0,i.BX)(d.x,{tag:"p",children:["Not what you're looking for?"," ",(0,i.tZ)(s.r,{href:"https://zap-search.zapier.app",target:"_blank",children:"Leave feedback"})]})})]})}},94525:function(e,n,t){var r=t(2784),i=t(73223),o=t(49243),a=function(e){return e?"".concat("https://zapier.com","/generated/").concat(e,"/64/"):i.hn};n.Z=function(e){return{services:(0,r.useMemo)((function(){var n;return e.steps?((null===e||void 0===e?void 0:e.steps)||[]).map((function(n){var t,r,i,o,l,d,s,c;return{authenticationId:(null===(r=null===e||void 0===e||null===(t=e.zdl)||void 0===t?void 0:t.steps.find((function(e){return e.id===n.id})))||void 0===r?void 0:r.authentication_id)||(null===(o=null===e||void 0===e||null===(i=e.zdl)||void 0===i?void 0:i.steps.find((function(e){return e.id===n.id})))||void 0===o?void 0:o.authenticationId),name:(null===(l=n.app)||void 0===l?void 0:l.name)||"",src:(null===(d=n.app)||void 0===d||null===(s=d.images)||void 0===s?void 0:s.url32X32)||a(null===(c=n.app)||void 0===c?void 0:c.id)}})):e.nodes?e.nodes.map((function(e){return{authenticationId:e.authId,name:e.selectedApi||"",src:a(e.selectedApi)}})):((null===e||void 0===e||null===(n=e.zdl)||void 0===n?void 0:n.steps)||[]).map((function(e,n){return{authenticationId:e.authentication_id||e.authenticationId,name:"Step ".concat(n),src:a(e.app)}}))}),[e]),serviceNames:(0,o.Z)((null===e||void 0===e?void 0:e.steps)||[])}}},84505:function(e,n,t){t.d(n,{Z:function(){return F}});var r=t(52903),i=t(28165),o=t(70776),a=t(15504),l=t(55414),d=t(74936),s=t(2784),c=t(75725),u=t(61854),p=t(87593),h=t(50248),v=t(38716),f=t(14725),m=(0,i.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;}',"DropdownItem.tsx--tooltipWrapperStyle"),g=(0,i.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%;min-width:200px;padding:0 10px;","DropdownItem.tsx--itemStyle"),Z=(0,i.iv)("&:hover,&:focus{background-color:",o.w.error100,";color:",o.w.error400,";}","DropdownItem.tsx--warningItemStyle"),b=(0,i.iv)("background-color:",o.w.blue20,";border-radius:5px;display:flex;padding:2px 5px;margin-left:auto;box-sizing:border-box;","DropdownItem.tsx--badgeStyle"),w=(0,i.iv)("color:",o.w.neutral500,";&:hover,&:focus{background-color:",o.w.white,";color:",o.w.neutral500,";}","DropdownItem.tsx--disabledItemStyle"),x=function(e){var n=e.avroEvent,t=e.badge,i=e.closeDropdown,o=e.disabled,a=e.href,d=e.icon,x=e.id,y=e.onClick,I=e.text,S=e.toolTipText,k=e.trackUserInteraction,F=e.warningHighlight,z=(0,v.X8)(),C=(0,s.useCallback)((function(){(0,f.Z)({accountId:z,eventAction:"click",interactionName:"zap_kebab_interaction",optionSelected:n,systemName:"settings"})}),[z,n]);return(0,r.tZ)("div",{css:m,children:(0,r.tZ)(p.p,{allowMultilineTooltip:!0,content:S,position:"west",tooltipId:"DropdownItem-tooltip-".concat(x),children:function(){return(0,r.tZ)("div",{"data-testid":"dropdown-item-".concat(I),onClick:function(){n&&k&&C()},onKeyDown:(0,h.q)(["enter"],(function(){n&&k&&C()})),role:"button",children:(0,r.tZ)(c.s,{href:a,onClick:function(){i&&i(),y&&y()},role:"menuitem",children:(0,r.BX)("span",{css:[g,!!F&&Z,!!o&&w],children:[d&&(0,r.tZ)(u.J,{name:d,size:"25px"}),I,t&&(0,r.tZ)("span",{css:b,children:(0,r.tZ)(l.x,{color:"neutral800",type:"smallPrint3Bold",children:t})})]})})})}})})},y=(0,i.iv)('position:relative;// highlight delete button in red\n [data-testid="dropdown-item-Delete"]{button{&:hover,&:focus{background-color:',o.w.error100," !important;span{color:",o.w.error400," !important;}}}}","ZapDropdown.tsx--zapDropdownRootStyle"),I=(0,i.iv)("padding:15px 20px;& 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;}","ZapDropdown.tsx--listStyle"),S=(0,i.iv)("margin:10px 20px 10px 0px;border-bottom:1px solid ",o.w.neutral300,";padding-bottom:10px 0;height:0px;","ZapDropdown.tsx--dividerStyle"),k=(0,i.iv)(S," padding:0 0 10px 10px;height:auto;","ZapDropdown.tsx--bulkActionsHeaderStyle"),F=function(e){var n=e.align,t=void 0===n?"left":n,i=e.ariaLabel,o=e.closeDropdown,s=e.header,c=e.id,u=e.items,p=e.trackUserInteraction,h=void 0!==p&&p;return(0,r.tZ)("div",{css:y,children:(0,r.tZ)(a.f,{align:t,position:"south",children:(0,r.BX)("div",{css:I,children:[s&&(0,r.tZ)("div",{css:k,children:(0,r.tZ)(l.x,{color:"neutral700",type:"paragraph3Bold",children:s})}),(0,r.tZ)(d.v,{ariaLabel:i,id:c,role:"menu",children:u.map((function(e,n){if(e.hasOwnProperty("text")){var t=e.avroEvent,i=e.badge,a=e.disabled,l=e.href,d=e.icon,s=e.onClick,u=e.text,p=e.toolTipText,v=e.warningHighlight;return(0,r.tZ)(x,{avroEvent:t,badge:i,closeDropdown:o,disabled:a,href:l,icon:d,id:"".concat(c,"-{icon}-").concat(u),onClick:s,text:u,toolTipText:p,trackUserInteraction:h,warningHighlight:v},"".concat(c,"-{icon}-").concat(u))}return(0,r.tZ)("div",{css:S},n)}))})]})})})}},71738:function(e,n,t){t.d(n,{Z:function(){return Ce}});var r=t(52903),i=t(2784),o=t(28316),a=t(28165),l=t(59712),d=t(76635),s=t(38716),c=t(66383),u=t(92228),p=t(70776),h=t(37168),v=t(55414),f=t(66415),m=t(20271),g=t(88106),Z=t(20110),b=t(87593),w=t(47043),x=t(87744),y=t(3e3),I=t(56813),S=t(89921),k=(0,a.iv)("margin-top:15px;","ZapDetailsDrawerTitle.tsx--rootStyles"),F=(0,a.iv)("display:flex;align-items:center;gap:5px;",y.ZT.sectionHeader3Semibold," button{color:",p.w.neutral600," !important;}","ZapDetailsDrawerTitle.tsx--titleStyles"),z=function(e){var n=e.emitRenameEvent,t=e.onRename,o=e.title,a=e.zapId,l=(0,i.useState)(!1),s=l[0],c=l[1],u=(0,i.useCallback)((function(){c(!s)}),[s]);return s&&(0,d.isFunction)(t)?(0,r.tZ)("div",{css:k,children:(0,r.tZ)(I.Z,{boldInput:!0,loadedText:o,onAccept:t,onClose:u,placeholder:"Enter Zap Title"})}):(0,r.BX)("div",{css:[k,F],children:[(0,r.tZ)("h3",{role:"presentation",id:"details-header",onClick:function(){n(),u()},children:o}),(0,d.isFunction)(t)&&(0,r.tZ)(S.Z,{onClick:function(){n(),u()},ariaLabel:"Edit zap title",dataTestId:"edit-zap-title-".concat(a),iconName:"actionEdit"})]})},C=t(99603),T=t(2569),A=t(56101),D=t(73223),B=(0,a.iv)("align-items:center;display:flex;padding-bottom:5px;gap:5px;> span{width:inherit !important;}button{color:",p.w.neutral600," !important;}","ZapDetailsDrawerLocation.tsx--rootStyle"),_=function(e){var n=e.emitMoveEvent,t=e.folderId,i=e.onMove,o=(0,s.X8)(),a=(0,C.Z)({folderId:t}),l=a.folder,c=a.isLoading,u=(0,T.Z)({accountId:o,folderId:Number(t)}),p=u.folderAncestors,h=u.folderAncestorsLoading;return c||h?(0,r.tZ)("div",{css:B,children:(0,r.tZ)(w.q,{height:40,width:"100%"})}):(console.log(null===l||void 0===l?void 0:l.title,l),(0,r.BX)("div",{css:B,children:[(0,r.tZ)(A.Z,{currentFolderId:null===l||void 0===l?void 0:l.id,currentFolderName:(null===l||void 0===l?void 0:l.title)||D.bo||(null===l||void 0===l?void 0:l.name),folderAncestors:p,showFolderIcon:!1}),(0,d.isFunction)(i)&&(0,r.tZ)(S.Z,{onClick:function(){n(),i()},ariaLabel:"Move zap to different folder",iconName:"actionMoveToFolder"})]}))},E=t(76128),M=t(51320),N=(0,a.iv)("display:flex;align-items:center;gap:5px;button{color:",p.w.neutral600," !important;}","ZapDetailsDrawerOwner.tsx--ownerStyle"),L=(0,a.iv)("font-size:14px;font-weight:normal;white-space:nowrap;","ZapDetailsDrawerOwner.tsx--labelStyle"),q=function(e){var n=e.email,t=e.image,o=e.name,a=e.onChangeOwner,l=e.emitChangeOwnerEvent,s=(0,i.useRef)(null);return(0,i.useEffect)((function(){var e,n;(null===(e=s.current)||void 0===e?void 0:e.querySelector("button"))&&(null===(n=s.current.querySelector("button"))||void 0===n||n.focus())}),[s]),(0,r.BX)("div",{css:N,children:[(0,r.tZ)("span",{css:L,children:o?"Owned by:":(0,r.tZ)(E.g,{children:(0,r.tZ)(f.N,{lines:1,size:"body",width:68})})}),(0,r.tZ)(M.Z,{email:n,image:t,name:o}),(0,d.isFunction)(a)&&(0,r.tZ)(S.Z,{onClick:function(){l(),a()},ariaLabel:"Change zap owner",iconName:"actionEdit",ref:s})]})},R=t(18911);function P(){var e=(0,u.Z)(["\n display: grid;\n grid-template-columns: repeat(",", 1fr);\n "]);return P=function(){return e},e}function X(){var e=(0,u.Z)(["\n padding: 15px 40px;\n border-bottom: 1px solid ",";\n\n button,\n a {\n border: none !important;\n box-shadow: none !important;\n color: "," !important;\n width: fit-content !important;\n\n &:hover,\n &:focus {\n color: "," !important;\n }\n }\n "]);return X=function(){return e},e}var O=function(e){var n,t=e.canTransferData,o=e.emitDetailsDrawerEvent,l=e.onClose,s=e.onDuplicate,c=e.onRun,u=e.onShare,h=e.zapId,v=(0,i.useMemo)((function(){return 1+[t,(0,d.isFunction)(s),(0,d.isFunction)(c),(0,d.isFunction)(u)].filter(Boolean).length}),[s,c,u,t]);return(0,r.BX)("div",{css:(n=3===v?3:2,(0,x.uq)({tablet:(0,a.iv)(P(),n),mobile:(0,a.iv)(X(),p.w.neutral300,p.w.neutral800,p.w.blueJeans)})),"data-testid":"ZapDetailsDrawerActions",children:[(0,d.isFunction)(s)&&(0,r.tZ)(Z.z,{color:"secondary",iconBefore:"actionCopy",onClick:function(){s(),o("duplicate"),l()},size:"small",children:"Duplicate"}),(0,d.isFunction)(c)&&(0,r.tZ)(Z.z,{color:"secondary",iconBefore:"actionPlay",onClick:function(){o("run"),c()},size:"small",children:"Run Zap"}),(0,r.tZ)(Z.z,{color:"secondary",href:(0,R.Ye)(h),iconBefore:"miscClock",onClick:function(){return o("view_history")},size:"small",children:"History"}),t&&(0,r.tZ)(Z.z,{color:"secondary",onClick:function(){return o("external_data_transfer")},iconBefore:"arrowConnect",size:"small",href:(0,R.oP)(h),children:"Transfer data"}),(0,d.isFunction)(u)&&(0,r.tZ)(Z.z,{color:"secondary",iconBefore:"actionShare",onClick:function(){o("share"),u()},size:"small",children:"Share template"})]})},U=t(97177),H=t(98788),W=t(70865),V=t(96670),J=t(5163),j=t(64476),Q=t(3842),$=t(15466),G=t(31544),Y=t(57441),K=t(94525),ee=t(50293);function ne(){var e=(0,u.Z)(["\n query FolderAuths($ids: [ID!]!) {\n authenticationsById(ids: $ids) {\n edges {\n id\n isPrivate\n isStale\n }\n }\n }\n"]);return ne=function(){return e},e}var te=(0,t(60138).Ps)(ne());function re(){var e=(0,u.Z)(["\n align-items: center;\n border-radius: 5px;\n border: 2px solid ",";\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n margin: 10px 0px;\n padding: 5px;\n\n button {\n width: fit-content !important;\n }\n "]);return re=function(){return e},e}function ie(){var e=(0,u.Z)(["\n display: grid;\n grid-template-columns: fit-content(100%) 1fr fit-content(100%);\n "]);return ie=function(){return e},e}var oe=(0,a.iv)("padding:15px 0px;border-bottom:1px solid ",p.w.neutral300,";","ZapDetailsDrawerApps.tsx--rootStyles"),ae=function(e){return(0,x.uq)({mobile:(0,a.iv)(re(),e?p.w.error400:"transparent"),tablet:(0,a.iv)(ie())})},le=(0,a.iv)("margin-left:auto;","ZapDetailsDrawerApps.tsx--buttonWrapperStyles"),de=(0,a.iv)(y.ZT.paragraph3Semibold,"ZapDetailsDrawerApps.tsx--textStyles"),se=function(e){var n=e.authentications,t=e.service,o=e.emitDetailsDrawerEvent,a=(0,i.useMemo)((function(){return null===n||void 0===n?void 0:n.find((function(e){return String(e.id)==String(t.authenticationId)}))}),[n,null===t||void 0===t?void 0:t.authenticationId]),l=(0,i.useMemo)((function(){return a?a.title:t.name}),[t,a]),d=(0,ee.Z)(),s=(0,c.Z)((0,Q.t)(te),1)[0],u=(0,$.Z)({selectedApi:(null===a||void 0===a?void 0:a.isPrivate)?null===a||void 0===a?void 0:a.selectedApi:"",serviceSlug:(null===a||void 0===a?void 0:a.serviceSlug)||""}).app,p=(0,i.useCallback)((0,H.Z)((function(){var e;return(0,J.__generator)(this,(function(n){switch(n.label){case 0:return[4,d(u,a)];case 1:return(null===(e=n.sent().connection)||void 0===e?void 0:e.id)&&s({variables:{ids:[null===a||void 0===a?void 0:a.id]}}),[2]}}))})),[d,s,u,a]);return(0,r.BX)("div",{css:ae((null===a||void 0===a?void 0:a.isStale)||!1),children:[(0,r.tZ)(j.A,{serviceName:t.name,src:t.src,size:40}),(0,r.tZ)("span",{css:de,children:l}),(null===a||void 0===a?void 0:a.serviceSlug)&&(null===a||void 0===a?void 0:a.isStale)&&(0,r.tZ)("div",{css:le,children:(0,r.tZ)(Z.z,{color:"danger",size:"small",isFullWidth:!1,onClick:function(){o("reconnect"),p()},children:"Reconnect"})}),(null===a||void 0===a?void 0:a.serviceSlug)&&!(null===a||void 0===a?void 0:a.isStale)&&(0,r.tZ)("div",{css:le,children:(0,r.tZ)(S.Z,{iconName:"arrowBigRight",href:"/app/connections/".concat(a.serviceSlug),onClick:function(){o("view_connection")}})})]})},ce=function(e){var n=e.emitDetailsDrawerEvent,t=e.zapId,o=(0,s.X8)(),a=(0,G.Z)({zapId:t}),l=(0,Y.Z)({zapId:a&&!(0,d.isEmpty)(a)?null:t}).zap,c=(0,i.useMemo)((function(){return(0,V.Z)((0,W.Z)({},a,l),{accountId:String(o)})}),[o,l,a]),u=(0,K.Z)(c).services,p=c.authentications,h=(0,i.useMemo)((function(){var e;return null===(e=null===u||void 0===u?void 0:u.filter((function(e){return e.name})))||void 0===e?void 0:e.reduce((function(e,n){return e.some((function(e){return n.name?n.authenticationId?e.authenticationId===n.authenticationId:e.name===n.name:null}))||e.push(n),e}),[])}),[u]);return!h.length&&c.id?null:(0,r.BX)("div",{css:oe,children:[(0,r.tZ)(v.x,{tag:"h3",type:"sectionHeader3Semibold",children:"Apps"}),!(null===c||void 0===c?void 0:c.steps)&&(0,r.BX)("div",{css:ae(!1),children:[(0,r.tZ)(w.q,{height:30,width:30}),(0,r.tZ)(f.N,{lines:1,size:"heading"})]}),h.map((function(e){return(null===c||void 0===c?void 0:c.steps)?(0,r.tZ)(se,{service:e,authentications:p,emitDetailsDrawerEvent:n},"".concat(e.name,"-").concat(e.authenticationId)):(0,r.BX)("div",{css:ae(!1),children:[(0,r.tZ)(w.q,{height:30,width:30}),(0,r.tZ)(f.N,{lines:1,size:"heading"})]},e.name)}))]})},ue=t(49947),pe=t(5851),he=t(16181),ve=t(89739);function fe(){var e=(0,u.Z)(["\n background-color: ",";\n box-shadow: ",";\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n height: calc(100vh);\n overflow: auto;\n padding: 32px 22px;\n position: sticky;\n width: calc(100% - 50px);\n z-index: 3;\n top: 0;\n grid-row: 2 / auto;\n grid-column: 1 / auto;\n left: 100%;\n "]);return fe=function(){return e},e}function me(){var e=(0,u.Z)(["\n width: 550px;\n "]);return me=function(){return e},e}function ge(){var e=(0,u.Z)(["\n border-left: 3px solid ",";\n "]);return ge=function(){return e},e}var Ze=(0,x.uq)({mobile:(0,a.iv)(fe(),p.w.neutral100,D.D6),tablet:(0,a.iv)(me()),desktop:(0,a.iv)(ge(),p.w.neutral300)}),be=(0,a.iv)("align-items:center;border-bottom:1px solid ",p.w.neutral300,";display:grid;grid-template-columns:1fr auto auto;padding-bottom:15px;","ZapDetailsDrawer.tsx--topRowStyles"),we=(0,a.iv)("padding:15px 20px;border-top:1px solid ",p.w.neutral300,";border-bottom:1px solid ",p.w.neutral300,";","ZapDetailsDrawer.tsx--viewEditZapStyle"),xe=(0,a.iv)("display:flex;justify-content:center;margin-top:24px;width:235px;align-self:center;","ZapDetailsDrawer.tsx--deleteWrapperStyles"),ye=(0,a.iv)("margin:0 0 15px;","ZapDetailsDrawer.tsx--alertWrapperStyle"),Ie=(0,a.iv)("margin:0 0 15px;display:flex;flex-direction:column;gap:15px;","ZapDetailsDrawer.tsx--metaWrapperStyle"),Se=function(e){var n=e.canTransferData,t=e.createdAt,o=e.description,a=e.editorUrl,l=e.emitDetailsDrawerEvent,s=e.folderId,u=e.folderName,p=e.isFullZapLoading,x=e.isInTrash,y=e.isToggling,I=e.isValid,k=e.isApprovalLoading,F=e.hasPublishedVersion,C=e.lastDisabledAt,T=e.note,A=e.onChangeOwner,B=e.onClose,E=e.onDelete,M=e.onDuplicate,N=e.onMove,L=e.onRename,R=e.onRun,P=e.onShare,X=e.onZapToggle,H=e.ownerEmail,W=e.ownerId,V=e.ownerImage,J=e.ownerName,j=e.publishedAt,Q=e.status,$=e.title,G=e.timezone,Y=e.zapId,K=e.isApprovalRequired,ee=e.isRestricted,ne=e.pendingDeleteApproval,te=e.pendingEnableOrDisableApproval,re=e.userPendingApproval,ie=e.setApprovalType,oe=(0,he.gn)().userId,ae=(0,i.useCallback)((function(e){var n;!!(null===(n=e.target)||void 0===n?void 0:n.closest('div[data-testid="Modal"]'))||(B(),e.preventDefault(),e.stopPropagation())}),[B]),le=(0,c.Z)((0,h.O)({onClickOutside:ae,events:["mousedown","touchstart"]}),1)[0],de=(0,i.useState)(!1),se=de[0],fe=de[1],me=(0,i.useCallback)((function(e){"Escape"===e.key&&B()}),[B]),ge=(0,i.useCallback)((function(){K&&ie?ie(ve.lI.DELETE):se?("on"===Q&&X&&X("disable"),E&&E(),l("delete")):fe(!0)}),[K,ie,se,Q,X,E,l]);(0,i.useEffect)((function(){return document.addEventListener("keydown",me),function(){document.removeEventListener("keydown",me)}}),[me]);var Se=(0,i.useRef)(null),ke=(0,i.useRef)(null);(0,i.useEffect)((function(){var e,n,t,r=!y&&I&&!x;if((null===(e=Se.current)||void 0===e?void 0:e.querySelector("input"))&&r&&!(0,d.isFunction)(A))null===(t=Se.current.querySelector("input"))||void 0===t||t.focus();else if((null===(n=ke.current)||void 0===n?void 0:n.querySelector("button"))&&!(0,d.isFunction)(A)){var i;null===(i=ke.current.querySelector("button"))||void 0===i||i.focus()}}),[Se,ke,A,x,y,I]);var Fe=(0,i.useMemo)((function(){var e=K?ne&&ne.requested_by_user_id===oe?"Cancel request to delete":"Request to delete":"on"===Q?"Turn off and delete Zap":"Delete Zap";return se?"Yes, delete":e}),[K,se,ne,Q,oe]),ze=(0,i.useMemo)((function(){return ee?"Move your Zap to a shared folder so an admin can review your request.":K&&ne&&ne.requested_by_user_id!==oe?"Request pending to delete this Zap.":K&&re&&!ne?"You have a request pending for this Zap.":void 0}),[K,ee,ne,oe,re]);return(0,r.BX)("div",{css:Ze,role:"dialog","aria-labelledby":"details-header","data-testid":"zap-details-header",id:"zap-details-header","aria-modal":"true",ref:le,children:[(0,r.BX)("div",{css:be,children:[(0,r.tZ)(q,{email:H,emitChangeOwnerEvent:function(){return l("change_owner")},image:V,name:J,onChangeOwner:A}),X&&(0,r.tZ)("div",{ref:Se,"data-testid":"ZapDetailsDrawerZapPauseToggle-".concat(Y),children:(0,r.tZ)(U.Z,{id:Y,toggleId:"ZapPauseToggle-zap-drawer-".concat(Y),isLoading:y,isTrashed:x,isValid:I,onDisableZap:function(){return X("disable")},onEnableZap:function(){return X("enable")},status:Q,tooltipPosition:"southeast",isApprovalRequired:K,isRestricted:ee,pendingApproval:te,userPendingApproval:re,setApprovalType:ie})}),(0,r.tZ)(S.Z,{ariaLabel:"Close details drawer",iconName:"formX",onClick:B,ref:ke,showTooltip:!0})]}),(0,r.tZ)(z,{emitRenameEvent:function(){return l("rename")},onRename:L,ownerId:W,title:$,zapId:Y}),(0,r.tZ)(_,{emitMoveEvent:function(){return l("move_to_folder")},folderId:x?D.K0:s,folderName:u,onMove:N}),(0,r.BX)("div",{css:Ie,children:[(0,r.tZ)(ue.Z,{description:o,note:T,onEditorLinkClick:function(){return l("edit_note")},zapId:Y}),(0,r.tZ)(pe.Z,{canShowDrafts:!0,createdAt:t,displayInline:!0,hasDraft:!F,hasPublishedVersion:F,isLoading:p,isEnabled:"on"===Q,lastDisabledAt:C,publishedAt:j}),G?(0,r.BX)(v.x,{type:"paragraph3",children:[(0,r.tZ)(v.x,{type:"paragraph3Bold",children:"Timezone: "}),G.replace("_"," ")]}):p?(0,r.tZ)(f.N,{lines:1,width:200}):null]}),(0,r.BX)("div",{css:we,children:[x&&(0,r.tZ)("div",{css:ye,children:(0,r.tZ)(m.b,{title:"This Zap was deleted",type:"warning",children:(0,r.tZ)(g.X,{children:"To restore this Zap from the trash, move it into a folder. Zaps in the trash will be permanently deleted after 30 days."})})}),(0,r.tZ)(Z.z,{ariaLabel:"View in Editor",color:"primary",disabled:!a,href:a,isFullWidth:!0,onClick:function(){return l("view")},size:"small",children:"View in Editor"})]}),(0,r.tZ)(O,{canTransferData:n,emitDetailsDrawerEvent:l,onClose:B,onDuplicate:M,onRun:R,onShare:P,zapId:Y}),(0,r.tZ)(ce,{emitDetailsDrawerEvent:l,zapId:Y}),(0,d.isFunction)(E)&&!x&&(0,r.tZ)("div",{css:xe,children:(0,r.tZ)(b.p,{allowMultilineTooltip:!0,content:ze,position:"north",children:function(){return k?(0,r.tZ)(w.q,{height:44,width:244}):(0,r.tZ)(Z.z,{color:"danger",iconBefore:"actionTrash",isFullWidth:!0,onClick:ge,size:"small",disabled:ee||K&&ne&&ne.requested_by_user_id!==oe||K&&re&&!ne,children:Fe})}})})]})},ke=t(47497),Fe=t(14725),ze=(0,a.iv)("grid-area:actions;position:relative;display:flex;","ZapItemDrawer.tsx--dropdownStyle"),Ce=function(e){var n=e.canTransferData,t=e.createdAt,a=e.description,c=e.editorUrl,u=e.folderId,p=e.hasPublishedVersion,h=e.hideButton,v=e.id,f=e.isInTrash,m=e.isToggling,g=e.isValid,Z=e.isApprovalLoading,b=e.lastDisabledAt,w=e.note,x=e.onAcceptDelete,y=e.onChangeOwner,I=e.onDuplicate,k=e.onMove,F=e.onRename,z=e.onRun,C=e.onShare,T=e.onZapToggle,A=e.ownerEmail,D=e.ownerId,B=e.ownerImage,_=e.ownerName,E=e.publishedAt,M=e.status,N=e.timezone,L=e.title,q=e.isApprovalRequired,R=e.isRestricted,P=e.pendingDeleteApproval,X=e.pendingEnableOrDisableApproval,O=e.userPendingApproval,U=e.setApprovalType,H=(0,ke.Z)(),W=H.details,V=H.setParams,J=H.search,j=(0,i.useState)(W===v),Q=j[0],$=j[1],G=(0,s.X8)();(0,l.At)(Q,"Open Zap Details Drawer");var K=(0,i.useRef)(null),ee=(0,i.useCallback)((function(e){e&&(0,Fe.Z)({accountId:G,eventAction:"click",interactionName:"zap_details_drawer_interaction",optionSelected:e,systemName:"settings"})}),[G]),ne=(0,Y.Z)({zapId:(J||E)&&Q?v:null}),te=ne.zap,re=ne.isLoading,ie=(0,i.useState)(null),oe=ie[0],ae=ie[1],le=(0,i.useCallback)((function(){$(!0),V({details:v}),ee("open")}),[$,V,v,ee]),de=(0,i.useCallback)((function(){var e,n;$(!1),null===(n=null===(e=K.current)||void 0===e?void 0:e.querySelector("button"))||void 0===n||n.focus(),V({},["details"]),ee("close")}),[$,V,ee]);return(0,i.useEffect)((function(){var e;ae("undefined"!==typeof document?null===(e=document.getElementsByTagName("main")[0])||void 0===e?void 0:e.closest("div"):null)}),[]),(0,r.BX)("div",{css:ze,id:"zap-item-drawer-".concat(v),children:[!h&&(0,r.tZ)(S.Z,{ariaControls:"zap-item-drawer-".concat(v),ariaExpanded:Q,ariaHasPopup:!0,ariaLabel:"toggle Zap drawer",dataTestId:"zap-item-drawer-".concat(v),iconName:"arrowSmallRight",onClick:le,ref:K}),Q&&!!oe&&(0,o.createPortal)((0,r.tZ)(Se,{canTransferData:n,createdAt:t||(null===te||void 0===te?void 0:te.createdAt),description:re?"":a,editorUrl:c,emitDetailsDrawerEvent:ee,folderId:u,hasPublishedVersion:p||(null===te||void 0===te?void 0:te.hasPublishedVersion),isFullZapLoading:re,isInTrash:f,isToggling:m,isValid:g,isApprovalLoading:Z,lastDisabledAt:b||(null===te||void 0===te?void 0:te.lastDisabledAt),note:re?"":w||(null===te||void 0===te?void 0:te.note),onChangeOwner:y,onClose:de,onDelete:(0,d.isFunction)(x)?function(){x(),de()}:void 0,onDuplicate:I,onMove:k,onRename:F,onRun:z,onShare:C,onZapToggle:T,ownerEmail:A,ownerId:D,ownerImage:B,ownerName:_,publishedAt:E||(null===te||void 0===te?void 0:te.publishedAt),status:M,timezone:N||(null===te||void 0===te?void 0:te.timezone),title:L,zapId:v,isApprovalRequired:q,isRestricted:R,pendingDeleteApproval:P,pendingEnableOrDisableApproval:X,userPendingApproval:O,setApprovalType:U}),oe)]})}},47557:function(e,n,t){var r=t(52903),i=t(76128),o=t(47043);n.Z=function(){return(0,r.tZ)(i.g,{children:(0,r.tZ)(o.q,{height:55,width:"100%"})})}},48964:function(e,n,t){var r=t(92228),i=t(52903),o=t(28165),a=t(55414),l=t(53939),d=t(73223);function s(){var e=(0,r.Z)(["\n flex: 1 100%;\n width: 100%;\n margin-bottom: 10px;\n max-width: 100%;\n "]);return s=function(){return e},e}function c(){var e=(0,r.Z)(["\n flex: 0 1 auto;\n width: auto;\n margin: 0 20px 0 0;\n "]);return c=function(){return e},e}var u=(0,t(87744).uq)({mobile:(0,o.iv)(s()),tablet:(0,o.iv)(c())}),p=(0,o.iv)("display:inline-block;word-break:break-all;> h2{display:inline !important;margin-right:10px !important;}","ZapListHeaderTitle.tsx--titleStyle");n.Z=function(e){var n=e.title,t=e.folderId,r=e.isTrash,o=e.hasZaps,s=e.shouldShowSearch,c=r&&o,h=t===d.Mz&&o;return(0,i.BX)("div",{css:u,"data-testid":"ZapListHeaderTitle",children:[(0,i.BX)("div",{css:p,children:[(0,i.tZ)(a.x,{tag:"h2",type:"sectionHeader1Medium",children:n}),s&&(0,i.tZ)(a.x,{type:"paragraph3",children:"By relevance"})]}),h&&(0,i.BX)(i.HY,{children:[(0,i.tZ)(l.L,{height:10}),(0,i.tZ)(a.x,{color:"neutral700",children:"The Zaps listed below were turned off when your plan changed. You can resume them here."})]}),c&&(0,i.BX)(i.HY,{children:[(0,i.tZ)(l.L,{height:10}),(0,i.tZ)(a.x,{color:"neutral700",children:"Zaps moved to the Trash will show up here for 30 days before being deleted."})]})]})}},20388:function(e,n,t){var r;t.d(n,{y:function(){return r}}),function(e){e.createFolder="createFolder",e.deleteFolder="deleteFolder",e.exportZaps="exportZaps",e.moveNestedFolder="moveNestedFolder",e.moveZapToFolder="moveZapToFolder",e.none="none",e.renameFolder="renameFolder",e.shareFolder="shareFolder",e.shareFolderConfirmation="shareFolderConfirmation",e.moveToSharedFolderConfirmation="moveToSharedFolderConfirmation",e.deleteZap="deleteZap",e.bulkUpdateOwner="bulkUpdateOwner"}(r||(r={}))},51320:function(e,n,t){var r=t(52903),i=t(28165),o=t(41273),a=t(55414),l=t(76128),d=t(47043),s=t(66415),c=t(47886),u=(0,i.iv)('display:flex !important;gap:5px;height:23px;align-self:center;align-items:center;> div[class*="SkeletonText"]{height:23px;}',"ZapOwner.tsx--ownerStyles"),p=(0,i.iv)("flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;","ZapOwner.tsx--nameStyles"),h=(0,i.iv)("flex:0 0 auto;align-items:center;","ZapOwner.tsx--avatarStyles");n.Z=function(e){var n=e.email,t=e.image,i=e.name;return i?(0,r.BX)("span",{css:u,children:[!!t&&(0,r.tZ)("span",{css:h,children:(0,r.tZ)(o.q,{ariaHidden:!0,name:i,size:25,url:t})}),(0,r.tZ)("span",{css:p,children:(0,r.tZ)(a.x,{type:"smallPrint1Bold",children:(0,r.tZ)("strong",{"data-testid":"owner-".concat(n),children:(0,c.G)(i)})})})]}):(0,r.BX)("span",{css:u,children:[(0,r.tZ)(l.g,{children:(0,r.tZ)(d.q,{height:23,width:23,borderRadius:"50%"})}),(0,r.tZ)(l.g,{children:(0,r.tZ)(s.N,{lines:1,size:"body",width:100})})]})}},14676:function(e,n,t){var r=t(92228),i=t(52903),o=t(28165),a=t(76128),l=t(66415),d=t(87744),s=t(51320);function c(){var e=(0,r.Z)(["\n grid-area: owner;\n align-items: center;\n height: 30px;\n "]);return c=function(){return e},e}function u(){var e=(0,r.Z)(["\n width: 100px;\n white-space: nowrap;\n padding: 10px !important;\n display: table-cell !important;\n "]);return u=function(){return e},e}function p(){var e=(0,r.Z)(["\n font-size: 14px;\n font-weight: normal;\n margin-right: 5px;\n white-space: nowrap;\n "]);return p=function(){return e},e}function h(){var e=(0,r.Z)(["\n display: none;\n white-space: normal;\n "]);return h=function(){return e},e}var v=(0,d.uq)({mobile:(0,o.iv)(c()),zapTable:(0,o.iv)(u())}),f=(0,d.uq)({mobile:(0,o.iv)(p()),zapTable:(0,o.iv)(h())});n.Z=function(e){var n=e.name,t=e.email,r=e.image;return(0,i.BX)("td",{css:v,children:[(0,i.tZ)("span",{css:f,children:n?"Owned by:":(0,i.tZ)(a.g,{children:(0,i.tZ)(l.N,{lines:1,size:"body",width:68})})}),(0,i.tZ)(s.Z,{email:t,image:r,name:n})]})}},25001:function(e,n,t){t.d(n,{Z:function(){return v}});var r=t(92228),i=t(52903),o=t(28165),a=t(2784),l=t(55414),d=t(68516),s=t(87744),c=function(e,n,t){var r=(0,d.lF)(e,n,t);return r.includes("second")?"Just now":r.replace(" days","d").replace(" day","d").replace(" hours","h").replace(" hour","h").replace(" minutes","m").replace(" minute","m").replace(" weeks","w").replace(" week","w")},u=t(25155);function p(){var e=(0,r.Z)(["\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n "]);return p=function(){return e},e}var h=(0,s.uq)({tablet:(0,o.iv)(p())}),v=function(e){var n=e.canShowDrafts,t=e.createdAt,r=e.requestedAt,o=e.hasDraft,s=e.hasPublishedVersion,p=e.lastDisabledAt,v=e.publishedAt,f=e.updatedAt,m=e.zapStatus,g=(0,a.useState)(null),Z=g[0],b=g[1],w=(0,a.useCallback)((function(){return r||(o&&!s&&t?t:n&&s&&"on"===m&&v?v:n&&s&&"off"===m&&p?p:f||null)}),[n,t,o,s,p,v,r,f,m]);return(0,a.useEffect)((function(){b(w())}),[w]),Z?(0,i.tZ)("div",{css:h,"data-testid":"ZapTimestamp-root",children:(0,i.tZ)(l.x,{type:"smallPrint1",children:Math.abs((0,u.differenceInWeeks)(Date.now(),Z))>4?(0,i.tZ)(d.ou,{date:Z,format:"MMM DD, YYYY"}):(0,i.tZ)(d.ij,{date:Z,formatter:c})})}):null}},878:function(e,n,t){t.d(n,{Z:function(){return d},w:function(){return l}});var r=t(50930),i=t(52903),o=t(2784),a=(0,o.createContext)({isChecked:function(){return!1},checked:new Set,set:function(){},toggle:function(){},clear:function(){},uncheck:function(){return new Set},check:function(){return new Set},contextMenuCoords:null,setContextMenuCoords:function(){}}),l=function(e){var n=e.children,t=e.initialSelection,l=void 0===t?new Set:t,d=(0,o.useState)(l),s=d[0],c=d[1],u=(0,o.useState)(null),p=u[0],h=u[1],v=(0,o.useCallback)((function(e){c((function(n){return n.has(e)?n.delete(e):n.add(e),new Set((0,r.Z)(n))}))}),[]),f=(0,o.useCallback)((function(e){return s.has(e)}),[s]),m=(0,o.useCallback)((function(){c(new Set)}),[]),g=(0,o.useCallback)((function(e){return s.delete(e),new Set((0,r.Z)(s))}),[s]),Z=(0,o.useCallback)((function(e){return s.add(e),new Set((0,r.Z)(s))}),[s]),b={isChecked:f,checked:s,set:c,toggle:v,clear:m,uncheck:g,check:Z,contextMenuCoords:p,setContextMenuCoords:h};return(0,i.tZ)(a.Provider,{value:b,children:n})},d=function(){return(0,o.useContext)(a)}},82610:function(e,n,t){t.d(n,{Z:function(){return Ke}});var r=t(92228),i=t(52903),o=t(2784),a=t(70776),l=t(87416),d=t(53583),s=t(19928),c=t.n(s),u=t(76635),p=t(30896),h=t(48964),v=t(47497),f=t(59400),m=t(73223),g=t(39633),Z=t(70865),b=t(28165),w=t(38716),x=t(60943),y=t(84913),I=t(67710),S=t(68217),k=t(60138),F=t(40794);function z(){var e=(0,r.Z)(["\n query FolderOwners($ownerIds: [ID!]!, $accountId: ID!) {\n batchGetOwner(ownerIds: $ownerIds, accountId: $accountId) {\n email\n id\n imageUrl\n name\n }\n }\n"]);return z=function(){return e},e}var C=(0,k.Ps)(z()),T=function(e){var n=e.ownerIds,t=(0,w.X8)(),r=(0,F.a)(C,{skip:!(null===n||void 0===n?void 0:n.length)||!t,variables:{ownerIds:(0,u.uniq)(n),accountId:t}}),i=r.data,a=r.loading,l=(0,o.useCallback)((function(e){return e?(0,u.find)(null===i||void 0===i?void 0:i.batchGetOwner,["id",String(e)]):null}),[null===i||void 0===i?void 0:i.batchGetOwner]);return{folderOwners:null===i||void 0===i?void 0:i.batchGetOwner,folderOwnersLoading:a,folderOwnerFromId:l}},A=t(50930),D=t(24468),B=t(47557),_=t(47043),E=t(87744);function M(){var e=(0,r.Z)(["\n border: 1px solid ",';\n border-radius: 5px;\n display: grid;\n align-items: center;\n grid-template-columns: 45px 1fr 40px;\n grid-template-areas:\n "folderType name menu"\n "folderType owner menu";\n padding: 15px;\n margin: 10px 0 0;\n td > div {\n flex: 1 1 100%;\n }\n ']);return M=function(){return e},e}function N(){var e=(0,r.Z)(["\n height: 74px;\n td {\n padding: 0 5px;\n }\n "]);return N=function(){return e},e}function L(){var e=(0,r.Z)(["\n grid-area: folderType;\n\n width: auto !important;\n > div {\n display: none !important;\n }\n "]);return L=function(){return e},e}function q(){var e=(0,r.Z)(["\n width: 5% !important;\n > div {\n display: flex !important;\n }\n "]);return q=function(){return e},e}function R(){var e=(0,r.Z)(["\n grid-area: name;\n width: 100% !important;\n padding-right: 20px;\n > div {\n width: 100%;\n }\n "]);return R=function(){return e},e}function P(){var e=(0,r.Z)(["\n width: 65% !important;\n > div {\n width: 100% !important;\n max-width: none !important;\n }\n "]);return P=function(){return e},e}function X(){var e=(0,r.Z)(["\n grid-area: owner;\n width: 60% !important;\n "]);return X=function(){return e},e}function O(){var e=(0,r.Z)(["\n width: 25% !important;\n "]);return O=function(){return e},e}function U(){var e=(0,r.Z)(["\n grid-area: menu;\n width: auto !important;\n "]);return U=function(){return e},e}function H(){var e=(0,r.Z)(["\n width: 10% !important;\n "]);return H=function(){return e},e}var W=(0,E.uq)({mobile:(0,b.iv)(M(),a.w.neutral400),zapTable:(0,b.iv)(N())}),V=(0,E.uq)({mobile:(0,b.iv)(L()),zapTable:(0,b.iv)(q())}),J=(0,E.uq)({mobile:(0,b.iv)(R()),zapTable:(0,b.iv)(P())}),j=(0,E.uq)({mobile:(0,b.iv)(X()),zapTable:(0,b.iv)(O())}),Q=(0,E.uq)({mobile:(0,b.iv)(U()),zapTable:(0,b.iv)(H())}),$=function(){return(0,i.BX)("tr",{css:W,children:[(0,i.tZ)("td",{css:V,children:(0,i.tZ)(_.q,{height:30,width:"100%"})}),(0,i.tZ)("td",{css:J,children:(0,i.tZ)(_.q,{height:30,width:"100%"})}),(0,i.tZ)("td",{css:j,children:(0,i.tZ)(_.q,{height:30,width:"100%"})}),(0,i.tZ)("td",{css:Q,children:(0,i.tZ)(_.q,{height:30,width:"100%"})})]})},G=(0,o.memo)($),Y=t(55414),K=t(18672),ee=(0,b.iv)("border-bottom:1px solid ",a.w.neutral400,";height:64px;text-align:left;padding-left:20px;","FolderTableHeader.tsx--thStyle"),ne=function(e){var n=e.children;return(0,i.tZ)("th",{css:ee,children:(0,i.tZ)(Y.x,{type:"smallPrint1Bold",children:n})})},te=function(){return(0,i.BX)("tr",{children:[(0,i.tZ)(ne,{children:(0,i.tZ)(K.T,{children:"Folder Type"})}),(0,i.tZ)(ne,{children:"Name"}),(0,i.tZ)(ne,{children:"Owner"}),(0,i.tZ)(ne,{children:(0,i.tZ)(K.T,{children:"Actions"})})]})},re=(0,b.iv)("flex:1 1 auto;","FolderTableLoading.tsx--rootStyle"),ie=function(e){var n=e.includeHeader;return(0,i.BX)("div",{css:re,children:[n&&(0,i.tZ)(B.Z,{}),(0,i.tZ)(D.Z,{collapseBreakpoint:m.RI,header:(0,i.tZ)(te,{}),rows:(0,A.Z)(Array(5)).map((function(e,n){return(0,i.tZ)(G,{},n)}))})]})},oe=t(52008),ae=t(14676),le=t(26215),de=t(18911),se=t(43455),ce=t(61854),ue=function(e){var n=e.isShared;return(0,i.tZ)(ce.J,{name:n?"team":"navFolder",size:25,ariaLabel:n?"shared Folder":"private folder"})},pe=t(56101),he=t(25666);function ve(){var e=(0,r.Z)(["\n padding: 10px 0 !important;\n width: auto;\n "]);return ve=function(){return e},e}function fe(){var e=(0,r.Z)(["\n display: flex;\n gap: 10px;\n align-items: center;\n margin-bottom: 2px;\n svg {\n display: block;\n }\n "]);return fe=function(){return e},e}function me(){var e=(0,r.Z)(['\n & > span[data-testid="iconContainer"] {\n display: none !important;\n width: 0px !important;\n }\n ']);return me=function(){return e},e}var ge=(0,E.uq)({zapTable:(0,b.iv)(ve())}),Ze=(0,E.uq)({mobile:(0,b.iv)(fe()),zapTable:(0,b.iv)(me())}),be=function(e){var n=e.name,t=e.ancestors,r=e.isShared,o=e.folderId,a=(0,v.Z)().search,l=(0,f.Z)().isSearchServiceMVPEnabled;return(0,i.BX)("div",{css:ge,children:[(0,i.BX)("div",{css:Ze,children:[(0,i.tZ)(ue,{isShared:!!r}),(0,i.tZ)(le.r,{href:(0,de.do)(o),title:n,children:(0,i.tZ)(Y.x,{color:"neutral800",tag:"h3",type:"smallPrint1Semibold",children:(0,i.tZ)("span",{"data-testid":"FolderTableRow-name",children:(0,i.tZ)(he.Z,{text:n,highlight:a})})})})]}),(0,se.k)(n,a)&&l&&(0,i.tZ)(Y.x,{type:"smallPrint1",children:"Your search term is in the folder name."}),t&&!(0,u.isEmpty)(t)&&(0,i.tZ)(pe.Z,{folderAncestors:t,showFolderIcon:!0})]})},we=t(4863),xe=t(90755),ye=t(47897);function Ie(){var e=(0,r.Z)(["\n border: 1px solid ",";\n background-color: ",';\n border-radius: 5px;\n align-items: center;\n grid-template-columns: 45px 2fr 1fr 85px 40px;\n grid-template-areas:\n "folderType name name name name menu"\n "folderType owner owner owner owner menu";\n padding: 15px;\n margin: 10px 0 0;\n\n td {\n border-bottom: 0 none transparent;\n background-color: ',";\n }\n "]);return Ie=function(){return e},e}function Se(){var e=(0,r.Z)(["\n grid-template-columns: 45px 125px 1fr 1fr 85px 40px;\n "]);return Se=function(){return e},e}function ke(){var e=(0,r.Z)(["\n margin: 0;\n display: table-row;\n gap: 5px 0;\n td {\n height: 74px;\n padding: 0 10px 0 20px;\n border-bottom: 1px solid ",";\n border-top: 1px solid ",";\n background-color: ",";\n }\n "]);return ke=function(){return e},e}function Fe(){var e=(0,r.Z)(["\n display: none !important;\n "]);return Fe=function(){return e},e}function ze(){var e=(0,r.Z)(["\n justify-self: start;\n width: 5%;\n white-space: nowrap;\n margin: 0 0 0 20px;\n padding-left: 30px !important;\n align-items: center;\n justify-content: center;\n display: table-cell !important;\n "]);return ze=function(){return e},e}function Ce(){var e=(0,r.Z)(["\n grid-area: name;\n min-width: 0;\n word-break: break-word;\n padding-right: 25px;\n display: flex;\n flex-direction: column;\n a {\n text-decoration-color: transparent !important;\n transition: all 0.2s !important;\n outline: none !important;\n\n &:hover,\n &:focus {\n text-decoration-color: transparent !important;\n\n h3 {\n color: "," !important;\n text-decoration-color: "," !important;\n transition: text-decoration-color 0.1s 0.2s, color 0.2s !important;\n }\n }\n h3 {\n text-decoration: underline !important;\n text-decoration-color: transparent !important;\n transition: text-decoration-color 0.1s 0.2s, color 0.2s !important;\n }\n }\n "]);return Ce=function(){return e},e}function Te(){var e=(0,r.Z)(["\n margin: 0;\n width: 65%;\n "]);return Te=function(){return e},e}function Ae(){var e=(0,r.Z)(["\n grid-area: menu;\n "]);return Ae=function(){return e},e}function De(){var e=(0,r.Z)(["\n padding-left: 5px !important;\n width: 5%;\n "]);return De=function(){return e},e}var Be=function(){return(0,E.uq)({mobile:(0,b.iv)(Ie(),a.w.neutral400,a.w.transparent,a.w.transparent),tablet:(0,b.iv)(Se()),zapTable:(0,b.iv)(ke(),a.w.neutral400,a.w.transparent,a.w.transparent)})},_e=(0,E.uq)({mobile:(0,b.iv)(Fe()),zapTable:(0,b.iv)(ze())}),Ee=(0,E.uq)({mobile:(0,b.iv)(Ce(),a.w.blue,a.w.blue),zapTable:(0,b.iv)(Te())}),Me=(0,E.uq)({mobile:(0,b.iv)(Ae()),zapTable:(0,b.iv)(De())}),Ne=(0,b.iv)('[aria-label*="Folder actions for"]{background:transparent !important;border-radius:10px !important;border:2px solid transparent !important;box-shadow:none !important;height:44px !important;padding:0 !important;transition:background-color 0.3s !important;width:44px !important;&:focus:before{display:none !important;}&:hover,&:focus{background-color:',a.w.acidWash," !important;outline:none !important;border:2px solid ",a.w.blueJeans," !important;}}","FolderTableRow.tsx--iconButtonStyle"),Le=function(e){var n=e.ancestors,t=e.id,r=e.isShared,a=e.name,l=e.ownerId,d=e.owner,s=e.parentId,c=e.rootId,u=(0,o.useState)(we.x.none),p=u[0],h=u[1];return(0,i.BX)("tr",{css:Be,"data-testid":"FolderTableItem-root-".concat(t),children:[(0,i.tZ)("td",{css:_e,children:(0,i.tZ)(ue,{isShared:!!r})}),(0,i.tZ)("td",{css:Ee,children:(0,i.tZ)(be,{ancestors:n,folderId:t,isShared:r,name:a})}),(0,i.tZ)(ae.Z,{email:null===d||void 0===d?void 0:d.email,name:null===d||void 0===d?void 0:d.name,image:(null===d||void 0===d?void 0:d.imageUrl)||m.Um}),(0,i.tZ)("td",{css:[Me,Ne],children:(0,i.tZ)(ye.Z,{folderDepth:((null===n||void 0===n?void 0:n.length)||0)+1,folderId:t,isNested:!!(0,oe.Z)(c),isShared:!!r,ownerId:l,setCurrentAction:h,text:a})}),p!==we.x.none&&(0,i.tZ)(xe.Z,{currentAction:p,folderId:(0,oe.Z)(t),folderIsShared:!!r,folderParentId:(0,oe.Z)(s),folderTitle:a,rootId:c,setCurrentAction:h})]})},qe=(0,o.memo)(Le),Re=t(57504),Pe=t(1083);function Xe(){var e=(0,r.Z)(["\n align-self: center;\n width: 100%;\n max-width: 100%;\n margin: 10px auto;\n "]);return Xe=function(){return e},e}function Oe(){var e=(0,r.Z)(["\n max-width: 460px;\n margin: 10px auto;\n "]);return Oe=function(){return e},e}function Ue(){var e=(0,r.Z)(["\n max-width: 370px;\n margin: 10px auto;\n "]);return Ue=function(){return e},e}var He=(0,b.iv)("display:flex;justify-content:center;","MyFoldersList.tsx--emptyFolderStyle"),We=(0,b.iv)("display:flex;min-height:50vh;align-items:flex-start;justify-content:flex-start;","MyFoldersList.tsx--rootLoadingStyle"),Ve=(0,b.iv)("margin-bottom:40px;","MyFoldersList.tsx--zapTableContainerStyle"),Je=(0,E.uq)({mobile:(0,b.iv)(Xe()),tablet:(0,b.iv)(Oe()),desktop:(0,b.iv)(Ue())}),je=function(){var e=(0,w.X8)(),n=(0,v.Z)(),t=n.search,r=n.searchType,a=n.folderType,l=(0,o.useState)(t||""),d=l[0],s=l[1],c=(0,o.useState)(0),u=c[0],h=c[1],f=(0,o.useState)(1),g=f[0],b=f[1],k=(0,S.Z)({accountId:e}),F=k.foldersTree,z=k.rootFoldersLoading,C=k.foldersTreeLoading,A=k.virtualFoldersLoading,B=(0,I.Z)(),_=B.strictFilterFolders,E=B.findFolderAncestors,M=(0,p.A)(),N=M.isFolderSearchLoading,L=M.isZapSearchLoading,q=M.setFolderResultCount,R=M.setIsFolderSearchLoading,P=(0,o.useMemo)((function(){return _(F,d,Pe.Zq[a]).filter((function(e){return!(0,Re.Z)(e.id)}))}),[F,d,_,a]);(0,o.useEffect)((function(){var e=Math.ceil(P.length/m.wN);h(e),q(P.length)}),[P,q]);var X=(0,o.useMemo)((function(){return P.slice(0,g*m.wN).map((function(e){return e.parentId?(0,Z.Z)({ancestors:E(F,e.parentId)},e):e}))}),[P,E,F,g]);(0,o.useEffect)((function(){s(t),b(1)}),[t]),(0,o.useEffect)((function(){z||C||A||R(!1)}),[z,A,C,R]);var O=T({ownerIds:P.map((function(e){return e.ownerId}))}).folderOwnerFromId;return N||r==Pe.sq.all&&L?(0,i.tZ)("div",{css:We,children:(0,i.tZ)(ie,{includeHeader:!1})}):(0,i.tZ)("div",{css:Ve,children:0===P.length?(0,i.tZ)("div",{css:He,children:d&&(0,i.tZ)(y.Z,{query:d})}):(0,i.BX)(o.Fragment,{children:[(0,i.tZ)(D.Z,{collapseBreakpoint:m.RI,header:(0,i.tZ)(te,{}),rows:X.map((function(e){return(0,i.tZ)(qe,{name:e.name,id:e.id,isShared:e.isShared,ownerId:e.ownerId,owner:O(null===e||void 0===e?void 0:e.ownerId),ancestors:null===e||void 0===e?void 0:e.ancestors},e.id)}))}),g<u&&(0,i.tZ)("div",{css:Je,children:(0,i.tZ)(x.W,{isLoading:N,onClick:function(){b(g+1)},children:"Load more"})})]})})};function Qe(){var e=(0,r.Z)(["\n display: ",";\n margin-top: 10px;\n "]);return Qe=function(){return e},e}var $e=(0,b.iv)("border-bottom:3px solid ",a.w.neutral300,";padding-bottom:20px;","MyZapAndFolderList.tsx--headerWrapperStyle"),Ge=function(e){return(0,E.uq)({mobile:(0,b.iv)(Qe(),e?"block":"none")})},Ye=(0,b.iv)('nav[class*="Tabs"] a{position:relative;z-index:1;border-bottom:3px solid transparent;&[aria-current="page"]{border-bottom:3px solid ',a.w.blueJeans,";}}","MyZapAndFolderList.tsx--rootStyle"),Ke=function(){var e=(0,p.A)(),n=e.folderResultCount,t=e.isFolderSearchLoading,r=e.isZapSearchLoading,a=e.webhookResultCount,s=e.zapResultCount,Z=(0,v.Z)(),b=Z.search,w=Z.searchType,x=Z.setParams,y=(0,f.Z)().isSearchServiceMVPEnabled,I=(0,o.useMemo)((function(){return[{ariaLabel:"Zap search results",href:"#zaps",text:(0,i.BX)(o.Fragment,{children:["Zaps"," ",(0,i.tZ)(l.C,{children:r||t?"-":s})]})},{ariaLabel:"Folder search results",href:"#folders",text:(0,i.BX)(o.Fragment,{children:["Folders"," ",(0,i.tZ)(l.C,{children:t||r?"-":n})]})},{ariaLabel:"Webhook search results",href:y?"#webhooks":"",text:(0,i.BX)(o.Fragment,{children:["Webhooks"," ",(0,i.tZ)(l.C,{children:t||r?"-":a})]})}].filter((function(e){return(0,u.isObject)(e)&&e.href}))}),[n,t,r,a,s,y]),S=(0,o.useState)(I[0]),k=S[0],F=S[1];(0,o.useEffect)((function(){"#folders"===(null===window||void 0===window?void 0:window.location.hash)||"folder"===w&&"#zaps"!==(null===window||void 0===window?void 0:window.location.hash)&&"#webhooks"!==(null===window||void 0===window?void 0:window.location.hash)?F(I[1]):"#webhooks"===(null===window||void 0===window?void 0:window.location.hash)||"webhook"===w&&"#zaps"!==(null===window||void 0===window?void 0:window.location.hash)?F(I[2]):F(I[0])}),[I,w,y]);var z=(0,o.useMemo)((function(){var e=n+s+a;return"".concat(e," ").concat(c()("result",e),' for "').concat(b,'"')}),[s,n,b,a]);return(0,i.BX)("div",{css:Ye,children:[(0,i.tZ)("div",{css:$e,children:r||t?(0,i.tZ)(B.Z,{}):(0,i.tZ)(h.Z,{title:z,folderId:m.ZJ,isTrash:!1,hasZaps:!1,shouldShowSearch:!0})}),(0,i.tZ)(d.m,{items:I,onChooseItem:function(e){F(e),x({},["page","orderBy"])},selectedItemHref:null===k||void 0===k?void 0:k.href}),(0,i.tZ)("div",{css:Ge("#zaps"===(null===k||void 0===k?void 0:k.href)),children:(0,i.tZ)(g.Z,{currentTab:k})}),(0,i.tZ)("div",{css:Ge("#folders"===(null===k||void 0===k?void 0:k.href)),children:(0,i.tZ)(je,{})}),y&&(0,i.tZ)("div",{css:Ge("#webhooks"===(null===k||void 0===k?void 0:k.href)),children:(0,i.tZ)(g.Z,{webhookSearch:!0,currentTab:k})})]})}},39633:function(e,n,t){t.d(n,{Z:function(){return xi}});var r=t(92228),i=t(50930),o=t(52903),a=t(2784),l=t(28165),d=t(25237),s=t.n(d),c=t(60943),u=t(38716),p=t(73223),h=t(87744),v=t(91815),f=t(70776),m=t(55414),g=t(26215),Z=t(20110),b=t(98788),w=t(5163),x=t(5632),y=t(47043),I=t(36407),S=t(59712),k=t(61854);function F(){var e=(0,r.Z)(["\n align-items: center;\n background-color: ",";\n border-radius: 5px;\n border: 1px solid ",";\n color: ",";\n display: flex;\n flex-direction: column;\n gap: 30px;\n padding: 30px 20px 20px;\n text-align: center;\n "]);return F=function(){return e},e}function z(){var e=(0,r.Z)(["\n flex-direction: row;\n padding: 15px 15px 15px 20px;\n text-align: left;\n "]);return z=function(){return e},e}var C={emptyStateContainer:(0,h.uq)({mobile:(0,l.iv)(F(),f.w.neutral200,f.w.neutral400,f.w.neutral800),tablet:(0,l.iv)(z())})},T=function(e){var n=e.children;return(0,o.BX)("div",{css:C.emptyStateContainer,children:[(0,o.tZ)(k.J,{color:"neutral800",name:"miscBolt",size:40}),(0,o.tZ)("div",{children:n})]})},A=t(60138),D=t(40794),B=t(35591);function _(){var e=(0,r.Z)(["\n query GetUserSuggestedZapTemplates {\n userSuggestedZapTemplates {\n id\n title\n slug\n canonicalId\n detailsUrl\n editorUrl\n services {\n name\n src\n isPremium\n }\n }\n }\n"]);return _=function(){return e},e}var E=(0,A.Ps)(_()),M=function(){var e=(0,D.a)(E,{onError:function(e){(0,B.Z)("GetUserSuggestedZapTemplates",e)}}),n=e.loading,t=e.error,r=e.data;return{isLoading:n,hasLoaded:!n&&!t,error:t,suggestedZapTemplates:(null===r||void 0===r?void 0:r.userSuggestedZapTemplates)||[]}},N=t(25120);function L(){var e=(0,r.Z)(['\n display: flex;\n flex-direction: column;\n gap: 20px;\n\n article[class*="ZapCard"] {\n padding-top: 0 !important;\n }\n div[class*="ZapCard__menuArea"] {\n display: none !important;\n }\n ']);return L=function(){return e},e}function q(){var e=(0,r.Z)(['\n gap: 10px;\n\n div[class*="ZapCard__menuArea"] {\n display: flex !important;\n }\n ']);return q=function(){return e},e}function R(){var e=(0,r.Z)(['\n gap: 5px;\n\n div[class*="ZapCard__menuArea"] {\n display: flex !important;\n }\n ']);return R=function(){return e},e}function P(){var e=(0,r.Z)(["\n display: none;\n "]);return P=function(){return e},e}function X(){var e=(0,r.Z)(["\n display: flex;\n "]);return X=function(){return e},e}var O={emptyContainer:(0,l.iv)("margin-top:10px;width:100%;","ZapRecommendations.tsx--Styles"),emptyStateNotice:(0,l.iv)("margin-bottom:32px;","ZapRecommendations.tsx--Styles"),zapCardsContainer:(0,h.uq)({mobile:(0,l.iv)(L()),tablet:(0,l.iv)(q()),desktop:(0,l.iv)(R())}),menu:(0,h.uq)({mobile:(0,l.iv)(P()),tablet:(0,l.iv)(X())})},U=function(e){var n=e.folderId,t=(0,x.useRouter)(),r=M(),i=r.suggestedZapTemplates,l=r.isLoading,d=r.error;(0,S.jj)("open ZapRecommendations");var s=(0,a.useCallback)((function(e){var n=e.templateId,t=e.templateSlug;(0,N.B6)({templateId:n,templateSlug:t})}),[]),c=new URLSearchParams([["entry-point-method","make_a_zap_call_to_action"],["entry-point-location","my_zaps"]]);n&&c.append("folder_id",n.toString());var u=function(){var e=(0,b.Z)((function(e){var n,r,i;return(0,w.__generator)(this,(function(o){switch(o.label){case 0:return n=e.templateId,r=e.templateSlug,i=e.url,[4,s({templateId:n,templateSlug:r})];case 1:return o.sent(),t.push(i),[2]}}))}));return function(n){return e.apply(this,arguments)}}();return(0,o.BX)("div",{"data-testid":"ZapRecommendations-container",css:O.emptyContainer,children:[(0,o.tZ)("div",{css:O.emptyStateNotice,children:(0,o.BX)(T,{children:[(0,o.tZ)(m.x,{tag:"strong",type:"paragraph3",fontWeight:700,children:"There are no Zaps in this folder"}),(0,o.tZ)(m.x,{tag:"p",type:"paragraph3",children:"Not sure where to start? Get inspired by trying a popular Zap template below."})]})}),(0,o.tZ)(m.x,{tag:"div",type:"subHeader5Bold",color:"neutral800",textAlign:"center",margin:"0 0 20px",children:"Recommended for you"}),(0,o.BX)("div",{css:O.zapCardsContainer,children:[l&&!d&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(y.q,{height:100,width:"100%"}),(0,o.tZ)(y.q,{height:100,width:"100%"}),(0,o.tZ)(y.q,{height:100,width:"100%"})]}),!l&&!d&&i.map((function(e){var n=e.id,t=e.canonicalId,r=e.editorUrl,i=e.title,a=e.slug,l=e.services,d=l.filter((function(e){return e.isPremium})),s="".concat(r,"&").concat(c.toString());return(0,o.tZ)(I.n,{href:s,layout:"auto",title:null!==i&&void 0!==i?i:"Untitled Zap Template",label:d.length>0?"Premium":void 0,labelTooltip:d.length>0?"Premium apps: ".concat(d.join(", ")):void 0,onClick:function(e){e.preventDefault(),u({url:s,templateId:t,templateSlug:a})},services:l},n)}))]})]})},H=function(){return(0,o.BX)("svg",{width:"570",height:"150",viewBox:"0 0 570 150",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-labelledby":"title",children:[(0,o.tZ)("title",{id:"title",children:"Multiple orange decorative squares"}),(0,o.BX)("g",{children:[(0,o.tZ)("rect",{x:"-36.4294",y:"-15.4277",width:"614.89",height:"231.429",fill:"#FFE7D1"}),(0,o.tZ)("rect",{x:"15.6096",y:"-90.0918",width:"161.632",height:"146.166",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"59.4456",y:"22.2266",width:"73.9722",height:"15.3868",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"15.6096",y:"77.8281",width:"161.632",height:"146.166",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"202.969",y:"-35.7637",width:"161.632",height:"146.166",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"246.797",y:"76.5547",width:"73.9722",height:"15.3868",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"202.969",y:"132.156",width:"161.632",height:"146.166",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"390.313",y:"-90.0918",width:"161.632",height:"146.166",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"434.145",y:"22.2266",width:"73.9722",height:"15.3868",rx:"2",stroke:"#FF4F00",strokeWidth:"2"}),(0,o.tZ)("rect",{x:"390.313",y:"77.8281",width:"161.632",height:"146.166",rx:"2",stroke:"#FF4F00",strokeWidth:"2"})]})]})},W=t(43600),V=t(99603);function J(){var e=(0,r.Z)(["\n background-color: ",";\n border-radius: 5px;\n margin: 50px 0;\n max-width: 100%;\n overflow: hidden;\n "]);return J=function(){return e},e}function j(){var e=(0,r.Z)(["\n max-width: 570px;\n "]);return j=function(){return e},e}function Q(){var e=(0,r.Z)(["\n align-items: center;\n display: flex;\n height: 100px;\n justify-content: center;\n overflow: hidden;\n position: relative;\n\n > svg {\n flex: 1 1 auto;\n left: 50%;\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n "]);return Q=function(){return e},e}function $(){var e=(0,r.Z)(["\n height: 150px;\n "]);return $=function(){return e},e}function G(){var e=(0,r.Z)(["\n padding: 20px 30px 15px;\n display: flex;\n flex-flow: column nowrap;\n gap: 15px;\n "]);return G=function(){return e},e}function Y(){var e=(0,r.Z)(["\n gap: 30px;\n padding: 20px 60px 15px;\n "]);return Y=function(){return e},e}var K=(0,h.uq)({mobile:(0,l.iv)(J(),f.w.neutral200),tablet:(0,l.iv)(j())}),ee=(0,h.uq)({mobile:(0,l.iv)(Q()),tablet:(0,l.iv)($())}),ne=(0,h.uq)({mobile:(0,l.iv)(G()),tablet:(0,l.iv)(Y())}),te=(0,l.iv)("display:flex;justify-content:center;","EmptyFolder.tsx--buttonAreaStyle"),re=function(e){var n=e.createZapHref,t=e.folderId,r=e.ownerId,i=e.memberId,l=(0,u.X8)(),d=(0,W.Z)({ownerId:r,selectedMemberId:i}).canCreateZap,s=(0,V.Z)({folderId:t,findCachedFolder:!0}).folder,c=(0,a.useCallback)((function(){return(0,N.yM)({accountId:l,isNested:!!(null===s||void 0===s?void 0:s.parentId)})}),[l,s]);return 0===t?(0,o.tZ)(U,{}):(0,o.BX)("div",{css:K,"data-testid":"EmptyFolder-root",children:[(0,o.tZ)("div",{css:ee,children:(0,o.tZ)(H,{})}),(0,o.BX)("div",{css:ne,children:[(0,o.tZ)(m.x,{tag:"h3",textAlign:"center",type:"pageHeader7",children:"There are no Zaps in this folder"}),(0,o.BX)(m.x,{color:"neutral700",tag:"p",textAlign:"center",type:"paragraph3",children:["A Zap is a collection of automations that work together to save you time. To see popular use cases,"," ",(0,o.tZ)(g.r,{href:"/explore",children:"explore pre-made Zap templates."})]}),(0,o.tZ)("div",{css:te,children:d&&(0,o.tZ)(Z.z,{href:n,onClick:c,children:"Create a new Zap"})})]})]})},ie=t(99570);function oe(){var e=(0,r.Z)(["\n margin: 50px 0;\n max-width: 100%;\n "]);return oe=function(){return e},e}function ae(){var e=(0,r.Z)(["\n max-width: 570px;\n "]);return ae=function(){return e},e}function le(){var e=(0,r.Z)(["\n padding: 30px;\n display: flex;\n flex-flow: column nowrap;\n align-items: center;\n gap: 15px;\n "]);return le=function(){return e},e}function de(){var e=(0,r.Z)(["\n padding: 60px;\n gap: 30px;\n "]);return de=function(){return e},e}var se=(0,h.uq)({mobile:(0,l.iv)(oe()),tablet:(0,l.iv)(ae())}),ce=(0,h.uq)({mobile:(0,l.iv)(le()),tablet:(0,l.iv)(de())}),ue=function(){return(0,o.tZ)("div",{css:se,children:(0,o.tZ)(ie.T,{borderColor:"neutral300",children:(0,o.BX)("div",{css:ce,children:[(0,o.tZ)(k.J,{color:"neutral400",name:"actionTrash",size:"50px"}),(0,o.tZ)(m.x,{tag:"h2",textAlign:"center",type:"sectionHeader1Extrabold",children:"All cleaned up!"}),(0,o.tZ)(m.x,{tag:"p",textAlign:"center",type:"paragraph1",children:"Zaps moved to the Trash will show up here for 30 days before being deleted."})]})})})},pe=t(53939),he=t(16181),ve=t(2569),fe=t(9466),me=t(3e3),ge=t(18911);function Ze(){var e=(0,r.Z)(["\n ","\n display: flex;\n align-items: center;\n overflow: hidden;\n max-width: ","%;\n & > a {\n display: block;\n overflow: hidden !important;\n padding: 0 3px !important;\n margin: 2px !important;\n & ~ span {\n flex: 0;\n display: inline-block;\n }\n }\n "]);return Ze=function(){return e},e}function be(){var e=(0,r.Z)(["\n ","\n "]);return be=function(){return e},e}var we=(0,l.iv)("display:inline-flex;width:100%;","FolderBreadcrumbs.tsx--listStyles"),xe=function(e){return(0,h.uq)({mobile:(0,l.iv)(Ze(),me.ZT.smallPrint1Semibold,100/e),tablet:(0,l.iv)(be(),me.ZT.paragraph1Semibold)})},ye=(0,l.iv)("min-width:0;display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;","FolderBreadcrumbs.tsx--nameStyle"),Ie=function(e){var n=e.ancestors,t=e.currentFolderName;return(0,o.tZ)("nav",{"aria-label":"breadcrumbs",children:(0,o.BX)("ol",{css:we,children:[n.map((function(e){return(0,o.BX)("li",{css:xe(n.length+1),children:[(0,o.tZ)(g.r,{title:e.name,href:(0,ge.do)(e.id),children:(0,o.tZ)("span",{css:ye,children:e.name})}),(0,o.tZ)(k.J,{name:"arrowSmallRight",size:"2ch",color:"neutral600"})]},e.id)})),(0,o.tZ)("li",{"aria-current":"page",css:xe(1),children:(0,o.tZ)("span",{css:ye,title:t,children:t})})]})})},Se=t(20388),ke=t(39386),Fe=t(878),ze=t(47557),Ce=t(48964),Te=t(66383),Ae=t(76635),De=t(3842),Be=t(33379),_e=t(19928),Ee=t.n(_e),Me=t(53736),Ne=t(8594),Le=t(86692),qe=t(73041);function Re(){var e=(0,r.Z)(["\n mutation DeleteZaps($accountId: ID!, $ids: [ID!]!) {\n deleteZaps(accountId: $accountId, ids: $ids) {\n id\n isTrashed\n }\n }\n"]);return Re=function(){return e},e}function Pe(){var e=(0,r.Z)(["\n query ExportZaps($accountId: Int!, $ids: [Int!]!) {\n account(id: $accountId) {\n id\n zapExport(zapIds: $ids)\n }\n }\n"]);return Pe=function(){return e},e}function Xe(){var e=(0,r.Z)(["\n mutation MoveZapsToFolder($ids: [ID!]!, $folderId: ID!, $accountId: ID!) {\n moveZapsFolder(ids: $ids, folderId: $folderId, accountId: $accountId) {\n folderId\n id\n isTrashed\n }\n }\n"]);return Xe=function(){return e},e}function Oe(){var e=(0,r.Z)(["\n mutation BulkUpdateOwner($zapIds: [ID!]!, $targetCustomuserId: ID!) {\n bulkUpdateOwner(zapIds: $zapIds, targetCustomuserId: $targetCustomuserId) {\n batchId\n }\n }\n"]);return Oe=function(){return e},e}var Ue,He=(0,A.Ps)(Re()),We=(0,A.Ps)(Pe()),Ve=(0,A.Ps)(Xe()),Je=(0,A.Ps)(Oe()),je=t(90446),Qe=t(59251);!function(e){e.changeOwner="change_owner"}(Ue||(Ue={}));var $e=function(e){var n=e.accountId,t=e.batchId,r=e.batchType,i=e.customUserId,o=e.folderIds,a=e.zapIds;return(0,je.Z)({account_id:n,batch_element_quantity:(null===a||void 0===a?void 0:a.length)||(null===o||void 0===o?void 0:o.length)||0,batch_type_name:r,customuser_id:Number(i),event_id:t,external_batch_id:t,folder_ids:o,identity_id:Number((0,Qe.v)("zapidentity")),release_id:"bc2c7338",timestamp_ms:Date.now(),zap_ids:a},"organization.bulk_action.tracking.UserBulkActionRequestEvent","organization")},Ge=t(47497);var Ye=function(e){var n=e.accountId,t=e.folderId,r=e.searchQuery,l=e.page,d=e.ownerId,s=(0,Me.l)().createNotification,c=(0,he.gn)().userId,u=(0,Fe.Z)().clear,h=(0,Ge.Z)().emptyQuerySearch,v=(0,Te.Z)((0,De.t)(We,{fetchPolicy:"no-cache",onCompleted:function(e){var n=e.account.zapExport,t=(new Date).toISOString();(0,Ne.S)("exported-zap-".concat(t,".json"),JSON.stringify(n))},onError:function(e){s({message:"Error exporting Zap: ".concat((0,Le.e$)(e)),type:"error"})}}),2),f=v[0],m=v[1],Z=(0,a.useCallback)((function(e){f({variables:{accountId:n,ids:(0,i.Z)(e).map((function(e){return Number(e)}))}})}),[n,f]),x=(0,Te.Z)((0,Be.D)(Ve,{onError:function(e){(0,B.Z)("MoveZapsToFolderMutation",e)},refetchQueries:function(){return r||h?[(0,qe.O_)({folderId:t,searchQuery:r,page:l})]:[]},update:function(e,i){var o=i.data,a=(null===o||void 0===o?void 0:o.moveZapsFolder)||[],l=Number(a[0].folderId),s=a.map((function(e){return e.id}));!a.length||r||h||(0,qe.Bs)(e,{accountId:n,folderId:t,ownerId:d,zapIds:s,userId:c,newFolderId:l})}}),1),y=x[0],I=(0,a.useCallback)(function(){var e=(0,b.Z)((function(e){var t,r;return(0,w.__generator)(this,(function(i){switch(i.label){case 0:return t=e.targetFolderId,r=e.ids,[4,y({variables:{accountId:n,folderId:t,ids:r},optimisticResponse:{moveZapsFolder:r.map((function(e){return{__typename:"Zap",id:e,folderId:t,isTrashed:String(t)===String(p.K0)}}))}})];case 1:return[2,i.sent()]}}))}));return function(n){return e.apply(this,arguments)}}(),[n,y]),S=(0,a.useCallback)(function(){var e=(0,b.Z)((function(e){var n,t,r,i,l,d;return(0,w.__generator)(this,(function(c){switch(c.label){case 0:n=e.selectedFullZaps,t=e.originalTargetFolderId,r=e.originalTargetFolderName,i=function(e){var n=e.originalTargetFolderId,t=e.originalTargetFolderName,r=e.zapsLength;s({message:(0,o.BX)(a.Fragment,{children:[r," ",Ee()("Zap",r)," that"," ",r>1?"were":"was","moved into the"," ",(0,o.tZ)(g.r,{href:"/app/zaps/folder/".concat(n),children:t})," ","folder could not be undone. Please try again!"]}),type:"error"})},l=(0,Ae.chain)(n).groupBy("folderId").map((function(e,n){return{folderId:n,zaps:e}})).value(),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(l.map(function(){var e=(0,b.Z)((function(e){var n,t;return(0,w.__generator)(this,(function(r){switch(r.label){case 0:return n=e.zaps.map((function(e){return e.id})),t=e.folderId,[4,I({targetFolderId:t,ids:n})];case 1:return[2,r.sent()]}}))}));return function(n){return e.apply(this,arguments)}}()))];case 2:return(d=c.sent()).every((function(e){var n;return null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.moveZapsFolder}))?s({message:(0,o.BX)(a.Fragment,{children:[1===(null===n||void 0===n?void 0:n.length)?"Zap that was":"".concat(null===n||void 0===n?void 0:n.length," ").concat(Ee()("Zap",null===n||void 0===n?void 0:n.length)," that were")," ","moved to the"," ",(0,o.tZ)(g.r,{href:"/app/zaps/folder/".concat(t),children:r})," ","folder has been undone."]}),type:"success"}):i({zapsLength:(null===n||void 0===n?void 0:n.length)||1,originalTargetFolderId:t,originalTargetFolderName:r}),[2,d];case 3:return c.sent(),i({zapsLength:(null===n||void 0===n?void 0:n.length)||1,originalTargetFolderId:t,originalTargetFolderName:r}),[3,4];case 4:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[s,I]),k=(0,a.useCallback)(function(){var e=(0,b.Z)((function(e){var n,t,r,i,l,d,c,u,p;return(0,w.__generator)(this,(function(h){switch(h.label){case 0:n=e.ids,t=e.targetFolderId,r=e.folderName,i=e.selectedFullZaps,l='"'.concat(r,'"'),d=function(){s({message:(0,o.BX)(a.Fragment,{children:[n.length," ",Ee()("Zap",n.length)," could not be moved into the"," ",(0,o.tZ)(g.r,{href:"/app/zaps/folder/".concat(t),children:l})," ","folder. Please try again!"]}),type:"error"})},h.label=1;case 1:return h.trys.push([1,3,,4]),[4,I({ids:n,targetFolderId:t})];case 2:return(null===(u=h.sent())||void 0===u||null===(c=u.data)||void 0===c?void 0:c.moveZapsFolder)?(p=u.data.moveZapsFolder||[],s({message:(0,o.BX)(a.Fragment,{children:[1===p.length?"Zap has":"".concat(p.length," ").concat(Ee()("Zap",p.length)," have")," ","been moved into the"," ",(0,o.tZ)(g.r,{href:"/app/zaps/folder/".concat(t),children:l})," ","folder."," ",i&&i.every((function(e){return!e.isTrashed}))&&(0,o.tZ)(g.r,{onClick:function(){return S({originalTargetFolderId:t,originalTargetFolderName:l,selectedFullZaps:i})},children:"Undo"})]}),type:"success"})):(null===u||void 0===u?void 0:u.errors)&&d(),[2,u];case 3:return h.sent(),d(),[3,4];case 4:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[s,I,S]),F=(0,Te.Z)((0,Be.D)(He,{onError:function(e){(0,B.Z)("DeleteZapsMutation",e)},refetchQueries:function(){return r||h?[(0,qe.O_)({searchQuery:r,page:l})]:[]},update:function(e,i){var o,a=i.data,l=(null===a||void 0===a||null===(o=a.deleteZaps)||void 0===o?void 0:o.map((function(e){return e.id})))||[];!l.length||r||h||(0,qe.Bs)(e,{accountId:n,folderId:t,ownerId:d,zapIds:l,userId:c,newFolderId:-1})}}),1),z=F[0],C=(0,a.useCallback)(function(){var e=(0,b.Z)((function(e){var t,r,i,l,d,c;return(0,w.__generator)(this,(function(u){switch(u.label){case 0:t=e.ids,r=e.selectedFullZaps,i=function(){s({message:(0,o.BX)(a.Fragment,{children:[t.length," ",Ee()("Zap",t.length)," could not be deleted. Please try again!"]}),type:"error"})},u.label=1;case 1:return u.trys.push([1,3,,4]),[4,z({variables:{accountId:n,ids:t},optimisticResponse:{deleteZaps:t.map((function(e){return{__typename:"Zap",id:e,isTrashed:!0}}))}})];case 2:return(null===(d=u.sent())||void 0===d||null===(l=d.data)||void 0===l?void 0:l.deleteZaps)?(c=d.data.deleteZaps||[],s({message:(0,o.BX)(a.Fragment,{children:[1===c.length?"Zap has":"".concat(c.length," ").concat(Ee()("Zap",c.length)," have")," ","been moved into the"," ",(0,o.tZ)(g.r,{href:"/app/zaps/folder/-1",children:"Trash"})," folder."," ",r&&(0,o.tZ)(g.r,{onClick:function(){return S({originalTargetFolderId:"-1",originalTargetFolderName:"Trash",selectedFullZaps:r})},children:"Undo"})]}),type:"success"})):(null===d||void 0===d?void 0:d.errors)&&i(),[2,d];case 3:return u.sent(),i(),[3,4];case 4:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[z,n,s,S]),T=(0,Te.Z)((0,Be.D)(Je,{onCompleted:function(e,t){var r,i=e.bulkUpdateOwner.batchId,a=null===t||void 0===t||null===(r=t.variables)||void 0===r?void 0:r.zapIds;n&&c&&a&&$e({accountId:n,customUserId:c,folderIds:null,batchId:i,batchType:Ue.changeOwner,zapIds:a}),u(),s({message:(0,o.BX)("span",{children:["Ownership of your Zaps is changing. This can take a few moments. See ",(0,o.tZ)(g.r,{href:"/app/queued",children:"Queued actions"})," for updates."]}),timeout:6e3,title:"Zap ownership changing",type:"warning"})},onError:function(e){(0,B.Z)("BulkUpdateOwnerMutation",e),s({message:"We ran into an error changing Zap ownership. Please try again.",type:"error"})},update:function(e,n){var t=n.data;e.modify({fields:{bulkActions:function(e){return(0,i.Z)(e).concat([null===t||void 0===t?void 0:t.bulkUpdateOwner.batchId])}}})}}),1),A=T[0],D=(0,a.useCallback)(function(){var e=(0,b.Z)((function(e,n){return(0,w.__generator)(this,(function(t){switch(t.label){case 0:return[4,A({variables:{zapIds:e,targetCustomuserId:n}})];case 1:return[2,t.sent()]}}))}));return function(n,t){return e.apply(this,arguments)}}(),[A]);return{isWorking:m.loading,onExportZaps:Z,onMoveZapsToFolder:k,onMoveZapsToTrash:C,onBulkUpdateOwner:D}},Ke=t(69237),en=t(52008),nn=t(90285),tn=function(e){var n=e.accountId,t=e.folderId,r=e.hasMaxFolderAncestors,o=e.ownerId,l=e.searchQuery,d=e.page,s=e.selectedFullZaps,c=e.selectedZaps,u=e.setCurrentAction,p=(0,ke.Z)({folderId:t}),h=(0,x.useRouter)(),v=h.push,f=h.asPath,m=(0,Me.l)().createNotification,g=(0,Fe.Z)().set,Z=Ye({accountId:n,folderId:t,searchQuery:l,page:d,ownerId:o}),y=Z.onMoveZapsToFolder,I=Z.onMoveZapsToTrash,S=Z.onExportZaps,k=Z.onBulkUpdateOwner,F=(0,Ke.Z)({accountId:n,folderId:t}),z=F.deleteFolder,C=F.deleteFolderAncestors,T=F.moveFolder,A=F.shareFolder,D=F.updateFolder,B=(0,a.useCallback)((function(){r?(0,nn.Z)({accountId:n,createNotification:m}):u(Se.y.createFolder)}),[r,n,m,u]),_=(0,a.useCallback)((function(){var e=Number(null===p||void 0===p?void 0:p.rootId)||Number(t);A(e,{isShared:!0}),u(Se.y.none)}),[A,u,t,p]),E=(0,a.useCallback)(function(){var e=(0,b.Z)((function(e){return(0,w.__generator)(this,(function(n){switch(n.label){case 0:return[4,D((0,en.Z)(t),{title:e})];case 1:return n.sent(),u(Se.y.none),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[t,u,D]),M=(0,a.useCallback)((0,b.Z)((function(){var e;return(0,w.__generator)(this,(function(n){switch(n.label){case 0:return[4,z((0,en.Z)(t))];case 1:return e=n.sent().data,u(Se.y.none),f.includes(String((0,en.Z)(t)))&&e&&v&&((null===p||void 0===p?void 0:p.parentId)?v((0,ge.do)(p.parentId)):v((0,ge.D)())),[2]}}))})),[f,null===p||void 0===p?void 0:p.parentId,z,t,v,u]),N=(0,a.useCallback)((function(e){e&&T({folderId:(0,en.Z)(e),folderIds:[(0,en.Z)(t)]}),u(Se.y.none)}),[T,t,u]),L=(0,a.useCallback)((function(){C((0,en.Z)(t)),u(Se.y.none)}),[u,C,t]),q=(0,a.useCallback)(function(){var e=(0,b.Z)((function(e){var n;return(0,w.__generator)(this,(function(t){switch(t.label){case 0:return[4,I({ids:e,selectedFullZaps:s})];case 1:return t.sent(),c.size&&(n=(0,i.Z)(c).filter((function(n){return!e.includes(n)})),g(new Set(n))),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[c,g,I,s]);return{handleUnnestFolder:L,handleDeleteFolder:M,handleMoveNestedFolder:N,handleRenameFolder:E,handleShowAddFolder:B,handleMoveZap:function(e,n){u(Se.y.none),y({ids:(0,i.Z)(c),targetFolderId:String(e),folderName:n,selectedFullZaps:s}),g(new Set)},handleDeleteZaps:q,handleExportZaps:function(){S(c)},handleShareFolderConfirmation:_,handleBulkUpdateOwner:(0,a.useCallback)((function(e){k(Array.from(c),e)}),[c,k])}},rn=t(23094),on=t(88366),an=t(38153),ln=function(e){return(0,l.iv)("text-align:center;cursor:",e,";width:100% !important;span{background-color:",f.w.acidWash,";border:1px solid ",f.w.neutral400,";padding:15px;word-break:break-word;}","ZapTableRowDragOverlay.tsx--dragOverlayOverrideStyle")},dn=function(e){var n=e.selectedFullZaps,t=(0,he.gn)().userId,r=(0,a.useState)("grabbing"),i=r[0],l=r[1];return(0,rn.IJ)({onDragOver:function(e){var r,i,o;if((null===e||void 0===e||null===(r=e.over)||void 0===r?void 0:r.id)&&(null===e||void 0===e||null===(i=e.over)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.current)&&n.length>0){var a=e.over.data.current;l((0,an.no)(n,a,t)?"grabbing":"not-allowed")}}}),0===(null===n||void 0===n?void 0:n.length)?null:(0,o.tZ)(rn.y9,{modifiers:[on.oJ],css:[ln(i)],children:(0,o.tZ)(m.x,{color:"neutral800",tag:"h3",type:"smallPrint1Semibold",children:(0,o.tZ)("span",{children:"Move ".concat(null===n||void 0===n?void 0:n.length," Zap").concat((null===n||void 0===n?void 0:n.length)>=2?"s":"")})})})},sn=t(87593),cn=t(84505),un=t(23755),pn=(0,l.iv)('button > span > span[class*="buttonIcon"]{margin-left:2px !important;}div[class*="TooltipWrapper"]{z-index:2 !important;}',"CreateButton.tsx--createButtonStyle"),hn=function(e){var n=e.createZapHref,t=e.folder,r=e.disabled,i=void 0!==r&&r,l=e.onShowAddFolder,d=(0,a.useState)(!1),s=d[0],c=d[1],h=p.Ru.indexOf(Number(null===t||void 0===t?void 0:t.id))>-1,v=(0,u.X8)(),f=(0,a.useMemo)((function(){return[{icon:"miscBoltAlt",href:n,text:"New Zap"},(0,Ae.isFunction)(l)?{icon:"navFolder",onClick:function(){(0,N.Of)({accountId:v,isNested:!h}),l((null===t||void 0===t?void 0:t.isShared)?"shared":"personal",h?void 0:t)},text:"New Folder"}:void 0].filter((function(e){return Boolean(e)}))}),[n,l,t,h,v]);return(0,o.tZ)("div",{"data-testid":"Create-Button-root",css:pn,children:(0,o.tZ)(sn.p,{allowMultilineTooltip:!0,content:i&&(null===t||void 0===t?void 0:t.isShared)?"Your account does not have access to this feature":"",position:"northeast",tooltipId:"zap-create-tooltip",children:function(){return(0,o.BX)(un.Z,{onClickOutside:function(){return c(!1)},children:[(0,o.tZ)(Z.z,{"aria-controls":"create-actions-dropdown","aria-label":"Toggle create actions menu",color:"primary",disabled:i,iconBefore:"formAdd",id:"create-actions-button",onClick:function(){return c(!s)},size:"small",children:"Create"}),s&&(0,o.tZ)(cn.Z,{align:"right",ariaLabel:"Create actions",closeDropdown:function(){return c(!1)},id:"create-actions-dropdown",items:f})]})}})})},vn=t(70865),fn=t(96670),mn=t(66830),gn=(0,l.iv)("margin-left:5px;button{color:",f.w.black," !important;border:2px solid transparent !important;border-radius:10px !important;transition:background-color 0.3s !important;&:hover,&:focus{background-color:",f.w.acidWash," !important;border:2px solid ",f.w.blueJeans," !important;outline:none !important;}}","FolderSettings.tsx--folderSettingsButtonStyle"),Zn=function(e){var n=e.disabledDeleteMessage,t=e.disabledShareMessage,r=e.onDeleteFolder,i=e.onMoveFolder,o=e.onRenameFolder,a=e.onShareFolder;return[(0,Ae.isFunction)(i)?{icon:"actionMoveToFolder",onClick:i,text:"Move folder"}:void 0,{icon:"actionRename",onClick:o,text:"Rename folder"},(0,Ae.isFunction)(a)?{icon:"personGroup",onClick:t?null:a,text:"Share folder",disabled:Boolean(t),toolTipText:t}:void 0,{icon:"actionTrash",onClick:n?null:r,text:"Delete folder",disabled:Boolean(n),toolTipText:n,warningHighlight:!0}].filter((function(e){return Boolean(e)}))},bn=function(e){var n=(0,a.useState)(!1),t=n[0],r=n[1],i={ariaControls:"folder-actions-dropdown",ariaExpanded:t,ariaLabel:"toggle folder actions menu",onClick:function(){return r(!t)},size:"small"};return(0,o.BX)(un.Z,{onClickOutside:function(){return r(!1)},children:[(0,o.tZ)("div",{css:gn,"data-testid":"folder-settings",children:(0,o.tZ)(mn.h,(0,fn.Z)((0,vn.Z)({},i),{color:"icon-secondary",icon:"navMoreHoriz"}))}),t&&(0,o.tZ)(cn.Z,{align:"right",ariaLabel:"Zap folder actions",closeDropdown:function(){return r(!1)},id:"folder-actions-dropdown",items:Zn(e)})]})};function wn(){var e=(0,r.Z)(["\n align-items: center;\n display: flex;\n gap: 10px;\n justify-content: space-between;\n margin-bottom: 2px;\n width: 100%;\n "]);return wn=function(){return e},e}function xn(){var e=(0,r.Z)(["\n flex-flow: unset;\n "]);return xn=function(){return e},e}var yn=s()((function(){return t.e(4104).then(t.bind(t,4104))}),{loadableGenerated:{webpack:function(){return[4104]}},ssr:!1}),In=s()((function(){return t.e(8366).then(t.bind(t,8366))}),{loadableGenerated:{webpack:function(){return[8366]}},ssr:!1}),Sn=s()((function(){return t.e(8015).then(t.bind(t,68015))}),{loadableGenerated:{webpack:function(){return[68015]}},ssr:!1}),kn=s()((function(){return t.e(3721).then(t.bind(t,3721))}),{loadableGenerated:{webpack:function(){return[3721]}},ssr:!1}),Fn=(0,h.uq)({mobile:(0,l.iv)(wn()),tablet:(0,l.iv)(xn())}),zn=(0,l.iv)("margin-bottom:10px;","ZapListHeader.tsx--ancestorsStyle"),Cn=(0,l.iv)("display:flex;gap:10px;","ZapListHeader.tsx--shareInfoStyles"),Tn=(0,l.iv)("display:flex;","ZapListHeader.tsx--buttonSpaceStyle"),An=(0,l.iv)("display:block;","ZapListHeader.tsx--buttonNarrowStyle"),Dn=function(e){var n,t=e.createZapHref,r=e.folderId,i=e.isLegacyZapsLoading,l=e.isLoadingMore,d=e.ownerId,s=e.searchQuery,c=e.page,h=e.title,v=e.zaps,f=(0,Ge.Z)(),m=f.memberId,g=f.searchType,Z=f.emptyQuerySearch,x=(0,he.gn)().userId,y=(0,u.X8)(),I=(0,a.useState)(Se.y.none),S=I[0],k=I[1],F=(0,V.Z)({folderId:r}).folder,z=(0,ke.Z)({folderId:r}),C=(0,ve.Z)({accountId:y,folderId:r}),T=C.folderAncestors,A=C.folderAncestorsLoading,D=(0,Fe.Z)(),B=D.set,_=D.checked,E=(0,a.useMemo)((function(){var e=Array.from(_);return v.filter((function(n){return e.includes(n.id)}))}),[_,v]),M=p.Ru.indexOf(r)>-1,N=r===p.ZJ,L=r===p.K0,q=!L,R=!M&&!s&&!Z&&(null===F||void 0===F?void 0:F.isShared),P=!M&&!s&&!Z&&!!(null===T||void 0===T?void 0:T.length),X=(0,W.Z)({folder:F,selectedMemberId:m}),O=X.canMove,U=X.canShare,H=X.disabledDeleteMessage,J=X.disabledShareMessage,j=!(0,fe.Z)(r),Q=N&&(!m||m===x)||(null===F||void 0===F||null===(n=F.owner)||void 0===n?void 0:n.id)===x,$=!(null===F||void 0===F?void 0:F.isShared)&&!Q||!U&&(null===F||void 0===F?void 0:F.isShared),G=(!M||N)&&!s&&!Z&&!_.size,Y=!M&&!s&&!Z&&!_.size,K=(0,a.useCallback)((0,b.Z)((function(){return(0,w.__generator)(this,(function(e){return B(new Set),k(Se.y.moveNestedFolder),[2]}))})),[B,k]),ee=(0,a.useCallback)((0,b.Z)((function(){return(0,w.__generator)(this,(function(e){return B(new Set),k(Se.y.deleteFolder),[2]}))})),[B,k]),ne=(0,a.useCallback)((function(){(null===F||void 0===F?void 0:F.isShared)?k(Se.y.shareFolder):k(Se.y.shareFolderConfirmation)}),[k,F]),te=tn({folderId:r,ownerId:d,searchQuery:s,page:c,accountId:y,setCurrentAction:k,selectedZaps:_,hasMaxFolderAncestors:(null===T||void 0===T?void 0:T.length)>=4,selectedFullZaps:E}),re=te.handleUnnestFolder,ie=te.handleDeleteFolder,oe=te.handleMoveNestedFolder,ae=te.handleRenameFolder,le=te.handleShowAddFolder,de=te.handleMoveZap,se=te.handleShareFolderConfirmation,ce=te.handleExportZaps,ue=te.handleDeleteZaps,me=te.handleBulkUpdateOwner,ge=!N||s||Z?h||(null===F||void 0===F?void 0:F.title)||(null===F||void 0===F?void 0:F.name):"My Zaps (default folder)",Ze=A&&!s&&!Z&&(null===z||void 0===z?void 0:z.rootId);return!F&&r!==p.ZJ||Ze||i&&s&&!Z&&!l?(0,o.tZ)(ze.Z,{}):(0,o.BX)("div",{"data-testid":"ZapListHeader",children:[P&&(0,o.tZ)("div",{css:zn,children:(0,o.tZ)(Ie,{ancestors:T,currentFolderName:(null===F||void 0===F?void 0:F.text)||(null===F||void 0===F?void 0:F.title)})}),"all"!==g&&(0,o.BX)("div",{css:Fn,children:[!s&&!Z&&(0,o.tZ)(Ce.Z,{title:ge,folderId:r,isTrash:L,hasZaps:!!v.length,shouldShowSearch:!!s}),(0,o.BX)("div",{css:Cn,children:[R&&(0,o.tZ)(In,{folder:F}),(0,o.BX)("div",{css:[Tn,!Y&&An],children:[G&&(0,o.tZ)(hn,{createZapHref:t,onShowAddFolder:j?le:void 0,folder:F,disabled:$}),Y?(0,o.tZ)(bn,{disabledDeleteMessage:H,disabledShareMessage:J,onDeleteFolder:ee,onMoveFolder:O?K:void 0,onRenameFolder:function(){return k(Se.y.renameFolder)},onShareFolder:U?ne:void 0}):(0,o.tZ)(pe.L,{width:49})]})]})]}),(0,o.tZ)(kn,{folderId:r}),q&&(0,o.tZ)(yn,{folderId:r,selectedZaps:_,zaps:v,currentAction:S,setCurrentAction:k,selectedFullZaps:E,onDelete:ue}),(0,o.tZ)(Sn,{currentAction:S,isSearch:!!s||Z,folderId:r,folderIsShared:null===z||void 0===z?void 0:z.isShared,folderParentId:null===z||void 0===z?void 0:z.parentId,folderTitle:(null===F||void 0===F?void 0:F.title)||"",onDeleteFolder:ie,onExport:ce,onMove:de,onMoveFolder:oe,onRenameFolder:ae,onShareFolderConfirmation:se,onUnnestFolder:re,onBulkUpdateOwner:me,setCurrentAction:k,selectedZapsCount:_.size,selectedFullZaps:E}),(0,o.tZ)(dn,{selectedFullZaps:E})]})},Bn=t(84913),_n=t(18672),En=(0,l.iv)("border-bottom:3px solid ",f.w.neutral300,";height:64px;text-align:left;padding-left:10px;","ZapTableHeader.tsx--thStyle"),Mn=(0,l.iv)("background:none;border:none;display:flex;white-space:nowrap;align-items:center;gap:10px;","ZapTableHeader.tsx--headerButtonStyle"),Nn=function(e){var n=e.ascSortKey,t=e.children,r=e.currentSort,i=e.descSortKey,l=e.onSort,d=e.sortable,s=(0,a.useMemo)((function(){return null===r||void 0===r?void 0:r.includes(n)}),[n,r]),c=(0,a.useMemo)((function(){return s?(null===r||void 0===r?void 0:r.includes("-"))?"arrowSmallDown":"arrowSmallUp":"arrowDropdown"}),[s,r]),u=(0,a.useCallback)((function(){(0,Ae.isFunction)(l)&&(n||i)&&(!s||(null===r||void 0===r?void 0:r.includes("-"))?l(n):l(i))}),[l,r,n,i,s]);return(0,o.tZ)("th",{css:En,"aria-sort":s?(null===r||void 0===r?void 0:r.includes("-"))?"descending":"ascending":"none",children:d&&"string"===typeof t?(0,o.BX)("button",{css:Mn,"aria-label":"".concat(t,", click to sort column"),onClick:u,children:[(0,o.tZ)(m.x,{type:"smallPrint1Bold",children:t}),(0,o.tZ)(k.J,{color:"neutral600",name:c,ariaHidden:!0,size:24})]}):(0,o.tZ)(m.x,{type:"smallPrint1Bold",children:t})})},Ln=function(e){var n=e.showOwner,t=void 0===n||n,r=e.sortable,i=void 0!==r&&r,a=e.onSort,l=e.currentSort;return(0,o.BX)("tr",{children:[(0,o.tZ)(Nn,{children:(0,o.tZ)(_n.T,{children:"Drag handle"})}),(0,o.tZ)(Nn,{children:(0,o.tZ)(_n.T,{children:"Checkboxes"})}),(0,o.tZ)(Nn,{children:(0,o.tZ)(_n.T,{children:"Apps used"})}),(0,o.tZ)(Nn,{sortable:i,currentSort:l,ascSortKey:"title",descSortKey:"-title",onSort:a,children:"Name"}),t&&(0,o.tZ)(Nn,{children:"Owner"}),(0,o.tZ)(Nn,{sortable:i,currentSort:l,ascSortKey:"updated_at",descSortKey:"-updated_at",onSort:a,children:"Last edit"}),(0,o.tZ)(Nn,{sortable:i,currentSort:l,ascSortKey:"enabled",descSortKey:"-enabled",onSort:a,children:"Running"}),(0,o.tZ)(Nn,{children:(0,o.tZ)(_n.T,{children:"Actions"})})]})},qn=t(28800),Rn=t(12700),Pn=t(34458),Xn=t(24441),On=t(13961),Un=t(31544),Hn=t(36911),Wn=(0,a.createContext)({}),Vn=function(e){var n=e.children,t=(0,a.useState)(!1),r=t[0],i=t[1];return(0,o.tZ)(Wn.Provider,{value:{isEditingZap:r,setIsEditingZap:i},children:n})},Jn=function(){return(0,a.useContext)(Wn)},jn=t(76128);function Qn(){var e=(0,r.Z)(["\n margin-top: 10px;\n "]);return Qn=function(){return e},e}function $n(){var e=(0,r.Z)(["\n height: 180px;\n display: block !important;\n "]);return $n=function(){return e},e}function Gn(){var e=(0,r.Z)(["\n display: none !important;\n "]);return Gn=function(){return e},e}function Yn(){var e=(0,r.Z)(["\n display: none !important;\n "]);return Yn=function(){return e},e}function Kn(){var e=(0,r.Z)(["\n border-bottom: 1px solid ",";\n display: table-cell !important;\n height: 74px;\n "]);return Kn=function(){return e},e}var et=(0,h.uq)({mobile:(0,l.iv)(Qn()),zapTable:"display: table-row;"}),nt=(0,h.uq)({mobile:(0,l.iv)($n()),zapTable:(0,l.iv)(Gn())}),tt=(0,h.uq)({mobile:(0,l.iv)(Yn()),zapTable:(0,l.iv)(Kn(),f.w.neutral400)}),rt=function(){return(0,o.BX)("tr",{css:et,children:[(0,o.tZ)("td",{colSpan:8,css:tt,children:(0,o.tZ)(jn.g,{children:(0,o.tZ)(y.q,{height:74,borderRadius:0})})}),(0,o.tZ)("td",{css:nt,children:(0,o.tZ)(jn.g,{children:(0,o.tZ)(y.q,{height:180})})})]})};function it(){var e=(0,r.Z)(["\n border: 1px solid ",";\n background-color: ",";\n border-radius: 5px;\n box-shadow: inset 6px 0 0 -3px ",';\n align-items: center;\n grid-template-columns: 0px 30px 2fr 1fr 60px 40px;\n grid-template-areas:\n "dragIcon checkbox services services toggle menu"\n ". . title title title ."\n ". . owner owner owner owner"\n ". . edited status status status";\n padding: 15px;\n margin: 10px 0 0;\n gap: 5px 0;\n td {\n border-bottom: 0 none transparent;\n background-color: ',";\n }\n "]);return it=function(){return e},e}function ot(){var e=(0,r.Z)(['\n grid-template-columns: 0px 45px 110px 1.5fr 60px 60px 40px;\n grid-template-areas:\n "dragIcon checkbox services title . toggle menu"\n ". . owner owner edited edited edited"\n ". . . . status status status";\n ']);return ot=function(){return e},e}function at(){var e=(0,r.Z)(["\n margin: 0;\n display: table-row;\n border-radius: 0;\n td {\n height: 74px;\n padding: 0 10px 0 10px;\n border-bottom: 1px solid ",";\n border-top: 1px solid ",";\n background-color: ",";\n }\n "]);return at=function(){return e},e}function lt(){var e=(0,r.Z)(["\n animation: "," "," ",";\n "]);return lt=function(){return e},e}function dt(){var e=(0,r.Z)(["\n animation: none;\n td {\n animation: "," "," ",";\n }\n "]);return dt=function(){return e},e}var st=function(e,n){return(0,h.uq)({mobile:(0,l.iv)(it(),f.w.neutral400,e||n?f.w.acidWash:f.w.transparent,n?f.w.blueJeans:"transparent",f.w.transparent),tablet:(0,l.iv)(ot()),zapTable:(0,l.iv)(at(),f.w.neutral400,f.w.transparent,e?f.w.acidWash:f.w.transparent)})},ct="linear",ut=(0,l.F4)("0%{background-color:",f.w.acidWash,";border-color:",f.w.blue,";}75%{background-color:",f.w.acidWash,";border-color:",f.w.blue,";}100%{background-color:",f.w.transparent,";border-color-bottom:",f.w.neutral400,";@media (min-width:",p.RI,"px){border-color-top:",f.w.transparent,";}}","ZapTableRowDraggable.tsx--fadeOutZapBody"),pt=(0,h.uq)({mobile:(0,l.iv)(lt(),"4s",ut,ct),zapTable:(0,l.iv)(dt(),"4s",ut,ct)}),ht=function(e){var n,t,r=e.children,i=e.id,d=e.isNew,s=(0,Fe.Z)(),c=s.toggle,u=s.isChecked,p=s.clear,h=u(i),v=(0,rn.Cj)().active,f=Jn().isEditingZap,m=(0,Ge.Z)().details,g=(0,a.useMemo)((function(){return i===m}),[i,m]);return(0,a.useEffect)((function(){var e,n;(null===v||void 0===v||null===(e=v.data)||void 0===e||null===(n=e.current)||void 0===n?void 0:n.id)!==i||h||c(i)}),[null===v||void 0===v?void 0:v.data,h,c,i]),(0,o.tZ)("tr",{id:"ZapItem-root-".concat(i),"data-testid":"ZapItem-root-".concat(i),css:[st(h,g),d&&pt,(n=h&&!f,t=!!(null===v||void 0===v?void 0:v.id),(0,l.iv)("opacity:",n&&t?.5:1," !important;transition:opacity 250ms ease;","ZapTableRowDraggable.tsx--dragAndDropStyle"))],onContextMenu:function(e){var n;!!(null===(n=e.target)||void 0===n?void 0:n.closest('div[id*="ZapPauseToggle-"], div[id*="zap-details-header"], div[id="zaptablerow-title"],div[id*="zap-item-drawer"]'))||h||(p(),c(i))},children:r})},vt=(0,a.memo)(ht),ft=t(61446),mt=t(96963),gt=t(97177),Zt=t(25001),bt=t(71738),wt=t(43975),xt=t(29416),yt=t(43455),It=t(56813),St=t(25666),kt=t(59400);function Ft(){var e=(0,r.Z)(["\n padding: 10px 0 !important;\n width: auto;\n "]);return Ft=function(){return e},e}function zt(){var e=(0,r.Z)(['\n align-items: center;\n display: flex;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n & span[class*="navFolderFill"] {\n padding-top: 2px !important;\n }\n ']);return zt=function(){return e},e}function Ct(){var e=(0,r.Z)(["\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n white-space: normal;\n -webkit-box-align: start;\n "]);return Ct=function(){return e},e}var Tt=(0,h.uq)({zapTable:(0,l.iv)(Ft())}),At=(0,h.uq)({mobile:(0,l.iv)(zt()),zapTable:(0,l.iv)(Ct())}),Dt=(0,l.iv)("text-decoration:underline;a{&:hover,&:focus{text-decoration-color:transparent !important;color:",f.w.night," !important;text-decoration-color:",f.w.night," !important;transition:text-decoration-color 0.1s 0.2s,color 0.2s !important;}}","ZapTableRowTitle.tsx--folderNameStyle"),Bt=(0,l.iv)("display:inline-block;margin-left:5px;","ZapTableRowTitle.tsx--badgeStyle"),_t=(0,l.iv)("display:inline-block;margin-left:3px;transform:translate(0,1px);","ZapTableRowTitle.tsx--editInSlackIconStyle"),Et=function(e){var n=e.canEditInSlack,t=e.folderId,r=e.folderName,i=e.handleRenamingState,l=e.isRenaming,d=e.onRename,s=e.title,c=e.url,u=(0,Ge.Z)().search,h=(0,kt.Z)().isSearchServiceMVPEnabled;return l&&(0,Ae.isFunction)(d)?(0,o.tZ)(It.Z,{loadedText:s,onAccept:d,onClose:i,placeholder:"Enter Zap Title"}):(0,o.BX)("div",{css:Tt,id:"zaptablerow-title",children:[(0,o.tZ)(g.r,{href:c,title:s?"Edit Zap ".concat(s):"Edit untitled Zap",children:(0,o.tZ)(m.x,{color:"neutral800",tag:"h3",type:"smallPrint1Semibold",children:(0,o.BX)(a.Fragment,{children:[(0,o.tZ)("span",{"data-testid":"ZapItem-title",children:s?(0,o.tZ)(St.Z,{text:s,highlight:u}):p.MK}),n&&(0,o.tZ)("span",{css:Bt,children:(0,o.BX)(xt.S,{color:"gray",size:"small",children:["Edit in Slack",(0,o.tZ)("span",{css:_t,children:(0,o.tZ)(k.J,{color:"white",name:"arrowOffsite",size:15})})]})})]})})}),(0,yt.k)(s,u)&&h&&(0,o.tZ)(m.x,{type:"smallPrint1",children:"Your search term is in the Zap name."}),r&&!!t&&(0,o.tZ)("span",{css:At,children:(0,o.BX)(m.x,{type:"smallPrint1",children:[(0,o.tZ)(k.J,{size:14,name:"navFolderFill"})," in"," ",(0,o.tZ)("span",{css:Dt,children:(0,o.tZ)(g.r,{title:r,href:(0,ge.do)(t),children:r})})]})})]})},Mt=t(14676),Nt=t(16536),Lt=t(23001),qt=function(e){return(0,l.iv)("align-items:center;cursor:",e?"grab":void 0,";display:flex;justify-content:center;opacity:1 !important;","ZapTableRowDragHandle.tsx--dragAndDropStyle")},Rt=function(e){var n=e.folderId,t=e.id,r=e.isFolderShared,i=e.title,l=(0,Fe.Z)(),d=l.checked,s=(0,l.isChecked)(t),c=(0,Ge.Z)().details,u=(0,Lt.Z)().isPublishApprovalEnabled,p=(0,he.gn)().isAdmin,h=Jn().isEditingZap,v=(0,rn.O1)({attributes:{roleDescription:"Drag Zap ".concat(i," to a new folder")},id:"Dragging-Zap-".concat((0,Nt.F)(i),"-").concat(t),data:{folderId:n,isFolderShared:r,id:t},disabled:u&&!p||h||!!c}),f=v.isDragging,m=v.attributes,g=v.listeners,Z=v.setNodeRef,b=(0,a.useMemo)((function(){return!c&&(0===d.size||s&&!h)}),[c,h,s,d.size]);return(0,S.At)(f,"drag Zap"),(0,o.tZ)("div",(0,fn.Z)((0,vn.Z)({css:qt(b),ref:Z},(s||0===d.size)&&g,(s||0===d.size)&&m),{"aria-label":"Drag Zap ".concat(i," handle"),children:(0,o.tZ)(k.J,{name:"actionDrag",size:20})}))},Pt=(0,a.memo)(Rt);function Xt(){var e=(0,r.Z)(["\n grid-area: dragIcon;\n // hide drag icon on mobile/tablet, only display on desktop\n display: none !important;\n "]);return Xt=function(){return e},e}function Ot(){var e=(0,r.Z)(["\n display: table-cell !important;\n width: 20px;\n "]);return Ot=function(){return e},e}function Ut(){var e=(0,r.Z)(['\n grid-area: checkbox;\n input[type="checkbox"] {\n &:hover,\n &:focus {\n &:after {\n display: block;\n content: "";\n border-radius: 3px;\n border: 2px solid ',';\n height: 14px;\n width: 14px;\n }\n }\n }\n input[type="checkbox"]:checked {\n &:hover,\n &:focus {\n &:after {\n border: 2px solid ',";\n box-shadow: 0 0 0 2px ",";\n }\n }\n }\n "]);return Ut=function(){return e},e}function Ht(){var e=(0,r.Z)(["\n justify-self: start;\n width: 40px;\n white-space: nowrap;\n margin: 0 0 0 20px;\n "]);return Ht=function(){return e},e}function Wt(){var e=(0,r.Z)(["\n grid-area: services;\n "]);return Wt=function(){return e},e}function Vt(){var e=(0,r.Z)(["\n width: 135px;\n "]);return Vt=function(){return e},e}function Jt(){var e=(0,r.Z)(["\n grid-area: title;\n min-width: 0;\n word-break: break-word;\n display: flex;\n flex-direction: column;\n a {\n text-decoration-color: transparent !important;\n transition: all 0.2s !important;\n outline: none !important;\n\n &:hover,\n &:focus {\n text-decoration-color: transparent !important;\n\n h3 {\n color: "," !important;\n text-decoration-color: "," !important;\n transition: text-decoration-color 0.1s 0.2s, color 0.2s !important;\n }\n }\n h3 {\n text-decoration: underline !important;\n text-decoration-color: transparent !important;\n transition: text-decoration-color 0.1s 0.2s, color 0.2s !important;\n }\n }\n "]);return Jt=function(){return e},e}function jt(){var e=(0,r.Z)(["\n margin: 0;\n "]);return jt=function(){return e},e}function Qt(){var e=(0,r.Z)(["\n grid-area: toggle;\n padding: 10px 0;\n "]);return Qt=function(){return e},e}function $t(){var e=(0,r.Z)(["\n padding: 0;\n width: 80px;\n padding-left: 15px;\n "]);return $t=function(){return e},e}function Gt(){var e=(0,r.Z)(["\n grid-area: edited;\n width: 100px;\n white-space: nowrap;\n > div time {\n font-weight: bold;\n }\n "]);return Gt=function(){return e},e}function Yt(){var e=(0,r.Z)(["\n > div time {\n font-weight: normal;\n }\n "]);return Yt=function(){return e},e}function Kt(){var e=(0,r.Z)(["\n grid-area: menu;\n "]);return Kt=function(){return e},e}function er(){var e=(0,r.Z)(["\n padding-left: 5px !important;\n width: 45px;\n "]);return er=function(){return e},e}function nr(){var e=(0,r.Z)(["\n font-size: 14px;\n font-weight: normal;\n margin-right: 5px;\n white-space: nowrap;\n "]);return nr=function(){return e},e}function tr(){var e=(0,r.Z)(["\n display: none;\n white-space: normal;\n "]);return tr=function(){return e},e}var rr=(0,h.uq)({mobile:(0,l.iv)(Xt()),zapTable:(0,l.iv)(Ot())}),ir=(0,h.uq)({mobile:(0,l.iv)(Ut(),f.w.blue,f.w.white,f.w.blue),zapTable:(0,l.iv)(Ht())}),or=(0,h.uq)({mobile:(0,l.iv)(Wt()),zapTable:(0,l.iv)(Vt())}),ar=(0,h.uq)({mobile:(0,l.iv)(Jt(),f.w.blue,f.w.blue),zapTable:(0,l.iv)(jt())}),lr=(0,h.uq)({mobile:(0,l.iv)(Qt()),zapTable:(0,l.iv)($t())}),dr=(0,h.uq)({mobile:(0,l.iv)(Gt()),zapTable:(0,l.iv)(Yt())}),sr=(0,h.uq)({mobile:(0,l.iv)(Kt()),zapTable:(0,l.iv)(er())}),cr=(0,h.uq)({mobile:(0,l.iv)(nr()),zapTable:(0,l.iv)(tr())}),ur=function(e){var n=e.canCheck,t=e.canEditInSlack,r=e.canTransferData,i=e.createdAt,l=e.description,d=e.editorUrl,s=e.folderId,c=e.folderName,u=e.hasPublishedVersion,p=e.id,h=e.isFolderShared,v=e.isInTrash,f=e.isToggling,m=e.isValid,g=e.isApprovalLoading,Z=e.lastDisabledAt,b=e.note,w=e.onAcceptDelete,x=e.onChangeOwner,y=e.onDuplicate,I=e.onMove,S=e.onRename,k=e.onRun,F=e.onShare,z=e.onZapToggle,C=e.ownerEmail,T=e.ownerId,A=e.ownerImage,D=e.ownerName,B=e.publishedAt,_=e.services,E=e.serviceTooltipContent,M=e.showOwner,N=void 0===M||M,L=e.timezone,q=e.title,R=e.titleUrl,P=e.updatedAt,X=e.zapStatus,O=e.isApprovalRequired,U=e.isApprovalRestrictedInPrivateFolder,H=e.pendingEnableOrDisableApproval,W=e.pendingDeleteApproval,V=e.userPendingApproval,J=e.setApprovalModalType,j=(0,Fe.Z)(),Q=j.isChecked,$=j.toggle,G=j.uncheck,Y=Q(p),K=(0,a.useState)(!1),ee=K[0],ne=K[1],te=Jn().setIsEditingZap,re=(0,a.useCallback)((function(){te(!ee),ne(!ee)}),[ee,te]),ie=!v&&n,oe=I?function(){G(p),I()}:void 0;return(0,o.BX)(a.Fragment,{children:[(0,o.tZ)("td",{css:rr,"data-testid":"ZapItem-Drag-Icon",children:(0,o.tZ)(Pt,{folderId:s,id:p,isFolderShared:h,title:q})}),(0,o.tZ)("td",{css:ir,"data-testid":"ZapItem-selected",children:ie&&(0,o.tZ)(ft.l,{children:(0,o.tZ)(mt.X,{ariaLabel:q||"Unnamed Zap",checked:Y,onChange:function(){return $(p)},value:p})})}),(0,o.tZ)("td",{css:or,children:(0,o.tZ)(wt.Z,{id:p,services:_,serviceTooltipContent:E})}),(0,o.tZ)("td",{css:ar,children:(0,o.tZ)(Et,{canEditInSlack:t,folderId:String(s),folderName:c,handleRenamingState:re,isRenaming:ee,onRename:S,title:q,url:R||d})}),N&&(0,o.tZ)(Mt.Z,{email:C,name:D,image:A}),(0,o.BX)("td",{css:dr,children:[(0,o.tZ)("span",{css:cr,children:"Last edit:"}),(0,o.tZ)(Zt.Z,{createdAt:i,hasPublishedVersion:u,lastDisabledAt:Z,publishedAt:B,updatedAt:P,zapStatus:X})]}),X&&(0,o.BX)(a.Fragment,{children:[z&&(0,o.tZ)("td",{css:lr,children:(0,o.tZ)(gt.Z,{id:p,isLoading:f,isTrashed:v,isValid:m,onDisableZap:function(){return z("disable")},onEnableZap:function(){return z("enable")},status:X,isApprovalRequired:O,isRestricted:U,pendingApproval:H,userPendingApproval:V,setApprovalType:J})}),(0,o.tZ)("td",{css:sr,children:(0,o.tZ)(bt.Z,{canTransferData:r,createdAt:i,description:l,editorUrl:d,folderId:s,hasPublishedVersion:u,id:p,isInTrash:v,isToggling:!!f,isValid:!!m,isApprovalLoading:g,lastDisabledAt:Z,note:b,onAcceptDelete:w,onChangeOwner:x,onDuplicate:y,onMove:oe,onRename:S,onRun:k,onShare:F,onZapToggle:z,ownerEmail:C,ownerId:T,ownerImage:A,ownerName:D,publishedAt:B,status:X,timezone:L,title:q,isApprovalRequired:O,isRestricted:U,pendingDeleteApproval:W,userPendingApproval:V,pendingEnableOrDisableApproval:H,setApprovalType:J})})]})]})},pr=(0,a.memo)(ur),hr=t(94525),vr=s()((function(){return Promise.all([t.e(3378),t.e(7479),t.e(5307)]).then(t.bind(t,29006))}),{loadableGenerated:{webpack:function(){return[29006]}},ssr:!1}),fr=function(e){var n,t,r,l,d,s=e.folderId,c=void 0===s?p.ZJ:s,h=e.isNew,v=e.isSearching,f=e.ownerId,m=e.searchQuery,g=e.page,Z=e.setNewZap,x=e.showOwner,y=e.zapFolderId,I=e.zapId,S=(0,u.X8)(),k=(0,Un.Z)({zapId:I,folderId:y}),F=(0,ke.Z)({folderId:Number((null===k||void 0===k?void 0:k.folderId)||c)}),z=(0,qn.Z)({accountId:S,folderId:c,kind:null===k||void 0===k?void 0:k.kind,searchQuery:m,page:g,zapId:null===k||void 0===k?void 0:k.id,currentVersionId:null===k||void 0===k?void 0:k.currentVersionId,ownerId:f}).isPausing,C=(0,Rn.Z)({currentFolderId:v&&k?k.folderId:c,rootFolderId:null===F||void 0===F?void 0:F.rootId,isSearching:v,zap:k}),T=C.canCheck,A=C.canTransferExistingData,D=C.slackWorkflowBuilderUrl,B=(0,Pn.Z)(k,c),_=B.copiesInProgress,E=B.currentAction,M=B.editorUrl,N=B.onMoveZap,L=B.onAcceptChangeOwner,q=B.onAcceptDelete,R=B.onAcceptMoveZap,P=B.onAcceptRenameZap,X=B.onChangeOwner,O=B.onDuplicate,U=B.onZapToggle,H=B.onRun,W=B.setCurrentAction,V=B.shareZap,J=(0,hr.Z)(k),j=J.serviceNames,Q=J.services,$=(0,a.useState)(null),G=$[0],Y=$[1],K=(0,Xn.Q)(k.id,null===F||void 0===F?void 0:F.isShared),ee=K.isApprovalRestrictedInPrivateFolder,ne=K.isApprovalRequired,te=K.isApprovalLoading,re=K.pendingDeleteApproval,ie=K.pendingEnableOrDisableApproval,oe=K.userPendingApproval,ae=(0,a.useMemo)((function(){return(null===k||void 0===k?void 0:k.createdAt)||""}),[k]);if(!k)return null;var le=k.isEnabled?"on":"off",de=function(){var e=(0,b.Z)((function(){var e;return(0,w.__generator)(this,(function(n){switch(n.label){case 0:return O?[4,O()]:[3,2];case 1:(null===(e=n.sent())||void 0===e?void 0:e.id)&&Z&&Z(e.id),n.label=2;case 2:return[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,o.BX)(Vn,{children:[E===Hn.I.duplicate&&(0,i.Z)(Array(_)).map((function(e,n){return(0,o.tZ)(rt,{},n)})),(0,o.tZ)(vt,{id:k.id,isNew:h,children:(0,o.tZ)(pr,{canCheck:T,canEditInSlack:!!D,canTransferData:A,createdAt:ae,description:k.description,editorUrl:M,folderName:function(e){return"folderName"in e?e.folderName:null}(k),folderId:null===k||void 0===k?void 0:k.folderId,hasPublishedVersion:(null===k||void 0===k?void 0:k.hasPublishedVersion)||void 0,id:k.id,isFolderShared:null===F||void 0===F?void 0:F.isShared,isInTrash:k.isTrashed,isToggling:z,isValid:!k.zdl||(0,On.Z)(k.zdl),isApprovalLoading:te,lastDisabledAt:(null===k||void 0===k?void 0:k.lastDisabledAt)||"",note:k.note,isApprovalRequired:ne,isApprovalRestrictedInPrivateFolder:ee,pendingEnableOrDisableApproval:ie,pendingDeleteApproval:re,userPendingApproval:oe,setApprovalModalType:Y,onChangeOwner:X,onAcceptDelete:q,onDuplicate:de,onMove:N,onRename:P,onRun:H,onShare:V,onZapToggle:U,ownerEmail:null===k||void 0===k||null===(n=k.owner)||void 0===n?void 0:n.email,ownerImage:null===k||void 0===k||null===(t=k.owner)||void 0===t?void 0:t.imageUrl,ownerName:null===k||void 0===k||null===(r=k.owner)||void 0===r?void 0:r.name,ownerId:f,publishedAt:(null===k||void 0===k?void 0:k.publishedAt)||"",services:Q,serviceTooltipContent:(null===k||void 0===k||null===(l=k.steps)||void 0===l?void 0:l.length)>3?j:void 0,showOwner:x,timezone:(null===k||void 0===k?void 0:k.timezone)||(null===k||void 0===k||null===(d=k.zdl)||void 0===d?void 0:d.timezone),title:k.title,updatedAt:k.updatedAt,zapStatus:le})}),(0,o.tZ)(vr,{approvalModalType:G,pendingDeleteApproval:re,pendingEnableOrDisableApproval:ie,currentAction:E,isFolderShared:null===F||void 0===F?void 0:F.isShared,onAcceptDelete:q,onAcceptMoveZap:R,onChangeOwner:L,setCurrentAction:W,setApprovalModalType:Y,zap:k})]})},mr=t(24468);function gr(){var e=(0,r.Z)(["\n border: 1px solid ",';\n border-radius: 5px;\n display: grid;\n align-items: center;\n grid-template-columns: 0px 30px 2fr 1fr 60px 40px;\n grid-template-areas:\n "dragIcon checkbox services services toggle menu"\n ". . title title title ."\n ". . owner owner owner owner"\n ". . edited status status status";\n padding: 15px;\n margin: 10px 0 0;\n td > div {\n flex: 1 1 100%;\n }\n ']);return gr=function(){return e},e}function Zr(){var e=(0,r.Z)(['\n grid-template-columns: 0px 45px 110px 1.5fr 60px 60px 40px;\n grid-template-areas:\n "dragIcon checkbox services title . toggle menu"\n ". . owner owner edited edited edited"\n ". . . . status status status";\n ']);return Zr=function(){return e},e}function br(){var e=(0,r.Z)(["\n height: 74px;\n td {\n padding: 0 5px;\n }\n "]);return br=function(){return e},e}function wr(){var e=(0,r.Z)(["\n grid-area: dragIcon;\n width: auto !important;\n "]);return wr=function(){return e},e}function xr(){var e=(0,r.Z)(["\n width: 20px !important;\n "]);return xr=function(){return e},e}function yr(){var e=(0,r.Z)(["\n grid-area: checkbox;\n width: auto !important;\n "]);return yr=function(){return e},e}function Ir(){var e=(0,r.Z)(["\n width: 20px !important;\n "]);return Ir=function(){return e},e}function Sr(){var e=(0,r.Z)(["\n grid-area: services;\n width: auto !important;\n > div {\n display: flex;\n }\n "]);return Sr=function(){return e},e}function kr(){var e=(0,r.Z)(["\n width: 10% !important;\n "]);return kr=function(){return e},e}function Fr(){var e=(0,r.Z)(["\n grid-area: title;\n width: 100% !important;\n padding-right: 20px;\n > div {\n width: 100%;\n }\n "]);return Fr=function(){return e},e}function zr(){var e=(0,r.Z)(["\n width: 50% !important;\n > div {\n width: 100% !important;\n max-width: none !important;\n }\n "]);return zr=function(){return e},e}function Cr(){var e=(0,r.Z)(["\n grid-area: owner;\n "]);return Cr=function(){return e},e}function Tr(){var e=(0,r.Z)(["\n width: 75px !important;\n "]);return Tr=function(){return e},e}function Ar(){var e=(0,r.Z)(["\n grid-area: edited;\n "]);return Ar=function(){return e},e}function Dr(){var e=(0,r.Z)(["\n width: 10% !important;\n "]);return Dr=function(){return e},e}function Br(){var e=(0,r.Z)(["\n grid-area: toggle;\n width: auto !important;\n "]);return Br=function(){return e},e}function _r(){var e=(0,r.Z)(["\n width: 75px !important;\n "]);return _r=function(){return e},e}function Er(){var e=(0,r.Z)(["\n grid-area: menu;\n width: auto !important;\n "]);return Er=function(){return e},e}function Mr(){var e=(0,r.Z)(["\n width: 50px !important;\n "]);return Mr=function(){return e},e}var Nr=(0,h.uq)({mobile:(0,l.iv)(gr(),f.w.neutral400),tablet:(0,l.iv)(Zr()),zapTable:(0,l.iv)(br())}),Lr=(0,h.uq)({mobile:(0,l.iv)(wr()),zapTable:(0,l.iv)(xr())}),qr=(0,h.uq)({mobile:(0,l.iv)(yr()),zapTable:(0,l.iv)(Ir())}),Rr=(0,h.uq)({mobile:(0,l.iv)(Sr()),zapTable:(0,l.iv)(kr())}),Pr=(0,h.uq)({mobile:(0,l.iv)(Fr()),zapTable:(0,l.iv)(zr())}),Xr=(0,h.uq)({mobile:(0,l.iv)(Cr()),zapTable:(0,l.iv)(Tr())}),Or=(0,h.uq)({mobile:(0,l.iv)(Ar()),zapTable:(0,l.iv)(Dr())}),Ur=(0,h.uq)({mobile:(0,l.iv)(Br()),zapTable:(0,l.iv)(_r())}),Hr=(0,h.uq)({mobile:(0,l.iv)(Er()),zapTable:(0,l.iv)(Mr())}),Wr=function(e){var n=e.showOwner,t=void 0===n||n;return(0,o.BX)("tr",{css:Nr,children:[(0,o.tZ)("td",{css:Lr,children:(0,o.tZ)(y.q,{height:18,width:18})}),(0,o.tZ)("td",{css:qr,children:(0,o.tZ)(y.q,{height:18,width:18})}),(0,o.tZ)("td",{css:Rr,children:(0,o.BX)("div",{children:[(0,o.tZ)(y.q,{height:30,width:30}),(0,o.tZ)(pe.L,{width:5}),(0,o.tZ)(y.q,{height:30,width:30})]})}),(0,o.tZ)("td",{css:Pr,children:(0,o.tZ)(y.q,{height:30,width:"100%"})}),t&&(0,o.tZ)("td",{css:Xr,children:(0,o.tZ)(y.q,{height:30,width:"100%"})}),(0,o.tZ)("td",{css:Or,children:(0,o.tZ)(y.q,{height:30,width:"100%"})}),(0,o.tZ)("td",{css:Ur,children:(0,o.tZ)(y.q,{height:44,width:"100%"})}),(0,o.tZ)("td",{css:Hr,children:(0,o.tZ)(y.q,{height:40,width:"100%"})})]})},Vr=(0,a.memo)(Wr),Jr=(0,l.iv)("flex:1 1 auto;","ZapTableLoading.tsx--rootStyle"),jr=function(e){var n=e.includeHeader,t=e.showOwner;return(0,o.BX)("div",{css:Jr,children:[n&&(0,o.tZ)(ze.Z,{}),(0,o.tZ)(mr.Z,{collapseBreakpoint:p.RI,header:(0,o.tZ)(Ln,{showOwner:t}),rows:(0,i.Z)(Array(5)).map((function(e,n){return(0,o.tZ)(Vr,{showOwner:t},n)}))})]})},Qr=t(78581),$r=function(e,n,t){(0,a.useEffect)((function(){e&&!n&&(null===t||void 0===t?void 0:t.length)&&(null===t||void 0===t?void 0:t.length)<=p.wN&&(0,Qr.pL)("search-".concat(encodeURI(e)))}),[e,n,t])},Gr=t(17688),Yr=t(81901);function Kr(){var e=(0,r.Z)(["\n position: relative;\n width: 100%;\n margin-top: 20px;\n "]);return Kr=function(){return e},e}function ei(){var e=(0,r.Z)(["\n display: none;\n "]);return ei=function(){return e},e}var ni=(0,h.uq)({mobile:(0,l.iv)(Kr()),zapTable:(0,l.iv)(ei())}),ti=(0,l.iv)('position:absolute;top:-70px;right:0;& > div[class*="Field"]{width:300px !important;height:42px;}',"ZapTableSortDropdown.tsx--sortDropdownStyle"),ri=function(e){var n=e.onSortChange,t=e.currentSort,r=(0,a.useState)(null),i=r[0],l=r[1],d=(0,a.useMemo)((function(){return[{label:"Zap title, A to Z",value:"title"},{label:"Zap title, Z to A",value:"-title"},{label:"Last edited, most to least recent",value:"-updated_at"},{label:"Last edited, least to most recent",value:"updated_at"},{label:"Status, enabled to disabled",value:"enabled"},{label:"Status, disabled to enabled",value:"-enabled"}]}),[]);return(0,a.useEffect)((function(){var e=d.find((function(e){return e.value===t}));l(e||null)}),[t,l,d]),(0,o.tZ)("div",{css:ni,children:(0,o.tZ)("div",{css:ti,children:(0,o.tZ)(Gr.g,{label:"Sort Zaps by",renderInput:function(e){return(0,o.tZ)(Yr.L,{inputId:e.id,items:d,menuAriaLabel:"List of available roles",onChange:n,placeholder:"Sort by...",selectedItem:i})}})})})},ii=function(e){var n=e.folderId,t=e.isLoading,r=void 0!==t&&t,i=e.isSearch,l=e.newZaps,d=e.ownerId,s=e.page,c=e.searchQuery,u=e.setNewZap,h=e.zapIds,v=e.zaps,f=(0,Ge.Z)(),m=f.setParams,g=f.orderBy,Z=f.searchType,b=(0,ke.Z)({folderId:n}),w=(0,he.gn)(),x=w.isTeam,y=w.userId,I=d||y;$r(c,r,v),function(e,n){var t=(0,a.useState)(e),r=t[0],i=t[1],o=(0,a.useState)(n),l=o[0],d=o[1];(0,a.useEffect)((function(){e!==r&&e.length!==r.length&&l===n?(e.length<r.length&&(0,Ae.difference)(r,e).forEach((function(e){(0,Qr.fr)("move_zap_".concat(e))&&(0,Qr.Nf)("move_zap_".concat(e))})),i(e)):l!==n&&d(n)}),[e,r,l,n])}(h||[],n||p.ZJ);var S=(0,kt.Z)().isSearchServiceMVPEnabled,k=(0,a.useState)(g||""),F=k[0],z=k[1],C=(0,a.useCallback)((function(e){z(e),"folder"===Z?m({orderBy:e},[],"#zaps"):"webhook"===Z&&"#zaps"!==(null===window||void 0===window?void 0:window.location.hash)?m({orderBy:e},[],"#webhooks"):m({orderBy:e},[],"#zaps")}),[m,z,Z]);return(0,o.BX)(a.Fragment,{children:[r&&(0,o.tZ)(jr,{}),Array.isArray(h)&&(null===h||void 0===h?void 0:h.length)&&!r?(0,o.tZ)(mr.Z,{collapseBreakpoint:p.RI,header:(0,o.tZ)(Ln,{showOwner:Boolean(null===b||void 0===b?void 0:b.isShared)||String(null===b||void 0===b?void 0:b.id)===String(p.K0)}),rows:h.map((function(e){return(0,o.tZ)(fr,{folderId:n,isNew:null===l||void 0===l?void 0:l.includes(e),isSearching:!1,ownerId:I,setNewZap:u,showOwner:Boolean(null===b||void 0===b?void 0:b.isShared)||String(null===b||void 0===b?void 0:b.id)===String(p.K0),zapId:e},e)}))}):null,Array.isArray(v)&&(null===v||void 0===v?void 0:v.length)&&!r?(0,o.BX)(a.Fragment,{children:[S&&(0,o.tZ)(ri,{onSortChange:function(e){var n=e.value;C(n)},currentSort:F}),(0,o.tZ)(mr.Z,{collapseBreakpoint:p.RI,header:(0,o.tZ)(Ln,{showOwner:i&&x,sortable:S,currentSort:F,onSort:C}),rows:v.map((function(e){return(0,o.tZ)(fr,{isSearching:!0,ownerId:I,searchQuery:c,page:s,showOwner:i&&x,zapFolderId:e.folderId,zapId:e.id},e.id)}))})]}):null]})},oi=t(816),ai=t(85769),li=t(57504),di=function(e){var n=e.accountId,t=e.allowEmptySearch,r=e.app,i=e.connection,o=e.folderId,l=e.orderBy,d=e.ownedBy,s=e.ownerId,c=e.page,u=e.searchQuery,h=e.webhookSearch,f=(0,ai.Z)({accountId:n,allowEmptySearch:t,app:r||void 0,connection:i||void 0,folderId:o,orderBy:l||void 0,ownedBy:d||void 0,ownerId:s,page:c,search:u||void 0,webhookSearch:h}),m=f.zaps,g=f.isLoading,Z=f.isLegacyLoading,b=f.legacyZaps,w=f.hasNextPage,x=f.loadMore,y=f.loadingMore,I=void 0!==y&&y,S=f.totalCount,k=p.P_.includes(Number(o)),F=(0,a.useMemo)((function(){return(0,v.Z)(o)&&(null===m||void 0===m?void 0:m.length)?m:(u||k||!u&&t)&&(null===b||void 0===b?void 0:b.length)?b:m}),[t,o,k,b,u,m]),z=(0,a.useMemo)((function(){return F.map((function(e){return e.id}))}),[F]),C="/webintent/create-zap?entry-point-method=make_a_zap_call_to_action&entry-point-location=my_zaps".concat((0,li.Z)(o)?"":"&folder_id=".concat(o)),T=!!u||!u&&t,A=!F.length&&!Z,D=Z?"":"".concat(S," ").concat(Ee()("Zap result",F.length),' for "').concat(u,'"');return{zaps:F,zapIds:z,loadMore:x,hasNextPage:w,isLoading:g,isZapsLoadingMore:I,isLegacyZapsLoading:Z,isSearch:T,searchTitle:D,shouldShowZapsEmpty:A,createZapHref:C,totalCount:S}},si=t(30896),ci=t(90982),ui=t(96459),pi=function(e){var n=e.page,t=void 0===n?0:n,r=e.onPaginate,i=e.pageCount,l=(0,x.useRouter)(),d=(0,a.useMemo)((function(){return Array.from({length:i||0},(function(e,n){return(0,ui.Sr)(l.asPath,{page:n})}))}),[i,l]);return(0,o.tZ)(ci.D,{currentPageIndex:t,condenseAt:7,isCentered:!0,onPaginate:function(e,n){n.preventDefault(),null===r||void 0===r||r(e.pageIndex)},pageUrls:d})};function hi(){var e=(0,r.Z)(["\n align-self: center;\n width: 100%;\n max-width: 100%;\n margin: 10px auto;\n "]);return hi=function(){return e},e}function vi(){var e=(0,r.Z)(["\n max-width: 460px;\n margin: 10px auto;\n "]);return vi=function(){return e},e}function fi(){var e=(0,r.Z)(["\n max-width: 370px;\n margin: 10px auto;\n "]);return fi=function(){return e},e}var mi=s()((function(){return t.e(8767).then(t.bind(t,98767)).then((function(e){return e.ZapDrawerWrapper}))}),{loadableGenerated:{webpack:function(){return[98767]}},ssr:!1}),gi=(0,l.iv)("display:flex;justify-content:center;","MyZapsList.tsx--emptyFolderStyle"),Zi=(0,l.iv)("display:flex;flex-flow:column nowrap;min-height:50vh;justify-content:center;","MyZapsList.tsx--rootLoadingStyle"),bi=(0,h.uq)({mobile:(0,l.iv)(hi()),tablet:(0,l.iv)(vi()),desktop:(0,l.iv)(fi())}),wi=function(e){var n=e.webhookSearch,t=e.currentTab,r=(0,a.useState)([]),l=r[0],d=r[1],s=(0,u.X8)(),h=(0,Ge.Z)(),f=h.app,m=h.connection,g=h.details,Z=h.emptyQuerySearch,b=h.folderId,w=h.memberId,x=h.orderBy,y=h.ownedBy,I=h.page,S=h.search,k=h.setParams,F=h.searchType,z=w||void 0,C=(0,a.useState)(S||""),T=C[0],A=C[1],D=(0,oi.Z)().isFolderRouteLoading;(0,a.useEffect)((function(){A(S),d([])}),[S]);var B=(0,Fe.Z)(),_=B.clear,E=B.setContextMenuCoords;(0,a.useEffect)((function(){_()}),[b,_]);var M=di({accountId:s,allowEmptySearch:Z,app:f,connection:m,folderId:b,orderBy:x,ownedBy:y,ownerId:z,page:I,searchQuery:T,webhookSearch:n}),N=M.zaps,L=M.zapIds,q=M.loadMore,R=M.hasNextPage,P=M.isLoading,X=M.isZapsLoadingMore,O=M.isLegacyZapsLoading,U=M.isSearch,H=M.searchTitle,W=M.shouldShowZapsEmpty,V=M.createZapHref,J=M.totalCount,j=(0,a.useCallback)((function(e){e?"folder"===F&&"#webhooks"!==(null===window||void 0===window?void 0:window.location.hash)?k({page:(e+1).toString()},[],"#zaps"):"webhook"===F||"#webhooks"===(null===window||void 0===window?void 0:window.location.hash)?k({page:(e+1).toString()},[],"#webhooks"):k({page:(e+1).toString()}):"folder"===F?k({},["page"],"#zaps"):"webhook"===F?k({},["page"],"#webhooks"):k({},["page"])}),[F,k]),Q=(0,si.A)(),$=Q.setZapResultCount,G=Q.setWebhookResultCount,Y=Q.setIsZapSearchLoading,K=Q.setDisplayedWebhookZapIds,ee=Q.setDisplayedZapIds,ne=Q.displayedWebhookZapIds,te=Q.displayedZapIds,ie=(0,a.useMemo)((function(){return JSON.stringify(L)}),[L]);(0,a.useEffect)((function(){n?(G(J),K(ie)):($(J),ee(ie))}),[K,ee,G,$,J,n,ie]),(0,a.useEffect)((function(){Y(D||P&&!X||O)}),[D,O,P,X,Y]);return D||P&&!X||X&&U?(0,o.BX)("div",{css:Zi,children:[(0,o.tZ)(jr,{includeHeader:!1}),X&&U&&(0,o.tZ)("div",{css:bi,"data-testid":"FolderZaps-load-more",children:(0,o.tZ)(pi,{page:I?I-1:0,onPaginate:j,pageCount:Math.ceil(J/p.wN)})})]}):(0,o.BX)("div",{onContextMenu:function(e){var n,t=!!(null===(n=e.target)||void 0===n?void 0:n.closest('div[id*="ZapPauseToggle-"], div[id*="zap-details-header"], div[id="zaptablerow-title"],div[id*="zap-item-drawer"]')),r=e.clientY+370<=window.innerHeight,i=e.clientX+250<=window.innerWidth,o=r?e.clientY:e.clientY-370,a=i?e.clientX:e.clientX-250;t||(e.preventDefault(),E([a,o]))},children:[(0,o.tZ)(Dn,{createZapHref:V,folderId:b||p.ZJ,isLegacyZapsLoading:O,isLoadingMore:!!X,ownerId:z,searchQuery:T,page:I,title:U?H:"",zaps:N}),(0,o.BX)("div",{children:[U?(0,o.tZ)(ii,{searchQuery:T,isSearch:U,page:I,zaps:N,ownerId:z,isLoading:O&&!X}):(0,o.tZ)(ii,{folderId:Number(b||p.ZJ),newZaps:l,setNewZap:function(e){d((function(n){return(0,i.Z)(n).concat([e])}))},zapIds:L,ownerId:z}),R&&!U&&(0,o.tZ)("div",{css:bi,"data-testid":"FolderZaps-load-more",children:(0,o.tZ)(c.W,{isLoading:Boolean(X||O),onClick:function(){q(),d([])},children:"Load more"})}),W&&(0,o.BX)("div",{css:gi,children:[!(0,v.Z)(b)&&!U&&(0,o.tZ)(re,{createZapHref:V,folderId:b,ownerId:z,memberId:w}),(0,v.Z)(b)&&!U&&(0,o.tZ)(ue,{}),U&&(0,o.tZ)(Bn.Z,{query:T})]}),(R||I&&I>1)&&U&&(0,o.tZ)("div",{css:bi,"data-testid":"FolderZaps-load-more",children:(0,o.tZ)(pi,{page:I?I-1:0,onPaginate:j,pageCount:Math.ceil(J/p.wN)})})]}),g&&!te.includes(g)&&"#zaps"!==(null===t||void 0===t?void 0:t.href)&&!ne.includes(g)&&"#webhooks"!==(null===t||void 0===t?void 0:t.href)&&(0,o.tZ)(mi,{zapId:g})]})};function xi(e){var n=e.webhookSearch,t=e.currentTab;return(0,o.tZ)(Fe.w,{children:(0,o.tZ)(wi,{webhookSearch:n,currentTab:t})})}},30896:function(e,n,t){t.d(n,{A:function(){return l},N:function(){return a}});var r=t(52903),i=t(2784),o=(0,i.createContext)({}),a=function(e){var n=e.children,t=(0,i.useState)(0),a=t[0],l=t[1],d=(0,i.useState)(0),s=d[0],c=d[1],u=(0,i.useState)(0),p=u[0],h=u[1],v=(0,i.useState)(!0),f=v[0],m=v[1],g=(0,i.useState)(!0),Z=g[0],b=g[1],w=(0,i.useState)([]),x=w[0],y=w[1],I=(0,i.useState)([]),S={displayedWebhookZapIds:I[0],displayedZapIds:x,folderResultCount:p,isFolderSearchLoading:Z,isZapSearchLoading:f,setDisplayedWebhookZapIds:I[1],setDisplayedZapIds:y,setFolderResultCount:h,setIsFolderSearchLoading:b,setIsZapSearchLoading:m,setWebhookResultCount:c,setZapResultCount:l,webhookResultCount:s,zapResultCount:a};return(0,r.tZ)(o.Provider,{value:S,children:n})},l=function(){return(0,i.useContext)(o)}},49146:function(e,n,t){var r=t(2784),i=t(35591);n.Z=function(e){var n=e.serverErrors;(0,r.useEffect)((function(){n&&n.forEach((function(e){(0,i.Z)("".concat(e.key," (SSR)"),e.err)}))}),[])}},17948:function(e,n,t){t.d(n,{Z:function(){return s}});var r=t(40794),i=t(92228);function o(){var e=(0,i.Z)(["\n query Approvals {\n approvals {\n zap {\n account {\n id\n }\n folderId\n id\n steps {\n app {\n images {\n url32X32\n }\n name\n id\n }\n id\n }\n title\n zdl\n }\n member {\n name\n email\n imageUrl\n }\n id\n requester_note\n type\n requested_timestamp\n requested_by_user_id\n }\n }\n"]);return o=function(){return e},e}var a=(0,t(60138).Ps)(o()),l=t(35591),d=t(23001);var s=function(){var e=(0,d.Z)().isPublishApprovalEnabled,n=(0,r.a)(a,{skip:!e,onError:function(e){(0,l.Z)("ApprovalsQuery",e)}}),t=n.data,i=n.refetch;return{isLoading:n.loading,approvals:(null===t||void 0===t?void 0:t.approvals)||[],refetch:i}}},31544:function(e,n,t){var r=t(70865),i=t(56675),o=t(53770),a=t(87063),l=t(21815),d=t(73223),s=t(37490),c=t(961),u=t(16181);n.Z=function(e){var n=e.zapId,t=e.folderId,p=(0,i.x)(),h=(0,u.gn)().userId;if(!n)return null;var v=function(e,n){return e.readFragment({fragment:o.Z,id:"Zap:".concat(n)},!0)}(p,n)||function(e,n){return e.readFragment({fragment:c.AO,id:"Zap:".concat(n)},!0)}(p,n)||function(e,n){return e.readFragment({fragment:a.hw,id:"LegacyZap:".concat(n)},!0)}(p,n)||function(e,n){return e.readFragment({fragment:a.CT,id:"LegacyZap:".concat(n)})}(p,n),f=p.readFragment({fragment:s.FD,id:function(e){var n=Number(e)===d.ZJ,t=(0,r.Z)({id:null===e||void 0===e?void 0:e.toString()},n&&{ownerId:String(h||"")});return"Folder:".concat(JSON.stringify(t))}(t)}),m=p.readFragment({fragment:l.ET,id:"FolderTreeItem:".concat(null===t||void 0===t?void 0:t.toString())});return(0,r.Z)({},v,t&&((null===f||void 0===f?void 0:f.title)||(null===m||void 0===m?void 0:m.name))?{folderName:(null===f||void 0===f?void 0:f.title)||(null===m||void 0===m?void 0:m.name)}:{})}},24441:function(e,n,t){t.d(n,{Q:function(){return l}});var r=t(16181),i=t(23001),o=t(17948),a=t(89739);function l(e,n){var t=(0,r.gn)(),l=t.isAdmin,d=t.userId,s=(0,i.Z)().isPublishApprovalEnabled,c=(0,o.Z)(),u=c.approvals,p=c.isLoading,h=u.filter((function(n){var t;return(null===n||void 0===n||null===(t=n.zap)||void 0===t?void 0:t.id)===e}));return{isApprovalRestrictedInPrivateFolder:s&&!l&&!n,isApprovalLoading:p,isApprovalRequired:s&&!l,pendingDeleteApproval:h.filter((function(e){return e.type===a.lI.DELETE}))[0],pendingEnableOrDisableApproval:h.filter((function(e){return e.type===a.lI.TURN_ON||e.type===a.lI.TURN_OFF}))[0],userPendingApproval:h.some((function(e){return(null===e||void 0===e?void 0:e.requested_by_user_id)===d}))}}},34458:function(e,n,t){t.d(n,{Z:function(){return b}});var r=t(98788),i=t(5163),o=t(2784),a=t(10523),l=t(38716),d=t(12700),s=t(36911),c=t(28800),u=t(18911),p=t(90446),h=t(58444),v=t(52129),f=t(53736),m=t(78581),g=t(39386),Z=t(61137),b=function(e,n){var t,b=(0,l.X8)(),w=(0,f.l)().createNotification,x=(0,o.useState)(s.I.none),y=x[0],I=x[1],S=(0,o.useState)(0),k=S[0],F=S[1],z=(0,d.Z)({currentFolderId:n||e.folderId,zap:e}),C=z.canChangeOwner,T=z.canDelete,A=z.canDuplicate,D=z.canEdit,B=z.canMoveZap,_=z.canRename,E=z.canRun,M=z.canShare,N=z.slackWorkflowBuilderUrl,L=(0,c.Z)({accountId:b,folderId:Number(null===e||void 0===e?void 0:e.folderId),kind:null===e||void 0===e?void 0:e.kind,zapId:null===e||void 0===e?void 0:e.id,currentVersionId:e.currentVersionId,ownerId:null===e||void 0===e||null===(t=e.owner)||void 0===t?void 0:t.id}),q=L.isPausing,R=L.moveZapToTrash,P=L.onChangeZapOwner,X=L.onEnableZap,O=L.onDisableZap,U=L.onDuplicateZap,H=L.onMoveZapFolder,W=L.onSetZapTitle,V=(0,g.Z)({folderId:Number(null===e||void 0===e?void 0:e.folderId)}),J=N||D&&(null===e||void 0===e?void 0:e.id)&&(0,u.Z9)(e.id)||void 0,j=(0,o.useCallback)((function(e){q||("disable"===e&&O(),"enable"===e&&X())}),[O,X,q]),Q=(0,o.useMemo)((function(){return C?function(){return I(s.I.changeOwner)}:void 0}),[C]),$=(0,o.useCallback)((function(e){I(s.I.none),P(e)}),[P]),G=(0,o.useMemo)((function(){return E?function(){return I(s.I.run)}:void 0}),[E,I]),Y=(0,h.i)((function(e){w({type:"error",timeout:15e3,message:e})})),K=(0,v.k)((0,r.Z)((function(){var n;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return[4,(0,a.b)({accountId:b||0,flowId:String(null===e||void 0===e?void 0:e.id)||"",initialSharingMode:"disabled"})];case 1:return n=t.sent(),[2,(0,u.ud)({slug:null===n||void 0===n?void 0:n.guided_recipe.slug,linkHash:null===n||void 0===n?void 0:n.link_hash})]}}))})),{isExternal:!0,customErrorHandler:function(e){Y(null!==e&&void 0!==e?e:[])}}),ee=M?K:void 0,ne=(0,o.useMemo)((function(){return function(){return I(s.I.move)}}),[I]),te=B?ne:void 0,re=(0,o.useCallback)((function(n,t){(0,m.Ch)("move_zap_".concat(e.id)),I(s.I.none),H({targetFolderId:n.toString(),folderName:t,zap:e,zapFolder:V})}),[H,V,e,I]),ie=(0,o.useCallback)((function(){T&&(I(s.I.none),R({zap:e}))}),[T,R,e,I]),oe=(0,o.useCallback)((function(e){I(s.I.none),W(e)}),[W,I]),ae=_?oe:void 0,le=(0,o.useMemo)((function(){return A?(0,r.Z)((function(){var n,t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return I(s.I.duplicate),F(k+1),n=(0,Z.Z)(),function(e){var n=e.accountId,t=e.copiedZapId,r=e.zapCreationAttemptId;(0,p.Z)({account_id:n,copied_zap_id:Number(t),entry_point_location_name:"my_zaps",entry_point_method_name:"copied_zap",release_id:"bc2c7338",system_name:"zap-management",timestamp:Date.now(),zap_creation_attempt_id:r},"event.zapier.zap.creation.ZapEntryPointEvent")}({accountId:b,copiedZapId:e.id,zapCreationAttemptId:n}),[4,U()];case 1:return t=r.sent(),F((function(e){var n=Math.max(e-1,0);return n||I(s.I.none),n})),(null===t||void 0===t?void 0:t.id)&&function(e){var n=e.zapCreationAttemptId,t=e.accountId,r=e.newZapId;(0,p.Z)({account_id:t,release_id:"bc2c7338",system_name:"zap-management",timestamp_ms:Date.now(),zap_creation_attempt_id:n,zap_id:Number(r)},"zap.creation.ZapCreationRequestSuccessEvent")}({accountId:b,newZapId:t.id,zapCreationAttemptId:n}),[2,t]}}))})):void 0}),[A,k,U,b,e.id,I]);return{copiesInProgress:k,currentAction:y,editorUrl:J,onAcceptChangeOwner:$,onAcceptDelete:ie,onAcceptMoveZap:re,onAcceptRenameZap:ae,onChangeOwner:Q,onDuplicate:le,onMoveZap:te,onRun:G,onZapToggle:j,setCurrentAction:I,shareZap:ee}}},85769:function(e,n,t){t.d(n,{Z:function(){return f}});var r=t(70865),i=t(96670),o=t(2784),a=t(73223),l=t(40794),d=t(35591),s=t(50668),c=t(78493),u=function(e){var n=e.skip,t=void 0!==n&&n,r=e.variables,i=void 0===r?{}:r,a=e.onCompleted,u=(0,c.Z)(s.yF,{onCompleted:a,notifyOnNetworkStatusChange:!0,onError:function(e){(0,d.Z)("PrimaryZaps",e)},skip:t,variables:i}),p=u.loading,h=u.fetchMore,v=(0,l.a)(s.U7,{onCompleted:a,notifyOnNetworkStatusChange:!0,onError:function(e){(0,d.Z)("SecondaryZaps",e)},skip:t,variables:i}).fetchMore,f=(0,l.a)(s.PB,{fetchPolicy:"cache-only",returnPartialData:!0,onError:function(e){(0,d.Z)("FullZaps",e)},skip:t,variables:i}).data;return{fetchMore:(0,o.useCallback)((function(e){h(e),v(e)}),[h,v]),data:f,loading:p}},p=t(87786),h=function(e){var n=e.skip,t=e.variables,r=e.onCompleted,i=(0,l.a)(p.oN,{notifyOnNetworkStatusChange:!0,onCompleted:r,onError:function(e){(0,d.Z)("PrimaryLegacyZaps",e)},skip:n,variables:t}),a=i.loading,s=i.fetchMore,c=(0,l.a)(p.cq,{notifyOnNetworkStatusChange:!0,onCompleted:r,onError:function(e){(0,d.Z)("SecondaryLegacyZaps",e)},skip:n,variables:t}).fetchMore,u=(0,l.a)(p._n,{fetchPolicy:(null===t||void 0===t?void 0:t.webhookUrl)?"network-only":"cache-only",returnPartialData:!0,onError:function(e){(0,d.Z)("LegacyZaps",e)},skip:n,variables:t}),h=u.loading,v=u.data,f=u.previousData;return{fetchMore:(0,o.useCallback)((function(e){s(e),c(e)}),[s,c]),data:v,previousData:f,loading:a||!!(null===t||void 0===t?void 0:t.webhookUrl)&&h}},v=t(78581),f=function(e){var n,t,l,d,s,c,p,f,m,g,Z,b,w,x,y,I=e.accountId,S=e.allowEmptySearch,k=e.app,F=e.connection,z=e.folderId,C=e.orderBy,T=e.ownedBy,A=e.ownerId,D=e.page,B=e.search,_=e.webhookSearch,E=a.P_.includes(z),M=(0,o.useState)(!1),N=M[0],L=M[1];(0,o.useEffect)((function(){L(!1)}),[I,z,B,A]);var q=u({onCompleted:function(){L(!0)},skip:!!B||E||!!S,variables:(0,r.Z)({folderId:z},A?{ownerId:A}:{})}),R=q.data,P=q.fetchMore,X=q.loading,O=h({onCompleted:function(e){var n;B&&!(null===e||void 0===e||null===(n=e.legacyZaps)||void 0===n?void 0:n.edges.length)&&(0,v.pL)("search-".concat(encodeURI(B))),L(!0)},skip:!E&&!B&&!S||_&&!B,variables:(0,i.Z)((0,r.Z)({},B?{}:{folderId:z},k?{apps:[k].filter(Boolean).join(",")}:{},F?{connection:F}:{},T?{ownedBy:T}:{},C?{order:C}:{},D?{offset:(D-1)*a.wN}:{},_?{webhookUrl:B}:{}),{limit:a.wN,search:_?"":B})}),U=O.data,H=O.previousData,W=O.loading,V=O.fetchMore;(0,o.useEffect)((function(){(U||R)&&L(!0)}),[U,R]);var J=(0,o.useMemo)((function(){var e,n,t,r,i;return[null===R||void 0===R||null===(e=R.zaps)||void 0===e||null===(n=e.pageInfo)||void 0===n?void 0:n.cursor,null===R||void 0===R||null===(t=R.zaps)||void 0===t?void 0:t.orgPageInfo,!!(null===R||void 0===R||null===(r=R.zaps)||void 0===r?void 0:r.orgPageInfo),null===U||void 0===U||null===(i=U.legacyZaps)||void 0===i?void 0:i.pageInfo]}),[R,U]),j=J[0],Q=J[1],$=J[2],G=J[3],Y=(0,o.useCallback)((function(){if(j||(null===Q||void 0===Q?void 0:Q.next)||(null===G||void 0===G?void 0:G.hasNextPage))if(null===G||void 0===G?void 0:G.hasNextPage){var e={limit:a.wN,offset:(G.offset||0)+a.wN};V({variables:e})}else{var n=j?{cursor:j}:{limit:a.wN,offset:((null===Q||void 0===Q?void 0:Q.offset)||0)+a.wN};P({variables:n})}}),[P,V,j,Q,G]),K=(0,o.useMemo)((function(){var e;return(null===R||void 0===R||null===(e=R.zaps)||void 0===e?void 0:e.edges)||[]}),[R]),ee=(0,o.useMemo)((function(){return K.map((function(e){return e.id}))}),[K]),ne=(0,o.useMemo)((function(){var e,n=(null===U||void 0===U||null===(e=U.legacyZaps)||void 0===e?void 0:e.edges)||[];return $?[]:n}),[U,$]),te=(0,o.useMemo)((function(){return ne.map((function(e){return e.id}))}),[ne]),re=(null===R||void 0===R||null===(n=R.zaps)||void 0===n||null===(t=n.edges)||void 0===t?void 0:t.length)&&X||(null===U||void 0===U||null===(l=U.legacyZaps)||void 0===l||null===(d=l.edges)||void 0===d?void 0:d.length)&&W||(null===H||void 0===H||null===(s=H.legacyZaps)||void 0===s||null===(c=s.edges)||void 0===c?void 0:c.length)&&W;return{hasLoadedZaps:N,hasNextPage:Boolean((null===R||void 0===R||null===(p=R.zaps)||void 0===p||null===(f=p.pageInfo)||void 0===f?void 0:f.hasNextPage)&&(null===R||void 0===R||null===(m=R.zaps)||void 0===m||null===(g=m.pageInfo)||void 0===g?void 0:g.cursor)&&K.length||(null===U||void 0===U||null===(Z=U.legacyZaps)||void 0===Z||null===(b=Z.pageInfo)||void 0===b?void 0:b.hasNextPage)&&ne.length||!!(null===Q||void 0===Q?void 0:Q.next)&&K.length),isLegacyLoading:W,isLoading:X,legacyZapIds:te,legacyZaps:ne,loadingMore:re,loadMore:Y,totalCount:(null===R||void 0===R||null===(w=R.zaps)||void 0===w?void 0:w.totalCount)||(null===U||void 0===U||null===(x=U.legacyZaps)||void 0===x?void 0:x.totalCount)||D&&D>1&&(null===H||void 0===H||null===(y=H.legacyZaps)||void 0===y?void 0:y.totalCount)||0,zapIds:ee,zaps:K}}},61137:function(e,n,t){var r=t(6804);n.Z=function(){return(0,r.Z)()}},43455:function(e,n,t){t.d(n,{k:function(){return r}});var r=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return!!n&&(null===e||void 0===e?void 0:e.toLowerCase().includes(n.toLowerCase()))}}}]);
//# sourceMappingURL=611-d211995d01468817.js.map