PageSourceSearch

https://cerebrozen-central-y2bgc1m.gamma.site/_next/static/chunks/pages/index-be51f0e1811cddb2.js

js cerebrozen-central-y2bgc1m.gamma.site collected 2026-10-03 04:03:35 UTC 411,250 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5405,4792,2973],{20204:function(e,i,t){"use strict";var s,n,l=t(2784),r=l&&"object"==typeof l&&"default"in l?l.default:l,o=function(){return(o=Object.assign||function(e){for(var i,t=1,s=arguments.length;t<s;t++)for(var n in i=arguments[t])Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);return e}).apply(this,arguments)},a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t.g?t.g:"undefined"!=typeof self?self:{};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(e,i){return e(i={exports:{}},i.exports),i.exports}var u=c(function(e,i){var t;Object.defineProperty(i,"__esModule",{value:!0}),i.BLOCKS=void 0,(t=i.BLOCKS||(i.BLOCKS={})).DOCUMENT="document",t.PARAGRAPH="paragraph",t.HEADING_1="heading-1",t.HEADING_2="heading-2",t.HEADING_3="heading-3",t.HEADING_4="heading-4",t.HEADING_5="heading-5",t.HEADING_6="heading-6",t.OL_LIST="ordered-list",t.UL_LIST="unordered-list",t.LIST_ITEM="list-item",t.HR="hr",t.QUOTE="blockquote",t.EMBEDDED_ENTRY="embedded-entry-block",t.EMBEDDED_ASSET="embedded-asset-block",t.TABLE="table",t.TABLE_ROW="table-row",t.TABLE_CELL="table-cell",t.TABLE_HEADER_CELL="table-header-cell"});d(u),u.BLOCKS;var h=c(function(e,i){var t;Object.defineProperty(i,"__esModule",{value:!0}),i.INLINES=void 0,(t=i.INLINES||(i.INLINES={})).HYPERLINK="hyperlink",t.ENTRY_HYPERLINK="entry-hyperlink",t.ASSET_HYPERLINK="asset-hyperlink",t.EMBEDDED_ENTRY="embedded-entry-inline"});d(h),h.INLINES;var x=c(function(e,i){var t,s;Object.defineProperty(i,"__esModule",{value:!0}),(s=t||(t={})).BOLD="bold",s.ITALIC="italic",s.UNDERLINE="underline",s.CODE="code",i.default=t});d(x);var p=c(function(e,i){var t,s=a&&a.__spreadArray||function(e,i,t){if(t||2==arguments.length)for(var s,n=0,l=i.length;n<l;n++)!s&&n in i||(s||(s=Array.prototype.slice.call(i,0,n)),s[n]=i[n]);return e.concat(s||Array.prototype.slice.call(i))};Object.defineProperty(i,"__esModule",{value:!0}),i.V1_NODE_TYPES=i.TEXT_CONTAINERS=i.HEADINGS=i.CONTAINERS=i.VOID_BLOCKS=i.TABLE_BLOCKS=i.LIST_ITEM_BLOCKS=i.TOP_LEVEL_BLOCKS=void 0,i.TOP_LEVEL_BLOCKS=[u.BLOCKS.PARAGRAPH,u.BLOCKS.HEADING_1,u.BLOCKS.HEADING_2,u.BLOCKS.HEADING_3,u.BLOCKS.HEADING_4,u.BLOCKS.HEADING_5,u.BLOCKS.HEADING_6,u.BLOCKS.OL_LIST,u.BLOCKS.UL_LIST,u.BLOCKS.HR,u.BLOCKS.QUOTE,u.BLOCKS.EMBEDDED_ENTRY,u.BLOCKS.EMBEDDED_ASSET,u.BLOCKS.TABLE],i.LIST_ITEM_BLOCKS=[u.BLOCKS.PARAGRAPH,u.BLOCKS.HEADING_1,u.BLOCKS.HEADING_2,u.BLOCKS.HEADING_3,u.BLOCKS.HEADING_4,u.BLOCKS.HEADING_5,u.BLOCKS.HEADING_6,u.BLOCKS.OL_LIST,u.BLOCKS.UL_LIST,u.BLOCKS.HR,u.BLOCKS.QUOTE,u.BLOCKS.EMBEDDED_ENTRY,u.BLOCKS.EMBEDDED_ASSET],i.TABLE_BLOCKS=[u.BLOCKS.TABLE,u.BLOCKS.TABLE_ROW,u.BLOCKS.TABLE_CELL,u.BLOCKS.TABLE_HEADER_CELL],i.VOID_BLOCKS=[u.BLOCKS.HR,u.BLOCKS.EMBEDDED_ENTRY,u.BLOCKS.EMBEDDED_ASSET],i.CONTAINERS=((t={})[u.BLOCKS.OL_LIST]=[u.BLOCKS.LIST_ITEM],t[u.BLOCKS.UL_LIST]=[u.BLOCKS.LIST_ITEM],t[u.BLOCKS.LIST_ITEM]=i.LIST_ITEM_BLOCKS,t[u.BLOCKS.QUOTE]=[u.BLOCKS.PARAGRAPH],t[u.BLOCKS.TABLE]=[u.BLOCKS.TABLE_ROW],t[u.BLOCKS.TABLE_ROW]=[u.BLOCKS.TABLE_CELL,u.BLOCKS.TABLE_HEADER_CELL],t[u.BLOCKS.TABLE_CELL]=[u.BLOCKS.PARAGRAPH],t[u.BLOCKS.TABLE_HEADER_CELL]=[u.BLOCKS.PARAGRAPH],t),i.HEADINGS=[u.BLOCKS.HEADING_1,u.BLOCKS.HEADING_2,u.BLOCKS.HEADING_3,u.BLOCKS.HEADING_4,u.BLOCKS.HEADING_5,u.BLOCKS.HEADING_6],i.TEXT_CONTAINERS=s([u.BLOCKS.PARAGRAPH],i.HEADINGS,!0),i.V1_NODE_TYPES=[u.BLOCKS.DOCUMENT,u.BLOCKS.PARAGRAPH,u.BLOCKS.HEADING_1,u.BLOCKS.HEADING_2,u.BLOCKS.HEADING_3,u.BLOCKS.HEADING_4,u.BLOCKS.HEADING_5,u.BLOCKS.HEADING_6,u.BLOCKS.OL_LIST,u.BLOCKS.UL_LIST,u.BLOCKS.LIST_ITEM,u.BLOCKS.HR,u.BLOCKS.QUOTE,u.BLOCKS.EMBEDDED_ENTRY,u.BLOCKS.EMBEDDED_ASSET,h.INLINES.HYPERLINK,h.INLINES.ENTRY_HYPERLINK,h.INLINES.ASSET_HYPERLINK,h.INLINES.EMBEDDED_ENTRY,"text"]});d(p),p.V1_NODE_TYPES,p.TEXT_CONTAINERS,p.HEADINGS,p.CONTAINERS,p.VOID_BLOCKS,p.TABLE_BLOCKS,p.LIST_ITEM_BLOCKS,p.TOP_LEVEL_BLOCKS;var m=c(function(e,i){Object.defineProperty(i,"__esModule",{value:!0})});d(m);var g=c(function(e,i){Object.defineProperty(i,"__esModule",{value:!0})});d(g);var j=c(function(e,i){Object.defineProperty(i,"__esModule",{value:!0});
1var t={nodeType:u.BLOCKS.DOCUMENT,data:{},content:[{nodeType:u.BLOCKS.PARAGRAPH,data:{},content:[{nodeType:"text",value:"",marks:[],data:{}}]}]};i.default=t});d(j);var C=c(function(e,i){function t(e,i){for(var t=0,s=Object.keys(e);t<s.length;t++)if(i===e[s[t]])return!0;return!1}Object.defineProperty(i,"__esModule",{value:!0}),i.isText=i.isBlock=i.isInline=void 0,i.isInline=function(e){return t(h.INLINES,e.nodeType)},i.isBlock=function(e){return t(u.BLOCKS,e.nodeType)},i.isText=function(e){return"text"===e.nodeType}});d(C),C.isText,C.isBlock,C.isInline;var v=c(function(e,i){var t=a&&a.__createBinding||(Object.create?function(e,i,t,s){void 0===s&&(s=t);var n=Object.getOwnPropertyDescriptor(i,t);(!n||("get"in n?!i.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return i[t]}}),Object.defineProperty(e,s,n)}:function(e,i,t,s){void 0===s&&(s=t),e[s]=i[t]}),s=a&&a.__setModuleDefault||(Object.create?function(e,i){Object.defineProperty(e,"default",{enumerable:!0,value:i})}:function(e,i){e.default=i}),n=a&&a.__exportStar||function(e,i){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(i,s)||t(i,e,s)},l=a&&a.__importStar||function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&t(i,e,n);return s(i,e),i},r=a&&a.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.helpers=i.EMPTY_DOCUMENT=i.MARKS=i.INLINES=i.BLOCKS=void 0,Object.defineProperty(i,"BLOCKS",{enumerable:!0,get:function(){return u.BLOCKS}}),Object.defineProperty(i,"INLINES",{enumerable:!0,get:function(){return h.INLINES}}),Object.defineProperty(i,"MARKS",{enumerable:!0,get:function(){return r(x).default}}),n(p,i),n(m,i),n(g,i),Object.defineProperty(i,"EMPTY_DOCUMENT",{enumerable:!0,get:function(){return r(j).default}});var o=l(C);i.helpers=o});d(v);var f=v.helpers;v.EMPTY_DOCUMENT;var b=v.MARKS,y=v.INLINES,_=v.BLOCKS,S=((s={})[_.DOCUMENT]=function(e,i){return i},s[_.PARAGRAPH]=function(e,i){return r.createElement("p",null,i)},s[_.HEADING_1]=function(e,i){return r.createElement("h1",null,i)},s[_.HEADING_2]=function(e,i){return r.createElement("h2",null,i)},s[_.HEADING_3]=function(e,i){return r.createElement("h3",null,i)},s[_.HEADING_4]=function(e,i){return r.createElement("h4",null,i)},s[_.HEADING_5]=function(e,i){return r.createElement("h5",null,i)},s[_.HEADING_6]=function(e,i){return r.createElement("h6",null,i)},s[_.EMBEDDED_ENTRY]=function(e,i){return r.createElement("div",null,i)},s[_.UL_LIST]=function(e,i){return r.createElement("ul",null,i)},s[_.OL_LIST]=function(e,i){return r.createElement("ol",null,i)},s[_.LIST_ITEM]=function(e,i){return r.createElement("li",null,i)},s[_.QUOTE]=function(e,i){return r.createElement("blockquote",null,i)},s[_.HR]=function(){return r.createElement("hr",null)},s[_.TABLE]=function(e,i){return r.createElement("table",null,r.createElement("tbody",null,i))},s[_.TABLE_ROW]=function(e,i){return r.createElement("tr",null,i)},s[_.TABLE_HEADER_CELL]=function(e,i){return r.createElement("th",
1null,i)},s[_.TABLE_CELL]=function(e,i){return r.createElement("td",null,i)},s[y.ASSET_HYPERLINK]=function(e){return E(y.ASSET_HYPERLINK,e)},s[y.ENTRY_HYPERLINK]=function(e){return E(y.ENTRY_HYPERLINK,e)},s[y.EMBEDDED_ENTRY]=function(e){return E(y.EMBEDDED_ENTRY,e)},s[y.HYPERLINK]=function(e,i){return r.createElement("a",{href:e.data.uri},i)},s),A=((n={})[b.BOLD]=function(e){return r.createElement("b",null,e)},n[b.ITALIC]=function(e){return r.createElement("i",null,e)},n[b.UNDERLINE]=function(e){return r.createElement("u",null,e)},n[b.CODE]=function(e){return r.createElement("code",null,e)},n);function E(e,i){return r.createElement("span",{key:i.data.target.sys.id},"type: ",i.nodeType," id: ",i.data.target.sys.id)}i.h=function(e,i){return(void 0===i&&(i={}),e)?function e(i,t){var s=t.renderNode,n=t.renderMark,o=t.renderText;if(f.isText(i))return i.marks.reduce(function(e,i){return n[i.type]?n[i.type](e):e},o?o(i.value):i.value);var a=i.content.map(function(i,s){var n;return n=e(i,t),l.isValidElement(n)&&null===n.key?l.cloneElement(n,{key:s}):n});return i.nodeType&&s[i.nodeType]?s[i.nodeType](i,a):r.createElement(r.Fragment,null,a)}(e,{renderNode:o(o({},S),i.renderNode),renderMark:o(o({},A),i.renderMark),renderText:i.renderText}):null}},80121:function(e,i){"use strict";var t;Object.defineProperty(i,"__esModule",{value:!0}),i.BLOCKS=void 0,(t=i.BLOCKS||(i.BLOCKS={})).DOCUMENT="document",t.PARAGRAPH="paragraph",t.HEADING_1="heading-1",t.HEADING_2="heading-2",t.HEADING_3="heading-3",t.HEADING_4="heading-4",t.HEADING_5="heading-5",t.HEADING_6="heading-6",t.OL_LIST="ordered-list",t.UL_LIST="unordered-list",t.LIST_ITEM="list-item",t.HR="hr",t.QUOTE="blockquote",t.EMBEDDED_ENTRY="embedded-entry-block",t.EMBEDDED_ASSET="embedded-asset-block",t.TABLE="table",t.TABLE_ROW="table-row",t.TABLE_CELL="table-cell",t.TABLE_HEADER_CELL="table-header-cell"},22233:function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=t(80121),n={nodeType:s.BLOCKS.DOCUMENT,data:{},content:[{nodeType:s.BLOCKS.PARAGRAPH,data:{},content:[{nodeType:"text",value:"",marks:[],data:{}}]}]};i.default=n},49186:function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isText=i.isBlock=i.isInline=void 0;var s=t(80121),n=t(23802);function l(e,i){for(var t=0,s=Object.keys(e);t<s.length;t++)if(i===e[s[t]])return!0;return!1}i.isInline=function(e){return l(n.INLINES,e.nodeType)},i.isBlock=function(e){return l(s.BLOCKS,e.nodeType)},i.isText=function(e){return"text"===e.nodeType}},82562:function(e,i,t){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,i,t,s){void 0===s&&(s=t);var n=Object.getOwnPropertyDescriptor(i,t);(!n||("get"in n?!i.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return i[t]}}),Object.defineProperty(e,s,n)}:function(e,i,t,s){void 0===s&&(s=t),e[s]=i[t]}),n=this&&this.__setModuleDefault||(Object.create?function(e,i){Object.defineProperty(e,"default",{enumerable:!0,value:i})}:function(e,i){e.default=i}),l=this&&this.__exportStar||function(e,i){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(i,t)||s(i,e,t)},r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&s(i,e,t);return n(i,e),i},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.helpers=i.EMPTY_DOCUMENT=i.MARKS=i.INLINES=i.BLOCKS=void 0;var a=t(80121);Object.defineProperty(i,"BLOCKS",{enumerable:!0,get:function(){return a.BLOCKS}});var d=t(23802);Object.defineProperty(i,"INLINES",{enumerable:!0,get:function(){return d.INLINES}});var c=t(15931);Object.defineProperty(i,"MARKS",{enumerable:!0,get:function(){return o(c).default}}),l(t(17904),i),l(t(4335),i),l(t(85972),i);var u=t(22233);Object.defineProperty(i,"EMPTY_DOCUMENT",{enumerable:!0,get:function(){return o(u).default}});var h=r(t(49186));i.helpers=h},23802:function(e,i){"use strict";var t;Object.defineProperty(i,"__esModule",{value:!0}),i.INLINES=void 0,(t=i.INLINES||(i.INLINES={})).HYPERLINK="hyperlink",t.ENTRY_HYPERLINK="entry-hyperlink",t.ASSET_HYPERLINK="asset-hyperlink",t.EMBEDDED_ENTRY="embedded-entry-inline"},15931:function(e,i){"use strict";var t,s;Object.defineProperty(i,"__esModule",{value:!0}),(s=t||(t={})).BOLD="bold",s.ITALIC="italic",s.UNDERLINE="underline",s.CODE="code",s.SUPERSCRIPT="superscript",s.SUBSCRIPT="subscript",i.default=t},85972:function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},17904:function(e,i,t){"use strict";var s,n=this&&this.__spreadArray||function(e,i,t){if(t||2==arguments.length)for(var s,n=0,l=i.length;n<l;
1n++)!s&&n in i||(s||(s=Array.prototype.slice.call(i,0,n)),s[n]=i[n]);return e.concat(s||Array.prototype.slice.call(i))},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.V1_MARKS=i.V1_NODE_TYPES=i.TEXT_CONTAINERS=i.HEADINGS=i.CONTAINERS=i.VOID_BLOCKS=i.TABLE_BLOCKS=i.LIST_ITEM_BLOCKS=i.TOP_LEVEL_BLOCKS=void 0;var r=t(80121),o=t(23802),a=l(t(15931));i.TOP_LEVEL_BLOCKS=[r.BLOCKS.PARAGRAPH,r.BLOCKS.HEADING_1,r.BLOCKS.HEADING_2,r.BLOCKS.HEADING_3,r.BLOCKS.HEADING_4,r.BLOCKS.HEADING_5,r.BLOCKS.HEADING_6,r.BLOCKS.OL_LIST,r.BLOCKS.UL_LIST,r.BLOCKS.HR,r.BLOCKS.QUOTE,r.BLOCKS.EMBEDDED_ENTRY,r.BLOCKS.EMBEDDED_ASSET,r.BLOCKS.TABLE],i.LIST_ITEM_BLOCKS=[r.BLOCKS.PARAGRAPH,r.BLOCKS.HEADING_1,r.BLOCKS.HEADING_2,r.BLOCKS.HEADING_3,r.BLOCKS.HEADING_4,r.BLOCKS.HEADING_5,r.BLOCKS.HEADING_6,r.BLOCKS.OL_LIST,r.BLOCKS.UL_LIST,r.BLOCKS.HR,r.BLOCKS.QUOTE,r.BLOCKS.EMBEDDED_ENTRY,r.BLOCKS.EMBEDDED_ASSET],i.TABLE_BLOCKS=[r.BLOCKS.TABLE,r.BLOCKS.TABLE_ROW,r.BLOCKS.TABLE_CELL,r.BLOCKS.TABLE_HEADER_CELL],i.VOID_BLOCKS=[r.BLOCKS.HR,r.BLOCKS.EMBEDDED_ENTRY,r.BLOCKS.EMBEDDED_ASSET],i.CONTAINERS=((s={})[r.BLOCKS.OL_LIST]=[r.BLOCKS.LIST_ITEM],s[r.BLOCKS.UL_LIST]=[r.BLOCKS.LIST_ITEM],s[r.BLOCKS.LIST_ITEM]=i.LIST_ITEM_BLOCKS,s[r.BLOCKS.QUOTE]=[r.BLOCKS.PARAGRAPH],s[r.BLOCKS.TABLE]=[r.BLOCKS.TABLE_ROW],s[r.BLOCKS.TABLE_ROW]=[r.BLOCKS.TABLE_CELL,r.BLOCKS.TABLE_HEADER_CELL],s[r.BLOCKS.TABLE_CELL]=[r.BLOCKS.PARAGRAPH],s[r.BLOCKS.TABLE_HEADER_CELL]=[r.BLOCKS.PARAGRAPH],s),i.HEADINGS=[r.BLOCKS.HEADING_1,r.BLOCKS.HEADING_2,r.BLOCKS.HEADING_3,r.BLOCKS.HEADING_4,r.BLOCKS.HEADING_5,r.BLOCKS.HEADING_6],i.TEXT_CONTAINERS=n([r.BLOCKS.PARAGRAPH],i.HEADINGS,!0),i.V1_NODE_TYPES=[r.BLOCKS.DOCUMENT,r.BLOCKS.PARAGRAPH,r.BLOCKS.HEADING_1,r.BLOCKS.HEADING_2,r.BLOCKS.HEADING_3,r.BLOCKS.HEADING_4,r.BLOCKS.HEADING_5,r.BLOCKS.HEADING_6,r.BLOCKS.OL_LIST,r.BLOCKS.UL_LIST,r.BLOCKS.LIST_ITEM,r.BLOCKS.HR,r.BLOCKS.QUOTE,r.BLOCKS.EMBEDDED_ENTRY,r.BLOCKS.EMBEDDED_ASSET,o.INLINES.HYPERLINK,o.INLINES.ENTRY_HYPERLINK,o.INLINES.ASSET_HYPERLINK,o.INLINES.EMBEDDED_ENTRY,"text"],i.V1_MARKS=[a.default.BOLD,a.default.CODE,a.default.ITALIC,a.default.UNDERLINE]},4335:function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},82863:function(e,i,t){"use strict";t.d(i,{FX:function(){return o},Nq:function(){return r},rg:function(){return l}});var s=t(2784);let n=(0,s.createContext)(null);function l({clientId:e,onScriptLoadSuccess:i,onScriptLoadError:t,children:l}){let r=function(e={}){let{onScriptLoadSuccess:i,onScriptLoadError:t}=e,[n,l]=(0,s.useState)(!1),r=(0,s.useRef)(i);r.current=i;let o=(0,s.useRef)(t);return o.current=t,(0,s.useEffect)(()=>{let e=document.createElement("script");return e.src="https://accounts.google.com/gsi/client",e.async=!0,e.defer=!0,e.onload=()=>{var e;l(!0),null===(e=r.current)||void 0===e||e.call(r)},e.onerror=()=>{var e;l(!1),null===(e=o.current)||void 0===e||e.call(o)},document.body.appendChild(e),()=>{document.body.removeChild(e)}},[]),n}({onScriptLoadSuccess:i,onScriptLoadError:t}),o=(0,s.useMemo)(()=>({clientId:e,scriptLoadedSuccessfully:r}),[e,r]);return s.createElement(n.Provider,{value:o},l)}function r({flow:e="implicit",scope:i="",onSuccess:t,onError:l,...r}){let{clientId:o,scriptLoadedSuccessfully:a}=function(){let e=(0,s.useContext)(n);if(!e)throw Error("Google OAuth components must be used within GoogleOAuthProvider");return e}(),d=(0,s.useRef)(),c=(0,s.useRef)(t);c.current=t;let u=(0,s.useRef)(l);u.current=l,(0,s.useEffect)(()=>{var t;if(!a)return;let s="implicit"===e?"initTokenClient":"initCodeClient",n=null===(t=window.google)||void 0===t?void 0:t.accounts.oauth2[s]({client_id:o,scope:`openid profile email ${i}`,callback:e=>{var i,t;if(e.error)return null===(i=u.current)||void 0===i?void 0:i.call(u,e);null===(t=c.current)||void 0===t||t.call(c,e)},...r});d.current=n},[o,a,e,i]);let h=(0,s.useCallback)(e=>d.current.requestAccessToken(e),[]),x=(0,s.useCallback)(()=>d.current.requestCode(),[]);return"implicit"===e?h:x}function o(e,i,...t){return!!window.google&&window.google.accounts.oauth2.hasGrantedAllScopes(e,i,...t)}},77603:function(e){e.exports=function(e,i){for(var t=-1,s=null==e?0:e.length;++t<s;)if(!i(e[t],t,e))return!1;return!0}},50080:function(e,i,t){var s=t(24303);e.exports=function(e,i){var t=!0;return s(e,function(e,s,n){return t=!!i(e,s,n)}),t}},39794:function(e,i,t){var s=t(77603),n=t(50080),l=t(68286),r=t(86152),o=t(82406);e.exports=function(e,i,t){var a=r(e)?s:n;return t&&o(e,i,t)&&(i=void 0),a(e,l(i,3))}},87314:function(e,i,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(79737)}])},29094:function(e,i){"use strict";i.Z={src:"/_next/static/media/Sal-Painting-2x.c8081548.png",height:5035,width:5077,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAVFBMVEVMaXEAAAAYGBjh4eEAAAAAAAAAAAABAQECAgIAAADf3983NzcBAQEDAwMAAAB/f38zMzPMzMwAAAA/Pz+ampoCAgK1tbWGhoYAAAAAAACVlZXr6+utrPL5AAAAGXRSTlMAOh6Fz9nD/YVc0yTjSbYErTL2iWWutG
1js83dYZgAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAEFJREFUeJwVxkcSgCAQAMEh7xLEbKH//6dFnxojV/V+McQw0kgjYMux7jOcr4vJK2xfjlWAnp1VBbgfWpspIlbND1vVAkv9ao33AAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},38095:function(e,i){"use strict";i.Z={src:"/_next/static/media/Sal-Spray.5abcbf19.svg",height:1657,width:2161,blurWidth:0,blurHeight:0}},57474:function(e,i){"use strict";i.Z={src:"/_next/static/media/Sal-Tether.5de34fdf.svg",height:1352,width:3061,blurWidth:0,blurHeight:0}},71508:function(e,i){"use strict";i.Z={src:"/_next/static/media/gamma-logo-profile-image.c51e9197.png",height:265,width:265,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAVFBMVEX16+XLN8P46dv3yMDq2ebQsOnXkrP27+b28+j8+uP1w9vlo5713+Xxt9TdU5zYdLqnmfHgbYyTKuagQremCurcuOzIi+KQVuzwqpHqrO3vdcz3U6Pc/F4nAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAQElEQVR4nCWLSRKAIBDEGgVmGnFXVPj/P6kpc8klAQAqDJEt0OyfMxYvYHDxuG6Cn3vXJSkk17ZPg0U6j/8GNXdHWAH663uVwQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},71537:function(e,i,t){"use strict";t.d(i,{z:function(){return eh}});var s=t(52322);t(98248),t(61219);var n=t(55671),l=t(62202),r=t(18200),o=t(81674),a=t(94523),d=t(97729),c=t.n(d),u=t(5632),h=t(2784),x=t(43997),p=t(14274),m=t(93202),g=t(2013);let j=e=>{let i=["malformed","encoded","illegal"];return e.includes("URIError")&&e.split(" ").some(e=>i.includes(e))};class C extends h.Component{componentDidMount(){window.addEventListener("error",this.handleError),window.addEventListener("unhandledrejection",this.handleUnhandledRejection)}componentWillUnmount(){window.removeEventListener("error",this.handleError),window.removeEventListener("unhandledrejection",this.handleUnhandledRejection)}componentDidCatch(e,i){if("dev"===p.v.APPLICATION_ENVIRONMENT)throw e}static getDerivedStateFromError(e){return{hasError:!0,errMessage:e.message,shouldMountChildren:!1}}handleError(e){if("dev"===p.v.APPLICATION_ENVIRONMENT)throw Error("[ErrorBoundary]: ".concat(e.message))}handleUnhandledRejection(e){let i=this.props.unhandledRejectionFilter(e);if(i){var t;let i=(null===(t=e.reason)||void 0===t?void 0:t.message)||"";this.setState({hasError:!0,errMessage:i})}}render(){let e=!0===j(this.state.errMessage)?{opacity:"0.65",starOverlay:!1}:{};return(0,s.jsxs)(s.Fragment,{children:[this.state.hasError&&(0,s.jsx)(g.q,{pos:"absolute",top:0,...e,errMessage:""===this.state.errMessage?void 0:this.state.errMessage,showDisclosure:!0}),this.state.shouldMountChildren&&this.props.children]})}constructor(e){super(e),this.state={hasError:!1,errMessage:"",shouldMountChildren:!0},this.handleError=this.handleError.bind(this),this.handleUnhandledRejection=this.handleUnhandledRejection.bind(this)}}C.defaultProps={unhandledRejectionFilter:e=>{var i;return!!j((null===(i=e.reason)||void 0===i?void 0:i.message)||"")||e.reason instanceof m.YBv&&!1===document.hidden||e.reason instanceof m.R5s}},t(61036),t(62376),t(6991),t(76298),t(4466),t(43839),t(40917);var v=t(11050),f=t(42005);let b=()=>{let e=(0,h.useRef)(!1),i=(0,h.useRef)(new Map);(0,h.useEffect)(()=>{if("production"!==p.v.APPLICATION_ENVIRONMENT)return;let t=()=>{if(e.current)return;let t=i.current.get("total"),s=i.current.get("notTrusted"),n=s/t>.5;n&&t>5&&(e.current=!0,f.c.track(v.xW.NOT_TRUSTED_EVENTS_DETECTED,{totalEvents:t,notTrustedEvents:s}))},s=e=>{e.isTrusted||i.current.set("notTrusted",(i.current.get("notTrusted")||0)+1),i.current.set("total",(i.current.get("total")||0)+1),t()};return document.addEventListener("paste",s,{capture:!0}),document.addEventListener("mousedown",s,{capture:!0}),document.addEventListener("keydown",s,{capture:!0}),()=>{document.removeEventListener("paste",s,{capture:!0}),document.removeEventListener("mousedown",s,{capture:!0}),document.removeEventListener("keydown",s,{capture:!0})}},[])};var y=t(79254),_=t(27354),S=t(42111),A=t(32019),E=t(99092),I=t(36651);let D=(e,i)=>{E.H.init(p.v.HIGHLIGHT_PROJECT_ID,{environment:p.v.APPLICATION_ENVIRONMENT,sessionShortcut:!!i&&"shift+command+0",enableStrictPrivacy:e,enableSegmentIntegration:!0,networkRecording:{enabled:!0,recordHeadersAndBody:!0}}),v.co.loadSdkPromise.then(e=>{e&&e.addSourceMiddleware(E.LZ)})},k=e=>{let{children:i}=e,{user:t,anonymousUser:n,isGammaOrgUser:l,isUserLoading:r}=(0,I.SE)(),{enabled:o,enableStrictPrivacy:a}=(0,S.ye)("highlight");return(0,h.useEffect)(()=>{o&&!r&&t&&D(a,l)},[a,o,l,r,t]),(0,h.useEffect)(()=>
1{if(!r){if(t){let{id:e,displayName:i,email:s,profileImageUrl:n}=t;E.H.identify(e,{highlightDisplayName:i,email:s,avatar:n})}else if(null==n?void 0:n.id){let{id:e,displayName:i}=n;E.H.identify("",{anonDisplayName:i||"",anonId:e})}}},[t,n,r]),(0,s.jsx)(s.Fragment,{children:i})};var w=t(34881),T=t(87254),P=t(5879),O=t(44754);let N=e=>{let{children:i}=e;return(0,O.b)(),(0,s.jsx)(P.bd,{i18n:T.ag,children:i})};var L=t(18875),R=t(17292),M=t(55478),F=t(76332),U=t(6912),z=t(27902),B=t(21733),G=t(78462),H=t(72354),K=t(1163),V=t(2953);let W="get-gamma-pro",q=e=>{var i,t;let{children:n}=e,{currentWorkspace:l,isUserLoading:r}=(0,B.SE)(),[o,a]=(0,h.useState)(!1),d=(0,z.z$)(),c=(0,S.ye)("upsellUXEnabled_Pro"),{data:u,refetch:x}=(0,F.FaU)({variables:{workspaceId:null==l?void 0:l.id,includeExpired:!0},skip:!(null==l?void 0:l.id)}),p=null==u?void 0:u.subscription;(0,U.ET)({subscription:p,workspace:l,autoLaunch:!0});let{data:m}=(0,F.kNl)({variables:{workspaceId:null==l?void 0:l.id},skip:!l}),g=null==m?void 0:null===(i=m.products)||void 0===i?void 0:i.find(e=>"pro"===e.key),j=null==g?void 0:null===(t=g.prices)||void 0===t?void 0:t.find(e=>e.frequencyUnit===F.C_B.Year),C=(0,K.K9)(l),{isOpen:v,onOpen:f,onClose:b}=(0,M.q)({id:"upsell-modal"}),y=(0,h.useRef)(null),_=(0,h.useCallback)(e=>{let{onOpenCallback:i,onCloseCallback:t,insufficientCreditsWarning:s,segmentEvent:n}=e;c&&(a(!!s),null==i||i(),f(),null==d||d.track(n),y.current=t||null)},[d,f,c]),A=(0,h.useCallback)(()=>{var e;null==y||null===(e=y.current)||void 0===e||e.call(y),b(),y.current=null,a(!1)},[b]),[E,I]=(0,h.useState)({openUpsellModal:_,product:C,subscription:p,proYearlyProductPrice:j});return(0,h.useEffect)(()=>{let e="true"===(0,G.SJ)()[W];e&&!r&&l&&(f(),(0,w.lO)({query:{...(0,G.SJ)(),[W]:void 0},emitChange:!1}))},[f,l,r]),(0,h.useEffect)(()=>{I({openUpsellModal:_,refetchSubscription:x,product:C,subscription:p,proYearlyProductPrice:j})},[_,C,p,j,x]),(0,s.jsxs)(V.P.Provider,{value:E,children:[n,(0,s.jsx)(H.b,{insufficientCreditsWarning:o,isUpsellModalOpen:v,closeUpsellModal:A}),(0,s.jsx)(U.S1,{})]})};var Y=t(99268),X=t(25944),Z=t(19902);let Q="no_org_id",J=e=>{let{children:i}=e;(0,X.iZ)();let{user:t,anonymousUser:n,currentWorkspace:l,isUserLoading:r}=(0,I.SE)();return(0,h.useEffect)(()=>{let e=(0,Z.K)();(0,Y.$n)(e.get()),e.fetch().then(Y.$n).catch(()=>{})},[]),(0,h.useEffect)(()=>{let e;if(!r){if(t){let{id:i,email:s}=t,n=!!s&&s.endsWith("@gamma.app"),r=(null==l?void 0:l.id)||Q;e={userId:i,isGammaUser:n,userOrgId:r,anonymousUser:!1,gammaUserFirstName:n?t.firstName:""}}else e={userId:"anonymous_user",isGammaUser:!1,userOrgId:Q,anonymousUser:!0,gammaUserFirstName:""};(0,Y.$n)(e)}},[r,t,n,l]),(0,s.jsx)(s.Fragment,{children:i})};var $=t(54839),ee=t(91994),ei=t(89311),et=t(95426),es=t(1198),en=t(90221),el=t(60742),er=t(13265),eo=t(90383);o.vc.autoAddCss=!1;let ea=(0,ee.bh)(),ed=(0,m.RqP)(),ec=(0,m.PGq)(),eu=(0,l.B1)(a.qZ,{styles:{global:{".ProseMirror":{outline:"0 none"}}}});((e,i)=>{let t=(0,$.I)({theme:i});e.globalToast=t})(window,eu),(0,el.Lq)(),R.F7.initialize(),(0,w.lt)(),v.co.init(),(0,L.S1)(),(0,_.u7)(),(0,et.a)("appMainBundleLoaded"),console.log("\uD83D\uDE80 GammaApp main wrapper imported"),S.VH.get("debugLogging")||(window.console.debug=()=>{});let eh=e=>function(i){return(0,s.jsx)(ex,{children:(0,s.jsx)(e,{...i})})},ex=e=>{let{children:i}=e;console.log("\uD83D\uDE80 GammaApp main wrapper rendered");let t=(0,u.useRouter)();(0,ei.l)(),(0,er.k)(),b(),(0,h.useEffect)(()=>{let e=(e,i)=>{let{shallow:t}=i;console.debug("[GammaApp - handleRouteChange] App is changing to ".concat(e," ").concat(t?"with":"without"," shallow routing"))};return t.events.on("routeChangeStart",e),()=>{t.events.off("routeChangeStart",e)}},[t]);let l=(0,es.aY)();return(0,s.jsx)(x.zt,{store:ea,children:(0,s.jsx)(N,{children:(0,s.jsx)(r.x,{theme:eu,resetCSS:!0,children:(0,s.jsx)(C,{children:(0,s.jsx)(n.e,{client:ed,children:(0,s.jsxs)(m.mdV,{client:ec,children:[(0,s.jsx)(em,{}),(0,s.jsx)(y.H6,{}),(0,s.jsx)(L.GQ,{}),(0,s.jsxs)(I.fS,{children:[(0,s.jsx)(z.qA,{children:(0,s.jsx)(S.dF,{children:(0,s.jsx)(q,{children:(0,s.jsx)(m.Imj,{children:(0,s.jsx)(J,{children:(0,s.jsx)(k,{children:(0,s.jsx)(es.dv,{value:l,children:(0,s.jsx)(A.u,{children:i})})})})})})})}),(0,s.jsx)(S.MG,{})]})]})})})})})})},ep="A new medium for presenting ideas, powered by AI. Beautiful, engaging content with none of the formatting and design work.",em=()=>{let e=p.v.APPLICATION_ENVIRONMENT;return(0,s.jsxs)(c(),{children:[(0,s.jsx)("title",{children:"Gamma"}),(0,s.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0, viewport-fit=cover"}),(0,s.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,s.jsx)("link",{rel:"shortcut icon",href:"production"===e?"/fav
1icons/favicon-transparent-96x96.png":"staging"===e?"/favicons/favicon_staging.jpg":"/favicons/favicon_local.jpg"}),(0,s.jsx)("meta",{content:ep,name:"description"},"description"),(0,s.jsx)("meta",{content:"Gamma",property:"og:title"},"og:title"),(0,s.jsx)("meta",{content:ep,property:"og:description"},"og:description"),(0,s.jsx)("meta",{content:p.v.OG_IMAGE_URL,property:"og:image"},"og:image"),(0,s.jsx)("meta",{content:"Gamma",property:"twitter:title"},"twitter:title"),(0,s.jsx)("meta",{content:ep,property:"twitter:description"},"twitter:description"),(0,s.jsx)("meta",{content:p.v.OG_IMAGE_URL,property:"twitter:image"},"twitter:image"),(0,s.jsx)("meta",{property:"og:type",content:"website"},"og:type"),(0,s.jsx)("meta",{content:"summary_large_image",name:"twitter:card"},"twitter:card"),(0,s.jsx)("link",{href:"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900",rel:"stylesheet"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://use.typekit.net/tiw2cwq.css"}),!(0,en.l6)()&&!(0,eo.wg)()&&(0,s.jsx)("script",{async:!0,src:"https://cdn.optimizely.com/js/20579410255.js"}),(0,s.jsx)("script",{src:"//cdn.iframe.ly/embed.js",async:!0,charSet:"utf-8"})]})}},16983:function(e,i,t){"use strict";t.d(i,{X:function(){return b}});var s=t(52322),n=t(11881),l=t(28535),r=t(62614),o=t(43297),a=t(38035),d=t(75009),c=t(29117),u=t(82554),h=t(74409),x=t(77533),p=t(82655),m=t(49929),g=t(5879),j=t(39097),C=t.n(j),v=t(90221);let f=e=>{let{children:i,href:t,onClick:o,as:a=C()}=e;return t?(0,s.jsx)(n.f,{as:l.xu,role:"group",onClick:o,children:(0,s.jsx)(n.A,{href:t,as:a,_focusVisible:{boxShadow:"none",outline:"0 none !important"},_hover:{textDecoration:"none !important"},children:i})}):(0,s.jsx)(l.xu,{as:r.z,w:"100%",variant:"unstyled",display:"inline-flex",h:"fit-content",role:"group",onClick:o,maxW:{base:"none",md:"18em"},tabIndex:0,_focusVisible:{boxShadow:"none",outline:"0 none !important"},children:i})},b=e=>{let{label:i,description:t,isPopular:n,colorScheme:r,imageUrl:j,href:b,transform:y,onClick:_,ctaIcon:S,ctaLabel:A,as:E}=e;return(0,s.jsx)(f,{href:b,onClick:e=>{null==_||_(e)},as:E||C(),children:(0,s.jsxs)(o.K,{cursor:"pointer",direction:{base:"row",md:"column"},px:"0",flex:"1",whiteSpace:"normal",textAlign:"left",spacing:"0",border:"none",bg:"white",borderRadius:"lg",boxShadow:{base:"sm",md:"md"},transition:"all 300ms ease",bottom:"0",outline:"none",_groupHover:(0,v.s2)()?{}:{bottom:3,boxShadow:"xl",transform:"scale(1.03)"},position:"relative",transform:{base:"auto",md:y&&!(0,v.s2)()?y:"auto"},_groupFocusWithin:{shadow:"outline"},overflow:"hidden",children:[(0,s.jsxs)(a.k,{flex:"1",justifyContent:"center",textAlign:"center",color:"".concat(r,".500"),bg:"".concat(r,".100"),position:"relative",minH:{base:"none",md:"190px"},children:[(0,s.jsx)(d.E,{src:j,objectFit:"cover",transitionProperty:"filter",transitionDuration:"normal",_groupHover:{filter:"brightness(1.02)"}}),n&&(0,s.jsx)(c.U,{position:"absolute",bottom:"2",left:"2",children:(0,s.jsxs)(u.C,{colorScheme:"teal",fontSize:"md",p:"0.5",px:"2",textTransform:"none",fontWeight:"600",borderRadius:["sm","md"],children:[(0,s.jsx)(m.G,{icon:p.BDt})," ",(0,s.jsx)(g.cC,{id:"gL/sdV"})]})})]}),(0,s.jsxs)(o.K,{spacing:"1.5",p:4,maxW:"100%",minH:{base:"100px",md:"none"},justifyContent:"space-between",alignItems:"stretch",flex:"1.5",direction:{base:"row",md:"column"},position:"relative",h:"100%",children:[(0,s.jsxs)(o.K,{children:[(0,s.jsx)(h.X,{fontSize:{base:"xl",md:"2xl"},fontWeight:"600",children:i}),(0,s.jsx)(c.U,{children:(0,s.jsx)(l.xu,{fontSize:{base:"sm",md:"md"},fontWeight:"500",lineHeight:"1.4",color:"gray.600",children:t})})]}),(0,s.jsxs)(c.U,{maxW:"100%",justifyContent:"flex-end",alignItems:"flex-start",fontSize:{base:"sm",sm:"md"},p:{base:.5,md:0},children:[(0,s.jsx)(x.x,{display:{base:"none",md:"block"},transition:"all 300ms ease",opacity:0,color:"".concat(r,".700"),_groupFocusWithin:{opacity:1},_groupHover:{opacity:1},children:A}),(0,s.jsx)(l.xu,{fontSize:{base:"md",sm:"lg"},_groupFocusWithin:{color:"".concat(r,".700")},_groupHover:{color:"".concat(r,".700")},children:S})]})]})]})})}},60510:function(e,i,t){"use strict";t.d(i,{r:function(){return L},h:function(){return R}});var s=t(52322),n=t(38035),l=t(17993),r=t(77533),o=t(62614),a=t(81672),d=t(42946),c=t(49929),u=t(2784),h=t(90221),x=t(90439),p=t(93441),m=t(89458),g=t(90383),j=t(18733),C=t(5879),v=t(42111),f=t(78462),b=t(94199),y=t(11082),_=t(64173),S=t(31807),A=t(6912),E=t(48832),I=t(11050),D=t(36651),k=t(81640),w=t(12265),T=t(11942),P=t(88640);let O=[{Component:()=>{let e=(0,v.ye)("outageButterbar");
1if(!e.enabled)return null;let{header:i,text:t,buttonLink:n,buttonText:l,key:r,pathnameRegexp:o}=e;return(0,s.jsx)(R,{definition:{key:r,header:i,text:t,buttonText:l,buttonLink:n,conditions:()=>!o||null!==window.location.pathname.match(new RegExp(o))}})},key:"outage-butterbar"},{Component:()=>{let e=(0,v.ye)("openAiStatus");return"NORMAL"===e?null:(0,s.jsx)(R,{definition:{key:"ai-service-status",header:(0,s.jsx)(C.cC,{id:"1Agl06"}),text:(0,s.jsx)(C.cC,{id:"cCl6WD"}),ttl:86400,conditions:()=>(0,f._r)(window.location.pathname)}})},key:"ai-service-status-butterbar"},{Component:()=>{var e,i,t;let{user:n,currentWorkspace:l}=(0,D.SE)(),{subscription:r,product:o}=(0,k.z)(),{launchFailedPaymentFlow:a,failedPaymentFlowEnabled:d}=(0,A.ET)({subscription:r,workspace:l,autoLaunch:!1});if(!r||!o)return null;let c=(0,w.K)(),{name:u,dontChurnMessage:h}=c[o],{status:x,expirationTime:p,id:m}=r,g=(0,E.p6)(p,"MMMM do, yyyy"),j=(null==r?void 0:null===(e=r.createdByUser)||void 0===e?void 0:e.id)===(null==n?void 0:n.id),v=(0,T._8)(),f=p>Date.now();if(!("unpaid"===x||"past_due"===x)&&!f)return null;let _=v&&(j||!(null==r?void 0:r.createdByUser))?(0,s.jsx)(C.cC,{id:"velw1T",values:{expirationFormatted:g,GAMMA_PROPER_NOUN:b.N6,productName:u},components:{0:(0,s.jsx)(y.r,{href:v,isExternal:!0,textDecoration:"underline"})}}):(0,s.jsx)(C.cC,{id:"9aBOfk",values:{expirationFormatted:g,GAMMA_PROPER_NOUN:b.N6,productName:u,0:null===(i=r.createdByUser)||void 0===i?void 0:i.displayName,1:null===(t=r.createdByUser)||void 0===t?void 0:t.email},components:{0:(0,s.jsx)("b",{}),1:(0,s.jsx)("b",{})}});return(0,s.jsx)(R,{definition:{key:"payment-overdue-".concat(m),header:(0,s.jsx)(C.cC,{id:"gosJne",values:{productName:u}}),text:(0,s.jsxs)(s.Fragment,{children:[h," ",_]}),buttonText:(0,s.jsx)(C.cC,{id:"WLvqZR"}),buttonLink:d?void 0:v,buttonOnClick:d?a:void 0}})},key:"payment-overdue-butterbar"},{Component:()=>{let{subscription:e,openUpsellModal:i}=(0,k.z)();if(!e)return null;let{status:t,expirationTime:n,id:l}=e,r=new Date>(0,S.Z)(n)&&new Date<(0,_.Z)((0,S.Z)(n),{days:10});if(!r)return null;let o=()=>i({segmentEvent:I.AA.GAMMA_PRO_UPSELL_SUBSCRIPTION_EXPIRED_BUTTERBAR}),a=(0,s.jsx)(y.r,{onClick:o,isExternal:!0,textDecoration:"underline",children:(0,s.jsx)(C.cC,{id:"mj68q/"})});return(0,s.jsx)(R,{definition:{key:"subscription-expired-".concat(l),header:(0,s.jsx)(C.cC,{id:"5nhH6A"}),text:(0,s.jsxs)(s.Fragment,{children:["unpaid"===t||"past_due"===t?(0,s.jsx)(C.cC,{id:"QdgXJv"}):""," ",a]}),buttonText:(0,s.jsx)(C.cC,{id:"kwkhPe"}),buttonOnClick:o}})},key:"subscription-expired-butterbar"},{Component:()=>{var e,i,t;let{user:n}=(0,D.SE)(),{subscription:l,product:r}=(0,k.z)();if(!l||!r)return null;let{status:o,expirationTime:a,id:d,cancellationRequestedTime:c}=l,u="canceled"!=o&&c&&new Date<(0,S.Z)(a)&&new Date>(0,_.Z)((0,S.Z)(a),{days:-7});if(!u)return null;let h=(null==l?void 0:null===(e=l.createdByUser)||void 0===e?void 0:e.id)===(null==n?void 0:n.id),x=(0,T._8)(),p=(0,E.p6)(a,"MMMM do, yyyy"),m=(0,w.K)(),{name:g,dontChurnMessage:j}=m[r],v=!h&&(null==l?void 0:l.createdByUser)?(0,s.jsx)(C.cC,{id:"z4DeyC",values:{expirationFormatted:p,GAMMA_PROPER_NOUN:b.N6,productName:g,0:null===(i=l.createdByUser)||void 0===i?void 0:i.displayName,1:null===(t=l.createdByUser)||void 0===t?void 0:t.email},components:{0:(0,s.jsx)("b",{}),1:(0,s.jsx)("b",{})}}):(0,s.jsx)(C.cC,{id:"qP91+f",values:{expirationFormatted:p,GAMMA_PROPER_NOUN:b.N6,productName:g},components:{0:(0,s.jsx)(y.r,{href:x,isExternal:!0,textDecoration:"underline"})}});return(0,s.jsx)(R,{definition:{key:"subscription-ending-soon-".concat(d),header:(0,s.jsx)(C.cC,{id:"THJAvC",values:{productName:g}}),text:(0,s.jsxs)(s.Fragment,{children:[j," ",v]}),buttonText:(0,s.jsx)(C.cC,{id:"3jHA5d"}),buttonLink:x}})},key:"upcoming-cancellation-butterbar"},{key:"tablet-browser-warning",header:(0,s.jsx)(C.cC,{id:"JAtlMu",values:{GAMMA_PROPER_NOUN:b.N6}}),text:(0,s.jsx)(C.cC,{id:"9JlCFS",values:{GAMMA_PROPER_NOUN:b.N6}}),conditions:()=>(0,h.dA)(),dismissKey:P.H.lastDismissedPreferredBrowserMessage},{key:"desktop-browser-warning",header:(0,s.jsx)(C.cC,{id:"3S0+Wy",values:{GAMMA_PROPER_NOUN:b.N6}}),text:(0,s.jsx)(C.cC,{id:"Tf7VpJ"}),conditions:()=>N()&&(0,h.ds)(),dismissKey:P.H.lastDismissedPreferredBrowserMessage}],N=()=>(0,h.jP)()||!(0,h.i7)()&&!(0,h.G6)()&&!(0,h.NA)(),L=e=>
1{let{isViewOnly:i}=e,t=(0,p.gF)();if(i||!t||(0,h.l6)()||x.cx||(0,g.wg)())return null;let l=O.map(e=>"Component"in e?(0,s.jsx)(e.Component,{},e.key):(0,s.jsx)(R,{definition:e},e.key));return(0,s.jsx)(n.k,{"data-testid":"butterbar",direction:"column",top:0,pos:"relative",zIndex:"banner",sx:{"> *:not(:first-child)":{display:"none"}},children:l})},R=e=>{let{definition:i}=e,{key:t,dismissKey:h="butterbar-dismiss-".concat(t),header:x,text:p,buttonText:g,buttonLink:C,buttonOnClick:v=C?()=>window.open(C,"_blank"):void 0,conditions:f,ttl:b}=i,[y,_]=(0,m.I)(h,!1);return((0,u.useEffect)(()=>{if(!(b&&y))return;let e=new Date().getTime(),i=new Date(y).getTime(),t=e-i>1e3*b;t&&j.W.removeItem(h)},[h,y,b]),f&&!f()||y)?null:(0,s.jsxs)(n.k,{direction:"row",bg:"indigo.500",color:"white",py:3,px:4,align:"center",fontSize:"sm",children:[(0,s.jsxs)(l.g,{flex:"1",align:"start",spacing:0,children:[(0,s.jsx)(r.x,{fontWeight:"bold",children:x}),(0,s.jsx)(r.x,{opacity:"0.7",fontSize:"xs",children:p})]}),g&&v&&(0,s.jsx)(o.z,{variant:"plain",size:"sm",mr:4,rightIcon:C?(0,s.jsx)(c.G,{icon:d.wlW}):void 0,onClick:v,children:g}),(0,s.jsx)(a.P,{onClick:()=>{_(String(new Date))}})]})}},2013:function(e,i,t){"use strict";t.d(i,{q:function(){return y}});var s=t(52322),n=t(38035),l=t(77533),r=t(49259),o=t(87436),a=t(95897),d=t(28535),c=t(89511),u=t(11121),h=t(44438),x=t(42822),p=t(62614),m=t(75009),g=t(94523),j=t(5879),C=t(3543),v=t(92981);let f=(0,s.jsx)(j.cC,{id:"HiX9QN"}),b={bgImage:"radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 50px 160px, #ddd, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 90px 40px, #fff, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 160px 120px, #ddd, rgba(0,0,0,0))",bgRepeat:"repeat",bgSize:"200px 200px",transform:"translate(-50%,-50%)",borderRadius:{base:0,lg:"100px"},pos:"relative",maxW:"8xl",maxH:"5xl",minH:{base:0,lg:"5xl"}},y=e=>{let{errMessage:i=f,showDisclosure:t=!1,opacity:y=1,starOverlay:_=!0,backgroundColor:S=g.qZ.colors.trueblue[900],...A}=e,E=_?b:{};return(0,s.jsx)(n.k,{"data-error-component":!0,w:"100vw",h:"100vh",overflow:"hidden",zIndex:99999,backgroundColor:(0,C.tT)(S,y),...A,children:(0,s.jsx)(n.k,{...E,justifyContent:"center",alignItems:"center",flex:1,p:[4,16],left:"50%",top:"50%",children:(0,s.jsxs)(v.qX,{lede:"",title:(0,s.jsx)(j.cC,{id:"HbR60U"}),stackProps:{shadow:"lg-dark",position:"relative"},children:[(0,s.jsx)(l.x,{children:(0,s.jsx)(j.cC,{id:"1gm+lP"})}),t&&(0,s.jsx)(r.U,{allowToggle:!0,pt:4,children:(0,s.jsxs)(o.Q,{children:[(0,s.jsxs)(a.K,{px:0,_hover:{bgColor:"none"},borderStyle:"none",children:[(0,s.jsx)(d.xu,{flex:"1",textAlign:"left",children:(0,s.jsx)(j.cC,{id:"qug3k/"})}),(0,s.jsx)(c.X,{})]}),(0,s.jsx)(u.H,{pb:4,children:(0,s.jsx)(h.E,{colorScheme:"red",children:i})})]})}),(0,s.jsx)(x.M,{children:(0,s.jsx)(p.z,{variant:"solid",size:"lg",m:6,onClick:()=>{window.location.reload()},children:(0,s.jsx)(j.cC,{id:"C6f2hU"})})}),(0,s.jsx)(m.E,{pos:"absolute",w:36,bottom:"calc(-100% + 120px)",right:-12,src:"/_next/static/media/Sal-Asteroid-Parachute.ad317576.png",pointerEvents:"none",opacity:{base:0,md:1}})]})})})}},79254:function(e,i,t){"use strict";t.d(i,{$C:function(){return h},H6:function(){return u},Uj:function(){return x}});var s=t(52322),n=t(5632),l=t(73534),r=t.n(l),o=t(14274),a=t(93441),d=t(34385);let c=["/signin","/signup","/invitations/workspaces/[workspaceId]"],u=()=>{let e=(0,n.useRouter)().pathname;return!(0,a.gF)()||c.includes(e)?null:(0,s.jsx)("style",{children:".grecaptcha-badge { visibility: hidden; }"})},h=()=>(0,s.jsx)(r(),{src:"https://www.google.com/recaptcha/enterprise.js?render=".concat(o.v.RECAPTCHA_SCORING_KEY),async:!0,defer:!0}),x=async e=>(await (0,d.X)(50,100)(()=>!!window.grecaptcha).catch(()=>{throw Error("Timed out waiting for grecaptcha")}),new Promise((i,t)=>{grecaptcha.enterprise.ready(async()=>{try{let t=await grecaptcha.enterprise.execute(o.v.RECAPTCHA_SCORING_KEY,{action:e});i(t)}catch(e){console.log(e),t(e)}})}))},39122:function(e,i,t){"use strict";t.d(i,{ET:function(){return s},LB:function(){return a},VN:function(){return o},VY:function(){return n},WJ:function(){return l},rj:function(){return r}});let s="/generate",n="ai-generate",l=2,r=2,o=400,a={DESIGNER__HELLO:0,USER__OUTPUT_FORMAT_INPUT:1,DESIGNER__TOPIC:2,USER__TOPIC_INPUT:3,DESIGNER__OUTLINE:4,USER__OUTLINE_INPUT:5}},49165:function(e,i,t){"use strict";t.d(i,{R:function(){return m},c:function(){return g}});
1var s=t(52322),n=t(70065),l=t(5879),r=t(5632),o=t(2784),a=t(93202),d=t(42111),c=t(84405),u=t(56356),h=t(41425),x=t(23147),p=t(36651);let m={example_deck_clone_toast:a.L17.DuplicateInspiration,import_google_doc:a.L17.ImportGoogleDoc,import_google_slides:a.L17.ImportGoogleSlides,import_docx:a.L17.ImportDocx,import_pptx:a.L17.ImportPptx,blank:a.L17.Blank,template_browser:a.L17.DuplicateTemplate,get_started_modal:a.L17.Blank,template_modal_griditem:a.L17.DuplicateTemplate,template_dashboard_griditem:a.L17.DuplicateTemplate,template_modal_preview:a.L17.DuplicateTemplate,template_modal_preview_create_theme:a.L17.DuplicateTemplate,"slash-new":a.L17.SlashNew,editor_toolbar_doc_menu_duplicate:a.L17.DuplicateDoc,dashboard_docs_view_duplicate:a.L17.DuplicateDoc,ai_generated:a.L17.AiGenerated,ai_generated_advanced:a.L17.AiGenerated,sites_add_page:a.L17.SitesAddPage,sites_copy_to_site:a.L17.SitesCopyToSite,sites_duplicate_page:a.L17.SitesDuplicatePage},g=()=>{let{user:e,currentWorkspace:i}=(0,p.SE)(),t=(0,d.ye)("cardLayoutsEnabled"),[g,{data:j,loading:C}]=(0,a.CsQ)(),{push:v,replace:f}=(0,r.useRouter)(),b=(0,n.p)(),y=(0,o.useCallback)(n=>{var r;let o=null==e?void 0:null===(r=e.settings)||void 0===r?void 0:r.needsEditorOnboarding,a=n.source,d=null==n?void 0:n.channelId,p=(null==n?void 0:n.historyFn)==="replace"?f:v,j=o?"quickstart":"empty";if(!(null==i?void 0:i.id)){console.error("[createDocAndNavigate] No currentWorkspace found");return}let C={cardLayoutsEnabled:t},y=(null==n?void 0:n.document)?n.document:"empty"===j?(0,u.bx)(e,{docFlags:C}):(0,u.VK)(e,{docFlags:C}),_=(0,x.qI)(y);return console.debug("[createDocAndNavigate] Creating doc",{document:y,encodedDocument:_}),g({variables:{workspaceId:null==i?void 0:i.id,title:(null==n?void 0:n.title)||"",source:m[n.source],initialContent:{ydoc:_,schemaVersion:h.bI,editors:[null==e?void 0:e.id]},...d?{channels:[{channelId:d}]}:{}}}).then(async e=>{let{data:i}=e;(0,c.Q)({doc_id:null==i?void 0:i.createDoc.id,source:a,channel:d||null}),console.debug("[createDocAndNavigate] Doc created. Navigating to Editor",null==i?void 0:i.createDoc.id),p("/docs/".concat(null==i?void 0:i.createDoc.id).concat(o?"?tour=true":""))}).catch(e=>{console.error("[createDocAndNavigate]",e),b({title:(0,s.jsx)(l.cC,{id:"0jT1fA"}),description:e.message,position:"top",status:"error",isClosable:!0,duration:null})})},[t,g,null==i?void 0:i.id,v,f,b,e]);return[y,{data:j,loading:C}]}},18469:function(e,i,t){"use strict";t.d(i,{p:function(){return p}});var s=t(43019),n=t(9850),l=t.n(n),r=t(54073),o=t.n(r),a=t(30764),d=t(2784),c=t(42111),u=t(91994),h=t(91073),x=t(66625);let p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0,t=(0,u.TL)(),n=(0,c.ye)("cardTextComputedEnabled");(0,d.useEffect)(()=>{if(!i||!n)return;let e=o()(()=>{let e={};i.state.doc.descendants((t,n)=>{if((0,h.KH)(t)&&t.attrs.id){let l=t.toJSON(),r=(0,s.getCardTitle)(l),o=i.state.doc.resolve(n),a=0===o.parentOffset&&1===o.depth;e[t.attrs.id]={title:r,text:m(i.schema,l,r),isFirstCard:a}}return!0}),t((0,x.uD)({localCardTextMap:e}))},1e3,{leading:!0,trailing:!0,maxWait:1e3});return e(),i.on("update",e),()=>{i.off("update",e)}},[i,t,n]),(0,d.useEffect)(()=>{e&&t((0,x.eJ)({cards:e}))},[t,e]),(0,d.useEffect)(()=>()=>{t((0,x.mc)())},[])},m=(e,i,t)=>{try{var n;let r=l()(i),o=(0,s.removeNodesOfType)(r,["cardNotes"]);if(!o)return"";o.content=null===(n=o.content)||void 0===n?void 0:n.map(e=>{if("card"!==e.type)return e;let i=(0,s.getCardTitle)(e);return{type:"paragraph",content:i?[{type:"text",text:i}]:[]}});let d=a.NB.fromJSON(e,o),c=d.textBetween(0,d.content.size,"\n\n",e=>{let i=e.type.name;return s.nodeSerializers[i]&&s.nodeSerializers[i](e)||" "});if(t)return(0,s.removeTitle)(c,t);return c}catch(e){return""}}},6912:function(e,i,t){"use strict";t.d(i,{S1:function(){return f},B_:function(){return _},ET:function(){return b}});var s=t(2784),n=t(14274),l=t(88232),r=t(42111),o=t(49152),a=t(44663),d=t(1163),c=t(11050),u=t(90221),h=t(23284),x=t(90383),p=t(87254),m=t(82108),g=t.n(m),j=t(94199);let C=(e,i)=>{let t=g()(i);return{[e]:{next:p.ag._({id:"hXzOVo"}),back:p.ag._({id:"iH8pgl"}),nevermind:p.ag._({id:"CKyk7Q"}),goToAccount:p.ag._({id:"C9yTHG",values:{GAMMA_PROPER_NOUN:j.N6}}),getHelp:p.ag._({id:"pWsyuL"}),declineOffer:p.ag._({id:"aIFikE"}),confirmAndCancel:p.ag._({id:"G9nPRC"}),pauseSubscription:p.ag._({id:"2RgEmU"}),cancelSubscription:p.ag._({id:"dEgA5A"}),discountSubscription:p.ag._({id:"qG4Wa/"}),claimOffer:p.ag._({id:"/Gl/RK"}),discountOff:p.ag._({id:"Bdtwnw"}),discountFor:p.ag._({id:"sQv06Y"}),discountForever:p.ag._({id:"FsOOWf"}),discountOneTime:p.ag._({id:"HpXCa4"}),day:p.ag._({id:"5YWExy"}),month:p.ag._({id:"obrMay"}),year:p.ag._({id:"/Tw548"}),error:p.ag._({id:"wTrpxV"}),genericErrorDescription:p.ag._({id:"PUjJ3A"}),cancelNow:p.ag._({id:"EiakwV"}),applyingDiscount:p.ag._({id:"8kSYjw"}),applyingCancel:p.ag._({id:"VpuvNv"}),applyingResume:p.ag._({id:"eIoGiX"}),applyingPause:p.ag._({id:"UD7gOq"}),discountApplied:p.ag._({id:"jdYyiz"}),discountAppliedMessage:p.ag._({id:"DhHX6G"}),pauseApplied:p.ag._({id:"eeITvj"}),pauseAppliedMessage:p.ag._({id:"nm0VaE"}),pauseAppliedResumeMessage:p.ag._({id:"qOe0SS"}),pauseScheduledMessage:p.ag._({id:"mqRc6d"}),until:p.ag._({id:"C51N+0"}),cancelApplied:p.ag._({id:"Wcg6zu"}),cancelAppliedMessage:p.ag._({id:"8vN97Y"}),cancelAppliedDateMessage:p.ag._({id:"BS/SGu"}),howLongToPausePrompt:p.ag._({id:"HLyJ9n"}),whatCouldWeHaveDone:p.ag._({id:"fcbm8H"}),weReadEveryAnswer:p.ag._({id:"nkuKRd"}),applyingCustomerAction:p.ag._({id:"PXwF+s"}),loading:p.ag._({id:"Z3FXyt"}),pauseWallCardPunch:p.ag._({id:"iL2TQ6"}),pauseWallCta:p.ag._({id:"TvXj47"}),pauseWallCardHeading:p.ag._({id:"kHm8Fg"}),scheduledToReactivate:p.ag._({id:"aH7vi8"}),resumeApplied:p.ag._({id:"diOgYK"}),resumeAppliedMessage:p.ag._({id:"YqFvUY"}),resumeNextChargeMessage:p.ag._({id:"VDqPUf"}),resumeNextChargeMessageWithoutAmount:p.ag._({id:"RrvVAn"}),resumeAccountDataInfo:p.ag._({id:"dJCJXA"}),subscriptionPauseNotice:p.ag._({id:"fpxliT"}),failedPaymentNotice:p.ag._({id:"Vxg5vO"}),chargedMultipleTimeNotice:p.ag._({id:"lAlv46"}),failedPaymentCardPunch:p.ag._({id:"KEZrHg",values:{GAMMA_PROPER_NOUN:j.N6,productName:t}}),resumeHey:p.ag._({id:"hdOctW"}),invoicePaidTitle:p.ag._({id:"aJGfDL"}),logout:p.ag._({id:"W+3RJN"}),note:p.ag._({id:"ycCSuD"}),discount:p.ag._({id:"HmpVeZ"}),discountNoticeHeadline:p.ag._({id:"5P1dmt"}),discountNoticePrepend:p.ag._({id:"yjadEY"}),discountOverride:p.ag._({id:"JfBDWL"}),discountValidUntil:p.ag._({id:"uXxNua"}),updateBilling:p.ag._({id:"tQilrI"}),extendTrialCTA:p.ag._({id:"m3l7VI"}),extendTrialPunch:p.ag._({id:"s5pINo"}),extendTrialOfferTitle:p.ag._({id:"SyzXYh"}),trialExtended:p.ag._({id:"fezME2"}),trialExtendedMessage:p.ag._({id:"QE4mUs"}),applyingTrialExtension:p.ag._({id:"vI2q9R"}),switchPlanCTA:p.ag._({id:"P2mx2L"}),changePlanHighlights:p.ag._({id:"qbgW+C"}),changePlanOfferPunch:p.ag._({id:"MRkiFP"}),planChanged:p.ag._({id:"ByFtyh"}),planChangedMessage:p.ag._({id:"Pf5z1G"}),applyingPlanChange:p.ag._({id:"9vKKLI"}),surveyStepTag:p.ag._({id:"cSUBI1"}),freeFormStepTag:p.ag._({id:"cSUBI1"}),finalConfirmation:p.ag._({id:"1/oP/N"}),offerDiscountTag:p.ag._({id:"LTgtxG"}),offerChangePlanTag:p.ag._({id:"ENMJv2"}),offerExtendTrialTag:p.ag._({id:"MWKntz"}),offerRedirectTag:p.ag._({id:"cvpAvL"}),offerContactTag:p.ag._({id:"cvpAvL"}),offerPauseTag:p.ag._({id:"+T6DGl"}),completeTag:p.ag._({id:"K5c1e7"}),errorTag:p.ag._({id:"EuvbIW"}),offerAccepted:p.ag._({id:"ZU0opP"})}}},v="\n!function(){  \n    if (!window.churnkey || !window.churnkey.created) {\n      window.churnkey = { created: true };\n      const a = document.createElement('script');\n      a.src = 'https://assets.churnkey.co/js/app.js?appId=".concat(n.v.CHURNKEY_APP_ID,"';\n      a.async = true;\n      const b = document.getElementsByTagName('script')[0];\n      b.parentNode.insertBefore(a, b);\n    }\n  }();\n"),f=()=>{let e=!(0,u.l6)()&&!(0,x.wg)();return(0,h.G)(e,v),null},b=e=>{let{subscription:i,workspace:t,autoLaunch:c=!0}
1=e,u=(0,r.ye)("churnkeyFailedPaymentWallEnabled"),h=(0,o.l)(),x=(0,d.K9)(t),p=(0,a.G)(),m=(0,s.useCallback)(async()=>{if(i&&x&&u)return(0,l.d6)("churnkey").then(e=>{var t,s;if(!e||!i.billingSubscriptionId||!(null===(t=i.createdByUser)||void 0===t?void 0:t.billingCustomerId)){console.error("[Churnkey] launchFailedPayment Missing hmac or subscription data",{hmac:e,subscription:i});return}console.debug("[Churnkey] launchFailedPayment - launching churnkey with:",{hmac:e,appId:n.v.CHURNKEY_APP_ID,subscriptionId:i.billingSubscriptionId,customerId:null===(s=i.createdByUser)||void 0===s?void 0:s.billingCustomerId}),y({authHash:e,subscription:i,localeKey:h,productKey:x,launchIntercomUI:p})})},[i,x,u,h,p]);return(0,s.useEffect)(()=>{c&&m()},[m,c]),{launchFailedPaymentFlow:m,failedPaymentFlowEnabled:u}},y=async e=>{var i,t;let{authHash:s,subscription:l,localeKey:r,productKey:o,launchIntercomUI:a}=e;null===(t=window.churnkey)||void 0===t||t.check("failed-payment",{subscriptionId:l.billingSubscriptionId,customerId:null===(i=l.createdByUser)||void 0===i?void 0:i.billingCustomerId,authHash:s,customerAttributes:{language:r},i18n:{lang:r,messages:C(r,o)},appId:n.v.CHURNKEY_APP_ID,mode:n.v.CHURNKEY_MODE,provider:"stripe",softWall:!0,forceCheck:!1,gracePeriodDays:3,ignoreInvoicesWithoutAttempt:!1,handleSupportRequest(){var e;a(),c.co.track(c.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"failed-payment-wall",subscriptionId:l.billingSubscriptionId,customerId:null===(e=l.createdByUser)||void 0===e?void 0:e.billingCustomerId})},async handleCancel(e){var i,t;return c.co.track(c.AA.CANCEL_SUBSCRIPTION_CLICK,{source:"failed-payment-wall",subscriptionId:l.billingSubscriptionId,customerId:null===(i=l.createdByUser)||void 0===i?void 0:i.billingCustomerId}),console.debug("[launchChurnkeyFailedPayment.handleCancel]",{subscriptionId:l.billingSubscriptionId,customerId:null===(t=l.createdByUser)||void 0===t?void 0:t.billingCustomerId,customer:e}),S({authHash:s,subscription:l,localeKey:r,productKey:o,launchIntercomUI:a,customerAttributes:{viaFailedPayment:!0}}).catch(e=>y({authHash:s,subscription:l,localeKey:r,productKey:o,launchIntercomUI:a}))},onFailedPaymentWallActivated(){var e;c.co.track(c.AA.CHURNKEY_FAILED_PAYMENT_WALL_SHOWN,{subscriptionId:l.billingSubscriptionId,customerId:null===(e=l.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onUpdatePaymentInformation(){var e;c.co.track(c.AA.CHURNKEY_PAYMENT_METHOD_UPDATED,{source:"failed-payment-wall",subscriptionId:l.billingSubscriptionId,customerId:null===(e=l.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onFailedPaymentWallClose(){var e;c.co.track(c.AA.CHURNKEY_FAILED_PAYMENT_WALL_CLOSED,{subscriptionId:l.billingSubscriptionId,customerId:null===(e=l.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onCancel(){var e;c.co.track(c.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"failed-payment-wall",subscriptionId:l.billingSubscriptionId,customerId:null===(e=l.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onError(e,i){console.warn('Churnkey check("failed-payment", ...) error',e,i)}})},_=(e,i)=>{let t=(0,r.ye)("churnkeyCancelFlowEnabled"),n=(0,o.l)(),c=(0,d.K9)(i),u=(0,a.G)(),h=(0,s.useCallback)(()=>{if(e&&c&&t)return(0,l.d6)("churnkey").then(i=>{var t;if(!i||!e.billingSubscriptionId||!(null===(t=e.createdByUser)||void 0===t?void 0:t.billingCustomerId)){console.debug("[Churnkey] handleCancel - Missing hmac or subscription data",{hmac:i,subscription:e});return}return S({authHash:i,subscription:e,localeKey:n,productKey:c,launchIntercomUI:u})})},[t,n,c,e,u]);return{launchCancelFlow:h,cancelFlowEnabled:t}},S=async e=>{let{authHash:i,subscription:t,localeKey:s,productKey:l,customerAttributes:r={},launchIntercomUI:o}=e;return new Promise((e,a)=>{var u,h,x;null===(x=window.churnkey)||void 0===x||x.init("show",{subscriptionId:t.billingSubscriptionId,customerId:null===(u=t.createdByUser)||void 0===u?void 0:u.billingCustomerId,authHash:i,customerAttributes:{language:s,frequency:null===(h=(0,d.OJ)(t))||void 0===h?void 0:h.frequencyUnit,productKey:l,...r},i18n:{lang:s,messages:C(s,l)},appId:n.v.CHURNKEY_APP_ID,mode:n.v.CHURNKEY_MODE,provider:"stripe",record:!0,handleSupportRequest
1(){var e;o(),c.co.track(c.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"cancel-flow",subscriptionId:t.billingSubscriptionId,customerId:null===(e=t.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onCancel(e,i,s){var n;c.co.track(c.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"cancel-flow",subscriptionId:t.billingSubscriptionId,customerId:null===(n=t.createdByUser)||void 0===n?void 0:n.billingCustomerId,surveyResponse:i,freeformFeedback:s}),console.debug("[launchChurnkeyCancelFlow.onCancel]",{surveyResponse:i,freeformFeedback:s})},onGoToAccount(i){console.debug("[launchChurnkeyCancelFlow.onGoToAccount]",{sessionResults:i}),e({sessionResults:i})},onClose(i){if(console.debug("[launchChurnkeyCancelFlow.onClose]",{sessionResults:i}),!i||i.aborted){a("Churnkey cancel flow aborted");return}e({sessionResults:i})},onError(e){console.warn("[launchChurnkeyCancelFlow.onError]",{message:e}),a({message:e})}})})}},12985:function(e,i,t){"use strict";t.d(i,{B:function(){return n}});var s=t(2784);let n=s.lazy(()=>Promise.all([t.e(8917),t.e(7120),t.e(4100),t.e(3421)]).then(t.bind(t,23421)).then(e=>({default:e.default})))},31702:function(e,i,t){"use strict";t.d(i,{Im:function(){return eO},nL:function(){return i$},UB:function(){return iQ},jn:function(){return iI},tk:function(){return iE}});var s,n,l,r,o,a,d,c,u,h,x,p,m,g,j,C,v,f,b,y,_,S,A,E,I,D,k,w,T,P,O,N,L,R,M,F,U,z,B,G,H,K,V,W,q,Y,X,Z,Q,J,$,ee,ei,et,es,en,el,er,eo,ea,ed,ec,eu,eh,ex,ep,em,eg,ej,eC,ev,ef,eb,ey,e_,eS,eA=t(52322),eE=t(77533),eI=t(38035),eD=t(43297),ek=t(74409),ew=t(20204),eT=t(82562);let eP={renderNode:{[eT.BLOCKS.PARAGRAPH]:function(e,i){return(0,eA.jsx)(eE.x,{color:"gray.600",children:i})}}},eO=e=>{let{category:i}=e,t=i.description?(0,ew.h)(i.description,eP):null;return(0,eA.jsx)(eI.k,{direction:"row",alignItems:"flex-start",justify:"space-between",children:(0,eA.jsxs)(eD.K,{mb:6,fontSize:"md",children:[(0,eA.jsx)(ek.X,{fontSize:"2xl",mb:-1,children:i.title}),t&&t]})})};var eN=t(54326),eL=t(2338),eR=t(97217),eM=t(75009),eF=t(50250),eU=t(62614),ez=t(28535),eB=t(67109),eG=t(69251),eH=t(30523),eK=t(42946),eV=t(49929),eW=t(5879),eq=t(49165),eY=t(29094),eX=t(55478),eZ=t(82729),eQ=t(2784),eJ=t(16426),e$=t(12136),e0=t(90221),e1=t(33579),e2=t(92850),e5=t(26468),e3=t(22226),e4=t(73235),e6=t(57981),e9=t(40794);function e7(){let e=(0,e4._)(["\n    fragment InspirationCategoryFieldsFragment on InspirationCategory {\n  title\n  slug\n  sys {\n    id\n  }\n  description {\n    json\n  }\n}\n    "]);return e7=function(){return e},e}function e8(){let e=(0,e4._)(["\n    fragment InspirationEntryFieldsFragment on InspirationEntry {\n  title\n  slug\n  description {\n    json\n  }\n  sys {\n    id\n    firstPublishedAt\n  }\n  deck {\n    title\n    docId\n    previewCardId\n    previewImage {\n      url\n    }\n    author {\n      name\n      image {\n        url\n      }\n    }\n  }\n}\n    "]);return e8=function(){return e},e}function ie(){let e=(0,e4._)(["\n    fragment TemplateCategoryFieldsFragment on TemplateCategory {\n  title\n  slug\n  sys {\n    id\n  }\n  description {\n    json\n  }\n}\n    "]);return ie=function(){return e},e}function ii(){let e=(0,e4._)(["\n    fragment TemplateEntryFieldsFragment on TemplateEntry {\n  title\n  slug\n  sys {\n    id\n    firstPublishedAt\n  }\n  deck {\n    title\n    docId\n    previewCardId\n    previewImage {\n      url\n    }\n    author {\n      name\n      image {\n        url\n      }\n    }\n  }\n}\n    "]);return ii=function(){return e},e}function it(){let e=(0,e4._)(["\n    fragment TemplateCategoryFieldsWithEntriesFragment on TemplateCategory {\n  ...TemplateCategoryFieldsFragment\n  templateEntriesCollection(limit: 7) {\n    items {\n      ...TemplateEntryFieldsFragment\n    }\n  }\n}\n    ","\n",""]);return it=function(){return e},e}function is(){let e=(0,e4._)(["\n    query GetInspirationCategoryCollection($where: InspirationCategoryFilter, $locale: String) {\n  inspirationCategoryCollection(\n    where: $where\n    locale: $locale\n    limit: 10\n    order: priority_DESC\n  ) {\n    items {\n      ...InspirationCategoryFieldsFragment\n      inspirationEntriesCollection(limit: 20) {\n        items {\n          ...Ins
1pirationEntryFieldsFragment\n        }\n      }\n    }\n  }\n}\n    ","\n",""]);return is=function(){return e},e}function il(){let e=(0,e4._)(["\n    query GetTemplateCategoryCollection($where: TemplateCategoryFilter, $locale: String) {\n  templateCategoryCollection(\n    where: $where\n    locale: $locale\n    limit: 20\n    order: priority_DESC\n  ) {\n    items {\n      ...TemplateCategoryFieldsFragment\n      templateEntriesCollection(limit: 100) {\n        items {\n          ...TemplateEntryFieldsFragment\n        }\n      }\n    }\n  }\n}\n    ","\n",""]);return il=function(){return e},e}function ir(){let e=(0,e4._)(["\n    query GetTemplateEntry($id: String!) {\n  templateEntry(id: $id) {\n    ...TemplateEntryFieldsFragment\n    description {\n      json\n    }\n    linkedFrom {\n      templateCategoryCollection {\n        items {\n          ...TemplateCategoryFieldsWithEntriesFragment\n        }\n      }\n    }\n  }\n}\n    ","\n",""]);return ir=function(){return e},e}function io(){let e=(0,e4._)(["\n    query GetAllTemplateEntries($where: TemplateEntryFilter) {\n  templateEntryCollection(where: $where) {\n    items {\n      ...TemplateEntryFieldsFragment\n      description {\n        json\n      }\n    }\n  }\n}\n    ",""]);return io=function(){return e},e}function ia(){let e=(0,e4._)(["\n    query GetFeaturedTemplateEntries($id: String!) {\n  featuredTemplates(id: $id) {\n    templateEntriesCollection {\n      items {\n        ...TemplateEntryFieldsFragment\n        description {\n          json\n        }\n      }\n    }\n  }\n}\n    ",""]);return ia=function(){return e},e}function id(){let e=(0,e4._)(["\n    query GetTours($where: TourFilter) {\n  tourCollection(where: $where, limit: 1) {\n    items {\n      id\n      title\n      description\n      stepsCollection {\n        items {\n          body {\n            json\n          }\n          headline\n          sys {\n            id\n          }\n          videoUrl\n          posterUrl\n          staticImageUrl\n        }\n        total\n      }\n    }\n  }\n}\n    "]);return id=function(){return e},e}let ic={};(s=B||(B={})).UrlAsc="url_ASC",s.UrlDesc="url_DESC",s.SizeAsc="size_ASC",s.SizeDesc="size_DESC",s.ContentTypeAsc="contentType_ASC",s.ContentTypeDesc="contentType_DESC",s.FileNameAsc="fileName_ASC",s.FileNameDesc="fileName_DESC",s.WidthAsc="width_ASC",s.WidthDesc="width_DESC",s.HeightAsc="height_ASC",s.HeightDesc="height_DESC",s.SysIdAsc="sys_id_ASC",s.SysIdDesc="sys_id_DESC",s.SysPublishedAtAsc="sys_publishedAt_ASC",s.SysPublishedAtDesc="sys_publishedAt_DESC",s.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",s.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",s.SysPublishedVersionAsc="sys_publishedVersion_ASC",s.SysPublishedVersionDesc="sys_publishedVersion_DESC",(n=G||(G={})).TitleAsc="title_ASC",n.TitleDesc="title_DESC",n.SlugAsc="slug_ASC",n.SlugDesc="slug_DESC",n.SysIdAsc="sys_id_ASC",n.SysIdDesc="sys_id_DESC",n.SysPublishedAtAsc="sys_publishedAt_ASC",n.SysPublishedAtDesc="sys_publishedAt_DESC",n.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",n.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",n.SysPublishedVersionAsc="sys_publishedVersion_ASC",n.SysPublishedVersionDesc="sys_publishedVersion_DESC",(l=H||(H={})).TitleAsc="title_ASC",l.TitleDesc="title_DESC",l.InternalNameAsc="internalName_ASC",l.InternalNameDesc="internalName_DESC",l.SlugAsc="slug_ASC",l.SlugDesc="slug_DESC",l.PriorityAsc="priority_ASC",l.PriorityDesc="priority_DESC",l.SysIdAsc="sys_id_ASC",l.SysIdDesc="sys_id_DESC",l.SysPublishedAtAsc="sys_publishedAt_ASC",l.SysPublishedAtDesc="sys_publishedAt_DESC",l.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",l.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",l.SysPublishedVersionAsc="sys_publishedVersion_ASC",l.SysPublishedVersionDesc="sys_publishedVersion_DESC",(r=K||(K={})).TitleAsc="title_ASC",r.TitleDesc="title_DESC",r.InternalNameAsc="internalName_ASC",r.InternalNameDesc="internalName_DESC",r.SlugAsc="slug_ASC",r.SlugDesc="slug_DESC",r.PriorityAsc="priority_ASC",r.PriorityDesc="priority_DESC",r.SysIdAsc="sys_id_ASC",r.SysIdDesc="sys_id_DESC",r.SysPublishedAtAsc="sys_publishedAt_ASC",r.SysPublishedAtDesc="sys_publishedAt_DESC",r.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",r.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",r.SysPublishedVersionAsc="sys_publishedVersion_ASC",r.SysPublishedVersionDesc="sys_publishedVersion_DESC",(o=V||(V={})).TitleAsc="title_ASC",o.TitleDesc="title_DESC",o.SlugAsc="slug_ASC",o.SlugDesc="slug_DESC",o.SysIdAsc="sys_id_ASC",o.SysIdDesc="sys_id_DESC",o.SysPublishedAtAsc="sys_publishedAt_ASC",o.SysPublishedAtDesc="sys_publishedAt_DESC",o.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",o.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",o.SysPublishedVersionAsc="sys_publishedVersion_ASC",o.SysPublishedVersionDesc="sys_publishedVersion_DESC",(a=W||(W={})).TitleAsc="title_ASC",a.TitleDesc="title_DESC",a.DocIdAsc="docId_ASC",a.DocIdDesc="docId_DESC",a.PreviewCardIdAsc="previewCardId_ASC",a.PreviewCardIdDesc="previewCardId_DESC",a.StagingDocIdAsc="stagingDocId_ASC",a.StagingDocIdDesc="stagingDocId_DESC",a.IsNewAsc="isNew_ASC",a.IsNewDesc="isNew_DESC",a.AuthorDisplayNameAsc="authorDisplayName_ASC",a.AuthorDisplayNameDesc="authorDisplayName_DESC",a.SlugAsc="slug_ASC",a.SlugDesc="slug_DESC",a.SysIdAsc="sys_id_ASC",a.SysIdDesc="sys_id_DESC",a.SysPublishedAtAsc="sys_publishedAt_ASC",a.SysPublishedAtDesc="sys_publishedAt_DESC",a.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",a.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",a.SysPublishedVersionAsc="sys_publishedVersion_ASC",a.SysPublishedVersionDesc="sys_publishedVersion_DESC",(d=q||(q={})).TitleAsc="title_ASC",d.TitleDesc="title_DESC",d.SlugAsc="slug_ASC",d.SlugDesc="slug_DESC",d.PriorityAsc="priority_ASC",d.PriorityDesc="priority_DESC",d.SysIdAsc="sys_id_ASC",d.SysIdDesc="sys_id_DESC",d.SysPublishedAtAsc="sys_publishedAt_ASC",d.SysPublishedAtDesc="sys_publishedAt_DESC",d.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",d.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",d.SysPublishedVersionAsc="sys_publishedVersion_ASC",d.SysPublishedVersionDesc="sys_publishedVersion_DESC",(c=Y||(Y={})).TitleAsc="title_ASC",c.TitleDesc="title_DESC",c.SlugAsc="slug_ASC",c.SlugDesc="slug_DESC",c.PriorityAsc="priority_ASC",c.PriorityDesc="priority_DESC",c.SysIdAsc="sys_id_ASC",c.SysIdDesc="sys_id_DESC",c.SysPublishedAtAsc="sys_publishedAt_ASC",c.SysPublishedAtDesc="sys_publishedAt_DESC",c.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",c.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",c.SysPublishedVersionAsc="sys_publishedVersion_ASC",c.SysPublishedVersionDesc="sys_publishedVersion_DESC",(u=X||(X={})).IdAsc="id_ASC",u.IdDesc="id_DESC",u.NameAsc="name_ASC",u.NameDesc="name_DESC",u.DescriptionAsc="description_ASC",u.DescriptionDesc="description_DESC",u.SysIdAsc="sys_id_ASC",u.SysIdDesc="sys_id_DESC",u.SysPublishedAtAsc="sys_publishedAt_ASC",u.SysPublishedAtDesc="sys_publishedAt_DESC",u.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",u.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",u.SysPublishedVersionAsc="sys_publishedVersion_ASC",u.SysPublishedVersionDesc="sys_publishedVersion_DESC",(h=Z||(Z={})).TitleAsc="title_ASC",h.TitleDesc="title_DESC",h.SlugAsc="slug_ASC",h.SlugDesc="slug_DESC",h.SysIdAsc="sys_id_ASC",h.SysIdDesc="sys_id_DESC",h.SysPublishedAtAsc="sys_publishedAt_ASC",h.SysPublishedAtDesc="sys_publishedAt_DESC",h.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",h.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",h.SysPublishedVersionAsc="sys_publishedVersion_ASC",h.SysPublishedVersionDesc="sys_publishedVersion_DESC",(x=Q||(Q={})).TitleAsc="title_ASC",x.TitleDesc="title_DESC",x.SlugAsc="slug_ASC",x.SlugDesc="slug_DESC",x.PriorityAsc="priority_ASC",x.PriorityDesc="priority_DESC",x.SysIdAsc="sys_id_ASC",x.SysIdDesc="sys_id_DESC",x.SysPublishedAtAsc="sys_publishedAt_ASC",x.SysPublishedAtDesc="sys_publishedAt_DESC",x.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",x.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",x.SysPublishedVersionAsc="sys_publishedVersion_ASC",x.SysPublishedVersionDesc="sys_publishedVersion_DESC",(p=J||(J={})).TitleAsc="title_ASC",p.TitleDesc="title_DESC",p.SlugAsc="slug_ASC",p.SlugDesc="slug_DESC",p.SysIdAsc="sys_id_ASC",p.SysIdDesc="sys_id_DESC",p.SysPublishedAtAsc="sys_publishedAt_ASC",p.SysPublishedAtDesc="sys_publishedAt_DESC",p.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",p.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",p.SysPublishedVersionAsc="sys_publishedVersion_ASC",p.SysPublishedVersionDesc="sys_publishedVersion_DESC",(m=$||($={})).TitleAsc="title_ASC",m.TitleDesc="title_DESC",m.SlugAsc="slug_ASC",m.SlugDesc="slug_DESC",m.SysIdAsc="sys_id_ASC",m.SysIdDesc="sys_id_DESC",m.SysPublishedAtAsc="sys_publishedAt_ASC",m.SysPublishedAtDesc="sys_publishedAt_DESC",m.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",m.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",m.SysPublishedVersionAsc="sys_publishedVersion_ASC",m.SysPublishedVersionDesc="sys_publishedVersion_DESC",(g=ee||(ee={}
1)).SysIdAsc="sys_id_ASC",g.SysIdDesc="sys_id_DESC",g.SysPublishedAtAsc="sys_publishedAt_ASC",g.SysPublishedAtDesc="sys_publishedAt_DESC",g.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",g.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",g.SysPublishedVersionAsc="sys_publishedVersion_ASC",g.SysPublishedVersionDesc="sys_publishedVersion_DESC",(j=ei||(ei={})).SlugAsc="slug_ASC",j.SlugDesc="slug_DESC",j.SysIdAsc="sys_id_ASC",j.SysIdDesc="sys_id_DESC",j.SysPublishedAtAsc="sys_publishedAt_ASC",j.SysPublishedAtDesc="sys_publishedAt_DESC",j.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",j.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",j.SysPublishedVersionAsc="sys_publishedVersion_ASC",j.SysPublishedVersionDesc="sys_publishedVersion_DESC",(C=et||(et={})).TitleAsc="title_ASC",C.TitleDesc="title_DESC",C.SlugAsc="slug_ASC",C.SlugDesc="slug_DESC",C.SysIdAsc="sys_id_ASC",C.SysIdDesc="sys_id_DESC",C.SysPublishedAtAsc="sys_publishedAt_ASC",C.SysPublishedAtDesc="sys_publishedAt_DESC",C.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",C.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",C.SysPublishedVersionAsc="sys_publishedVersion_ASC",C.SysPublishedVersionDesc="sys_publishedVersion_DESC",(v=es||(es={})).TitleAsc="title_ASC",v.TitleDesc="title_DESC",v.ColorSchemeAsc="colorScheme_ASC",v.ColorSchemeDesc="colorScheme_DESC",v.PreviewImageAsc="previewImage_ASC",v.PreviewImageDesc="previewImage_DESC",v.IconNameAsc="iconName_ASC",v.IconNameDesc="iconName_DESC",v.ActionAsc="action_ASC",v.ActionDesc="action_DESC",v.SysIdAsc="sys_id_ASC",v.SysIdDesc="sys_id_DESC",v.SysPublishedAtAsc="sys_publishedAt_ASC",v.SysPublishedAtDesc="sys_publishedAt_DESC",v.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",v.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",v.SysPublishedVersionAsc="sys_publishedVersion_ASC",v.SysPublishedVersionDesc="sys_publishedVersion_DESC",(f=en||(en={})).IdAsc="id_ASC",f.IdDesc="id_DESC",f.TitleAsc="title_ASC",f.TitleDesc="title_DESC",f.SysIdAsc="sys_id_ASC",f.SysIdDesc="sys_id_DESC",f.SysPublishedAtAsc="sys_publishedAt_ASC",f.SysPublishedAtDesc="sys_publishedAt_DESC",f.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",f.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",f.SysPublishedVersionAsc="sys_publishedVersion_ASC",f.SysPublishedVersionDesc="sys_publishedVersion_DESC",(b=el||(el={})).IdAsc="id_ASC",b.IdDesc="id_DESC",b.TitleAsc="title_ASC",b.TitleDesc="title_DESC",b.SysIdAsc="sys_id_ASC",b.SysIdDesc="sys_id_DESC",b.SysPublishedAtAsc="sys_publishedAt_ASC",b.SysPublishedAtDesc="sys_publishedAt_DESC",b.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",b.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",b.SysPublishedVersionAsc="sys_publishedVersion_ASC",b.SysPublishedVersionDesc="sys_publishedVersion_DESC",(y=er||(er={})).TitleAsc="title_ASC",y.TitleDesc="title_DESC",y.ColorSchemeAsc="colorScheme_ASC",y.ColorSchemeDesc="colorScheme_DESC",y.PreviewImageAsc="previewImage_ASC",y.PreviewImageDesc="previewImage_DESC",y.IconNameAsc="iconName_ASC",y.IconNameDesc="iconName_DESC",y.ActionAsc="action_ASC",y.ActionDesc="action_DESC",y.SysIdAsc="sys_id_ASC",y.SysIdDesc="sys_id_DESC",y.SysPublishedAtAsc="sys_publishedAt_ASC",y.SysPublishedAtDesc="sys_publishedAt_DESC",y.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",y.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",y.SysPublishedVersionAsc="sys_publishedVersion_ASC",y.SysPublishedVersionDesc="sys_publishedVersion_DESC",(_=eo||(eo={})).Jpg="JPG",_.JpgProgressive="JPG_PROGRESSIVE",_.Png="PNG",_.Png8="PNG8",_.Webp="WEBP",_.Avif="AVIF",(S=ea||(ea={})).Center="CENTER",S.Top="TOP",S.TopRight="TOP_RIGHT",S.Right="RIGHT",S.BottomRight="BOTTOM_RIGHT",S.Bottom="BOTTOM",S.BottomLeft="BOTTOM_LEFT",S.Left="LEFT",S.TopLeft="TOP_LEFT",S.Face="FACE",S.Faces="FACES",(A=ed||(ed={})).Fit="FIT",A.Pad="PAD",A.Fill="FILL",A.Scale="SCALE",A.Crop="CROP",A.Thumb="THUMB",(E=ec||(ec={})).TitleAsc="title_ASC",E.TitleDesc="title_DESC",E.SlugAsc="slug_ASC",E.SlugDesc="slug_DESC",E.SysIdAsc="sys_id_ASC",E.SysIdDesc="sys_id_DESC",E.SysPublishedAtAsc="sys_publishedAt_ASC",E.SysPublishedAtDesc="sys_publishedAt_DESC",E.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",E.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",E.SysPublishedVersionAsc="sys_publishedVersion_ASC",E.SysPublishedVersionDesc="sys_publishedVersion_DESC",(I=eu||(eu={})).TitleAsc="title_ASC",I.TitleDesc="title_DESC",I.InternalNameAsc="internalName_ASC",I.InternalNameDesc="internalName_DESC",I.SlugAsc="slug_ASC",I.SlugDesc="slug_DESC",I.PriorityAsc="priority_ASC",I.PriorityDesc="priority_DESC",I.SysIdAsc="sys_id_ASC",I.SysIdDesc="sys_id_DESC",I.SysPublishedAtAsc="sys_publishedAt_ASC",I.SysPublishedAtDesc="sys_publishedAt_DESC",I.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",I.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",I.SysPublishedVersionAsc="sys_publishedVersion_ASC",I.SysPublishedVersionDesc="sys_publishedVersion_DESC",(D=eh||(eh={})).TitleAsc="title_ASC",D.TitleDesc="title_DESC",D.InternalNameAsc="internalName_ASC",D.InternalNameDesc="internalName_DESC",D.SlugAsc="slug_ASC",D.SlugDesc="slug_DESC",D.PriorityAsc="priority_ASC",D.PriorityDesc="priority_DESC",D.SysIdAsc="sys_id_ASC",D.SysIdDesc="sys_id_DESC",D.SysPublishedAtAsc="sys_publishedAt_ASC",D.SysPublishedAtDesc="sys_publishedAt_DESC",D.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",D.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",D.SysPublishedVersionAsc="sys_publishedVersion_ASC",D.SysPublishedVersionDesc="sys_publishedVersion_DESC",(k=ex||(ex={})).TitleAsc="title_ASC",k.TitleDesc="title_DESC",k.SlugAsc="slug_ASC",k.SlugDesc="slug_DESC",k.SysIdAsc="sys_id_ASC",k.SysIdDesc="sys_id_DESC",k.SysPublishedAtAsc="sys_publishedAt_ASC",k.SysPublishedAtDesc="sys_publishedAt_DESC",k.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",k.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",k.SysPublishedVersionAsc="sys_publishedVersion_ASC",k.SysPublishedVersionDesc="sys_publishedVersion_DESC",(w=ep||(ep={})).TitleAsc="title_ASC",w.TitleDesc="title_DESC",w.DocIdAsc="docId_ASC",w.DocIdDesc="docId_DESC",w.PreviewCardIdAsc="previewCardId_ASC",w.PreviewCardIdDesc="previewCardId_DESC",w.StagingDocIdAsc="stagingDocId_ASC",w.StagingDocIdDesc="stagingDocId_DESC",w.IsNewAsc="isNew_ASC",w.IsNewDesc="isNew_DESC",w.AuthorDisplayNameAsc="authorDisplayName_ASC",w.AuthorDisplayNameDesc="authorDisplayName_DESC",w.SlugAsc="slug_ASC",w.SlugDesc="slug_DESC",w.SysIdAsc="sys_id_ASC",w.SysIdDesc="sys_id_DESC",w.SysPublishedAtAsc="sys_publishedAt_ASC",w.SysPublishedAtDesc="sys_publishedAt_DESC",w.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",w.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",w.SysPublishedVersionAsc="sys_publishedVersion_ASC",w.SysPublishedVersionDesc="sys_publishedVersion_DESC",(T=em||(em={})).NameAsc="name_ASC",T.NameDesc="name_DESC",T.EmailAsc="email_ASC",T.EmailDesc="email_DESC",T.PhoneAsc="phone_ASC",T.PhoneDesc="phone_DESC",T.FacebookAsc="facebook_ASC",T.FacebookDesc="facebook_DESC",T.TwitterAsc="twitter_ASC",T.TwitterDesc="twitter_DESC",T.SysIdAsc="sys_id_ASC",T.SysIdDesc="sys_id_DESC",T.SysPublishedAtAsc="sys_publishedAt_ASC",T.SysPublishedAtDesc="sys_publishedAt_DESC",T.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",T.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",T.SysPublishedVersionAsc="sys_publishedVersion_ASC",T.SysPublishedVersionDesc="sys_publishedVersion_DESC",(P=eg||(eg={})).TitleAsc="title_ASC",P.TitleDesc="title_DESC",P.InternalNameAsc="internalName_ASC",P.InternalNameDesc="internalName_DESC",P.SlugAsc="slug_ASC",P.SlugDesc="slug_DESC",P.PriorityAsc="priority_ASC",P.PriorityDesc="priority_DESC",P.SysIdAsc="sys_id_ASC",P.SysIdDesc="sys_id_DESC",P.SysPublishedAtAsc="sys_publishedAt_ASC",P.SysPublishedAtDesc="sys_publishedAt_DESC",P.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",P.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",P.SysPublishedVersionAsc="sys_publishedVersion_ASC",P.SysPublishedVersionDesc="sys_publishedVersion_DESC",(O=ej||(ej={})).TitleAsc="title_ASC",O.TitleDesc="title_DESC",O.SlugAsc="slug_ASC",O.SlugDesc="slug_DESC",O.SysIdAsc="sys_id_ASC",O.SysIdDesc="sys_id_DESC",O.SysPublishedAtAsc="sys_publishedAt_ASC",O.SysPublishedAtDesc="sys_publishedAt_DESC",O.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",O.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",O.SysPublishedVersionAsc="sys_publishedVersion_ASC",O.SysPublishedVersionDesc="sys_publishedVersion_DESC",(N=eC||(eC={})).SlugAsc="slug_ASC",N.SlugDesc="slug_DESC",N.SysIdAsc="sys_id_ASC",N.SysIdDesc="sys_id_DESC",N.SysPublishedAtAsc="sys_publishedAt_ASC",N.SysPublishedAtDesc="sys_publishedAt_DESC",N.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",N.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",N.SysPublishedVersionAsc="sys_publishedVersion_ASC",N.SysPublishedVersionDesc="sys_publishedVersion_DESC",(L=ev||(ev={}
1)).TitleAsc="title_ASC",L.TitleDesc="title_DESC",L.InternalNameAsc="internalName_ASC",L.InternalNameDesc="internalName_DESC",L.SlugAsc="slug_ASC",L.SlugDesc="slug_DESC",L.PriorityAsc="priority_ASC",L.PriorityDesc="priority_DESC",L.SysIdAsc="sys_id_ASC",L.SysIdDesc="sys_id_DESC",L.SysPublishedAtAsc="sys_publishedAt_ASC",L.SysPublishedAtDesc="sys_publishedAt_DESC",L.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",L.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",L.SysPublishedVersionAsc="sys_publishedVersion_ASC",L.SysPublishedVersionDesc="sys_publishedVersion_DESC",(R=ef||(ef={})).TitleAsc="title_ASC",R.TitleDesc="title_DESC",R.SlugAsc="slug_ASC",R.SlugDesc="slug_DESC",R.SysIdAsc="sys_id_ASC",R.SysIdDesc="sys_id_DESC",R.SysPublishedAtAsc="sys_publishedAt_ASC",R.SysPublishedAtDesc="sys_publishedAt_DESC",R.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",R.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",R.SysPublishedVersionAsc="sys_publishedVersion_ASC",R.SysPublishedVersionDesc="sys_publishedVersion_DESC",(M=eb||(eb={})).IdAsc="id_ASC",M.IdDesc="id_DESC",M.TitleAsc="title_ASC",M.TitleDesc="title_DESC",M.DescriptionAsc="description_ASC",M.DescriptionDesc="description_DESC",M.SysIdAsc="sys_id_ASC",M.SysIdDesc="sys_id_DESC",M.SysPublishedAtAsc="sys_publishedAt_ASC",M.SysPublishedAtDesc="sys_publishedAt_DESC",M.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",M.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",M.SysPublishedVersionAsc="sys_publishedVersion_ASC",M.SysPublishedVersionDesc="sys_publishedVersion_DESC",(F=ey||(ey={})).IdAsc="id_ASC",F.IdDesc="id_DESC",F.TitleAsc="title_ASC",F.TitleDesc="title_DESC",F.DescriptionAsc="description_ASC",F.DescriptionDesc="description_DESC",F.SysIdAsc="sys_id_ASC",F.SysIdDesc="sys_id_DESC",F.SysPublishedAtAsc="sys_publishedAt_ASC",F.SysPublishedAtDesc="sys_publishedAt_DESC",F.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",F.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",F.SysPublishedVersionAsc="sys_publishedVersion_ASC",F.SysPublishedVersionDesc="sys_publishedVersion_DESC",(U=e_||(e_={})).HeadlineAsc="headline_ASC",U.HeadlineDesc="headline_DESC",U.VideoUrlAsc="videoUrl_ASC",U.VideoUrlDesc="videoUrl_DESC",U.PosterUrlAsc="posterUrl_ASC",U.PosterUrlDesc="posterUrl_DESC",U.StaticImageUrlAsc="staticImageUrl_ASC",U.StaticImageUrlDesc="staticImageUrl_DESC",U.SysIdAsc="sys_id_ASC",U.SysIdDesc="sys_id_DESC",U.SysPublishedAtAsc="sys_publishedAt_ASC",U.SysPublishedAtDesc="sys_publishedAt_DESC",U.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",U.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",U.SysPublishedVersionAsc="sys_publishedVersion_ASC",U.SysPublishedVersionDesc="sys_publishedVersion_DESC",(z=eS||(eS={})).HeadlineAsc="headline_ASC",z.HeadlineDesc="headline_DESC",z.VideoUrlAsc="videoUrl_ASC",z.VideoUrlDesc="videoUrl_DESC",z.PosterUrlAsc="posterUrl_ASC",z.PosterUrlDesc="posterUrl_DESC",z.StaticImageUrlAsc="staticImageUrl_ASC",z.StaticImageUrlDesc="staticImageUrl_DESC",z.SysIdAsc="sys_id_ASC",z.SysIdDesc="sys_id_DESC",z.SysPublishedAtAsc="sys_publishedAt_ASC",z.SysPublishedAtDesc="sys_publishedAt_DESC",z.SysFirstPublishedAtAsc="sys_firstPublishedAt_ASC",z.SysFirstPublishedAtDesc="sys_firstPublishedAt_DESC",z.SysPublishedVersionAsc="sys_publishedVersion_ASC",z.SysPublishedVersionDesc="sys_publishedVersion_DESC";let iu=(0,e6.Ps)(e7()),ih=(0,e6.Ps)(e8()),ix=(0,e6.Ps)(ie()),ip=(0,e6.Ps)(ii()),im=(0,e6.Ps)(it(),ix,ip),ig=(0,e6.Ps)(is(),iu,ih),ij=(0,e6.Ps)(il(),ix,ip);(0,e6.Ps)(ir(),ip,im),(0,e6.Ps)(io(),ip),(0,e6.Ps)(ia(),ip),(0,e6.Ps)(id());var iC=t(39794),iv=t.n(iC),ib=t(10649);let iy=e=>{var i;return!!((null==e?void 0:e.graphQLErrors)&&(null==e?void 0:null===(i=e.graphQLErrors)||void 0===i?void 0:i.length)>0&&iv()(null==e?void 0:e.graphQLErrors,e=>{var i,t;return(null==e?void 0:null===(t=e.extensions)||void 0===t?void 0:null===(i=t.contentful)||void 0===i?void 0:i.code)==="UNRESOLVABLE_LINK"}))&&(null==e?void 0:e.clientErrors.length)===0&&!(null==e?void 0:e.networkError)},i_="en-US",iS=e=>e===ib.p5?i_:"ko"===e?"ko":i_,iA=(e,i)=>({variables:{where:{},locale:i},context:{clientName:"contentfulGraphql"},onError:i=>{iy(i)||console.error("[".concat(e,"] error"),i.message)},errorPolicy:"all",fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),iE=()=>{var e;let{i18n:i}=(0,eW.mV)(),{data:t,loading:s,error:n}=function(e){let i={...ic,...e};return e9.a(ij,i)}({...iA("useGetTemplateCategories",iS(i.locale))}),l=(0,e1.$H)(null==t?void 0:null===(e=t.templateCategoryCollection)||void 0===e?void 0:e.items),r=iy(n)?void 0:n;return{categories:l,loading:s,error:r}},iI=()=>{var e;let{i18n:i}=(0,eW.mV)(),{data:t,loading:s,error:n}=function(e){let i={...ic,...e};return e9.a(ig,i)}({...iA("useGetInspirationCategories",iS(i.locale))}),l=(0,e1.$H)(null==t?void 0:null===(e=t.inspirationCategoryCollection)||void 0===e?void 0:e.items),r=iy(n)?void 0:n;return{categories:l,loading:s,error:r}};var iD=t(89364),ik=t(42822),iw=t(81540),iT=t(32899),iP=t(93202),iO=t
1(18469),iN=t(11050);let iL="260px";var iR=t(56356),iM=t(46409);let iF="template-preview-modal-body",iU=e=>{let{doc:i,theme:t,snapshotContent:s,setEditor:n}=e;return(0,eA.jsxs)(eI.k,{w:"100%",flex:1,direction:"column",className:"".concat(iF),align:"center",overflowY:"auto",overflowX:"auto",justifyContent:"flex-start",h:"100%",borderWidth:"1px",borderStyle:"solid",borderColor:"gray.200",css:{"--editor-width":"calc(100vw - ".concat(iL," - var(--chakra-sizes-32) - 2px)")},children:[(0,eA.jsx)(iM.Y,{}),(0,eA.jsx)(iR.yE,{animationsEnabled:!1,isStatic:!1,theme:t||void 0,initialContent:s,doc:i,docId:i.id,readOnly:!0,scrollingParentSelector:".".concat(iF),onCreate:e=>{let{editor:i}=e;return n(i)}},i.id)]})};var iz=t(56581),iB=t(11881),iG=t(94523),iH=t(94199),iK=t(53596);let iV=e=>{let{isChecked:i,setTheme:t,theme:s}=e;return(0,eA.jsxs)(ez.xu,{as:iB.f,p:2,transition:"all 0.2s ease-in-out",bgColor:i?"trueblue.100":"linen.50",textAlign:"left",tabIndex:0,borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_focus:{boxShadow:i?void 0:"outline"},outline:"none",onClick:()=>t(s),_hover:{bgColor:i?"trueblue.100":"gray.100"},"data-theme-id":s.id,"data-testid":i?"current-theme-preview":void 0,cursor:"pointer",children:[(0,eA.jsx)(iK.n,{theme:s}),(0,eA.jsxs)(eD.K,{direction:"row",spacing:1,pt:1,children:[i&&(0,eA.jsx)(iz.n,{w:3,h:"auto",mr:1,color:"trueblue.700"}),(0,eA.jsx)(eE.x,{fontSize:"sm",noOfLines:1,"data-testid":"theme-name",color:i?"trueblue.700":void 0,children:s.name})]})]})},iW=e=>{let{heading:i,themes:t,currentTheme:s,setTheme:n}=e;return(0,eA.jsxs)(eD.K,{spacing:2,children:[(0,eA.jsx)(iG.NZ,{children:i}),(0,eA.jsx)(eD.K,{spacing:4,p:1,pr:4,children:null==t?void 0:t.map((e,i)=>{let t=e.id===(null==s?void 0:s.id);return(0,eA.jsx)(iV,{theme:e,setTheme:n,isChecked:t},i)})})]})},iq=e=>{let{templateTheme:i,setTheme:t,currentTheme:s,themes:n,onCloneClick:l,isCloneButtonDisabled:r}=e;return(0,eA.jsxs)(eI.k,{w:iL,ml:4,direction:"column",children:[(0,eA.jsx)(ez.xu,{w:"100%",pb:8,children:(0,eA.jsxs)(eU.z,{w:"100%",variant:"solid",size:"lg",onClick:l,isDisabled:r,children:[(0,eA.jsx)(eW.cC,{id:"p6eI8J"})," →"]})}),(0,eA.jsxs)(eD.K,{spacing:6,overflowY:"auto",h:"100%",pb:8,children:[(0,eA.jsx)(iW,{heading:(0,eA.jsx)(eW.cC,{id:"mdLv9o"}),themes:i?[i]:[],currentTheme:s,setTheme:t}),(0,eA.jsx)(iW,{heading:(0,eA.jsx)(eW.cC,{id:"mvmJyu"}),themes:n||[],currentTheme:s,setTheme:t}),(0,eA.jsx)(eD.K,{spacing:4,p:1,pr:4,children:(0,eA.jsx)(eI.k,{alignItems:"center",justifyContent:"center",border:"1px solid",borderColor:"gray.200",borderRadius:"lg",background:"gray.50",minH:36,_hover:{background:"white",color:"trueblue.600",cursor:"pointer"},onClick:()=>l({openThemeEditor:!0}),children:(0,eA.jsxs)(eD.K,{textAlign:"center",children:[(0,eA.jsx)(eE.x,{fontSize:"xl",children:(0,eA.jsx)(eV.G,{icon:eK.EQ8})}),(0,eA.jsx)(eE.x,{children:(0,eA.jsx)(eW.cC,{id:"YHI6sk"})})]})})}),(0,eA.jsx)(ez.xu,{px:2,py:4,children:(0,eA.jsxs)(eE.x,{textAlign:"center",fontSize:"sm",color:"gray.600",children:[(0,eA.jsx)(eW.cC,{id:"k0ByBj",values:{GAMMA_ARTIFACT_PROPER_NOUN:iH.Yc}})," ",(0,eA.jsx)("span",{role:"img","aria-label":"thumbs-up",children:"\uD83D\uDC4D"})]})})]})]})},iY=()=>(0,eA.jsxs)(eA.Fragment,{children:[(0,eA.jsx)(eN.x,{children:(0,eA.jsx)(eB.O,{w:"80%",h:"48px"})}),(0,eA.jsx)(eL.o,{}),(0,eA.jsxs)(eR.f,{display:"flex",overflow:"hidden",children:[(0,eA.jsx)(eI.k,{flex:1,children:(0,eA.jsx)(ik.M,{w:"100%",bg:"gray.100",children:(0,eA.jsx)(iw.$,{})})}),(0,eA.jsxs)(eI.k,{w:iL,ml:4,direction:"column",children:[(0,eA.jsx)(eB.O,{w:"100%",h:"48px",mb:4}),(0,eA.jsx)(eB.O,{w:"50%",h:8,mb:4}),(0,eA.jsx)(eB.O,{w:"100%",h:36,mb:4}),(0,eA.jsx)(eB.O,{w:"100%",h:36,mb:4}),(0,eA.jsx)(eB.O,{w:"100%",h:36,mb:4})]})]}),(0,eA.jsx)(eF.m,{children:(0,eA.jsx)(eB.O,{w:48,h:"42px"})})]}),iX=e=>{let{onClose:i,heading:t,errorMessage:s,onBackClick:n}=e;return(0,eA.jsxs)(eA.Fragment,{children:[(0,eA.jsxs)(eN.x,{children:[!!n&&(0,eA.jsx)(iT.h,{"aria-label":"Back",icon:(0,eA.jsx)(iD.R,{}),variant:"ghost",onClick:n,mr:2}),t]}),(0,eA.jsx)(eL.o,{}),(0,eA.jsx)(eR.f,{display:"flex",overflow:"hidden",className:"template-preview-modal-body",children:(0,eA.jsxs)(eI.k,{direction:"column",justify:"center",align:"center",w:"100%",children:[(0,eA.jsx)(eM.E,{src:eY.Z.src,width:"300px",alt:"Sal, the Gamma mascot, perched on a rocket enjoying some screentime",mb:6}),(0,eA.jsx)(ek.X,{size:"sm",mb:2,textAlign:"center",children:(0,eA.jsx)(eW.cC,{id:"zwZQVm"})}),(0,eA.jsxs)(eE.x,{fontSize:"md",color:"gray.400",textAlign:"center",children:[(0,eA.jsx)(eW.cC,{id:"u4Djqb"}),(0,eA.jsx)("br",{}),!!s&&s]})]})}),(0,eA.jsx)(eF.m,{children:(0,eA.jsx)(eU.z,{variant:"solid",onClick:i,children:(0,eA.jsx)(eW.cC,{id:"yz7wBu"})})})]})},iZ=e=>{var i,t;let{previewDeck:s,onBackClick:n,forceChannelId:l,onClose:r}=e,[o,a]=(0,eQ.useState)(!1),d=(0,e$.e)(),c=(0,e1.Lq)(s);(0,iN.If)(e=>{e.track(iN.AA.DOC_VIEWED,{doc_id:c}),e.track(iN.AA.EXAMPLE_VIEWED,{doc_id:c})});let{data:u,loading:h,error:x}=(0,iP.Iej)({variables:{id:c},skip:!c,fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),{data:p,loading:m}=(0,iP.BCl)({variables:{workspaceId:null,archived:!1},fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),g=(null==p?void 0:p.themes)||[],j=(0,iN.z$)(),C=null==u?void 0:u.doc,v=null==C?void 0:C.theme,[f,b]=(0,eQ.useState)(v),y=(0,eQ.useRef)(!1),[_,S]=(0,eQ.useState)(),A=!s||h,E=x||x,I=null==C?void 0:null===(i=C.currentSnapshot)||void 0===i?void 0:i.content.default;(0,iO.p)(null==u?void 0:null===(t=u.doc)||void 0===t?void 0:t.cards,_);
1let D=[...g.filter(e=>e.id!==(null==v?void 0:v.id))];(0,eQ.useEffect)(()=>{v&&!y.current&&(b(v),y.current=!0)},[v]),(0,eQ.useEffect)(()=>{if(_){let e=null==f?void 0:f.config.accentBackgrounds;if(!e||0===e.length){I&&_.commands.setContent(I);return}_.commands.updateThemeAccentImages(e)}},[I,_,f]);let k=(0,eQ.useCallback)(e=>{b(e),null==j||j.track(iN.AA.IN_APP_TEMPLATE_THEME_CLICKED,{theme_id:e.id})},[j]),w=(0,eQ.useCallback)(e=>{let{openThemeEditor:i}=e;C&&I&&(a(!0),i&&(null==j||j.track(iN.AA.IN_APP_TEMPLATE_CREATE_THEME_CLICKED,{source_doc_id:C.id})),d({docId:C.id,initialContent:I,channelId:l,newWindow:!(0,e0.Q5)(),onSuccess:r,openThemeEditor:i,source:i?"template_modal_preview":"template_modal_preview_create_theme"}))},[C,I,d,l,j,r]);return A?(0,eA.jsx)(iY,{}):!E&&s&&C&&I?(0,eA.jsxs)(eA.Fragment,{children:[(0,eA.jsxs)(eN.x,{children:[!!n&&(0,eA.jsx)(iT.h,{"aria-label":"Back",icon:(0,eA.jsx)(iD.R,{}),variant:"ghost",onClick:n,mr:2}),s.title]}),(0,eA.jsx)(eL.o,{}),(0,eA.jsxs)(eR.f,{display:"flex",overflow:"hidden",children:[(0,eA.jsx)(iU,{doc:C,snapshotContent:I,theme:f,setEditor:S}),(0,eA.jsx)(iq,{setTheme:k,currentTheme:f,templateTheme:v,themes:D,onCloneClick:w,isCloneButtonDisabled:o})]})]}):(E&&console.error("[TemplatePreview] Error loading template: ".concat(E.message)),(0,eA.jsx)(iX,{onClose:r,onBackClick:n,heading:(null==s?void 0:s.title)?s.title:"Error loading template",errorMessage:null==E?void 0:E.message}))},iQ=e=>{let{isOpen:i,onClose:t,forceDocId:s=null,forceChannelId:n=null,forceCategoryId:l=null}=e,[r,o]=(0,eQ.useState)(s),{categories:a,loading:d,error:c}=iE(),u=(0,e1.Up)(a),[h,x]=(0,eQ.useState)(l),p=(null==a?void 0:a.find(e=>e.id===h))||a[0],m=null==u?void 0:u.find(e=>{let i=(0,e1.Lq)(e);return i===r}),g=(0,eQ.useCallback)(e=>{if(!e){console.error("[TemplatesModal] onPreviewClick: docId is not defined");return}o(e)},[]),j=s?void 0:()=>o(null),C=r?"preview":"browser";return(0,eA.jsxs)(e2.u_,{isOpen:i,onClose:t,size:"full",returnFocusOnClose:!1,children:[(0,eA.jsx)(e5.Z,{}),(0,eA.jsxs)(e3.h,{borderRadius:"xl",m:6,minH:"calc(100vh - var(--chakra-sizes-12))",h:"calc(100vh - var(--chakra-sizes-12))",w:"calc(100vw - var(--chakra-sizes-12))",children:["browser"===C&&(0,eA.jsx)(i9,{onClose:t,categories:a,isLoading:d,error:c,onPreviewClick:g,currentCategory:p,setCurrentCategoryId:x,forceChannelId:n}),"preview"===C&&(0,eA.jsx)(iZ,{onBackClick:j,previewDeck:m,forceChannelId:n,onClose:t})]})]})},iJ={transitionProperty:"common",transitionDuration:"normal",transform:"scale(.9)",opacity:0,_groupFocus:{opacity:1,transform:"scale(1)"},_groupHover:{opacity:1,transform:"scale(1)"},_focus:{opacity:1,shadow:"outline"}},i$=e=>{let{deck:i,onPreviewClick:t,forceChannelId:s=null,onCloseEnclosingModal:n}=e,{isOpen:l,onOpen:r,onClose:o}=(0,eX.q)({id:"template-browser-modal"}),a=(0,e1.Lq)(i),d=(0,e$.e)(),[c,u]=(0,eQ.useState)(!1),{title:h,previewImageUrl:x}=i,p=t?()=>t(a):r,m=(0,eQ.useCallback)(()=>{if(!a){console.error("[TemplateGridItem] docIdToUse is required to clone");return}n||u(!0);let e=n?"template_modal_griditem":"template_dashboard_griditem";d({docId:a,channelId:s,source:e,newWindow:!(0,e0.Q5)(),onSuccess:()=>{n?n():setTimeout(()=>{u(!1)},3e3)}})},[a,d,s,n]);return a?(0,eA.jsxs)(eH.P,{role:"group",position:"relative",children:[(0,eA.jsxs)(eD.K,{children:[(0,eA.jsxs)(ez.xu,{tabIndex:0,role:"group",borderRadius:"5px",shadow:"md",_focus:{shadow:"outline"},_focusWithin:{shadow:"outline"},_hover:{shadow:"lg"},position:"relative",overflow:"hidden",transition:"box-shadow .2s ease",color:"white",onClick:e=>{var i,t;(null===(i=e.target)||void 0===i?void 0:i.closest('[data-target-name="use-template-button"]'))||(null===(t=e.target)||void 0===t?void 0:t.closest('[data-target-name="preview-button"]'))||p()},cursor:"pointer",children:[(0,eA.jsx)(eZ.o,{ratio:40/21,bgColor:"gray.100",children:(0,eA.jsx)(eM.E,{src:x,fallbackSrc:eJ.Z.src,fit:"cover"})}),(0,eA.jsx)(eI.k,{alignItems:"center",justifyContent:"center",position:"absolute",inset:0,zIndex:2,children:(0,eA.jsxs)(eD.K,{direction:"column",flexDirection:"column",justifyContent:"center",alignItems:"center",children:[(0,eA.jsx)(eU.z,{...iJ,size:"sm","data-target-name":"use-template-button",variant:"solid",onClick:m,isDisabled:c,
1children:(0,eA.jsx)(eW.cC,{id:"QNtP5M"})}),(0,eA.jsx)(eU.z,{"data-target-name":"preview-button",...iJ,onClick:p,w:"fit-content",size:"xs",variant:"plain",textDecoration:"none !important",children:(0,eA.jsx)(eW.cC,{id:"rdUucN"})})]})}),(0,eA.jsx)(ez.xu,{position:"absolute",inset:0,bg:"blackAlpha.300",zIndex:1,transitionProperty:"common",transitionDuration:"normal",opacity:0,_groupFocus:{opacity:1},_groupHover:{opacity:1}})]}),(0,eA.jsx)(eE.x,{fontSize:"md",children:h})]}),(0,eA.jsx)(iQ,{forceDocId:a,isOpen:l,onClose:o})]}):(console.error(["[TemplateGridItem] docIdToUse is not defined",i]),(0,eA.jsx)(eA.Fragment,{}))},i0=e=>{var i;let{category:t,onPreviewClick:s,forceChannelId:n,onClose:l}=e;return(0,eA.jsxs)(eI.k,{flex:1,w:"100%",pl:6,direction:"column",overflowY:"auto",pr:6,mr:-6,children:[(0,eA.jsx)(eO,{category:t}),(0,eA.jsx)(ez.xu,{w:"100%",children:(0,eA.jsx)(eG.r,{templateColumns:{base:"repeat(1, 1fr)",md:"repeat(2, 1fr)",lg:"repeat(3, 1fr)"},gap:6,children:null===(i=t.decks)||void 0===i?void 0:i.map(e=>(0,eA.jsx)(i$,{deck:e,onPreviewClick:s,forceChannelId:n,onCloseEnclosingModal:l},e.docId))})})]})};var i1=t(36371),i2=t(73582),i5=t(2969);let i3=e=>{let{categories:i,setCurrentCategoryId:t,currentCategoryId:s}=e,n=null==i?void 0:i.findIndex(e=>e.id===s);return i&&(null==i?void 0:i.length)!==0?(0,eA.jsx)(ez.xu,{w:iL,children:(0,eA.jsx)(i1.m,{index:n,variant:"soft-rounded",orientation:"vertical",size:"md",w:"100%",children:(0,eA.jsx)(i2.t,{w:"100%",children:(null==i?void 0:i.length)>0&&i.map(e=>{let{title:i,id:s,decks:n}=e;return(0,eA.jsxs)(i5.O,{flexDirection:"column",borderRadius:"base",border:"none",onClick:()=>t(s),alignItems:"flex-start",width:"100%",textAlign:"left",display:"block",children:[i," ","".concat(n&&(null==n?void 0:n.length)>0?"(".concat(n.length,")"):"")]},s)})})})}):(console.error("[TemplateBrowserSidebar] categories is empty"),null)},i4=e=>{let{error:i,onClose:t}=e;return(0,eA.jsxs)(eA.Fragment,{children:[(0,eA.jsx)(eN.x,{}),(0,eA.jsx)(eL.o,{}),(0,eA.jsx)(eR.f,{display:"flex",overflow:"hidden",children:(0,eA.jsxs)(eI.k,{direction:"column",justify:"center",align:"center",w:"100%",children:[(0,eA.jsx)(eM.E,{src:eY.Z.src,width:"300px",alt:"Sal, the Gamma mascot, perched on a rocket enjoying some screentime",mb:6}),(0,eA.jsx)(ek.X,{size:"sm",mb:2,textAlign:"center",children:(0,eA.jsx)(eW.cC,{id:"zwZQVm"})}),(0,eA.jsxs)(eE.x,{fontSize:"md",color:"gray.400",textAlign:"center",children:[(0,eA.jsx)(eW.cC,{id:"JhOQAi"}),(0,eA.jsx)("br",{}),(null==i?void 0:i.message)&&i.message]})]})}),(0,eA.jsx)(eF.m,{children:(0,eA.jsx)(eU.z,{variant:"solid",onClick:t,children:(0,eA.jsx)(eW.cC,{id:"yz7wBu"})})})]})},i6=e=>{let{onClose:i}=e;return(0,eA.jsxs)(eA.Fragment,{children:[(0,eA.jsx)(eN.x,{children:(0,eA.jsx)(eW.cC,{id:"iTylMl"})}),(0,eA.jsx)(eL.o,{}),(0,eA.jsx)(eR.f,{children:(0,eA.jsxs)(eI.k,{direction:"row",children:[(0,eA.jsxs)(ez.xu,{w:48,h:"100%",children:[(0,eA.jsx)(eB.O,{w:"100%",h:"40px",mb:2}),(0,eA.jsx)(eB.O,{w:"100%",h:"40px",mb:2}),(0,eA.jsx)(eB.O,{w:"100%",h:"40px",mb:2})]}),(0,eA.jsxs)(eI.k,{flex:1,w:"100%",pl:6,direction:"column",children:[(0,eA.jsx)(eB.O,{w:"50%",h:"48px",mb:4}),(0,eA.jsx)(ez.xu,{w:"100%",children:(0,eA.jsxs)(eG.r,{templateColumns:["repeat(2, 1fr)","repeat(3, 1fr)"],gap:6,children:[(0,eA.jsx)(eH.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:eB.O}),(0,eA.jsx)(eH.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:eB.O}),(0,eA.jsx)(eH.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:eB.O})]})})]})]})}),(0,eA.jsx)(eF.m,{children:(0,eA.jsx)(eU.z,{variant:"solid",onClick:i,children:(0,eA.jsx)(eW.cC,{id:"DPfwMq"})})})]})},i9=e=>{var i;let{categories:t,onClose:s,onPreviewClick:n,currentCategory:l,setCurrentCategoryId:r,forceChannelId:o,isLoading:a,error:d}=e,[c,{data:u,loading:h}]=(0,eq.c)();return a?(0,eA.jsx)(i6,{onClose:s}):d?(0,eA.jsx)(i4,{error:d,onClose:s}):(0,eA.jsxs)(eA.Fragment,{children:[(0,eA.jsx)(eN.x,{children:(0,eA.jsx)(eW.cC,{id:"iTylMl"})}),(0,eA.jsx)(eL.o,{}),(0,eA.jsx)(eR.f,{overflow:"hidden",children:(0,eA.jsxs)(eI.k,{direction:"row",h:"100%",children:[t&&(null==t?void 0:t.length)>0&&(0,eA.jsx)(i3,{currentCategoryId:l.id,setCurrentCategoryId:r,categories:t}),(null==l?void 0:null===(i=l.decks)||void 0===i?void 0:i.length)>0&&(0,eA.jsx)(i0,{category:l,onPreviewClick:n,forceChannelId:o,onClose:s})]})}),(0,eA.jsxs)(eF.m,{justifyContent:"space-between",children:[(0,eA.jsx)(eU.z,{size:"md",variant:"ghost",isDisabled:h,leftIcon:(0,eA.jsx)(eV.G,{icon:eK.r8p}),onClick:()=>{c({channelId:o,source:"template_browser"})},children:(0,eA.jsx)(eW.cC,{id:"exOjhh"})}),(0,eA.jsx)(eU.z,{variant:"solid",onClick:s,children:(0,eA.jsx)(eW.cC,{id:"DPfwMq"})})]})]})}},33579:function(e,i,t){"use strict";t.d(i,{$H:function(){return h},Lq:function(){return o},Up:function(){return x}});var s=t(35676),n=t.n(s),l=t(14274),r=t(16426);let o=e=>{if(!e){console.warn("[getDocIdForEnv] Deck is undefined. This is unexpected.");return}return"production"!==l.v.APPLICATION_ENVIRONMENT?e.stagingDocId||"oltspxg8obq2nzc":e.docId},a=e=>{let{docId:i,previewCardId:t}=e;return t&&i?"https://assets.api.gamma.app/".concat("zc87vhr30n8uf3n","/screenshots/").concat(i,"/").concat(t,"/slide"):null},d=e=>e.filter(e=>null!==e),c=e=>{var i,t,s,n,l,o,d,c,u,h,x,p,m;return{title:e.title||null,id:(null==e?void 0:null===(i=e.sys)||void 0===i?void 0:i.id)||null,description:(null===(t=e.description)||void 0===t?void 0:t.json)||null,slug:e.slug||null,docId:(null===(s=e.deck)||void 0===s?void 0:s.docId)||null,previewCardId:(null===(n=e.deck)||void 0===n?void 0:n.previewCardId)||null,authorDisplayName:(null===(o=e.deck)||void 0===o?void 0:null===(l=o.author)||void 0===l?void 0:l.name)||null,authorImageUrl:(null===(u=e.deck)||void 0===u?void 0:null===(c=u.author)||void 0===c?void 0:null===(d=c.image)||void 0===d?void 0:d.url)||null,previewImageUrl:(null===(x=e.deck)||void 0===x?void 0:null===(h=x.previewImage)||void 0===h?void 0:h.url)||a({docId:null===(p=e.deck)||void 0===p?void 0:p.docId,previewCardId:null===(m=e.deck)||void 0===m?void 0:m.previewCardId})||r.Z.src}},u=e=>{var i,t;if(!e)return[];let s=[];return(null==e?void 0:e.__typename)==="TemplateCategory"?s=(null===(i=e.templateEntriesCollection)||void 0===i?void 0:i.items)||[]:(null==e?void 0:e.__typename)==="InspirationCategory"&&(s=(null===(t=e.inspirationEntriesCollection)||void 0===t?void 0:t.items)||[]),d(s).map(c)||[]},h=e=>e&&0!==e.length?d(e).map(e=>{var i,t;return{id:(null==e?void 0:null===(i=e.sys)||void 0===i?void 0:i.id)||null,title:e.title||null,description:(null===(t=e.description)||void 0===t?void 0:t.json)||null,slug:(null==e?void 0:e.slug)||null,decks:u(e)||null}}):[],x=e=>e&&n()(e.map(e=>e.decks))||[]},34208:function(e,i,t){"use strict";t.d(i,{G:function(){return o}});var s=t(5632),n=t.n(s),l=t(2784),r=t(42111);let o=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",t=(0,r.ye)(e),{hasInitialized:s}=(0,r.yZ)(),o=s?!t:null;return(0,l.useEffect)(()=>{!0===o&&n().replace(i)},[o,i]),o}},26495:function(e,i,t){"use strict";t.d(i,{m:function(){return d}});var s=t(65616),n=t(48484),l=t(14274),r=t(99787),o=t(2090);let a=e=>{let i="",t=!1;if("transloadit"in e){let{failed:s,transloadit:n}=e;t=!!s.length,i=n[0].results[":original"][0].url}else{if(!("results"in e))return{sourceUrl:i,success:!1};i=e.results[":original"][0].url}return t?{sourceUrl:i,success:!1}:{sourceUrl:i,success:!0}},d=(e,i)=>{let t=new s.ZP({...r.N$,restrictions:{...r.N$.restrictions,allowedFileTypes:r.Ge}});return t.use(n.ZP,{assemblyOptions:async()=>{let i=l.v.TRANSLOADIT_FILE_TEMPLATE_ID,{signature:t,expires:s}=await (0,o.xQ)(i);return{params:{auth:{key:l.v.TRANSLOADIT_AUTH_KEY,expires:s},template_id:i},fields:{orgId:e},signature:t}},waitForEncoding:!0}),new Promise((e,s)=>{t.on("complete",i=>{let{success:t,sourceUrl:n}=a(i);t?e(n):s("Could not get sourceUrl from upload result")}),t.on("transloadit:complete",i=>{let{success:t,sourceUrl:n}=a(i);t?e(n):s("Could not get sourceUrl from result")}),t.on("error",e=>{s(e)}),t.on("restriction-failed",(e,i)=>{console.error("[uploadFontFile] restriction failed on file",e,"error",i),s(i)}),t.addFile({name:i.name,type:i.type,data:i}),r.N$.autoProceed||t.upload()})}},85747:function(e,i,t){"use strict";t.d(i,{E:function(){return o}});var s=t(52322),n=t(2784),l=t(99787);let r={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},o=e=>{let{handleFilesCallback:i,multiple:t=!1,accept:o=l.pK.join(",")}=e,a=(0,n.useRef)(null),d=(0,n.useMemo)(()=>(0,s.jsx)("input",{ref:a,className:"gamma-FileInput-input",style:r,type:"file",name:"gamma-file-input",multiple:t,accept:o,onChange:e=>{let t=e.target;if(!t||!t.files)return;let s=Array.from(t.files);i(s),t.value=null}}),[o,i,t]),c=(0,n.useCallback)(()=>{var e;null===(e=a.current)||void 0===e||e.click()},[]);return{inputElement:d,onClick:c}}},62700:function(e,i,t){"use strict";t.d(i,{d:function(){return l}});var s=t(52322),n=t(5879);let l=()=>({100:(0,s.jsx)(n.cC,{id:"RGjFMI"}),200:(0,s.jsx)(n.cC,{id:"GMGHcE"}),300:(0,s.jsx)(n.cC,{id:"1njn7W"}),400:(0,s.jsx)(n.cC,{id:"xfqlmg"}),500:(0,s.jsx)(n.cC,{id:"agPptk"}),600:(0,s.jsx)(n.cC,{id:"KVGfPY"}),700:(0,s.jsx)(n.cC,{id:"KmydK6"}),800:(0,s.jsx)(n.cC,{id:"NV46Ki"}),900:(0,s.jsx)(n.cC,{id:"THokF3"})})},30423:function(e,i,t){"use strict";t.d(i,{Av:function(){return g},B_:function(){return C},CZ:function(){return h},QP:function(){return v},Sd:function(){return f},UK:function(){return x},ZN:function(){return j},cC:function(){return m},x_:function(){return p},zn:function(){return c}});var s=t(18149),n=t.n(s),l=t(53553),r=t(93202);let o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=["italic","oblique"];for(let t of e)for(let e of i)if(-1!==t.toLowerCase().indexOf(e))return!0;return!1},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let i of e){if(d(i,["thin"]))return 100;if(d(i,["light","lite"],["extra","ultra","x"]))return 200;if(d(i,["light"]))return 300;if(d(i,["medium"]))return 500;if(d(i,["bold"],["demi","semi"]))return 600;if(d(i,["bold"],["extra","x"]))return 800;if(d(i,["bold"]))return 700;if(d(i,["black","heavy","ultra"]))return 900}return 400},d=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let s of i)if(0===t.length){if(-1!==e.toLowerCase().indexOf(s.toLowerCase()))return!0}else for(let i of t)if(-1!==e.toLowerCase().indexOf(s.toLowerCase())&&-1!==e.toLowerCase().indexOf(i.toLowerCase()))return!0;return!1},c=async e=>new Promise((i,t)=>{let s=new FileReader;s.onload=e=>{var s,n,r,d,c,u,h,x,p,m,g,j,C,v,f,b,y,_,S;let A=null===(s=e.target)||void 0===s?void 0:s.result;try{let e=l.ZP.parse(A),t=null!==(b=null===(n=Object.values(null!==(f=null===(d=e.tables)||void 0===d?void 0:null===(r=d.name)||void 0===r?void 0:r.preferredSubfamily)&&void 0!==f?f:null===(u=e.tables)||void 0===u?void 0:null===(c=u.name)||void 0===c?void 0:c.fontSubfam
1ily))||void 0===n?void 0:n[0])&&void 0!==b?b:"",s=null!==(y=null===(h=Object.values(null===(p=e.tables)||void 0===p?void 0:null===(x=p.name)||void 0===x?void 0:x.fullName))||void 0===h?void 0:h[0])&&void 0!==y?y:"",E=null!==(S=null===(m=Object.values(null!==(_=null===(j=e.tables)||void 0===j?void 0:null===(g=j.name)||void 0===g?void 0:g.preferredFamily)&&void 0!==_?_:null===(v=e.tables)||void 0===v?void 0:null===(C=v.name)||void 0===C?void 0:C.fontFamily))||void 0===m?void 0:m[0])&&void 0!==S?S:"";i({familyName:E,isItalic:o([t,s]),weight:a([t,s])})}catch(e){t(e)}},s.onerror=e=>{console.error("[parseFontFile] unable to read the font file, providing defaults",e),i({familyName:"",isItalic:!1,weight:400})},s.readAsArrayBuffer(e)}),u=e=>{let i=e.lastIndexOf(".");return -1===i||i===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,i),extension:e.slice(i+1)}},h=e=>{let{extension:i}=u(e);return i===r.sA6.Otf||i===r.sA6.Ttf?i:r.sA6.Ttf},x=e=>{let{existingFont:i}=e;if(!i)return!0;let t={fontName:i.name,fontId:i.id,fontFiles:i.fontFiles.map(e=>({id:e.id,name:e.name,weight:e.weight,isItalic:e.isItalic,fileType:e.fileType,sourceUrl:e.sourceUrl}))},s={fontName:e.fontName,fontId:e.fontId,fontFiles:e.uploadFontFiles.map(e=>({id:e.fontFile.id,name:e.fontFile.name,weight:e.fontFile.weight,isItalic:e.fontFile.isItalic,fileType:e.fontFile.fileType,sourceUrl:e.fontFile.sourceUrl}))};return!n()(t,s)},p=e=>{let i=e.reduce((e,i)=>{let t=[i.weight,i.isItalic].join("__");return{...e,[t]:!0}},{});return Object.keys(i).length},m=e=>{let i=Object.values(e.reduce((e,i)=>{let t=i.fontFile,s=[t.weight,t.isItalic,t.fileType].join("__");return e[s]=e[s]||[],e[s].push(i),e},{})).reduce((e,i)=>{if(i.length>1)for(let t of i)e[t.uploadId]=!0;return e},{});return i},g=e=>e.reduce((e,i)=>{let t=i.fontFile.weight;return{...e,[t]:[...e[t]||[],i]}},{}),j=function(e){let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return e.sort((e,t)=>i?Number(e)-Number(t):Number(t)-Number(e))},C=e=>j(Array.from(new Set(e.map(e=>e.weight)))),v=(e,i)=>{if(void 0===i)return;if(i>e[e.length-1])return e[e.length-1];let t=1/0,s=-1;for(let n=0;n<e.length;n++){let l=Math.abs(i-e[n]);if(l<t)t=l,s=n;else break}return e[s]},f=e=>!!e&&0!==e.length&&-1===e.findIndex(e=>!e.isItalic)},48832:function(e,i,t){"use strict";t.d(i,{BK:function(){return y},Dw:function(){return b},Km:function(){return f},dN:function(){return C},p6:function(){return v}});var s=t(87254),n=t(82282),l=t(32361),r=t(96740),o=t(31807),a=t(73871),d=t(57907),c=t(21346),u=t(48053),h=t(1363),x=t(49738),p=t(90535),m=t(9283),g=t(75528);let j={en:d.Z,"pt-br":c.Z,ja:u.Z,"zh-cn":h.Z,"zh-tw":x.Z,es:p.Z,fr:m.Z,ko:g.Z},C=()=>j[s.ag.locale]||void 0,v=(e,i)=>e?(0,n.Z)((0,o.Z)(e),i,{locale:C()}):"",f=(e,i)=>e?(0,r.Z)((0,o.Z)(e),i?(0,o.Z)(i):new Date,{locale:C()}):"",b=e=>e?(0,l.Z)((0,o.Z)(e),{locale:C()}):"",y=e=>e?(0,a.Z)((0,o.Z)(e),new Date,{locale:C(),addSuffix:!0,roundingMethod:"floor"}):""},26787:function(e,i,t){"use strict";t.d(i,{v:function(){return k}});var s=t(52322),n=t(43297),l=t(28535),r=t(77533),o=t(87651),a=t(29117),d=t(81540),c=t(42946),u=t(54933),h=t(49929),x=t(5879),p=t(16983),m=t(70065),g=t(82863),j=t(2784),C=t(14274),v=t(42111),f=t(36651),b=t(93441),y=t(23405),_=t(2
1090),S=t(85747);let A=e=>{let i=(0,m.p)(),{currentWorkspace:t}=(0,f.SE)(),[n,l]=(0,j.useState)(!1),[r,o]=(0,j.useState)(!1),a=(0,y.y)("pptImportV2"),d=(0,j.useCallback)(async(n,r)=>{let{isPPT:a,toastId:d}=r;(0,_.cT)(n,null==t?void 0:t.id,{onUploadComplete:async t=>{let{src:n,name:r}=t,c=await fetch(n).then(e=>e.text()),u=r.replace(/[.]html$/,"");e.onUploadComplete({html:c,filename:u,source:a?"PptxUpload":"DocxUpload",src:n}),i.update(d,{status:"success",title:(0,s.jsx)(x.cC,{id:"oMgC5V"}),duration:5e3,isClosable:!0}),o(!0),l(!1)},onUploadFailed(t){var n;i.update(d,{status:"error",title:(0,s.jsx)(x.cC,{id:"SlfejT"}),description:(0,s.jsx)(x.cC,{id:"lIW942"}),duration:5e3,isClosable:!0}),null===(n=e.onUploadFailed)||void 0===n||n.call(e,t),l(!1),o(!1)}},void 0,"importDoc",C.v.TRANSLOADIT_DOC_IMPORT_TEMPLATE_ID)},[null==t?void 0:t.id,e,i]),c=(0,j.useCallback)((n,r)=>{let{toastId:a}=r;(0,_.cT)(n,null==t?void 0:t.id,{onUploadComplete:async t=>{let{name:n,fullResults:r,src:d}=t,{convert_to_html:c,convert_to_pdf:u,pdf_to_images:h}=r,p=h.map(e=>({index:e.meta.thumb_index,width:e.meta.width,height:e.meta.height,url:e.ssl_url})),m=u[0].ssl_url,g=u[0].original_name||n.replace(/[.]x?html$/,""),j=c[0].ssl_url,C=await fetch(j).then(e=>e.text());e.onUploadComplete({html:C,filename:g,htmlUrl:j,src:d,source:"PptxUpload",thumbnails:p,pdfUrl:m,fileUrl:d}),i.update(a,{status:"success",title:(0,s.jsx)(x.cC,{id:"oMgC5V"}),duration:5e3,isClosable:!0}),o(!0),l(!1)},onUploadFailed(t){var n;i.update(a,{status:"error",title:(0,s.jsx)(x.cC,{id:"SlfejT"}),description:(0,s.jsx)(x.cC,{id:"lIW942"}),duration:5e3,isClosable:!0}),null===(n=e.onUploadFailed)||void 0===n||n.call(e,t),l(!1),o(!1)}},void 0,"importPpt",C.v.TRANSLOADIT_PPT_IMPORT_TEMPLATE_ID)},[null==t?void 0:t.id,e,i]),u=(0,j.useCallback)(async t=>{var n;null===(n=e.onUploadStarted)||void 0===n||n.call(e),l(!0);let r=t[0],o=_.eb.includes(r.type),u=i({id:"load-doc-toast-".concat(r.name),position:"top",duration:null,status:"loading",variant:"subtle",title:(0,s.jsx)(x.cC,{id:"hdsaJo"}),description:(0,s.jsx)(x.cC,{id:"HOoZAi"}),isClosable:!1});o&&a?c(r,{toastId:u}):d(r,{isPPT:o,toastId:u})},[e,a,i,d,c]),{onClick:h,inputElement:p}=(0,S.E)({handleFilesCallback:u,multiple:!1,accept:[..._.u0,..._.eb].join(",")});return{initiateDocUpload:h,hiddenInputElement:p,isUploading:n,handleDocUpload:u,isSuccess:r}},E="https://www.googleapis.com/auth/drive.file",I=e=>
1{let[i,t]=(0,j.useState)(!1),[n,l]=(0,j.useState)(),r=(0,m.p)(),{user:o}=(0,f.SE)(),[a,d]=(0,j.useState)(!1),[c,u]=(0,j.useState)(!1),{handleDocUpload:h}=A({onUploadComplete:e.onImportComplete}),p=(0,j.useCallback)((e,i,t,n)=>{let l="https://www.googleapis.com/drive/v3/files/".concat(i,"?fields=exportLinks");d(!0);let o=r({id:"load-doc-toast-".concat(i),position:"top",duration:null,status:"loading",variant:"subtle",title:(0,s.jsx)(x.cC,{id:"hdsaJo"}),description:(0,s.jsx)(x.cC,{id:"5VLwXq"}),isClosable:!1});fetch(l,{headers:{Authorization:"Bearer ".concat(e)}}).then(async e=>{if(200!==e.status){var i;let t=await e.json(),s=null==t?void 0:null===(i=t.error)||void 0===i?void 0:i.message;return Promise.reject(s?"Google Drive error ".concat(e.status,": ").concat(s):"Google Drive error ".concat(e.status))}return e.json()}).then(async i=>{let s=i.exportLinks[t],n=await fetch(s,{headers:{Authorization:"Bearer ".concat(e)}});return n.blob()}).then(e=>{let i=new File([e],"".concat(n,".pptx"),{type:t});h([i]),d(!1),r.close(o)}).catch(e=>{console.error("Error importing doc ".concat(i," from google"),e),d(!1),r.update(o,{status:"error",title:(0,s.jsx)(x.cC,{id:"SlfejT"}),description:e.message||e||(0,s.jsx)(x.cC,{id:"lIW942"}),duration:5e3,isClosable:!0})})},[r,h]),y=(0,j.useCallback)((i,t,n,l)=>{let o="https://www.googleapis.com/drive/v3/files/".concat(t,"/export?mimeType=").concat(n);d(!0);let a=r({id:"load-doc-toast-".concat(t),position:"top",duration:null,status:"loading",variant:"subtle",title:(0,s.jsx)(x.cC,{id:"hdsaJo"}),description:(0,s.jsx)(x.cC,{id:"gmwDJx"}),isClosable:!1});fetch(o,{headers:{Authorization:"Bearer ".concat(i)}}).then(e=>e.text()).then(i=>{e.onImportComplete({html:i,filename:l,source:"GoogleDocs",src:o}),r.update(a,{status:"success",title:(0,s.jsx)(x.cC,{id:"oMgC5V"}),duration:5e3,isClosable:!0}),u(!0),d(!1)}).catch(e=>{console.error("Error importing doc ".concat(t," from google"),e),u(!1),d(!1)})},[e,r]),_=(0,j.useCallback)((e,i)=>{if("picked"!==i.action)return;let[t]=i.docs;"application/vnd.google-apps.document"===t.mimeType?y(e,t.id,"text/html",t.name):"application/vnd.google-apps.presentation"===t.mimeType&&p(e,t.id,"application/vnd.openxmlformats-officedocument.presentationml.presentation",t.name)},[y,p]),S=(0,j.useCallback)(e=>{l(e);let i=window.google,t=v.VH.get("pptImport"),s=["application/vnd.google-apps.document",t&&"application/vnd.google-apps.presentation"].filter(e=>!!e),n=new i.picker.DocsView(i.picker.ViewId.DOCS).setMimeTypes(s.join(",")),r=new i.picker.PickerBuilder().addView(n).addView(i.picker.ViewId.FOLDERS).setOAuthToken(e).setAppId(C.v.GOOGLE_PROJECT_ID).setDeveloperKey(C.v.GOOGLE_API_KEY).setCallback(i=>{_(e,i)});t&&r.addView(i.picker.ViewId.DOCUMENTS).addView(i.picker.ViewId.PRESENTATIONS),r.build().setVisible(!0),Array.from(document.getElementsByClassName("picker-dialog")).forEach(e=>{e.style.zIndex="2000"})},[_]),I=(0,j.useCallback)(e=>{console.error("Google auth failed:",e),r({title:(0,s.jsx)(x.cC,{id:"FL/pCd",values:{error:e}}),status:"error",duration:3e3,position:"top",isClosable:!1})},[r]),D=(0,g.Nq)({scope:E,hint:null==o?void 0:o.email,prompt:"",onSuccess:e=>{(0,g.FX)(e,E)?S(e.access_token):I("Could not get requested scopes")},onError:I}),k=(0,j.useCallback)(()=>{window.gapi.load("picker",()=>{t(!0)})},[]);(0,b.Gq)("https://apis.google.com/js/api.js",{onload:k});let w=(0,j.useCallback)(()=>{i&&(n?S(n):D())},[n,D,i,S]);return{initiateGoogleImport:w,isImporting:a,isSuccess:c}},D=e=>{let{text:i}=e;return(0,s.jsxs)(n.K,{direction:"row",spacing:1.5,w:"100%",children:[(0,s.jsx)(l.xu,{color:"green.400",children:(0,s.jsx)(h.G,{icon:u.LEp})}),(0,s.jsx)(r.x,{children:i})]})},k=e=>{let{onImportComplete:i}=e,{initiateDocUpload:t,hiddenInputElement:u,isUploading:m,isSuccess:g}=A({onUploadComplete:i}),{initiateGoogleImport:j,isImporting:C,isSuccess:v}=I({onImportComplete:i}),f=m||C,b=v||g;return(0,s.jsxs)(l.xu,{w:"100%",children:[(0,s.jsx)(o.U,{in:b,children:(0,s.jsx)(a.U,{w:"100%",p:12,justifyContent:"center",spacing:4,border:"none",boxShadow:"none",bg:"whiteAlpha.700",backdropFilter:"blur(10px)",borderRadius:"md",children:(0,s.jsx)(r.x,{fontSize:"xl",children:(0,s.jsx)(x.cC,{id:"oMgC5V"})})})}),(0,s.jsx)(o.U,{in:f,children:(0,s.jsxs)(a.U,{w:"100%",p:12,justifyContent:"center",spacing:4,border:"none",boxShadow:"none",bg:"whiteAlpha.700",backdropFilter:"blur(10px)",borderRadius:"md",children:[(0,s.jsx)(d.$,{}),(0,s.jsx)(r.x,{fontSize:"xl",children:(0,s.jsx)(x.cC,{id:"fxZ/WE"})})]})}),(0,s.jsx)(o.U,{in:!f&&!b,children:(0,s.jsxs)(n.K,{w:"100%",direction:{base:"column",md:"row"},justifyContent:"center",spacing:{base:3,md:4},children:[(0,s.jsx)(p.X,{label:(0,s.jsx)(x.cC,{id:"RMmFZu"}),description:(0,s.jsxs)(n.K,{spacing:1,children:[(0,s.jsx)(D,{text:(0,s.jsx)(x.cC,{id:"W/x3L4"})}),(0,s.jsx)(D,{text:(0,s.jsx)(x.cC,{id:"cuyHFX"})})]}),isPopular:!1,colorScheme:"blue",imageUrl:"/_next/static/media/Thumbnail-drive.beda1526.svg",onClick:j,ctaIcon:(0,s.jsx)(h.G,{icon:c.A$k}),ctaLabel:(0,s.jsx)(x.cC,{id:"iSLIjg"})}),(0,s.jsx)(p.X,{label:(0,s.jsx)(x.cC,{id:"RNxrCU"}),description:(0,s.jsxs)(n.K,{spacing:1,children:[(0,s.jsx)(D,{text:(0,s.jsx)(x.cC,{id:"GwfEs/"})}),(0,s.jsx)(D,{text:(0,s.jsx)(x.cC,{id:"g8oIJP"})})]}),isPopular:!1,colorScheme:"purple",imageUrl:"/_next/static/media/Thumbnail-upload.175964bf.svg",onClick:t,ctaIcon:(0,s.jsx)(h.G,{icon:c.A$k}),ctaLabel:(0,s.jsx)(x.cC,{id:"JYj5R2"})}),u]})})]})}},23312:function(e,i,t){"use strict";t.d(i,{C:function(){return m}});var s=t(52322),n=t(92850),l=t(26468),r=t(22226),o=t(54326),a=t(2338),d=t(97217),c=t(77533),u=t(50250),h=t(43297),x=t(62614),p=t(5879);let m=e=>{let{invitationCount:i,isOpen:t,onClose:m,onSendInvitationsClick:g,onDiscardClick:j}=e;
1return t?(0,s.jsxs)(n.u_,{returnFocusOnClose:!1,onClose:m,closeOnOverlayClick:!0,isOpen:!0,isCentered:!0,children:[(0,s.jsx)(l.Z,{}),(0,s.jsxs)(r.h,{children:[(0,s.jsx)(o.x,{children:(0,s.jsx)(p.cC,{id:"tW/kB6",values:{invitationCount:i}})}),(0,s.jsx)(a.o,{}),(0,s.jsx)(d.f,{children:(0,s.jsx)(c.x,{children:(0,s.jsx)(p.cC,{id:"qxNK2k",values:{invitationCount:i}})})}),(0,s.jsx)(u.m,{children:(0,s.jsxs)(h.K,{spacing:2,direction:"row",align:"center",children:[(0,s.jsx)(x.z,{onClick:j,children:(0,s.jsx)(p.cC,{id:"bzSI52"})}),(0,s.jsx)(x.z,{variant:"solid",onClick:g,children:(0,s.jsx)(p.cC,{id:"6dWGPZ",values:{invitationCount:i}})})]})})]})]}):null}},25944:function(e,i,t){"use strict";t.d(i,{bf:function(){return m},iZ:function(){return x},lh:function(){return h},wK:function(){return p}});var s=t(2784),n=t(42111),l=t(91994),r=t(47968),o=t(90604),a=t(56400),d=t(99268);let c=e=>Math.random()<=1/e;class u{setupProvider(){this.t1SetupProvider||(this.t1SetupProvider=performance.now())}downloadDoc(){this.t2DownloadDoc||(this.t2DownloadDoc=performance.now())}onCreate(){this.t3OnCreate||(this.t3OnCreate=performance.now())}report(){return null===this.t1SetupProvider||null===this.t2DownloadDoc||null===this.t3OnCreate?null:{downloadDoc:this.t2DownloadDoc-this.t1SetupProvider,onCreate:this.t3OnCreate-this.t2DownloadDoc}}constructor(){this.t1SetupProvider=null,this.t2DownloadDoc=null,this.t3OnCreate=null}}let h=(e,i)=>{let t=(0,l.CG)(r.Pw),n=(0,s.useRef)(t);(0,s.useEffect)(()=>{n.current=t},[t]),(0,s.useEffect)(()=>{if(e)return window.addEventListener("keydown",t,!0),()=>{window.removeEventListener("keydown",t,!0)};function t(e){let t=e.target.closest(".ProseMirror");if(!t||!n.current||!c(i))return;let s=performance.now();requestAnimationFrame(()=>{let i=e.key;" "===i&&(i="Space");let t=performance.now()-s;(0,d.EF)({...(0,a.H)(),key:i,duration:t})})}},[e,n,i])},x=()=>{let e=(0,n.ye)("rumSampleRate");(0,s.useEffect)(()=>{(0,d._k)(e)},[e])},p=e=>{let i=(0,s.useCallback)(i=>{let{isFullscreen:t=!1}=i;if(!e)return;let s=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-s;(0,d.gG)({...(0,a.H)(),toMode:o.q.SLIDE_VIEW,duration:e,isFullscreen:t})})})},[e]),t=(0,s.useCallback)(i=>{let{isFullscreen:t=!1}=i;if(!e)return;let s=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-s;(0,d.gG)({...(0,a.H)(),toMode:o.q.DOC_VIEW,duration:e,isFullscreen:t})})})},[e]);return{recordExitSlideModePerformance:t,recordEnterSlideModePerformance:i}},m=()=>{let[e]=(0,s.useState)(()=>new u),i=(0,s.useCallback)(()=>{e.setupProvider()},[e]),t=(0,s.useCallback)(()=>{e.downloadDoc()},[e]),n=(0,s.useCallback)(()=>{e.onCreate();let i=e.report();if(null===i){console.warn("[HoneycombDocLoadTimer] failed to generate doc timings");return}(0,d.Py)({...(0,a.H)(),duration:i.onCreate}),(0,d.aZ)({...(0,a.H)(),duration:i.downloadDoc})},[e]);return{timeOnCreate:n,timeOnSetupProvider:i,timeOnDownloadDoc:t}}},18896:function(e,i,t){"use strict";t.d(i,{X:function(){return a}});var s=t(5632),n=t(2784),l=t(7e4),r=t(78462),o=t(88640);let a=e=>{let[i,t]=(0,l.X)(o.H.lastHomeUrl,"/"),a=(0,s.useRouter)();(0,n.useEffect)(()=>{let i=i=>{e&&(0,r.y6)(i)&&t(i)};return a.events.on("routeChangeStart",i),a.events.on("hashChangeStart",i),()=>{a.events.off("routeChangeStart",i),a.events.off("hashChangeStart",i)}},[a.events,t,e])};t(89311)},89311:function(e,i,t){"use strict";t.d(i,{l:function(){return o}});var s=t(5632),n=t(2784),l=t(7e4),r=t(88640);let o=()=>{let{pathname:e,isReady:i}=(0,s.useRouter)(),t=(0,n.useRef)(!1),[o,a]=(0,l.X)(r.H.lastHomeUrl,"/");(0,n.useEffect)(()=>{if(t.current||!i)return;let s="/inspiration"===e||"/templates"===e?e:"/";a(s),t.current=!0},[a,i,e])}},84405:function(e,i,t){"use strict";t.d(i,{J:function(){return r},Q:function(){return l}});var s=t(11050),n=t(25566);let l=e=>{let{doc_id:i,source:t,source_doc_id:l,channel:r,extra:o}=e;null===s.co||void 0===s.co||s.co.track(n.AA.DOC_CREATED,{doc_id:i,source_doc_id:l,source:t,channel:r,extra:o})},r=e=>{let{docId:i,type:t,source:l}=e;if(!i){console.debug("[trackDocShareLinkCopiedEvent]: doc_id is required");return}null===s.co||void 0===s.co||s.co.track(n.AA.DOC_SHARELINK_COPIED,{doc_id:i,source:l,type:t})}},60536:function(e,i,t){"use strict";t.d(i,{V:function(){return j}});var s=t(52322),n=t(50019),l=t(38035),r=t(74008),o=t(29117),a=t(77533),d=t(82554),c=t(36474),u=t(41098),h=t(5879),x=t(23405),p=t(94199),m=t(67964),g=t(81640);let j=e=>{let{onClose:i,onOpen:t,segmentEvent:j,doc:C,label:v}=e,f=(0,x.y)("upsellUXEnabled_Pro"),b=(0,m.dU)(null==C?void 0:C.organization),{openUpsellModal:y}=(0,g.z)(),_=(0,n.ff)("gray.200","gray.700");return!1===b&&f?(0,s.jsxs)(l.k,{direction:"column",w:"100%",children:[(0,s.jsx)(r.i,{borderColor:_}),(0,s.jsxs)(o.U,{mt:4,mb:2,children:[(0,s.jsxs)(o.U,{children:[(0,s.jsx)(a.x,{children:v||(0,s.jsx)(h.cC,{id:"kuLK2H",values:{GAMMA_PROPER_NOUN:p.N6}})}),(0,s.jsx)(d.C,{colorScheme:"trueblue",variant:"solid",children:p.k3})]}),(0,s.jsx)(c.L,{}),(0,s.jsx)(u.r,{onClickCapture:e=>{e.preventDefault(),y({onOpenCallback:i,onCloseCallback:t,segmentEvent:j})},isChecked:!0})]})]}):null}},4758:function(e,i,t){"use strict";t.d(i,{L:function(){return m}});var s=t(52322),n=t(38035),l=t(16556),r=t(29117),o=t(109),a=t(77533),d=t(28535),c=t(42946),u=t(49929),h=t(94523),x=t(5879),p=t(7985);t(30579);let m=e=>{let{selectedCollaborator:i,idx:t,handleRemoveClick:m}=e,g=i&&(0,p.G)((null==i?void 0:i.email)||""),j=0===t?170:300;return(0,s.jsx)(n.k,{width:0===t?"calc(100% - 100px)":"",className:"searchbartag","data-testid":"searchbartag-collaborator-".concat(i.email),children:(0,s.jsxs)(l.Vp,{size:"md",minW:110,...g?{}:{colorScheme:"red",bg:"red",color:"white"},children:["id"in i?(0,s.jsx)(h.kH,{label:i.email,"aria-label":i.email,children:(0,s.jsxs)(r.U,{children:[(0,s.jsx)(o.q,{size:"2xs",m:0,name:i.displayName,src:i.profileImageUrl}),(0,s.jsx)(a.x,{textTransform:"capitalize",wordBreak:"break-word",noOfLines:1,maxW:j,lineHeight:"1.5",children:i.displayName})]})}):(0,s.jsx)(h.kH,{label:g?i.email:(0,s.jsx)(x.cC,{id:"XILg0L"}),"aria-label":i.email,children:(0,s.jsxs)(r.U,{flex:1,children:[(0,s.jsx)(d.Cd,{bg:g?"trueblue.100":"none",size:6,children:(0,s.jsx)(u.G,{icon:g?c.FU$:c.WV2})}),(0,s.jsx)(a.x,{wordBreak:"break-all",display:"block",height:"100%",width:"100%",noOfLines:1,maxW:j,lineHeight:"1.5",children:i.email})]})}),(0,s.jsx)(l.SD,{onClick:m})]})},"id"in i?i.id:i.email)}},60740:function(e,i,t){"use strict";t.d(i,{y:function(){return l}});var s=t(55478),n=t(2784);let l=()=>{let{isOpen:e,onOpen:i,onClose:t}=(0,s.q)({id:"sharePanelDisclosure"}
1),[l,r]=(0,n.useState)("invite");return{isSharePanelOpen:e,onSharePanelOpen:i,onSharePanelClose:t,view:l,setView:r}}},34613:function(e,i,t){"use strict";t.d(i,{XG:function(){return s},Nj:function(){return eD},t9:function(){return ek},o$:function(){return eL},aA:function(){return iE},WQ:function(){return iI}});var s,n=t(52322),l=t(92850),r=t(26468),o=t(22226),a=t(54326),d=t(28535),c=t(2338),u=t(74008),h=t(97217),x=t(43297),p=t(67109),m=t(89099),g=t(62614),j=t(82554),C=t(36474),v=t(50250),f=t(38035),b=t(42946),y=t(49929),_=t(94523),S=t(5879),A=t(2784),E=t(93202),I=t(11550),D=t(67964),k=t(30579),w=t(16710),T=t(46759),P=t(15041),O=t(29318),N=t(36651),L=t(55274),R=t(70065),M=t(77533),F=t(87651),U=(t(81672),t(74409)),z=t(47443),B=t(52929),G=t(109),H=(t(82655),t(87254)),K=t(1842),V=t.n(K),W=t(94199),q=t(20336),Y=t(93441),X=t(89458),Z=t(88640),Q=t(29117),J=t(11082),$=t(8174),ee=t(78462);let ei=e=>{let{icon:i,showDisabled:t=!1}=e;return(0,n.jsx)(d.Cd,{color:"gray.800",textAlign:"center",bg:"gray.200",size:8,opacity:t?.5:1,children:t?(0,n.jsxs)("span",{className:"fa-stack",children:[(0,n.jsx)(y.G,{icon:b.u6k,className:"fa-stack-1x"}),(0,n.jsx)(y.G,{icon:i,className:"fa-stack-1x"})]}):(0,n.jsx)(y.G,{size:"1x",icon:i})})},et=e=>{let{channel:i,doc:t,isDisabled:s,showDisabledIcon:l=!1}=e,{removeDocChannel:r}=(0,$.Z)(),o=(0,A.useCallback)(()=>{t&&r(t,i.id)},[i.id,t,r]),a=(0,ee.j)({slug:i.slug,id:i.id});return(0,n.jsxs)(Q.U,{py:2,w:"100%",justify:"space-between","data-testid":"workspace-row-".concat(i.id),children:[(0,n.jsx)(d.xu,{children:(0,n.jsxs)(f.k,{alignItems:"center",children:[(0,n.jsx)(ei,{icon:k.Ty,showDisabled:l}),(0,n.jsx)(d.xu,{ml:3,opacity:l?.5:1,children:(0,n.jsx)(J.r,{href:a,target:"_blank",children:i.name})})]})}),(0,n.jsx)(g.z,{size:"sm",variant:"ghost",colorScheme:"red",onClick:o,isDisabled:s,children:(0,n.jsx)(S.cC,{id:"t/YqKh"})})]},i.id)};var es=t(46949),en=t(50019),el=t(75768),er=t(74105),eo=t(81540),ea=t(20816),ed=t(46028),ec=t(38421),eu=t.n(ec);let eh=e=>{let{workspaceId:i,docId:t,existingChannels:s,isDisabled:l}=e,r=(0,A.useRef)(null),[o,a]=(0,A.useState)(""),[c,u]=(0,A.useState)([]),[h,p]=(0,A.useState)(!1),{addDocChannel:m}=(0,$.Z)(),{data:g,loading:j}=(0,E.Kce)({variables:{query:o,workspaceId:i},skip:!o});(0,A.useEffect)(()=>{if(j||!g)return;let e=g.search.filter(Boolean);u(e),p(0===e.length)},[g,j]);let C=(0,A.useMemo)(()=>o?c.filter(e=>!s.find(i=>i.id===e.id)):[],[s,o,c]),v=(0,A.useCallback)(e=>{let i=C.find(i=>i.id===e);if(!i){console.error("[ChannelSearchBar.addSelectedChannel] No matching channel found");return}m({docId:t,channel:i,existingChannels:s})},[m,t,s,C]),b=(0,en.ff)("gray.100","gray.700"),I=(0,en.ff)("light","dark"),D=(0,en.ff)("trueblue.50","whiteAlpha.100");(0,en.ff)("trueblue.100","whiteAlpha.200");let w=(0,en.ff)("gray.200","gray.600");return(0,n.jsx)(el.h,{w:"100%",mb:2,alignItems:"flex-start","data-testid":"sharepanel-channel-search-bar",children:(0,n.jsx)(d.xu,{flex:1,children:(0,n.jsxs)(er.B,{w:"100%",justifyContent:"center",zIndex:1,children:[(0,n.jsx)(f.k,{display:"none",position:"absolute",h:"100%",w:"100%",alignItems:"center",justifyContent:"center",bg:b,zIndex:"overlay",opacity:.4,children:(0,n.jsx)(eo.$,{})}),(0,n.jsxs)(ed.Qc,{rollNavigation:!0,multiple:!0,emptyState:()=>!!h&&(0,n.jsxs)(f.k,{direction:"column",justify:"center",align:"center",w:"100%",my:6,children:[(0,n.jsx)(d.xu,{w:"80%",maxW:"200px",mb:6,alignContent:"center",children:(0,n.jsx)(eu(),{src:"/images/Sal-Fishing-2x.png",width:"640",height:"361",alt:"Sal, the Gamma mascot, fishing extraterrestrially"})}),(0,n.jsx)(U.X,{size:"xs",mb:2,textAlign:"center",children:(0,n.jsx)(S.cC,{id:"NmfOr+"})}),(0,n.jsx)(M.x,{fontSize:"sm",color:"gray.400",textAlign:"center",children:(0,n.jsx)(S.cC,{id:"kXnLEt"})})]}),suggestWhenEmpty:!1,openOnFocus:!0,filter:()=>!0,onSelectOption:e=>{let{item:i}=e;v(i.value),a("")},children:[(0,n.jsxs)(ea.Z,{pointerEvents:"none",color:(0,en.ff)("gray.300","gray.600"),h:"100%",flexDirection:"column",children:[(0,n.jsx)(f.k,{flex:1}),(0,n.jsx)(f.k,{h:10,py:4,alignItems:"center",children:(0,n.jsx)(es.W,{w:10})})]}),(0,n.jsx)(ed.Vp,{ref:r,"data-testid":"autocomplete-channels-input",cursor:l?"not-allowed":void 0,disabled:l,w:"100%",pl:5,wrapStyles:{px:2},fontSize:"md",placeholder:H.ag._({id:"KmCmUJ"}),transition:"width 1s ease-in-out",value:o,borderColor:w,onChange:e=>{let{target:i}=e,{value:t}=i;a(t),t||u([])}}),(0,n.jsx)(ed.Jm,{w:"100%",mt:0,display:o.length>0?"flex":"none","data-theme":I,children:C.length>0&&C.map(e=>{let{id:i,name:t,memberCount:s,isMember:l,members:r}=e;return(0,n.jsx)(ed.Gb,{"data-testid":"autocomplete-item-channel-".concat(i),value:{id:e.id},getValue:e=>e.id,align:"center",_focus:{bg:D},children:(0,n.jsxs)(Q.U,{spacing:4,p:0,flex:1,children:[(0,n.jsx)(d.xu,{color:"gray.700",children:(0,n.jsx)(y.G,{icon:k.Ty})}),(0,n.jsxs)(x.K,{spacing:0,flex:"1",children:[(0,n.jsx)(M.x,{children:t}),(0,n.jsx)(M.x,{fontSize:"sm",color:"gray.400",children:l?(0,n.jsx)(S.cC,{id:"tWPlLK",values:{0:s||0}}):(0,n.jsx)(S.cC,{id:"pkIIls",values:{0:s||0}})})]}),(0,n.jsx)(_.NL,{size:"xs",overflowTooltipLabel:H.ag._({id:"25VyZX"}),avatars:r||[],max:3,onClick:e=>{e.preventDefault(),e.stopPropagation()}})]})},i)})})]})]})})})};var ex=t(55478),ep=t(78071),em=t(7985),eg=t(38045),ej=t(99016),eC=t(23312),ev=t(80498),ef=t(62549),eb=t(10625),ey=t(67046),e_=t(99058),eS=t(44035),eA=t(39237),eE=t(27599),eI=t(25481);(s||(s={})).NoAccess="no_access";let eD={[E.y3$.Manage]:{title:()=>H.ag._({id:"DZfDCl"}),description:()=>H.ag._({id:"r59J7Q"})},[E.y3$.Edit]:{title:()=>H.ag._({id:"ePK91l"}),description:()=>H.ag._({id:"kuZsYI"})},[E.y3$.Comment]:{title:()=>H.ag._({id:"NBdIgR"}),description:()=>H.ag._({id:"IwFh5+"})},[E.y3$.View]:{title:()=>H.ag._({id:"jpctdh"}),description:()=>H.ag._({id:"yzFEXd"})},[s.NoAccess]:{title:()=>H.ag._({id:"oPoLg+"}),description:()=>H.ag._({id:"Vcif8/"})}},ek=e=>{let{isDisabled:i,options:t,disabledOptions:l=[],selected:r,variant:o="ghost",onClick:a=()=>{},onRemove:c}=e;return(0,n.jsxs)(eb.v,{closeOnSelect:!0,children:[(0,n.jsx)(ey.j,{"data-testid":"permission-menu-value-".concat(r),as:g.z,display:"flex",size:"sm",isDisabled:i,variant:o,rightIcon:(0,n.jsx)(y.G,{icon:b.ptq}),children:eD[r||s.NoAccess].title()}),(0,n.jsx)(e_.q,{textAlign:"left",zIndex:"overlay",children:(0,n.jsxs)(eS._,{defaultValue:r,value:r,title:H.ag._({id:"9cDpsw"}),type:"radio",onChange:e=>{a(e)},children:[t.map(e=>{let i=l.find(i=>i.permission===e),t=i&&i.reason;return(0,n.jsx)(eA.i,{isDisabled:!!i,value:e,alignItems:"start",pt:3,children:(0,n.jsx)(_.kH,{label:t,"aria-label":t,isDisabled:!i,placement:"top",children:(0,n.jsxs)(d.xu,{children:[(0,n.jsx)(M.x,{mt:-1,children:eD[e].title()}),(0,n.jsx)(M.x,{fontSize:"sm",color:"gray.500",mt:1,children:eD[e].description()})]})},e)},e)}),c&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eE.R,{}),(0,n.jsx)(eI.s,{color:"red.500",onClick:c,icon:(0,n.jsx)(y.G,{icon:b.XAH,fixedWidth:!0}),children:(0,n.jsx)(S.cC,{id:"t/YqKh"})})]})]})})]})};var ew=t(4758);let eT=(0,eg.E)(d.xu),eP=(e,i,t)=>{if(!t)return e;let s=[...e],n=e.findIndex(e=>"email"in e&&e.email===t),l=i.find(e=>e.email===t);return -1!==n&&s.splice(n,1),[...s,l||{email:t}]},eO=(e,i)=>{let t=(0,ef.Hs)(i.map(e=>"displayName"in e?e.displayName:e.email),3);return e===E.y3$.Manage?H.ag._({id:"4bKxWq",values:{userNames:t,GAMMA_ARTIFACT_PROPER_NOUN:W.Yc,0:i.length}}):e===E.y3$.Edit?H.ag._({id:"3rbi6Y",values:{userNames:t,GAMMA_ARTIFACT_PROPER_NOUN:W.Yc,0:i.length}}):e===E.y3$.Comment?H.ag._({id:"uGWY40",values:{userNames:t,GAMMA_ARTIFACT_PROPER_NOUN:W.Yc,0:i.length}}):e===E.y3$.View?H.ag._({id:"p5IG6F",values:{userNames:t,GAMMA_ARTIFACT_PROPER_NOUN:W.Yc,0:i.length}}):H.ag._({id:"Ai1TAT",values:{userNames:t,GAMMA_ARTIFACT_PROPER_NOUN:W.Yc,0:i.length}})},eN=e=>{let{workspaceId:i,docId:t,user:s,existingDocCollaborators:l,existingInvitations:r,registerDoneFn:o,isDisabled:a}=e,c=(0,R.p)(),[u,h]=(0,A.useState)(!1),x=(0,A.useRef)(),p=(0,A.useRef)(null),[m,j]=(0,A.useState)(""),[C,v]=(0,A.useState)([]),[I,D]=(0,A.useState)(E.y3$.Manage),[k,w]=(0,A.useState)(new ev.B),[T,P]=(0,A.useState)([]),O=T.filter(e=>"email"in e),N=l.map(e=>e.user),{isOpen:L,onOpen:F,onClose:U}=(0,ex.q)({id:"unsentInvitationsModalDisclosure"}),[z,{loading:B,error:K}]=(0,E.qVw)();(0,Y.GJ)("Error inviting collaborators.",K);let V=(0,ej.j)(E.aAR),{data:W,loading:q}=(0,E.PGi)({variables:{query:m,workspaceId:i},skip:!m});(0,A.useEffect)(()=>
1{if(q||!W)return;let e=W.search.filter(Boolean);v(e)},[W,q]);let X=(0,A.useMemo)(()=>m?C.filter(e=>"User"===e.__typename&&e.id!==s.id&&!O.concat(N).find(i=>i.email===e.email)):[],[C,N,m,O,s.id]),Z=!!m&&!X.find(e=>e.email===m),J=I===E.y3$.Manage&&O.some(e=>!("__typename"in e&&"User"===e.__typename)),$=T.concat({email:m}).filter(e=>!("email"in e)||(0,em.G)(e.email||"")),ee=!!T.length,ei=!!$.length;(0,A.useEffect)(()=>{o(()=>()=>(ei?F():k.resolve(),k.promise))},[o,k,ei,F]);let et=(0,A.useCallback)(async e=>{h(!0),P(i=>e.reduce((e,i)=>eP(e,X,i.trim()),i));let t=(await Promise.all(e.map(e=>V({workspaceId:i,query:e}).then(i=>{var t;return null===(t=i.data)||void 0===t?void 0:t.search.find(i=>"User"===i.__typename&&i.email===e)})))).filter(Boolean);P(i=>e.reduce((e,i)=>eP(e,t,i.trim()),i)),h(!1)},[X,V,i]),ec=(0,A.useCallback)(async()=>{if(0===O.length)return;let e=eP(O,X,m.trim()).filter(e=>"email"in e&&(0,em.G)(e.email||"")),i=[...l,...e.map(e=>{if("id"in e)return{docId:t,user:e,guest:!1,permission:I,__typename:"DocCollaborator"}})].filter(e=>!!e),n=[...r,...e.map(e=>{if("id"in e)return;let i={id:"temp",docTitle:"temp-title",invitedBy:s,docId:t,email:e.email,permission:I,__typename:"DocInvitation"};return i})].filter(e=>!!e);return z({variables:{docId:t,collaborators:e.map(e=>{let i="id"in e?{userId:e.id}:{email:e.email};return{...i,permission:I}})},update:(e,i)=>{let{data:s}=i;e.writeFragment({id:"Doc:".concat(t),fragment:E.yAO,data:null==s?void 0:s.addCollaborators})},optimisticResponse:{addCollaborators:{id:t,collaborators:i,invitations:n}}}).then(()=>{let i=H.ag._({id:"Ka86rB",values:{0:e.length}}),t=eO(I,e);c({title:i,description:t,status:"success",duration:5e3,isClosable:!0,position:"top"})})},[z,t,m,I,X,O,l,r,c,s]),eu=(0,A.useCallback)(async()=>Promise.all([ec()]).then(()=>{var e;P([]),j(""),null===(e=x.current)||void 0===e||e.resetItems(!0),k.resolve(),w(new ev.B)}).catch(e=>{console.warn(e)}),[ec,k]),eh=a||B||u,eg=(0,en.ff)("gray.100","gray.700"),ef=(0,en.ff)("light","dark"),eb=(0,en.ff)("trueblue.50","whiteAlpha.100"),ey=(0,en.ff)("trueblue.100","whiteAlpha.200"),e_=(0,en.ff)("gray.200","gray.600");return(0,n.jsxs)(el.h,{w:"100%",mb:2,alignItems:"flex-start","data-testid":"sharepanel-search-bar",children:[(0,n.jsx)(d.xu,{flex:1,children:(0,n.jsxs)(er.B,{w:"100%",justifyContent:"center",zIndex:2,children:[(0,n.jsx)(f.k,{display:u?"flex":"none",position:"absolute",h:"100%",w:"100%",alignItems:"center",justifyContent:"center",bg:eg,zIndex:"overlay",opacity:.4,children:(0,n.jsx)(eo.$,{})}),(0,n.jsxs)(ed.Qc,{ref:x,values:T,maxSelections:100,maxSuggestions:20,creatable:!0,multiple:!0,freeSolo:!0,suggestWhenEmpty:!1,openOnFocus:!0,filter:(e,i)=>!O.find(e=>e.email===i),onSelectOption:e=>{let{item:i}=e,{type:t}=i.originalValue;"collaborator"===t&&P(e=>eP(e,X,i.value)),j("")},onTagRemoved:e=>{P(i=>[...i].filter(i=>"email"in i?i.email!==e:!("id"in i)||i.id!==e))},children:[(0,n.jsxs)(ea.Z,{pointerEvents:"none",color:(0,en.ff)("gray.300","gray.600"),h:"100%",flexDirection:"column",children:[(0,n.jsx)(f.k,{flex:1}),(0,n.jsx)(f.k,{h:10,py:4,alignItems:"center",children:(0,n.jsx)(es.W,{w:10})})]}),(0,n.jsx)(ed.Vp,{ref:p,"data-testid":"autocomplete-collaborators-input",cursor:eh?"not-allowed":void 0,disabled:eh,w:"100%",pl:5,wrapStyles:{px:2},fontSize:"md",placeholder:H.ag._({id:"P8H57Z"}),transition:"width 1s ease-in-out",value:m,borderColor:e_,onKeyDown:e=>{let{key:i}=e;if("Backspace"===i&&0===m.length&&T.length>0){let e=T.slice(-1).pop();if(e){var t;null===(t=x.current)||void 0===t||t.removeItem("email"in e?e.email:e.id)}}},onPaste:e=>{e.preventDefault(),e.stopPropagation();let i=e.clipboardData.getData("Text"),t=i.trim().split(/[,|;\s]+/);et(t),j(""),v([])},onChange:e=>{let{target:i}=e,{value:t}=i;j(t),t||v([])},children:T.map((e,i)=>(0,n.jsx)(ew.L,{idx:i,selectedCollaborator:e,handleRemoveClick:()=>{var i;null===(i=x.current)||void 0===i||i.removeItem(e.email)}},"id"in e?e.id:e.email))}),(0,n.jsx)(ed.Jm,{w:"100%",mt:0,display:m.length>0?"flex":"none","data-theme":ef,children:X.map(e=>{let{id:i,email:t,displayName:s,profileImageUrl:l}=e;return(0,n.jsx)(ed.Gb,{fixed:!0,"data-testid":"autocomplete-item-user-".concat(i),value:{email:t,type:"collaborator"},getValue:e=>e.email,align:"center",_focus:{bg:eb},children:(0,n.jsxs)(Q.U,{children:[(0,n.jsx)(G.q,{size:"sm",name:s,src:l}),(0,n.jsxs)(d.xu,{children:[(0,n.jsx)(M.x,{textTransform:"capitalize",children:s}),(0,n.jsx)(M.x,{fontSize:"xs",color:"gray.500",children:null==t?void 0:t.toLowerCase()})]})]})},i)}).concat((0,n.jsx)(ed.Gb,{value:{email:m,type:"collaborator"},align:"center",display:Z?"flex":"none",_focus:{bg:eb},children:(0,n.jsxs)(Q.U,{children:[(0,n.jsx)(d.Cd,{bg:ey,size:8,children:(0,n.jsx)(y.G,{icon:b.FU$})}),(0,n.jsx)(M.x,{size:"md",children:m})]})},m))})]}),(0,n.jsx)(ep.p,{in:ee,unmountOnExit:!0,children:(0,n.jsx)(ea.x,{w:"auto",justifyContent:"flex-end",pr:1,children:(0,n.jsx)(ek,{isDisabled:B,options:[E.y3$.Manage,E.y3$.Edit,E.y3$.Comment,E.y3$.View],variant:"ghost",selected:I,onClick:e=>D(e)})})})]})}),(0,n.jsx)(eT,{overflowX:"hidden",mr:-2,transition:"slow",animate:{maxWidth:ee?"200px":"0px"},children:(0,n.jsx)(_.kH,{label:(0,n.jsx)(S.cC,{id:"Rxin92"}),"aria-label":H.ag._({id:"Rxin92"}),isDisabled:!J,placement:"top",children:(0,n.jsx)(d.xu,{children:(0,n.jsx)(g.z,{variant:"solid",onClick:eu,isDisabled:!ei||J,isLoading:B,"data-testid":"add-selected-items",children:(0,n.jsx)(S.cC,{id:"m16xKo"})})})})}
1),(0,n.jsx)(eC.C,{invitationCount:$.length,onDiscardClick:()=>{U(),k.resolve(),w(new ev.B)},onSendInvitationsClick:()=>{U(),eu()},onClose:()=>{U(),k.reject(),w(new ev.B)},isOpen:L})]})},eL=e=>{let{title:i,subtitle:t,img:s,isDisabled:l=!1,disabledText:r,tooltipText:o,testId:a,infoIcon:c,permissionsControl:u,workspaceGuestInvite:h}=e,x="string"==typeof t?(0,n.jsx)(M.x,{fontSize:"xs",color:"gray.500",children:t}):t,p=(0,n.jsx)(_.kH,{isDisabled:!o,label:o,placement:"top",children:(0,n.jsx)(d.xu,{children:u})});return(0,n.jsxs)(Q.U,{w:"100%",justify:"space-between",py:2,"data-testid":"permission-settings-row".concat(a?"-"+a:""),children:[(0,n.jsx)(d.xu,{children:(0,n.jsxs)(f.k,{alignItems:"center",children:[s,(0,n.jsxs)(d.xu,{ml:3,children:[(0,n.jsx)(M.x,{children:i}),(0,n.jsxs)(f.k,{align:"center",children:[h&&h,x&&x]})]})]})}),(0,n.jsx)(d.xu,{children:(0,n.jsx)(_.kH,{isDisabled:!o,label:(0,n.jsx)(M.x,{children:o}),placement:"top",children:l?(0,n.jsx)(M.x,{size:"sm",color:"gray.500","data-testid":"permission-controls-disabled-".concat(a),children:r}):c?(0,n.jsxs)(Q.U,{children:[c,p]}):p})})]})};var eR=t(17993);let eM=e=>{let{children:i,showDivider:t=!0,isDark:s=!1,...l}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eR.g,{spacing:1,align:"stretch",py:4,...l,children:i}),t&&(0,n.jsx)(u.i,{borderColor:s?"gray.700":"gray.200"})]})};var eF=t(43679),eU=t(34071),ez=t(39429),eB=t(46164),eG=t(47154),eH=t(48394);let eK=e=>{let{email:i,name:t,workspaceName:s,workspaceId:l}=e,[r]=(0,E.f4M)(),[o,a]=(0,A.useState)(!1),d=(0,R.p)();return(0,n.jsx)(eF.J,{closeOnBlur:!0,children:e=>{let{onClose:c}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eU.x,{children:(0,n.jsx)(g.z,{leftIcon:(0,n.jsx)(y.G,{icon:b.Gg}),size:"xs",colorScheme:"gray",mr:1,px:2,h:"auto",py:1,children:(0,n.jsx)(S.cC,{id:"O1wAlQ"})})}),(0,n.jsxs)(ez.y,{bg:"white",children:[(0,n.jsx)(eB.Q,{}),(0,n.jsx)(eG.Y,{fontWeight:"bold",children:(0,n.jsx)(S.cC,{id:"XYV7FR"})}),(0,n.jsxs)(eH.b,{children:[(0,n.jsx)(M.x,{fontSize:"sm",children:(0,n.jsx)(S.cC,{id:"hJZ5XP",values:{name:t,workspaceName:s,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:W.aq}})}),(0,n.jsx)(g.z,{isDisabled:o,w:"100%",mt:2,onClick:()=>{l&&i&&(a(!0),r({variables:{workspaceId:l,invitees:[{email:i}]}}).then(()=>{d({title:H.ag._({id:"oNCcm2"}),status:"success",duration:5e3,isClosable:!0,position:"top"})}).catch(e=>{console.error(e),d({title:H.ag._({id:"h37zlR",values:{0:e.message}}),status:"error",isClosable:!0,position:"top"})}).finally(()=>{a(!1),c()}))},children:(0,n.jsx)(S.cC,{id:"qVqqmP"})})]})]})]})}})},eV=(e,i)=>{var t,s;let n="DocCollaborator"===e.__typename?null===(t=e.user.displayName)||void 0===t?void 0:t.toUpperCase():"DocInvitation"===e.__typename?e.email.toUpperCase():"",l="DocCollaborator"===i.__typename?null===(s=i.user.displayName)||void 0===s?void 0:s.toUpperCase():"DocInvitation"===i.__typename?i.email.toUpperCase():"";return!l||n&&n<l?-1:!n||l&&n>l?1:0},eW=(e,i)=>{if(e.permission!==i.permission){if("manage"===e.permission)return -1;if("manage"===i.permission)return 1}return eV(e,i)},eq=e=>{var i,t;let{workspaceId:l,isFromOtherOrg:r,doc:o,user:a,setVerifySearchDone:c,canManage:u,isDark:h=!1}=e,x=(0,R.p)(),[p,m]=(0,X.I)(Z.H.hasDismissedDocWorkspaceNotice,!1),{isConnected:g}=(0,E.$gs)(),[j,{error:C}]=(0,E.qVw)(),[v,{error:f}]=(0,E.mrc)();(0,Y.GJ)("Error updating collaborator.",C),(0,Y.GJ)("Error removing collaborator.",f);let[A]=(0,E.rIg)(),I=u&&g,D=!r,k=(D&&(p||!o||o.orgAccess),!!(!(null==o?void 0:o.orgAccess)&&(null==o?void 0:o.channels)&&(null==o?void 0:o.channels.length)>0&&(null==o?void 0:o.channels.every(e=>V()(e.permission))))),T=(null==o?void 0:o.orgAccess)==null&&(null==o?void 0:o.publicAccess)==E.y3$.View,P=(0,w.qw)(o),O=(null==o?void 0:o.collaborators)||[],N=(null==o?void 0:o.invitations)||[],L=O.filter(e=>e.permission===E.y3$.Manage).length,U=[...O,...N].sort(eW),K=e=>()=>{let i="updated"===e?H.ag._({id:"Xpw8aE"}):H.ag._({id:"jwO7L7"});x({title:i,status:"success",duration:5e3,isClosable:!0,position:"top"})},Q=o.orgAccess?o.orgAccess:s.NoAccess,J=Q!==s.NoAccess;return(0,n.jsxs)(n.Fragment,{children:[I&&(0,n.jsx)(eN,{workspaceId:l,docId:o.id,user:a,existingDocCollaborators:O,existingInvitations:N,registerDoneFn:c,isDisabled:!u}),(0,n.jsx)(q.V,{label:(0,n.jsx)(S.cC,{id:"i5bpoc"}),isConnected:g,mb:4}),(0,n.jsx)(M.x,{fontSize:"sm",color:"gray.600",pt:2,children:P}),(0,n.jsxs)(eM,{isDark:h,children:[!1,(0,n.jsx)(eL,{testId:"workspace",title:(0,n.jsx)(S.cC,{id:"wtxjAY"}),subtitle:J?H.ag._({id:"aC87LX",values:{0:null==o?void 0:null===(i=o.organization)||void 0===i?void 0:i.name}}):"",img:(0,n.jsx)(ei,{icon:b.P88,showDisabled:!J}),isDisabled:!I,disabledText:eD[Q].title(),infoIcon:T?(0,n.jsx)(_.kH,{label:(0,n.jsx)(S.cC,{id:"paaewf",values:{GAMMA_ARTIFACT_PROPER_NOUN:W.Yc}}),placement:"top",children:(0,n.jsx)(d.xu,{color:"yellow.500",children:(0,n.jsx)(y.G,{icon:b.DBf})})}):void 0,permissionsControl:(0,n.jsx)(ek,{isDisabled:!I,selected:Q,options:[E.y3$.Manage,E.y3$.Edit,E.y3$.Comment,E.y3$.View,s.NoAccess],onClick:e=>{let i={id:o.id,orgAccess:e===s.NoAccess?null:e};A({variables:i,optimisticResponse:{updateDoc:{...i,__typename:"Doc"}},refetchQueries:["GetDocs"]}).then(K(e===s.NoAccess?"removed":"updated"))}})}),D&&(null===(t=o.channels)||void 0===t?void 0:t.map(e=>(0,n.jsx)(et,{channel:e,doc:o,isDisabled:!g,showDisabledIcon:k},e.id))),!!o.orgAccess&&D&&!o.site&&!k&&(0,n.jsx)(d.xu,{w:"100%",mt:2,children:(0,n.jsx)(eh,{existingChannels:o.channels,workspaceId:l,docId:o.id,isDisabled:!g})}),(0,n.jsx)(F.U,{in:D&&k,children:(0,n.jsxs)(z.b,{status:"warning",children:[(0,n.jsx)(B.z,{}),(0,n.jsx)(S.cC,{id:"RZRM4l",values:{GAMMA_ARTIFACT_PROPER_NOUN:W.Yc}})]})})]}),U&&(0,n.jsx)(eM,{showDivider:!1,isDark:h,children:U.map(e=>{let i=e.permission===E.y3$.Manage&&L<2,t=!I||i,s=i?H.ag._({id:"0q0LJR"}):void 0,r=eD[e.permission].title();if("DocCollaborator"===e.__typename){var c;let i=e.user;return(0,n.jsx)(eL,{testId:i.email,title:"".concat(i.displayName," ").concat(i.id===a.id?H.ag._({id:"dDUgzP"}):""),img:(0,n.jsx)(G.q,{name:i.displayName,src:i.profileImageUrl,size:"sm"}),subtitle:t?void 0:i.email,isDisabled:t,disabledText:r,tooltipText:s,workspaceGuestInvite:!t&&e.guest?(0,n.jsx)(eK,{name:i.displayName,workspaceName:null===(c=o.organization)||void 0===c?void 0:c.name,workspaceId:l,email:e.user.email}):void 0,permissionsControl:(0,n.jsx)(ek,{isDisabled:t,selected:e.permission,options:[E.y3$.Manage,E.y3$.Edit,E.y3$.Comment,E.y3$.View],disabledOptions:e.guest?[{permission:E.y3$.Manage,reason:H.ag._({id:"Rxin92"})}]:[],onClick:e=>{let t={docId:o.id,collaborators:[{userId:i.id,permission:e}]};j({variables:t,optimisticResponse:{addCollaborators:{id:t.docId,collaborators:O.map(t=>({...t,permission:t.user.id===i.id?e:t.permission})),invitations:N,__typename:"Doc"}}}).then(K("updated")).catch(()=>{})},onRemove:()=>{let e={docId:o.id,collaborators:[{userId:i.id}]};v({variables:e,optimisticResponse:{removeCollaborators:{id:e.docId,collaborators:O.filter(e=>e.user.id!==i.id),invitations:N,__typename:"Doc"}}}).then(K("removed"))}})},i.id)}return"DocInvitation"===e.__typename?(0,n.jsx)(eL,{testId:e.email,title:e.email,subtitle:H.ag._({id:"MActeE"}),img:(0,n.jsx)(d.Cd,{bg:"trueblue.50",size:8,children:(0,n.jsx)(y.G,{icon:b.FU$,size:"sm"})}),isDisabled:t,disabledText:r,permissionsControl:(0,n.jsx)(ek,{selected:e.permission,options:[E.y3$.Manage,E.y3$.Edit,E.y3$.Comment,E.y3$.View],disabledOptions:[{permission:E.y3$.Manage,reason:H.ag._({id:"Rxin92"})}],onClick:i=>{let t={docId:o.id,collaborators:[{email:e.email,permission:i}]};j({variables:t,optimisticResponse:{addCollaborators:{id:t.docId,invitations:N.map(t=>({...t,permission:t.email===e.email?i:t.permission})),collaborators:O,__typename:"Doc"}}}).then(K("updated")).catch(()=>{console.warn("Error updating permission")})},onRemove:()=>{let i={docId:o.id,collaborators:[{email:e.email}]};v({variables:i,optimisticResponse:{removeCollaborators:{id:i.docId,invitations:N.filter(i=>i.email!==e.email),collaborators:O,__typename:"Doc"}}}).then(K("removed"))}})},e.email):null})})]})};var eY=t(11050),eX=t(26284),eZ=t(29494),eQ=t(84405);let eJ="embed-copied-toast",e$=e=>{let{embedCode:i,isDisabled:t,docId:s}=e,l=(0,R.p)(),[r,o]=(0,A.useState)(!1),{hasCopied:a,onCopy:d}=(0,eX.V)(i),c=(0,A.useRef)(null);(0,A.useEffect)(()=>{c.current&&r&&(c.current.focus(),c.current.select())},[r]);let u=(0,A.useCallback)(()=>o(!0),[]),h=(0,A.useCallback)(()=>o(!1),[]),x=(0,A.useCallback)(()=>{d(),l.isActive(eJ)||l({id:eJ,title:(0,n.jsx)(S.cC,{id:"ETv+Uw"}),status:"success",duration:5e3}),(0,eQ.J)({docId:s,source:"sharePanel",type:"embed"})},[s,d,l]);return(0,n.jsxs)(eR.g,{spacing:4,align:"stretch",children:[(0,n.jsx)(eZ.g,{ref:c,rows:5,variant:"filled",fontFamily:"mono",colorScheme:"gray",disabled:t,onClick:u,onBlur:h,isReadOnly:!0,resize:"none",pointerEvents:t?"none":void 0,children:i}),(0,n.jsx)(g.z,{alignSelf:"flex-end",onClick:x,isDisabled:t,size:"sm",...t?{op
1acity:"1 !important",color:"gray.400",_hover:{opacity:"1"},_active:{boxShadow:"0 none"}}:{},children:a?(0,n.jsx)(S.cC,{id:"6V3Ea3"}):(0,n.jsx)(S.cC,{id:"Sx4kHi"})})]})};var e0=t(60536);let e1=e=>{let{doc:i,onSharePanelOpen:t,onSharePanelClose:s}=e,l=(0,A.useMemo)(()=>(0,ee.lT)({docId:i.id,docTitle:i.title}),[i.id,i.title]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(M.x,{fontSize:"sm",color:"gray.600",pt:2,pb:2,children:(0,n.jsx)(S.cC,{id:"2QJhbq",values:{GAMMA_ARTIFACT_PROPER_NOUN:W.Yc}})}),(0,n.jsx)(d.xu,{pb:4,children:(0,n.jsx)(e$,{embedCode:l,docId:i.id,isDisabled:!1})}),(0,n.jsx)(e0.V,{onClose:s,onOpen:t,segmentEvent:eY.AA.GAMMA_PRO_UPSELL_SHARE_SETTINGS_REMOVE_WATERMARK,doc:i})]})};var e2=t(91994),e5=t(25566),e3=t(75652),e4=t.n(e3),e6=t(14274),e9=t(47968);let e7=(e,i)=>"".concat(e6.v.API_HOST||"","/export/docs/").concat(e,"/").concat(i),e8=async(e,i,t)=>{let s=e7(e,t);return fetch(s,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","share-token":e6.v.SHARE_TOKEN||""},body:JSON.stringify({docContent:i})})},ie=function(e,i,t){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"pdf",l=(0,R.p)(),r=(0,A.useRef)(null),o=(0,eY.z$)(),[a,d]=(0,A.useState)(!1),c=(0,A.useCallback)(()=>{r.current=l({id:"export-toast-".concat(e.id,"-").concat(s),isClosable:!1,position:"top",duration:null,status:"loading",variant:"light",title:(0,n.jsx)(S.cC,{id:"N/fNtX",values:{format:s}})})},[null==e?void 0:e.id,l,s]),u=(0,A.useCallback)(()=>{r.current&&l.update(r.current,{status:"loading",variant:"light",title:(0,n.jsx)(S.cC,{id:"eJOEBy"}),description:(0,n.jsx)(S.cC,{id:"vMANwD"}),isClosable:!0})},[l,s]),h=(0,A.useCallback)(()=>{r.current&&l.update(r.current,{title:(0,n.jsx)(S.cC,{id:"walT1X"}),status:"error",duration:null,isClosable:!0})},[l]),x=(0,A.useCallback)(e=>{r.current&&l.update(r.current,{status:"success",title:(0,n.jsx)(S.cC,{id:"pK8dQg"}),description:(0,n.jsx)(M.x,{children:(0,n.jsx)(S.cC,{id:"MTtTC2",components:{0:(0,n.jsx)(J.r,{textDecoration:"underline",target:"_blank",href:e||void 0,onClick:()=>r.current&&l.close(r.current)})}})}),isClosable:!0})},[l,s]),p=(0,A.useCallback)(()=>{let n=null==t?void 0:t.getJSON();d(!0),c();let l=setTimeout(u,3e4);e8(e.id,n,s).then(async t=>{var n;let l=await t.blob();if(!t.ok)throw Error("Export failed.");let r="pdf"===s?eY.AA.PDF_EXPORTED:eY.AA.PPTX_EXPORTED;null==o||o.track(r,{doc_id:e.id,source:i}),x(decodeURIComponent(t.headers.get("x-gamma-download-url")||"")||void 0);let a=window.URL.createObjectURL(l),d=document.createElement("a"),c=decodeURIComponent((null===(n=(t.headers.get("Content-Disposition")||"").split(";").find(e=>e.includes("filename=")))||void 0===n?void 0:n.replace("filename=","").trim())||"".concat(e.id,".").concat(s));d.download=c,d.href=a,d.style.display="none",document.body.appendChild(d),d.click(),d.remove()}).catch(()=>{h()}).finally(()=>{d(!1),clearTimeout(l)})},[o,null==e?void 0:e.id,t,i,s,h,c,u,x]);return{handleExport:p,exportInProgress:a}},ii=e=>{let i=(0,e2.CG)(e9.Pu),t=e.theme||i,s=(0,A.useMemo)(()=>{let e=t.fonts?[...t.fonts]:[];return e.length<2&&e.push({id:"Inter",name:"Inter",url:"https://fonts.googleapis.com/css2?family=Inter"}),e4()(e).map(e=>{var i;return(null===(i=e.url)||void 0===i?void 0:i.includes("fonts.googleapis.com"))?{name:e.name,url:"https://fonts.google.com/specimen/".concat(e.name)}:{name:e.name}}).filter(e=>!!e)},[t]);return s};var it=t(69747),is=t(68727);let il=e=>{let{doc:i,editor:t,onSharePanelOpen:s,onSharePanelClose:l,isMultipage:r=!1}=e,o=(0,e2.CG)(e9.Pu),a=o.config.headingGradient,d=(0,N.py)("edit",i);return(0,n.jsxs)(eR.g,{spacing:4,align:"start",pt:2,children:[(0,n.jsx)(M.x,{fontSize:"sm",color:"gray.600",children:r?(0,n.jsx)(S.cC,{id:"QI+Cf0",values:{0:i.title},components:{0:(0,n.jsx)("strong",{})}}):(0,n.jsx)(S.cC,{id:"qwhOQ/",values:{GAMMA_ARTIFACT_PROPER_NOUN:W.Yc}})}),(0,n.jsxs)(x.K,{spacing:2,width:"100%",children:[(0,n.jsx)(ia,{format:"pdf",label:"PDF",icon:b.gSj,accentColor:"red",doc:i,editor:t}),(0,n.jsx)(ia,{format:"pptx",label:"PowerPoint",icon:b.WOY,accentColor:"orange",doc:i,editor:t})]}),(0,n.jsxs)(x.K,{spacing:"2",w:"100%",children:[a&&(0,n.jsx)(ir,{}),(0,n.jsx)(io,{doc:i})]}),t&&d&&(0,n.jsx)(M.x,{fontSize:"sm",color:"gray.600",children:(0,n.jsx)(S.cC,{id:"8LhjM/",components:{0:(0,n.jsx)(g.z,{variant:"link",as:"span",size:"sm",cursor:"pointer",onClick:()=>{l(),it.pw.emit(it.TI.OPEN_PAGE_SETUP,"cards")}})}})}),(0,n.jsx)(e0.V,{onClose:l,onOpen:s,segmentEvent:e5.AA.GAMMA_PRO_UPSELL_EXPORT_SETTINGS_REMOVE_WATERMARK,doc:i})]})},ir=()=>{let e=(0,en.ff)("gray.100","gray.800");return(0,n.jsxs)(z.b,{status:"info",bg:e,children:[(0,n.jsx)(B.z,{color:"gray.400",boxSize:"4",mt:"1",mr:"2.5"}),(0,n.jsx)(S.cC,{id:"lgULOV",values:{GAMMA_ARTIFACT_PROPER_NOUN:W.Yc}})]})},io=e=>{let{doc:i}=e,t=ii(i),s=(0,en.ff)("gray.200","gray.700"),l=(0,en.ff)("gray.100","gray.800"),r=(0,en.ff)("white","gray.800"),o=(0,en.ff)("trueblue.400","trueblue.200"),a=(0,en.ff)("trueblue.300","trueblue.200");return t.length?(0,n.jsxs)(z.b,{status:"info",bg:l,children:[(0,n.jsx)(B.z,{color:"gray.400",boxSize:"4",mt:"1",mr:"2.5"}),(0,n.jsxs)(x.K,{children:[(0,n.jsx)(M.x,{fontSize:"sm",children:(0,n.jsx)(S.cC,{id:"5qYpE7"})}),(0,n.jsx)(Q.U,{children:t.map(e=>{let{name:i,url:t}=e;return(0,n.jsx)(d.xu,{border:"1px",borderColor:s,borderRadius:"md",bg:r,h:"auto",_hover:t?{boxShadow:"var(--chakra-shadows-md)",borderColor:a,color:o}:{},transitionProperty:"common",transitionDuration:"normal",onClick:t?()=>window.open(t,"_blank"):void 0,cursor:t?"pointer":void 0,children:(0,n.jsxs)(Q.U,{p:3,paddingRight:4,spacing:4,children:[(0,n.jsx)(M.x,{fontWeight:"medium",children:i}),t&&(0,n.jsx)(y.G,{icon:b.wlW,size:"1x"})]})},"name")})})]})]}):null},ia=e=>{let{format:i,doc:t,editor:s,icon:l,accentColor:r,label:o,badge:a}=e,{handleExport:d,exportInProgress:c}=ie(t,"share_panel",s,i);return(0,n.jsx)(is.j,{onClick:d,icon:l,formatLabel:o,accentColor:r,exportInProgress:c,exportInProgressNote:(0,n.jsx)(S.cC,{id:"57bp6s"}),badge:a})};var id=t(49259),ic=t(87436),iu=t(95897),ih=t(89511),ix=t(11121),ip=t(54933),im=t(21979),ig=t(42111),ij=t(16893);let iC=e=>{let{subtitle:i,tooltipLabel:t,ariaLabel:s,icon:l}=e;return(0,n.jsxs)(Q.U,{spacing:1,align:"center",children:[(0,n.jsx)(M.x,{fontSize:"xs",color:"gray.500",children:i}),(0,n.jsx)(_.kH,{label:t,placement:"top","aria-label":s,children:(0,n.jsx)(d.xu,{color:"gray.500",lineHeight:"1",children:(0,n.jsx)(y.G,{size:"xs",icon:l})})})]})};var iv=t(41098),ib=t(85573),iy=t(81640);let i_=e=>{var i;let{onClose:t,onOpen:s,accessLinkEnabled:l,doc:r,isDark:o,segmentEvent:a}=e,d=(0,R.p)(),{subscription:c,product:u,openUpsellModal:h}=(0,iy.z)(),[p,{data:m}]=(0,E.deZ)(),[v,f]=(0,A.useState)(""),[b,{loading:y}]=(0,E.DFf)(),[I]=(0,E.pi3)(),D=c&&"pro"===u,k=(null==r?void 0:null===(i=r.accessLinks)||void 0===i?void 0:i[0].type)==="password",[w,T]=(0,A.useState)(k);(0,A.useEffect)(()=>{k&&p({variables:{docId:r.id},fetchPolicy:"network-only",nextFetchPolicy:"network-only"}).then(e=>{let{data:i}=e;f((null==i?void 0:i.getDocPassword)||"")})},[r,k,p,f]);let P=null==m?void 0:m.getDocPassword,O=k||w,N=(0,A.useCallback)(e=>{l&&(D?(T(e.target.checked),e.target.checked||(I({variables:{docId:r.id}}).then(()=>{d({title:(0,n.jsx)(S.cC,{id:"YZNij4"}),status:"success",duration:3e3,isClosable:!0,position:"top"})}),f(""))):(e.preventDefault(),h({onOpenCallback:t,onCloseCallback:s,segmentEvent:a})))},[l,r,D,h,s,t,I,a,d]),L=(0,A.useCallback)(()=>{b({variables:{docId:r.id,password:v},refetchQueries:["GetDocPassword"]}).then(()=>{d({title:(0,n.jsx)(S.cC,{id:"R10gKk"}),status:"success",duration:3e3,isClosable:!0,position:"top"})})},[r,v,b,d]);return(0,n.jsxs)(x.K,{w:"100%",children:[(0,n.jsxs)(Q.U,{mt:4,mb:2,children:[(0,n.jsxs)(Q.U,{children:[(0,n.jsx)(M.x,{children:(0,n.jsx)(S.cC,{id:"F5g7OG"})}),!D&&(0,n.jsx)(j.C,{colorScheme:"purple",variant:"solid",children:W.ML})]}),(0,n.jsx)(C.L,{}),(0,n.jsx)(_.kH,{label:l?"":(0,n.jsx)(S.cC,{id:"5JvE0U"}),placement:"top",children:(0,n.jsx)(iv.r,{isChecked:w,disabled:!l,onChange:N})})]}),(0,n.jsx)(F.U,{in:O,children:(0,n.jsxs)(Q.U,{children:[(0,n.jsx)(ib.I,{id:"password",type:"text",value:v,onCh
1ange:e=>f(e.currentTarget.value),onKeyUp:e=>{"Enter"===e.key&&L()},width:"50%",placeholder:H.ag._({id:"f7sXvi"}),bg:o?void 0:"white"}),(0,n.jsx)(g.z,{isDisabled:v===P,variant:"plain",onClick:L,isLoading:y,children:(0,n.jsx)(S.cC,{id:"tfDRzk"})})]})})]})},iS=()=>({view:{subtitle:H.ag._({id:"ihPQra"}),tooltip:(0,k.tN)()},comment:{subtitle:H.ag._({id:"qPZYdC"}),tooltip:H.ag._({id:"oKPro/",values:{0:(0,k.tN)()}})},edit:{subtitle:H.ag._({id:"TVFcVE"}),tooltip:H.ag._({id:"2gPY9r",values:{0:(0,k.tN)()}})}}),iA=e=>{var i;let{doc:t,isConnected:l,onSharePanelOpen:r,onSharePanelClose:o,canManage:a,isDark:c}=e,u=(0,R.p)(),h=(0,ij.A)(iS),x=(0,ig.ye)("passwordProtectedDoc")&&a,p=null==t?void 0:null===(i=t.accessLinks)||void 0===i?void 0:i[0],[m,g]=(0,A.useState)(!1),[j]=(0,E.kTH)(),C=(null==p?void 0:p.permission)?null==p?void 0:p.permission:s.NoAccess,v=C===s.NoAccess,_=(null==p?void 0:p.token)==="",I=p&&p.permission!==E.y3$.View,D=e=>()=>{let i="updated"===e?H.ag._({id:"Xpw8aE"}):H.ag._({id:"jwO7L7"});u({title:i,status:"success",duration:5e3,isClosable:!0,position:"top"})},k=(0,A.useMemo)(()=>(0,ee.Gn)({docTitle:null==t?void 0:t.title,docId:null==t?void 0:t.id,token:null==p?void 0:p.token,absolute:!0}),[t,null==p?void 0:p.token]),w=(0,n.jsx)(e0.V,{onClose:o,onOpen:r,segmentEvent:eY.AA.GAMMA_PRO_UPSELL_SHARE_SETTINGS_REMOVE_WATERMARK,doc:t});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eM,{showDivider:!1,children:a&&(0,n.jsxs)(eM,{showDivider:!1,children:[(0,n.jsx)(eL,{title:(0,n.jsx)(S.cC,{id:"qZu20V"}),subtitle:v?H.ag._({id:"vMZPZT"}):(0,n.jsx)(iC,{subtitle:h[C].subtitle,tooltipLabel:h[C].tooltip,ariaLabel:h[C].subtitle,icon:b.DBf}),img:(0,n.jsx)(ei,{icon:b.nNP,showDisabled:v}),isDisabled:!(a&&l),disabledText:eD[s.NoAccess].title(),permissionsControl:(0,n.jsx)(ek,{selected:C,options:[E.y3$.Edit,E.y3$.Comment,E.y3$.View,s.NoAccess],onClick:e=>{let i=null==p?void 0:p.id,n={id:t.id,accessLinks:e===s.NoAccess?[{permission:null}]:[{permission:e}]};j({variables:n,optimisticResponse:{updateDoc:{...n,accessLinks:[{__typename:"AccessLink",id:i||"temp-id",permission:e===s.NoAccess?null:e}],__typename:"Doc"}}}).then(D(e===s.NoAccess?"removed":"updated"))}})}),(0,n.jsxs)(F.U,{animateOpacity:!0,in:!!(null==p?void 0:p.permission),children:[(0,n.jsx)(im.I,{url:k,customLabel:H.ag._({id:"y1eoq1"}),onClick:()=>{(0,eQ.J)({docId:t.id,source:"sharePanel",type:"tokenUrl"})}}),!_&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F.U,{in:m,unmountOnExit:!0,children:(0,n.jsxs)(eR.g,{mt:3,align:"stretch",spacing:4,bg:"gray.50",p:6,borderRadius:"md",children:[(0,n.jsxs)(Q.U,{spacing:4,align:"center",children:[(0,n.jsx)(d.xu,{color:"purple.600",children:(0,n.jsx)(y.G,{fixedWidth:!0,icon:ip._1N})}),(0,n.jsx)(M.x,{fontSize:"sm",children:(0,n.jsx)(S.cC,{id:"asiJbp"})})]}),(0,n.jsxs)(Q.U,{spacing:4,align:"center",children:[(0,n.jsx)(d.xu,{color:"purple.600",children:(0,n.jsx)(y.G,{fixedWidth:!0,icon:ip.Mdf})}),(0,n.jsx)(M.x,{fontSize:"sm",display:"inline-block",children:(0,n.jsx)(S.cC,{id:"+g8rkW",values:{GAMMA_ARTIFACT_PROPER_NOUN:W.Yc,GAMMA_PROPER_NOUN:W.N6}})})]}),I&&(0,n.jsxs)(Q.U,{spacing:4,align:"center",children:[(0,n.jsx)(d.xu,{color:"purple.600",children:(0,n.jsx)(y.G,{fixedWidth:!0,icon:ip.FKd})}),(0,n.jsx)(M.x,{fontSize:"sm",children:(0,n.jsx)(S.cC,{id:"NSCwrX",values:{GAMMA_PROPER_NOUN:W.N6,selectedAccessLinkPermission:C},components:{0:(0,n.jsx)(M.x,{as:"span",fontWeight:"bold"})}})})]})]})}),(0,n.jsx)(f.k,{justify:"center",alignItems:"center",my:3,children:(0,n.jsxs)(Q.U,{spacing:1,as:"button",onClick:()=>g(!m),children:[m?(0,n.jsx)(y.G,{fixedWidth:!0,size:"xs",icon:b.onQ}):(0,n.jsx)(y.G,{fixedWidth:!0,size:"xs",icon:b.r8p}),(0,n.jsx)(M.x,{lineHeight:"normal",marginLeft:"auto",marginRight:"auto",fontSize:"xs",fontWeight:"medium",children:m?(0,n.jsx)(S.cC,{id:"BRvU04"}):(0,n.jsx)(S.cC,{id:"l0Ck42"})})]})})]})]})]})}),x?(0,n.jsx)(id.U,{allowToggle:!0,bgColor:c?"gray.800":"gray.100",borderRadius:"md",borderColor:"transparent",children:(0,n.jsxs)(ic.Q,{children:[(0,n.jsxs)(iu.K,{children:[(0,n.jsx)(d.xu,{as:"span",flex:"1",textAlign:"left",fontWeight:"medium",children:(0,n.jsx)(S.cC,{id:"VNgKZz"})}),(0,n.jsx)(ih.X,{})]}),(0,n.jsxs)(ix.H,{children:[w,(0,n.jsx)(i_,{onClose:o,onOpen:r,segmentEvent:eY.AA.GAMMA_PRO_UPSELL_SHARE_SETTINGS_REMOVE_WATERMARK,doc:t,isDark:c,accessLinkEnabled:!v})]})]})}):w]})},iE=e=>{let{visibility:i,isFromOtherOrg:t}=e,s=(0,en.ff)("white","var(--chakra-colors-gray-900)");return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(y.G,{icon:b.Gg}),(0,n.jsxs)(d.xu,{as:"span",className:"fa-layers fa-fw",children:[(0,n.jsx)(y.G,{icon:i.primaryIcon}),i.secondaryIcon&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y.G,{icon:ip.diR,color:s,transform:"down-6 right-6"}),(0,n.jsx)(y.G,{icon:i.secondaryIcon,transform:"shrink-7 right-6 down-6"})]})]})]})},iI=e=>{var i;let{doc:t,editor:s,isSharePanelOpen:R,onSharePanelClose:M,onSharePanelOpen:F,onAnalyticsPanelOpen:U,view:z,setView:B,showAnalytics:G=!0,showSharePublic:H=!0,showEmbed:K=!0,showSiteSettings:V=!0}
1=e,W=(0,O.Yy)(),q=(0,D._O)(),{openSiteSettings:Y}=(0,L.AA)(),X=(0,A.useRef)(!1),{user:Z,currentWorkspace:Q}=(0,N.SE)(),{isConnected:J}=(0,E.$gs)(),$=(0,N.py)("manage",t),ee=(0,N.py)("comment",t),{isOpen:ei,onClose:et}=(0,I.M)({id:"create-site-modal"}),es=t&&t.site&&t.site.routes.length>1,en=t&&(0,P.Vr)(t.site),el=(0,k.ei)({showSharePublic:H&&$&&!en,showEmbed:K&&$&&!en}),er=$&&U&&t&&!en,[eo,ea]=(0,A.useState)(()=>()=>Promise.resolve()),ed=(0,A.useCallback)(()=>{M(),et()},[M,et]),ec=t?es?t.site.name:t.title:null,eu=(0,A.useCallback)(()=>{eo().then(()=>{B("invite"),M()},()=>{console.debug("[handleSharePanelClose] CollaboratorSearchBar rejected \uD83D\uDC4E\uD83C\uDFFC")})},[B,M,eo]),eh=(0,A.useCallback)(()=>{U&&(M(),U())},[U,M]),ex=(0,A.useCallback)(()=>{Y("domains"),M()},[M,Y]);if(!Z)return null;let ep=(0,w.h_)(t,Z),em=ep?(0,w.Xp)()[ep]:null,eg=(0,w.Gi)(t,Q);if(t&&null===em)return console.error("[SharePanel] Unknown VisibilityValue for doc",t),null;let ej=null==t?void 0:null===(i=t.organization)||void 0===i?void 0:i.id;!t||ej||X.current||(console.error("[SharePanelModal] Doc unexpectedly doesnt have a workspaceId",{docId:t.id,organization:t.organization}),X.current=!0);let eC=W?"gray.400":"gray.600",ev=W?"whiteAlpha.200":"trueblue.50",ef=W?"trueblue.200":"trueblue.500";return(0,n.jsxs)(_.Wk,{isDark:W,children:[(0,n.jsxs)(l.u_,{onEsc:eu,isOpen:R,onClose:M,trapFocus:!1,size:"3xl",returnFocusOnClose:!1,children:[(0,n.jsx)(r.Z,{}),(0,n.jsxs)(o.h,{color:W?"white":"gray.800",bg:W?"gray.900":"white","data-share-panel-modal-content":!0,mx:2,borderColor:W?"gray.700":"gray.200",children:[(0,n.jsxs)(a.x,{children:[em&&(0,n.jsx)(d.xu,{as:"span",mr:3,children:(0,n.jsx)(iE,{visibility:em,isFromOtherOrg:eg})}),ec?(0,n.jsx)(S.cC,{id:"sit2to",values:{displayName:ec}}):(0,n.jsx)(S.cC,{id:"Z8lGw6"})]}),(0,n.jsx)(c.o,{"data-share-panel-close-button":!0,onClick:e=>{e.preventDefault(),eu()}}),(0,n.jsx)(u.i,{}),t?(0,n.jsx)(h.f,{"data-testid":"share-panel-modal-body",children:t&&ej&&(0,n.jsxs)(n.Fragment,{children:[$&&(0,n.jsxs)(x.K,{direction:"row",children:[(0,n.jsx)(m.E,{my:4,children:el.map(e=>{let{viewKey:i,icon:t,ariaLabel:s,label:l,isBeta:r}=e,o=z===i;return(0,n.jsx)(m.U,{children:(0,n.jsx)(g.z,{leftIcon:(0,n.jsx)(y.G,{icon:t,"aria-label":s}),variant:"ghost",size:"sm",fontWeight:"600",bg:o?ev:"transparent",color:o?ef:eC,onClick:()=>B(i),rightIcon:r?(0,n.jsx)(j.C,{colorScheme:"green",children:(0,n.jsx)(S.cC,{id:"YBt9YP"})}):void 0,children:l})},i)})}),V&&!(null==t?void 0:t.site)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C.L,{}),(0,n.jsx)(g.z,{onClick:ex,variant:"plain",size:"sm",my:4,children:(0,n.jsx)(S.cC,{id:"wzvDe1"})})]})]}),(!ee||"invite"==z)&&(0,n.jsx)(eq,{workspaceId:ej,doc:t,user:Z,setVerifySearchDone:ea,canManage:$,isFromOtherOrg:eg,isMultipage:es,isDark:W}),$&&"public"===z&&(0,n.jsx)(iA,{doc:t,isConnected:J,onSharePanelOpen:F,onSharePanelClose:M,canManage:$,isDark:W}),$&&"embed"===z&&(0,n.jsx)(e1,{doc:t,onSharePanelOpen:F,onSharePanelClose:M}),ee&&"export"===z&&(0,n.jsx)(il,{doc:t,editor:s,onSharePanelOpen:F,onSharePanelClose:M,isMultipage:es})]})}):(0,n.jsx)(h.f,{pb:6,"data-testid":"share-panel-modal-body",children:(0,n.jsxs)(x.K,{children:[(0,n.jsx)(p.O,{height:"55px"}),(0,n.jsx)(p.O,{height:"55px"}),(0,n.jsx)(p.O,{height:"55px"}),(0,n.jsx)(p.O,{height:"55px"})]})}),(0,n.jsx)(u.i,{}),(0,n.jsx)(v.m,{children:(0,n.jsxs)(f.k,{justifyContent:"space-between",flex:1,children:[G&&er&&(0,n.jsx)(g.z,{isDisabled:!J,leftIcon:(0,n.jsx)(y.G,{icon:b.Ma4}),variant:"ghost",onClick:eh,children:(0,n.jsx)(S.cC,{id:"YaUqUV"})}),(0,n.jsx)(C.L,{}),(0,n.jsx)(g.z,{onClick:e=>{e.preventDefault(),eu()},variant:"solid",children:(0,n.jsx)(S.cC,{id:"DPfwMq"})})]})})]})]}),(null==t?void 0:t.id)&&q&&$&&(0,n.jsx)(T.M,{isOpen:ei,onClose:ed,existingDoc:t})]})}},91283:function(e,i,t){"use strict";t.d(i,{XG:function(){return s.XG},t9:function(){return s.t9},zx:function(){return w},bg:function(){return T}});var s=t(34613),n=t(52322),l=t(92850),r=t(26468),o=t(22226),a=t(54326),d=t(2338),c=t(97217),u=t(77533),h=t(28535),x=t(50250),p=t(75768),m=t(62614),g=t(55478),j=t(70065),C=t(42946),v=t(49929),f=t(5879),b=t(87254),y=t(1842),_=t.n(y),S=t(2784),A=t(93202),E=t(94199),I=t(36651),D=t(8174),k=t(16710);let w=e=>{var i;let{onClose:t,onSubmit:g,doc:j}=e,y=(0,I.py)("manage",j||void 0),{isConnected:_}
1=(0,A.$gs)(),[E,D]=(0,S.useState)(A.y3$.Manage);return j?(0,n.jsxs)(l.u_,{closeOnOverlayClick:!1,isOpen:!0,onClose:t,size:"lg",children:[(0,n.jsx)(r.Z,{}),(0,n.jsxs)(o.h,{"data-testid":"workspace-permissions-prompt",children:[(0,n.jsx)(a.x,{children:(0,n.jsx)(f.cC,{id:"JzTAyU",values:{0:j.title}})}),(0,n.jsx)(d.o,{}),(0,n.jsxs)(c.f,{children:[(0,n.jsx)(u.x,{mb:6,children:(0,n.jsx)(f.cC,{id:"wKPcxh"})}),(0,n.jsx)(s.o$,{testId:"workspace",title:(0,n.jsx)(f.cC,{id:"wtxjAY"}),subtitle:b.ag._({id:"aC87LX",values:{0:null==j?void 0:null===(i=j.organization)||void 0===i?void 0:i.name}}),isDisabled:!y||!_,img:(0,n.jsx)(h.Cd,{color:"gray.800",textAlign:"center",bg:"gray.200",size:"32px",children:(0,n.jsx)(v.G,{size:"1x",icon:C.P88})}),disabledText:s.Nj[E].title(),permissionsControl:(0,n.jsx)(s.t9,{selected:E,options:[A.y3$.Manage,A.y3$.Edit,A.y3$.Comment,A.y3$.View],onClick:e=>{D(e)}})})]}),(0,n.jsx)(x.m,{children:(0,n.jsxs)(p.h,{children:[(0,n.jsx)(m.z,{variant:"ghost",onClick:t,children:(0,n.jsx)(f.cC,{id:"dEgA5A"})}),(0,n.jsx)(m.z,{variant:"solid","data-testid":"workspace-permissions-submit",onClick:()=>{g(E),t()},children:(0,n.jsx)(f.cC,{id:"DPfwMq"})})]})})]})]}):(0,n.jsx)(n.Fragment,{})},T=()=>{let{onOpen:e,isOpen:i,onClose:t}=(0,g.q)({id:"workspacePermissionPromptDisclosure"}),[s]=(0,A.rIg)(),{currentWorkspace:n}=(0,I.SE)(),l=(0,j.p)(),{addDocChannel:r}=(0,D.Z)(),[o,a]=(0,S.useState)(null),[d,c]=(0,S.useState)(null),u=(0,I.we)(),h=(0,S.useCallback)((e,i)=>{let t=(e.channels||[]).find(e=>e.id===i.id),s=(0,k.Gi)(e,n),r=u.cannot("manage",e)&&_()(e.orgAccess);return s?(l({description:b.ag._({id:"doMS3L",values:{GAMMA_ARTIFACT_PROPER_NOUN:E.Yc}}),status:"warning",duration:5e3,isClosable:!0,position:"top"}),!1):r?(l({description:b.ag._({id:"81ZRAa",values:{GAMMA_ARTIFACT_PROPER_NOUN:E.Yc}}),status:"warning",duration:5e3,isClosable:!0,position:"top"}),!1):!t||(l({description:b.ag._({id:"FRsVHP",values:{GAMMA_ARTIFACT_PROPER_NOUN:E.Yc}}),status:"warning",duration:5e3,isClosable:!0,position:"top"}),!1)},[u,l,n]),x=(0,S.useCallback)(e=>{if(!o||!d)return;let{id:i}=o;s({variables:{id:i,orgAccess:e},optimisticResponse:{updateDoc:{id:i,orgAccess:e,__typename:"Doc"}}}).then(()=>{r({doc:o,channel:d,existingChannels:null==o?void 0:o.channels})}).catch(e=>{console.error("[useAddDocToChannel.updatedocOrgAccess] Error setting doc orgAccess for doc id",i),l({title:b.ag._({id:"SlfejT"}),description:b.ag._({id:"x9Wysy",values:{0:e.message}}),status:"error"})})},[r,o,d,l,s]),p=(0,S.useCallback)((i,t)=>{let s=h(i,t);s&&(i.orgAccess?r({doc:i,channel:t,existingChannels:(null==i?void 0:i.channels)||[]}):(a(i),c(t),e()))},[r,e,h]),m=(0,S.useCallback)(()=>{c(null),a(null),t()},[t]);return{isOpen:i,onClose:m,doc:o,handleAddDocToChannel:p,updateWorkspacePermissionThenAddToChannel:x}}},8174:function(e,i,t){"use strict";t.d(i,{Z:function(){return d}});var s=t(52322),n=t(70065),l=t(5879),r=t(2784),o=t(93202),a=t(94199);let d=()=>{let e=(0,n.p)(),[i]=(0,o.yx3)({refetchQueries:["GetChannelDocActivity","GetChannels"]}),t=(0,r.useCallback)(t=>{let{docId:n,doc:r,channel:d,existingChannels:c=[]}=t,u=n||(null==r?void 0:r.id);if(!u){console.error("Invalid docid");return}let h={input:{docId:u,sharing:[{op:o.Bdm.Add,path:"/channels",value:[{channelId:d.id}]}]}},x=(null==r?void 0:r.title)||a.Yc,p=[...c,{id:d.id,slug:d.slug,name:d.name,permission:o.y3$.Comment}].sort((e,i)=>e.slug.localeCompare(i.slug,"en"));i({variables:h,update:(e,i)=>{let{data:t}=i;e.writeFragment({id:"Doc:".concat(u),fragment:o.IiT,data:null==t?void 0:t.updatePublicChannels})},optimisticResponse:{updatePublicChannels:{id:h.input.docId,channels:p}}}).then(()=>{e({title:(0,s.jsx)(l.cC,{id:"7hDHpt",values:{title:x}}),description:(0,s.jsx)(l.cC,{id:"A2xcFn",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc,0:d.name}}),status:"success",duration:5e3,isClosable:!0,position:"top"})},i=>{e({title:(0,s.jsx)(l.cC,{id:"bLdU0Q",values:{title:x,0:d.name}}),description:i.message,duration:null,status:"error",isClosable:!0,position:"top"})})},[i,e]),d=(0,r.useCallback)((t,n)=>{var r;if(!n)return;let d={input:{docId:t.id,sharing:[{op:o.Bdm.Remove,path:"/channels",value:[{channelId:n}]}]}};i({variables:d,update:(e,i)=>{let{data:s}=i;e.writeFragment({id:"Doc:".concat(t.id),fragment:o.P6u,data:null==s?void 0:s.updatePublicChannels})},optimisticResponse:{updatePublicChannels:{id:d.input.docId,channels:null===(r=t.channels)||void 0===r?void 0:r.filter(e=>e.id!==n)}}}).then(()=>{e({title:(0,s.jsx)(l.cC,{id:"qsnpV6",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),status:"success",duration:1e4,position:"top"})}).catch(i=>{e({title:(0,s.jsx)(l.cC,{id:"+yMzgs"}),description:i.message,status:"error",duration:3e3,isClosable:!0,position:"top"}),console.error("[addRemoveDocChannel] Error removing channel:",i.message)})},[i,e]);return{addDocChannel:t,removeDocChannel:d}}},16710:function(e,i,t){"use strict";t.d(i,{Gi:function(){return c},Xp:function(){return x},h_:function(){return p},nZ:function(){return j},qw:function(){return m},uG:function(){return C}});var s=t(52322),n=t(42946),l=t(5879),r=t(87254),o=t(94199),a=t(30579),d=t(78462);let c=(e,i)=>{var t;return(null==e?void 0:null===(t=e.organization)||void 0===t?void 0:t.id)!==(null==i?void 0:i.id)},u={PRIVATE:"private",LINK_VIEW:"link-view",LINK_COMMENT:"link-comment",LINK_EDIT:"link-edit",INDIVIDUAL:"individual",ORG_VIEW:"org-view",ORG_COMMENT:"org-comment",ORG_EDIT:"org-edit",ORG_MANAGE:"org-manage",CHANNEL_PRIVATE:"channel-private",PUBLIC:"public"},h=[u.ORG_VIEW,u.ORG_COMMENT,u.ORG_EDIT,u.ORG_MANAGE],x=()=>({[u.PRIVATE]:{title:()=>
1r.ag._({id:"IZiYjM",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),subtitle:()=>r.ag._({id:"nHujJB",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),primaryIcon:n.byT},[u.LINK_VIEW]:{title:()=>r.ag._({id:"Pb5t/X",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),primaryIcon:n.nNP},[u.LINK_COMMENT]:{title:()=>r.ag._({id:"FUtIA5",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),primaryIcon:n.nNP},[u.LINK_EDIT]:{title:()=>r.ag._({id:"tNOSZi",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),primaryIcon:n.nNP},[u.INDIVIDUAL]:{title:()=>r.ag._({id:"IB6oAl",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),subtitle:e=>"".concat(e," can access this ").concat(o.Yc,"."),primaryIcon:n.ILF},[u.ORG_VIEW]:{title:e=>r.ag._({id:"S+losC",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc,org:e}}),primaryIcon:n.P88,secondaryIcon:n.Mdf},[u.ORG_COMMENT]:{title:e=>r.ag._({id:"acq2w5",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc,org:e}}),primaryIcon:n.P88,secondaryIcon:n.Mzg},[u.ORG_EDIT]:{title:e=>r.ag._({id:"FFdz7p",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc,org:e}}),primaryIcon:n.P88,secondaryIcon:n.TzT},[u.ORG_MANAGE]:{title:e=>r.ag._({id:"3yNlmN",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc,org:e}}),primaryIcon:n.P88},[u.CHANNEL_PRIVATE]:{title:()=>
1r.ag._({id:"Tw6Jzi"}),primaryIcon:a.Ty},[u.PUBLIC]:{title:()=>r.ag._({id:"NMHF69",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),primaryIcon:n.Xj}}),p=(e,i)=>{var t;if(!e)return null;let s=(null==e?void 0:e.publicAccess)?u.PUBLIC:(null==e?void 0:e.orgAccess)==="manage"?u.ORG_MANAGE:(null==e?void 0:e.orgAccess)==="edit"?u.ORG_EDIT:(null==e?void 0:e.orgAccess)==="comment"?u.ORG_COMMENT:(null==e?void 0:e.orgAccess)==="view"?u.ORG_VIEW:(null==e?void 0:e.channels)&&e.channels.some(e=>null!==e.permission)?u.CHANNEL_PRIVATE:(null==e?void 0:e.collaborators)&&(null==e?void 0:null===(t=e.collaborators)||void 0===t?void 0:t.length)>1?u.INDIVIDUAL:(null==e?void 0:e.accessLinks)&&e.accessLinks.some(e=>"view"===e.permission&&""===e.token)?u.LINK_VIEW:(null==e?void 0:e.accessLinks)&&e.accessLinks.some(e=>"comment"===e.permission&&""===e.token)?u.LINK_COMMENT:(null==e?void 0:e.accessLinks)&&e.accessLinks.some(e=>"edit"===e.permission&&""===e.token)?u.LINK_EDIT:C(e,i)?u.PRIVATE:u.INDIVIDUAL;return s},m=e=>(null==e?void 0:e.publicAccess)?r.ag._({id:"gJUdlS",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}):(null==e?void 0:e.orgAccess)?r.ag._({id:"5Ma3Lv",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}):r.ag._({id:"QbKKqw",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),g=(e,i,t)=>{var r,o;if(!i)return[];let x=(null==e?void 0:null===(r=e.channels)||void 0===r?void 0:r.map(e=>{let{id:i,name:t,slug:s}=e;return{id:i,label:t,href:(0,d.j)({id:i,slug:s}),icon:a.Ty}}))||[],m=p(e,i),g=c(e,t),j=g?[{id:"shared-from-external-org",label:(null==e?void 0:null===(o=e.organization)||void 0===o?void 0:o.name)?(0,s.jsx)(l.cC,{id:"lFZJ+N",values:{0:e.organization.name}}):(0,s.jsx)(l.cC,{id:"qn35Ez"}),icon:n.Gg,color:"gray.500"}]:[];if(m===u.PUBLIC)return[{id:"public",label:(0,s.jsx)(l.cC,{id:"7d1a0d"}),icon:n.Xj,color:"gray.500"},...j,...x];if(m===u.PRIVATE)return[{id:"private",label:(0,s.jsx)(l.cC,{id:"zwBp5t"}),icon:n.byT,color:"gray.500"},...j];if(m===u.INDIVIDUAL){let t=(e.collaborators||[]).filter(e=>e.user.id!==i.id).length;return[{id:"collaborators",label:(0,s.jsx)(l.cC,{id:"o2NxSP",values:{numCollaborators:t}}),icon:n.ILF,color:"gray.500"},...j]}return g?j:m&&h.includes(m)?[{id:"workspace",label:(0,s.jsx)(l.cC,{id:"0Gd0NU"}),icon:n.P88,color:"gray.500"},...j,...x]:x},j=e=>{let{doc:i,user:t,currentWorkspace:s,channelToExclude:n}=e;return g(i,t,s).filter(e=>e.id!==n)},C=(e,i)=>{var t;return e&&i&&!e.orgAccess&&!e.publicAccess&&(null===(t=e.createdBy)||void 0===t?void 0:t.id)===i.id}},46759:function(e,i,t){"use strict";t.d(i,{M:function(){return D}});var s=t(52322),n=t(70065),l=t(92850),r=t(26468),o=t(22226),a=t(54326),d=t(2338),c=t(97217),u=t(43297),h=t(35183),x=t(97166),p=t(85573),m=t(50250),g=t(75768),j=t(62614),C=t(94523),v=t(5879),f=t(87254),b=t(5632),y=t(2784),_=t(93202),S=t(83669),A=t(15041),E=t(36651),I=t(78462);let D=e=>{var i;let{isOpen:t,onClose:D,existingDoc:k}=e,w=(0,n.p)(),T=(0,y.useRef)(null),[P,O]=(0,y.useState)(!1),{currentWorkspace:N}=(0,E.SE)(),[L,R]=(0,y.useState)(""),[M]=(0,_.V$$)(),[F]=(0,_.So6)(),U=(0,S.b)(),{push:z}=(0,b.useRouter)(),B=(0,y.useCallback)(async()=>{if(null==k?void 0:k.id){await (0,A.iL)(k.id),O(!0);try{var e,i;let{data:t}=await F({variables:{duplicateDocInput:{sourceDocId:k.id,source:_.L17.SitesCopyToSite,title:(null==k?void 0:k.title)||f.ag._({id:"wja8aL"}),orgId:null==N?void 0:N.id,orgAccess:_.y3$.Manage,themeId:null}}}),s=null==t?void 0:null===(e=t.duplicateDoc)||void 0===e?void 0:e.id;if(!s){console.error("[CreateSiteModal] Failed to duplicate doc with id",k.id);return}let{data:n}=await M({variables:{input:{workspaceId:null==N?void 0:N.id,name:L,routes:[{docId:s,path:"/"}],themeId:null==k?void 0:null===(i=k.theme)||void 0===i?void 0:i.id}}}),l=null==n?void 0:n.createSite;if(!l){console.error("[CreateSiteModal] Failed to create site, no site returned");return}let r=(0,I.yQ)({docId:s});z(r),D()}catch(e){w({status:"error",title:(0,s.jsx)(v.cC,{id:"Pdboh4"}),description:(0,s.jsx)(v.cC,{id:"c6YG3V"})}),console.error(e)}O(!1)}},[M,null==N?void 0:N.id,F,null==k?void 0:k.id,null==k?void 0:null===(i=k.theme)||void 0===i?void 0:i.id,null==k?void 0:k.title,L,z,w]),G=(0,y.useCallback)(async()=>{O(!0);let{data:e}=await M({variables:{input:{workspaceId:null==N?void 0:N.id,name:L,routes:[]}}}),i=null==e?void 0:e.createSite;if(!i){console.error("[CreateSiteModal] Failed to create site, no site returned");return}U({siteId:null==i?void 0:i.id,routes:null==i?void 0:i.routes,title:"Home",path:"/"})},[U,M,null==N?void 0:N.id,L]),H=(0,y.useCallback)(async()=>(null==k?void 0:k.id)?B():G(),[null==k?void 0:k.id,B,G]),K=L.length>0;return(0,s.jsx)(C.Wk,{isDark:!1,children:(0,s.jsxs)(l.u_,{isOpen:t,onClose:D,initialFocusRef:T,size:"2xl",children:[(0,s.jsx)(r.Z,{}),(0,s.jsxs)(o.h,{children:[(0,s.jsx)(a.x,{children:(0,s.jsx)(v.cC,{id:"JHMOcq"})}),(0,s.jsx)(d.o,{}),(0,s.jsx)(c.f,{children:(0,s.jsx)(u.K,{spacing:4,children:(0,s.jsxs)(h.NI,{children:[(0,s.jsx)(x.l,{children:(0,s.jsx)(v.cC,{id:"Lve3H6"})}
1),(0,s.jsx)(p.I,{ref:T,placeholder:f.ag._({id:"tlD7N3"}),onChange:e=>{R(e.target.value)},onKeyDown:e=>{K&&"Enter"===e.key&&H()}})]})})}),(0,s.jsx)(m.m,{children:(0,s.jsxs)(g.h,{children:[(0,s.jsx)(j.z,{variant:"ghost",onClick:D,children:(0,s.jsx)(v.cC,{id:"dEgA5A"})}),(0,s.jsx)(j.z,{variant:"solid",onClick:H,isDisabled:!K,isLoading:P,children:(0,s.jsx)(v.cC,{id:"JHMOcq"})})]})})]})]})})}},83669:function(e,i,t){"use strict";t.d(i,{b:function(){return x}});var s=t(5632),n=t(2784),l=t(93202),r=t(84405),o=t(56356),a=t(41425),d=t(12136),c=t(23147),u=t(21733),h=t(78462);let x=()=>{let e=(0,d.e)(),{user:i,currentWorkspace:t}=(0,u.SE)(),[x]=(0,l.CsQ)(),[p]=(0,l.qbt)(),{push:m}=(0,s.useRouter)(),g=(0,n.useCallback)(async s=>{let n,{title:d,path:u,siteId:g,routes:j,sourceDocId:C}=s;if(!u.startsWith("/")){console.error("[AddNewPageToSite] Path must start with /. Aborting.",u);return}if(!(null==t?void 0:t.id)||!g||!j)return;if(C)await e({docId:C,docTitle:d,source:l.L17.SitesDuplicatePage,onSuccess:e=>{n=e}});else{let e=(0,o.R$)({settings:{defaultFullBleed:"full"},docFlags:{cardLayoutsEnabled:!0}}),s=(0,c.qI)(e),{data:h}=await x({variables:{workspaceId:null==t?void 0:t.id,title:d,source:l.L17.SitesAddPage,initialContent:{ydoc:s,schemaVersion:a.bI,editors:[null==i?void 0:i.id]},orgAccess:l.y3$.Manage,mainPage:"/"===u}});n=null==h?void 0:h.createDoc.id,(0,r.Q)({doc_id:n,source:l.L17.SitesAddPage,channel:null})}if(!g||!n){console.error("[AddPageModal] Site or doc id is undefined. Cannot add route.");return}await p({variables:{input:{siteId:g,docId:n,path:u,offline:!1}},refetchQueries:["GetSite"]});let v=(0,h.yQ)({docId:n});return console.debug("[AddPageModal] Doc created. Adding route then navigating to editor",n),await m(v,void 0,{shallow:!0}),n},[null==t?void 0:t.id,p,m,e,x,null==i?void 0:i.id]);return g}},96967:function(e,i,t){"use strict";t.d(i,{z:function(){return iC}});var s=t(52322),n=t(70065),l=t(32981),r=t(26468),o=t(73751),a=t(97217),d=t(2338),c=t(28535),u=t(42822),h=t(81540),x=t(94523),p=t(87254),m=t(2784),g=t(43997),j=t(93202),C=t(11050),v=t(47968),f=t(36651),b=t(93441),y=t(38035),_=t(43297),S=t(77533),A=t(74008),E=t(75768),I=t(62614),D=t(36371),k=t(73582),w=t(2969),T=t(3181),P=t(13272),O=t(84010),N=t(5879),L=t(18149),R=t.n(L),M=t(66625),F=t(94199),U=t(91994),z=t(56356),B=t(46409),G=t(49354),H=t(96933),K=t(20678),V=t(47749),W=t(29318),q=t(887),Y=t(66479),X=t(20437),Z=t(30233),Q=t(26838);let J=(0,m.memo)(e=>{let{theme:i,onThemeClick:t,onSelectClick:n}=e,{data:l,loading:r}=(0,j.BCl)({variables:{workspaceId:null,archived:!1},fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),o=(null==l?void 0:l.themes)||[],a=(0,H.i)({base:"md","2xl":"lg"});return(0,s.jsxs)(y.k,{flexDirection:"column",w:"100%",children:[(0,s.jsx)(c.xu,{flex:1,p:{base:3,md:5},children:r?(0,s.jsx)(Z.S,{size:4}):(0,s.jsx)(X.M,{columns:{base:1,lg:2},spacing:1,children:[...o].sort(Y.qb).map(e=>(0,s.jsx)(Q.o,{type:"standard",theme:e,isChecked:e.id===i.id,onThemeClicked:t,variant:"ghost"},e.id))})}),(0,s.jsxs)(c.xu,{pos:"sticky",bottom:0,children:[(0,s.jsx)(A.i,{}),(0,s.jsx)(y.k,{p:{base:3,md:5},alignItems:"center",bg:"white",children:(0,s.jsx)(I.z,{size:a,"data-testid":"select-this-theme",flex:1,variant:"solid",onClick:n,children:(0,s.jsx)(N.cC,{id:"RT9Fre"})})})]})]})});var $=t(5200),ee=t(24772),ei=t(29117),et=t(74409),es=t(82655),en=t(49929),el=t(42111),er=t(35183),eo=t(97166),ea=t(47443),ed=t(82713),ec=t(24213),eu=t(71272),eh=t(59568),ex=t(52929),ep=t(42946),em=t(37164),eg=t(99787),ej=t(16494),eC=t(29596),ev=t(40520),ef=t(64743);let eb=e=>(0,ef.bH)(e)&&(0,ef.Rr)(e),ey=e=>{let{setBackground:i,background:t,defaultMessage:n,isDark:l,isValidSource:r}=e,[o,a]=(0,m.useState)(eg.hq.key),d=eC.ah[o],c=(0,m.useCallback)(e=>r?r(e)&&eb(e):eb(e),[r]),u=(0,m.useCallback)(e=>{i({...t,...e})},[t,i]);return(0,s.jsx)(ev.O,{isDark:l,isValidSource:c,defaultMessage:n,currentBackground:t,currentSource:d,updateCurrentBackground:u,setCurrentSourceKey:a,currentSourceKey:o,editType:"themeBackgroun
1d"})};var e_=t(13793);t(38095);var eS=t(17993),eA=t(75009),eE=t(32899),eI=t(91710),eD=t(97253),ek=t(87205);t(65331),t(41779);let ew=e=>{let{uploadedImages:i,setUploadedImages:t,setIsLoading:l}=e,r=(0,U.CG)(v.KV),{currentWorkspace:o}=(0,f.SE)(),{orgId:a,templateId:d}=(0,W.Ds)(r||(null==o?void 0:o.id),"themeBackground"),c=(0,n.p)(),[u,h]=(0,m.useState)(0),[g,j]=(0,m.useState)(!1),C=(0,m.useCallback)(e=>{let{file:i,tempUrl:s}=e;l(!0);let n=s;if(i.type&&(0,ek.Ns)(i.type)){let e="HEIC_tempId_".concat((0,em.x0)());n=e}t(e=>[...e,{tempUrl:n,name:i.name,src:null,showPlaceholder:!0,uploadStatus:ej.D.Uploading}])},[l,t]),b=(0,m.useCallback)(e=>{t(i=>{let t=i.map(i=>i.name===e.name?{...i,tempUrl:null,...(0,eD.gM)({result:e,isError:!1})}:i);return t}),h(e=>e+1)},[t]);(0,m.useEffect)(()=>{l(!i.every(e=>"optimized"===e.uploadResultStep))},[l,i]);let y=(0,m.useCallback)(()=>{c({title:"Error uploading images, please try again",status:"error",duration:3e3,isClosable:!0}),h(e=>e+1)},[c]),A=(0,m.useMemo)(()=>{if(!a)throw Error("Tried uploading an image with no orgId");return eg.ND.createUppyInstance(a,{onUploadStart:C,onUploadComplete:b,onUploadFailed:y}
1,"themeBackground",50,"image",d)},[u,a,C,b,y,d]),E=()=>(0,s.jsx)(s.Fragment,{children:a&&(0,s.jsx)(eI.v0,{width:"100%",height:"100%",note:p.ag._({id:"x4Ts51"}),uppy:A,locale:{strings:{browse:p.ag._({id:"wZ9s+A"})}}})});return i.length>0?(0,s.jsxs)(eS.g,{align:"flex-start",spacing:4,onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),j(!0)},children:[g&&(0,s.jsx)(E,{}),(0,s.jsx)(X.M,{gap:2,columns:{base:2,"2xl":3},children:i.map(e=>{let{src:i,meta:n,name:l,tempUrl:r}=e||{},o=i?(0,ek.aN)(i,{width:500}):void 0;return(0,s.jsxs)(_.K,{spacing:1,position:"relative",role:"group",children:[(0,s.jsx)(eA.E,{src:o||r||"",alt:"",ignoreFallback:!0,borderRadius:"md"}),(0,s.jsx)(x.kH,{label:(0,s.jsx)(N.cC,{id:"ZTnXof"}),placement:"top",children:(0,s.jsx)(eE.h,{"aria-label":p.ag._({id:"Rz0Yis"}),icon:(0,s.jsx)(en.G,{icon:ep.XAH}),onClick:()=>{t(i=>{let t=i.filter(i=>i.name!==e.name);return t})},isRound:!0,position:"absolute",top:1,right:1,size:"sm",color:"red.600",opacity:0,_hover:{color:"red.600"},_groupHover:{opacity:1}})}),n&&n.width&&n.height&&(0,s.jsxs)(S.x,{fontSize:"xs",children:[n.width,"\xd7",n.height,"px"]}),l&&(0,s.jsx)(S.x,{fontSize:"xs",lineHeight:4,children:l})]},e.tempUrl)})})]}):(0,s.jsx)(E,{})};var eT=t(53701);let eP=e=>e.backgroundType===e_.E.IMAGE,eO={...G.Gx,accentId:void 0},eN=e=>{let{theme:i,updateTheme:t}=e,[n,l]=(0,m.useState)(!1),[r,o]=(0,m.useState)(null),[a,d]=(0,m.useState)(null),c=r&&!!r.accentId,u=i.config.accentBackgrounds,h=(0,el.ye)("bulkUploadAccentImages"),x=(0,m.useCallback)(()=>{d(eO),o(eO)},[]),g=(0,m.useCallback)(()=>{o(null),d(null)},[]),j=(0,m.useCallback)(e=>{let i=e||r;if(!i)return;let s={...i,source:V.cx,originalSource:i.source,accentId:(0,em.x0)()},n=u||[];if(c){let e=n.findIndex(e=>e.accentId===r.accentId);if(-1===e){console.warn("[AccentImagePicker] Could not find accent image to edit");return}t({accentBackgrounds:[...n.slice(0,e),s,...n.slice(e+1)]})}else t({accentBackgrounds:[...n,s]});g()},[u,r,c,g,t]),C=(0,m.useCallback)(e=>{let i=(u||[]).filter(i=>i.accentId!==e.accentId);t({accentBackgrounds:i})},[u,t]),v=(0,m.useCallback)(e=>{let i={...e,source:e.originalSource};d(i),o({...e,source:e.originalSource})},[]),f=(0,m.useCallback)(e=>{if(e.source===eg.hq.key||e.source===eg.$5.key){j(e);return}if(e.source===eg.in.key){var i,t,s,n;(null===(i=e.image)||void 0===i?void 0:i.uploadStatus)===ej.D.Uploading?l(!0):(null===(t=e.image)||void 0===t?void 0:t.uploadStatus)===ej.D.Done&&(null===(s=e.image)||void 0===s?void 0:s.uploadResultStep)==="optimized"?l(!1):(null===(n=e.image)||void 0===n?void 0:n.uploadStatus)===ej.D.Error&&l(!1)}o(e)},[j]),b=(0,m.useMemo)(()=>!R()(r,a),[r,a]),y=(0,Y.wj)(i),[S,A]=(0,m.useState)([]),[D,k]=(0,m.useState)(!1),w=(0,m.useCallback)(()=>{A([]),k(!1)},[]),T=(0,m.useCallback)(()=>{let e=S.map(e=>({type:e_.E.IMAGE,source:V.cx,originalSource:"image.custom",image:e,accentId:(0,em.x0)()})),i=u||[];t({accentBackgrounds:[...e,...i]}),w()},[S,u,t,w]);return r?(0,s.jsxs)(_.K,{p:6,children:[(0,s.jsx)(ey,{setBackground:f,background:r,isValidSource:eP,defaultMessage:(0,s.jsxs)(ea.b,{children:[(0,s.jsx)(ex.z,{}),(0,s.jsx)(N.cC,{id:"VPwqDS"})]}),isDark:y}),(0,s.jsxs)(E.h,{pt:6,display:"flex",children:[(0,s.jsx)(I.z,{variant:"ghost",onClick:g,children:(0,s.jsx)(N.cC,{id:"dEgA5A"})}),(0,s.jsx)(I.z,{variant:"solid",onClick:()=>j(),isLoading:n,isDisabled:!b,flex:1,children:c?(0,s.jsx)(N.cC,{id:"tfDRzk"}):(0,s.jsx)(N.cC,{id:"B6vyEa"})})]})]}):(0,s.jsxs)(_.K,{spacing:6,children:[(0,s.jsxs)(_.K,{spacing:3,children:[(0,s.jsx)(I.z,{leftIcon:(0,s.jsx)(en.G,{icon:ep.r8p}),alignSelf:"flex-start",onClick:x,children:(0,s.jsx)(N.cC,{id:"5phU36"})}),h&&(0,s.jsx)(ew,{uploadedImages:S,setUploadedImages:A,setIsLoading:k}),u&&0!=u.length&&(0,s.jsx)(eT.U,{accentImages:u,isDark:y,handleDelete:C,handleItemClick:v,editType:"themeBackgroun
1d"})]}),S.length>0&&(0,s.jsxs)(E.h,{display:"flex",w:"100%",position:"sticky",bottom:0,left:0,bg:"white",py:3,px:6,borderTop:"1px",borderColor:"gray.300",children:[(0,s.jsx)(I.z,{variant:"ghost",onClick:w,children:(0,s.jsx)(N.cC,{id:"dEgA5A"})}),(0,s.jsx)(I.z,{variant:"solid",onClick:T,isLoading:D,flex:1,children:(0,s.jsx)(N.cC,{id:"1rLekk",values:{0:S.length,1:p.ag._({id:"BZPFHo",values:{0:S.length}})}})})]})]})};var eL=t(85573),eR=t(29494),eM=t(63176),eF=t(99793),eU=t(12985);let ez=async(e,i,s)=>{try{let s=(await Promise.all([t.e(5489),t.e(4751)]).then(t.bind(t,89089))).default,n=(await Promise.all([t.e(5489),t.e(9224)]).then(t.bind(t,30058))).default,l=s.parse(e),r=n.objectify(l);i(r)}catch(e){s(e.message)}},eB=async(e,i,s)=>{try{let s=(await Promise.all([t.e(5489),t.e(4751)]).then(t.bind(t,89089))).default,n=(await Promise.all([t.e(5489),t.e(9224)]).then(t.bind(t,30058))).default;s().process(e,{parser:n}).then(e=>{let{css:t}=e;i(t)})}catch(e){s(e.message)}},eG=e=>{let{label:i,initialValue:n,updateValue:l,helperText:r}=e,[o,a]=(0,m.useState)(""),[d,u]=(0,m.useState)(null),[h,x]=(0,m.useState)(),p=(0,b.Kt)(ez,100);return((0,m.useEffect)(()=>{Promise.all([t.e(8917),t.e(7120),t.e(6214)]).then(t.bind(t,65284)).then(e=>{x(e.css())})},[]),(0,b.vm)(()=>{u(null),n&&eB(n,a,u)},[n],[]),(0,b.vm)(()=>{u(null),p(o,l,u)},[o,l,p],[o]),h)?(0,s.jsxs)(er.NI,{isInvalid:!!d,children:[(0,s.jsx)(eo.l,{children:i}),d&&(0,s.jsx)(eF.J1,{children:d}),r&&(0,s.jsx)(er.Q6,{children:r}),(0,s.jsx)(c.xu,{border:"1px solid",borderColor:"gray.200",fontSize:"md",children:(0,s.jsx)(m.Suspense,{fallback:(0,s.jsx)("span",{}),children:(0,s.jsx)(eU.B,{value:o,height:"300px",extensions:[h],onChange:a})})})]}):null};var eH=t(8624),eK=t(10625),eV=t(67046),eW=t(99058),eq=t(39237),eY=t(89098);let eX=e=>{let{theme:i,dispatch:t}=e,n=(0,eY.c)(i);return(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"x5htAS"})}),(0,s.jsxs)(eK.v,{matchWidth:!0,children:[(0,s.jsx)(eV.j,{size:"lg",as:I.z,borderRadius:"md",rightIcon:(0,s.jsx)(en.G,{icon:ep.ptq,transform:"shrink-6"}),variant:"toolbar",px:4,h:10,w:"100%",border:"1px solid",borderColor:"gray.200",children:(0,s.jsx)(S.x,{textAlign:"left",fontWeight:"400",children:n.name()})}),(0,s.jsx)(eW.q,{maxH:"320px",maxW:"100%",overflow:"auto",children:eY.N.map(e=>(0,s.jsx)(eq.i,{isChecked:n.key===e.key,value:e.key,onClick:()=>t({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{themeBase:e.key}}}),children:(0,s.jsxs)(ei.U,{maxW:"100%",children:[(0,s.jsx)(eZ,{base:e}),(0,s.jsxs)(c.xu,{flex:"1",minW:"0",children:[e.name(),e.description&&(0,s.jsx)(S.x,{color:"gray.400",fontSize:"sm",children:e.description()})]})]})},e.key))})]})]})},eZ=e=>{let{base:i}=e,t={"--card-color":"#FFF",...i.getCSSVars({cardColor:"#FFF",accentColor:"#F00",accentPalette:["#F00"]})};return(0,s.jsx)(c.xu,{backgroundColor:"gray.200",p:4,css:t,children:(0,s.jsx)(c.xu,{sx:i.cardSx,h:"3em",w:"5em"})})},eQ=(0,m.memo)(()=>{var e;let{state:i,dispatch:t}=(0,eh.q)(),{theme:n}=i,l=(null===(e=n.config.cardBackground)||void 0===e?void 0:e.type)===e_.E.COLOR?n.config.cardBackground.color:null;return(0,s.jsxs)(_.K,{spacing:4,children:[(0,s.jsxs)(er.NI,{"data-testid":"custom-theme-card-color-picker",children:[(0,s.jsxs)(eo.l,{children:[(0,s.jsx)(N.cC,{id:"9d2iLQ"})," ",(0,s.jsx)(x.Yq,{label:(0,s.jsx)(N.cC,{id:"7wiFpy"})})]}),(0,s.jsx)(eH.T,{value:(null==l?void 0:l.hex)||null,updateValue:e=>t({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{cardBackground:e?{type:e_.E.COLOR,
1color:{hex:e}}:void 0}}}),defaultValue:"#FFFFFF"})]}),(0,s.jsx)(eX,{theme:n,dispatch:t})]})});eQ.displayName="ThemeConfigCardStylesPanel";var eJ=t(84286),e$=t(66028);let e0=e=>{let{value:i,updateValue:t,onLogoUploadStart:n,onLogoUploadFail:l}=e,[r,o]=(0,m.useState)(null),[a,d]=(0,m.useState)(null),u=(0,U.CG)(v.KV),{currentWorkspace:h}=(0,f.SE)(),x=u||(null==h?void 0:h.id);return x?i||a?(0,s.jsxs)(eS.g,{align:"flex-start",spacing:4,children:[(0,s.jsxs)(c.xu,{position:"relative",w:"100%",background:"gray.50",children:["placeholder"==a?(0,s.jsx)(eJ.k3,{w:"100%"}):(0,s.jsx)(eA.E,{w:"100%",src:i||a||void 0,alt:"",onMouseDown:e$.br}),r==ej.D.Uploading&&(0,s.jsx)(eJ.HI,{}),r==ej.D.Error&&(0,s.jsx)(eJ.s7,{})]}),(0,s.jsx)(I.z,{onClick:()=>{t(null),o(null)},mt:2,w:"100%",children:(0,s.jsx)(N.cC,{id:"VlT9ID"})})]}):(0,s.jsx)(eg.un,{orgId:x,uploadType:"image",editType:"icon",dropHereText:p.ag._({id:"cmRkd1",values:{0:"%{browse}"}}),customHeight:"250px",customFontSize:"sm",showTip:!1,onUploadStart:e=>{let{file:i,tempUrl:t}=e;o(ej.D.Uploading),n&&n(),i.type&&(0,ek.Ns)(i.type)?d("placeholder"):d(t)},onUploadSuccess:e=>{let{src:i}=e;o(ej.D.Done),t(i),d(null)},onUploadFailed:e=>{o(ej.D.Error),l&&l()}}):null};var e1=t(30423),e2=t(52099),e5=t(78462),e3=t(44035),e4=t(27599),e6=t(54933);let e9=e=>{let{label:i,description:t,labelColor:n="black",fontFamily:l,fontStyle:r="normal",fontWeight:o=400}=e,a=(0,s.jsxs)(ei.U,{alignItems:"baseline",children:[(0,s.jsx)(c.xu,{color:"yellow.400",children:(0,s.jsx)(en.G,{icon:e6.e7M})}),(0,s.jsx)(S.x,{textAlign:"left",color:n,fontWeight:o,fontSize:"lg",fontFamily:l,fontStyle:r,children:i})]});return t?(0,s.jsxs)(c.xu,{children:[a,(0,s.jsx)(S.x,{fontSize:"xs",color:"gray.500",children:t})]}):a},e7=e=>{let{value:i,updateValue:t,onFontUploadClick:n,weight:l="regular",defaultFont:r,fonts:o,customFontsEnabled:a,...d}=e,{workspaceFonts:c,globalFonts:u}=o,[h,p,g]=(0,m.useMemo)(()=>{let e=[...c,...u],t=e.find(e=>e.id===i),s=(0,e2.Yw)(e,i),n=(0,e2.Yw)(e,i,!1);return[t,s,n]},[u,c,i]),j=a&&c.filter(e=>!e.archived||e.id===(null==h?void 0:h.id)).length>0,C=!1,v="normal",f="bold"===l?700:400;if(h&&null!==h.workspaceId){C=!0===h.archived;let e=[...h.fontFiles||[]];v=(0,e1.Sd)(e)?"italic":"normal";let i=(0,e1.B_)(e);f=(0,e1.QP)(i,"bold"===l?700:400)||400}return(0,s.jsxs)(eK.v,{matchWidth:!0,isLazy:!0,children:[(0,s.jsx)(eV.j,{size:"lg",as:I.z,borderRadius:"md",rightIcon:(0,s.jsx)(en.G,{icon:ep.ptq,transform:"shrink-6"}),variant:"toolbar",px:4,h:10,w:"100%",border:"1px solid",borderColor:"gray.200",...d,children:a&&C?(0,s.jsx)(e9,{label:g||"",fontFamily:'"'.concat(p,'"'),labelColor:i?"gray.800":"gray.400",fontStyle:v,fontWeight:f}):(0,s.jsx)(S.x,{textAlign:"left",fontFamily:'"'.concat(p||r,'"'),fontWeight:f,color:i?"gray.800":"gray.400",fontStyle:v,children:g||(0,s.jsx)(N.cC,{id:"Ff/YaY",values:{defaultFont:r,GAMMA_PROPER_NOUN:F.N6}})})}),(0,s.jsxs)(eW.q,{maxH:"320px",overflow:"auto",zIndex:"dropdown",children:[(0,s.jsxs)(e3._,{type:"radio",value:i||"",onChange:e=>t(e||void 0),children:[j&&(0,s.jsx)(x.NZ,{m:2,children:(0,s.jsx)(N.cC,{id:"syCKVA"})}),j&&c.map(e=>{var t;let n=e.id!==i,r=e.archived&&n,o=(null===(t=e.fontFiles)||void 0===t?void 0:t.length)===0&&n;if(!e.fontFiles||o||r)return null;let a=(0,e1.Sd)(e.fontFiles)?"italic":"normal";return C&&e.id===i?(0,s.jsx)(eq.i,{value:e.id,disabled:!0,children:(0,s.jsx)(e9,{fontFamily:e.name,label:e.name,fontStyle:a,description:(0,s.jsx)(N.cC,{id:"FZBl16"})})},e.id):(0,s.jsx)(eq.i,{value:e.id,children:(0,s.jsx)(S.x,{fontFamily:'"'.concat(e.name,'"'),fontSize:"lg",fontWeight:l,fontStyle:a,children:e.name})},e.id)}),j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e4.R,{}),(0,s.jsx)(x.NZ,{m:2,children:(0,s.jsx)(N.cC,{id:"Z/0bkt"})})]}),(0,s.jsx)(eq.i,{value:"",children:(0,s.jsx)(S.x,{fontFamily:r,fontSize:"lg",fontWeight:l,color:"gray.400",children:(0,s.jsx)(N.cC,{id:"fuNYg+"})})}),u&&u.map(e=>(0,s.jsx)(eq.i,{value:e.id,children:(0,s.jsx)(S.x,{fontFamily:(0,e2.eu)(e.id)?'"'.concat(e.id,'"'):'"'.concat(e.name,'"'),fontSize:"lg",fontWeight:l,children:e.name})},e.id))]}),a&&(0,s.jsx)(I.z,{width:"calc(100% + var(--chakra-space-4))",variant:"plain",position:"sticky",bottom:-2,m:-2,mt:2,p:2,borderX:"none",borderBottom:"none",fontSize:"sm",borderRadius:"none",onClick:n,leftIcon:(0,s.jsx)(en.G,{icon:ep.A$k}),children:(0,s.jsx)(N.cC,{id:"vNYIdl"})})]})]})};var e8=t(29705),ie=t(11082),ii=t(62700);let it=e=>{var i,t,n;
1let{font:l,value:r,defaultWeight:o,updateValue:a,...d}=e,c=(0,m.useCallback)(e=>{let i=Number(e);Number.isNaN(i)||a(i)},[a]),u=(null==r?void 0:r.toString())||"",h=(0,ii.d)()[o],{weightOptions:x,isDeletedFontWeight:p}=(0,m.useMemo)(()=>{let e=(0,e2.W9)(l),i=void 0!==r&&!e.includes(r);if(!i||!r)return{isDeletedFontWeight:i,weightOptions:e};let t=[...e,r].sort((e,i)=>e-i);return{isDeletedFontWeight:i,weightOptions:t}},[l,r]),g=l&&(null==l?void 0:l.workspaceId)!==null,j=g&&(null===(i=l.fontFiles)||void 0===i?void 0:i.length)===0,C=p&&g,v=(0,e5.p6)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eK.v,{matchWidth:!0,isLazy:!0,children:[(0,s.jsx)(eV.j,{size:"lg",as:I.z,borderRadius:"md",rightIcon:(0,s.jsx)(en.G,{icon:ep.ptq,transform:"shrink-6"}),variant:"toolbar",px:4,h:10,w:"100%",border:"1px solid",borderColor:"gray.200",isDisabled:x.length<=1,...d,children:p?(0,s.jsx)(e9,{label:j?(0,s.jsx)(N.cC,{id:"EqUVJs"}):null!==(t=(0,ii.d)()[u])&&void 0!==t?t:h,labelColor:r?"gray.800":"gray.400"}):(0,s.jsx)(S.x,{textAlign:"left",color:r?"gray.800":"gray.400",fontWeight:400,children:null!==(n=(0,ii.d)()[u])&&void 0!==n?n:h})}),(0,s.jsx)(eW.q,{maxH:"320px",overflow:"auto",zIndex:"dropdown",children:(0,s.jsx)(e3._,{type:"radio",value:u,onChange:c,children:x.map(e=>{var i,t;return p&&r===e?(0,s.jsx)(eq.i,{value:e.toString(),disabled:!0,children:(0,s.jsx)(e9,{label:null!==(i=(0,ii.d)()[e])&&void 0!==i?i:h,description:C?(0,s.jsx)(N.cC,{id:"KFmni+"}):(0,s.jsx)(N.cC,{id:"mGTUJj"})})},e):(0,s.jsx)(eq.i,{value:e.toString(),children:(0,s.jsx)(S.x,{fontSize:"lg",children:null!==(t=(0,ii.d)()[e])&&void 0!==t?t:h})},e)})})})]}),C&&(0,s.jsx)(S.x,{fontSize:"xs",mt:1.5,children:(0,s.jsxs)(ie.r,{href:v,textDecoration:"underline",isExternal:!0,children:[(0,s.jsx)(N.cC,{id:"RUO69p"}),(0,s.jsx)(e8.h,{ml:1})]})})]})},is=e=>{let{label:i,helperText:t,value:n,defaultValue:l,updateValue:r,...o}=e;return(0,s.jsxs)(er.NI,{...o,children:[i&&(0,s.jsx)(eo.l,{children:(0,s.jsx)(S.x,{children:i})}),(0,s.jsx)(eH.T,{value:n,updateValue:r,defaultValue:l}),t&&(0,s.jsx)(er.Q6,{children:t})]})},il=[{testId:"background",label:()=>p.ag._({id:"GtJbUa"}),icon:es.UHQ,Component:(0,s.jsx)(()=>{let{dispatch:e,state:i}=(0,eh.q)(),t=(0,Y.E7)(i.theme),n=(0,Y.wj)(i.theme),l=(0,m.useCallback)(i=>{var t,s;(null==i?void 0:i.type)===e_.E.IMAGE&&(null===(t=i.image)||void 0===t?void 0:t.uploadStatus)===ej.D.Uploading?e({type:"THEME_BACKGROUND_IMAGE_UPLOAD_STARTED",data:{background:i}}):(null==i?void 0:i.type)===e_.E.IMAGE&&(null===(s=i.image)||void 0===s?void 0:s.uploadStatus)===ej.D.Error?e({type:"THEME_BACKGROUND_IMAGE_UPLOAD_FAIL"}):e({type:"THEME_BACKGROUND_UPDATE_SUCCESS",data:{background:i}})},[e]);return(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"uIeorD"})}),(0,s.jsx)(ey,{setBackground:l,background:t,defaultMessage:(0,s.jsxs)(ea.b,{fontSize:"xs",children:[(0,s.jsx)(ex.z,{}),(0,s.jsx)(S.x,{children:(0,s.jsx)(N.cC,{id:"j+PsQe"})})]}),isDark:n})]})},{})},{testId:"card-styles",label:()=>p.ag._({id:"Roi1AL"}),icon:es.lCX,Component:(0,s.jsx)(eQ,{})},{testId:"accent-colors",label:()=>p.ag._({id:"TzJ8ZI"}),icon:es.AVo,Component:(0,s.jsx)(()=>{var e,i;let{state:t,dispatch:n}=(0,eh.q)(),{theme:l}=t,r=(0,m.useCallback)(e=>n({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{accentColor:null!=e?e:void 0}}}),[n]);return(0,s.jsxs)(_.K,{spacing:2,children:[(0,s.jsxs)(er.NI,{"data-testid":"custom-theme-accent-color-picker",children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"Udsgl4"})}),(0,s.jsx)(er.Q6,{mb:4,children:(0,s.jsx)(N.cC,{id:"ILESdz"})}),(0,s.jsx)(ec.U,{color:l.accentColor,defaultColor:V.uP,updateColor:r,gradient:l.config.accentGradient,updateGradient:e=>n({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{accentGradient:e}}})})]}),(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"NEXUdn"})}),(0,s.jsx)(er.Q6,{mb:2,children:(0,s.jsx)(N.cC,{id:"OU8xue"})}),(0,s.jsx)(eu.Y,{value:(null===(e=l.config)||void 0===e?void 0:e.secondaryAccentColors)||[],updateValue:e=>n({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{secondaryAccentColors:e}}}),maxColors:4})]}),(0,s.jsxs)(er.NI,{children:[(0,s.jsxs)(eo.l,{mt:4,children:[(0,s.jsx)(N.cC,{id:"AnNF5e"})," ",(0,s.jsx)(x.Yq,{label:(0,s.jsx)(N.cC,{id:"QjwqJE"})})]}),(0,s.jsx)(ea.b,{colorScheme:"gray",children:(0,s.jsx)(ed.X,{isChecked:!(null===(i=l.config)||void 0===i?void 0:i.disableReadabilityAdjustment),onChange:()=>{var e;return n({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{disableReadabilityAdjustment:!(null===(e=l.config)||void 0===e?void 0:e.disableReadabilityAdjustment)}}})},children:(0,s.jsx)(N.cC,{id:"KmUJ3J"})})})]})]})},{})},{testId:"accent-images",label:()=>p.ag._({id:"COXEr5"}),description:()=>p.ag._({id:"B2lKp+"}),icon:es.l9f,Component:(0,s.jsx)(()=>{let{state:e,dispatch:i}=(0,eh.q)(),{theme:t}=e;return(0,s.jsx)(eN,{theme:t,updateTheme:e=>i({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{...e}}})})},{})},{testId:"typography",label:()=>p.ag._({id:"nWRfmt"}),icon:es.nUG,Component:(0,s.jsx)(()=>{var e;let i=(0,el.ye)("customFonts"),{dispatch:t,state:n}=(0,eh.q)(),{theme:l,fontState:r}
1=n,{fonts:o,fontsMap:a}=r,d=(0,m.useCallback)(e=>{let i=a[e],s=(0,e2.W9)(i),n=(0,e1.QP)(s,l.headingFontWeight||V.ZT.heading)||V.ZT.heading,r=(0,e2.s8)({fontsMap:a,headingFontId:e,bodyFontId:l.bodyFont});t({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{headingFont:e,headingFontWeight:n,fonts:r}}})},[t,a,l.bodyFont,l.headingFontWeight]),c=(0,m.useCallback)(e=>{let i=a[e],s=(0,e2.W9)(i),n=(0,e1.QP)(s,l.bodyFontWeight||V.ZT.body)||V.ZT.body,r=(0,e2.s8)({fontsMap:a,bodyFontId:e,headingFontId:l.headingFont});t({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{bodyFont:e,bodyFontWeight:n,fonts:r}}})},[t,a,l.headingFont,l.bodyFontWeight]),u=(0,m.useCallback)(e=>t({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{headingFontWeight:e}}}),[t]),h=(0,m.useCallback)(e=>t({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{bodyFontWeight:e}}}),[t]),x=(0,m.useCallback)(e=>t({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{headingColor:null!=e?e:void 0}}}),[t]),p=(0,m.useCallback)(e=>t({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{headingGradient:null!=e?e:void 0}}}),[t]),g=(0,m.useCallback)(e=>t({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{bodyColor:null!=e?e:void 0}}}),[t]),j=(0,m.useCallback)(()=>{let e=(0,e5.p6)();window.open(e,"_blank")},[]),C=a[l.headingFont||V.ke.headingFont]||a[V.ke.headingFont],v=a[l.bodyFont||V.ke.bodyFont]||a[V.ke.bodyFont],f=l.headingFontWeight||V.ZT.heading,b=l.bodyFontWeight||V.ZT.body,y=(0,Y.wj)(l);return(0,s.jsxs)(_.K,{children:[(0,s.jsxs)(er.NI,{mb:"2",children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(S.x,{children:(0,s.jsx)(N.cC,{id:"7OvVwW"})})}),(0,s.jsx)(e7,{fonts:o,value:l.headingFont,customFontsEnabled:i,updateValue:d,onFontUploadClick:j,weight:"bold",defaultFont:V.ke.headingFont,"data-testid":"custom-theme-heading-font-picker"}),i&&(0,s.jsx)(it,{font:C,value:f,defaultWeight:700,updateValue:u})]}),(0,s.jsx)(er.NI,{mb:"2","data-testid":"custom-theme-heading-color-picker",children:(0,s.jsx)(ec.U,{color:l.config.headingColor,updateColor:x,defaultColor:y?V.Qw:V.l0,gradient:l.config.headingGradient,updateGradient:p})}),(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(S.x,{children:(0,s.jsx)(N.cC,{id:"B4QCf7"})})}),(0,s.jsx)(e7,{fonts:o,value:l.bodyFont,customFontsEnabled:i,updateValue:c,onFontUploadClick:j,weight:"normal",defaultFont:V.ke.bodyFont,"data-testid":"custom-theme-body-font-picker"}),i&&(0,s.jsx)(it,{font:v,value:b,defaultWeight:400,updateValue:h})]}),(0,s.jsx)(is,{value:(null===(e=l.config)||void 0===e?void 0:e.bodyColor)||null,defaultValue:y?V.Z_:V.zL,updateValue:g}),(0,s.jsx)(ea.b,{mt:"6",colorScheme:"gray",children:(0,s.jsx)(S.x,{fontSize:"md",children:(0,s.jsx)(N.cC,{id:"gXllrZ"})})})]})},{})},{testId:"logo",label:()=>p.ag._({id:"iG7KNr"}),icon:es.yoz,Component:(0,s.jsx)(()=>{let{state:e,dispatch:i}=(0,eh.q)(),{theme:t}=e;return(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"qy77B2"})}),(0,s.jsx)(e0,{value:t.logoUrl||null,onLogoUploadStart:()=>{i({type:"THEME_LOGO_UPLOAD_STARTED"})},updateValue:e=>i({type:"THEME_LOGO_UPLOAD_SUCCESS",data:{logoUrl:null!=e?e:void 0}}),onLogoUploadFail:()=>{i({type:"THEME_LOGO_UPLOAD_FAIL"})}})]})},{})},{testId:"advanced",label:()=>p.ag._({id:"sxkWRg"}),description:()=>p.ag._({id:"VeFaaQ",values:{GAMMA_PROPER_NOUN:F.N6}}),icon:es.gr5,Component:(0,s.jsx)(()=>{var e,i,t,n,l,r,o;let{state:a,dispatch:d}=(0,eh.q)(),{theme:c}=a;return(0,s.jsxs)(_.K,{spacing:4,children:[(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"S0kLOH"})}),(0,s.jsx)(eL.I,{defaultValue:c.id,readOnly:!0})]}),(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"PPYsiY"})}),(0,s.jsx)(eR.g,{defaultValue:null===(i=c.config.keywords)||void 0===i?void 0:null===(e=i.color)||void 0===e?void 0:e.join(", "),onChange:e=>{d({type:"THEME_UPDATE_THEME_KEYWORDS",data:{keywords:{color:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}}})}}),(0,s.jsx)(er.Q6,{children:(0,s.jsx)(N.cC,{id:"j3OJ2O"})})]}),(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"valYIJ"})}),(0,s.jsx)(eR.g,{defaultValue:null===(n=c.config.keywords)||void 0===n?void 0:null===(t=n.tone)||void 0===t?void 0:t.join(", "),onChange:e=>{d({type:"THEME_UPDATE_THEME_KEYWORDS",data:{keywords:{tone:e.target.value.split(",").map(e=>
1e.trim()).filter(Boolean)}}})}}),(0,s.jsx)(er.Q6,{children:(0,s.jsx)(N.cC,{id:"j3OJ2O"})})]}),(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"1hKEom"})}),(0,s.jsx)(eM.Y2,{defaultValue:c.priority,onChange:(e,i)=>{d({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{priority:Number.isNaN(i)?void 0:i}}})},children:(0,s.jsx)(eM.zu,{})}),(0,s.jsx)(er.Q6,{children:(0,s.jsx)(N.cC,{id:"RyAyyY"})})]}),(0,s.jsxs)(er.NI,{children:[(0,s.jsx)(eo.l,{children:(0,s.jsx)(N.cC,{id:"q3il6U"})}),(0,s.jsx)(eM.Y2,{defaultValue:null===(l=c.config)||void 0===l?void 0:l.fontSize,onChange:(e,i)=>{d({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{fontSize:Number.isNaN(i)?void 0:i}}})},children:(0,s.jsx)(eM.zu,{})})]}),(0,s.jsx)(eG,{label:(0,s.jsx)(N.cC,{id:"3loch2"}),initialValue:null===(r=c.config)||void 0===r?void 0:r.contentStyles,updateValue:e=>d({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{contentStyles:e}}})}),(0,s.jsx)(eG,{label:(0,s.jsx)(N.cC,{id:"r0cjYF"}),initialValue:null===(o=c.config)||void 0===o?void 0:o.containerStyles,updateValue:e=>d({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{containerStyles:e}}}),helperText:p.ag._({id:"W5hi5t"})})]})},{}),isForGammaOnly:!0}],ir=(e,i)=>!!e.featureFlag&&!el.VH.get(e.featureFlag)||!!e.isForGammaOnly&&!i,io=e=>{let{theme:i,dispatch:t,fonts:n,fontsMap:l}=e,{isGammaOrgUser:r}=(0,f.SE)(),o=(0,ee.S)({base:!0,lg:!1}),a=(0,m.useMemo)(()=>il.filter(e=>!ir(e,r)),[r]),d={outline:"1px dashed var(--chakra-colors-sunglow-500)",outlineOffset:"0"};return(0,s.jsx)(eh.u.Provider,{value:{state:{theme:i,fontState:{fonts:n,fontsMap:l}},dispatch:t},children:(0,s.jsxs)(D.m,{display:o?"block":"flex",alignItems:"flex-start",flexDirection:o?"column":"row",variant:"soft-rounded",defaultIndex:0,w:"100%",flex:"1",children:[(0,s.jsx)(k.t,{display:"flex",flexDirection:o?"row":"column",overflowX:"auto",position:"sticky",top:"0",p:"2",bg:"white",zIndex:"1",minW:o?"100%":"220px",alignItems:o?"flex-start":"stretch",gap:o?void 0:"1",children:il.map((e,i)=>(0,s.jsx)(w.O,{"data-testid":"theme-config-tab-".concat(e.testId),justifyContent:"flex-start",whiteSpace:o?"nowrap":void 0,...e.isForGammaOnly&&d,borderRadius:"md",_hover:{bg:"trueblue.50"},children:(0,s.jsxs)(ei.U,{spacing:"2.5",fontSize:{base:"sm",md:"md"},children:[(0,s.jsx)(c.xu,{color:"trueblue.400",children:(0,s.jsx)(en.G,{icon:e.icon,fixedWidth:!0})}),(0,s.jsx)(S.x,{textAlign:"left",noOfLines:{base:void 0,md:1},whiteSpace:"no-wrap",children:e.label()})]})},i))}),(0,s.jsx)(A.i,{orientation:o?"horizontal":"vertical"}),(0,s.jsx)(T.n,{children:a.map((e,i)=>(0,s.jsxs)(P.x,{bg:"white",p:{base:3,md:5},pb:{base:5,md:10},h:"100%",as:_.K,spacing:{base:"4",md:"6"},children:[(0,s.jsxs)(_.K,{spacing:"1",children:[(0,s.jsx)(et.X,{fontSize:"2xl",color:"gray.800",fontWeight:"500",children:e.label()}),e.description&&(0,s.jsx)(S.x,{fontSize:"sm",color:"gray.600",children:e.description()})]}),e.Component]},i))})]})})};var ia=t(58905),id=t(75230),ic=t(64951),iu=t(29264);let ih=e=>{let{value:i,onSave:t,themeValidationError:n}=e;return(0,s.jsxs)(er.NI,{isInvalid:!!n,children:[(0,s.jsx)(ia.C,{defaultValue:i,placeholder:(0,V.F)(),onSubmit:t,submitOnBlur:!0,color:"gray.800",isPreviewFocusable:!0,fontSize:"2xl",fontWeight:"500",children:(0,s.jsxs)(ei.U,{spacing:"2",minHeight:10,minW:"10",children:[(0,s.jsx)(id.w,{px:"1",bg:"gray.50",w:"100%","data-testid":"custom-theme-name-preview",_hover:{bg:"gray.200"}}),(0,s.jsx)(ic.V,{px:"1","data-testid":"custom-theme-name-input"}),(0,s.jsx)(ix,{})]})}),n&&(0,s.jsx)(eF.J1,{fontWeight:"500",pb:2,children:n})]})},ix=()=>{let{isEditing:e,getSubmitButtonProps:i,getCancelButtonProps:t,getEditButtonProps:n}=(0,iu.Z)();return e?(0,s.jsxs)(E.h,{justifyContent:"center",size:"sm",spacing:0,children:[(0,s.jsx)(x.kH,{label:(0,s.jsx)(N.cC,{id:"dEgA5A"}),placement:"top",children:(0,s.jsx)(eE.h,{size:"md",colorScheme:"red",variant:"ghost","aria-label":p.ag._({id:"dEgA5A"}),icon:(0,s.jsx)(en.G,{icon:e6.YIN}),...t()})}),(0,s.jsx)(x.kH,{label:(0,s.jsx)(N.cC,{id:"fNzdjk"}),placement:"top",children:(0,s.jsx)(eE.h,{size:"md",colorScheme:"green",variant:"ghost","aria-label":p.ag._({id:"fNzdjk"}),icon:(0,s.jsx)(en.G,{icon:e6.LEp}),...i(),"data-testid":"save-theme-name-button"})})]}):(0,s.jsx)(y.k,{justifyContent:"center",children:(0,s.jsx)(x.kH,{label:(0,s.jsx)(N.cC,{id:"+MxT3Q"}),placement:"top",children:(0,s.jsx)(c.xu,{children:(0,s.jsx)(eE.h,{size:"md",variant:"ghost",colorScheme:"gray",color:"gray.400","aria-label":p.ag._({id:"+MxT3Q"}),icon:(0,s.jsx)(en.G,{icon:e6.IwR}),...n(),ref:null})})})})},ip="theme-editor-root",im=e=>{var i,t;let{state:n,dispatch:l,docContent:r,doc:o,workspaceId:a,onSave:d,onCancel:h,isLoading:p}=e,{theme:g,customizationStep:j}=n,[C,v]=(0,m.useState)(),[f,O]=(0,m.useState)(null),L=(0,b.Kt)(v,300);(0,m.useEffect)(()=>{L(g)},[g,L]);let{globalFonts:F,workspaceFonts:K,fontsMap:X,allThemeFonts:Z}=(0,W.TY)(a);(null==r?void 0:r.content)&&(null===(i=r.content[0].attrs)||void 0===i?void 0:i.background)&&
1(r.content[0].attrs.background=G.jg);let Q=(0,U.CG)(M.mT),ee="selection"===j,ei=(0,H.i)({base:"var(--chakra-sizes-sm)",lg:ee?"var(--chakra-sizes-lg)":"var(--chakra-sizes-xl)",xl:ee?"var(--chakra-sizes-xl)":"var(--chakra-sizes-2xl)","2xl":ee?"var(--chakra-sizes-2xl)":"var(--chakra-sizes-3xl)"})||"var(--chakra-sizes-md)",et=(0,H.i)({base:"md","2xl":"lg"}),es=(0,m.useMemo)(()=>(0,q.y)(),[]);(0,m.useEffect)(()=>{let e=null==C?void 0:C.config.accentBackgrounds;if(e){if(f&&0===e.length){f.commands.setContent(es);return}null==f||f.commands.updateThemeAccentImages(e,!0)}},[f,null==C?void 0:C.config.accentBackgrounds,es]);let en=(0,m.useCallback)(e=>{l({type:"SET_NEW_THEME_FOR_SELECTING",data:{theme:(0,Y.mg)(e)}})},[l]),el=(0,m.useCallback)(()=>{l({type:"SET_NEW_THEME_FOR_CUSTOMIZING",data:{theme:(0,Y.mg)(g,!0)}})},[l,g]),er="loading"===n.themeBackgroundImgStatus||"loading"===n.themeLogoImgStatus,eo="new"===n.theme.id||!R()(n.theme,n.originalTheme);return(0,s.jsxs)(y.k,{direction:"row",h:"100%",maxH:"100%",children:[(0,s.jsx)(y.k,{direction:"column",w:ei,borderLeft:"1px solid",borderColor:"gray.200",position:"relative",children:(0,s.jsxs)(y.k,{flex:"1",position:"relative",h:"100%",flexDirection:"column",children:[(0,s.jsx)(y.k,{p:{base:3,md:5},alignItems:"stretch",flexDirection:"column",children:ee?(0,s.jsxs)(_.K,{spacing:0,children:[(0,s.jsx)(S.x,{fontSize:{base:"2xl",lg:"3xl"},fontWeight:"700",letterSpacing:"tight",children:(0,s.jsx)(N.cC,{id:"sZF+xW"})}),(0,s.jsx)(S.x,{color:"gray.700",fontSize:"sm",children:(0,s.jsx)(N.cC,{id:"cMoaWD"})})]}):(0,s.jsx)(ig,{name:(null===(t=n.theme)||void 0===t?void 0:t.name)||(0,V.F)(),doc:o,theme:n.theme,dispatch:l,themeValidationError:n.themeValidationError})}),(0,s.jsx)(A.i,{}),(0,s.jsx)(y.k,{flex:"1",maxH:"100%",overflowY:"scroll",w:"100%",children:ee?(0,s.jsx)(J,{theme:g,onThemeClick:en,onSelectClick:el}):(0,s.jsx)(io,{theme:g,dispatch:l,fonts:{globalFonts:F,workspaceFonts:K},fontsMap:X})}),!ee&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(A.i,{}),(0,s.jsx)(y.k,{p:{base:3,md:4},justifyContent:"flex-end",bg:"white",position:"sticky",bottom:"0",children:(0,s.jsxs)(E.h,{size:et,children:[(0,s.jsx)(I.z,{variant:"plain",onClick:h,children:(0,s.jsx)(N.cC,{id:"dEgA5A"})}),(0,s.jsx)(x.kH,{isDisabled:!er,label:(0,s.jsx)(N.cC,{id:"yz1qqg"}),children:(0,s.jsx)(c.xu,{display:"inline-flex",children:(0,s.jsx)(I.z,{variant:"solid",isLoading:p||p||er,isDisabled:!eo,onClick:d,"data-testid":"custom-theme-save",children:(0,s.jsx)(N.cC,{id:"EsJdRp"})})})})]})})]})]})}),(0,s.jsx)(y.k,{flex:1,bg:"gray.100",position:"relative",maxW:"calc(100vw - ".concat(ei,")"),children:(0,s.jsxs)(y.k,{className:ip,overflowY:"scroll",width:"100%",height:"100%",direction:"column",position:"relative",css:{"--editor-width":"100%"},children:[(0,s.jsx)(B.Y,{}),(0,s.jsx)($.J,{fonts:Z}),(0,s.jsxs)(D.m,{variant:"soft-rounded",size:"sm","data-testid":"custom-theme-tabs",children:[r&&(0,s.jsx)(u.M,{position:"sticky",top:0,zIndex:2,background:"white",children:(0,s.jsxs)(k.t,{p:2,position:"absolute",top:"1rem",background:"white",borderRadius:"full",shadow:"base",children:[(0,s.jsx)(w.O,{"data-testid":"custom-theme-tester-deck-tab",children:(0,s.jsx)(N.cC,{id:"vat9WD"})}),(0,s.jsx)(w.O,{"data-testid":"custom-theme-current-deck-tab",children:(0,s.jsx)(N.cC,{id:"VJUm9p"})})]})}),(0,s.jsxs)(T.n,{"data-testid":"custom-theme-tab-panels",pointerEvents:"none",children:[(0,s.jsx)(P.x,{p:0,"data-testid":"custom-theme-preview-editor",children:(0,s.jsx)(z.fb,{onCreate:e=>{let{editor:i}=e;return O(i)},initialContent:es,theme:C,scrollingParentSelector:".".concat(ip),isInsideDrawer:!0})}),r&&(0,s.jsx)(P.x,{p:0,"data-testid":"custom-theme-preview-editor",children:(0,s.jsx)(z.fb,{reduxData:{cards:Q},initialContent:r,theme:C,scrollingParentSelector:".".concat(ip),doc:o,isInsideDrawer:!0})})]})]})]})})]})},ig=e=>{var i;let{name:t,doc:n,theme:l,themeValidationError:r,dispatch:o}=e,[a,d]=(0,m.useState)(),{data:c,loading:u}=(0,j.gec)({variables:{id:null==l?void 0:l.id},skip:!l||"new"===l.id}),h=(0,K.$)(null==n?void 0:n.title);(0,m.useEffect)(()=>{!u&&c&&c.theme&&d(c.theme)},[u,c,d]);let x=(0,m.useCallback)(e=>{let i=e||(0,V.F)();o({type:"THEME_UPDATE_THEME_NAME",data:{name:i}})},[o]);return(0,s.jsxs)(_.K,{spacing:"1.5",children:[(0,s.jsx)(ih,{value:t||(0,V.F)(),onSave:x,themeValidationError:r}),u?(0,s.jsx)(O.N,{noOfLines:1,fontSize:"sm",maxW:"300px"}):(0,s.jsxs)(S.x,{color:"gray.700",fontSize:"sm",fontWeight:"normal",letterSpacing:"normal",children:[(null==a?void 0:a.createdBy)&&(0,s.jsx)(N.cC,{id:"qeNU2j",values:{0:a.createdBy.displayName}})," ",(null==a?void 0:a.docCount)&&(null==a?void 0:a.docCount)===1&&(null==a?void 0:a.id)===(null==n?void 0:null===(i=n.theme)||void 0===i?void 0:i.id)?(0,s.jsx)(N.cC,{id:"On+kRG",values:{docTitle:h,GAMMA_ARTIFACT_PROPER_NOUN:F.Yc},components:{0:(0,s.jsx)("strong",{})}}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.cC,{id:"eVRfvp",values:{GAMMA_ARTIFACT_PROPER_NOUN:F.Yc,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:F.aq,0:(null==a?void 0:a.docCount)||0},components:{0:(0,s.jsx)("strong",{}),1:(0,s.jsx)("strong",{})}})})]})]})},ij=["headingFont","bodyFont","accentColor","logoUrl"],iC=(0,m.memo)(e=>{let{isOpen:i,onClose:t,state:c,dispatch:u,docContent:h,onThemeCreated:y,disableDrawerTransition:_=!1}=e,S=(0,C.z$)(),A=(0,n.p)(),E=(0,g.v9)(v.yx),I=(0,b.NE)(i,500),{user:D,currentWorkspace:k}=(0,f.SE)(),w=(0,m.useRef)(null),T=_?i:I,[P,{loading:O}]=(0,j.Wu6)(),[N,{loading:L}]=(0,j.suk)(),R=(0,m.useCallback)(()=>{u({type:"THEME_RESET"}),t()},[u,t]),M=(0,m.useCallback)(()=>
1{if(D&&k&&c.theme){if(!c.theme.name){u({type:"THEME_VALIDATION_ERROR",data:{errorMessage:"Theme name is required."}});return}if("new"===c.theme.id){let e={...c.theme,workspaceId:k.id},{id:i,archived:t,fonts:s,...n}=e;P({variables:{input:n},update:(i,t)=>{let{data:s}=t;(null==s?void 0:s.createTheme)&&i.writeQuery({query:j.$LR,variables:{workspaceId:e.workspaceId,archived:!1},data:{themes:[s.createTheme]}})},optimisticResponse:{createTheme:{__typename:"Theme",...e,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(i=>{let{data:t}=i;if(null==t?void 0:t.createTheme){var s;null==S||S.track(C.AA.THEME_CREATED,{theme_id:null==t?void 0:null===(s=t.createTheme)||void 0===s?void 0:s.id,type:"new"}),null==y||y(t.createTheme)}A({title:p.ag._({id:"NE6T/k",values:{0:e.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}),R()}).catch(i=>{i.graphQLErrors&&i.graphQLErrors.length>0&&"duplicate_theme_name"===i.graphQLErrors[0].code?u({type:"THEME_VALIDATION_ERROR",data:{errorMessage:i.message}}):(console.error("Couldn't create theme ".concat(e.name," error: ").concat(i)),A({title:p.ag._({id:"FcSGqc",values:{e:i}}),status:"error",duration:3e3,position:"top",isClosable:!1}))})}else{let{__typename:e,archived:i,createdTime:t,updatedTime:s,createdBy:n,fonts:l,...r}=c.theme;for(let e of ij)e in r&&void 0===r[e]&&(r[e]=null);N({variables:{input:r},update:(e,i)=>{let{data:t}=i;(null==t?void 0:t.updateTheme)&&e.writeQuery({query:j.$LR,variables:{workspaceId:c.theme.workspaceId,archived:!1},data:{themes:[t.updateTheme]}})},optimisticResponse:{updateTheme:{__typename:"Theme",...c.theme,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(()=>{null==S||S.track(C.AA.THEME_UPDATED,{theme_id:c.theme.id}),A({title:p.ag._({id:"WODDpW",values:{0:c.theme.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}),R()}).catch(e=>{e.graphQLErrors&&"duplicate_theme_name"===e.graphQLErrors[0].code?u({type:"THEME_VALIDATION_ERROR",data:{errorMessage:e.message}}):(console.error("Couldn't update theme ".concat(c.theme.name," error: ").concat(e)),A({title:p.ag._({id:"hSYiXl",values:{e:e}}),status:"error",duration:3e3,position:"top",isClosable:!1}))})}}},[D,k,u,null==c?void 0:c.theme,P,A,R,S,y,N]),F="calc(var(--100vh) - 24px)";return(0,s.jsx)(x.Wk,{isDark:!1,children:(0,s.jsxs)(l.d,{placement:"bottom",onClose:R,isOpen:i,isFullHeight:!0,initialFocusRef:w,children:[(0,s.jsx)(r.Z,{}),(0,s.jsxs)(o.s,{borderTopRadius:"xl",h:F,transform:_?"none !important":void 0,children:[(0,s.jsx)(a.f,{p:0,maxH:F,children:T?(0,s.jsx)(im,{state:c,workspaceId:null==k?void 0:k.id,dispatch:u,docContent:h,doc:E,onSave:M,onCancel:R,isLoading:!!(O||L)}):(0,s.jsx)(iv,{})}),(0,s.jsx)(d.o,{ref:w,bg:"white",boxShadow:"base",size:"lg",top:"3",right:"3"})]})]})})});iC.displayName="ThemeEditorDrawer";let iv=()=>(0,s.jsx)(c.xu,{flexDirection:"column",flex:"1",w:"100%",h:"100%",bg:"gray.100",inset:0,children:(0,s.jsx)(u.M,{h:"100%",children:(0,s.jsx)(h.$,{})})})},30233:function(e,i,t){"use strict";t.d(i,{S:function(){return r}});var s=t(52322),n=t(69251),l=t(67109);let r=e=>{let{size:i}=e;return(0,s.jsx)(n.r,{gap:4,flex:1,templateColumns:{base:"repeat(2, minmax(0, 1fr))"},children:Array(i).fill(!0).map((e,i)=>(0,s.jsx)(l.O,{h:"9em",borderRadius:"base"},i))})}},26838:function(e,i,t){"use strict";t.d(i,{o:function(){return eo}});var s=t(52322),n=t(56581),l=t(29117),r=t(77533),o=t(70065),a=t(55478),d=t(28535),c=t(38035),u=t(36474),h=t(5879),x=t(87254),p=t(2784),m=t(90763),g=t(93202),j=t(48832),C=t(11050),v=t(50260),f=t(10625),b=t(67046),y=t(32899),_=t(332),S=t(99058),A=t(27599),E=t(25481),I=t(42946),D=t(54933),k=t(49929),w=t(94523),T=t(82282),P=t(31807),O=t(47749),N=t(29318);let L=(0,p.memo)(e=>{let{theme:i}=e,t=(0,N.eo)({theme:i}),n=i.name.replace(O.Qk,"");return(0,s.jsxs)(f.v,{isLazy:!0,children:[(0,s.jsx)(b.j,{as:y.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,s.jsx)(k.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,s.jsx)(h.cC,{id:"7L01XJ"})}),(0,s.jsx)(_.h,{children:(0,s.jsxs)(S.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)(d.xu,{px:4,py:0,maxWidth:"300px",children:[(0,s.jsx)(r.x,{noOfLines:3,children:n}),i.createdTime&&(0,s.jsx)(r.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,s.jsx)(h.cC,{id:"MXSt4t",values:{0:(0,T.Z)((0,P.Z)(i.createdTime),"PPP")}})}),i.createdBy&&(0,s.jsx)(w.kH,{label:i.createdBy.email,children:(0,s.jsx)(r.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,s.jsx)(h.cC,{id:"t490IT",values:{0:i.createdBy.displayName}})})})]}),(0,s.jsx)(A.R,{}),(0,s.jsx)(E.s,{icon:(0,s.jsx)(k.G,{icon:D.XnX,fixedWidth:!0}),onClick:t,children:(0,s.jsx)(h.cC,{id:"yKu/3Y"})})]})})]})});var R=t(53596),M=t(36651),F=t(14274),U=t(8393),z=t(21733);let B=(0,p.memo)(e=>{let{onCustomizeThemeClick:i,onEditThemeClick:t}=e,{isGammaOrgUser:n}=(0,z.SE)(),l=n&&"production"!==F.v.APPLICATION_ENVIRONMENT;return(0,s.jsxs)(f.v,{isLazy:!0,children:[(0,s.jsx)(b.j,{as:y.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,s.jsx)(k.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,s.jsx)(h.cC,{id:"7L01XJ"})}),(0,s.jsx)(_.h,{children:(0,s.jsxs)(S.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(E.s,{icon:(0,s.jsx)(k.G,{icon:I.Mw$,fixedWidth:!0}),onClick:i,children:(0,s.jsx)(h.cC,{id:"XZd6AM"})}),l&&(0,s.jsx)(E.s,{color:"orange.500",icon:(0,s.jsx)(d.xu,{boxSize:"4",children:(0,s.jsx)(U.Y,{})}),onClick:t,children:"Edit theme"}),(0,s.jsx)(A.R,{}),(0,s.jsx)(d.xu,{px:4,py:0,maxW:56,children:(0,s.jsx)(r.x,{fontSize:"sm",color:"gray.600",children:(0,s.jsx)(h.cC,{id:"FV8ABd"})})})]})})]})});var G=t(29705),H=t(92850),K=t(26468),V=t(22226),W=t(54326),q=t(97217),Y=t(11082),X=t(67109),Z=t(50250),Q=t(75768),J=t(62614),$=t(2338),ee=t(5632),ei=t(94199),et=t(91994),es=t(47968);let en=e=>{let{theme:i,isOpen:t,onClose:n}=e,{asPath:l}=(0,ee.useRouter)(),[o,a]=(0,p.useState)(),[d,c]=(0,p.useState)(),u=(0,et.CG)(es.yx),x=(0,N.EW)({theme:i,showLinkToDashboard:!!u}),{data:m,loading:j}=(0,g.gec)({variables:{id:null==i?void 0:i.id},skip:!i||"new"===i.id});(0,p.useEffect)(()=>{var e,i;!j&&m&&((null===(e=m.theme)||void 0===e?void 0:e.docCount)&&a(m.theme.docCount),(null===(i=m.theme)||void 0===i?void 0:i.siteCount)&&c(m.theme.siteCount))},[j,m,a,c]);let C=(0,p.useMemo)(()=>{let e=0;return o&&o>0&&(e+=o),d&&d>0&&(e+=d),e},[o,d]);return(0,s.jsxs)(H.u_,{closeOnOverlayClick:!1,isOpen:t,onClose:n,size:"lg",children:[(0,s.jsx)(K.Z,{}),(0,s.jsxs)(V.h,{children:[(0,s.jsx)(W.x,{children:(0,s.jsx)(h.cC,{id:"oh7Knm",values:{0:i.name}})}),(0,s.jsx)(q.f,{children:C>0?(0,s.jsxs)(r.x,{mb:2,children:[(0,s.jsx)(h.cC,{id:"uSopl9",values:{totalCount:C,GAMMA_ARTIFACT_PROPER_NOUN:ei.Yc,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:ei.aq}})," ",(0,s.jsx)(h.cC,{id:"c+lbSJ",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:ei.aq}})," ","/#themes"!==l&&(0,s.jsx)(h.cC,{id:"kLomb7",components:{0:(0,s.jsx)(Y.r,{color:"trueblue.500",colorScheme:"trueblue",href:v.oH,textDecoration:"underline",isExternal:!0}),1:(0,s.jsx)(G.h,{mx:"2px"})}})]}):j?(0,s.jsx)(X.O,{h:"1em",mb:2}):(0,s.jsx)(r.x,{mb:2,children:(0,s.jsx)(h.cC,{id:"KNTN0L",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:ei.aq}})})}),(0,s.jsx)(Z.m,{children:(0,s.jsxs)(Q.h,{children:[(0,s.jsx)(J.z,{variant:"ghost",onClick:n,children:(0,s.jsx)(h.cC,{id:"dEgA5A"})}),(0,s.jsx)(J.z,{variant:"ghost",colorScheme:"red",onClick:()=>{x(),n()},children:(0,s.jsx)(h.cC,{id:"zck3yw"})})]})}),(0,s.jsx)($.o,{})]})]})},el=(0,p.memo)(e=>{let{theme:i,openThemeEditorWithThisTheme:t,onDuplicate:n,onArchiveThemeModalOpen:l,isArchiveThemeModalOpen:o,onArchiveThemeModalClose:a}=e,{canMakeStandard:c,convertToStandard:u}=(0,N.Xm)(i);return(0,s.jsxs)(f.v,{isLazy:!0,children:[(0,s.jsx)(b.j,{as:y.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,s.jsx)(k.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,s.jsx)(h.cC,{id:"7L01XJ"})}),(0,s.jsx)(_.h,{children:(0,s.jsxs)(S.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)(d.xu,{px:4,py:0,maxWidth:"300px",children:[(0,s.jsx)(r.x,{noOfLines:3,children:i.name}),i.createdTime&&(0,s.jsx)(r.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,s.jsx)(h.cC,{id:"MXSt4t",values:{0:(0,T.Z)((0,P.Z)(i.createdTime),"PPP")}})}),i.createdBy&&(0,s.jsx)(w.kH,{label:i.createdBy.email,children:(0,s.jsx)(r.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,s.jsx)(h.cC,{id:"t490IT",values:{0:i.createdBy.displayName}})})})]}),(0,s.jsx)(A.R,{}),(0,s.jsx)(E.s,{icon:(0,s.jsx)(k.G,{icon:I.q2v,fixedWidth:!0}),onClick:t,children:(0,s.jsx)(h.cC,{id:"ePK91l"})}),(0,s.jsx)(E.s,{icon:(0,s.jsx)(k.G,{icon:I.WM4,fixedWidth:!0}),onClick:n,children:(0,s.jsx)(h.cC,{id:"euc6Ns"})}),(0,s.jsx)(A.R,{}),c&&(0,s.jsx)(E.s,{color:"orange.500",icon:(0,s.jsx)(d.xu,{boxSize:"4",children:(0,s.jsx)(U.Y,{})}),onClick:u,children:(0,s.jsx)(h.cC,{id:"thLYdn"})}),(0,s.jsx)(E.s,{color:"red.500",icon:(0,s.jsx)(k.G,{icon:I.N2j,fixedWidth:!0}),onClick:l,children:(0,s.jsx)(h.cC,{id:"B495Gs"})})]})}),o&&(0,s.jsx)(_.h,{children:(0,s.jsx)(en,{theme:i,isOpen:!0,onClose:a})})]})}),er=e=>{let{isChecked:i,name:t}=e;return(0,s.jsxs)(l.U,{spacing:1,alignItems:"flex-start",children:[i&&(0,s.jsx)(n.n,{w:3,h:"auto",mr:1,mt:1,color:"trueblue.700"}),(0,s.jsx)(r.x,{fontSize:"sm",noOfLines:1,"data-testid":"theme-name",color:i?"trueblue.700":void 0,children:t})]})},eo=(0,p.memo)(e=>{var i,t,n,r;let{theme:f,onThemeClicked:b,isChecked:y=!1,onEditClick:_,variant:S="outline"}=e,A=(0,C.z$)(),E=(0,o.p)(),I="ghost"===S,D=(0,p.useRef)(null),k=(0,p.useCallback)(e=>()=>{_&&(e?_((0,v.mg)(f,!0)):_(f))},[_,f]),{isOpen:w,onOpen:T,onClose:P}=(0,a.q)({id:"ArchiveThemeModalDisclosure"}),{user:O,currentWorkspace:N}=(0,M.SE)(),[F]=(0,g.gFs)(),U=f.name.replace(v.Qk,""),z=(0,p.useCallback)(()=>
1{if(!O||!N)return;let{id:e,...i}=f;F({variables:{id:e},update:(e,i)=>{let{data:t}=i;(null==t?void 0:t.duplicateTheme)&&e.writeQuery({query:g.$LR,variables:{workspaceId:f.workspaceId,archived:!1},data:{themes:[t.duplicateTheme]}})},optimisticResponse:{duplicateTheme:{id:"temp",__typename:"Theme",...i,name:"".concat(U," (copy)"),archived:!1,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(i=>{let{data:t}=i;t&&(null==A||A.track(C.AA.THEME_DUPLICATED,{theme_id:t.duplicateTheme.id,source_theme_id:e,name:U}),null==A||A.track(C.AA.THEME_CREATED,{theme_id:t.duplicateTheme.id,name:t.duplicateTheme.name,type:"duplicate"}),E({title:x.ag._({id:"DvRoa4",values:{0:t.duplicateTheme.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}))}).catch(e=>{console.error("Couldn't duplicate theme ".concat(f.name," error: ").concat(e)),E({title:x.ag._({id:"aOi88n",values:{err:e}}),status:"error",duration:3e3,position:"top",isClosable:!1})})},[O,N,f,F,U,A,E]),G=f.workspaceId&&!!(null===(i=f.createdBy)||void 0===i?void 0:i.displayName),H=!!b,K=!_;return(0,s.jsxs)(d.xu,{ref:D,bgColor:y?"trueblue.100":I?void 0:"linen.50",textAlign:"left",tabIndex:H?0:void 0,borderRadius:"md",transitionProperty:I?"common":"none",transitionDuration:"normal",outline:"none",onClick:()=>null==b?void 0:b(f),onKeyPress:e=>{H&&"Enter"===e.key&&(null==b||b(f))},_hover:H?{shadow:I||y?void 0:"lg",bgColor:y?"trueblue.100":I?"trueblue.50":"gray.100"}:void 0,_focus:{boxShadow:y||!H?void 0:"outline"},shadow:I?void 0:"md",p:I?2:0,"data-theme-id":f.id,"data-testid":y?"current-theme-preview":void 0,cursor:H?"pointer":void 0,children:[(0,s.jsx)(R.n,{theme:f,minH:"9em",maxH:"9em"}),(0,s.jsxs)(c.k,{align:"baseline",mt:1,direction:"column",p:I?0:2,children:[G&&(0,s.jsx)(c.k,{my:2,children:(0,s.jsx)(er,{name:U,isChecked:y})}),(0,s.jsxs)(l.U,{alignItems:"flex-start",w:"100%",children:[G?(0,s.jsx)(m.l,{createdByYou:(null===(t=f.createdBy)||void 0===t?void 0:t.id)===(null==O?void 0:O.id),createdByName:null===(n=f.createdBy)||void 0===n?void 0:n.displayName,createdByProfileImageUrl:null===(r=f.createdBy)||void 0===r?void 0:r.profileImageUrl,timestampDescription:f.updatedTime&&(0,s.jsx)(h.cC,{id:"E1dtM3",values:{0:(0,j.Dw)(f.updatedTime)}})}):(0,s.jsx)(er,{name:U,isChecked:y}),(0,s.jsx)(u.L,{}),K?null:f.workspaceId&&!f.archived?(0,s.jsx)(el,{theme:f,openThemeEditorWithThisTheme:k(!1),onDuplicate:z,onArchiveThemeModalOpen:T,isArchiveThemeModalOpen:w,onArchiveThemeModalClose:P}):f.workspaceId&&!0===f.archived?(0,s.jsx)(L,{theme:f}):(0,s.jsx)(B,{onCustomizeThemeClick:k(!0),onEditThemeClick:k(!1)})]})]})]})});eo.displayName="ThemePreview"},53596:function(e,i,t){"use strict";t.d(i,{n:function(){return f}});var s=t(52322),n=t(28535),l=t(82554),r=t(38035),o=t(77533),a=t(73200),d=t(5879),c=t(2784),u=t(50260),h=t(5200),x=t(13608),p=t(22569),m=t(87205),g=t(15151),j=t(27333),C=t(5995),v=t(89098);let f=(0,c.memo)(e=>{var i;let{theme:t,variant:c="outline",...f}=e,{contentStyles:y}=t.config,_=(0,p.R5)(t),S=(0,u.wj)(t),A=(0,C.l)(t),E=(0,g.J)(t,!1),I=(0,v.c)(t),D=(0,p.wh)(_,S,m.Iv),k=null===(i=t.config.accentBackgrounds)||void 0===i?void 0:i[0],w=k?(0,p.wh)(k,S,m.Iv):{},T=k?{display:"grid",gridTemplateRows:"minmax(2.5em, auto) auto",gridTemplateAreas:'"accent" "body"',gridTemplateColumns:"1fr",overflow:"hidden"}:{},P=b(t);return(0,s.jsxs)(n.xu,{css:A,sx:E,w:"100%",pos:"relative",children:[P&&null===t.workspaceId&&(0,s.jsx)(l.C,{pos:"absolute",right:-1,top:-1,zIndex:1,colorScheme:"green",children:(0,s.jsx)(d.cC,{id:"isRobC"})}),(0,s.jsxs)(r.k,{borderTopRadius:"ghost"===c?"none":"md",boxShadow:"sm",_focus:{boxShadow:"outline"},p:"1em",transitionProperty:"common",transitionDuration:"normal",...D,backgroundAttachment:"initial",direction:"row",align:"center",...f,children:[(0,s.jsx)(h.P,{theme:t}),(0,s.jsxs)(n.xu,{sx:{...I.cardSx,...y},...T,borderRadius:"base",className:"".concat(x.pL," ").concat(S?"is-dark":""),color:S?"white":"gray.900",flex:1,pointerEvents:"none",children:[k&&(0,s.jsx)(n.xu,{gridArea:'"accent"',...w}),(0,s.jsxs)(n.xu,{gridArea:k?'"body"':void 0,py:k?2:4,px:4,children:[(0,s.jsx)(o.x,{className:"block-title",mt:"0 !important",mb:"".concat(k?"0":"var(--chakra-space-1)"," !important"),children:(0,s.jsx)(o.x,{as:"span",className:(0,a.cx)("title",j.A8),fontSize:"1.6em !important",paddingBottom:"0 !important",children:(0,s.jsx)(d.cC,{id:"MHrjPM"})})}),(0,s.jsx)(o.x,{fontSize:"0.9em !important",noOfLines:3,className:"block block-paragraph",my:"0 !important",children:(0,s.jsx)(d.cC,{id:"U41VTK",components:{0:(0,s.jsx)(o.x,{as:"a",className:"link"})}})})]})]})]})]})});f.displayName="ThemePreviewThumbnail";let b=e=>{if(!e.createdTime)return!1;let i=new Date(e.createdTime),t=new Date;return t.setDate(t.getDate()-30),i>t}},86963:function(e,i,t){"use strict";t.d(i,{g:function(){return d}});var s=t(9850),n=t.n(s),l=t(2784),r=t(47749);let o={theme:r.mU,themeValidationError:null,status:"new",themeBackgroun
1dImgStatus:"idle",themeLogoImgStatus:"idle",customizationStep:null,originalTheme:null};function a(e,i){switch(i.type){case"NEW_BLANK_THEME":return{...n()(o),customizationStep:"customization"};case"THEME_RESET":return n()(o);case"SET_THEME_EDITING":{let{theme:t}=i.data,s=n()(t);return{...e,status:"editing",theme:t,originalTheme:s,customizationStep:"customization"}}case"SET_NEW_THEME_FOR_SELECTING":{let{theme:t}=i.data;return{...e,status:"new",theme:t,customizationStep:"selection"}}case"SET_NEW_THEME_FOR_CUSTOMIZING":{let{theme:t}=i.data,s=n()(t);return{...e,theme:t,originalTheme:s,customizationStep:"customization"}}case"THEME_UPDATE_THEME_PROPS":{let{theme:t}=e,{themeProps:s}=i.data;return{...e,theme:{...t,...s}}}case"THEME_UPDATE_THEME_CONFIG":{let{theme:t}=e,{themeConfig:s}=i.data;return{...e,theme:{...t,config:{...t.config,...s}}}}case"THEME_UPDATE_THEME_KEYWORDS":{let{theme:t}=e,{keywords:s}=i.data;return{...e,theme:{...t,config:{...t.config,keywords:{color:[],tone:[],...t.config.keywords,...s}}}}}case"THEME_BACKGROUND_IMAGE_UPLOAD_STARTED":{let{theme:t}=e,{background:s}=i.data;
1return{...e,themeBackgroundImgStatus:"loading",theme:{...t,config:{...t.config,background:s}}}}case"THEME_BACKGROUND_UPDATE_SUCCESS":{let{theme:t}=e,{background:s}=i.data;return{...e,themeBackgroundImgStatus:"idle",theme:{...t,config:{...t.config,background:s}}}}case"THEME_BACKGROUND_IMAGE_UPLOAD_FAIL":return{...e,themeBackgroundImgStatus:"idle"};case"THEME_LOGO_UPLOAD_STARTED":return{...e,themeLogoImgStatus:"loading"};case"THEME_LOGO_UPLOAD_SUCCESS":{let{theme:t}=e,{logoUrl:s}=i.data;return{...e,themeLogoImgStatus:"idle",theme:{...t,logoUrl:s}}}case"THEME_LOGO_UPLOAD_FAIL":return{...e,themeLogoImgStatus:"idle"};case"THEME_UPDATE_THEME_NAME":{let{theme:t}=e,{name:s}=i.data;return{...e,theme:{...t,name:s},themeValidationError:null}}case"THEME_VALIDATION_ERROR":{let{errorMessage:t}=i.data;return{...e,themeValidationError:t}}case"THEME_VALIDATION_ERROR_RESET":return{...e,themeValidationError:null}}}function d(){return l.useReducer(a,o)}},46409:function(e,i,t){"use strict";t.d(i,{Y:function(){return F}});var s=t(52322),n=t(84586),l=t(28165),r=t(2784),o=t(13608),a=t(71997),d=t(4878);let c={fontSize:"var(--chakra-fontSizes-sm) !important",fontFamily:'"Inter", sans-serif !important',fontWeight:"500 !important",lineHeight:"1.5 !important",textTransform:"none",letterSpacing:"normal !important",textAlign:"left !important",margin:"0 !important",color:"var(--chakra-colors-gray-900) !important",background:"none !important",blockquote:{borderLeftWidth:"0px !important",borderLeftStyle:"solid !important",borderLeftColor:"transparent !important",padding:"0 !important",color:"var(--chakra-colors-gray-900) !important",fontStyle:"normal !important"},border:"0 none !important",padding:"0 !important",content:'""'},u={...c,color:"var(--chakra-colors-blue-500) !important","&:hover":{textDecoration:"underline"},cursor:"pointer"},h={"p,h1,h2,h3,h4,h5,h6, .title, .section-title":{...c,margin:0},a:u,"ul, ol":{marginLeft:"1.2em"},blockquote:{borderLeft:"3px solid var(--chakra-colors-gray-200)",paddingLeft:"0.5em"},color:"var(--chakra-colors-gray-900) !important",wordBreak:"break-word",lineHeight:"1.5 !important",letterSpacing:"normal !important",".mention":{bgColor:"trueblue.50",whiteSpace:"break-spaces"}},x={fontFamily:'"Inter", sans-serif !important',fontWeight:"500","@media screen and (max-width: 30rem)":{".controls-wrapper":{}},"@media screen and (min-width: 30rem)":{".controls-wrapper":{paddingLeft:"var(--comment-padding)"},".controls-wrapper__gridLayout, .controls-wrapper__gallery":{paddingLeft:"calc(-1 * var(--grid-padding) + var(--comment-padding))"}},".comments-list":{".comments-sign-up":{a:{...c,...u,fontSize:"xs",color:"gray.500",fontWeight:"bold","&:hover":{color:"gray.500",textDecoration:"underline"}}},".comment":{".reactions-row ul":{marginLeft:"auto"},".comment-date":{fontSize:"var(--chakra-fontSizes-xs) !important",color:"var(--chakra-colors-gray-500) !important"},...h},".block-image":{"&.is-focused":{"img, .image, .placeholder":{boxShadow:"var(--chakra-shadows-outline)"}}},".block-target-html":{"p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,li, .title, .section-title":{...c,"::after":c},a:{...u},li:{margin:"0 !important",padding:"0 !important",listStyle:"none !important",p:{margin:0}},img:{maxWidth:"200px",maxHeight:"80px"}}},".comment-editor .ProseMirror":{...h,"\n      @media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2),\n      @media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3),\n      @media only screen and (max-device-width: 640px) and (-webkit-min-device-pixel-ratio: 4)\n    ":{fontSize:"16px  !important"},padding:"12px",borderRadius:"5px","&.focus-visible":{boxShadow:"0 0 0 2px rgb(49, 130, 206)"},"a.image-link":{pointerEvents:"none"}}};var p=t(73235),m=t(56974),g=t.n(m),j=t(24992),C=t(93814),v=t(65301);function f(){let e=(0,p._)(["\n  0% {\n    box-shadow: ",";\n  }\n  7%,\n  60% {\n    box-shadow: var(--link-box-shadow);\n  }\n  100% {\n    box-shadow: ",";\n  }\n"]);return f=function(){return e},e}function b(){let e=(0,p._)(["\n  0% \n  100% {\n    box-shadow: ",";\n  }\n"]);return b=function(){return e},e}let y="0 0 0 0 rgba(0, 0, 0, 0.0)",_=(0,l.F4)(f(),y,y),S=(0,l.F4)(b(),y);var A=t(12304);let E={"math-display":{fontSize:"1.125em",".katex":{whiteSpace:"normal"}},"math-inline":{"&.ProseMirror-selectednode":{marginY:"-0.25em"}},"math-display, math-inline":{"&.ProseMirror-selectednode":{boxShadow:"outline",borderRadius:"var(--box-border-radius)",backgroundColor:"gray.100",padding:".25em",marginX:"3px",".math-src":{color:"gray.700"}}}};var I=t(49354),D=t(58879),k=t(87254);let w=e=>({".block-smartLayout":{'[data-node-view-content-outer="smartLayout"]':{display:"contents"},'[data-node-view-content-inner="smartLayout"]':{display:"contents"},"[data-selection-ring]":{outlineStyle:"none",outlineWidth:"1px",outlineColor:"var(--grid-outline-color)"},'[data-selection-ring="padded"]':{outlineOffset:"0.25em",".add-button":{m:"-0.25em"}},"&:not(.is-focused)":{"[data-content-empty=true] > [data-node-view-content]":{height:0}},"&.is-focused":{"[data-content-empty=true]":{"[placeholder]::before":D.BI}},["&.is-focused, &:hover, &[".concat(v.r,"]")]:{".is-editable":{"[data-selection-ring]":{outlineStyle:"solid"},".add-button":{opacity:1}}}},".node-smartLayoutCell":{display:"contents","> [data-node-view-wrapper]":{display:"contents"},"--heading-placeholder":(0,D.iI)(k.ag._({id:"HX5SVx"})),'[data-node-view-content-inner="smartLayoutCell"] > .first-block':{mt:[0,0]},'[data-node-view-content-inner="smartLayoutCell"] > .last-block':{mb:[0,0]},".slash-menu-prompt":{display:"none"},".block-heading, .block-title":{...(0,I.iL)(e).tight},".block-paragraph":{...(0,I.YW)(e).tight}}});var T=t(97676),P=t(89),O=t(46741);
1function N(){let e=(0,p._)(["\n  0% {\n    align-items: flex-start;\n    grid-template-rows: 0.2fr;\n    overflow: hidden;\n  }\n  99% {\n    align-items: flex-start;\n    overflow: hidden;\n  }\n  100% {\n    align-items: initial;\n    grid-template-rows: 1fr;\n    overflow: visible;\n  }\n"]);return N=function(){return e},e}let L=(0,l.F4)(N()),R=e=>({height:"100%",outlineWidth:"0px",lineHeight:e?"1.6 !important":A.I0,"&.is-focused":{".is-empty":{"[data-placeholder]":{_after:D.BI},"[data-multiline-placeholder]":{position:"relative",_after:D.cY,"> [data-node-view-content-inner]":{position:"absolute",width:"100%",minH:"1em"}}}},"--block-margin":(0,I.l1)(e),"--box-border-color":"var(--chakra-colors-blackAlpha-200)","--grid-border":"1px","--grid-padding":"1.22em","&.is-dark":{"--box-border-color":"var(--chakra-colors-whiteAlpha-400)",".block-blockquote":{blockquote:{borderLeftColor:"var(--accent-color)"}},...T.KX.dark,...P.E_.dark},".block-card":{"&.expandable-node":{"&-selected .expandable-selected":{animation:"".concat(_," 3000ms ease-in-out forwards")},"&-reset .expandable-selected":{animation:"".concat(S)}}},".block":{my:"var(--block-margin)",fontFamily:"var(--body-font)",fontWeight:"var(--body-font-weight)",color:"var(--body-color)"},"&.is-nested":{display:"grid",animation:"".concat(L," ").concat(C.nY,"ms ease-out forwards")},"&.is-full-width":{".block.is-full-width":{width:"var(--full-width)",position:"relative",left:"50%",transform:"translateX(-50%)"}},'[data-node-view-content-inner="cardLayoutItem"], [data-node-view-content-inner="card"]':{"> .first-block":{mt:"0em"},"> .last-block":{mb:"0em"}},"a.link":{color:"var(--text-color, var(--link-color))",cursor:"pointer",fontWeight:"bold",textDecoration:"underline",'&[href=""]':{textDecorationStyle:"dashed"},"&:hover":{color:"var(--link-color-hover)"},"&:active":{color:"var(--link-color-hover)"}},".block-toggle":{"&.expandable-node":{"&-selected .toggle":{animation:"".concat(_," 3000ms ease-in-out forwards")},"&-reset .toggle":{animation:"".concat(S)}},'[data-open="false"]':{'[data-node-view-content-inner="toggle"]':{"> :not(:first-child)":{display:"none"}}}},...A.g6,...T.KX.default,...P.E_.default,...O.dE,...E,".block-codeBlock":{pre:{fontFamily:"mono",fontSize:I.um.codeBlock,"@media print":{fontSize:g()(I.um.codeBlock)},color:"var(--body-color)",background:"var(--accent-color-background-muted)",borderRadius:"var(--box-border-radius)",overflow:"hidden",code:{display:"block",padding:".75em 1em"}}},code:{backgroundColor:"var(--accent-color-background-muted)",color:"var(--body-color)",...T.FC},".block-blockquote":{blockquote:{pl:"1.5em"}},".block-embed, .block-video":{"&.expandable-node":{"&-selected":{".embed-preview, .embed-viewer, .video-player":{animation:"".concat(_," 3000ms ease-in-out forwards")}},"&-reset":{".embed-preview, .embed-viewer, .video-player":{animation:"".concat(S)}}}},".block-image":{"&.expandable-node":{"&-selected":{"[data-selection-ring]":{animation:"".concat(_," 3000ms ease-in-out forwards")}},"&-reset ":{"[data-selection-ring]":{animation:"".concat(S)}}}},".block-contributors":{".contributors-list":{fontSize:"1.25em",fontWeight:"bold"}},".mention":{bgColor:"var(--accent-color-100)"},".block-gallery":{mx:"calc(-1 * var(--grid-padding))",my:"calc(-0.25 * var(--grid-padding))",".gallery":{px:"var(--grid-padding)",py:"calc(0.75 * var(--grid-padding))",border:"1px solid",borderColor:"transparent",borderRadius:"var(--box-border-radius)",".add-image":{mb:"calc(0.75 * var(--grid-padding))"},["&.".concat(j.A)]:{border:"1px dashed var(--chakra-colors-trueblue-300) !important",backgroundColor:"var(--chakra-colors-trueblue-50) !important",".gallery-placeholder":{pointerEvents:"none"}}},"&.is-focused, &.is-empty":{".gallery":{backgroundColor:"blackAlpha.50"}},["&.is-focused, &:hover, &[".concat(v.r,"]")]:{".gallery":{borderColor:"var(--grid-outline-color)"},".add-image":{opacity:1}},"&.expandable-node":{"&-selected .gallery":{animation:"".concat(_," 3000ms ease-in-out forwards")},"&-reset .gallery":{animation:"".concat(S)}}},...w(e),".block-gridLayout":{mx:"calc(-1 * var(--grid-padding))",".layout-content":{display:"contents","> div":{display:"contents"}},".grid-cell":{position:"relative",height:"100%",paddingX:"var(--grid-padding)",display:"flex",flexDirection:"column",outlineWidth:"1px",outlineStyle:"none",outlineColor:"var(--grid-outline-color)",".block-gallery":{my:"0"}},["&.is-focused, &:hover, &[".concat(v.r,"]")]:{".is-editable":{".grid-cell":{outlineStyle:"solid"}},".add-column":{opacity:1}}},".node-cardLayoutItem, .node-cardAccentLayoutItem":{position:"relative",display:"flex",flexDirection:"column",justifyContent:"stretch",minWidth:0,minHeight:0,"> [data-node-view-wrapper]":{position:"relative",height:"100%",width:"100%"}},".node-cardNotes":{display:"none"},".block-table":{table:{'[data-node-view-content-inner="table"]':{display:"contents",'[data-node-view-content-inner="tableRow"]':{display:"contents"},td:{verticalAlign:"top",".block-heading [data-placeholder]::before":{display:"none"}}}},td:{minWidth:"3em",paddingX:"1em",position:"relative",".block":{maxWidth:e?"75vw":void 0},"&:not(:first-of-type)":{borderLeft:"1px solid transparent"}},".selectedCell:after":{zIndex:2,position:"absolute",content:'""',left:0,right:0,top:0,bottom:0,backgroundColor:"trueblue.100",pointerEvents:"none",opacity:.4},"&.is-focused, &:hover":{"td:not(:first-of-type)":{borderLeft:"1px solid var(--grid-outline-color)"}}},".tippy-arrow":{borderLeftColor:"red"},".footnote-label":{textDecoration:"underline",textDecorationColor:"var(--link-color)",_hover:{bgColor:"var(--accent-color-100)",color:"gray.800",borderRadius:"sm"}},".footnote":{color:"var(--link-color)",_hover:{_after:{bgColor:"var(--accent-color-100)",color:"gray.800"}}},".node-emoji":{color:"initial"},".block-paragraph":{...(0,A.v0)("default")},".block-heading":{...(0,I.iL)(e).default,".heading":{position:"relative"},'.heading[level="1"]':{...(0,A.v0)("h1")},'.heading[level="2"]':{...(0,A.v0)("h2")},'.heading[level="3"]':{...(0,A.v0)("h3")},'.heading[level="4"]':{...(0,A.v0)("h4")}},".block-title":{...(0,I.iL)(e).default,".title":{position:"relative",...(0,A.v0)("title")}}
1,".node-gridLayout, .node-calloutBox":{".block-heading, .block-title":{...(0,I.iL)(e).compact},".block-paragraph":{...(0,I.YW)(e).compact}},".block-table td":{".block":{...(0,I.YW)(e).tight},".block-heading, .block-title":{...(0,I.iL)(e).tight}},'[data-node-view-content-inner="card"]:not(:has(> .node-cardAccentLayoutItem)) [data-node-view-content-inner="cardLayoutItem"] > .first-block:not(.last-block)':{"&.block-heading, &.block-title":{"&:not(:has(+ .block-heading, + .block-title, + .node-gridLayout))":{mb:(0,I.iL)(e).relaxed.mb}}},'[data-node-view-content-inner="cardLayoutItem"] > .first-block:not(.last-block)':{"&.block-paragraph":{...(0,I.YW)(e).compact,"+ .block-heading, + .block-title":{mt:(0,I.iL)(e).compact.mt}},'&.block-heading:has([level="2"], [level="3"], [level="4"])':{mb:(0,I.iL)(e).compact.mb,"+ .block-heading, + .block-title":{mt:(0,I.iL)(e).compact.mt}}}});var M=t(3561);let F=(0,r.memo)(()=>{let e=(0,d.TZ)();return(0,s.jsx)(l.xB,{styles:i=>{let t={[".".concat(o.pL)]:R(e),[".".concat(M.G)]:x,[".".concat(a.d)]:a.l};if(!t)return;let s=(0,n.iv)(t)(i);return s}})});F.displayName="GlobalCardStyles"},58879:function(e,i,t){"use strict";t.d(i,{BI:function(){return s},cY:function(){return n},iI:function(){return l}});let s={content:"attr(data-placeholder)",position:"absolute",top:0,opacity:.25,pointerEvents:"none",left:0,width:"100%",color:"var(--heading-color)",lineClamp:1,textOverflow:"ellipsis",overflow:"hidden",boxOrient:"vertical",wordBreak:"break-all",height:"100%",whiteSpace:"nowrap"},n={...s,content:"attr(data-multiline-placeholder)",color:"inherit",position:"relative",lineClamp:0,whiteSpace:"normal",wordBreak:"normal"},l=e=>'"'.concat(e,'"')},12136:function(e,i,t){"use strict";t.d(i,{e:function(){return m}});var s=t(52322),n=t(70065),l=t(5879),r=t(5632),o=t(2784),a=t(93202),d=t(49165),c=t(11050),u=t(84405),h=t(36651),x=t(41425),p=t(23147);let m=()=>{let[e]=(0,a.So6)({refetchQueries:["GetDocs"]}),{push:i}=(0,r.useRouter)(),t=(0,n.p)(),{user:m,currentWorkspace:g}=(0,h.SE)(),j=(0,c.z$)(),C=(0,o.useCallback)(async n=>{var r;let{docId:o,docTitle:a,initialContent:h,channelId:C,source:v,openThemeEditor:f,onSuccess:b,newWindow:y}=n,_=null==m?void 0:null===(r=m.settings)||void 0===r?void 0:r.needsEditorOnboarding;if(!o)return Promise.reject(Error("Cannot duplicate without a docId"));let S=t({id:"duplicate-toast-".concat(o),isClosable:!1,position:"top",status:"loading",variant:"light",duration:null,title:(0,s.jsx)(l.cC,{id:"OvEjsP"})});return m&&(null==g?void 0:g.id)?e({variables:{duplicateDocInput:{orgId:null==g?void 0:g.id,sourceDocId:o,source:d.R[v],initialContent:h?{ydoc:(0,p.qI)(h),schemaVersion:x.bI,editors:[null==m?void 0:m.id]}:void 0,...C?{channels:[{channelId:C}]}:{}}}}).then(e=>{var n,r,d;if(!(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.duplicateDoc))throw Error("No data received");null==j||j.track(c.AA.EXAMPLE_DUPLICATED,{doc_id:o,title:a,source:v});let h=null==e?void 0:null===(d=e.data)||void 0===d?void 0:null===(r=d.duplicateDoc)||void 0===r?void 0:r.id;(0,u.Q)({doc_id:h,source:v,source_doc_id:o}),console.debug("[Duplicate.".concat(v,"] Doc duplicated New doc id (").concat(h,"). Navigating to Editor")),t.update(S,{status:"success",description:(0,s.jsx)(l.cC,{id:"zzDlyQ"}),duration:5e3,isClosable:!0});let x=f?"/docs/".concat(h).concat(f?"?openThemeEditor=true":""):_?"/docs/".concat(h,"?tour=true"):"/docs/".concat(h);y?window.open(x,"_blank"):i(x),b&&h&&b(h)},e=>{console.error("[Duplicate.".concat(v,"] Error duplicating doc:"),e.message),t.update(S,{title:(0,s.jsx)(l.cC,{id:"ADJtFi"}),description:e.message,status:"error",duration:null,isClosable:!0})}).catch(e=>{console.error("[Duplicate.".concat(v,"] Error duplicating doc:"),e.message),t.update(S,{title:(0,s.jsx)(l.cC,{id:"ADJtFi"}),description:e.message,status:"error",duration:null,isClosable:!0})}):(console.error("[Duplicate.".concat(v,"] Cannot duplicate without a user or workspace"),{user:m}),Promise.reject(Error("Cannot duplicate without a user or workspace")))},[null==g?void 0:g.id,m,t,e,j,i]);return C}},17324:function(e,i,t){"use strict";t.d(i,{a:function(){return I}});var s=t(52322),n=t(28535),l=t(43297),r=t(35183),o=t(97166),a=t(7344),d=t(59905),c=t(73481),u=t(17993),h=t(85573),x=t(62614),p=t(94523),m=t(5879),g=t(87254),j=t(2784),C=t(93202),v=t(94199),f=t(36651);let b=[{id:"consulting",label:()=>
1g.ag._({id:"m5xed+"})},{id:"creator",label:()=>g.ag._({id:"UE2beD"})},{id:"customer_service",label:()=>g.ag._({id:"FfYIy2"})},{id:"data",label:()=>g.ag._({id:"HKH+W+"})},{id:"design",label:()=>g.ag._({id:"f8fH8W"})},{id:"education",label:()=>g.ag._({id:"aqxYLv"})},{id:"engineering",label:()=>g.ag._({id:"SUXBxp"})},{id:"finance",label:()=>g.ag._({id:"8V6XO3"})},{id:"human_resources",label:()=>g.ag._({id:"aDLrMs"})},{id:"leadership",label:()=>g.ag._({id:"HyFz7F"})},{id:"legal",label:()=>g.ag._({id:"vifyyw"})},{id:"marketing",label:()=>g.ag._({id:"vo2a+a"})},{id:"operations",label:()=>g.ag._({id:"B1MDds"})},{id:"product",label:()=>g.ag._({id:"K47k8R"})},{id:"recruiting",label:()=>g.ag._({id:"bn0SqF"})},{id:"sales",label:()=>g.ag._({id:"mUv9U4"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],y={"get-started":{saveButtonText:()=>g.ag._({id:"ZDIydz"}),formControlMaxW:["100%","80%","70%"],categoryQuestion:()=>g.ag._({id:"kJizcc"})},modal:{saveButtonText:()=>g.ag._({id:"hQRttt"}),formControlMaxW:["100%","60%"],categoryQuestion:()=>g.ag._({id:"06/kLN"})},setup:{saveButtonText:()=>g.ag._({id:"xGVfLh"}),formControlMaxW:["100%"],categoryQuestion:()=>g.ag._({id:"kJizcc"})}},_=[{id:"work",label:()=>g.ag._({id:"rgBHdd"})},{id:"education",label:()=>g.ag._({id:"RKJfzm"})},{id:"personal",label:()=>g.ag._({id:"jo0oU2"})}],S=[{id:"primary",label:()=>g.ag._({id:"LldObG"})},{id:"secondary",label:()=>g.ag._({id:"AtXGMV"})},{id:"university",label:()=>g.ag._({id:"DEb9mB"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],A=[{id:"student",label:()=>g.ag._({id:"a0qEkS"})},{id:"teacher",label:()=>g.ag._({id:"lypRAW"})},{id:"administrator",label:()=>g.ag._({id:"Faptqt"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],E=[{id:"friend",label:()=>g.ag._({id:"Gw0M4G"})},{id:"internet",label:()=>g.ag._({id:"mRh0Qq"})},{id:"search",label:()=>g.ag._({id:"z4/LHW"})},{id:"tiktok",label:()=>g.ag._({id:"zyUxcw"})},{id:"instagram",label:()=>g.ag._({id:"zzlbbf"})},{id:"youtube",label:()=>g.ag._({id:"9Q6UKX"})},{id:"linkedin",label:()=>g.ag._({id:"gggTBm"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],I=e=>{let{onSuccess:i,onError:t,context:I="get-started"}=e,{user:D,refetch:k}
1=(0,f.SE)(),[w,T]=(0,j.useState)(!1),[P,O]=(0,j.useState)(void 0),[N,L]=(0,j.useState)(void 0),[R,M]=(0,j.useState)(!1),[F,U]=(0,j.useState)(void 0),[z,{loading:B,error:G}]=(0,C.kDo)(),[H,K]=(0,j.useState)(void 0),[V,W]=(0,j.useState)("student"),q="education"===F||"education"===P?H&&V:F,Y=P&&!F,X=(0,j.useCallback)(()=>{let e="education"===F||"education"===P?"".concat(F,"_").concat(V,"_").concat(H):F;z({variables:{input:{id:null==D?void 0:D.id,referrer:N,jobFunction:e}}}).then(()=>(T(!0),null==k?void 0:k())).then(()=>{i&&i()}).catch(e=>{console.error('[GetStarted.UserInfo] Error updating user info "'.concat(null==D?void 0:D.id,'"'),e.message),T(!1),t&&t()})},[F,H,V,t,i,N,k,z,null==D?void 0:D.id,P]),{formControlMaxW:Z,saveButtonText:Q,categoryQuestion:J}=y[I];return(0,s.jsx)(n.xu,{w:"100%",children:(0,s.jsxs)(l.K,{pt:6,alignItems:"center",spacing:6,alignSelf:"center",mb:10,children:[(0,s.jsxs)(r.NI,{maxW:Z,as:"fieldset",isRequired:!0,children:[(0,s.jsx)(o.l,{children:J()}),(0,s.jsx)(a.E,{onChange:e=>{O(e),"education"===e&&"education"!==F?U("education"):U(void 0)},value:P,children:(0,s.jsx)(l.K,{direction:"column",spacing:2,children:_.map(e=>{let{id:i,label:t}=e;return(0,s.jsx)(d.Y,{value:i,children:t()},i)})})})]}),P&&(0,s.jsxs)(s.Fragment,{children:["education"!==P&&(0,s.jsxs)(r.NI,{maxW:Z,isRequired:!0,children:[(0,s.jsx)(o.l,{children:(0,s.jsx)(m.cC,{id:"SYYw/x"})}),(0,s.jsx)(c.P,{placeholder:g.ag._({id:"rjLlrw"}),isRequired:!0,value:F,onChange:e=>{let i=e.target.value;"work"===P&&"education"===i&&W("teacher"),U(i)},children:b.map((e,i)=>{let{label:t,id:n}=e;return(0,s.jsx)("option",{value:n,children:t()},"".concat(n,"-").concat(i))})})]}),("education"===P||"education"===F)&&(0,s.jsxs)(r.NI,{maxW:Z,isRequired:!0,children:[(0,s.jsx)(o.l,{children:(0,s.jsx)(m.cC,{id:"B+ClFT"})}),(0,s.jsxs)(u.g,{spacing:2,children:[(0,s.jsx)(c.P,{placeholder:g.ag._({id:"rjLlrw"}),isRequired:!0,value:V,onChange:e=>{W(()=>e.target.value)},children:A.map((e,i)=>{let{label:t,id:n}=e;return(0,s.jsx)("option",{value:n,children:t()},"".concat(n,"-").concat(i))})}),(0,s.jsx)(c.P,{placeholder:g.ag._({id:"rNbKca"}),isRequired:!0,onChange:e=>{K(()=>e.target.value)},value:H,children:S.map((e,i)=>{let{label:t,id:n}=e;return(0,s.jsx)("option",{value:n,children:t()},"".concat(n,"-").concat(i))})})]}),(0,s.jsx)(r.Q6,{fontSize:"xs",children:(0,s.jsx)(m.cC,{id:"9sEdx4"})})]}),(0,s.jsxs)(r.NI,{maxW:Z,children:[(0,s.jsx)(o.l,{children:(0,s.jsx)(m.cC,{id:"bxuHg8"})}),(0,s.jsxs)(u.g,{spacing:2,children:[(0,s.jsx)(c.P,{placeholder:g.ag._({id:"rjLlrw"}),value:R?"other":N,onChange:e=>{"other"===e.target.value?(M(!0),L("")):(M(!1),L(e.target.value))},children:E.map((e,i)=>{let{label:t,id:n}=e;return(0,s.jsx)("option",{value:n,children:t()},"".concat(n,"-").concat(i))})}),R&&(0,s.jsx)(h.I,{type:"text",value:N,onChange:e=>{L(e.target.value)}})]}),(0,s.jsx)(r.Q6,{fontSize:"xs",children:N&&(null==N?void 0:N.length)>4?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.cC,{id:"RNrV8M",values:{GRANT_PROPER_NOUN:v.XI}})," ",(0,s.jsx)("span",{role:"img","aria-label":g.ag._({id:"8K1shM"}),children:"\uD83D\uDE4F"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.cC,{id:"Bhgibl",values:{GRANT_PROPER_NOUN:v.XI}})," ",(0,s.jsx)("span",{role:"img","aria-label":g.ag._({id:"bh5RqM"}),children:"\uD83D\uDE0A"})]})})]})]}),(0,s.jsx)(l.K,{alignItems:"center",spacing:4,pt:4,children:(0,s.jsx)(p.kH,{label:(0,s.jsx)(m.cC,{id:"5G+MQW"}),isDisabled:!Y,placement:"top",children:(0,s.jsx)(n.xu,{children:(0,s.jsx)(x.z,{variant:"solid",size:"lg",isDisabled:w||!!G||!q,isLoading:B||w,onClick:X,children:Q()})})})})]})})}},7603:function(e,i,t){"use strict";t.d(i,{o:function(){return r}});var s=t(89220),n=t(2784),l=t(36651);let r=()=>{let{push:e}=(0,s.useRouter)(),{userStatus:i}=(0,l.SE)();(0,n.useEffect)(()=>{"loggedOut"===i&&e("/signin?redirect_to=".concat(encodeURIComponent(window.location.href)))},[i,e])}},52610:function(e,i,t){"use strict";t.d(i,{My:function(){return o},rK:function(){return c},r_:function(){return a},up:function(){return d}});var s=t(52322),n=t(5879),l=t(87254),r=t(93202);let o=1,a=()=>
1l.ag._({id:"cyLJM2"}),d=()=>l.ag._({id:"6h5uMS"}),c={[r.r3E.Admin]:{title:(0,s.jsx)(n.cC,{id:"U3pytU"}),description:(0,s.jsx)(n.cC,{id:"U4MLdj"})},[r.r3E.Member]:{title:(0,s.jsx)(n.cC,{id:"OvoEq7"}),description:(0,s.jsx)(n.cC,{id:"nslZjr"})}}},79737:function(e,i,t){"use strict";let s;t.r(i),t.d(i,{HomePage:function(){return t6},default:function(){return t9}});var n=t(52322),l=t(71537),r=t(18896),o=t(7603),a=t(46929),d=t(55478),c=t(29117),u=t(43297),h=t(82554),x=t(74409),p=t(38035),m=t(75009),g=t(77533),j=t(75768),C=t(62614),v=t(11082),f=t(28535),b=t(69251),y=t(30523),_=t(67109),S=t(42946),A=t(49929),E=t(5879),I=t(34498),D=t.n(I),k=t(5632),w=t.n(k),T=t(2784),P=t(93202),O=t(42111),N=t(46759),L=t(36651),R=t(40651),M=t(97763),F=t(57124),U=t(11050),z=t(64663),B=t(90221);let G=()=>{let{isOpen:e,onOpen:i,onClose:t}=(0,d.q)({id:"ai-credits-modal"}),{isOpen:s,onOpen:l,onClose:r}=(0,d.q)({id:"create-site-modal"}),o=(0,F._O)(),a=(0,O.ye)("createSiteAi");(0,U.z$)();let m=o&&(!(0,B.s2)()||(0,B.s2)()),{push:j}=(0,k.useRouter)(),{credits:v,hasEnoughCreditsToGenerateDeck:b}=(0,M.qO)(),[y,_]=(0,T.useState)(!1),I=(0,T.useCallback)(async()=>{_(!0),await j("/create/generate?ref=sites-dashboard"),_(!1)},[j]),{displayName:D,ariaLabel:w,icon:P}=z.A5[z.oc.SITES];return(0,n.jsxs)(p.k,{flex:"1",mb:(0,B.s2)()?0:4,direction:"column",children:[(0,n.jsx)(f.xu,{w:["100%","auto"],children:(0,n.jsx)(c.U,{h:"1.5em",children:(0,n.jsxs)(x.X,{fontSize:"lg",fontWeight:"600","data-testid":"sites-view-header",children:[(0,n.jsx)(A.G,{icon:P,"aria-label":w})," ",(0,n.jsx)(g.x,{as:"span",ml:2,children:D})]})})}),m&&(0,n.jsxs)(p.k,{flex:"1",mb:(0,B.s2)()?0:4,direction:"column",children:[(0,n.jsxs)(u.K,{direction:{base:"column",lg:"row"},spacing:2,mt:4,children:[a&&(0,n.jsx)(C.z,{"data-testid":"create-from-aipartner-button",variant:"solid",onClick:I,isLoading:y,leftIcon:(0,n.jsx)(A.G,{icon:S.r8p}),rightIcon:(0,n.jsx)(h.C,{colorScheme:"trueblue",textShadow:"none",children:"AI"}),children:(0,n.jsx)(E.cC,{id:"6/5iNu"})}),!(0,B.s2)()&&(0,n.jsx)(C.z,{w:"auto","data-testid":"create-site-button",isDisabled:!o,variant:a?"plain":"solid",onClick:l,leftIcon:(0,n.jsx)(A.G,{icon:S.r8p}),children:(0,n.jsx)(E.cC,{id:"h3eRam"})})]}),(0,n.jsx)(R.H,{credits:v,isOpen:e,onClose:t,onOpen:i}),(0,n.jsx)(N.M,{isOpen:s,onClose:r})]})]})};var H=t(11881),K=t(82729),V=t(36474),W=t(87254),q=t(39097),Y=t.n(q),X=t(90763),Z=t(16426),Q=t(15041),J=t(10625),$=t(67046),ee=t(32899),ei=t(332),et=t(99058),es=t(27599),en=t(25481),el=t(94523),er=t(48832);let eo=e=>{var i,t,s;let{site:l}=e,{isOpen:r,onOpen:o,onClose:a}=(0,d.q)({id:"site-menu-".concat(null==l?void 0:l.id)}),c=l&&(0,Q.AR)({site:l,path:"/"});return l?(0,n.jsxs)(J.v,{isLazy:!0,closeOnSelect:!1,children:[(0,n.jsx)($.j,{"data-dashboard-site-menu":!0,as:ee.h,size:"xs",variant:"ghost",borderRadius:"full",onClick:o,icon:(0,n.jsx)(A.G,{fixedWidth:!0,icon:S.cNd}),color:"gray.400",_hover:{color:"gray.800",bg:"gray.200"},children:(0,n.jsx)(E.cC,{id:"7L01XJ"})}),r&&l&&(0,n.jsx)(ei.h,{children:(0,n.jsxs)(et.q,{maxW:"sm",zIndex:"overlay",children:[(0,n.jsxs)(f.xu,{px:4,py:0,wordBreak:"break-word",children:[(0,n.jsx)(g.x,{children:null==l?void 0:l.name}),(0,n.jsx)(g.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,n.jsx)(E.cC,{id:"MXSt4t",values:{0:(0,er.p6)(null==l?void 0:l.createdTime,"MMMM do, yyyy")}})}),(null==l?void 0:null===(i=l.createdBy)||void 0===i?void 0:i.email)&&(null==l?void 0:null===(t=l.createdBy)||void 0===t?void 0:t.email)&&(0,n.jsx)(el.kH,{label:null==l?void 0:null===(s=l.createdBy)||void 0===s?void 0:s.email,children:(0,n.jsx)(g.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,n.jsx)(E.cC,{id:"t490IT",values:{0:l.createdBy.displayName}})})})]}),c&&(null==l?void 0:l.currentDeployment)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(es.R,{}),(0,n.jsx)(en.s,{href:c,as:Y(),target:"_blank",icon:(0,n.jsx)(A.G,{fixedWidth:!0,icon:S.ZE5}),children:(0,n.jsx)(E.cC,{id:"OHFiKG"})})]})]})})]}):(0,n.jsx)(n.Fragment,{})},ea=e=>"recent"===e||"favorites"===e,ed=e=>({all:{ready:!0,filter:{}},recent:{ready:!0,filter:{sortBy:{field:P.IX5.LastViewed,direction:P.SrV.Desc}}},private:{ready:!0,filter:{isPrivate:!0}},createdByYou:{ready:!!e,filter:{createdBy:null==e?void 0:e.id}},favorites:{ready:!0,filter:{sortBy:{field:P.IX5.Favorited,direction:P.SrV.Desc}}}}),ec=e=>{let{sortBy:i,filterBy:t,docUser:s,doc:l}=e;if("favorites"===t)return(0,n.jsx)(E.cC,{id:"8a9FIL",values:{0:(0,er.Dw)(null==s?void 0:s.favorited)}});if("recent"===t)return(0,n.jsx)(E.cC,{id:"yJynx8",values:{0:(0,er.Dw)(null==s?void 0:s.lastViewed)}});let r={[P.IX5.LastViewed]:(0,n.jsx)(E.cC,{id:"yJynx8",values:{0:(0,er.Dw)(null==s?void 0:s.lastViewed)}}),[P.IX5.CreatedTime]:(0,n.jsx)(E.cC,{id:"oJFw5Q",values:{0:(0,er.Dw)(null==l?void 0:l.createdTime)}}),[P.IX5.EditedTime]:(0,n.jsx)(E.cC,{id:"yxz5Og",values:{0:(0,er.Dw)(null==l?void 0:l.editedTime)}})};return(null==r?void 0:r[i])||(0,n.jsx)(E.cC,{id:"yxz5Og",values:{0:(0,er.Dw)(null==l?void 0:l.editedTime)}})};var eu=t(78462);let eh=e=>{var i;let{site:t,doc:s,sortBy:l,filterBy:r}=e,{user:o}=(0,L.SE)(),a=(null==t?void 0:t.createdBy)||(null==s?void 0:s.createdBy),d=(null==t?void 0:t.previewUrl)||(null==s?void 0:null===(i=s.titleCard)||void 0===i?void 0:i.previewUrl),{docUser:x}=s||{},j=s&&ec({sortBy:l,docUser:x,filterBy:r,doc:s}),C=null==t?void 0:t.id,v=(null==s?void 0:s.id)?s.id:t&&"routes"in t?(0,Q.eQ)(t):void 0,b=(0,Q.Zz)((0,Q.ms)(null==t?void 0:t.domains))[0],_=(0,T.useMemo)(()=>v&&C&&(0,eu.yQ)({docId:v}),[v,C]),I=(null==t?void 0:t.enabled)&&!(null==t?void 0:t.archived)&&!(null==s?void 0:s.archived);return _?(0,n.jsxs)(H.f,{as:y.P,bg:"linen.50",borderRadius:"5px",shadow:"md",_focusWithin:{shadow:"outline",_hover:{shadow:"outline"}},cursor:"pointer",_hover:{shadow:"lg",bgColor:"gray.100"},transition:"box-shadow .2s ease",role:"group",className:"highlight-mask",children:[(0,n.jsx)(f.xu,{pos:"absolute",top:-2,left:2,right:2,bottom:"calc(66%)",border:"1px solid var(--chakra-colors-blackAlpha-300)",bg:"whiteAlpha.600",zIndex:0,borderRadius:"md"}),(0,n.jsx)(f.xu,{pos:"absolute",top:-1,left:1,right:1,bottom:"calc(66%)",bg:"whiteAlpha.900",border:"1px solid var(--chakra-colors-blackAlpha-400)",zIndex:0,borderRadius:"md"}),(0,n.jsxs)(p.k,{direction:"column",wordBreak:"break-word",alignContent:"space-between",height:"100%",bg:"white",_hover:{bgColor:"gray.100"},borderBottomRadius:"md",children:[(0,n.jsx)(H.A,{href:_,as:Y(),borderRadius:"md",children:(0,n.jsx)(K.o,{ratio:40/21,bgColor:"gray.100",children:(0,n.jsxs)(p.k,{borderBottomWidth:"1px",borderBottomColor:"gray.100",pos:"relative",overflow:"hidden",borderTopRadius:"md",children:[(0,n.jsx)(m.E,{src:d,fit:"cover",fallbackSrc:Z.Z.src}),(null==t?void 0:t.enabled)&&(0,n.jsx)(h.C,{pos:"absolute",size:"xs",bottom:2,left:2,colorScheme:"blackAlpha",bg:"gray.100",color:"gray.600",textTransform:"none",children:(0,n.jsxs)(c.U,{spacing:1,children:[(0,n.jsx)(A.G,{fixedWidth:!0,icon:S.Xj}),(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"ebQKK7"})})]})})]})})}),(0,n.jsxs)(p.k,{p:3,position:"relative",direction:"column",justifyContent:"space-between",h:"100%",alignItems:"flex-start",children:[(0,n.jsx)(H.A,{href:_,as:Y(),children:(0,n.jsxs)(u.K,{spacing:0,mb:2,children:[(0,n.jsx)(g.x,{noOfLines:2,children:null==t?void 0:t.name}),(0,n.jsxs)(c.U,{children:[(null==t?void 0:t.faviconUrl)&&(0,n.jsx)(m.E,{maxW:"16px",maxH:"16px",src:null==t?void 0:t.faviconUrl}),(0,n.jsx)(g.x,{noOfLines:1,color:"gray.500",fontSize:"xs",wordBreak:"break-all",children:null==b?void 0:b.name})]})]})}),(0,n.jsx)(p.k,{direction:"column",w:"100%",children:(0,n.jsxs)(p.k,{mt:2,align:"flex-start",w:"100%",justify:"space-between",children:[a&&(0,n.jsx)(X.l,{createdByYou:a.id===(null==o?void 0:o.id),createdByName:a.displayName||W.ag._({i
1d:"rtir7c"}),createdByProfileImageUrl:a.profileImageUrl,timestampDescription:j}),(0,n.jsx)(V.L,{}),I&&(0,n.jsx)(eo,{site:t})]})})]})]})]}):(0,n.jsx)(n.Fragment,{})};var ex=t(74008),ep=t(71113);let em=e=>{let{setIsSidebarVisible:i,isSidebarVisible:t,children:s}=e,{currentWorkspace:l}=(0,L.SE)();return(0,n.jsxs)(f.xu,{w:"100%",mb:6,maxW:"100%",children:[(0,n.jsxs)(f.xu,{w:"100%",display:{sm:"block",md:"none"},mb:4,children:[(0,n.jsxs)(p.k,{align:"center",w:"100%",mb:2,justify:"space-between",children:[(0,n.jsx)(ee.h,{"aria-label":"Open Sidebar",variant:"ghost",icon:(0,n.jsx)(A.G,{icon:S.xiG}),size:"sm",mr:2,ml:-2,onClick:()=>i(!t),isRound:!0}),(0,n.jsxs)(p.k,{flex:"1",w:"100%",justify:"space-between",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:[(0,n.jsx)(g.x,{fontSize:"lg",fontWeight:"600",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:null==l?void 0:l.name}),(0,n.jsx)(V.L,{}),(0,n.jsx)(ep.DY,{})]})]}),(0,n.jsx)(ex.i,{})]}),s]})},eg={base:"repeat(1, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(2, 1fr)",lg:"repeat(3, 1fr)",xl:"repeat(4, 1fr)","2xl":"repeat(5, 1fr)"},ej=e=>{let{isSidebarVisible:i,setIsSidebarVisible:t}=e,{currentWorkspace:s}=(0,L.SE)(),l=(0,O.ye)("createSiteAi"),{push:r}=(0,k.useRouter)(),{isOpen:o,onOpen:a,onClose:I}=(0,d.q)({id:"create-site-modal"}),[w,R]=(0,T.useState)(!1),{data:M,loading:F,error:U}=(0,P.bBo)({variables:{workspaceId:null==s?void 0:s.id},skip:!(null==s?void 0:s.id),fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"}),z=(0,T.useCallback)(async()=>{l?(R(!0),await r("/create/generate?ref=sites-dashboard"),R(!1)):a()},[l,a,r]),B=(null==M?void 0:M.sites)&&D()(null==M?void 0:M.sites,"updatedTime","desc");return!B||0!==B.length||F||U?(0,n.jsxs)(f.xu,{w:"100%","data-testid":"sites-view-container",children:[(0,n.jsx)(em,{isSidebarVisible:i,setIsSidebarVisible:t,children:(0,n.jsx)(G,{})}),(0,n.jsxs)(u.K,{children:[F&&(0,n.jsxs)(b.r,{templateColumns:eg,gap:6,children:[(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:_.O}),(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:_.O}),(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:_.O})]}),!F&&!U&&(0,n.jsx)(b.r,{templateColumns:eg,gap:6,children:null==B?void 0:B.map(e=>(0,n.jsx)(eh,{site:e},e.id))})]}),(0,n.jsx)(N.M,{isOpen:o,onClose:I})]}):(0,n.jsxs)(c.U,{spacing:4,flex:1,h:"100%",maxW:"3xl",margin:"auto",children:[(0,n.jsxs)(u.K,{align:"flex-start",justify:"center",spacing:6,flex:1,children:[(0,n.jsx)(c.U,{children:(0,n.jsx)(h.C,{colorScheme:"green",children:(0,n.jsx)(E.cC,{id:"YBt9YP"})})}),(0,n.jsx)(x.X,{fontFamily:"p22-mackinac-pro",fontWeight:"700",children:(0,n.jsx)(E.cC,{id:"2xMidw"})}),(0,n.jsx)(p.k,{flex:1,display:{base:"flex",lg:"none"},children:(0,n.jsx)(m.E,{src:"https://cdn.gamma.app/zc87vhr30n8uf3n/9f0b4d71d10f4d388e50febe89bb1853/optimized/Sal-Chill-Cloud.svg"})}),(0,n.jsx)(g.x,{fontSize:"lg",children:(0,n.jsx)(E.cC,{id:"Vg3hxF"})}),(0,n.jsxs)(j.h,{size:"lg",children:[(0,n.jsx)(C.z,{variant:"solid",onClick:z,isLoading:w,children:(0,n.jsx)(E.cC,{id:"JHMOcq"})}),(0,n.jsx)(C.z,{as:v.r,variant:"plain",isExternal:!0,href:"https://help.gamma.app/en/articles/8429268-how-to-publish-your-page-to-a-custom-domain",rightIcon:(0,n.jsx)(A.G,{icon:S.gJF}),children:(0,n.jsx)(E.cC,{id:"zwWKhA"})})]})]}),(0,n.jsx)(p.k,{flex:1,display:{base:"none",lg:"flex"},children:(0,n.jsx)(m.E,{src:"https://cdn.gamma.app/zc87vhr30n8uf3n/9f0b4d71d10f4d388e50febe89bb1853/optimized/Sal-Chill-Cloud.svg"})}),(0,n.jsx)(N.M,{isOpen:o,onClose:I})]})};var eC=t(70189),ev=t(80774),ef=t(79443),eb=t(109),ey=t(46402),e_=t(14223),eS=t(16710),eA=t(35138);let eE=e=>'[data-doc-grid-item-id="'.concat(e,'"]'),eI=T.memo(e=>{let{user:i,currentWorkspace:t,currentChannelId:s,viewPreference:l}=e,r=(0,O.ye)("screenshotsEnabled"),o=(0,T.useRef)(null),a=(0,T.useRef)(null),[d,u]=(0,T.useState)(null),h=(0,ey.N)(),x=h.getMonitor();(0,T.useEffect)(()=>x.subscribeToOffsetChange(()=>{let e=x.getItem();if(!e||!o.current||!a.current)return;let i=x.getClientOffset();if(!i)return;let{x:t,y:s}=i;o.current.style.transform="translate(".concat(t,"px, ").concat(s,"px)")}),[x]),(0,T.useEffect)(()=>x.subscribeToStateChange(()=>{let e=x.getItemType(),i=x.getItem();if(e!==eA.c||null===i){u(null),o.current.style.transform="translate(0px, 0px)";return}let t=document.querySelector(eE(i.id));if(t){let e=t.getBoundingClientRect();a.current.style.width="".concat(e.width,"px"),a.current.style.height="".concat(e.height,"px")}u(i)}),[x]);let m=(0,T.useMemo)(()=>{var e,o,a,u,h;if(!d)return null;let x=(0,eS.nZ)({doc:d,user:i,currentWorkspace:t,channelToExclude:s}
1),m={src:r?null===(e=d.titleCard)||void 0===e?void 0:e.previewUrl:Z.Z.src,fallbackSrc:Z.Z.src};return"list"===l?(0,n.jsx)(eC.i,{width:"100%",children:(0,n.jsxs)(ev.Tr,{children:[(0,n.jsx)(ef.Td,{}),(0,n.jsx)(ef.Td,{w:"50%",children:d.title||""}),(0,n.jsx)(ef.Td,{children:(0,n.jsx)(el.MY,{tags:x,NextLink:Y()})}),(0,n.jsx)(ef.Td,{color:"gray.600"}),(0,n.jsx)(ef.Td,{children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(eb.q,{shadow:"md",borderWidth:"1px",size:"xs",src:null==d?void 0:null===(u=d.createdBy)||void 0===u?void 0:u.profileImageUrl}),(0,n.jsx)(g.x,{children:null==d?void 0:null===(h=d.createdBy)||void 0===h?void 0:h.displayName})]})})]})}):(0,n.jsx)(e_.F7,{id:"temp",title:d.title||"",thumbnailImageUrl:m,NextLink:p.k,createdTime:d.createdTime,href:"",editors:d.editors,tags:x,createdByName:(null===(o=d.createdBy)||void 0===o?void 0:o.displayName)||"",createdByProfileImageUrl:null===(a=d.createdBy)||void 0===a?void 0:a.profileImageUrl,createdByEmail:"",menuEnabled:!1})},[d,i,t,r,s,l]);return(0,n.jsx)(ei.h,{children:(0,n.jsx)(p.k,{ref:o,display:d?"block":"none",position:"fixed",pointerEvents:"none",zIndex:"overlay",left:0,top:0,children:(0,n.jsx)(p.k,{ref:a,transform:"scale(".concat(d?.5:1,")"),transition:"transform .2s ease",transformOrigin:"0 0",children:m})})})});eI.displayName="DocGridItemCustomDragLayer";var eD=t(92843);function ek(){return s||((s=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),s}let ew=(0,T.memo)(e=>{let{user:i,currentWorkspace:t,doc:s,currentChannelId:l,sortBy:r,filterBy:o,canDuplicate:a,canEditDoc:d,canManageDoc:c,createdByYou:u,cardThumbnails:h,fetchThumbnails:x,handleDuplicateDoc:p,handleFavoriteDoc:m,handleTrash:g,handlePermanentDelete:j,handleRestoreDoc:C,handleShareClick:v,handleRenameClick:f,handleRemoveFromChannel:b}=e,{id:y,title:_,createdTime:S,archived:A,titleCard:E,docUser:I,createdBy:D}=s,k=ec({sortBy:r,docUser:I,filterBy:o,doc:s}),w=(0,O.ye)("screenshotsEnabled"),P=(0,eS.nZ)({doc:s,user:i,currentWorkspace:t,channelToExclude:l}),N={src:w?null==E?void 0:E.previewUrl:Z.Z.src,fallbackSrc:Z.Z.src},L=!!l,R=!!s.site,[M,F,U]=(0,eD.c)({type:eA.c,item:()=>s,options:{dropEffect:"copy",doc:s},collect:e=>({isDragging:e.isDragging()})},[c,s]);(0,T.useEffect)(()=>{U(ek())},[U]);let z=(0,T.useCallback)(()=>{w&&x(s.id)},[s.id,x,w]);return R?(0,n.jsx)(eh,{site:s.site,doc:s,filterBy:o,sortBy:r}):(0,n.jsx)(e_.F7,{ref:F,id:y,title:_||"",thumbnailImageUrl:N,NextLink:Y(),href:(0,eu.Gn)({docId:y}),createdByYou:u,createdTime:S,timestampDescription:k,createdByName:(null==D?void 0:D.displayName)||"",createdByProfileImageUrl:null==D?void 0:D.profileImageUrl,createdByEmail:(null==D?void 0:D.email)||"",isDuplicateEnabled:a,isShareEnabled:d,isRenameEnabled:d,isTrashAndRestoreEnabled:c,isTrashed:A,isFavorited:!!(null==I?void 0:I.favorited),isRemoveFromChannelEnabled:L,onDuplicate:()=>p(s),onFavorite:m(new Date,s),onUnfavorite:m(null,s),onTrash:()=>g(s.id),onPermanentDelete:j?()=>j(s):void 0,onRestore:()=>C(s.id),onShareClick:()=>v(s.id),onRename:()=>f(s),onRemoveFromChannel:()=>b(s,l),tags:P,menuEnabled:!0,cardThumbnails:w?h:[],onMouseEnter:z},y)});ew.displayName="DocGridItemWrapper";var eT=t(56581),eP=t(44035);let eO=e=>{var i;let{sortBy:t,sortDirection:s,setSortBy:l,setSortDirection:r,size:o="sm",dateDisplayOption:a,setDateDisplayOption:d,options:c,showSortOrderToggle:u}=e;return(0,n.jsxs)(j.h,{variant:"ghost",colorScheme:"blackAlpha",size:o,ml:-3,children:[(0,n.jsxs)(J.v,{closeOnSelect:!1,children:[(0,n.jsx)($.j,{as:C.z,variant:"ghost",size:o,rightIcon:(0,n.jsx)(A.G,{icon:S.ptq,"aria-label":"Open menu"}),fontWeight:"600",color:"gray.500",children:(null===(i=c.find(e=>e.key===a))||void 0===i?void 0:i.label)||"Date"}),(0,n.jsx)(ei.h,{children:(0,n.jsx)(et.q,{minWidth:"240px",children:(0,n.jsx)(eP._,{fontSize:"sm",defaultValue:"alpha",title:W.ag._({id:"IEY4J0"}),type:"radio",children:c.map(e=>{let i=a===e.key;return(0,n.jsx)(en.s,{icon:i?(0,n.jsx)(eT.n,{}):(0,n.jsx)(f.xu,{w:3}),value:e.key,onClick:()=>{d(e.key),l(e.key),r(P.SrV.Desc)},children:e.label},e.key)})})})})]}),u&&(0,n.jsx)(el.kH,{label:(0,n.jsx)(E.cC,{id:"TZml21"}),children:(0,n.jsx)(ee.h,{color:"title"!==t?"gray.700":"gray.300","aria-label":"sort",onClick:()=>{t!==P.IX5.Title?r(s===P.SrV.Asc?P.SrV.Desc:P.SrV.Asc):r(P.SrV.Desc),l(a)},icon:(0,n.jsx)(A.G,{icon:S.RXu})})})]})};var eN=t(14093),eL=t(78534),eR=t(5832),eM=t(66983),eF=t(54933),eU=t(76644),ez=t(20678),eB=t(89099),eG=t(73871),eH=t(31807);let eK=e=>{var i,t;let{doc:s,dateDisplayOption:n}=e,l=null==s?void 0:s.updatedTime;n===P.IX5.LastViewed&&(l=null==s?void 0:null===(i=s.docUser)||void 0===i?void 0:i.lastViewed),n===P.IX5.Favorited&&(l=null==s?void 0:null===(t=s.docUser)||void 0===t?void 0:t.favorited),n===P.IX5.CreatedTime&&(l=null==s?void 0:s.createdTime);try{return"".concat((0,eG.Z)(new Date,(0,eH.Z)(l))," ago")}catch(e){return"--"}},eV=e=>{var i,t,s;let{doc:l,dateDisplayOption:r}=e,o=(0,eu.Gn)({docId:l.id}),a=eK({doc:l,dateDisplayOption:r}),{site:d}=l||{};return(0,n.jsxs)(ev.Tr,{_hover:{bg:"blackAlpha.50"},role:"group","data-doc-list-item-id":l.id,children:[(0,n.jsx)(ef.Td,{}),(0,n.jsx)(ef.Td,{minW:"280px",children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(Y(),{href:o,passHref:!0,legacyBehavior:!0,children:(0,n.jsx)(v.r,{_hover:{color:"var(--chakra-colors-trueblue-500) !important"},children:(null==d?void 0:d.name)||l.title})}),(0,n.jsx)(h.C,{size:"xs",colorScheme:"blackAlpha",bg:"gray.100",color:"gray.600",textTransform:"none",children:(0,n.jsxs)(c.U,{spacing:1,children:[(0,n.jsx)(A.G,{fixedWidth:!0,icon:S.Xj}),(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"ebQKK7"})})]})}),(null==d?void 0:d.routes)&&(null==d?void 0:null===(i=d.routes)||void 0===i?void 0:i.length)>1&&(0,n.jsx)(h.C,{colorScheme:"blackAlpha",bg:"gray.100",color:"gray.600",children:(0,n.jsxs)(c.U,{spacing:1,children:[(0,n.jsx)(A.G,{fixedWidth:!0,icon:S.s2}),(0,n.jsx)(g.x,{children:null==d?void 0:d.routes.length})]})})]})}),(0,n.jsx)(ef.Td,{zIndex:2,_groupHover:{opacity:1}}),(0,n.jsx)(ef.Td,{color:"gray.600",pr:-2,children:(0,n.jsx)(g.x,{children:a})}),(0,n.jsx)(ef.Td,{alignContent:"center",pr:-2,children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(eb.q,{shadow:"md",borderWidth:"1px",size:"xs",src:null==l?void 0:null===(t=l.createdBy)||void 0===t?void 0:t.profileImageUrl}),(0,n.jsx)(g.x,{children:null==l?void 0:null===(s=l.createdBy)||void 0===s?void 0:s.displayName})]})}),(0,n.jsx)(ef.Td,{isNumeric:!0,children:(0,n.jsx)(eo,{site:l.site})})]},l.id)},eW=e=>{var i,t;let{doc:s,dateDisplayOption:n}=e,l=null==s?void 0:s.updatedTime;n===P.IX5.LastViewed&&(l=null==s?void 0:null===(i=s.docUser)||void 0===i?void 0:i.lastViewed),n===P.IX5.Favorited&&(l=null==s?void 0:null===(t=s.docUser)||void 0===t?void 0:t.favorited),n===P.IX5.CreatedTime&&(l=null==s?void 0:s.createdTime);try{return"".concat((0,eG.Z)(new Date,(0,eH.Z)(l))," ago")}catch(e){return"--"}},eq=e=>{var i,t,s;let{doc:l,handleShareClick:r,dateDisplayOption:o,tags:a,handleFavoriteDoc:d,user:u,menu:h,canManageDoc:x}=e,p=(0,eu.Gn)({docId:l.id}),m=eW({doc:l,dateDisplayOption:o}),[j,f,b]=(0,eD.c)({type:eA.c,item:()=>l,options:{dropEffect:"copy",doc:l},collect:e=>({isDragging:e.isDragging()})},[x,l]);return((0,T.useEffect)(()=>{b(ek())},[b]),l.site)?(0,n.jsx)(eV,{doc:l,dateDisplayOption:o}):(0,n.jsxs)(ev.Tr,{ref:f,_hover:{bg:"blackAlpha.50"},role:"group","data-doc-list-item-id":l.id,children:[(0,n.jsx)(ef.Td,{children:d&&(0,n.jsx)(e_._6,{isFavorited:!!(null==l?void 0:null===(i=l.docUser)||void 0===i?void 0:i.favorited),onFavorite:d(new Date,l),onUnfavorite:d(null,l)})}),(0,n.jsx)(ef.Td,{minW:"280px",children:(0,n.jsx)(Y(),{href:p,passHref:!0,legacyBehavior:!0,children:(0,n.jsx)(v.r,{_hover:{color:"var(--chakra-colors-trueblue-500) !important"},children:l.title||""})})}),(0,n.jsx)(ef.Td,{zIndex:2,_groupHover:{opacity:1},children:(0,n.jsxs)(eB.E,{_groupHover:{opacity:1},children:[(0,n.jsx)(el.MY,{tags:a,NextLink:Y(),overflowButtonLabel:W.ag._({i
1d:"K0UBDD"})}),(0,eS.uG)(l,u)?(0,n.jsxs)(C.z,{size:"xs",variant:"ghost",colorScheme:"blackAlpha",fontWeight:"500",_hover:{color:"gray.800",bg:"blackAlpha.50"},opacity:0,_groupHover:{opacity:1},transitionProperty:"none",onClick:()=>r(l.id),children:[(0,n.jsx)(E.cC,{id:"Z8lGw6"}),"…"]}):null]})}),(0,n.jsx)(ef.Td,{color:"gray.600",pr:-2,children:(0,n.jsx)(g.x,{children:m})}),(0,n.jsx)(ef.Td,{alignContent:"center",pr:-2,children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(eb.q,{shadow:"md",borderWidth:"1px",size:"xs",src:null==l?void 0:null===(t=l.createdBy)||void 0===t?void 0:t.profileImageUrl}),(0,n.jsx)(g.x,{children:null==l?void 0:null===(s=l.createdBy)||void 0===s?void 0:s.displayName})]})}),(0,n.jsx)(ef.Td,{isNumeric:!0,children:!!h&&h})]},l.id)},eY=(e,i)=>{let t=ea(e),s=t?eU.Kk:eU.en,n=!t||"recent"===e&&i===P.IX5.LastViewed||"favorites"===e&&i===P.IX5.Favorited;return{displayOptions:s,showSortOrderToggle:n,enableTitleSort:!t}},eX=e=>{let{user:i,currentWorkspace:t,userHasNoWorkspaces:s,docs:l,currentChannelId:r,dateDisplayOption:o,sortBy:a,sortDirection:d,setDateDisplayOption:c,setSortBy:u,setSortDirection:h,filterBy:x,handleDuplicateDoc:p,handleFavoriteDoc:m,handleTrash:g,handlePermanentDelete:j,handleRestoreDoc:v,handleShareClick:b,handleRenameClick:y,handleRemoveFromChannel:_}=e,S=(0,L.we)(),{displayOptions:I,showSortOrderToggle:D,enableTitleSort:k}=eY(x,o);return(0,n.jsx)(eN.x,{pt:4,maxW:"100%",children:(0,n.jsxs)(eC.i,{colorScheme:"blackAlpha",size:"sm",whiteSpace:"normal",variant:"simple",children:[(0,n.jsx)(eL.h,{children:(0,n.jsxs)(ev.Tr,{color:"gray.800",children:[(0,n.jsx)(eR.Th,{w:4}),(0,n.jsxs)(eR.Th,{justifyContent:"space-between",minW:"280px",children:[k&&(0,n.jsx)(C.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{u(P.IX5.Title),h(d===P.SrV.Asc?P.SrV.Desc:P.SrV.Asc)},rightIcon:(0,n.jsx)(f.xu,{color:a===P.IX5.Title?"gray.700":"gray.300",children:(0,n.jsx)(A.G,{icon:a===P.IX5.Title?d===P.SrV.Asc?eF.eW2:eF.l1h:eF.CmM})}),children:(0,n.jsx)(E.cC,{id:"MHrjPM"})}),!k&&"Title"]}),(0,n.jsx)(eR.Th,{children:(0,n.jsx)(E.cC,{id:"HSh8u/"})}),(0,n.jsx)(eR.Th,{w:32,pr:-2,children:(0,n.jsx)(eO,{size:"sm",sortBy:a,sortDirection:d,setSortBy:u,setSortDirection:h,options:I,showSortOrderToggle:D,exclude:[P.IX5.Title],dateDisplayOption:o,setDateDisplayOption:c})}),(0,n.jsx)(eR.Th,{w:32,children:(0,n.jsx)(E.cC,{id:"UE2beD"})}),(0,n.jsx)(eR.Th,{})]})}),(0,n.jsx)(eM.p,{children:null==l?void 0:l.map(e=>{var l,a,d;let c=S.can("view",e)&&!s,u=S.can("manage",e)&&!s,h=S.can("edit",e)&&!s,x=(0,eS.nZ)({doc:e,user:i,currentWorkspace:t,channelToExclude:r}),C=!!r;return(0,n.jsx)(eq,{canManageDoc:u,user:i,tags:x,doc:e,dateDisplayOption:o,handleFavoriteDoc:m,handleShareClick:b,menu:(0,n.jsx)(e_.Ot,{href:(0,eu.Gn)({docId:e.id}),title:(0,ez.$)(e.title),createdByName:(null==e?void 0:null===(l=e.createdBy)||void 0===l?void 0:l.displayName)||"",createdByEmail:(null==e?void 0:null===(a=e.createdBy)||void 0===a?void 0:a.email)||"",createdTime:e.createdTime,isDuplicateEnabled:c,isTrashAndRestoreEnabled:u,isRenameEnabled:h,isRemoveFromChannelEnabled:C,isShareEnabled:h,isTrashed:!!(null==e?void 0:e.archived),isFavorited:null===(d=e.docUser)||void 0===d?void 0:d.favorited,onDuplicate:()=>p(e),onFavorite:m(new Date,e),onUnfavorite:m(null,e),onTrash:()=>g(e.id),onPermanentDelete:j?()=>j(e):void 0,onRestore:()=>v(e.id),onShareClick:()=>b(e.id),onRename:()=>y(e),onRemoveFromChannel:()=>_(e,r)})},e.id)})})]})})};var eZ=t(42822),eQ=t(51456),eJ=t(70065),e$=t(94199);let e0=e=>{let{refetchQueries:i}=e,{user:t}=(0,L.SE)(),s=(0,eJ.p)(),[l]=(0,P.LT4)({refetchQueries:i}),[r,{loading:o}]=(0,P.y2l)({refetchQueries:i}),[a]=(0,P.iX9)({refetchQueries:i}),[d]=(0,P.$4k)({refetchQueries:i}),c=(0,T.useCallback)((e,i)=>()=>{if(!t||!i)return;let s={input:{docId:i.id,userId:null==t?void 0:t.id,favorited:e}};d({variables:s,update:(e,t)=>{let{data:s}=t;e.writeFragment({id:"Doc:".concat(i.id),fragment:P.VRt,data:{docUser:null==s?void 0:s.updateDocUser}})},optimisticResponse:{updateDocUser:{...i.docUser,favorited:s.input.favorited,__typename:"DocUser"}}})},[d,t]),u=(0,T.useCallback)(e=>{let i={id:e};
1a({variables:i,optimisticResponse:{unarchiveDoc:{...i,archived:!1,__typename:"Doc"}}}).then(()=>{s({title:(0,n.jsx)(E.cC,{id:"nRyNMz"}),status:"success",duration:1e4,position:"top"})})},[a,s]),h=(0,T.useCallback)(e=>{let i={id:e};l({variables:i,optimisticResponse:{archiveDoc:{...i,archived:!0,__typename:"Doc"}}}).then(()=>{s({title:(0,n.jsxs)(g.x,{children:[(0,n.jsx)(E.cC,{id:"i3Wq9L",values:{GAMMA_ARTIFACT_PROPER_NOUN:e$.Yc}})," ",(0,n.jsx)(v.r,{textDecoration:"underline",onClick:()=>u(e),children:(0,n.jsx)(E.cC,{id:"9uI/rE"})})]}),status:"success",duration:3e3,position:"top",isClosable:!0})})},[l,u,s]),x=(0,T.useCallback)(e=>r({variables:{id:e},update:i=>{i.evict({id:i.identify({__typename:"Doc",id:e})}),i.gc()},optimisticResponse:{deleteDoc:e}}).then(()=>{s({title:(0,n.jsx)(E.cC,{id:"sOg7tZ",values:{GAMMA_ARTIFACT_PROPER_NOUN:e$.Yc}}),position:"top",status:"success",duration:3e3})}).catch(()=>{s({title:(0,n.jsx)(E.cC,{id:"SlfejT"}),description:(0,n.jsx)(E.cC,{id:"fWsBTs"}),status:"error",duration:3e3,position:"top",isClosable:!0})}),[r,s]);return{favoriteDoc:c,restoreDoc:u,trashDoc:h,permanentlyDeleteDoc:x,isPermanentlyDeletingDoc:o}};var e1=t(92850),e2=t(26468),e5=t(22226),e3=t(54326),e4=t(2338),e6=t(97217),e9=t(50250);let e7=e=>{let{onClose:i,doc:t}=e,{permanentlyDeleteDoc:s,isPermanentlyDeletingDoc:l}=e0({refetchQueries:["GetDocs","GetChannelDocActivity"]}),r=(0,T.useCallback)(()=>{s&&s(t.id).then(i)},[t.id,i,s]);return(0,n.jsxs)(e1.u_,{onClose:i,isOpen:!0,children:[(0,n.jsx)(e2.Z,{}),(0,n.jsxs)(e5.h,{children:[(0,n.jsx)(e3.x,{children:(0,n.jsx)(E.cC,{id:"u85NBF"})}),(0,n.jsx)(e4.o,{isDisabled:l}),(0,n.jsx)(e6.f,{children:(0,n.jsxs)(u.K,{spacing:4,children:[(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"dLUUOA",values:{0:t.title}})}),(0,n.jsx)(g.x,{color:"red.500",children:(0,n.jsx)(E.cC,{id:"2xOCJW"})})]})}),(0,n.jsx)(e9.m,{children:(0,n.jsxs)(j.h,{children:[(0,n.jsx)(C.z,{variant:"ghost",onClick:i,children:(0,n.jsx)(E.cC,{id:"dEgA5A"})}),(0,n.jsx)(C.z,{variant:"ghost",colorScheme:"red",onClick:r,isLoading:l,children:(0,n.jsx)(E.cC,{id:"0Lbaux"})})]})})]})]})};var e8=t(34613),ie=t(60740),ii=t(8174),it=t(12136),is=t(64368);let il=e=>{var i,t;let{activeTab:s,currentChannelId:n,channelPreview:l,filterBy:r,sortBy:o,sortDirection:a,user:d,currentWorkspace:c}=e,u=(0,O.ye)("channelActivity"),h={filter:{},ready:!0};n?h={filter:{channelId:n,...ed(d)[r].filter},ready:!0}:s===z.oc.ALL||s===z.oc.SITES?h=ed(d)[r]:s===z.oc.TRASH&&(h={filter:{archived:!0},ready:!0});let x={workspaceId:null==c?void 0:c.id,first:50,archived:!1,...h.filter,sortBy:{field:s===z.oc.TRASH?eU.j7.includes(o)?P.IX5.EditedTime:o:"recent"===r?P.IX5.LastViewed:"favorites"===r?P.IX5.Favorited:o,direction:a}},p=!!(null==l?void 0:l.id),m=n||(null==l?void 0:l.id),{data:g,networkStatus:j,fetchMore:C}=(0,P.HHH)({variables:x,skip:!d||!h.ready||p,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",n
1otifyOnNetworkStatusChange:!0}),{data:v}=(0,P.sCo)({variables:{first:50,channelId:null==l?void 0:l.id},skip:!p}),f=!u||!m,{data:b,subscribeToMore:y}=(0,P.nJh)({variables:{first:50,channelId:m},skip:f,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first"});(0,T.useEffect)(()=>{if(y&&!f)return y({document:P.EMb,variables:{channelId:m},updateQuery:(e,i)=>{let{subscriptionData:t}=i;if(!t.data||!t.data.channelDocActivity)return e;let s=t.data.channelDocActivity,n=s.slice(0,50).map(e=>({node:e}));return{channelDocActivity:{edges:n,pageInfo:e.channelDocActivity.pageInfo,__typename:"DocActivityConnection"}}}})},[m,y,f]);let _=p?null==v?void 0:v.previewChannelDocs:null==g?void 0:g.docs,S=(null==b?void 0:null===(i=b.channelDocActivity)||void 0===i?void 0:i.edges)&&(null==b?void 0:null===(t=b.channelDocActivity)||void 0===t?void 0:t.edges.map(e=>e.node).filter(e=>e.editors&&e.editors.length>0||e.presenters&&e.presenters.length>0))||void 0,A=null==_?void 0:_.edges.map(e=>e.node).filter(e=>{var i;return!n||(null==e?void 0:null===(i=e.channels)||void 0===i?void 0:i.find(e=>e.id===n))}),E=null==g?void 0:g.docs.pageInfo,I=null==E?void 0:E.endCursor,D=(0,T.useCallback)(()=>C({variables:{after:I}}),[C,I]),k=[is.I.loading,is.I.setVariables].includes(j),w=!k&&(null==E?void 0:E.hasNextPage)&&(null==E?void 0:E.endCursor);return console.debug("%c[useDocsData]","background-color:aqua",{sortBy:o,sortDirection:a,filterInfo:h,variables:x,networkStatus:j,docs:A}),{docs:A,loading:k,pageInfo:E,fetchMore:D,showPaginationControls:w,activeDocs:S}};var ir=t(89458),io=t(88640);let ia=e=>{let{currentChannelId:i,activeTab:t}=e,[s,n]=(0,ir.I)(io.H.viewPreferences,"grid"),[l,r]=(0,T.useState)(P.IX5.EditedTime),[o,a]=(0,T.useState)(P.SrV.Desc),[d,c]=(0,T.useState)(()=>i?"all":"recent"),[u,h]=(0,T.useState)(eU.LS);return(0,T.useEffect)(()=>{t===z.oc.ALL?c("recent"):c("all")},[i,t,c]),(0,T.useEffect)(()=>{"createdByYou"===d?(h(P.IX5.CreatedTime),r(P.IX5.CreatedTime)):"recent"===d?h(P.IX5.LastViewed):"favorites"===d?h(P.IX5.Favorited):(r(P.IX5.EditedTime),h(P.IX5.EditedTime))},[d,r,h]),{viewPreference:s,setViewPreference:n,sortBy:l,setSortBy:r,sortDirection:o,filterBy:d,setFilterBy:c,setSortDirection:a,dateDisplayOption:u,setDateDisplayOption:h}};var id=t(38421),ic=t.n(id);let iu=()=>(0,n.jsx)(eZ.M,{minH:"sm",children:(0,n.jsxs)(p.k,{direction:"column",justify:"center",align:"center",children:[(0,n.jsx)(f.xu,{w:"80%",maxW:"250px",mb:6,alignContent:"center",children:(0,n.jsx)(ic(),{src:"/images/Sal-Fishing-2x.png",width:"640",height:"361",alt:"Sal, the Gamma mascot, fishing extraterrestrially"})}),(0,n.jsx)(x.X,{size:"md",mb:2,textAlign:"center",children:(0,n.jsx)(E.cC,{id:"ZxwTXP",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:e$.aq}})}),(0,n.jsx)(g.x,{fontSize:"lg",color:"gray.400",textAlign:"center",children:(0,n.jsx)(E.cC,{id:"y1jRzK",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:e$.aq},components:{0:(0,n.jsx)(v.r,{as:Y(),color:"trueblue.500",href:"/#".concat(eU.pX)})}})})]})}),ih=[,,].fill(1),ix=[,,,,].fill(1),ip=e=>{let{viewPreference:i="grid"}=e;return"grid"===i?(0,n.jsx)(f.xu,{width:"100%","data-testid":"docs-view-skeleton",children:(0,n.jsx)(b.r,{templateColumns:{base:"repeat(1, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(2, 1fr)",lg:"repeat(3, 1fr)",xl:"repeat(4, 1fr)","2xl":"repeat(5, 1fr)"},gap:6,children:ih.map((e,i)=>(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"240px",as:_.O},i))})}):(0,n.jsx)(f.xu,{width:"100%","data-testid":"docs-view-skeleton",children:(0,n.jsx)(eN.x,{pt:4,maxW:"100%",children:(0,n.jsx)(eC.i,{colorScheme:"blackAlpha",size:"sm",whiteSpace:"normal",variant:"simple",children:(0,n.jsx)(eM.p,{children:ix.map((e,i)=>(0,n.jsx)(ev.Tr,{children:(0,n.jsx)(ef.Td,{as:_.O,height:"36px",mb:2})},i))})})})})};var im=t(39237),ig=t(96933);let ij={all:{label:(0,n.jsx)(E.cC,{id:"N40H+G"}),ariaLabel:W.ag._({id:"N40H+G"}),icon:S.s2},recent:{label:(0,n.jsx)(E.cC,{id:"AOvC3b"}),ariaLabel:W.ag._({id:"AOvC3b"}),icon:S.SZw},private:{label:(0,n.jsx)(E.cC,{id:"zwBp5t"}),ariaLabel:W.ag._({id:"zwBp5t"}),icon:S.byT},createdByYou:{label:(0,n.jsx)(E.cC,{id:"WZTg05"}
1),ariaLabel:W.ag._({id:"WZTg05"}),icon:S.m08},favorites:{label:(0,n.jsx)(E.cC,{id:"X9kySA"}),ariaLabel:W.ag._({id:"X9kySA"}),icon:S.Tab}},iC=["all","recent","createdByYou","favorites"].map(e=>({key:e,...ij[e]})),iv=["all","recent","createdByYou","favorites"].map(e=>({key:e,...ij[e]})),ib=e=>{var i;let{currentChannelId:t,filterBy:s,setFilterBy:l}=e,r=(0,ig.i)({base:!0,xl:!1}),o=t?iv:iC,a=null==ij?void 0:null===(i=ij[s])||void 0===i?void 0:i.label;return(0,n.jsx)(eB.E,{id:"filter-by-dropdown",zIndex:"3",width:["100%","auto"],mt:[4,0],children:r?(0,n.jsxs)(J.v,{closeOnSelect:!0,children:[(0,n.jsx)($.j,{as:C.z,variant:"ghost",size:"sm",rightIcon:(0,n.jsx)(A.G,{icon:S.ptq}),fontWeight:"600",color:"gray.700",leftIcon:(0,n.jsx)(A.G,{icon:S.G_j}),children:a}),(0,n.jsx)(et.q,{minWidth:"240px",children:(0,n.jsx)(eP._,{defaultValue:s,title:W.ag._({id:"MwX53Z"}),type:"radio",onChange:l,value:s,children:o.map(e=>(0,n.jsx)(im.i,{value:e.key,children:e.label},e.key))})})]}):o.map(e=>{let i=e.key===s;return(0,n.jsx)(eB.U,{children:(0,n.jsx)(C.z,{fontWeight:"600",color:i?"trueblue.500":"gray.600",bg:i?"trueblue.50":"transparent",size:"sm",leftIcon:(0,n.jsx)(A.G,{icon:e.icon,"aria-label":e.ariaLabel}),variant:"ghost",onClick:()=>l(e.key),children:e.label})},e.key)})})},iy=e=>{var i;let{filterBy:t,sortBy:s,sortDirection:l,setSortBy:r,setSortDirection:o,size:a="sm"}=e,d=ea(t),c=d?eU.Kk:eU.en.concat({key:P.IX5.Title,label:W.ag._({id:"MHrjPM"})});return(0,n.jsxs)(j.h,{variant:"ghost",size:a,zIndex:"2",children:[!(0,B.s2)()&&!d&&(0,n.jsxs)(J.v,{closeOnSelect:!0,children:[(0,n.jsx)($.j,{as:C.z,variant:"ghost",size:a,rightIcon:(0,n.jsx)(A.G,{icon:S.ptq,"aria-label":"Open menu"}),fontWeight:"600",color:"gray.700",children:(null==c?void 0:null===(i=c.find(e=>e.key===s))||void 0===i?void 0:i.label)||(0,n.jsx)(E.cC,{id:"acZeX2"})}),(0,n.jsx)(ei.h,{children:(0,n.jsx)(et.q,{minWidth:"240px",zIndex:"overlay",children:(0,n.jsx)(eP._,{defaultValue:"alpha",title:W.ag._({id:"/HgF9q"}),type:"radio",children:c.map(e=>{let i=s===e.key;return(0,n.jsx)(en.s,{icon:i?(0,n.jsx)(eT.n,{}):(0,n.jsx)(f.xu,{w:3}),value:e.key,onClick:()=>r(e.key),children:e.label},e.key)})})})})]}),(d||c.find(e=>e.key===s))&&(0,n.jsx)(el.kH,{label:(0,n.jsx)(E.cC,{id:"TZml21"}),children:(0,n.jsx)(ee.h,{color:"gray.700","aria-label":"sort",onClick:()=>o(l===P.SrV.Asc?P.SrV.Desc:P.SrV.Asc),icon:(0,n.jsx)(A.G,{icon:S.RXu})})})]})},i_=e=>{let{currentChannelId:i,filterBy:t,sortBy:s,sortDirection:l,viewPreference:r,setFilterBy:o,setSortBy:a,setSortDirection:d,setViewPreference:h,shouldShowCategoryFilters:x,shouldShowSortOptions:p,shouldShowViewToggle:m}=e;return x||p||m?(0,n.jsxs)(u.K,{direction:"row",alignItems:"center",children:[x&&(0,n.jsx)(ib,{filterBy:t,setFilterBy:o,currentChannelId:i}),(0,n.jsx)(V.L,{}),(0,n.jsxs)(c.U,{alignItems:"center",children:[p&&(0,n.jsx)(iy,{filterBy:t,sortBy:s,sortDirection:l,setSortBy:a,setSortDirection:d}),m&&(0,n.jsx)(iS,{viewPreference:r,setViewPreference:h})]})]}):(0,n.jsx)(n.Fragment,{})},iS=e=>{let{viewPreference:i,setViewPreference:t}=e,s="list"===i;return(0,n.jsxs)(c.U,{spacing:0,bg:"gray.200",p:.5,borderRadius:"md",children:[(0,n.jsx)(C.z,{size:"sm","data-testid":"view-toggle-grid",variant:s?"ghost":"plain",color:s?"gray.600":"trueblue.500",onClick:()=>t("grid"),children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(A.G,{icon:S.emM}),(0,n.jsx)(g.x,{display:["none","none","none","none","block"],children:(0,n.jsx)(E.cC,{id:"CXDHcv"})})]})}),(0,n.jsx)(C.z,{size:"sm","data-testid":"view-toggle-list",variant:s?"plain":"ghost",color:s?"trueblue.500":"gray.600",onClick:()=>t("list"),children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(A.G,{icon:S.xiG}),(0,n.jsx)(g.x,{display:["none","none","none","none","block"],children:(0,n.jsx)(E.cC,{id:"2BBAbc"})})]})})]})};var iA=t(49165),iE=t(31702),iI=t(69024),iD=t(82863),ik=t(14274),iw=t(26787);let iT=e=>{let i=(0,O.ye)("docImport"),t=(0,O.ye)("pptImport");return i||t?(0,n.jsx)(iD.rg,{clientId:ik.v.GOOGLE_DRIVE_IMPORT_CLIENT_ID,children:(0,n.jsx)(iP,{...e})}):null},iP=e=>{let{handleImport:i,isDisabled:t,buttonProps:s,helpTip:l}=e,{isOpen:r,onOpen:o,onClose:a}=(0,d.q)({id:"import-plain-modal"}),{push:x}=(0,k.useRouter)();return(0,n.jsxs)(J.v,{children:[(0,n.jsx)($.j,{as:C.z,onFocus:e=>e.preventDefault(),"data-testid":"import-doc-button",isDisabled:t,leftIcon:(0,n.jsx)(A.G,{icon:S.Vmj}),rightIcon:(0,n.jsx)(A.G,{icon:S.gc2}),sx:{span:{flexGrow:0}},...s,children:(0,n.jsx)(E.cC,{id:"l3s5ri"})}),(0,n.jsx)(ei.h,{children:(0,n.jsx)(et.q,{maxW:"350px",zIndex:"tooltip",children:(0,n.jsxs)(iI.k,{title:W.ag._({i
1d:"F6aY4g"}),children:[(0,n.jsx)(en.s,{icon:(0,n.jsx)(A.G,{icon:eF.JyM,fixedWidth:!0}),onClick:()=>{x("/create/import?ref=dashboard")},children:(0,n.jsxs)(c.U,{align:"flex-start",children:[(0,n.jsxs)(u.K,{spacing:0,children:[(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"QIFgHt"})}),(0,n.jsx)(g.x,{fontSize:"xs",color:"gray.500",children:(0,n.jsx)(E.cC,{id:"Aqrkal"})})]}),(0,n.jsx)(V.L,{}),(0,n.jsx)(h.C,{h:"fit-content",colorScheme:"trueblue",ml:2,children:(0,n.jsx)(E.cC,{id:"jsQZMk"})})]})}),(0,n.jsx)(en.s,{icon:(0,n.jsx)(A.G,{icon:S.Vmj,fixedWidth:!0}),onClick:o,children:(0,n.jsxs)(u.K,{spacing:0,children:[(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"yCc/Nz"})}),(0,n.jsx)(g.x,{fontSize:"xs",color:"gray.500",children:(0,n.jsx)(E.cC,{id:"exXmrP"})})]})})]})})}),(0,n.jsxs)(e1.u_,{isOpen:r,onClose:a,size:"2xl",children:[(0,n.jsx)(e2.Z,{}),(0,n.jsxs)(e5.h,{bg:"gray.50",children:[(0,n.jsx)(e3.x,{children:(0,n.jsxs)(c.U,{spacing:3,children:[(0,n.jsx)(A.G,{icon:S.Vmj}),(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"F6aY4g"})})]})}),(0,n.jsx)(ex.i,{}),(0,n.jsx)(e4.o,{}),(0,n.jsx)(e6.f,{py:4,px:{base:4,md:6},children:(0,n.jsxs)(u.K,{spacing:4,justifyContent:"flex-start",children:[(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"bQtlIq"})}),(0,n.jsx)(iw.v,{onImportComplete:i})]})}),(0,n.jsx)(e9.m,{children:(0,n.jsx)(C.z,{variant:"ghost",onClick:a,children:(0,n.jsx)(E.cC,{id:"dEgA5A"})})})]})]})]})};var iO=t(72338),iN=t(77377),iL=t(3402),iR=t(31709);let iM=(e,i)=>{var t;let s;let n=(0,iN.e)(),l=(0,iO.J1)(n),{slice:r}=(0,iL.T)(e,l,i,!1),o=(null===(t=r.toJSON())||void 0===t?void 0:t.content)||[];if(o.every(e=>"card"===e.type))s=(0,iR.vL)(void 0,o);else{let e=o.filter(e=>l.nodes[e.type].isBlock)||[];s=(0,iR.vL)(void 0,[{type:"card",content:e}])}return console.debug("Parsing imported doc",{doc:s,slice:r,splitContent:o,html:e}),s},iF=e=>{let{isDisabled:i}=e,{push:t}=(0,k.useRouter)(),s=(0,T.useCallback)(()=>t("/create"),[t]);return(0,n.jsx)(C.z,{"data-testid":"create-from-ai-button",isDisabled:i,variant:"solid",onClick:s,leftIcon:(0,n.jsx)(A.G,{icon:S.r8p}),rightIcon:(0,n.jsx)(h.C,{colorScheme:"trueblue",textShadow:"none",children:"AI"}),children:(0,n.jsx)(E.cC,{id:"BOqY23"})})};var iU=t(62207);let iz={GoogleDocs:"import_google_doc",GoogleSlides:"import_google_slides",DocxUpload:"import_docx",PptxUpload:"import_pptx"},iB=e=>{let{currentWorkspace:i,description:t,ariaLabel:s,displayName:l,icon:r,showCreateButton:o,channel:a,isChannelPreview:h}=e,{isOpen:m,onOpen:j,onClose:v}=(0,d.q)({id:"template-browser-modal"}),{isOpen:b,onOpen:y,onClose:_}=(0,d.q)({id:"ai-credits-modal"}),I=(0,O.ye)("aiWizard"),D=(0,U.z$)(),{credits:k,hasEnoughCreditsToGenerateDeck:w}=(0,M.qO)(),[P,{data:N,loading:L}]=(0,iA.c)(),F=L||!!((null==N?void 0:N.createDoc)||!i),z=(0,T.useCallback)(e=>{let{html:i,filename:t,source:s,src:n}=e;if(!i)return;let l="GoogleDocs"===s||"DocxUpload"===s,r=iM(i,{splitOnHeadings:l,splitOnDividers:!0,nested:l});null==D||D.track(U.AA.DOC_IMPORTED,{source:s,src:n,with_ai:!1}),P({document:r,channelId:null==a?void 0:a.id,title:t,source:iz[s]})},[null==a?void 0:a.id,P,D]),G=(0,T.useCallback)(()=>{P({channelId:null==a?void 0:a.id,source:"blank"})},[null==a?void 0:a.id,P]);return(0,n.jsxs)(p.k,{flex:"1",mb:(0,B.s2)()?0:4,direction:"column",children:[(0,n.jsxs)(f.xu,{w:["100%","auto"],children:[(0,n.jsxs)(c.U,{h:"1.5em",children:[(0,n.jsxs)(x.X,{fontSize:"lg",fontWeight:"600","data-testid":"docs-view-header",children:[r&&(0,n.jsx)(A.G,{icon:r,"aria-label":s})," ",(0,n.jsx)(g.x,{as:"span",ml:2,children:l})]}),(0,n.jsx)(V.L,{}),!h&&a&&(0,n.jsx)(iU.k,{channel:a,workspaceId:null==i?void 0:i.id})]}),t&&(0,n.jsx)(g.x,{color:"gray.600",fontSize:"sm",children:t}),a&&(0,n.jsxs)(u.K,{direction:"row",alignItems:"center",mt:4,children:[(0,n.jsx)(el.NL,{overflowTooltipLabel:"See everyone",size:"xs",avatars:(null==a?void 0:a.members)||[],max:6}),(0,n.jsx)(g.x,{fontSize:"sm",color:"gray.400",ml:2,children:(0,n.jsx)(E.cC,{id:"pkIIls",values:{0:a.memberCount||0}})})]})]}),o&&(0,n.jsxs)(u.K,{direction:{base:"column",lg:"row"},spacing:2,mt:4,children:[I&&(0,n.jsx)(iF,{isDisabled:F}),!(0,B.s2)()&&(0,n.jsx)(C.z,{"data-testid":"create-doc-button",isDisabled:F,variant:"plain",onClick:G,leftIcon:(0,n.jsx)(A.G,{icon:S.r8p}
1),children:(0,n.jsx)(E.cC,{id:"exOjhh"})}),o&&!(0,B.s2)()&&(0,n.jsx)(iT,{handleImport:z,isDisabled:F})]}),(0,n.jsx)(R.H,{credits:k,isOpen:b,onClose:_,onOpen:y}),(0,n.jsx)(iE.UB,{isOpen:m,onClose:v,forceChannelId:null==a?void 0:a.id})]})};var iG=t(99368);let iH=()=>{let[e,i]=(0,T.useState)(null),[t,{data:s}]=(0,P.t1J)({variables:{docId:e,maxDepth:1,archived:!1},returnPartialData:!0,fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"});(0,T.useEffect)(()=>{!e||(0,B.s2)()||t({variables:{docId:e,maxDepth:1}})},[e,t]);let n=(0,T.useMemo)(()=>[],[]),l=(0,T.useMemo)(()=>{var i,t;let l=(null==s?void 0:s.docCards)!==void 0&&(null==s?void 0:null===(i=s.docCards[0])||void 0===i?void 0:i.docId)===e?null==s?void 0:null===(t=s.docCards)||void 0===t?void 0:t.filter(e=>!!e.previewUrl):n;return function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length<=i)return e;let t=Math.floor(e.length/i),s=[];for(let n=0;n<e.length&&(s.push(e[n]),s.length!==i);n+=t);return s}(l)},[null==s?void 0:s.docCards,e,n]),r=(0,T.useCallback)(e=>{i(e)},[]),o=(0,T.useCallback)(i=>e===i?l:n,[l,e,n]);return{fetchThumbnails:r,getThumbnails:o}},iK=e=>{let{editors:i,user:t}=e,s=(0,iG.Yc)(i,null==t?void 0:t.id);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(el.NL,{size:"xs",overflowTooltipLabel:W.ag._({id:"25VyZX"}),shouldAnimate:!1,max:3,avatars:s.map(e=>{let{displayName:i,profileImageUrl:t,id:s}=e;return{name:i||"",id:s,profileImageUrl:t,color:"white"}})}),(0,n.jsx)(u.K,{spacing:0,children:(0,n.jsx)(g.x,{fontSize:"xs",color:"gray.500",children:(0,n.jsx)(E.cC,{id:"27Yldc",values:{0:s.length}})})})]})},iV=e=>{let{presenters:i,user:t}=e,s=(0,iG.Yc)(i,null==t?void 0:t.id);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(el.NL,{overflowTooltipLabel:W.ag._({id:"25VyZX"}),shouldAnimate:!1,size:"xs",max:3,avatars:s.map(e=>{let{displayName:i,profileImageUrl:t,id:s}=e;return{name:i||"",id:s,profileImageUrl:t,color:"white"}})}),(0,n.jsx)(u.K,{spacing:0,children:(0,n.jsx)(g.x,{fontSize:"xs",color:"gray.500",children:(0,n.jsx)(E.cC,{id:"u2htxq",values:{0:s.length}})})})]})},iW=e=>{let{activeDocs:i,filterBy:t}=e,{fetchThumbnails:s,getThumbnails:l}=iH(),r=(0,O.ye)("screenshotsEnabled"),{user:o}=(0,L.SE)(),{favoriteDoc:a}=e0({refetchQueries:["GetDocs","GetChannelDocActivity"]});return(0,n.jsxs)(f.xu,{bg:"blackAlpha.100",my:4,pt:2,borderRadius:"md",border:"1px solid #000",borderColor:"blackAlpha.100",children:[(0,n.jsxs)(g.x,{px:6,fontSize:"sm",fontWeight:"600",color:"gray.600",mt:2,children:[(0,n.jsx)(A.G,{icon:S.V1P})," ",(0,n.jsx)(E.cC,{id:"/sL1z7"})]}),(0,n.jsx)(b.r,{templateColumns:{base:"repeat(1, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(2, 1fr)",lg:"repeat(3, 1fr)",xl:"repeat(4, 1fr)","2xl":"repeat(5, 1fr)"},gap:6,p:6,pt:3,children:null==i?void 0:i.map(e=>{var i;let{doc:t,editors:d,presenters:u}=e,{title:h,id:x,titleCard:p,createdTime:m}=t,g={src:r?null==p?void 0:p.previewUrl:Z.Z,fallbackSrc:Z.Z.src},j=u&&u.length>0,C=!j&&d&&d.length>0,v=(0,eu.Gn)({docId:x}),f=(0,n.jsxs)(c.U,{px:2,py:1,bg:"green.100",borderRadius:"md",w:"100%",children:[C&&(0,n.jsx)(iK,{editors:d,user:o}),j&&(0,n.jsx)(iV,{presenters:u,user:o})]}),b=l(t.id);return(0,n.jsx)(e_.F7,{createdTime:m,title:h,NextLink:Y(),href:v,id:x,thumbnailImageUrl:g,isFavorited:null===(i=t.docUser)||void 0===i?void 0:i.favorited,onFavorite:a(new Date,t),onUnfavorite:a(null,t),menuEnabled:!1,activity:f,cardThumbnails:r?b:[],onMouseEnter:()=>{r&&s(t.id)}},x)})})]})},iq=(0,T.memo)(e=>{let{activeTab:i,channel:t,isChannelPreview:s,activeDocs:l,sortDirection:r,sortBy:o,filterBy:a,viewPreference:d,setSortBy:c,setSortDirection:u,setViewPreference:h,setFilterBy:x}=e,p=!(0,B.s2)()&&i!==z.f8.TEMPLATES,m=!!(i===z.f8.ALL||t),{currentWorkspace:g}=(0,L.SE)(),{displayName:j,description:C,ariaLabel:v,icon:b,showCreateButton:y}=z.A5[i],_=(null==t?void 0:t.name)||j;return(0,n.jsxs)(f.xu,{w:"100%",mb:6,children:[(0,n.jsx)(iB,{displayName:_,ariaLabel:v,description:C,icon:b,showCreateButton:y&&!s,currentWorkspace:g,channel:t,isChannelPreview:s}),l&&l.length>0&&(0,n.jsx)(iW,{activeDocs:l,filterBy:a}),(0,n.jsx)(i_,{filterBy:a,sortBy:o,sortDirection:r,setViewPreference:h,setFilterBy:x,setSortBy:c,setSortDirection:u,viewPreference:d,shouldShowCategoryFilters:m,currentChannelId:(null==t?void 0:t.id)||null,shouldShowSortOptions:p&&"grid"===d,shouldShowViewToggle:p})]})});iq.displayName="DocsViewTopbar";var iY=t(35183),iX=t(85573),iZ=t(99793),iQ=t(43019);let iJ=e=>{let{onClose:i,doc:t}=e,[s,{loading:l}]=(0,P.D1_)(),r=(0,eJ.p)(),[o,a]=(0,T.useState)(()=>t.title),[d,c]=(0,T.useState)("Untitled"),[u,h]=(0,T.useState)(null),x=(0,T.useCallback)(e=>{a(e.target.value)},[]),m=(0,T.useRef)(null),{data:g}=(0,P.EDv)({variables:{docId:t.id,snapshotId:t.currentSnapshotId},skip:!(null==t?void 0:t.currentSnapshotId)||!(null==t?void 0:t.id)}),v=!!u;(0,T.useEffect)(()=>
1{if(!(null==g?void 0:g.snapshot))return;let e=(null==g?void 0:g.snapshot)&&(0,iQ.getCardTitle)(g.snapshot.content.default.content[0].content[0])||W.ag._({id:"wja8aL"});c(e)},[null==g?void 0:g.snapshot]);let f=(0,T.useCallback)(()=>{let e=!!(o&&o.length),l={id:t.id,titleEdited:e,title:e?o:d};s({variables:l}).then(()=>{r({title:(0,n.jsx)(E.cC,{id:"ZYAPMn",values:{GAMMA_ARTIFACT_PROPER_NOUN:e$.Yc,0:o.length>0?o:d}}),position:"top",status:"success",duration:5e3}),h(null),i()}).catch(e=>{console.error(e),h(e.message)})},[t.id,i,o,r,s,d]);return(0,n.jsxs)(e1.u_,{closeOnOverlayClick:!1,isOpen:!0,initialFocusRef:m,onClose:i,children:[(0,n.jsx)(e2.Z,{}),(0,n.jsxs)(e5.h,{children:[(0,n.jsx)(e3.x,{children:(0,n.jsx)(E.cC,{id:"2wxgft"})}),(0,n.jsx)(e4.o,{}),(0,n.jsx)(e6.f,{children:(0,n.jsx)(p.k,{mt:4,w:"100%",direction:"column",children:(0,n.jsxs)(iY.NI,{isInvalid:v,children:[(0,n.jsx)(iX.I,{value:o,placeholder:d,ref:m,_placeholder:{opacity:1,color:"gray.300"},onKeyDown:e=>{"Enter"===e.key&&f()},onChange:x}),v&&(0,n.jsx)(iZ.J1,{children:u})]})})}),(0,n.jsx)(e9.m,{children:(0,n.jsxs)(j.h,{children:[(0,n.jsx)(C.z,{variant:"ghost",onClick:i,children:(0,n.jsx)(E.cC,{id:"dEgA5A"})}),(0,n.jsx)(C.z,{isLoading:l,variant:"solid",onClick:f,children:(0,n.jsx)(E.cC,{id:"2wxgft"})})]})})]})]})},i$=e=>{let{userHasNoWorkspaces:i,isSidebarVisible:t,setIsSidebarVisible:s,currentChannelId:l,activeChannel:r,channelPreview:o,activeTab:a}=e,{user:c,currentWorkspace:u}=(0,L.SE)(),[h,x]=(0,T.useState)(!1),[p,m]=(0,T.useState)(null),[g,j]=(0,T.useState)(null),{isOpen:v,onOpen:b,onClose:y}=(0,d.q)({id:"ConfirmPermanentlyDeleteModal"}),[_,S]=(0,T.useState)(null),[A,{data:I}]=(0,P.WMx)({variables:{id:p},returnPartialData:!0,nextFetchPolicy:"cache-first"}),{favoriteDoc:D,trashDoc:k,restoreDoc:w}=e0({refetchQueries:["GetDocs","GetChannelDocActivity"]}),N=(0,it.e)(),{removeDocChannel:R}=(0,ii.Z)(),M=(0,L.we)(),{isSharePanelOpen:F,onSharePanelOpen:U,onSharePanelClose:z,view:B,setVie
1w:G}=(0,ie.y)(),{isOpen:H,onOpen:K,onClose:V}=(0,d.q)({id:"RenameDocModalDisclosure"}),W=(0,O.ye)("permanentlyDeleteDoc"),{viewPreference:q,setViewPreference:Y,sortBy:X,setSortBy:Z,sortDirection:Q,filterBy:J,setFilterBy:$,setSortDirection:ee,dateDisplayOption:ei,setDateDisplayOption:et}=ia({currentChannelId:l,activeTab:a}),{docs:es,loading:en,showPaginationControls:el,fetchMore:er,activeDocs:eo}=il({filterBy:J,activeTab:a,currentChannelId:l,channelPreview:o,user:c,currentWorkspace:u,sortBy:X,sortDirection:Q});(0,T.useEffect)(()=>{p&&A({variables:{id:p}})},[p,A]);let ea=(0,T.useCallback)(e=>{j(e),b()},[b]),ed=W?ea:void 0,ec=(0,T.useCallback)(e=>{m(e),U()},[U]),eu=(0,T.useCallback)((e,i)=>{R(e,i)},[R]),eh=(0,T.useCallback)(e=>{N({docId:e.id,source:"dashboard_docs_view_duplicate"})},[N]),ex=(0,T.useCallback)(e=>{S(e),K()},[K]),ep=!en&&es&&(null==es?void 0:es.length)>0,{fetchThumbnails:eg,getThumbnails:ej}=iH();return(0,n.jsxs)(f.xu,{width:"100%",children:[!i&&(0,n.jsx)(em,{isSidebarVisible:t,setIsSidebarVisible:s,children:(0,n.jsx)(iq,{activeTab:a,channel:o||r,activeDocs:eo,isChannelPreview:!!o,sortDirection:Q,sortBy:X,filterBy:J,viewPreference:q,setSortBy:Z,setSortDirection:ee,setViewPreference:Y,setFilterBy:$})}),(0,n.jsxs)(f.xu,{width:"100%","data-testid":"docs-view-container",children:[(0,n.jsx)(eI,{user:c,currentWorkspace:u,currentChannelId:l,viewPreference:q}),en&&(0,n.jsx)(ip,{viewPreference:q}),!en&&(null==es?void 0:es.length)===0&&(0,n.jsx)(iu,{}),"list"===q&&ep&&(0,n.jsx)(eX,{dateDisplayOption:ei,setDateDisplayOption:et,user:c,currentWorkspace:u,userHasNoWorkspaces:i,filterBy:J,docs:es,currentChannelId:l,sortBy:X,sortDirection:Q,setSortBy:Z,setSortDirection:ee,handleDuplicateDoc:eh,handleFavoriteDoc:D,handleTrash:k,handlePermanentDelete:ed,handleRestoreDoc:w,handleShareClick:ec,handleRenameClick:ex,handleRemoveFromChannel:eu}),"grid"===q&&ep&&(0,n.jsx)(eQ.G,{"data-testid":"docs-view-doc-grid",children:es.map(e=>{var t;let s=M.can("view",e)&&!i,r=M.can("edit",e)&&!i,o=M.can("manage",e)&&!i,a=ej(e.id);return(0,n.jsx)(ew,{user:c,currentWorkspace:u,doc:e,currentChannelId:l,sortBy:X,filterBy:J,canDuplicate:s,createdByYou:(null==e?void 0:null===(t=e.createdBy)||void 0===t?void 0:t.id)===(null==c?void 0:c.id),handleDuplicateDoc:eh,handleFavoriteDoc:D,handleTrash:k,handlePermanentDelete:ed,handleRenameClick:ex,handleRemoveFromChannel:eu,handleRestoreDoc:w,handleShareClick:ec,fetchThumbnails:eg,cardThumbnails:a,canEditDoc:r,canManageDoc:o},e.id)})}),F&&(0,n.jsx)(e8.WQ,{doc:null==I?void 0:I.doc,isSharePanelOpen:F,onSharePanelClose:()=>{m(null),z()}
1,onSharePanelOpen:U,view:B,setView:G,showSiteSettings:!1}),H&&(0,n.jsx)(iJ,{doc:_,onClose:V}),el&&(0,n.jsx)(eZ.M,{p:6,children:(0,n.jsx)(C.z,{isLoading:h,onClick:()=>{x(!0),er().finally(()=>{x(!1)})},size:"sm",children:(0,n.jsx)(E.cC,{id:"yQ2kGp"})})}),W&&v&&g&&(0,n.jsx)(e7,{doc:g,onClose:y})]})]})};var i0=t(20437),i1=t(34208);let i2=e=>{let[i]=(0,P.r$k)(),[t]=(0,P.NuY)(),s=(0,T.useCallback)(s=>{let n=s.uploadFontFiles.filter(e=>("existing"===e.status||"created"===e.status)&&e.fontFile.sourceUrl).map(e=>{let{name:i,weight:t,isItalic:s,fileType:n,sourceUrl:l}=e.fontFile,r={name:i,weight:t,isItalic:s,fileType:n,sourceUrl:l};return"existing"===e.status&&e.fontFile.id&&(r.id=e.fontFile.id),r});if("edit"!==s.mode)return i({variables:{input:{name:s.fontName,fontFiles:n,workspaceId:e}},refetchQueries:["GetWorkspaceFonts"]});{let i=[{op:P.bPF.Add,path:"/name",value:s.fontName},{op:P.bPF.Replace,path:"/fontFiles",value:n}];return t({variables:{input:{id:s.fontId,workspaceId:e,data:i}},refetchQueries:["GetWorkspaceFonts"]})}},[i,e,t]);return s},i5=e=>{let i=(0,eJ.p)(),[t,{loading:s}]=(0,P.xUs)(),l=(0,T.useCallback)(async(s,l)=>t({variables:{id:s,workspaceId:e},refetchQueries:["GetWorkspaceFonts"]}).then(e=>(i({title:(0,n.jsx)(E.cC,{id:"w+hpl4",values:{name:l}}),status:"success",duration:2e3,isClosable:!0,position:"top"}),e)),[t,e,i]);return{archiveFontFn:l,isArchiving:s}},i3=e=>{let{onClose:i,font:t,orgId:s}=e,{archiveFontFn:l,isArchiving:r}=i5(s),o=(0,T.useCallback)(()=>{l(t.id,t.name).then(i).catch(e=>{console.error("[FontDeleteModal] Error deleting font",e)})},[l,t.id,t.name,i]);return(0,n.jsxs)(e1.u_,{onClose:i,isOpen:!0,children:[(0,n.jsx)(e2.Z,{}),(0,n.jsxs)(e5.h,{children:[(0,n.jsx)(e3.x,{children:(0,n.jsx)(E.cC,{id:"Tf88pC",values:{0:t.name}})}),(0,n.jsx)(e4.o,{isDisabled:r}),(0,n.jsx)(e6.f,{children:(0,n.jsxs)(u.K,{spacing:4,children:[(0,n.jsx)(g.x,{fontWeight:"bold",children:(0,n.jsx)(E.cC,{id:"GG34Oa"})}),(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"AYXLSv"})}),(0,n.jsx)(g.x,{color:"red.600",children:(0,n.jsx)(E.cC,{id:"U99rVM"})})]})}),(0,n.jsx)(e9.m,{children:(0,n.jsxs)(j.h,{children:[(0,n.jsx)(C.z,{variant:"ghost",onClick:i,children:(0,n.jsx)(E.cC,{id:"dEgA5A"})}),(0,n.jsx)(C.z,{variant:"ghost",color:"red.600",onClick:o,isLoading:r,children:(0,n.jsx)(E.cC,{id:"04FTaq"})})]})})]})]})},i4=e=>{let{children:i,...t}=e;return(0,n.jsx)(p.k,{border:"1px solid",borderColor:"gray.200",minH:36,maxH:36,minW:"100%",borderRadius:"lg",alignItems:"center",justifyContent:"center",transition:"all",transitionDuration:"normal",_hover:{background:"white",color:"trueblue.600",cursor:"pointer"},...t,children:i})};var i6=t(17993),i9=t(62700),i7=t(47443),i8=t(52929),te=t(44438);let ti=()=>(0,n.jsxs)(i7.b,{status:"warning",children:[(0,n.jsx)(i8.z,{}),(0,n.jsxs)(g.x,{children:[(0,n.jsxs)("strong",{children:[(0,n.jsx)(E.cC,{id:"S89SGJ"})," ",(0,n.jsx)("span",{role:"img","aria-label":"Crying emoji",children:"\uD83D\uDE22"}),"."]})," ",(0,n.jsx)(E.cC,{id:"5FjY+D",components:{0:(0,n.jsx)(te.E,{colorScheme:"purple"}),1:(0,n.jsx)(te.E,{colorScheme:"pink"})}})]})]});var tt=t(16556);let ts=e=>{let{fileExtension:i}=e;return(0,n.jsx)(tt.Vp,{size:"sm",justifyContent:"center",background:i===P.sA6.Ttf?"trueblue.100":"shocking.100",children:i.toUpperCase()})},tn=e=>{let{fontFamily:i,fontWeight:t,isItalic:s,headingText:l}=e;return(0,n.jsx)(x.X,{fontFamily:'"'.concat(i,'"'),noOfLines:1,lineHeight:"base",fontWeight:t,fontStyle:s?"italic":"normal",children:l||i})},tl=e=>{let i=e.reduce((e,i)=>{let t=e.findIndex(e=>e.isItalic===i.isItalic&&e.weight===i.weight);if(-1===t)return[...e,i];if(e[t].fileType===i.fileType)return e;let s={...i,fileTypes:[i.fileType,e[t].fileType]};return[...e.slice(0,t),s,...e.slice(t+1)]},[]),t=[...i];return t.sort((e,i)=>e.weight!==i.weight?e.weight-i.weight:e.isItalic!==i.isItalic?!1===e.isItalic?-1:1:0),t},tr=e=>{var i;let{font:t,onClose:s,onEditClick:l,onDeleteClick:r}=e,o=(0,T.useMemo)(()=>tl(t.fontFiles||[]),[t.fontFiles]);return(0,n.jsxs)(e1.u_,{isOpen:!0,onClose:s,size:"3xl",blockScrollOnMount:!1,children:[(0,n.jsx)(e2.Z,{}),(0,n.jsxs)(e5.h,{children:[(0,n.jsx)(e3.x,{children:t.name}),(0,n.jsx)(e4.o,{}),(0,n.jsx)(ex.i,{mb:"4"}),(0,n.jsx)(e6.f,{children:(0,n.jsxs)(i6.g,{mb:4,spacing:6,align:"stretch",children:[(null===(i=t.fontFiles)||void 0===i?void 0:i.length)===0&&(0,n.jsx)(ti,{}),o.map(e=>{var i,s;
1let l=!!(e.fileType===P.sA6.Otf||(null===(i=e.fileTypes)||void 0===i?void 0:i.includes(P.sA6.Otf))),r=!!(e.fileType===P.sA6.Ttf||(null===(s=e.fileTypes)||void 0===s?void 0:s.includes(P.sA6.Ttf)));return(0,n.jsx)(to,{fontName:t.name,weight:e.weight,isItalic:e.isItalic,hasOTF:l,hasTTF:r},e.id)})]})}),(0,n.jsxs)(e9.m,{justifyContent:"space-between",children:[(0,n.jsx)(C.z,{variant:"ghost",colorScheme:"red",onClick:r,children:(0,n.jsx)(E.cC,{id:"cnGeoo"})}),(0,n.jsxs)(j.h,{children:[(0,n.jsx)(C.z,{variant:"plain",onClick:l,children:(0,n.jsx)(E.cC,{id:"ePK91l"})}),(0,n.jsx)(C.z,{variant:"solid",onClick:s,children:(0,n.jsx)(E.cC,{id:"DPfwMq"})})]})]})]})]})},to=e=>{let{fontName:i,weight:t,isItalic:s,hasOTF:l,hasTTF:r}=e,o=(0,n.jsxs)(n.Fragment,{children:[(0,i9.d)()[t]," ",s?(0,n.jsx)(E.cC,{id:"pzutoc"}):""]}),a=(0,n.jsxs)(n.Fragment,{children:[i," ",o]}),d=(0,n.jsxs)(n.Fragment,{children:[t," - ",o]});return(0,n.jsxs)(p.k,{justify:"space-between",gap:"10px",children:[(0,n.jsxs)(u.K,{spacing:2,children:[(0,n.jsx)(g.x,{color:"gray.600",children:d}),(0,n.jsx)(tn,{fontFamily:i,fontWeight:t.toString(),isItalic:s,headingText:a})]}),(0,n.jsxs)(c.U,{align:"center",children:[r&&(0,n.jsx)(ts,{fileExtension:P.sA6.Ttf}),l&&(0,n.jsx)(ts,{fileExtension:P.sA6.Otf})]})]})};var ta=t(30423);let td=e=>{let{font:i,onClick:t,onEditClick:s,onDeleteClick:l}=e,r=(0,ta.x_)((null==i?void 0:i.fontFiles)||[]),o=(0,ta.B_)(i.fontFiles||[]),a=(0,ta.QP)(o,700)||700,d=(0,ta.Sd)(null==i?void 0:i.fontFiles);return(0,n.jsxs)(u.K,{children:[(0,n.jsx)(i4,{bg:"white",justifyContent:"flex-start",p:6,onClick:t,children:(0,n.jsxs)(u.K,{maxW:"100%",children:[(0,n.jsx)(tn,{fontWeight:a.toString(),isItalic:d,fontFamily:i.name,headingText:i.name}),(0,n.jsx)(E.cC,{id:"B2DVf/",values:{styleCount:r},components:{0:(0,n.jsx)(g.x,{color:"orange.600"}),1:(0,n.jsx)(f.xu,{as:"span",mr:1}),2:(0,n.jsx)(A.G,{icon:eF.e7M})}})]})}),(0,n.jsxs)(p.k,{children:[(0,n.jsx)(g.x,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:i.name}),(0,n.jsx)(V.L,{}),(0,n.jsxs)(J.v,{children:[(0,n.jsx)($.j,{as:ee.h,isRound:!0,size:"sm",variant:"ghost",icon:(0,n.jsx)(A.G,{icon:S.cNd}),"aria-label":W.ag._({id:"eqqNgX"})}),(0,n.jsxs)(et.q,{children:[(0,n.jsx)(en.s,{icon:(0,n.jsx)(A.G,{icon:S.Xcf,fixedWidth:!0}),onClick:s,children:(0,n.jsx)(E.cC,{id:"ePK91l"})}),(0,n.jsx)(es.R,{}),(0,n.jsx)(en.s,{color:"red.500",icon:(0,n.jsx)(A.G,{icon:S.XAH,fixedWidth:!0}),onClick:l,children:(0,n.jsx)(E.cC,{id:"cnGeoo"})})]})]})]})]})};var tc=t(37164),tu=t(2090);let th={existingFont:null,mode:"create",fontId:void 0,hasUploadedFonts:!1,fontName:"",uploadFontFiles:[]};function tx(e,i){switch(i.type){case"NEW_FONT_UPLOAD":case"RESET_FONT_UPLOAD":return th;case"EDIT_EXISTING_FONT":{let{font:e}=i.data;return{existingFont:e,mode:"edit",fontId:e.id,fontName:e.name,hasUploadedFonts:!0,uploadFontFiles:e.fontFiles.map(e=>({fontFile:e,uploadId:e.id,status:"existing",errorMessage:null}))}}case"EDIT_FONT_NAME":{let{fontName:t}=i.data;return{...e,fontName:t}}case"UPLOAD_FONT_FILE_UPLOAD_STARTED":{let{data:t}=i,s={fontFile:{id:t.uploadId,name:t.name,weight:t.weight,isItalic:t.isItalic,fileType:t.fileType},uploadId:t.uploadId,status:"uploading",errorMessage:null},n=e.fontName?e.fontName:t.familyName;return{...e,fontName:n,hasUploadedFonts:!0,uploadFontFiles:[...e.uploadFontFiles,s]}}case"UPLOAD_FONT_FILE_UPLOAD_ERROR":{let{uploadId:t,errorMessage:s}=i.data;return{...e,uploadFontFiles:e.uploadFontFiles.map(e=>t===e.uploadId?{...e,status:"error",errorMessage:s}:e)}}case"UPLOAD_FONT_FILE_UPLOAD_SUCCESS":{let{uploadId:t,sourceUrl:s}=i.data;return{...e,uploadFontFiles:e.uploadFontFiles.map(e=>{if(t===e.uploadId){let i={...e.fontFile,sourceUrl:s};return{...e,status:"created",errorMessage:null,fontFile:i}}return e})}}case"EDIT_UPLOAD_FONT_FILE_WEIGHT":{let{uploadId:t,weight:s}=i.data;return{...e,uploadFontFiles:e.uploadFontFiles.map(e=>e.uploadId===t?{...e,fontFile:{...e.fontFile,weight:s}}:e)}}case"EDIT_UPLOAD_FONT_FILE_STYLE":{let{uploadId:t,isItalic:s}=i.data;return{...e,uploadFontFiles:e.uploadFontFiles.map(e=>e.uploadId===t?{...e,fontFile:{...e.fontFile,isItalic:s}}:e)}}case"DELETE_UPLOAD_FONT_FILE":{let{uploadId:t}=i.data;return{...e,uploadFontFiles:e.uploadFontFiles.filter(e=>e.uploadId!==t)}}default:throw Error("Unhandled action type: ".concat(i))}}var tp=t(78597),tm=t(97166),tg=t(81540),tj=t(82713),tC=t(73481);let tv=e=>{let{fontFiles:i,fontWeight:t,dispatch:s}=e,[l,r]=(0,T.useState)(!1);if(!i)return null;let o=(0,n.jsxs)(n.Fragment,{children:[t," - ",(0,i9.d)()[t]]}),a=(0,ta.cC)(i),d=!!Object.keys(a).length;return(0,n.jsx)(eN.x,{mt:8,children:(0,n.jsxs)(eC.i,{colorScheme:"blackAlpha",mb:8,borderRadius:"md",children:[(0,n.jsx)(eL.h,{children:(0,n.jsx)(el.kH,{placement:"top",
1isDisabled:!d,label:(0,n.jsx)(E.cC,{id:"KXcsLu"}),shouldWrapChildren:!0,children:(0,n.jsxs)(el.NZ,{mb:"2",cursor:d?"help":void 0,color:d?"yellow.600":void 0,children:[d&&(0,n.jsx)(A.G,{icon:eF.e7M})," ",o]})})}),(0,n.jsx)(eM.p,{children:i.map(e=>(0,n.jsx)(tf,{uploadFontFile:e,dispatch:s,duplicates:a,isHoveringOnADuplicate:l,setIsHoveringOnADuplicate:r},e.uploadId))})]})})},tf=e=>{let{uploadFontFile:i,duplicates:t,isHoveringOnADuplicate:s,setIsHoveringOnADuplicate:l,dispatch:r}=e,o=(0,eJ.p)(),{fontFile:a,errorMessage:d,uploadId:h}=i,x=void 0===a.sourceUrl&&!d,p=t[h],m=(0,ta.ZN)(Object.keys((0,i9.d)())),j=s&&p?"yellow.100":p?"yellow.50":"blackAlpha.50",C=(0,T.useCallback)(()=>{r({type:"DELETE_UPLOAD_FONT_FILE",data:{uploadId:h}}),o({title:(0,n.jsx)(E.cC,{id:"NHHKzo",values:{0:a.name}}),status:"info",duration:1e3,isClosable:!0,position:"top"})},[r,a.name,o,h]),v=p?a.isItalic?(0,n.jsx)(E.cC,{id:"yvnLC0",values:{0:a.weight}}):(0,n.jsx)(E.cC,{id:"QiSKej",values:{0:a.weight}}):"";return(0,n.jsxs)(ev.Tr,{minH:12,width:"100%",background:j,children:[(0,n.jsx)(ef.Td,{py:1,fontSize:"sm",textOverflow:"ellipsis",width:80,pl:0,children:(0,n.jsxs)(c.U,{ml:4,spacing:3,children:[(0,n.jsx)(ts,{fileExtension:a.fileType||P.sA6.Ttf}),(0,n.jsx)(el.kH,{placement:"right",label:v,children:(0,n.jsxs)(u.K,{width:"100%",pl:1,spacing:0,cursor:p?"help":"auto",onMouseOver:()=>{l(p)},onMouseOut:()=>{l(!1)},children:[(0,n.jsx)(el.kH,{label:(0,n.jsx)(E.cC,{id:"e3mFaa"}),placement:"top",isDisabled:!d,children:(0,n.jsxs)(g.x,{color:d?"red.600":void 0,children:[a.name," ",x?(0,n.jsx)(tg.$,{ml:1,size:"xs",color:"gray"}):d&&(0,n.jsx)(f.xu,{as:"span",color:"red.600",children:(0,n.jsx)(A.G,{icon:eF.e7M})})]})}),p&&(0,n.jsx)(g.x,{fontSize:"xs",color:"yellow.700",children:(0,n.jsx)(E.cC,{id:"mAsucF"})})]})})]})}),(0,n.jsx)(ef.Td,{py:1,minW:12,children:(0,n.jsx)(el.kH,{"aria-label":W.ag._({id:"+7pOZT"}),label:(0,n.jsx)(E.cC,{id:"+7pOZT"}),placement:"top",children:(0,n.jsx)(f.xu,{children:(0,n.jsx)(tj.X,{size:"sm",isChecked:a.isItalic,onChange:e=>{r({type:"EDIT_UPLOAD_FONT_FILE_STYLE",data:{uploadId:h,isItalic:e.target.checked}})},children:(0,n.jsx)(g.x,{fontSize:"sm",children:(0,n.jsx)(E.cC,{id:"pzutoc"})})})})})}),(0,n.jsx)(ef.Td,{minW:"16",py:"1",pr:"2",children:(0,n.jsx)(tC.P,{bg:"revert",value:a.weight,size:"sm",onChange:e=>{r({type:"EDIT_UPLOAD_FONT_FILE_WEIGHT",data:{uploadId:h,weight:parseInt(e.target.value,10)}})},children:(0,n.jsx)("optgroup",{label:W.ag._({id:"rgzUkd"}),children:m.map(e=>(0,n.jsxs)("option",{value:e,children:[e," - ",(0,i9.d)()[e]]},e))})})}),(0,n.jsx)(ef.Td,{py:"1",px:"0",children:(0,n.jsx)(el.kH,{placement:"top",label:(0,n.jsx)(E.cC,{id:"9cmpNe"}),children:(0,n.jsx)(ee.h,{"aria-label":W.ag._({id:"9cmpNe"}),colorScheme:"red",icon:(0,n.jsx)(A.G,{icon:S.XAH}),variant:"ghost",onClick:C})})})]})},tb=e=>{let{fontFiles:i,dispatch:t}=e,s=(0,T.useMemo)(()=>{let e=(0,ta.Av)(i);return Object.fromEntries(Object.entries(e).map(e=>{let[i,t]=e,s=[...t];return s.sort((e,i)=>e.fontFile.fileType!==i.fontFile.fileType?e.fontFile.fileType===P.sA6.Ttf?-1:1:e.fontFile.isItalic!==i.fontFile.isItalic?!1===e.fontFile.isItalic?-1:1:0),[i,s]}))},[i]);if(!i)return null;let l=(0,ta.ZN)(Object.keys((0,i9.d)()));return(0,n.jsxs)(n.Fragment,{children:[0===i.length&&(0,n.jsx)(ti,{}),l.map(e=>{let i=s[e];return i?(0,n.jsx)(tv,{fontFiles:i,dispatch:t,fontWeight:e},e):null})]})},ty=e=>{let{fontName:i,fontFiles:t,dispatch:s,onFontFileUploadClick:l}=e,r=(0,T.useCallback)(e=>{s({type:"EDIT_FONT_NAME",data:{fontName:e.target.value}})},[s]),o=0===i.length;return(0,n.jsx)(e6.f,{children:(0,n.jsxs)(i6.g,{align:"stretch",mb:"4",children:[(0,n.jsxs)(p.k,{justifyContent:"space-between",gap:6,children:[(0,n.jsxs)(iY.NI,{isInvalid:o,flex:2,children:[(0,n.jsx)(tm.l,{children:(0,n.jsx)(E.cC,{id:"5qk/OL"})}),(0,n.jsx)(iX.I,{type:"text",placeholder:W.ag._({id:"NFz66a"}),value:i,onChange:r}),o&&(0,n.jsx)(iZ.J1,{alignSelf:"flex-start",children:(0,n.jsx)(E.cC,{id:"YtAPjw"})})]}),(0,n.jsxs)(u.K,{mt:8,flex:1,children:[(0,n.jsx)(C.z,{leftIcon:(0,n.jsx)(A.G,{icon:S.A$k}),onClick:l,children:(0,n.jsx)(E.cC,{id:"BLNAld"})}),(0,n.jsx)(g.x,{textAlign:"center",fontSize:"xs",color:"gray.600",children:(0,n.jsx)(E.cC,{id:"GYK/1H",values:{GAMMA_PROPER_NOUN:e$.N6}})})]})]}),(0,n.jsx)(tb,{fontFiles:t,dispatch:s})]})})};var t_=t(82655);let tS=e=>{let{uploadTip:i,children:t}=e;return(0,n.jsxs)(i6.g,{align:"stretch",children:[(0,n.jsx)(p.k,{width:"100%",alignItems:"center",justifyContent:"center",minH:32,userSelect:"none",background:"gray.50",borderRadius:"md",p:4,mb:1,children:(0,n.jsx)(u.K,{spacing:0,children:t})}),(0,n.jsx)(g.x,{color:"gray.700",fontSize:"sm",children:i})]})},tA=()=>(0,n.jsx)(i7.b,{status:"warning",margin:"0 auto",maxW:412,lineHeight:"var(--chakra-lineHeights-base)",children:(0,n.jsx)(g.x,{fontSize:"xs",color:"yellow.800",children:(0,n.jsx)(E.cC,{id:"ULVfg0",components:{0:(0,n.jsx)("strong",{})}})})}),tE=e=>{let{onFontFileUploadClick:i}=e;return(0,n.jsx)(e6.f,{children:(0,n.jsxs)(i6.g,{mb:"4",spacing:"8",borderRadius:"md",children:[(0,n.jsxs)(x.X,{textAlign:"center",size:"md",fontWeight:"600",children:[(0,n.jsx)("span",{role:"img","aria-label":"idea",children:"\uD83D\uDCA1"})," ",(0,n.jsx)(E.cC,{id:"O70dt2"})]}),(0,n.jsxs)(i0.M,{columns:{base:1,md:3},spacing:4,width:"100%",children:[(0,n.jsx)(tS,{uploadTip:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(E.cC,{id:"F/H43B",components:{0:(0,n.jsx)("strong",{})}})}),children:(0,n.jsx)(x.X,{fontSize:"3xl",fontWeight:"bold",children:"Inter"})}),(0,n.jsxs)(tS,{uploadTip:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(E.cC,{id:"b2oYEF",components:{0:(0,n.jsx)("strong",{})}})}),children:[(0,n.jsxs)(g.x,{children:["inter-",(0,n.jsx)("strong",{children:"regular"}),".ttf"," ",(0,n.jsx)(f.xu,{color:"green.400",as:"span",children:(0,n.jsx)(A.G,{icon:t_.LEp})})]}),(0,n.jsxs)(g.x,{children:["inter-",(0,n.jsx)("strong",{children:"italic"}),".ttf"," ",(0,n.jsx)(f.xu,{color:"green.400",as:"span",children:(0,n.jsx)(A.G,{icon:t_.LEp})})]}),(0,n.jsxs)(g.x,{children:["inter-",(0,n.jsx)("strong",{children:"bold"}),".ttf"," ",(0,n.jsx)(f.xu,{color:"green.400",as:"span",children:(0,n.jsx)(A.G,{icon:t_.LEp})})]})]}),(0,n.jsxs)(tS,{uploadTip:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(E.cC,{id:"xjFrIG",components:{0:(0,n.jsx)("strong",{}),1:(0,n.jsx)("strong",{})}})}),children:[(0,n.jsxs)(g.x,{children:[(0,n.jsx)(g.x,{color:"gray.600",as:"span",children:(0,n.jsx)(A.G,{icon:S.nfZ})})," ","...-regular",(0,n.jsx)(te.E,{colorScheme:"purple",children:".ttf"})]}),(0,n.jsxs)(g.x,{children:[(0,n.jsx)(g.x,{color:"gray.600",as:"span",children:(0,n.jsx)(A.G,{icon:S.nfZ})})," ","...-regular",(0,n.jsx)(te.E,{colorScheme:"pink",children:".otf"})]})]})]}),(0,n.jsxs)(i6.g,{spacing:4,children:[(0,n.jsx)(C.z,{leftIcon:(0,n.jsx)(A.G,{icon:S.A$k}),variant:"solid",onClick:i,children:(0,n.jsx)(E.cC,{id:"NQrqa1"})}),(0,n.jsx)(g.x,{textAlign:"center",fontSize:"xs",color:"gray.600",children:(0,n.jsx)(E.cC,{id:"GYK/1H",values:{GAMMA_PROPER_NOUN:e$.N6}})}),(0,n.jsx)(tA,{})]})]})})};var tI=t(26495),tD=t(85747);let tk=e=>{let i=e.uploadFontFiles.every(e=>("created"===e.status||"existing"===e.status)&&e.fontFile.sourceUrl);return e.fontName&&i},tw=e=>{let{onClose:i,orgId:t,font:s}=e,[l,r]=T.useReducer(tx,th),o=(0,eJ.p)();(0,T.useEffect)(()=>{s?r({type:"EDIT_EXISTING_FONT",data:{font:s}}):r({type:"NEW_FONT_UPLOAD"})},[r,s]);let[a,d]=(0,T.useState)(!1),c=tk(l),u=i2(t),h=(0,ta.UK)(l),x=(0,T.useCallback)(()=>{r({type:"RESET_FONT_UPLOAD"}),i()},[r,i]),m=(0,T.useCallback)(e=>{Promise.all(e.map(async e=>{let i=(0,tc.x0)();try{let t=await (0,ta.zn)(e);r({type:"UPLOAD_FONT_FILE_UPLOAD_STARTED",data:{uploadId:i,fileType:(0,ta.CZ)(e.name),name:e.name,...t}})}catch(i){console.error("[FontUploadModal] There was an error parsing ".concat(e.name),e,i),o({title:(0,n.jsx)(E.cC,{id:"zr0u7y",values:{0:e.name}}),description:(0,n.jsx)(E.cC,{id:"SuKrYu"}),status:"error",isClosable:!0,position:"top",duration:null});return}try{let s=await (0,tp.uO)(()=>(0,tI.m)(t,e),{maxRetries:3,timeout:2e4});r({type:"UPLOAD_FONT_FILE_UPLOAD_SUCCESS",data:{uploadId:i,sourceUrl:s}})}catch(s){let t=s instanceof Error?s.message:"There was an error uploading ".concat(e.name);r({type:"UPLOAD_FONT_FILE_UPLOAD_ERROR",data:{uploadId:i,errorMessage:t}})}})).catch(e=>{console.error("[FontUploadModal] error while uploading font files",e)})},[r,t,o]),{onClick:v,inputElement:f}=(0,tD.E)({handleFilesCallback:m,multiple:!0,accept:tu.Ge.join(",")}),b=(0,T.useCallback)(()=>{d(!0),u(l).then(()=>{"create"===l.mode?o({title:(0,n.jsx)(E.cC,{id:"MXSt4t",values:{0:l.fontName}}),status:"success",duration:1e3,isClosable:!0,position:"top"}):"edit"===l.mode&&o({title:(0,n.jsx)(E.cC,{id:"P2ieni",values:{0:l.fontName}}),status:"success",duration:2e3,isClosable:!0,position:"top"})}).catch(e=>{o({title:"edit"===l.mode?(0,n.jsx)(E.cC,{id:"K45zvU"}):(0,n.jsx)(E.cC,{id:"FL7N1y",values:{0:l.fontName}}),status:"error",duration:5e3,isClosable:!0,position:"top"}),console.error("[FontUploadModal] error ".concat("edit"===l.mode?"editing":"creating"," font"),e)}).finally(()=>{d(!1),i()})},[i,u,l,o]),y=(0,ta.x_)(l.uploadFontFiles.map(e=>e.fontFile));return(0,n.jsxs)(e1.u_,{isOpen:!0,closeOnOverlayClick:!1,onClose:x,size:"3xl",children:[(0,n.jsx)(e2.Z,{}),(0,n.jsxs)(e5.h,{children:[(0,n.jsx)(e3.x,{children:l.hasUploadedFonts?l.fontName?l.fontName:(0,n.jsx)(E.cC,{id:"yT14LZ"}):(0,n.jsx)(E.cC,{id:"O7HGjV"})}),(0,n.jsx)(e4.o,{isDisabled:a}),(0,n.jsx)(ex.i,{mb:"4"}),f,l.hasUploadedFonts?(0,n.jsx)(ty,{fontFiles:l.uploadFontFiles,fontName:l.fontName,dispatch:r,onFontFileUploadClick:v}):(0,n.jsx)(tE,{onFontFileUploadClick:v}),(0,n.jsx)(ex.i,{mb:1}),(0,n.jsx)(e9.m,{children:l.hasUploadedFonts?(0,n.jsxs)(p.k,{flex:1,mb:"2",alignItems:"center",justifyContent:"space-between",children:[(0,n.jsx)(g.x,{children:(0,n.jsx)(E.cC,{id:"y
1DnXlV",values:{numOfStyles:y}})}),(0,n.jsxs)(j.h,{children:[(0,n.jsx)(C.z,{variant:"ghost",onClick:i,children:(0,n.jsx)(E.cC,{id:"dEgA5A"})}),(0,n.jsx)(C.z,{isDisabled:!c||!h,variant:"solid",onClick:b,isLoading:a,children:"edit"===l.mode?(0,n.jsx)(E.cC,{id:"tfDRzk"}):(0,n.jsx)(E.cC,{id:"N/mjN3"})})]})]}):(0,n.jsx)(C.z,{variant:"ghost",onClick:i,children:(0,n.jsx)(E.cC,{id:"dEgA5A"})})})]})]})};var tT=t(62131),tP=t(2953),tO=t(5200);let tN=e=>{let{label:i,icon:t,onClick:s}=e;return(0,n.jsx)(i4,{bg:"gray.50",onClick:s,children:(0,n.jsxs)(u.K,{align:"center",children:[(0,n.jsx)(g.x,{fontSize:"x-large",children:t}),(0,n.jsx)(g.x,{children:i}),(0,n.jsx)(tT.U,{productFeature:"custom_fonts"})]})})},tL=e=>{let{isSidebarVisible:i,setIsSidebarVisible:t}=e;(0,i1.G)("customFonts");let{currentWorkspace:s}=(0,L.SE)(),{openUpsellModal:l}=(0,tP.z)(),r=(0,F.lo)(),[o,a]=(0,T.useState)(null),{data:c,error:h,loading:p}=(0,P.LkU)({variables:{workspaceId:null==s?void 0:s.id,archived:!1},skip:!s}),{isOpen:m,onOpen:j,onClose:C}=(0,d.q)(),{isOpen:v,onOpen:b,onClose:y}=(0,d.q)(),{isOpen:_,onOpen:I,onClose:D}=(0,d.q)(),k=(0,T.useCallback)((e,i)=>()=>{if(!r){l({segmentEvent:U.AA.GAMMA_PRO_UPSELL_CALLOUT_CUSTOM_FONTS});return}a(e),"edit"===i?j():(b(),C()),D()},[r,l,b,D,j,C]),w=(0,T.useCallback)(()=>{if(!r){l({segmentEvent:U.AA.GAMMA_PRO_UPSELL_CALLOUT_CUSTOM_FONTS});return}a(null),j()},[r,l,j]),O=(0,T.useCallback)(e=>()=>{a(e),I()},[I]),{displayName:N,description:R,ariaLabel:M,icon:B}=z.A5[z.oc.FONTS],G=((null==c?void 0:c.fonts)||[]).filter(e=>!e.archived),H=G.map(e=>({id:e.id,name:e.name,url:e.cssUrl})),K=G.length;return(0,n.jsxs)(f.xu,{w:"100%","data-testid":"fonts-view-container",children:[(0,n.jsx)(tO.J,{fonts:H}),(0,n.jsxs)(em,{isSidebarVisible:i,setIsSidebarVisible:t,children:[(0,n.jsxs)(x.X,{fontSize:"lg",fontWeight:"600","data-testid":"fonts-view-header",children:[B&&(0,n.jsx)(A.G,{icon:B,"aria-label":M})," ",(0,n.jsx)(g.x,{as:"span",ml:2,children:N})]}),(0,n.jsx)(g.x,{fontSize:"md",mt:"2",mb:"6",color:"gray.600",children:R})]}),(0,n.jsxs)(u.K,{children:[(0,n.jsx)(g.x,{color:"gray.600",children:(0,n.jsx)(E.cC,{id:"GOR0mG",values:{numOfFonts:K}})}),(0,n.jsxs)(i0.M,{columns:{base:1,md:2,xl:3,"2xl":4},spacing:6,children:[(0,n.jsx)(tN,{label:(0,n.jsx)(E.cC,{id:"O7HGjV"}),icon:(0,n.jsx)(A.G,{icon:S.A$k}),onClick:w}),!p&&!h&&G.map(e=>(0,n.jsx)(td,{font:e,onEditClick:k(e,"edit"),onDeleteClick:k(e,"delete"),onClick:O(e)},e.id))]})]}),m&&s&&(0,n.jsx)(tw,{onClose:C,orgId:s.id,font:o}),v&&s&&o&&(0,n.jsx)(i3,{onClose:y,orgId:s.id,font:o}),_&&o&&(0,n.jsx)(tr,{onClose:D,onEditClick:k(o,"edit"),onDeleteClick:k(o,"delete"),font:o})]})};var tR=t(33579),tM=t(71508);let tF=e=>{let{deck:i}=e,t=(0,tR.Lq)(i),s=(0,eu.Gn)({docId:t,path:"example"});return(0,n.jsx)(e_.F7,{title:i.title||"",menuEnabled:!0,href:s,id:t,createdTime:new Date().toISOString(),thumbnailImageUrl:{src:null==i?void 0:i.previewImageUrl,fallbackSrc:Z.Z.src},NextLink:Y(),onFavorite:void 0,isTrashAndRestoreEnabled:!1,createdByName:(null==i?void 0:i.authorDisplayName)||"Gamma",createdByProfileImageUrl:(null==i?void 0:i.authorImageUrl)||tM.Z.src,isDuplicateEnabled:!1},t)},tU=e=>{let{category:i}=e;if(!i)return(0,n.jsx)(n.Fragment,{});let t=i.decks;return(0,n.jsxs)(f.xu,{mb:8,children:[(0,n.jsx)(iE.Im,{category:i}),(0,n.jsx)(e_.Gd,{children:null==t?void 0:t.map(e=>(0,n.jsx)(tF,{deck:e},e.docId))})]},i.id)},tz=e=>{let{isSidebarVisible:i,setIsSidebarVisible:t}=e,{categories:s,loading:l}=(0,iE.jn)(),{displayName:r,ariaLabel:o,description:a,icon:d}=z.A5[z.oc.INSPIRATION];return(0,n.jsxs)(f.xu,{w:"100%","data-testid":"inspiration-view-container",children:[(0,n.jsx)(em,{isSidebarVisible:i,setIsSidebarVisible:t,children:(0,n.jsxs)(x.X,{fontSize:"lg",fontWeight:"600","data-testid":"docs-view-header",children:[d&&(0,n.jsx)(A.G,{icon:d,"aria-label":o})," ",(0,n.jsx)(g.x,{as:"span",ml:2,children:r})]})}),l&&(0,n.jsx)(f.xu,{width:"100%","data-testid":"inspiration-skeleton",children:(0,n.jsxs)(e_.Gd,{children:[(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"240px",as:_.O},1),(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"240px",as:_.O},2),(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"240px",as:_.O},3)]})}),!l&&s&&(null==s?void 0:s.length)>0&&(null==s?void 0:s.map(e=>(0,n.jsx)(tU,{category:e},e.id)))]})},tB=()=>(0,n.jsxs)(p.k,{flex:1,w:"100%",direction:"column",children:[(0,n.jsx)(_.O,{w:"50%",h:"48px",mb:4}),(0,n.jsx)(f.xu,{w:"100%",children:(0,n.jsxs)(b.r,{templateColumns:["repeat(2, 1fr)","repeat(3, 1fr)"],gap:6,children:[(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:_.O}),(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:_.O}),(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"200px",as:_.O})]})})]}),tG=e=>{let{category:i}=e;if(!i)return(0,n.jsx)(n.Fragment,{});let t=i.decks;return(0,n.jsxs)(f.xu,{mb:8,children:[(0,n.jsx)(iE.Im,{category:i}),(0,n.jsx)(e_.Gd,{children:null==t?void 0:t.map(e=>(0,n.jsx)(iE.nL,{deck:e},e.docId))})]},i.id)},tH=e=>{let{isSidebarVisible:i,setIsSidebarVisible:t}=e,{categories:s,loading:l}=(0,iE.tk)(),{isOpen:r,onOpen:o,onClose:a}=(0,d.q)({id:"template-browser-modal"});if((0,B.s2)())return w().replace("/"),null;let{displayName:c,ariaLabel:u,icon:h}=z.A5[z.oc.TEMPLATES];return(0,n.jsxs)(f.xu,{w:"100%","data-testid":"templates-view-container",children:[(0,n.jsx)(em,{isSidebarVisible:i,setIsSidebarVisible:t,children:(0,n.jsxs)(x.X,{fontSize:"lg",fontWeight:"600","data-testid":"docs-view-header",children:[h&&(0,n.jsx)(A.G,{icon:h,"aria-label":u})," ",(0,n.jsx)(g.x,{as:"span",ml:2,children:c})]})}),l&&(0,n.jsx)(tB,{}),!l&&s&&(null==s?void 0:s.length)>0&&(null==s?void 0:s.map(e=>(0,n.jsx)(tG,{category:e},e.id))),r&&(0,n.jsx)(iE.UB,{isOpen:!0,onClose:a})]})};var tK=t(11550),tV=t(50260),tW=t(96967),tq=t(26838),tY=t(86963),tX=t(46409);let tZ=e=>{let{label:i,icon:t,onClick:s}=e;return(0,n.jsx)(p.k,{alignItems:"center",justifyContent:"center",border:"1px solid",borderColor:"gray.200",borderRadius:"lg",background:"gray.50",minH:36,minW:"100%",_hover:{background:"white",color:"trueblue.600",cursor:"pointer"},onClick:s,children:(0,n.jsxs)(u.K,{textAlign:"center",children:[(0,n.jsx)(g.x,{fontSize:"xl",children:t}),(0,n.jsx)(g.x,{children:i})]})})},tQ=e=>{let{isSidebarVisible:i,setIsSidebarVisible:t}=e,[s,l]=(0,T.useState)("custom"),[r,o]=(0,tY.g)(),{currentWorkspace:a}=(0,L.SE)(),{isOpen:d,onOpen:u,onClose:h}=(0,tK.M)({id:"themeEditor"}),p=(0,T.useCallback)(function(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e?i?o({type:"SET_NEW_THEME_FOR_SELECTING",data:{theme:e}}):o({type:"SET_THEME_EDITING",data:{theme:e}}):o({type:"NEW_BLANK_THEME"}),u()},[o,u]),m=(0,T.useCallback)(()=>{o({type:"THEME_RESET"}),h()},[o,h]),{data:j,loading:v,called:b}
1=(0,P.BCl)({variables:{workspaceId:null==a?void 0:a.id,archived:!1},skip:!a}),{data:I}=(0,P.BCl)({variables:{workspaceId:null,archived:!1}}),[D,{data:k,loading:w}]=(0,P.T_w)({variables:{workspaceId:null==a?void 0:a.id,archived:!0},fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"});(0,T.useEffect)(()=>{"archived"===s&&a&&D()},[a,s,D]);let O=(null==k?void 0:k.themes)||[],N=(null==j?void 0:j.themes)||[],R=(null==I?void 0:I.themes)||[],M=(0,T.useMemo)(()=>(0,tV.QB)(null==I?void 0:I.themes),[I]),{displayName:F,description:U,ariaLabel:B,icon:G}=z.A5[z.oc.THEMES],H=(0,ig.i)({base:!0,xl:!1}),K=null===tV.oN||void 0===tV.oN?void 0:tV.oN[s],V=tV.rd.map(e=>({key:e,...tV.oN[e]})),q="custom"===s?N:"archived"===s?O:R;return(0,n.jsxs)(f.xu,{w:"100%","data-testid":"themes-view-container",children:[(0,n.jsx)(tX.Y,{}),(0,n.jsxs)(em,{isSidebarVisible:i,setIsSidebarVisible:t,children:[(0,n.jsxs)(x.X,{fontSize:"lg",fontWeight:"600","data-testid":"themes-view-header",children:[G&&(0,n.jsx)(A.G,{icon:G,"aria-label":B})," ",(0,n.jsx)(g.x,{as:"span",ml:2,children:F})]}),(0,n.jsx)(g.x,{fontSize:"md",mt:"2",mb:"6",color:"gray.600",children:U}),(0,n.jsx)(eB.E,{id:"filter-by-dropdown",zIndex:"3",width:["100%","auto"],mt:[4,0],children:H?(0,n.jsxs)(J.v,{closeOnSelect:!0,children:[(0,n.jsx)($.j,{as:C.z,variant:"ghost",size:"sm",rightIcon:(0,n.jsx)(A.G,{icon:S.ptq}),fontWeight:"600",color:"gray.700",leftIcon:(0,n.jsx)(A.G,{icon:S.G_j}),children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(f.xu,{boxSize:4,children:K.icon}),(0,n.jsx)(f.xu,{children:K.label})]})}),(0,n.jsx)(et.q,{minWidth:"240px",children:(0,n.jsx)(eP._,{defaultValue:s,title:W.ag._({id:"MwX53Z"}),type:"radio",onChange:e=>{l(e)},value:s,children:V.map(e=>(0,n.jsx)(im.i,{value:e.key,children:(0,n.jsxs)(c.U,{children:[(0,n.jsx)(f.xu,{w:5,children:e.icon}),(0,n.jsx)(f.xu,{children:e.label})]})},e.key))})})]}):V.map(e=>{let i=e.key===s;return(0,n.jsx)(eB.U,{children:(0,n.jsx)(C.z,{fontWeight:"600",color:i?"trueblue.500":"gray.600",bg:i?"trueblue.50":"transparent",size:"sm",leftIcon:e.icon,variant:"ghost",onClick:()=>l(e.key),children:e.label})},e.key)})})]}),!b||v||w?(0,n.jsx)(f.xu,{width:"100%","data-testid":"themes-skeleton",children:(0,n.jsx)(i0.M,{columns:[1,2,2,3,5],spacing:6,children:[1,2,3,4,5,6,7,8].map(e=>(0,n.jsx)(y.P,{bg:"linen.50",borderRadius:"5px",height:"144px",as:_.O},e))})}):0===q.length&&"custom"!==s?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(E.cC,{id:"h+6hB/"})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(tJ,{themes:q,openThemeEditor:p,type:s,defaultNewTheme:M})}),(0,n.jsx)(tW.z,{isOpen:d,onClose:m,state:r,dispatch:o,disableDrawerTransition:!0})]})},tJ=e=>{let{themes:i,type:t,defaultNewTheme:s,openThemeEditor:l}=e,r="custom"===t,o=(0,T.useCallback)(()=>{l&&s&&l(s,!0)},[l,s]),a=(0,T.useCallback)(e=>{null==l||l(e)},[l]);return(0,n.jsx)(u.K,{children:(0,n.jsxs)(i0.M,{columns:[1,2,2,3,5],spacing:6,children:[r&&(0,n.jsx)(tZ,{label:(0,n.jsx)(E.cC,{id:"FiwgR9"}),icon:(0,n.jsx)(A.G,{icon:S.EQ8}),onClick:o}),[...i].sort(tV.qb).map(e=>(0,n.jsx)(tq.o,{type:t,theme:e,isChecked:!1,onEditClick:l,onThemeClicked:r?a:void 0},e.id))]})})},t$=()=>{let{activeTab:e,userHasNoWorkspaces:i,currentChannelId:t,channelPreview:s,isSidebarVisible:l,setIsSidebarVisible:r,sitesEnabled:o,activeChannel:d}=(0,a.J)();switch(e){case"all":return(0,n.jsx)(i$,{activeTab:e,userHasNoWorkspaces:i,isSidebarVisible:l,setIsSidebarVisible:r,currentChannelId:t,activeChannel:d,channelPreview:s});case"sites":if(o)return(0,n.jsx)(ej,{isSidebarVisible:l,setIsSidebarVisible:r});case"templates":return(0,n.jsx)(tH,{isSidebarVisible:l,setIsSidebarVisible:r});case"inspiration":return(0,n.jsx)(tz,{isSidebarVisible:l,setIsSidebarVisible:r});case"themes":return(0,n.jsx)(tQ,{isSidebarVisible:l,setIsSidebarVisible:r});case"fonts":return(0,n.jsx)(tL,{isSidebarVisible:l,setIsSidebarVisible:r});default:return(0,n.jsx)(i$,{activeTab:e,userHasNoWorkspaces:i,isSidebarVisible:l,setIsSidebarVisible:r,currentChannelId:t,activeChannel:d,channelPreview:s})}};var t0=t(17190),t1=t(97729),t2=t.n(t1);let t5=()=>{let[e,i]=(0,T.useState)(!1);return(0,n.jsxs)(p.k,{"data-testid":"home",width:"100%",height:"100%",children:[(0,n.jsx)(t2(),{children:(0,n.jsx)("title",{children:"Gamma"})}),(0,n.jsx)(p.k,{"data-testid":"doc-root-main",flex:"1",px:2,py:6,w:"100vw",bg:"gray.100",borderTopLeftRadius:"15p
1x",borderBottomLeftRadius:"15px",direction:"column",marginLeft:{base:"0"},minH:"var(--100vh)",transition:"margin .2s ease",children:(0,n.jsxs)(t0.W,{maxW:"80em",children:[(0,n.jsx)(_.O,{height:"42px",w:"30%",mb:2}),(0,n.jsx)(_.O,{height:"24px",w:"100%",mb:2}),(0,n.jsx)(_.O,{height:"24px",w:"100%",mb:10}),(0,n.jsx)(p.k,{width:"100%",children:(0,n.jsx)(ip,{})})]})})]})};var t3=t(33360),t4=t(93441);let t6=()=>{let e=(0,t4.gF)();return((0,r.X)(!0),(0,o.o)(),e)?(0,n.jsx)(t$,{},"home-v2"):(0,n.jsx)(t5,{},"home-skeleton")};var t9=(0,l.z)((0,t3.w)(t6))},18412:function(e,i,t){"use strict";t.d(i,{T:function(){return n}});var s=t(76919);let n=new s.v},55274:function(e,i,t){"use strict";t.d(i,{AA:function(){return u},DN:function(){return d},mb:function(){return c}});var s=t(5632),n=t(2784),l=t(91994),r=t(47968),o=t(78462),a=t(18412);let d=(0,n.createContext)({openPageSetup:(e,i)=>{},openSiteSettings:e=>{},openSharePanel:(e,i)=>{}}),c=(e,i)=>{let{push:t}=(0,s.useRouter)(),d=(0,l.qr)();return(0,n.useMemo)(()=>({openPageSetup:async(s,n)=>{if(!i)return;let l=()=>a.T.emit("openPageSetup",n);if(s!==e){let e=(0,o.yQ)({docId:s});await t(e);let i=d.subscribe(()=>{(0,r.ke)(d.getState())===s&&(l(),i())})}else l()},openSiteSettings:e=>{a.T.emit("openSiteSettings",e)},openSharePanel:async(i,s)=>{let n=()=>a.T.emit("openSharePanel",s);if(i!==e){let e=(0,o.yQ)({docId:i});await t(e);let s=d.subscribe(()=>{(0,r.ke)(d.getState())===i&&(n(),s())})}else n()}}),[e,t,i,d])},u=()=>(0,n.useContext)(d)},37639:function(e,i,t){"use strict";t.d(i,{Ad:function(){return c},ve:function(){return d}});var s=t(52322),n=t(2784),l=t(64663);let r={activeTab:l.oc.ALL},o=(0,n.createContext)({state:r,dispatch:()=>{throw Error("dispatch function must be overridden")}}),a=(e,i)=>"SET_ACTIVE_TAB"===i.type?{...e,activeTab:i.payload}:e,d=()=>{let e=(0,n.useContext)(o);if(void 0===e)throw Error("useActiveTabContext must be used within a ActiveTabProvider");return e},c=e=>{let{children:i}=e,[t,l]=(0,n.useReducer)(a,r);return(0,s.jsx)(o.Provider,{value:{state:t,dispatch:l},children:i})}},64663:function(e,i,t){"use strict";t.d(i,{A5:function(){return u},f8:function(){return d},oc:function(){return c}});var s=t(52322),n=t(42946),l=t(5879),r=t(87254),o=t(94199),a=t(30579);let d={SHARED_WITH_ME:"shared-with-me",ALL:"all",CHANNEL:"channel",TRASH:"trash",TEMPLATES:"templates",INSPIRATION:"inspiration",THEMES:"themes",FONTS:"fonts",SITES:"sites",SETTINGS:"settings"},c={...d},u={[d.SHARED_WITH_ME]:{displayName:(0,s.jsx)(l.cC,{id:"lIbchQ"}),ariaLabel:r.ag._({id:"rt/fuz"}),icon:n.XCy,showCreateButton:!1},[d.ALL]:{displayName:(0,s.jsx)(l.cC,{id:"W10xDz",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:o.aq}}),ariaLabel:r.ag._({id:"W10xDz",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:o.aq}}),icon:n.s2,showCreateButton:!0},[d.SITES]:{displayName:(0,s.jsx)(l.cC,{id:"QHZRmq"}),ariaLabel:r.ag._({id:"QHZRmq"}),icon:n.g4A,showCreateButton:!0},[d.CHANNEL]:{displayName:(0,s.jsx)(l.cC,{id:"HSh8u/"}),ariaLabel:r.ag._({id:"HSh8u/"}),icon:a.Ty,showCreateButton:!0},[d.TRASH]:{displayName:(0,s.jsx)(l.cC,{id:"GQ3O42"}),ariaLabel:r.ag._({id:"GQ3O42"}),icon:n.XAH,showCreateButton:!1},[d.TEMPLATES]:{displayName:(0,s.jsx)(l.cC,{id:"iTylMl"}),ariaLabel:r.ag._({id:"iTylMl"}),icon:n.BDt,showCreateButton:!1},[d.INSPIRATION]:{displayName:(0,s.jsx)(l.cC,{id:"K2fjhl"}),ariaLabel:r.ag._({id:"K2fjhl"}),icon:n.cnt,showCreateButton:!1},[d.THEMES]:{displayName:(0,s.jsx)(l.cC,{id:"fJ3EbT"}),ariaLabel:r.ag._({id:"fJ3EbT"}),icon:n.q2v,showCreateButton:!1,description:(0,s.jsx)(l.cC,{id:"1kjnn4",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:o.aq},components:{0:(0,s.jsx)("b",{}),1:(0,s.jsx)("b",{})}})},[d.FONTS]:{displayName:(0,s.jsx)(l.cC,{id:"E3KfxC"}),ariaLabel:r.ag._({id:"E3KfxC"}),icon:n.gu6,showCreateButton:!1,description:(0,s.jsx)(l.cC,{id:"sWZ6Li",components:{0:(0,s.jsx)("b",{})}})},[d.SETTINGS]:{displayName:(0,s.jsx)(l.cC,{id:"0dbeO4"}),ariaLabel:r.ag._({id:"0dbeO4"}),icon:n.Kb6,showCreateButton:!1}}},46929:function(e,i,t){"use strict";t.d(i,{J:function(){return O}});var s=t(5632),n=t.n(s),l=t(2784),r=t(42111),o=t(67964),a=t(91994),d=t(11050),c=t(36651),u=t(37639),h=t(64663),x=t(76644),p=t(52322),m=t(70065),g=t(93202),j=t(82642),C=t(38035),v=t(77533),f=t(75768),b=t(62614),y=t(32899),_=t(5879),S=t(87254);let A=e=>{let{currentChannelId:i,channelPreview:t,workspaceId:s,joinChannel:l,toastId:r}=e,o=(0,m.p)();return r?(0,p.jsxs)(C.k,{bg:"white",p:3,px:6,m:4,justify:"center",align:"center",borderRadius:"md",shadow:"md",children:[(0,p.jsx)(v.x,{fontSize:"sm",mr:4,children:(0,p.jsx)(_.cC,{id:"HPr8I3",values:{0:t.name},components:{0:(0,p.jsx)("strong",{})}})}),(0,p.jsxs)(f.h,{size:"sm",alignItems:"center",children:[(0,p.jsx)(b.z,{maxW:"xs",display:"block",noOfLines:1,onClick:()=>
1{if(!i||!t){console.error("No active channel id");return}l({channel:{...t},workspaceId:s}).then(()=>{o.close(r)})},variant:"solid",children:(0,p.jsx)(_.cC,{id:"0wdd7X"})}),(0,p.jsx)(y.h,{isRound:!0,variant:"ghost",size:"xs","aria-label":S.ag._({id:"1QfxQT"}),icon:(0,p.jsx)(j.T,{}),onClick:()=>{o.close(r),n().replace("/#".concat(x.pX))}})]})]}):null};var E=t(77405);let I=e=>{let{currentChannelId:i,activeChannel:t,workspaceId:s}=e,r=(0,l.useRef)(),o=(0,m.p)(),{joinChannel:a}=(0,E.A)(),{data:d,called:c,error:u,loading:h}=(0,g.aw6)({variables:{id:i,workspaceId:s},skip:t||!i||!s}),j=i&&!t&&(null==d?void 0:d.channel)?d.channel:null;return(0,l.useEffect)(()=>{u&&console.error("[useChannelsData] Error fetching channelPreview",u),(u||c&&j&&j.archived)&&n().replace("/#".concat(x.pX))},[u,j,c,h]),(0,l.useEffect)(()=>{let e=i&&j;return!e&&r.current&&(o.close(r.current),r.current=void 0),e&&(r.current?r.current&&o.update(r.current,{duration:null,render:()=>(0,p.jsx)(A,{workspaceId:s,currentChannelId:i,channelPreview:j,joinChannel:a,toastId:r.current})}):r.current=o({duration:null,render:()=>(0,p.jsx)(A,{workspaceId:s,currentChannelId:i,channelPreview:j,joinChannel:a,toastId:r.current})})),()=>{r.current&&o.close(null==r?void 0:r.current)}},[i,j,a,o,s]),{channelPreview:j}},D=e=>{let{workspaceId:i,user:t}=e,{query:n}=(0,s.useRouter)(),r=Array.isArray(n.channelSlug)?n.channelSlug[0]:n.channelSlug,o=r?r.slice(-15):null,{data:a,loading:d,subscribeToMore:c}=(0,g.uCJ)({variables:{workspaceId:i},skip:!t||!t.workspaceMemberships||!i,returnPartialData:!0});(0,l.useEffect)(()=>{if(c&&i)return c({document:g.olB,variables:{workspaceId:i}})},[c,i]);let u=((null==a?void 0:a.channels)||[]).filter(e=>e.isMember&&!e.archived).sort((e,i)=>e.slug.localeCompare(i.slug,"en")),h=u.find(e=>e.id===o),{channelPreview:x}=I({currentChannelId:o,activeChannel:h,workspaceId:i});return{channelPreview:x,currentChannelId:o,channels:u,isChannelsLoading:d,activeChannel:h}},k=e=>{let{currentChannel:i,currentWorkspaceId:t}=e,{replace:n}=(0,s.useRouter)();(0,l.useEffect)(()=>{t&&i&&i.workspaceId!==t&&n("/")},[i,t,n])};var w=t(16263),T=t(78462);let P=e=>Object.values(h.oc).find(i=>i===e),O=()=>{let{user:e,currentWorkspace:i}=(0,c.SE)(),{isReady:t,route:p}=(0,s.useRouter)(),m=(0,o._O)(),g=(0,r.ye)("workspaceSettings"),j=!!(e&&0===e.workspaceMemberships.length),C=P((0,T.AE)()),{channelPreview:v,channels:f,activeChannel:b,currentChannelId:y,isChannelsLoading:_}=D({workspaceId:null==i?void 0:i.id,user:e});k({currentChannel:v||b,currentWorkspaceId:null==i?void 0:i.id});let{state:S,dispatch:A}=(0,u.ve)(),E=S.activeTab,I=(0,a.TL)(),O=(0,a.CG)(w.NV),N=(0,l.useCallback)(e=>{I((0,w.II)({isSidebarVisible:e}))},[I]);return(0,l.useEffect)(()=>{let e="/settings"===p?"settings":void 0,i=y?h.oc.CHANNEL:C||e||x.pX;i!==E&&A({type:"SET_ACTIVE_TAB",payload:i})},[E,y,A,p,C]),(0,l.useEffect)(()=>{m||"sites"!==E||n().replace("/")},[m,E]),(0,l.useEffect)(()=>{N(!1)},[]),(0,l.useEffect)(()=>{t&&(j?n().replace("/#".concat(h.oc.SHARED_WITH_ME)):setTimeout(()=>{I((0,w.II)({isSidebarVisible:!1}))},150))},[I,C,y,j,t]),(0,d.If)(e=>{e.track(d.AA.HOME_TAB_VIEWED,{tab:E})},[E]),{channelPreview:v,channels:f,activeChannel:b,currentChannelId:y,isChannelsLoading:_,activeTab:E,isWorkspaceSettingsEnabled:g,isSidebarVisible:O,setIsSidebarVisible:N,sitesEnabled:m,userHasNoWorkspaces:j,user:e,currentWorkspace:i}}},62207:function(e,i,t){"use strict";t.d(i,{k:function(){return eo},l:function(){return V}});var s=t(52322),n=t(46949),l=t(43297),r=t(38035),o=t(28535),a=t(75009),d=t(74409),c=t(77533),u=t(29117),h=t(36474),x=t(62614),p=t(92850),m=t(26468),g=t(22226),j=t(54326),C=t(2338),v=t(97217),f=t(35183),b=t(74105),y=t(20816),_=t(85573),S=t(81540),A=t(99793),E=t(67109),I=t(42822),D=t(50250),k=t(42946),w=t(49929),T=t(94523),P=t(5879),O=t(87254),N=t(2784),L=t(93202),R=t(94199),M=t(30579),F=t(29094),U=t(77405),z=t(11082),B=t(38421),G=t.n(B);let H=e=>{let{channelName:i,onCreateClick:t}=e;return(0,s.jsx)(I.M,{minH:"sm",children:(0,s.jsxs)(r.k,{direction:"column",justify:"center",align:"center",w:["100%","80%"],children:[(0,s.jsx)(o.xu,{w:"80%",maxW:"250px",mb:6,alignContent:"center",children:(0,s.jsx)(G(),{src:"/images/Sal-Fishing-2x.png",width:"640",height:"361",alt:"Sal, the Gamma mascot, fishing extraterrestrially"})}),(0,s.jsx)(d.X,{size:"md",mb:2,textAlign:"center",children:(0,s.jsx)(P.cC,{id:"NmfOr+"})}),(0,s.jsx)(c.x,{fontSize:"lg",color:"gray.400",textAlign:"center",children:(0,s.jsx)(P.cC,{id:"cZOpR0",values:{channelName:i},components:{0:(0,s.jsx)(z.r,{onClick:t,color:"trueblue.500"})}})})]})})},K=e=>{let{channels:i,workspaceId:t}=e,{leaveChannel:n,joinChannel:p}=(0,U.A)(),m=(0,N.useCallback)((e,i)=>{e?p({channel:i,workspaceId:t}):n({channel:i})},[p,n,t]);return(0,s.jsxs)(l.K,{spacing:0,children:[0===i.length&&(0,s.jsxs)(r.k,{direction:"column",justify:"center",align:"center",w:"100%",my:6,children:[(0,s.jsx)(o.xu,{w:"80%",maxW:"200px",mb:6,alignContent:"center",children:(0,s.jsx)(a.E,{src:F.Z.src,width:"725px",alt:"Sal, the Gamma mascot, painting in space"})}),(0,s.jsx)(d.X,{size:"md",mb:2,textAlign:"center",children:(0,s.jsx)(P.cC,{id:"PN1FMY"})}),(0,s.jsx)(c.x,{fontSize:"lg",color:"gray.400",textAlign:"center",children:(0,s.jsx)(P.cC,{id:"gdEwT8",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:R.aq},components:{0:(0,s.jsx)("br",{})}})})]}),i.length>0&&i.map(e=>{let{members:i,isMember:t,memberCount:n,name:r}=e;return(0,s.jsxs)(u.U,{spacing:4,px:4,py:2,_hover:{bg:"gray.100"},borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",children:[(0,s.jsx)(o.xu,{p:2,color:t?"":"gray.400",children:(0,s.jsx)(w.G,{icon:t?k.fV7:M.Ty})}),(0,s.jsxs)(u.U,{flex:1,children:[(0,s.jsxs)(l.K,{spacing:0,children:[(0,s.jsx)(c.x,{children:r}),(0,s.jsx)(c.x,{fontSize:"sm",color:"gray.400",children:e.isMember?(0,s.jsx)(P.cC,{id:"tWPlLK",values:{0:n||0}}):(0,s.jsx)(P.cC,{id:"pkIIls",values:{0:n||0}})})]}),(0,s.jsx)(h.L,{}
1),(0,s.jsx)(T.NL,{size:"xs",overflowTooltipLabel:O.ag._({id:"25VyZX"}),avatars:i||[],max:3})]}),(0,s.jsx)(x.z,{w:20,variant:t?"ghost":"plain",color:t?"gray.600":"plain",size:"sm",onClick:()=>{m(!t,e)},children:t?(0,s.jsx)(P.cC,{id:"Mv8CyJ"}):(0,s.jsx)(P.cC,{id:"0wdd7X"})})]},e.id)})]})},V=e=>{var i;let{isOpen:t,onClose:r,workspaceId:o}=e,[a,d]=(0,N.useState)(""),[h,k]=(0,N.useState)(!1),[w,R]=(0,N.useState)(!1),M=(0,N.useRef)(null),{createChannel:F,createChannelLoading:z,createChannelError:B}=(0,U.A)(),[G,V]=(0,N.useState)(null),[W,q]=(0,N.useState)(!1),{data:Y,loading:X,called:Z,fetchMore:Q}=(0,L.Un3)({variables:{workspaceId:o,first:20,sortBy:{field:L.Bhs.MemberCount,direction:L.SrV.Desc},query:a},skip:!o,nextFetchPolicy:"cache-only"}),J=(0,N.useCallback)(e=>{let{value:i}=e.target;V(null),i?d(i):d("")},[]),$=!!(a&&(null==Y?void 0:Y.workspaceChannels.edges.length)===0),ee=()=>{o&&F({input:{name:a,workspaceId:o}}).then(()=>{r()}).catch(e=>{V(e.message)})};(0,N.useEffect)(()=>{X||k($)},[X,$]),(0,N.useEffect)(()=>{!Z||X||w||R(!0)},[Z,X,w]);let ei=h&&$,et=(null==Y?void 0:Y.workspaceChannels.edges.map(e=>e.node))||[],es=!a,en=null==Y?void 0:null===(i=Y.workspaceChannels)||void 0===i?void 0:i.pageInfo,el=w&&(null==en?void 0:en.hasNextPage)&&(null==en?void 0:en.endCursor);return(0,s.jsxs)(p.u_,{isOpen:t,onClose:r,lockFocusAcrossFrames:!1,returnFocusOnClose:!1,size:"2xl",initialFocusRef:M,children:[(0,s.jsx)(m.Z,{}),(0,s.jsxs)(g.h,{children:[(0,s.jsx)(j.x,{pb:0,children:(0,s.jsx)(P.cC,{id:"Mxy55o"})}),(0,s.jsxs)(c.x,{px:6,color:"gray.500",mb:2,children:[(0,s.jsx)(P.cC,{id:"/eBcp2"}),"."]}),(0,s.jsx)(C.o,{}),(0,s.jsx)(v.f,{children:(0,s.jsxs)(l.K,{spacing:5,children:[(0,s.jsxs)(u.U,{align:"flex-start",children:[(0,s.jsxs)(f.NI,{isInvalid:!!B&&a.length>0,children:[(0,s.jsxs)(b.B,{size:"md",children:[(0,s.jsx)(y.Z,{pointerEvents:"none",color:"gray.300",children:(0,s.jsx)(n.W,{})}),(0,s.jsx)(_.I,{value:a,onChange:J,placeholder:O.ag._({id:"iwm5Y3"}),_placeholder:{opacity:1},ref:M}),X&&(0,s.jsx)(y.x,{pointerEvents:"none",color:"gray.500",transitionProperty:"common",transitionDuration:"normal",children:(0,s.jsx)(S.$,{size:"sm"})})]}),G&&(0,s.jsx)(A.J1,{children:G})]}),(0,s.jsx)(x.z,{w:"300px",variant:"plain",onClick:ee,isDisabled:0===a.length,isLoading:z,children:(0,s.jsx)(P.cC,{id:"Oo7YVo"})})]}),(0,s.jsxs)(T.NZ,{children:[es&&(0,s.jsx)(P.cC,{id:"LOzhoI"}),a&&(0,s.jsx)(P.cC,{id:"mjEyky",values:{0:et.length}})]}),ei&&(0,s.jsx)(H,{channelName:a,onCreateClick:ee}),!w&&(0,s.jsxs)(l.K,{children:[(0,s.jsx)(E.O,{height:"55px"}),(0,s.jsx)(E.O,{height:"55px"}),(0,s.jsx)(E.O,{height:"55px"}),(0,s.jsx)(E.O,{height:"55px"}),(0,s.jsx)(E.O,{height:"55px"})]}),w&&o&&!ei&&(0,s.jsx)(K,{channels:et,workspaceId:o}),el&&(0,s.jsx)(I.M,{p:6,children:(0,s.jsx)(x.z,{isLoading:W,onClick:()=>{q(!0),Q({variables:{...0===a.length?{first:50}:{},after:null==en?void 0:en.endCursor}}).finally(()=>{q(!1)})},size:"sm",children:(0,s.jsx)(P.cC,{id:"yQ2kGp"})})})]})}),(0,s.jsx)(D.m,{children:(0,s.jsx)(x.z,{variant:"solid",onClick:r,children:(0,s.jsx)(P.cC,{id:"DPfwMq"})})})]})]})};var W=t(55478),q=t(70065),Y=t(26284),X=t(10625),Z=t(67046),Q=t(32899),J=t(99058),$=t(25481),ee=t(27599),ei=t(5632),et=t.n(ei),es=t(78462),en=t(75768);let el=e=>{let{channel:i,workspaceId:t,onClose:n}=e,[l]=(0,L.HOP)(),r=(0,q.p)(),o=(0,N.useCallback)(()=>{if(!t||!(null==i?void 0:i.id)){console.error('[onDeleteChannelClick] Cannot delete channel. OrgId: "'.concat(t,'" channelId: "').concat(null==i?void 0:i.id,'"'));return}l({variables:{channelId:i.id,workspaceId:t}}).then(()=>{r({title:(0,s.jsx)(P.cC,{id:"j4JrT0"}),status:"success",duration:3e3,position:"top"})})},[i,r,l,t]);return(0,s.jsxs)(p.u_,{closeOnOverlayClick:!1,isOpen:!0,onClose:n,size:"lg",children:[(0,s.jsx)(m.Z,{}),(0,s.jsxs)(g.h,{children:[(0,s.jsxs)(j.x,{children:["Delete ",i.name,"?"]}),(0,s.jsx)(C.o,{}),(0,s.jsxs)(v.f,{children:[(0,s.jsx)(c.x,{mb:2,children:(0,s.jsx)(P.cC,{id:"IkJ0gO"})}),(0,s.jsx)(c.x,{mb:2,children:(0,s.jsx)(P.cC,{id:"r5GL8F",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:R.aq}}
1)}),(0,s.jsx)(c.x,{color:"red.500",children:(0,s.jsx)(P.cC,{id:"2xOCJW"})})]}),(0,s.jsx)(D.m,{children:(0,s.jsxs)(en.h,{children:[(0,s.jsx)(x.z,{variant:"ghost",onClick:n,children:(0,s.jsx)(P.cC,{id:"dEgA5A"})}),(0,s.jsx)(x.z,{variant:"ghost",colorScheme:"red",onClick:()=>{o(),n()},children:(0,s.jsx)(P.cC,{id:"NbFtQm"})})]})})]})]})},er=e=>{let{channel:i,workspaceId:t,onClose:n}=e,l=(0,q.p)(),[o,a]=(0,N.useState)(()=>null==i?void 0:i.name),[d,{loading:c}]=(0,L.tWW)(),[u,h]=(0,N.useState)(null),b=(0,N.useCallback)(e=>{a(e.target.value)},[]),y=(0,N.useRef)(null),S=!!u,E=(0,N.useCallback)(()=>{if(!t||!(null==i?void 0:i.id)){console.error('[onRenameChannel] Cannot rename channel. OrgId: "'.concat(t,'" channelId: "').concat(null==i?void 0:i.id,'"'));return}d({variables:{input:{id:null==i?void 0:i.id,workspaceId:t,name:o}}}).then(e=>{var t;let{data:r}=e;et().replace((0,es.j)({id:null==i?void 0:i.id,slug:null==r?void 0:r.updateChannel.slug})),l({title:(0,s.jsx)(P.cC,{id:"QJd4OZ",values:{0:null==r?void 0:null===(t=r.updateChannel)||void 0===t?void 0:t.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}),n()}).catch(e=>{h(e.message)})},[t,null==i?void 0:i.id,d,o,l,n]);return(0,s.jsxs)(p.u_,{closeOnOverlayClick:!1,isOpen:!0,initialFocusRef:y,onClose:n,children:[(0,s.jsx)(m.Z,{}),(0,s.jsxs)(g.h,{children:[(0,s.jsx)(j.x,{children:(0,s.jsx)(P.cC,{id:"NZgZhv"})}),(0,s.jsx)(C.o,{}),(0,s.jsx)(v.f,{children:(0,s.jsx)(r.k,{mt:4,w:"100%",direction:"column",children:(0,s.jsxs)(f.NI,{isInvalid:S,children:[(0,s.jsx)(_.I,{value:o,ref:y,onChange:b,onKeyDown:e=>{"Enter"===e.key&&E()}}),S&&(0,s.jsx)(A.J1,{children:u})]})})}),(0,s.jsx)(D.m,{children:(0,s.jsxs)(en.h,{children:[(0,s.jsx)(x.z,{variant:"ghost",onClick:n,children:(0,s.jsx)(P.cC,{id:"dEgA5A"})}),(0,s.jsx)(x.z,{isLoading:c,variant:"solid",onClick:E,children:(0,s.jsx)(P.cC,{id:"2wxgft"})})]})})]})]})},eo=e=>{let{channel:i,workspaceId:t}=e,{isOpen:n,onOpen:l,onClose:r}=(0,W.q)({id:"deleteChannelModalDisclosure"}),{isOpen:o,onOpen:a,onClose:d}=(0,W.q)({id:"renameChannelModalDisclosure"}),{push:c}=(0,ei.useRouter)(),{leaveChannel:u}=(0,U.A)(),h=(0,q.p)(),{onCopy:x}=(0,Y.V)((0,es.j)({id:null==i?void 0:i.id,slug:null==i?void 0:i.slug},!1));return(0,s.jsxs)(X.v,{closeOnSelect:!1,isLazy:!0,children:[(0,s.jsx)(Z.j,{as:Q.h,variant:"ghost",fontWeight:"600",color:"gray.700",icon:(0,s.jsx)(w.G,{icon:k.S6C})}),(0,s.jsxs)(J.q,{zIndex:"popover",children:[(0,s.jsx)($.s,{icon:(0,s.jsx)(w.G,{fixedWidth:!0,icon:k.aJJ}),onClick:a,children:(0,s.jsx)(P.cC,{id:"NZgZhv"})}),(0,s.jsx)(ee.R,{}),(0,s.jsx)($.s,{onClick:()=>{x(),h({title:(0,s.jsx)(P.cC,{id:"h5GS+N"}),status:"success",duration:3e3,position:"top"})},icon:(0,s.jsx)(w.G,{fixedWidth:!0,icon:k.DrL}),children:(0,s.jsx)(P.cC,{id:"alYpud"})}),(0,s.jsx)($.s,{icon:(0,s.jsx)(w.G,{fixedWidth:!0,icon:k.WQc}),onClick:()=>{u({channel:i}).then(()=>{c("/")})},children:(0,s.jsx)(P.cC,{id:"jC8TAY"})}),(0,s.jsx)(ee.R,{}),(0,s.jsx)($.s,{color:"red.500",onClick:l,icon:(0,s.jsx)(w.G,{fixedWidth:!0,icon:k.XAH}),children:(0,s.jsx)(P.cC,{id:"NbFtQm"})})]}),o&&(0,s.jsx)(er,{channel:i,workspaceId:t,onClose:d}),n&&(0,s.jsx)(el,{channel:i,workspaceId:t,onClose:r})]})}},76644:function(e,i,t){"use strict";t.d(i,{Kk:function(){return a},LS:function(){return c},en:function(){return o},j7:function(){return u},pX:function(){return d}});var s=t(52322),n=t(5879),l=t(93202),r=t(64663);let o=[{key:l.IX5.EditedTime,label:(0,s.jsx)(n.cC,{id:"acZeX2"})},{key:l.IX5.CreatedTime,label:(0,s.jsx)(n.cC,{id:"u46WEi"})}],a=[{key:l.IX5.LastViewed,label:(0,s.jsx)(n.cC,{id:"UOgIR2"})},{key:l.IX5.LastEdited,label:(0,s.jsx)(n.cC,{id:"acZeX2"})},{key:l.IX5.Favorited,label:(0,s.jsx)(n.cC,{id:"2TANrw"})}],d=r.oc.ALL,c=l.IX5.EditedTime,u=[l.IX5.LastViewed,l.IX5.LastEdited,l.IX5.Favorited]},77405:function(e,i,t){"use strict";t.d(i,{A:function(){return u}});var s=t(52322),n=t(70065),l=t(5879),r=t(5632),o=t.n(r),a=t(2784),d=t(93202),c=t(78462);let u=()=>{let e=(0,n.p)(),[i]=(0,d.ozD)(),[t]=(0,d.Oau)(),[r,{loading:u,error:h}]=(0,d.dbz)(),x=(0,a.useCallback)(t=>{let{channel:n}=t;return i({variables:{channelId:n.id}}).then(()=>{e({title:(0,s.jsx)(l.cC,{id:"GCUxja",values:{0:null==n?void 0:n.name}}),description:(0,s.jsx)(l.cC,{id:"SQY08b",values:{0:null==n?void 0:n.name}}),status:"success",duration:3e3,isClosable:!0,position:"top"})})},[i,e]),p=(0,a.useCallback)(i=>{let{channel:n,workspaceId:r}=i,{name:o}=n;return t({variables:{channelId:n.id},update:(e,i)=>{let{data:t}=i;(null==t?void 0:t.joinChannel)&&e.writeQuery({query:d.kTw,variables:{workspaceId:r},data:{channels:[t.joinChannel]}})},optimisticResponse:{joinChannel:{...n}}}).then(()=>{e({title:(0,s.jsx)(l.cC,{id:"WpOdvg",values:{name:o}}),description:(0,s.jsx)(l.cC,{id:"/IOSvX",values:{name:o}}),status:"success",duration:3e3,isClosable:!0,position:"top"})}).catch(i=>{e({title:(0,s.jsx)(l.cC,{id:"bLRa0l",values:{name:o}}),description:i.message,status:"error",duration:3e3,isClosable:!0,position:"top"})})},[t,e]),m=(0,a.useCallback)(i=>
1{let{input:t}=i;return r({variables:{input:t},update:(e,i)=>{let{data:s}=i;(null==s?void 0:s.createChannel)&&e.writeQuery({query:d.kTw,variables:{workspaceId:t.workspaceId},data:{channels:[s.createChannel]}})},optimisticResponse:{createChannel:{id:"temp-id",slug:"temp-slug",...t,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString(),__typename:"Channel"}}}).then(i=>{var t;let n=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t.createChannel;(null==n?void 0:n.name)&&e({title:(0,s.jsx)(l.cC,{id:"EbT81q",values:{0:n.name}}),status:"success",duration:3e3,isClosable:!0,position:"top"}),(null==n?void 0:n.id)&&(null==n?void 0:n.slug)?o().push((0,c.j)({id:n.id,slug:n.slug})):console.error('[CreateChannelModal] Error generating channel URL. ID: "'.concat(null==n?void 0:n.id,'". Slug: "').concat(null==n?void 0:n.slug,'"'))}).catch(i=>{e({title:(0,s.jsx)(l.cC,{id:"YeikaQ"}),description:i.message,status:"error",duration:3e3,isClosable:!0,position:"top"})})},[r,e]);return{joinChannel:p,leaveChannel:x,createChannel:m,createChannelLoading:u,createChannelError:h}}},33360:function(e,i,t){"use strict";t.d(i,{w:function(){return tk}});var s=t(52322),n=t(38035),l=t(28165),r=t(60510),o=t(37639),a=t(17190),d=t(97729),c=t.n(d),u=t(2784),h=t(28846),x=t(52797),p=t(16690),m=t(94199),g=t(31341),j=t(92850),C=t(26468),v=t(22226),f=t(54326),b=t(2338),y=t(28535),_=t(29117),S=t(17993),A=t(77533),E=t(74008),I=t(97217),D=t(20437),k=t(50250),w=t(42946),T=t(49929),P=t(5879),O=t(5632),N=t.n(O),L=t(39122),R=t(93202),M=t(49165),F=t(42111),U=t(34881),z=t(11050),B=t(36651),G=t(96933),H=t(90221),K=t(89458),V=t(88640),W=t(30523),q=t(11082),Y=t(43297),X=t(82554),Z=t(39097),Q=t.n(Z);let J=e=>{let{title:i,body:t,accentColor:l,href:r,icon:o,isNew:a,onClick:d}=e;return(0,s.jsx)(Q(),{href:r,passHref:!0,legacyBehavior:!0,children:(0,s.jsx)(W.P,{as:q.r,position:"relative",padding:"6",border:"2px solid",borderColor:"gray.100",borderRadius:"8",cursor:"pointer",boxSizing:"border-box",background:"white",shadow:"sm",transitionProperty:"common",transitionDuration:"normal",_hover:{borderColor:"".concat(l,".400"),boxShadow:"xl",textDecoration:"none"},role:"group",onClick:d,children:(0,s.jsxs)(Y.K,{children:[(0,s.jsx)(n.k,{height:"40",mb:"2",justify:"center",alignItems:"center",borderRadius:"md",top:0,left:0,bottom:0,right:0,background:"".concat(l,".100"),fontSize:"3rem",color:"".concat(l,".300"),transitionProperty:"all",transitionDuration:"normal",_groupHover:{color:"".concat(l,".400"),fontSize:"3.125rem"},children:(0,s.jsx)(y.xu,{children:(0,s.jsx)(T.G,{icon:o,className:"fa-xl"})})}),(0,s.jsxs)(A.x,{mt:2,fontSize:"xl",fontWeight:"bold",lineHeight:"short",children:[i,a&&(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsx)(X.C,{fontSize:"0.75em",colorScheme:"green",children:(0,s.jsx)(P.cC,{id:"YBt9YP"})})]})]}),(0,s.jsx)(A.x,{fontSize:"sm",children:t})]})})})};var $=t(54933);let ee={createFromAI:{title:(0,s.jsx)(P.cC,{id:"ks31i0"}),body:(0,s.jsx)(P.cC,{id:"y3x+dr"}),colorScheme:"pink",icon:$.ddb,action:"createFromAI",isNew:!0},createDeck:{title:(0,s.jsx)(P.cC,{id:"17dkjV"}),body:(0,s.jsx)(P.cC,{id:"EHsEUm"}),colorScheme:"purple",icon:$.RLl,action:"blankDeck",isNew:!1},viewTemplates:{title:(0,s.jsx)(P.cC,{id:"M4C2N9"}),body:(0,s.jsx)(P.cC,{id:"hO9+rY"}),colorScheme:"salmon",icon:$.BDt,action:"templates",isNew:!1},tipsAndTricks:{title:(0,s.jsx)(P.cC,{id:"ZOGX27"}),body:(0,s.jsx)(P.cC,{id:"mgn8Bj"}),colorScheme:"teal",icon:$.s2,action:"welcomeDoc",isNew:!1},inspiration:{title:(0,s.jsx)(P.cC,{id:"IR0bRg"}),body:(0,s.jsx)(P.cC,{id:"QbmT2X"}),colorScheme:"orchid",icon:$.cnt,action:"inspiration",isNew:!1}},ei="getStarted",et=()=>{let{push:e,query:i,pathname:t}=(0,O.useRouter)(),[n]=(0,M.c)(),l=!!i[ei],r=(0,u.useCallback)(i=>{let{searchParams:s}=new URL(window.location.href);s.delete(ei),i?i.startsWith("/#")?N().replace(i):((0,U.lO)({query:Object.fromEntries(s.entries())}),e(i)):N().replace({pathname:t,query:s.toString()},void 0,{shallow:!0})},[t,e]),o=(0,u.useCallback)(()=>{let{searchParams:e}=new URL(window.location.href);e.delete(ei),(0,U.lO)({query:Object.fromEntries(e.entries())}),n({source:"get_started_modal"})},[n]);return l?(0,s.jsx)(el,{onClose:r,onCreateDoc:o}):null},es=e=>{let{isMobile:i,aiWizardEnabled:t,openAiStatus:s}=e,n="DOWN"==s;return i?[...t&&!n?[ee.createFromAI]:[],ee.tipsAndTricks,ee.inspiration]:[...t&&!n?[ee.createFromAI]:[],ee.createDeck,ee.viewTemplates,ee.tipsAndTricks].slice(0,3)},en={createFromAI:"create_from_ai",welcomeDoc:"welcome_doc",templates:"templates",inspiration:"inspiration",blankDeck:"create_doc"},el=e=>{var i,t;let{onClose:n,onCreateDoc:l}=e,r=(0,F.ye)("createGenerateV2"),o=(0,z.z$)(),[a]=(0,K.I)(V.H.welcomeDocId,null),d=(0,F.ye)("aiWizard"),c=(0,F.ye)("openAiStatus"),h=(0,G.i)(["full","full","3xl","4xl"]),{user:x,currentWorkspace:p,setSettings:m}=(0,B.SE)(),g=null==x?void 0:x.id,O=es({isMobile:(0,H.s2)(),aiWizardEnabled:d,openAiStatus:c}),N=r?"/create/generate?ref=dashboard":L.ET;(0,u.useEffect)(()=>{null==m||m({remove:["showGetStarted"]})},[m]);let{data:M,loading:U,called:W}=(0,R.HHH)({variables:{workspaceId:null==p?void 0:p.id,first:1,createdBy:g,sortBy:{field:R.IX5.CreatedTime,direction:R.SrV.Asc}},skip:!!(!g||a)}),q=a||(null==x?void 0:null===(i=x.settings)||void 0===i?void 0:i.welcomeDocId)||(null==M?void 0:null===(t=M.docs.edges[0])||void 0===t?void 0:t.node.id),Y=(0,u.useCallback)(e=>{switch(e){case"welcomeDoc":q?n("/docs/".concat(q)):console.warn("[StartingModal] No welcomeDoc");break;case"templates":n("/#templates");break;case"inspiration":n("/#inspiration");break;case"blankDeck":l();break;case"createFromAI":n(N);break;default:console.warn("[StartingModal] Unknown action",e)}},[N,n,l,q]);return(0,s.jsxs)(j.u_,{isOpen:!0,size:h,trapFocus:!1,onClose:()=>{null==o||o.track(z.AA.GET_STARTED_CLICKED,{target:"dismiss",variation:"new"}),n()},children:[(0,s.jsx)(C.Z,{}),(0,s.jsxs)(v.h,{children:[(0,s.jsx)(f.x,{children:(0,s.jsx)(P.cC,{id:"h0sjMM"})}),(0,s.jsx)(b.o,{}),(0,H.s2)()?(0,s.jsx)(y.xu,{padding:"4",background:"salmon.100",mb:"4",children:(0,s.jsxs)(_.U,{spacing:"5",paddingLeft:"2",children:[(0,s.jsx)(y.xu,{color:"salmon.600",children:(0,s.jsx)(T.G,{icon:w.tc$,className:"fa-xl"})}),(0,s.jsxs)(S.g,{align:"flex-start",spacing:"0",children:[(0,s.jsx)(A.x,{fontWeight:"600",fontSize:"lg",children:(0,s.jsx)(P.cC,{id:"2aP3e7"})}),(0,s.jsx)(A.x,{fontSize:"sm",children:(0,s.jsx)(P.cC,{id:"WsGA8K"})})]})]})}):(0,s.jsx)(E.i,{mb:"4"}),(0,s.jsx)(I.f,{children:(0,s.jsx)(D.M,{columns:[1,1,3],spacing:5,children:O.map((e,i)=>{let{icon:t,colorScheme:n,title:l,body:r,action:d,isNew:c}=e;if("welcomeDoc"===d&&!a&&W&&!U&&!M)return console.error("[GetStartedModalContent] Unexpectedly cant find a welcomeDocId"),null;let u="blankDeck"===d?"/new":"templates"===d?"/#templates":"inspiration"===d?"/#inspiration":"welcomeDoc"===d?"/docs/".concat(q):"createFromAI"===d?N:"/";return(0,s.jsx)(J,{accentColor:n||"trueblue",title:l,body:r,href:u,icon:t,isNew:c,onClick:e=>{null==o||o.track(z.AA.GET_STARTED_CLICKED,{target:en[d],variation:"new"}),e.metaKey||(e.preventDefault(),Y(d))}},i)})})}),(0,s.jsx)(k.m,{})]})]})};var er=t(82642),eo=t(55478),ea=t(32899),ed=t(81540),ec=t(36474),eu=t(87254),eh=t(71113),ex=t(40651),ep=t(17749),em=t(1196),eg=t(44663),ej=t(11881),eC=t(2953),ev=t(62131);let ef=e=>{let{onOpenCallback:i,onCloseCallback:t}=e,n=(0,F.ye)("upsellUXEnabled_Pro"),{openUpsellModal:l}=(0,eC.z)();return n?(0,s.jsx)(ej.f,{bottom:0,bg:"white",borderRadius:"md",boxShadow:"base",border:"1px solid",borderColor:"trueblue.100",p:3,children:(0,s.jsxs)(Y.K,{children:[(0,s.jsxs)(_.U,{children:[(0,s.jsx)(ev.ER,{variant:"solid"}),(0,s.jsx)(A.x,{fontSize:"sm",fontWeight:"600",children:(0,s.jsx)(P.cC,{id:"mpbrVv",values:{GAMMA_PRO_PROPER_NOUN:m.x8}})})]}),(0,s.jsx)(A.x,{fontSize:"xs",color:"gray.600",children:(0,s.jsx)(P.cC,{id:"gGlaFH",values:{GAMMA_PROPER_NOUN:m.N6}})}),(0,s.jsx)(A.x,{fontSize:"sm",fontWeight:"bold",children:(0,s.jsx)(ej.A,{color:"trueblue.600",href:"#",onClick:()=>{l({onOpenCallback:i,onCloseCallback:t,segmentEvent:z.AA.GAMMA_PRO_UPSELL_CALLOUT_SIDEBAR})},children:(0,s.jsx)(A.x,{children:(0,s.jsx)(P.cC,{id:"y7e9aS"})})})})]})}):null};var eb=t(57124),ey=t(91994),e_=t(67109),eS=({size:e="2rem",...i})=>(0,s.jsx)(e_.O,{borderRadius:"full",boxSize:e,...i});eS.displayName="SkeletonCircle";var eA=t(109),eE=t(10625),eI=t(67046),eD=t(62614),ek=t(99058),ew=t(25481),eT=t(27599),eP=t(44035),eO=t(39237),eN=t(94523),eL=t(1842),eR=t.n(eL),eM=t(14274),eF=(0,t(67012).I)({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),eU=t(47443),ez=t(70065),eB=t(82713),eG=t(75768);let eH=()=>
1(0,s.jsxs)(_.U,{px:2,py:2,border:"2px solid var(--chakra-colors-red-500)",borderRadius:"md",children:[(0,s.jsx)(eF,{w:4,h:4,color:"red.500"}),(0,s.jsx)(A.x,{fontSize:"sm",color:"red.500",children:(0,s.jsx)(P.cC,{id:"Ofm9ns"})})]}),eK=e=>{let{user:i,workspace:t,canDeleteAccount:l}=e;return(0,s.jsxs)(eU.b,{status:i||(null==t?void 0:t.memberCount)&&t.memberCount<=1?"error":"warning",display:"flex",flexDirection:"column",alignItems:"normal",mt:2,children:[(0,s.jsxs)(n.k,{pb:3,flexDirection:["column","column","row","row"],align:"flex-start",gap:2,children:[(0,s.jsxs)(n.k,{flex:1,children:[(0,s.jsx)(eA.q,{src:null==i?void 0:i.profileImageUrl,size:"sm",name:(null==i?void 0:i.displayName)||(null==t?void 0:t.name)}),(0,s.jsxs)(Y.K,{spacing:0,ml:2,flex:"1",children:[(0,s.jsx)(A.x,{fontSize:"sm",flex:"1",wordBreak:"break-word",children:(null==i?void 0:i.displayName)||(null==t?void 0:t.name)}),i&&(0,s.jsx)(A.x,{fontSize:"xs",color:"gray.600",flex:"1",wordBreak:"break-word",children:i.email}),t&&(0,s.jsx)(A.x,{fontSize:"xs",color:"gray.600",children:(0,s.jsx)(P.cC,{id:"LaQ44M",values:{0:t.memberCount||0}})})]})]}),(0,s.jsx)(n.k,{flexShrink:1,children:(i||t&&(null==t?void 0:t.memberCount)===1)&&(0,s.jsx)(eH,{})})]}),(0,s.jsx)(E.i,{borderColor:"blackAlpha.200"}),(0,s.jsxs)(A.x,{pt:2,fontSize:"sm",color:i||(null==t?void 0:t.memberCount)&&t.memberCount<=1?"red.500":"yellow.700",children:[l&&i&&(0,s.jsxs)(s.Fragment,{children:["⚠️"," ",(0,s.jsx)(P.cC,{id:"j95nHI",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})]}),l&&(null==t?void 0:t.memberCount)&&(t.memberCount>1?(0,s.jsxs)(s.Fragment,{children:["⚠️ ",(0,s.jsx)(P.cC,{id:"QnF/9z"})]}):(0,s.jsxs)(s.Fragment,{children:["⚠️"," ",(0,s.jsx)(P.cC,{id:"PU+L+E",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})]})),!l&&(0,s.jsxs)(s.Fragment,{children:["⚠️"," ",(0,s.jsx)(P.cC,{id:"eFx5qm"})]})]})]})},eV=e=>{var i,t;let{isOpen:n,onClose:l,user:r}=e,[o,a]=(0,u.useState)(!1),[d,c]=(0,u.useState)(!1),{data:h}=(0,R.NUx)(),x=(0,ez.p)(),[p]=(0,R.I1z)(),g=(null==h?void 0:null===(t=h.user)||void 0===t?void 0:null===(i=t.workspaceMemberships)||void 0===i?void 0:i.filter(e=>!1===e.disabled))||[],S=g.filter(e=>{var i,t;return"admin"===e.role&&(null===(i=e.workspace)||void 0===i?void 0:i.adminCount)===1&&(null===(t=e.workspace)||void 0===t?void 0:t.memberCount)&&e.workspace.memberCount>1}),E=g.map(e=>e.workspace),D=0===S.length,w=(0,u.useCallback)(()=>{c(!0),p().then(e=>{let{data:i}=e;i&&(window.location.href="".concat(eM.v.API_HOST,"/logout?redirectTo=/user-deleted"))}).catch(()=>{c(!1),x({title:"Delete account failed. Try again or reach out to Gamma support.",status:"error",duration:3e3,position:"top",isClosable:!0})})},[x,p]);return(0,s.jsxs)(j.u_,{isOpen:n,onClose:l,size:"lg",closeOnOverlayClick:!1,children:[(0,s.jsx)(C.Z,{}),(0,s.jsxs)(v.h,{p:2,children:[(0,s.jsx)(f.x,{children:(0,s.jsx)(P.cC,{id:"pj33Dr",values:{GAMMA_PROPER_NOUN:m.N6}})}),(0,s.jsx)(b.o,{}),(0,s.jsxs)(I.f,{children:[D&&(0,s.jsxs)(Y.K,{spacing:3,children:[(0,s.jsx)(A.x,{children:(0,s.jsx)(P.cC,{id:"gICMDu"})}),(0,s.jsxs)(y.xu,{children:[(0,s.jsx)(A.x,{colorScheme:"gray",fontSize:"sm",children:(0,s.jsx)(P.cC,{id:"sG4820"})}),(0,s.jsx)(eK,{user:r,canDeleteAccount:D})]}),E&&E.length>0&&(0,s.jsxs)(y.xu,{children:[(0,s.jsx)(A.x,{colorScheme:"gray",fontSize:"sm",children:(0,s.jsx)(P.cC,{id:"dFEw4P"})}),null==E?void 0:E.map(e=>(0,s.jsx)(eK,{workspace:e,canDeleteAccount:D},null==e?void 0:e.id))]}),(0,s.jsxs)(y.xu,{children:[(0,s.jsx)(A.x,{colorScheme:"gray",fontSize:"sm",children:(0,s.jsx)(P.cC,{id:"R3XcoA"})}),(0,s.jsxs)(_.U,{bg:"gray.100",mt:2,p:3,pl:2,spacing:2,borderRadius:"sm",children:[(0,s.jsx)(eB.X,{size:"lg",spacing:"1rem",p:3,defaultChecked:o,onChange:e=>a(e.target.checked)}),(0,s.jsx)(A.x,{fontSize:"sm",children:(0,s.jsx)(P.cC,{id:"4YT8Pd"})})]})]})]}),!D&&(0,s.jsx)(Y.K,{children:(0,s.jsxs)(y.xu,{children:[(0,s.jsx)(A.x,{colorScheme:"gray",fontSize:"sm",children:(0,s.jsx)(P.cC,{id:"nhUDfL"})}),null==E?void 0:E.map(e=>(0,s.jsx)(eK,{workspace:e,canDeleteAccount:D},null==e?void 0:e.id))]})})]}),D&&(0,s.jsx)(k.m,{children:(0,s.jsxs)(eG.h,{children:[(0,s.jsx)(eD.z,{variant:"ghost",colorScheme:"gray",onClick:l,children:(0,s.jsx)(P.cC,{id:"dEgA5A"})}),(0,s.jsx)(eD.z,{isDisabled:!o,variant:"ghost",colorScheme:"red",onClick:w,isLoading:d,loadingText:eu.ag._({i
1d:"O71YIC"}),children:(0,s.jsx)(P.cC,{id:"dfBVKc"})})]})})]})]})};var eW=t(75009),eq=t(87651),eY=t(99793),eX=t(35183),eZ=t(97166),eQ=t(85573),eJ=t(89606),e$=t(10649),e0=t(49152),e1=t(43102),e2=t(99787);let e5={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},e3=e=>{let{uppy:i,multiple:t=!1,accept:n=e2.pK.join(",")}=e,l=(0,u.useRef)(null),r=(0,u.useMemo)(()=>(0,s.jsx)("input",{ref:l,className:"gamma-uppy-FileInput-input",style:e5,type:"file",name:"gamma-file-input",multiple:t,accept:n,onChange:e=>{let t=e.target;if(!t||!t.files)return;let s=Array.from(t.files);s.forEach(e=>{try{i.addFile({source:"file input",name:e.name,type:e.type,data:e})}catch(e){e.isRestriction?console.warn("[useFileInput] Restriction error:",e):console.error(e)}}),t.value=null}}),[]),o=(0,u.useCallback)(()=>{var e;null===(e=l.current)||void 0===e||e.click()},[]);return(0,u.useEffect)(()=>{let e=l.current;e&&(i.on("file-removed",()=>{e.value=null}),i.on("complete",()=>{e.value=null}),i.on("transloadit:complete",()=>{e.value=null}))},[]),{inputElement:r,onClick:o}};var e4=t(87205);let e6={cropped:"",original:""},e9=e=>{let{isOpen:i,onClose:t,onAccountDeleteModalOpen:l,user:r,orgId:o,refetchUser:a}=e,d=(0,ez.p)(),[c,{loading:h,error:x}]=(0,R.kDo)(),{setSettings:p}=(0,B.SE)(),m=(0,e0.l)(),g=(0,u.useMemo)(()=>m,[]),[S,D]=(0,u.useState)(g);(0,e1.m)(S);let[O,N]=(0,u.useState)(r.firstName||""),[L,M]=(0,u.useState)(r.lastName||""),[F,U]=(0,u.useState)(r.profileImageUrl||""),[z,G]=(0,u.useState)(e6),[H,K]=(0,u.useState)("original"),V=z.cropped&&"cropped"===H?z.cropped:z.original&&"original"===H?z.original:F,[W,q]=(0,u.useState)("idle"),X=(0,u.useMemo)(()=>e2.ND.createUppyInstance(o,{onUploadStart:e=>{G(e6),q("uploading"),K("original"),(0,e4.Ns)(e.file.type||"")||U(e.tempUrl)},onOriginalFileUpload:e=>{console.debug("[AccountSettingsModal] onOriginalFileUpload",e),U(e.src),G(i=>({...i,original:e.src}))},onUploadComplete:e=>{console.debug("[AccountSettingsModal] onUploadComplete",e),U(i=>i||e.src),G(()=>({original:e.src,cropped:e.croppedFace||""})),q("idle"),X.cancelAll()},onUploadFailed:()=>{q("error"),X.cancelAll()}},"profile"),[]),{onClick:Z,inputElement:Q}=e3({uppy:X}),J=(0,u.useCallback)(()=>{l&&(l(),t())},[l,t]),ee=(0,u.useCallback)(()=>{X.cancelAll(),q("idle"),N(r.firstName||""),M(r.lastName||""),U(r.profileImageUrl||""),K("original"),G(e6),D(g)},[r,g,X]),ei=S!==g,et=O!==r.firstName||L!==r.lastName||F!==r.profileImageUrl,es=(0,u.useMemo)(()=>et||ei,[ei,et]),en=(0,u.useCallback)(()=>{if(!es){t();return}let e=[];ei&&p&&e$.p_.includes(S)&&e.push(p({set:{locale:S}})),et&&e.push(c({variables:{input:{id:r.id,firstName:O,lastName:L,profileImageUrl:F}}})),Promise.all(e).then(()=>{null==a||a(),t(),d({title:(0,s.jsx)(P.cC,{id:"wAvGr+"}),position:"top",status:"success",isClosable:!0,duration:3e3})}).catch(e=>{console.error('[AccountSettingsModal.onSaveClick] Error updating user info "'.concat(null==r?void 0:r.id,'"'),e.message)})},[O,es,ei,et,L,S,t,F,a,p,d,c,null==r?void 0:r.id]),el=O.length<1&&L.length<1||!!(null==x?void 0:x.message)||"error"===W;return(0,s.jsxs)(j.u_,{isOpen:i,onClose:t,size:"lg",closeOnOverlayClick:!1,children:[Q,(0,s.jsxs)(y.xu,{w:0,h:0,children:[(0,s.jsx)(eW.E,{src:z.original}),(0,s.jsx)(eW.E,{src:z.cropped})]}),(0,s.jsx)(C.Z,{}),(0,s.jsxs)(v.h,{children:[(0,s.jsx)(f.x,{children:(0,s.jsx)(P.cC,{id:"T3FM0r"})}),(0,s.jsx)(b.o,{}),(0,s.jsx)(E.i,{mb:4}),(0,s.jsxs)(I.f,{display:"flex",flexDirection:"column",alignItems:"center",children:[(0,s.jsxs)(Y.K,{direction:"column",alignItems:"center",children:[(0,s.jsxs)(eE.v,{placement:"bottom-start",offset:[100,0],children:[(0,s.jsx)(eN.kH,{label:(0,s.jsx)(P.cC,{id:"etzA4s"}),openDelay:750,placement:"top",children:(0,s.jsx)(eI.j,{position:"relative",disabled:"uploading"===W,userSelect:"none",cursor:"pointer",role:"group",_hover:{opacity:.9},children:(0,s.jsxs)(eA.q,{src:V,name:"".concat(O," ").concat(L).trim(),size:"2xl",_groupHover:{shadow:"lg"},ignoreFallback:!0,children:["uploading"===W&&(0,s.jsx)(y.Cd,{position:"absolute",size:"full",justifyContent:"center",alignItems:"center",bg:"gray.300",opacity:.5,children:(0,s.jsx)(ed.$,{size:"xl",thickness:"2px"})}),(0,s.jsx)(y.Cd,{position:"absolute",bottom:0,right:0,borderRadius:"full",color:"gray.800",textAlign:"center",bg:"gray.200",size:9,_groupHover:{shadow:"lg",transform:"scale(1.02)"},children:(0,s.jsx)(T.G,{icon:F?w._jT:w.TzT,width:16,height:16,size:"xs"})})]})})}),(0,s.jsxs)(ek.q,{fontSize:"sm",children:[(0,s.jsx)(ew.s,{onClick:()=>{"uploading"!==W&&Z()},children:(0,s.jsxs)(_.U,{children:[(0,s.jsx)(T.G,{icon:$.A$k}),(0,s.jsx)(A.x,{children:(0,s.jsx)(P.cC,{id:"wPTug2"})})]})}),F&&(0,s.jsx)(eT.R,{}),F&&(0,s.jsx)(ew.s,{onClick:()=>{U(""),G(e6)},children:(0,s.jsxs)(_.U,{color:"var(--chakra-colors-red-500)",children:[(0,s.jsx)(T.G,{icon:w.Vui,color:"var(--chakra-colors-red-500)"}),(0,s.jsx)(A.x,{children:(0,s.jsx)(P.cC,{id:"k8od7T"})})]})})]})]}),(0,s.jsx)(eq.U,{in:!!F&&!!z.cropped&&F!==r.profileImageUrl&&"idle"===W,animateOpacity:!0,children:(0,s.jsx)(eB.X,{size:"sm",fontSize:"12px",color:"gray.500",isChecked:"cropped"===H,onChange:e=>{K(e.target.checked?"cropped":"original"),U(e.target.checked?z.cropped:z.original)},mb:3,children:(0,s.jsx)(P.cC,{id:"+J8/VC"})})}),(0,s.jsx)(eY.J1,{children:"error"===W&&"Error uploading profile image."}),(0,s.jsxs)(Y.K,{spacing:0,alignItems:"center",children:[(0,s.jsx)(A.x,{fontSize:"xl",fontWeight:"bold",children:r.displayName}),(0,s.jsx)(A.x,{color:"gray.500",children:r.email})]})]}),(0,s.jsxs)(Y.K,{direction:"column",width:"100%",my:6,px:4,spacing:6,children:[(0,s.jsxs)(eX.NI,{isInvalid:el,children:[(0,s.jsx)(eZ.l,{children:(0,s.jsx)(P.cC,{id:"V1EGGU"})}),(0,s.jsx)(eQ.I,{w:"100%",value:O,onChange:e=>N(e.target.value.slice(0,60))})]}),(0,s.jsxs)(eX.NI,{isInvalid:el,children:[(0,s.jsx)(eZ.l,{children:(0,s.jsx)(P.cC,{id:"1ZaQUH"})}),(0,s.jsx)(eQ.I,{w:"100%",value:L,onChange:e=>M(e.target.value.slice(0,60))}),(0,s.jsx)(eY.J1,{children:(null==x?void 0:x.message)?null==x?void 0:x.message:(0,s.jsx)(P.cC,{id:"yQeiGC"})})]}),(0,s.jsxs)(eX.NI,{children:[(0,s.jsx)(eZ.l,{children:(0,s.jsx)(P.cC,{id:"vXIe7J"})}),(0,s.jsx)(eJ.p,{selectedLocale:e$.w$[S],onLocaleSelect:D})]})]})]}),(0,s.jsx)(k.m,{children:(0,s.jsxs)(n.k,{justifyContent:"space-between",flex:1,alignItems:"flex-end",children:[(0,s.jsx)(n.k,{
1children:(0,s.jsx)(eD.z,{variant:"ghost",color:"gray.400",colorScheme:"gray",size:"sm",onClick:J,children:(0,s.jsx)(P.cC,{id:"ktknoE"})})}),(0,s.jsxs)(n.k,{flexWrap:"wrap",justifyContent:"flex-end",gap:2,children:[es&&(0,s.jsx)(eD.z,{variant:"ghost",colorScheme:"gray",onClick:ee,children:(0,s.jsx)(P.cC,{id:"dEgA5A"})}),(0,s.jsx)(eD.z,{variant:es?"solid":"plain",onClick:en,isDisabled:el||"uploading"===W,isLoading:h,children:es?(0,s.jsx)(P.cC,{id:"y3aU20"}):(0,s.jsx)(P.cC,{id:"DPfwMq"})})]})]})})]})]})},e7=()=>(0,s.jsxs)(_.U,{w:"100%",px:2,pb:1,children:[(0,s.jsx)(eS,{size:"32px"}),(0,s.jsx)(e_.O,{width:"60%",height:"20px"})]}),e8=e=>{var i;let{workspace:t,memberCount:n,isMultiline:l=!0}=e;return(0,s.jsxs)(_.U,{mr:4,children:[(0,s.jsx)(eA.q,{name:null===(i=t.name)||void 0===i?void 0:i.replace(/\s/g,""),size:"sm",bgColor:"orchid.300",color:"white"}),(0,s.jsxs)(Y.K,{textAlign:"left",align:"flex-start",justify:"flex-start",spacing:0,...l?{}:{noOfLines:1},children:[(0,s.jsx)(A.x,{fontSize:"sm",fontWeight:"600",wordBreak:"break-word",m:0,p:0,...l?{}:{overflow:"hidden",textOverflow:"ellipsis"},minWidth:"0px",children:t.name}),(0,s.jsx)(ev.Y7,{workspace:t}),!eR()(n)&&(0,s.jsx)(A.x,{fontSize:"xs",color:"gray.500",textAlign:"left",children:(0,s.jsx)(P.cC,{id:"F6GBat",values:{memberCount:n}})})]})]})},ie=e=>{let{onOpen:i}=e,{user:t,currentWorkspace:l,refetch:r,setCurrentWorkspaceId:o}=(0,B.SE)(),{isConnected:a}=(0,R.$gs)(),{isOpen:d,onOpen:c,onClose:u}=(0,eo.q)({id:"user-settings-modal"}),{isOpen:h,onOpen:x,onClose:p}=(0,eo.q)({id:"account-delete-modal"}),m=(0,G.i)({md:"400px"});if(!t)return(0,s.jsx)(s.Fragment,{});let g=null==t?void 0:t.organizations;return g&&l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eE.v,{autoSelect:!1,children:[(0,s.jsx)(eN.kH,{label:a?"":"You're offline","aria-label":a?"Workspace options":"You're offline",children:(0,s.jsx)(y.xu,{children:(0,s.jsx)(eI.j,{as:eD.z,isDisabled:!a,variant:"ghost",rightIcon:a?(0,s.jsx)(T.G,{icon:w.gc2,"aria-label":"Caret icon"}):(0,s.jsx)(T.G,{icon:w.bKP}),w:"100%",colorScheme:"blackAlpha",color:"gray.800",cursor:"pointer",_hover:{color:"trueblue.600"},p:2,pr:4,children:(0,s.jsx)(y.xu,{width:"100%",children:l&&(0,s.jsx)(e8,{workspace:l,memberCount:null,isMultiline:!1})})})})}),(0,s.jsxs)(ek.q,{minW:m,zIndex:"overlay",shadow:"lg",maxW:"min(500px, 100vw)",children:[(0,s.jsxs)(ew.s,{px:2,cursor:"pointer",onClick:c,children:[(0,s.jsx)(eA.q,{src:t.profileImageUrl,size:"sm",name:t.displayName}),(0,s.jsxs)(Y.K,{spacing:0,ml:2,children:[(0,s.jsx)(A.x,{fontSize:"sm",children:t.displayName}),(0,s.jsx)(A.x,{fontSize:"xs",color:"gray.500",children:t.email})]}),(0,s.jsx)(ec.L,{}),(0,s.jsx)(T.G,{size:"sm",icon:$.gr5,color:"var(--chakra-colors-gray-500)"})]}),(0,s.jsx)(eT.R,{}),g&&g.length>0&&(0,s.jsx)(eP._,{title:eu.ag._({id:"pmt7u4"}),type:"radio",defaultValue:null==l?void 0:l.id,onChange:e=>{o(e)},children:g.filter(e=>!eR()(e)&&!eR()(e.id)&&!eR()(e.name)).map(e=>(0,s.jsx)(eO.i,{value:e.id,icon:1===g.length?null:void 0,isFocusable:1!==g.length,children:(0,s.jsxs)(_.U,{children:[(0,s.jsx)(n.k,{flex:1,w:"100%",children:(0,s.jsx)(e8,{workspace:e,memberCount:null,isMultiline:!0})}),e.id===(null==l?void 0:l.id)&&(0,s.jsx)(n.k,{children:(0,s.jsx)(eD.z,{size:"sm",variant:"outline",onClick:i,children:(0,s.jsx)(P.cC,{id:"0dbeO4"})})})]})},e.id))}),(0,s.jsx)(eT.R,{}),(0,s.jsx)(ew.s,{color:"red.500",icon:(0,s.jsx)(T.G,{icon:w.jLD,fixedWidth:!0}),onClick:()=>{window.location.href="".concat(eM.v.API_HOST,"/logout")},children:(0,s.jsx)(P.cC,{id:"fcWrnU"})})]})]}),d&&(0,s.jsx)(e9,{orgId:l.id,user:t,refetchUser:r,isOpen:d,onClose:u,onAccountDeleteModalOpen:x}),h&&(0,s.jsx)(eV,{user:t,isOpen:h,onClose:p})]}):(0,s.jsx)(s.Fragment,{})};var ii=t(74409),it=t(36371),is=t(73582),il=t(2969),ir=t(3181),io=t(13272),ia=t(87342),id=t(29705),ic=t(82282),iu=t(31807),ih=t(6912),ix=t(11942),ip=t(81640),im=t(42005),ig=t(25566);let ij=e=>{var i,t,n,l;let{memberCount:r}=e,{user:o,currentWorkspace:a}=(0,B.SE)(),{subscription:d,product:c,refetchSubscription:h}=(0,ip.z)(),{launchCancelFlow:x,cancelFlowEnabled:p}=(0,ih.B_)(d,a),[m,g]=(0,u.useState)(!1),j=(0,u.useCallback)(async()=>
1{if(x){im.c.track(ig.AA.CANCEL_SUBSCRIPTION_CLICK,{source:"cancel-flow"}),g(!0);try{var e;let i=await x();(null==i?void 0:null===(e=i.sessionResults)||void 0===e?void 0:e.canceled)===!0&&await (null==h?void 0:h())}catch(e){console.warn("Failed to cancel subscription",e)}g(!1)}},[x,h]),C=null==d?void 0:null===(i=d.products)||void 0===i?void 0:i[0];if(!C||!c)return null;let v=!!(null==d?void 0:d.cancellationRequestedTime),f=!!(null==d?void 0:d.expirationTime)&&new Date>new Date(d.expirationTime),b=(null==d?void 0:null===(t=d.createdByUser)||void 0===t?void 0:t.id)===(null==o?void 0:o.id),_=b?(0,ix._8)():null,S=(null==C?void 0:C.units)&&r?r-C.units:void 0,A="".concat(null==d?void 0:null===(n=d.createdByUser)||void 0===n?void 0:n.displayName," (").concat(null==d?void 0:null===(l=d.createdByUser)||void 0===l?void 0:l.email,")");return(0,s.jsxs)(Y.K,{direction:"row",spacing:2,alignItems:"baseline",children:[(0,s.jsx)(ev.Y7,{workspace:a}),S&&S>0&&b&&(0,s.jsx)(eN.kH,{label:(0,s.jsx)(P.cC,{id:"J8+D9M",values:{addedSeats:S}}),placement:"top",children:(0,s.jsx)(y.xu,{color:"yellow.500",children:(0,s.jsx)(T.G,{icon:w.Vm4})})}),(0,s.jsxs)(eG.h,{px:2,spacing:4,children:[(0,s.jsx)(eN.kH,{placement:"top",shouldWrapChildren:!0,label:b?f?(0,s.jsx)(P.cC,{id:"uxwzHm",values:{0:(0,ic.Z)((0,iu.Z)(d.expirationTime),"PPP")}}):v?(0,s.jsx)(P.cC,{id:"SoEbnk",values:{0:(0,ic.Z)((0,iu.Z)(d.expirationTime),"PPP")}}):(0,s.jsx)(P.cC,{id:"HrQ7yf"}):(0,s.jsx)(P.cC,{id:"H49TQ5",values:{creatorNameAndEmail:A}}),children:(0,s.jsx)(eD.z,{target:"_blank",href:b&&_?_:void 0,as:q.r,colorScheme:b?"trueblue":"gray",variant:"link",size:"sm",rightIcon:(0,s.jsx)(id.h,{ml:-1}),isDisabled:!b,children:(0,s.jsx)(P.cC,{id:"J/hVSQ",values:{0:v||f?"Re-activate subscription":"Manage subscription"}})})}),p&&!v&&b&&(0,s.jsx)(eN.kH,{placement:"top",shouldWrapChildren:!0,label:(0,s.jsx)(P.cC,{id:"o/WrRZ"}),children:(0,s.jsx)(eD.z,{colorScheme:"gray",color:"gray.600",variant:"link",size:"sm",onClick:j,isLoading:m,isDisabled:m,children:(0,s.jsx)(P.cC,{id:"fHXMPy"})})})]}),f?(0,s.jsx)(y.xu,{fontSize:"sm",color:"gray.400",children:(0,s.jsx)(P.cC,{id:"mrIVJ+",values:{0:(0,ic.Z)((0,iu.Z)(d.expirationTime),"PPP")}})}):v?(0,s.jsx)(y.xu,{fontSize:"sm",color:"gray.400",children:(0,s.jsx)(P.cC,{id:"uBqaX6",values:{0:(0,ic.Z)((0,iu.Z)(d.expirationTime),"PPP")}})}):(0,s.jsx)(y.xu,{fontSize:"sm",color:"gray.400",children:(0,s.jsx)(P.cC,{id:"TwZCUl",values:{0:(0,ic.Z)((0,iu.Z)(d.nextBillingTime),"PPP")}})})]})};var iC=t(46640),iv=t(37733),ib=t(52610);let iy=e=>{let{workspace:i,canManageWorkspace:t}=e,n=(0,ez.p)(),{refetch:l}=(0,B.SE)(),[r,o]=(0,u.useState)((null==i?void 0:i.name)||""),[a,d]=(0,u.useState)(!1),[c,{loading:h,called:x,error:p,reset:m}]=(0,R.Mqp)(),g=(0,u.useCallback)(()=>{d(!1),o((null==i?void 0:i.name)||"")},[null==i?void 0:i.name]),j=(0,u.useCallback)(()=>{c({variables:{input:{name:r,id:null==i?void 0:i.id}},fetchPolicy:"no-cache"}).then(()=>{null==l||l(),n({status:"success",title:"Success!",description:"Workspace updated successfully.",position:"top",duration:5e3}),setTimeout(()=>{d(!1),m()},1e3)}).catch(e=>{console.error('[WorkspaceSettingsModal] Error updating workspace "'.concat(null==i?void 0:i.id,'"'),e.message)})},[r,null==i?void 0:i.id,l,m,n,c]),C=""===r||r.length<ib.My||r.length>50||!!(null==p?void 0:p.message);(0,u.useEffect)(()=>{r!==i.name&&d(!0)},[r,i.name]);let v=(0,ib.up)();return i?(0,s.jsx)(y.xu,{children:(0,s.jsxs)(eX.NI,{isInvalid:C,children:[(0,s.jsx)(eZ.l,{children:(0,s.jsx)(P.cC,{id:"CozWO1"})}),(0,s.jsxs)(Y.K,{w:"100%",direction:["column","row"],children:[(0,s.jsx)(eN.kH,{placement:"top-start",label:(0,s.jsx)(P.cC,{id:"M1LZmX",values:{WORKSPACE_ADMIN_DISPLAY_NAME_PLURAL:v}}),isDisabled:t,children:(0,s.jsx)(y.xu,{flex:1,children:(0,s.jsx)(eQ.I,{w:["100%","50%"],placeholder:eu.ag._({id:"CozWO1"}),value:r,disabled:!t,onChange:e=>o(e.target.value.slice(0,50))})})}),(0,s.jsx)(iv.R,{in:a,unmountOnExit:!0,children:(0,s.jsx)(y.xu,{children:(0,s.jsxs)(eG.h,{w:"100%",children:[(0,s.jsx)(eD.z,{variant:"solid",isLoading:h,isDisabled:C||x,onClick:j,children:(0,s.jsx)(P.cC,{id:"EkH9pt"})}),(0,s.jsx)(eD.z,{onClick:g,children:(0,s.jsx)(P.cC,{id:"dEgA5A"})})]})})})]}),(0,s.jsx)(eX.Q6,{children:(0,s.jsx)(P.cC,{id:"ODB/Vo"})}),(0,s.jsx)(eY.J1,{children:(null==p?void 0:p.message)?null==p?void 0:p.message:(0,s.jsx)(P.cC,{id:"soNtuq",values:{WORKSPACE_NAME_MIN_LENGTH:ib.My}})})]})}):null};var i_=t(46949),iS=t(74105),iA=t(20816),iE=t(46028),iI=t(7985),iD=t(38045),ik=t(84636),iw=t.n(ik),iT=t(23312),iP=t(4758),iO=t(80498),iN=t(16893),iL=t(1163);let iR=()=>{let[e,i]=(0,u.useState)(!1),{product:t}=(0,ip.z)(),s=!!t,[n,l]=(0,u.useState)(new iO.B),{isOpen:r,onOpen:o,onClose:a}
1=(0,eo.q)({id:"confirm-add-paid-user"}),d=(0,u.useCallback)(()=>i(e=>!e),[]),c=(0,u.useCallback)(()=>{n.reject(),i(!1),a()},[a,n]),h=(0,u.useCallback)(()=>{n.resolve(!0),i(!1),a()},[a,n]),x=(0,u.useCallback)(()=>{if(!s)return Promise.resolve();let e=new iO.B;return l(e),o(),e.promise},[s,o]);return{isConfirmAddPaidMemberModalOpen:r,isConfirmAddPaidMemberModalChecked:e,onConfirmAddPaidMemberClose:c,onConfirmAddPaidMemberClick:h,showConfirmPaidUserModal:x,onConfirmAddPaidMemberClickCheckbox:d}},iM=e=>{let{isOpen:i,newMemberCount:t,isChecked:l,onClose:r,onConfirmClick:o,onCancelClick:a,onCheckboxConfirm:d}=e,{subscription:c}=(0,ip.z)(),h=(0,u.useCallback)(()=>(0,iL.$F)(c,t),[c,t]),{totalPrice:x,productPrice:p}=(0,iN.A)(h,[t,c]);if(!i||!c)return null;let m=(null==p?void 0:p.frequencyUnit)===R.C_B.Month?(0,s.jsx)(P.cC,{id:"JKIwMd",values:{newMemberCount:t,totalPrice:x},components:{0:(0,s.jsx)("strong",{}),1:(0,s.jsx)("strong",{})}}):(0,s.jsx)(P.cC,{id:"Pltlc3",values:{newMemberCount:t,totalPrice:x},components:{0:(0,s.jsx)("strong",{}),1:(0,s.jsx)("strong",{})}});return(0,s.jsxs)(j.u_,{isOpen:i,onClose:r,trapFocus:!1,size:"xl",children:[(0,s.jsx)(C.Z,{}),(0,s.jsxs)(v.h,{children:[(0,s.jsx)(f.x,{children:(0,s.jsx)(P.cC,{id:"B9zUUN",values:{newMemberCount:t}})}),(0,s.jsx)(b.o,{}),(0,s.jsx)(I.f,{children:(0,s.jsxs)(Y.K,{spacing:4,children:[(0,s.jsx)(A.x,{as:"span",children:(0,s.jsx)(P.cC,{id:"c6yFkJ"})}),(0,s.jsxs)(n.k,{gap:3,alignItems:"start",children:[(0,s.jsx)(eB.X,{mt:1,isChecked:l,onChange:d}),(0,s.jsx)(A.x,{children:m})]}),(0,s.jsx)(y.xu,{fontSize:"sm",bgColor:"gray.200",p:4,borderRadius:"md",children:(0,s.jsx)(A.x,{children:(0,s.jsx)(P.cC,{id:"mjZQpA"})})})]})}),(0,s.jsx)(k.m,{children:(0,s.jsxs)(eG.h,{children:[(0,s.jsx)(eD.z,{variant:"ghost",colorScheme:"gray",onClick:a,children:(0,s.jsx)(P.cC,{id:"dEgA5A"})}),(0,s.jsx)(eD.z,{variant:"solid",onClick:o,isDisabled:!l,children:(0,s.jsx)(P.cC,{id:"WMsmjg",values:{newMemberCount:t}})})]})})]})]})},iF=(0,iD.E)(y.xu),iU=e=>{let{workspace:i,canManageWorkspace:t,setDoneFn:l}=e,r=(0,ez.p)(),o=(0,u.useRef)(),a=(0,u.useRef)(null),[d,c]=(0,u.useState)([]),[h,x]=(0,u.useState)(new iO.B),[p,m]=(0,u.useState)(""),[g,{loading:j}]=(0,R.f4M)(),{isOpen:C,onOpen:v,onClose:f}=(0,eo.q)({id:"confirm-unsent-invitations"}),{isConfirmAddPaidMemberModalOpen:b,isConfirmAddPaidMemberModalChecked:_,onConfirmAddPaidMemberClick:S,onConfirmAddPaidMemberClose:E,showConfirmPaidUserModal:I,onConfirmAddPaidMemberClickCheckbox:D}=iR(),k=(0,u.useMemo)(()=>d.concat({email:p.trim()}).filter(e=>!("email"in e)||(0,iI.G)(e.email||"")),[p,d]),w=!!(p.length||d.length),T=!!k.length;(0,u.useEffect)(()=>
1{l(()=>()=>(T?v():h.resolve(),h.promise))},[T,h,v,l]);let O=j||!t,N=(0,u.useCallback)(async()=>{if(0!==k.length)return g({variables:{workspaceId:i.id,invitees:k},refetchQueries:["GetWorkspace"]}).then(()=>{let e=(0,s.jsx)(P.cC,{id:"Ka86rB",values:{0:k.length}});r({title:e,description:(0,s.jsx)(A.x,{children:k.map(e=>(0,s.jsx)(A.x,{children:e.email},e.email))}),status:"success",position:"top",isClosable:!0,duration:9e3})})},[k,g,i.id,r]),L=(0,u.useCallback)(async()=>I().then(N).then(()=>{var e;c([]),m(""),null===(e=o.current)||void 0===e||e.resetItems(!0),h.resolve(),x(new iO.B)}).catch(e=>{console.warn(e)}),[I,N,h]),M=(0,u.useCallback)(e=>{c(i=>i.filter(i=>i.email!==e))},[]),F=(0,u.useCallback)(e=>{c(i=>iw()([...i,...e],"email"))},[]),U=(0,ib.up)(),z=(0,ib.r_)();return(0,s.jsxs)(y.xu,{my:4,mb:6,children:[(0,s.jsx)(A.x,{mb:2,fontSize:"sm",color:"gray.500",children:(0,s.jsx)(P.cC,{id:"/Yxzaj"})}),(0,s.jsxs)(n.k,{direction:"row",w:"100%",alignItems:"flex-start",children:[(0,s.jsx)(iS.B,{w:"100%",justifyContent:"center",flex:1,children:(0,s.jsxs)(iE.Qc,{ref:o,values:d,maxSelections:100,maxSuggestions:20,creatable:!0,multiple:!0,freeSolo:!0,suggestWhenEmpty:!1,openOnFocus:!0,filter:(e,i)=>!d.find(e=>e.email===i),onSelectOption:e=>{let{item:i}=e;F([{email:i.value}]),m("")},onTagRemoved:e=>{c(i=>[...i].filter(i=>i.email!==e))},children:[(0,s.jsxs)(iA.Z,{pointerEvents:"none",color:"gray.300",h:"100%",flexDirection:"column",children:[(0,s.jsx)(n.k,{flex:1}),(0,s.jsx)(n.k,{h:10,py:4,alignItems:"center",children:(0,s.jsx)(i_.W,{w:10})})]}),(0,s.jsx)(eN.kH,{placement:"top-start",label:(0,s.jsx)(P.cC,{id:"8LvjQl",values:{WORKSPACE_ADMIN_DISPLAY_NAME_PLURAL:U,WORKSPACE_ADMIN_DISPLAY_NAME:z}}),isDisabled:t,children:(0,s.jsx)(y.xu,{children:(0,s.jsx)(iE.Vp,{ref:a,"data-testid":"autocomplete-collaborators-input",cursor:O?"not-allowed":void 0,disabled:O,w:"100%",pl:5,wrapStyles:{px:2},fontSize:"md",placeholder:eu.ag._({id:"+1O5zr"}),transition:"width 1s ease-in-out",value:p,onKeyDown:e=>{let{key:i}=e;if("Enter"===i&&0===p.length){e.preventDefault();return}if("Backspace"===i&&0===p.length&&d.length>0){let e=d.slice(-1).pop();if(e){var t;null===(t=o.current)||void 0===t||t.removeItem(e.email)}}},onPaste:e=>{e.preventDefault(),e.stopPropagation();let i=e.clipboardData.getData("Text"),t=i.trim().split(/[,|;\s]+/);F([...t.map(e=>({email:e}))]),m("")},onChange:e=>{let{target:i}=e,{value:t}=i;m(t)},children:d.map((e,i)=>(0,s.jsx)(iP.L,{idx:i,selectedCollaborator:e,handleRemoveClick:()=>{M(e.email)}},e.email))})})})]})}),(0,s.jsx)(iF,{overflowX:"hidden",transition:"slow",animate:{maxWidth:w?"240px":"0px"},children:(0,s.jsx)(y.xu,{ml:2,children:(0,s.jsx)(eD.z,{variant:"solid",onClick:L,isDisabled:!T,isLoading:!1,"data-testid":"add-selected-items",children:(0,s.jsx)(P.cC,{id:"MFKlMB"})})})})]}),(0,s.jsx)(iT.C,{invitationCount:k.length,isOpen:C,onClose:()=>{f(),h.reject(),x(new iO.B)},onDiscardClick:()=>{f(),h.resolve(),x(new iO.B)},onSendInvitationsClick:()=>{f(),L()}}),(0,s.jsx)(iM,{isOpen:b,newMemberCount:k.length,isChecked:_,onConfirmClick:S,onClose:E,onCancelClick:E,onCheckboxConfirm:D})]})};var iz=t(52929),iB=t(21979);let iG=()=>{let{subscription:e}=(0,ip.z)(),i=(0,iL.OJ)(e),t=null==i?void 0:i.frequencyUnit;return(0,s.jsxs)(A.x,{children:[(0,s.jsx)(A.x,{as:"span",fontWeight:"600",children:t===R.C_B.Month?(0,s.jsx)(P.cC,{id:"cs6BKJ",values:{0:(0,iL.Hk)(i)},components:{0:(0,s.jsx)(A.x,{as:"span",textDecoration:"underline"})}}):t===R.C_B.Year?(0,s.jsx)(P.cC,{id:"xArlW8",values:{0:(0,iL.Hk)(i)},components:{0:(0,s.jsx)(A.x,{as:"span",textDecoration:"underline"})}}):"---"}),(0,s.jsx)(A.x,{children:(0,s.jsx)(P.cC,{id:"gfz9Jx"})})]})};var iH=t(78462);let iK=e=>{let{workspace:i}=e,t=(0,iH.Dg)(i),{product:l}=(0,ip.z)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(A.x,{my:2,fontSize:"sm",color:"gray.500",children:[(0,s.jsx)(P.cC,{id:"eR6rch"})," ",(0,s.jsx)(P.cC,{id:"X4Z7y1"})]}),(0,s.jsx)(n.k,{mb:4,children:(0,s.jsx)(iB.I,{url:t})}),(0,s.jsxs)(eU.b,{mt:2,status:"warning",fontSize:"sm",borderRadius:4,children:[(0,s.jsx)(iz.z,{}),(0,s.jsxs)(Y.K,{children:[(0,s.jsxs)(A.x,{children:[(0,s.jsx)("strong",{children:(0,s.jsx)(P.cC,{id:"XeiZmu"})})," ",(0,s.jsx)(P.cC,{id:"PF+S+V",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})]}),l&&(0,s.jsx)(iG,{})]})]})]})};var iV=t(14093),iW=t(70189),iq=t(78534),iY=t(80774),iX=t(5832),iZ=t(66983),iQ=t(79443);let iJ=(e,i)=>"".concat(null!=e?e:""," ").concat(i?"(".concat(i,")"):"");var i$=t(97010);let i0=(e,i,t)=>{let n=iJ(i.displayName,i.email),l=(0,ib.r_)();return"remove"===e?{title:(0,s.jsx)(P.cC,{id:"HlXuQk",values:{0:i.displayName||""}}),description:(0,s.jsx)(P.cC,{id:"MYcnTw",values:{nameWithEmail:n}}),confirmButtonLabel:(0,s.jsx)(P.cC,{id:"gNjH/6"})}:"leave"===e?{title:(0,s.jsx)(P.cC,{id:"6iUevl"}),description:(0,s.jsx)(P.cC,{id:"nM44Cu",values:{0:t.name}}),confirmButtonLabel:(0,s.jsx)(P.cC,{id:"hGWoeF"})}:{title:(0,s.jsx)(P.cC,{id:"kxbLa+",values:{WORKSPACE_ADMIN_DISPLAY_NAME:l}}),description:(0,s.jsx)(P.cC,{id:"gJfQ74",values:{WORKSPACE_ADMIN_DISPLAY_NAME:l}}),confirmButtonLabel:(0,s.jsx)(P.cC,{id:"m4YerB"})}},i1=e=>{let{isOpen:i,onClose:t,onConfirmClick:n,onCancelClick:l,userToConfirm:r,workspace:o,action:a}=e;if(!i)return null;let{title:d,description:c,confirmButtonLabel:u}=i0(a,r,o);
1return(0,s.jsxs)(j.u_,{returnFocusOnClose:!1,onClose:t,isOpen:!0,isCentered:!0,size:"lg",children:[(0,s.jsx)(C.Z,{}),(0,s.jsxs)(v.h,{children:[(0,s.jsx)(f.x,{children:d}),(0,s.jsx)(b.o,{}),(0,s.jsxs)(I.f,{children:[(0,s.jsx)(A.x,{children:c}),"remove"===a&&(0,s.jsx)(i2,{user:r,mt:3})]}),(0,s.jsx)(k.m,{children:(0,s.jsxs)(eG.h,{variant:"ghost",children:[(0,s.jsx)(eD.z,{onClick:l,colorScheme:"gray",children:(0,s.jsx)(P.cC,{id:"dEgA5A"})}),(0,s.jsx)(eD.z,{colorScheme:"red",onClick:n,children:u})]})})]})]})},i2=e=>{let{user:i,...t}=e;return(0,s.jsxs)(S.g,{spacing:3,...t,children:[(0,s.jsx)(eU.b,{status:"warning",children:(0,s.jsxs)(_.U,{children:[(0,s.jsx)(eA.q,{src:null==i?void 0:i.profileImageUrl,size:"sm",name:null==i?void 0:i.displayName}),(0,s.jsxs)(Y.K,{spacing:0,ml:2,flex:"1",children:[(0,s.jsx)(A.x,{fontSize:"sm",flex:"1",wordBreak:"break-word",children:null==i?void 0:i.displayName}),i.email&&(0,s.jsx)(A.x,{fontSize:"xs",color:"gray.600",flex:"1",wordBreak:"break-word",children:i.email})]})]})}),(0,s.jsxs)(eU.b,{children:[(0,s.jsx)(iz.z,{}),(0,s.jsxs)(i$.GS,{spacing:3,children:[(0,s.jsx)(i$.HC,{children:(0,s.jsx)(P.cC,{id:"J1E9I7",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq,0:i.displayName||""}})}),(0,s.jsx)(i$.HC,{children:(0,s.jsx)(P.cC,{id:"1i/P7t",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq,0:i.displayName||""}})})]})]})]})};var i5=t(19783);let i3=e=>{let{selected:i,options:t,onSelect:n,isMenuDisabled:l,disabledOptions:r=[],deleteLabel:o=(0,s.jsx)(P.cC,{id:"HBvein"}),onDeleteClick:a,disabledDeleteReason:d}=e,c=i===R.r3E.Admin?(0,s.jsx)(P.cC,{id:"U3pytU"}):(0,s.jsx)(P.cC,{id:"OvoEq7"});return(0,s.jsxs)(eE.v,{closeOnSelect:!0,children:[(0,s.jsx)(eI.j,{as:eD.z,isDisabled:l,variant:"ghost",size:"sm",rightIcon:(0,s.jsx)(T.G,{icon:w.ptq}),children:c}),(0,s.jsx)(ek.q,{maxW:"320px",zIndex:"dropdown",children:(0,s.jsxs)(eP._,{defaultValue:i,value:i,type:"radio",onChange:e=>{Array.isArray(e)||n(e)},children:[t.map(e=>{let i=r.find(i=>i.disabledOption===e);return(0,s.jsx)(eO.i,{value:e,isDisabled:!!i,pt:3,children:(0,s.jsx)(i5.u,{"aria-label":null==i?void 0:i.reason,label:null==i?void 0:i.reason,isDisabled:!i,placement:"right",shouldWrapChildren:!0,children:(0,s.jsxs)(y.xu,{lineHeight:"base",children:[(0,s.jsx)(A.x,{fontSize:"md",children:ib.rK[e].title}),(0,s.jsx)(A.x,{fontSize:"sm",color:"gray.500",children:ib.rK[e].description})]})})},e)}),(0,s.jsx)(eT.R,{}),(0,s.jsx)(i5.u,{"aria-label":d,label:d,isDisabled:!d,placement:"right",shouldWrapChildren:!0,children:(0,s.jsx)(ew.s,{onClick:a,color:"red.500",fontSize:"md",lineHeight:"base",isDisabled:!!d,children:o})})]})})]})},i4=(e,i)=>(i||[]).find(i=>{var t;return(null===(t=i.workspace)||void 0===t?void 0:t.id)===e}),i6=e=>{var i;let{workspace:t,dateFormatterFn:l,canManageWorkspace:r,workspaceAdminCount:o}=e,[a,d]=(0,u.useState)(R.tvj.DisplayName),[c,h]=(0,u.useState)(R.SrV.Asc),[x,p]=(0,u.useState)(!1),m={id:null==t?void 0:t.id,first:50,sortBy:{field:a,direction:c}},{data:g,loading:j,fetchMore:C}=(0,R.iR3)({variables:m,skip:!(null==t?void 0:t.id)}),[v,{loading:f}]=(0,R.Eiz)(),[b,{loading:_}]=(0,R.ert)(),[S,A]=(0,u.useState)(null),E=null==g?void 0:null===(i=g.workspaceMembers)||void 0===i?void 0:i.pageInfo,I=!j&&(null==E?void 0:E.hasNextPage)&&(null==E?void 0:E.endCursor),D=null==g?void 0:g.workspaceMembers.edges.map(e=>e.node),{user:k,refetch:w}=(0,B.SE)(),O=t.id,N=(0,ez.p)(),[L,M]=(0,u.useState)(null),[F,U]=(0,u.useState)(null),[z,G]=(0,u.useState)(new iO.B),{isOpen:H,onOpen:K,onClose:V}=(0,eo.q)(),W=(0,u.useMemo)(()=>null!=o?o:(null==D?void 0:D.reduce((e,i)=>{let t=i4(O,i.workspaceMemberships);return t&&t.role===R.r3E.Admin&&e++,e},0))||0,[D,O,o]),q=(0,u.useCallback)(async()=>(K(),z.promise),[z,K]),X=(0,u.useCallback)(()=>{M(null),U(null)},[]),Z=(0,u.useCallback)((e,i)=>{A(e.id),v({variables:{workspaceId:t.id,userId:e.id,role:i},refetchQueries:["GetWorkspace"]}).then(()=>{null==w||w();let t=i===R.r3E.Admin?(0,s.jsx)(P.cC,{id:"IFCQlQ",values:{0:e.displayName,1:e.email}}):(0,s.jsx)(P.cC,{id:"gWgob7",values:{0:e.displayName,1:e.email}});N({description:t,status:"success",position:"top",duration:5e3,isClosable:!0})}).catch(()=>{N({description:(0,s.jsx)(P.cC,{id:"CF7q4i",values:{0:e.displayName,1:e.email}}),status:"error",position:"top",duration:5e3,isClosable:!0})}).finally(()=>{A(null)})},[w,N,v,t.id]),Q=(0,u.useCallback)(e=>async i=>{e&&r&&((null==k?void 0:k.id)===e.id&&i===R.r3E.Member?!(W<=1)&&(M(e),U("giveUpAdminAccess"),q().then(()=>{Z(e,i)}).catch(()=>{console.debug("[handleMemberRoleChange] User cancelled action")}).finally(()=>X())):Z(e,i))},[W,r,Z,q,X,null==k?void 0:k.id]),J=(0,u.useCallback)(e=>()=>{if(e.id===(null==k?void 0:k.id))return;let i=iJ(e.displayName,e.email);M(e),U("remove"),q().then(()=>{A(e.id),b({variables:{workspaceId:O,userId:e.id},refetchQueries:["GetWorkspace","GetWorkspaceMembers"]}).then(()=>{null==w||w(),N({description:(0,s.jsx)(P.cC,{id:"jkCRxy",values:{emailWithName:i}}),status:"success",position:"top",duration:5e3,isClosable:!0})}).catch(()=>{N({description:(0,s.jsx)(P.cC,{id:"eETcUn",values:{emailWithName:i}}),status:"error",position:"top",duration:5e3,isClosable:!0})})}).finally(()=>{A(null),X()})},[b,q,O,null==k?void 0:k.id,w,X,N]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(iV.x,{children:(0,s.jsxs)(iW.i,{variant:"simple",colorScheme:"blackAlpha",size:"sm",whiteSpace:"normal",children:[(0,s.jsx)(iq.h,{children:(0,s.jsxs)(iY.Tr,{children:[(0,s.jsx)(iX.Th,{children:(0,s.jsx)(eD.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{d(R.tvj.DisplayName),h(e=>e===R.SrV.Asc?R.SrV.Desc:R.SrV.Asc)},rightIcon:(0,s.jsx)(y.xu,{color:a===R.tvj.DisplayName?"gray.700":"gray.300",children:(0,s.jsx)(T.G,{icon:a===R.tvj.DisplayName?"asc"===c?$.eW2:$.l1h:$.CmM})}),children:(0,s.jsx)(P.cC,{id:"6YtxFj"})})}),(0,s.jsx)(iX.Th,{children:(0,s.jsx)(eD.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{d(R.tvj.CreatedTime),h(e=>e===R.SrV.Asc?R.SrV.Desc:R.SrV.Asc)},rightIcon:(0,s.jsx)(y.xu,{color:a===R.tvj.CreatedTime?"gray.700":"gray.300",children:(0,s.jsx)(T.G,{icon:a===R.tvj.CreatedTime?"asc"===c?$.eW2:$.l1h:$.CmM})}),children:(0,s.jsx)(P.cC,{id:"SnjWqV"})})}),(0,s.jsx)(iX.Th,{children:(0,s.jsx)(P.cC,{id:"GDvlUT"})})]})}),(0,s.jsxs)(iZ.p,{children:[j&&(0,s.jsx)(iY.Tr,{p:0,children:(0,s.jsx)(iQ.Td,{colSpan:2,p:0,children:(0,s.jsxs)(Y.K,{spacing:2,children:[(0,s.jsx)(e_.O,{h:8}),(0,s.jsx)(e_.O,{h:8}),(0,s.jsx)(e_.O,{h:8})]})})}),D&&D.map((e,i)=>{let n=i===D.length-1,o=i4(t.id,e.workspaceMemberships),a=null==o?void 0:o.createdTime,d=l(a),c=null==o?void 0:o.role,u=c===R.r3E.Admin,h=c?ib.rK[c].title:"",x=S===e.id,p=e.id===(null==k?void 0:k.id);return(0,s.jsxs)(iY.Tr,{children:[(0,s.jsx)(iQ.Td,{borderBottom:n?"0 n
1one":void 0,children:(0,s.jsx)(i9,{user:e,isSelf:p})}),(0,s.jsx)(iQ.Td,{borderBottom:n?"0 none":void 0,whiteSpace:"nowrap",children:d}),(0,s.jsx)(iQ.Td,{borderBottom:n?"0 none":void 0,w:32,children:x?(0,s.jsx)(y.xu,{textAlign:"center",children:(0,s.jsx)(ed.$,{size:"xs"})}):r&&c?(0,s.jsx)(i3,{selected:c,isMenuDisabled:f||_,options:[R.r3E.Admin,R.r3E.Member],onSelect:Q(e),disabledOptions:u&&W<=1?[{disabledOption:R.r3E.Member,reason:"A workspace must have at least one admin"}]:[],disabledDeleteReason:p?"You cannot remove yourself":void 0,onDeleteClick:J(e)}):h})]},e.id)})]})]})}),I&&(0,s.jsx)(n.k,{w:"100%",justify:"center",align:"center",mt:3,children:(0,s.jsx)(eD.z,{isLoading:x,size:"sm",onClick:()=>{p(!0),C({variables:{after:null==E?void 0:E.endCursor}}).finally(()=>{p(!1)})},children:(0,s.jsx)(P.cC,{id:"yQ2kGp"})})}),L&&F&&(0,s.jsx)(i1,{isOpen:H,onClose:()=>{V(),z.reject(),G(new iO.B)},onCancelClick:()=>{V(),z.reject(),G(new iO.B)},onConfirmClick:async()=>{V(),z.resolve(),G(new iO.B)},userToConfirm:L,action:F,workspace:t})]})},i9=e=>{let{user:i,isSelf:t}=e,{displayName:n,profileImageUrl:l,email:r}=i;return(0,s.jsxs)(_.U,{children:[(0,s.jsx)(eA.q,{size:"sm",name:n,src:l}),(0,s.jsxs)(Y.K,{spacing:0,children:[(0,s.jsxs)(A.x,{children:[n,t?(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsx)(P.cC,{id:"4Q6lF1"})]}):""]}),(0,s.jsx)(_.U,{mt:1,children:(0,s.jsx)(A.x,{fontSize:"xs",color:"gray.500",children:r})})]})]})};var i7=t(829),i8=t.n(i7);let te=e=>{let{invitations:i,dateFormatterFn:t,canManageWorkspace:n}=e,[l,r]=(0,u.useState)("email"),[o,a]=(0,u.useState)("asc"),[d]=(0,R.PZh)(),c=(0,ez.p)(),h=(0,ib.up)(),x=(0,u.useCallback)(e=>{d({variables:{id:e}}).then(()=>{c({title:eu.ag._({id:"DGxAzK"}),status:"success",duration:3e3,isClosable:!0,position:"bottom"})}).catch(e=>{console.error(e),c({title:eu.ag._({id:"s51CLN",values:{0:e.message}}),status:"error",isClosable:!0,position:"bottom"})})},[d,c]),p="asc"===o?i8()(i,l):i8()(i,l).reverse();return 0===p.length?(0,s.jsx)(y.xu,{p:4,background:"gray.50",children:(0,s.jsx)(A.x,{my:8,textAlign:"center",children:(0,s.jsx)(P.cC,{id:"blyObO"})})}):(0,s.jsx)(iV.x,{children:(0,s.jsxs)(iW.i,{variant:"simple",colorScheme:"blackAlpha",size:"sm",whiteSpace:"normal",children:[(0,s.jsx)(iq.h,{children:(0,s.jsxs)(iY.Tr,{children:[(0,s.jsx)(iX.Th,{children:(0,s.jsx)(eD.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{r("email"),a(e=>"asc"===e?"desc":"asc")},rightIcon:(0,s.jsx)(y.xu,{color:"email"===l?"gray.700":"gray.300",children:(0,s.jsx)(T.G,{icon:"email"===l?"asc"===o?$.eW2:$.l1h:$.CmM})}),children:(0,s.jsx)(P.cC,{id:"O3oNi5"})})}),(0,s.jsxs)(iX.Th,{children:[" ",(0,s.jsx)(eD.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{r("createdTime"),a(e=>"asc"===e?"desc":"asc")},rightIcon:(0,s.jsx)(y.xu,{color:"email"===l?"gray.700":"gray.300",children:(0,s.jsx)(T.G,{icon:"createdTime"===l?"asc"===o?$.eW2:$.l1h:$.CmM})}),children:(0,s.jsx)(P.cC,{id:"B82OLR"})})]}),(0,s.jsx)(iX.Th,{children:(0,s.jsx)(P.cC,{id:"GXsAby"})})]})}),(0,s.jsx)(iZ.p,{children:p&&(null==p?void 0:p.length)>0&&p.map((e,i)=>(0,s.jsxs)(iY.Tr,{children:[(0,s.jsx)(iQ.Td,{children:e.email}),(0,s.jsx)(iQ.Td,{children:t(e.createdTime)}),(0,s.jsx)(iQ.Td,{children:(0,s.jsx)(eN.kH,{placement:"top",label:(0,s.jsx)(P.cC,{id:"wcx9n8",values:{WORKSPACE_ADMIN_DISPLAY_NAME_PLURAL:h}}),shouldWrapChildren:!0,isDisabled:n,children:(0,s.jsx)(eD.z,{w:20,variant:"plain",color:"plain",size:"sm",isDisabled:!n,onClick:()=>{x(e.id)},children:(0,s.jsx)(P.cC,{id:"GXsAby"})})})})]},e.id))})]})})},ti=e=>{var i,t,n;let{isOpen:l,onClose:r}=e,{currentWorkspace:o}=(0,B.SE)(),a=(0,B.d3)(),{data:d}=(0,R.WaV)({variables:{id:null==o?void 0:o.id},skip:!(null==o?void 0:o.id)}),[c,h]=(0,u.useState)(()=>()=>Promise.resolve()),x=(null==d?void 0:null===(i=d.workspace)||void 0===i?void 0:i.invitations)||[],p=(0,u.useCallback)(()=>{c().then(r).catch(()=>{console.warn("[workspaceSettingsModal] InviteByEmail rejected to close modal")})},[c,r]);if(!o)return null;let m=null==d?void 0:null===(t=d.workspace)||void 0===t?void 0:t.memberCount;return(0,s.jsxs)(j.u_,{isOpen:l,onClose:p,size:"3xl",trapFocus:!1,children:[(0,s.jsx)(C.Z,{}),(0,s.jsxs)(v.h,{children:[(0,s.jsx)(f.x,{children:(0,s.jsx)(P.cC,{id:"Knd6gz"})}),(0,s.jsx)(b.o,{}),(0,s.jsx)(E.i,{mb:4}),(0,s.jsxs)(I.f,{children:[(0,s.jsx)(ia.m,{segmentEvent:z.AA.GAMMA_PRO_UPSELL_CALLOUT_WORKSPACE_SETTINGS,onOpenCallback:p}
1),(0,s.jsx)(iy,{workspace:o,canManageWorkspace:a}),(0,s.jsx)(y.xu,{mt:12,children:(0,s.jsxs)(Y.K,{spacing:8,children:[(0,s.jsxs)(y.xu,{children:[(0,s.jsx)(ii.X,{size:"md",fontWeight:"600",mb:4,children:(0,s.jsx)(P.cC,{id:"KKJitJ"})}),(0,s.jsx)(iU,{workspace:o,canManageWorkspace:a,setDoneFn:h}),a&&(0,s.jsx)(iK,{workspace:o})]}),(0,s.jsx)(y.xu,{children:(0,s.jsxs)(it.m,{variant:"soft-rounded",size:"sm",children:[(0,s.jsxs)(is.t,{mb:4,children:[(0,s.jsxs)(il.O,{children:[(0,s.jsx)(y.xu,{mr:2,children:(0,s.jsx)(T.G,{icon:$.iOm})}),(0,s.jsx)(P.cC,{id:"VJ7g+s",values:{memberCount:m}})]}),(0,s.jsxs)(il.O,{children:[(0,s.jsx)(y.xu,{mr:2,children:(0,s.jsx)(T.G,{icon:w.FU$})}),(0,s.jsx)(P.cC,{id:"KxTWx3",values:{0:x.length}})]})]}),(0,s.jsxs)(ir.n,{children:[(0,s.jsx)(io.x,{p:0,mt:0,children:(0,s.jsx)(i6,{workspace:o,dateFormatterFn:iC.P9,canManageWorkspace:a,workspaceAdminCount:null==d?void 0:null===(n=d.workspace)||void 0===n?void 0:n.adminCount})}),(0,s.jsx)(io.x,{p:0,mt:0,children:(0,s.jsx)(te,{invitations:x,dateFormatterFn:iC.P9,canManageWorkspace:a})})]})]})})]})})]}),(0,s.jsx)(E.i,{mt:6}),(0,s.jsx)(k.m,{children:(0,s.jsxs)(Y.K,{w:"100%",direction:"row",align:"center",justifyContent:"space-between",children:[(0,s.jsx)(ij,{memberCount:m}),(0,s.jsx)(ec.L,{}),(0,s.jsx)(eG.h,{children:(0,s.jsx)(eD.z,{variant:"solid",onClick:p,children:(0,s.jsx)(P.cC,{id:"DPfwMq"})})})]})})]})]})};var tt=t(82089);let ts=e=>{let{openModal:i}=e,{currentWorkspace:t}=(0,B.SE)(),n=(0,ez.p)();(0,u.useEffect)(()=>{let e=(0,iH.SJ)()[B.f2],l=null==t?void 0:t.id;e&&l&&(e===l?i():n({title:(0,s.jsx)(P.cC,{id:"EhVOPs"}),position:"top",id:"workspace-not-found",status:"error",isClosable:!0,duration:3e3}),(0,tt.lO)({query:{...(0,iH.SJ)(),[B.f2]:void 0},emitChange:!1}))},[n,i,t])},tn=u.forwardRef((e,i)=>{let{children:t,dataTestId:n,isSelected:l,isDropActive:r,href:o,target:a,...d}=e;return(0,s.jsx)(eD.z,{ref:i,textDecoration:"none",variant:"ghost",w:"100%",size:"sm",colorScheme:"gray",as:q.r,borderRadius:"md",justifyContent:"flex-start","data-testid":n,_hover:{bgColor:l?"trueblue.50":"gray.100",textDecoration:"none"},color:l||r?"trueblue.500":"gray.600",bgColor:l||r?"trueblue.50":void 0,_active:{color:"trueblue.500",bgColor:"trueblue.200",textDecoration:"none"},py:1.5,mb:1,paddingInlineStart:2,fontWeight:l?"bold":"regular",href:o,target:a,...d,children:t})});tn.displayName="SidebarButton";var tl=t(20103),tr=t(91283),to=t(30579),ta=t(99368),td=t(35138),tc=t(62207);let tu=u.forwardRef((e,i)=>{let{tabKey:t,isSelected:n,isDropActive:l=!1,href:r,target:o,children:a,...d}=e;return(0,s.jsx)(Q(),{href:r,passHref:!0,legacyBehavior:!0,children:(0,s.jsx)(tn,{ref:i,isSelected:n,isDropActive:l,dataTestId:"sidebar-".concat(t,"-tab").concat(n?"--selected":""),target:o,...d,children:a})})});tu.displayName="SidebarItem";let th=e=>{let{icon:i,title:t,faClassName:n,w:l,badge:r}=e;return(0,s.jsxs)(_.U,{justify:"flex-start",w:"100%",pr:r?3:void 0,children:[i&&(0,s.jsx)(T.G,{icon:i,fixedWidth:!0,className:n||void 0,size:"1x"}),(0,s.jsx)(A.x,{textOverflow:"ellipsis",overflowX:"hidden",ml:2,w:l,children:t}),r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ec.L,{}),r]})]})};var tx=t(64663);let tp=e=>{let{isSelected:i,hasActivity:t}=e;return t&&w.V1P,i?to.l7:to.Ty},tm=e=>{let{activity:i,user:t}=e;if(!(null==i?void 0:i.activeUsers))return(0,s.jsx)(s.Fragment,{});let n=iw()(i.activeUsers,"id"),l=(0,ta.Yc)(n,null==t?void 0:t.id);return(0,s.jsx)(eN.NL,{overflowTooltipLabel:eu.ag._({id:"25VyZX"}),position:"absolute",right:2,size:"xs",max:3,avatars:l.map(e=>{let{displayName:i,profileImageUrl:t,id:s}=e;return{name:i||"",id:s,profileImageUrl:t,color:"white",badge:{color:"green.500",size:"1em"}}}),onClick:e=>{e.preventDefault(),e.stopPropagation()}})},tg=e=>{var i,t;let{isPreview:n,channel:l,activeTab:r,currentChannelId:o,addDocToChannel:a,user:d}=e,c=(0,F.ye)("channelActivity"),[{canDrop:u,isOver:h},x]=(0,tl.L)(()=>({accept:td.c,drop:e=>{a(e,l)},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})})),p=r===tx.f8.CHANNEL&&l.id===o,m=c&&!!((null==l?void 0:null===(i=l.activity)||void 0===i?void 0:i.activeUsers)&&(null==l?void 0:null===(t=l.activity)||void 0===t?void 0:t.activeUsers.length)>0),g=tp({isSelected:p,hasActivity:m});return(0,s.jsxs)(tu,{ref:x,"data-testid":"sidebar-item",tabKey:"".concat(tx.f8.CHANNEL,"-").concat(l.id),isDropActive:h&&u,isSelected:p,href:(0,iH.j)({id:l.id,slug:l.slug}),opacity:n?"0.5":void 0,justifyContent:"space-between",w:"100%",children:[(0,s.jsx)(th,{icon:g,title:l.name,faClassName:p&&m?"fa-beat-fade":void 0,w:"18ch"}),m&&(0,s.jsx)(tm,{activity:null==l?void 0:l.activity,user:d})]},l.id)},tj=e=>{let{channelPreview:i,channels:t,activeTab:n,currentChannelId:l,isChannelsLoading:r}=e,{user:o,currentWorkspace:a}=(0,B.SE)(),{isOpen:d,onClose:c,doc:u,handleAddDocToChannel:h,updateWorksp
1acePermissionThenAddToChannel:x}=(0,tr.bg)(),{isOpen:p,onOpen:g,onClose:j}=(0,eo.q)({id:"manageChannelsModalDisclosure"});return r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e_.O,{h:"30px",w:"100%"}),(0,s.jsx)(e_.O,{h:"30px",w:"100%"}),(0,s.jsx)(e_.O,{h:"30px",w:"100%"})]}):(0,s.jsxs)(y.xu,{"data-testid":"sidebar-channels",w:"100%",children:[(0,s.jsxs)(_.U,{justify:"space-between",children:[(0,s.jsx)(eN.NZ,{textAlign:"left",mt:4,mb:3,paddingInlineStart:1,children:(0,s.jsx)(P.cC,{id:"HSh8u/"})}),(0,s.jsx)(eN.kH,{label:(0,s.jsx)(P.cC,{id:"Mxy55o"}),children:(0,s.jsx)(ea.h,{"aria-label":eu.ag._({id:"Mxy55o"}),size:"xs",isRound:!0,variant:"plain",icon:(0,s.jsx)(T.G,{icon:w.r8p}),onClick:g})})]}),i&&(0,s.jsx)(tg,{isPreview:!0,channel:i,activeTab:n,currentChannelId:l,addDocToChannel:h,user:o},i.id),t.map(e=>(0,s.jsx)(tg,{channel:e,activeTab:n,currentChannelId:l,addDocToChannel:h,user:o},e.id)),0===t.length&&(0,s.jsxs)(y.xu,{bgColor:"gray.50",textAlign:"center",p:4,mb:2,children:[(0,s.jsx)(A.x,{fontSize:"sm",children:(0,s.jsx)(P.cC,{id:"4G3U4C",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})}),(0,s.jsx)(A.x,{fontSize:"sm",mt:2,fontWeight:"bold",children:(0,s.jsx)(q.r,{color:"trueblue.600",href:"#",onClick:g,children:(0,s.jsx)(P.cC,{id:"Mxy55o"})})})]}),(0,s.jsx)(tc.l,{isOpen:p,onClose:j,workspaceId:null==a?void 0:a.id}),d&&(0,s.jsx)(tr.zx,{doc:u,onSubmit:x,onClose:c})]})},tC=e=>{let{setIsSidebarVisible:i}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Y.K,{pt:2,children:[(0,s.jsx)(e7,{}),(0,s.jsx)(y.xu,{display:{sm:"lg",md:"none"},children:(0,s.jsx)(ea.h,{"aria-label":"Close Sidebar",size:"sm",variant:"ghost",icon:(0,s.jsx)(T.G,{icon:w.NBC}),onClick:()=>i(!1)})}),(0,s.jsx)(e_.O,{w:"100%",height:"36px"})]}),(0,s.jsx)(e_.O,{w:"100%",height:"30px",mt:4}),(0,s.jsx)(e_.O,{w:"100%",height:"20px",mt:8}),(0,s.jsx)(e_.O,{w:"100%",height:"30px",mt:4}),(0,s.jsx)(e_.O,{w:"100%",height:"30px",mt:2}),(0,s.jsx)(e_.O,{w:"100%",height:"30px",mt:2}),(0,s.jsx)(ec.L,{}),(0,s.jsx)(n.k,{justify:"center",align:"flex-end",children:(0,s.jsx)(y.xu,{w:"30px",children:eh.TR})})]})},tv=e=>{let{channelPreview:i,isSidebarVisible:t,setIsSidebarVisible:l,isReady:r,activeTab:o,currentChannelId:a,channels:d,isChannelsLoading:c}=e,u=(0,F.ye)("intercom"),h=(0,F.ye)("shareFeedback"),x=(0,eb.Y)("unlimited_credits"),{product:p}=(0,eC.z)(),m=(0,ey.CG)(ep.Lj),j=(0,eg.G)(),C=(0,B.d3)(),{isOpen:v,onOpen:f,onClose:b}=(0,eo.q)({id:"workspace-settings-modal"}),{isOpen:_,onOpen:S,onClose:A}=(0,eo.q)({id:"ai-credits-modal"});ts({openModal:f});let I=(0,F.ye)("workspaceSettings");return(0,s.jsxs)(n.k,{direction:"column",zIndex:"overlay",h:"100vh",position:{base:"fixed",md:"sticky"},top:0,w:"300px",minW:"300px",bg:"white",shadow:{base:t?"xl":"none",md:"none"},transform:t?{base:"translate(0,0px)",md:"translate(0,0)"}:{base:"translate(-100%,0px)",md:"translate(0,0)"},transition:"transform .2s ease",children:[(0,s.jsx)(n.k,{overflowY:"auto",h:"100vh",p:6,pt:2,pb:4,direction:"column",alignContent:"space-between",children:r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Y.K,{children:[(0,s.jsx)(n.k,{alignItems:"flex-start",justify:"flex-end",children:(0,s.jsx)(y.xu,{display:{base:"block",md:"none"},children:(0,s.jsx)(ea.h,{size:"sm","aria-label":eu.ag._({id:"62Ciis"}),variant:"ghost",icon:(0,s.jsx)(er.T,{w:3}),onClick:()=>l(!1),isRound:!0})})}),(0,s.jsx)(ie,{onOpen:f}),(0,s.jsx)(g.Pu,{})]}),(0,s.jsx)(tf,{channelPreview:i,activeTab:o,currentChannelId:a,channels:d,isChannelsLoading:c}),(0,s.jsx)(y.xu,{w:"100%",pt:1,pb:3,children:(0,s.jsx)(E.i,{})}),C&&(0,s.jsx)(tn,{dataTestId:"invite-to-workspace",onClick:()=>{f()},children:(0,s.jsx)(th,{icon:w.FKd,title:(0,s.jsx)(P.cC,{id:"qVqqmP"})})}),!1===x&&(0,s.jsx)(tn,{dataTestId:"ai-user-credits",onClick:S,children:(0,s.jsx)(th,{icon:w.owJ,title:null===m?(0,s.jsx)(ed.$,{size:"xs"}):(0,s.jsx)(P.cC,{id:"IniQ/K",values:{availableCredits:m}})})}),I&&(0,s.jsx)(tu,{tabKey:tx.oc.SETTINGS,isSelected:o===tx.oc.SETTINGS,href:"/".concat(tx.oc.SETTINGS),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.SETTINGS].icon,title:tx.A5[tx.oc.SETTINGS].displayName})}),u&&(0,s.jsx)(tn,{dataTestId:"contact-button",onClick:j,children:(0,s.jsx)(th,{icon:w.sNQ,title:(0,s.jsx)(P.cC,{id:"mpby9d"})})}),!u&&(0,s.jsx)(tn,{dataTestId:"contact-button",href:"mailto:".concat(em.p),children:(0,s.jsx)(th,{icon:w.FU$,title:(0,s.jsx)(P.cC,{id:"A0C9La"})})}),h&&(0,s.jsx)(tn,{dataTestId:"feedback-button",href:"https://ideas.gamma.app/ideas",target:"_blank",children:(0,s.jsx)(th,{icon:w.OH3,title:(0,s.jsx)(P.cC,{id:"u5hSeG"})})}),(0,s.jsx)(ec.L,{}),null===p?(0,s.jsx)(ef,{}):(0,s.jsx)(n.k,{justify:"center",align:"flex-end",width:"100%",my:6,children:(0,s.jsx)(y.xu,{fontSize:"12px",width:"30px",children:eh.TR})})]}):(0,s.jsx)(tC,{setIsSidebarVisible:l})}),(0,s.jsx)(ti,{isOpen:v,onClose:b}),(0,s.jsx)(ex.H,{isOpen:_,onClose:A,credits:m,onOpen:S})]})},tf=e=>{let{channelPreview:i,activeTab:t,currentChannelId:n,channels:l,isChannelsLoading:r}=e,o=(0,F.ye)("customFonts"),a=(0,eb._O)();return(0,s.jsxs)(S.g,{"data-testid":"sidebar-tablist",mt:4,mb:2,w:"100%",spacing:1,children:[(0,s.jsxs)(Y.K,{spacing:0,w:"100%",children:[(0,s.jsx)(tu,{tabKey:tx.oc.ALL,isSelected:t===tx.oc.ALL,href:"/#".concat(tx.oc.ALL),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.ALL].icon,title:tx.A5[tx.oc.ALL].displayName})}),a&&(0,s.jsx)(tu,{pr:-1,tabKey:tx.oc.SITES,isSelected:t===tx.oc.SITES,href:"/#".concat(tx.oc.SITES),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.SITES].icon,title:tx.A5[tx.oc.SITES].displayName,badge:(0,s.jsx)(X.C,{colorScheme:"green",lineHeight:"normal",fontSize:"xxs",children:(0,s.jsx)(P.cC,{id:"YBt9YP"})})})})]}),(0,s.jsx)(tj,{channelPreview:i,isChannelsLoading:r,channels:l,currentChannelId:n,activeTab:t}),(0,s.jsx)(y.xu,{w:"100%",pt:1,pb:2,children:(0,s.jsx)(E.i,{})}),!(0,H.s2)()&&(0,s.jsx)(tu,{tabKey:tx.oc.TEMPLATES,isSelected:t===tx.oc.TEMPLATES,href:"/#".concat(tx.oc.TEMPLATES),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.TE
1MPLATES].icon,title:tx.A5[tx.oc.TEMPLATES].displayName})}),(0,s.jsx)(tu,{tabKey:tx.oc.INSPIRATION,isSelected:t===tx.oc.INSPIRATION,href:"/#".concat(tx.oc.INSPIRATION),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.INSPIRATION].icon,title:tx.A5[tx.oc.INSPIRATION].displayName})}),!(0,H.s2)()&&(0,s.jsx)(tu,{tabKey:tx.oc.THEMES,isSelected:t===tx.oc.THEMES,href:"/#".concat(tx.oc.THEMES),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.THEMES].icon,title:tx.A5[tx.oc.THEMES].displayName})}),o&&!(0,H.s2)()&&(0,s.jsx)(tu,{tabKey:tx.oc.FONTS,isSelected:t===tx.oc.FONTS,href:"/#".concat(tx.oc.FONTS),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.FONTS].icon,title:tx.A5[tx.oc.FONTS].displayName})}),(0,s.jsx)(tu,{tabKey:tx.oc.TRASH,isSelected:t===tx.oc.TRASH,href:"/#".concat(tx.oc.TRASH),children:(0,s.jsx)(th,{icon:tx.A5[tx.oc.TRASH].icon,title:tx.A5[tx.oc.TRASH].displayName})})]})};var tb=t(17324),ty=t(57474);let t_=()=>{let{onClose:e,onOpen:i,isOpen:t}=(0,eo.q)(),{user:l,isUserLoading:r}=(0,B.SE)(),o=!!(l&&!r&&!l.jobFunction);return((0,u.useEffect)(()=>{o&&setTimeout(i,1e3)},[o,i]),t)?(0,s.jsxs)(j.u_,{isOpen:t,onClose:e,closeOnEsc:!1,closeOnOverlayClick:!1,size:"lg",children:[(0,s.jsx)(C.Z,{}),(0,s.jsxs)(v.h,{children:[(0,s.jsx)(f.x,{children:(0,s.jsx)(P.cC,{id:"H8aFPr"})}),(0,s.jsx)(I.f,{children:(0,s.jsxs)(Y.K,{children:[(0,s.jsx)(n.k,{height:32,justifyContent:"center",background:"radial-gradient(circle at center, var(--chakra-colors-pink-200) 0, var(--chakra-colors-salmon-200) 110%)",borderRadius:"md",pt:4,px:4,children:(0,s.jsx)(eW.E,{src:ty.Z.src,alt:"Sal floating on a pink gradient"})}),(0,s.jsx)(A.x,{fontSize:"lg",pb:0,pt:4,children:(0,s.jsx)(P.cC,{id:"arCM97"})}),(0,s.jsxs)(A.x,{fontSize:"sm",color:"gray.500",textAlign:"center",children:["(",(0,s.jsx)(P.cC,{id:"H50C1I"})," ",(0,s.jsx)("span",{role:"img","aria-label":"stopwatch",children:"⏱"}),")"]}),(0,s.jsx)(tb.a,{context:"modal",onSuccess:e})]})})]})]}):(0,s.jsx)(s.Fragment,{})},tS={fontWeight:"bold",backgroundImage:"linear-gradient(50deg, #F658A8, #ff5b8a 49%, #ff5b8a 53%, #ff5b8a 55%, #fba64b 77%, #f99b52)",backgroundClip:"text",color:"transparent"},tA=()=>(0,s.jsx)(n.k,{bg:"#1A013F",direction:"column",mb:4,children:(0,s.jsxs)(n.k,{py:4,px:8,direction:["column","row"],children:[(0,s.jsxs)(Y.K,{mr:[0,4],children:[(0,s.jsx)(A.x,{fontSize:"xl",sx:tS,children:"Meet Gamma, the fast alternative to slides"}),(0,s.jsx)(A.x,{color:"gray.200",children:"Write like a doc, present like a deck."})]}),(0,s.jsx)(ec.L,{}),(0,s.jsxs)(_.U,{mt:[2,0],children:[(0,s.jsx)(eD.z,{as:"a",href:"/signup",children:"Make your own"}),(0,s.jsx)(eD.z,{as:"a",cursor:"pointer",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>{window.location.href="".concat(eM.v.API_HOST,"/logout")},children:"Sign out"})]})]})});var tE=t(46929);let tI=e=>{let{children:i}=e,{user:t,activeTab:l,userHasNoWorkspaces:r,currentChannelId:o,channelPreview:d,channels:u,isChannelsLoading:j,isSidebarVisible:C,setIsSidebarVisible:v}=(0,tE.J)();return(0,s.jsxs)(h.W,{backend:x.PD,children:[(0,s.jsxs)(n.k,{"data-testid":"home",width:"100%",height:"100%",position:"relative",children:[(0,s.jsx)(c(),{children:(0,s.jsx)("title",{children:l?"".concat(tx.A5[l].ariaLabel," - ").concat(m.N6):"".concat(m.N6)})}),(0,s.jsx)(g.H9,{}),(0,s.jsx)(et,{}),r?null:(0,s.jsx)(tv,{channelPreview:d,isSidebarVisible:C,setIsSidebarVisible:v,user:t,isReady:!!t,activeTab:l,currentChannelId:o,channels:u,isChannelsLoading:j}),(0,s.jsxs)(n.k,{"data-testid":"doc-root-main",flex:"1",px:r?0:(0,H.s2)()?2:6,py:r?0:(0,H.s2)()?2:6,w:"calc(100vw - 300px - var(--chakra-sizes-4))",bg:"gray.100",borderTopLeftRadius:"15px",borderBottomLeftRadius:"15px",direction:"column",marginLeft:{base:"0"},minH:"var(--100vh)",pb:"10em",transition:"margin .2s ease",children:[r&&(0,s.jsx)(tA,{}),(0,s.jsx)(a.W,{maxW:"80em",p:(0,H.s2)()?2:void 0,h:"100%",children:i})]})]}),(0,s.jsx)(p.C,{showShortcuts:!1}),(0,s.jsx)(t_,{})]})},tD=e=>{let{children:i}=e;return(0,s.jsxs)(n.k,{width:"100%",height:"100%",direction:"column",minHeight:"var(--100vh)",bgColor:"gray.100",color:"gray.800",p:0,children:[(0,s.jsx)(l.xB,{styles:{body:{overflowY:"scroll"}}}),(0,s.jsx)(r.r,{}),(0,s.jsx)(o.Ad,{children:(0,s.jsx)(tI,{children:i})})]})};function tk(e){let i=i=>(0,s.jsx)(tD,{children:(0,s.jsx)(e,{...i})});return"getInitialProps"in e&&(i.getInitialProps=e.getInitialProps),i}},35138:function(e,i,t){"use strict";t.d(i,{c:function(){return s}});let s="ChannelDocDragItemType"}
1,90439:function(e,i,t){"use strict";t.d(i,{Oj:function(){return o},Pv:function(){return r},QX:function(){return l},cx:function(){return n}});var s=t(14274);let n=s.v.GAMMA_PUPPETEER_SERVICE,l=n&&"pptx"===window.format,r=n&&"pdf"===window.format,o=n&&"screenshot"===window.format},7e4:function(e,i,t){"use strict";t.d(i,{X:function(){return l}});var s=t(2784),n=t(18733);function l(e,i){let[t,l]=(0,s.useState)(()=>{try{let t=n.Q.getItem(e);if(null===t)return i;return JSON.parse(t)}catch(e){return console.error("[useSessionStorage.getItem] Error getting sessionStorage item",e),i}}),r=(0,s.useCallback)(i=>{try{n.Q.setItem(e,JSON.stringify(i)),l(i)}catch(e){console.error("[useSessionStorage.setItem] Error setting sessionStorage item",e)}},[e]);return[t,r]}},62376:function(){},6991:function(){},76298:function(){},4466:function(){},43839:function(){},2517:function(){},29264:function(e,i,t){"use strict";t.d(i,{Z:function(){return n}});var s=t(95083);function n(){let{isEditing:e,getEditButtonProps:i,getCancelButtonProps:t,getSubmitButtonProps:n}=(0,s.V)();return{isEditing:e,getEditButtonProps:i,getCancelButtonProps:t,getSubmitButtonProps:n}}},89364:function(e,i,t){"use strict";t.d(i,{R:function(){return s}});var s=(0,t(67012).I)({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"})},73481:function(e,i,t){"use strict";t.d(i,{P:function(){return h}});var s=t(31053),n=t(68023),l=t(76801),r=t(52322),o=(0,n.G)(function(e,i){let{children:t,placeholder:n,className:o,...a}=e;return(0,r.jsxs)(l.m.select,{...a,ref:i,className:(0,s.cx)("chakra-select",o),children:[n&&(0,r.jsx)("option",{value:"",children:n}),t]})});o.displayName="SelectField";var a=t(76874),d=t(91982),c=t(84586),u=t(2784),h=(0,n.G)((e,i)=>{var t;let n=(0,d.jC)("Select",e),{rootProps:u,placeholder:h,icon:x,color:p,height:g,h:j,minH:C,minHeight:v,iconColor:f,iconSize:b,...y}=(0,c.Lr)(e),[_,S]=function(e,i){let t={},s={};for(let[n,l]of Object.entries(e))i.includes(n)?t[n]=l:s[n]=l;return[t,s]}(y,c.oE),A=(0,a.Y)(S),E={paddingEnd:"2rem",...n.field,_focus:{zIndex:"unset",...null==(t=n.field)?void 0:t._focus}};return(0,r.jsxs)(l.m.div,{className:"chakra-select__wrapper",__css:{width:"100%",height:"fit-content",position:"relative",color:p},..._,...u,children:[(0,r.jsx)(o,{ref:i,height:null!=j?j:g,minH:null!=C?C:v,placeholder:h,...A,__css:E,children:e.children}),(0,r.jsx)(m,{"data-disabled":(0,s.PB)(A.disabled),...(f||p)&&{color:f||p},__css:n.icon,...b&&{fontSize:b},children:x})]})});h.displayName="Select";var x=e=>(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),p=(0,l.m)("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),m=e=>{let{children:i=(0,r.jsx)(x,{}),...t}=e,s=(0,u.cloneElement)(i,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return(0,r.jsx)(p,{...t,className:"chakra-select__icon-wrapper",children:(0,u.isValidElement)(i)?s:null})};m.displayName="SelectIcon"}},function(e){e.O(0,[9774,7662,8433,2182,2812,8774,6694,4078,3273,9025,5333,4424,8707,146,3661,3016,116,2545,9808,5112,3693,931,2808,4328,205,8271,2252,1537,6656,2681,7174,9718,4001,887,2888,179],function(){return e(e.s=87314)}),_N_E=e.O()}]);
2//# sourceMappingURL=index-be51f0e1811cddb2.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.