PageSourceSearch

https://etc-skin-gummies-sbq5ylf.gamma.site/_next/static/chunks/pages/create/generate/[id]-d9da6352725bd616.js

js etc-skin-gummies-sbq5ylf.gamma.site collected 2026-10-03 04:04:46 UTC 141,602 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[508,4792],{43781:function(e){e.exports={prettyPrint:function(e,t){var n,i,r,o,a,s;for(i=(t=t||{}).indent_size||4,r=t.indent_char||" ",a=t.brace_style||"collapse",o=0==t.max_char?1/0:t.max_char||70,s=t.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],(n=new function(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:"\n\r	 ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var n=0;n<t.length;n++)if(e===t[n])return!0;return!1}},this.get_content=function(){for(var e="",t=[],n=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(e,this.Utils.whitespace)){t.length&&(n=!0),this.line_char_count--;continue}if(n){if(this.line_char_count>=this.max_char){t.push("\n");for(var i=0;i<this.indent_level;i++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;n=!1}t.push(e)}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",n=RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(t=this.input.substring(this.pos,r),this.pos=r),t},this.record_tag=function(e){this.tags[e+"count"]?this.tags[e+"count"]++:this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level,this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.get_tag=function(){var e,t,n,i="",r=[],o=!1;do{if(this.pos>=this.input.length)return r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(i,this.Utils.whitespace)){o=!0,this.line_char_count--;continue}"'"!==i&&'"'!==i||r[1]&&"!"===r[1]||(i+=this.get_unformatted(i),o=!0),"="===i&&(o=!1),r.length&&"="!==r[r.length-1]&&">"!==i&&o&&(this.line_char_count>=this.max_char?(this.print_newline(!1,r),this.line_char_count=0):(r.push(" "),this.line_char_count++),o=!1),"<"===i&&(t=this.pos-1),r.push(i)}while(">"!==i);var a=r.join("");e=-1!=a.indexOf(" ")?a.indexOf(" "):a.indexOf(">");var l=a.substring(1,e).toLowerCase();if("/"===a.charAt(a.length-2)||this.Utils.in_array(l,this.Utils.single_token))this.tag_type="SINGLE";else if("script"===l)this.record_tag(l),this.tag_type="SCRIPT";else if("style"===l)this.record_tag(l),this.tag_type="STYLE";else if(this.Utils.in_array(l,s)){var c=this.get_unformatted("</"+l+">",a);r.push(c),t>0&&this.Utils.in_array(this.input.charAt(t-1),this.Utils.whitespace)&&r.splice(0,0,this.input.charAt(t-1)),n=this.pos-1,this.Utils.in_array(this.input.charAt(n+1),this.Utils.whitespace)&&r.push(this.input.charAt(n+1)),this.tag_type="SINGLE"}else if("!"===l.charAt(0)){if(-1!=l.indexOf("[if")){if(-1!=a.indexOf("!IE")){var c=this.get_unformatted("-->",a);r.push(c)}this.tag_type="START"}else if(-1!=l.indexOf("[endif"))this.tag_type="END",this.unindent();else if(-1!=l.indexOf("[cdata[")){var c=this.get_unformatted("]]>",a);r.push(c),this.tag_type="SINGLE"}else{var c=this.get_unformatted("-->",a);r.push(c),this.tag_type="SINGLE"}}else"/"===l.charAt(0)?(this.retrieve_tag(l.substring(1)),this.tag_type="END"):(this.record_tag(l),this.tag_type="START"),this.Utils.in_array(l,this.Utils.extra_liners)&&this.print_newline(!0,this.output);return r.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",i="",r=!0;
1do{if(this.pos>=this.input.length)break;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!r){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,r=!0}while(-1==i.toLowerCase().indexOf(e));return i},this.get_token=function(){var e;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var t=this.last_token.substr(7);return"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]}return"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":Array(e+1).join(this.indent_string)},this.printer=function(e,t,n,i,r){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.max_char=i,this.line_char_count=0;for(var o=0;o<this.indent_size;o++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){if(this.line_char_count=0,t&&t.length){if(!e)for(;this.Utils.in_array(t[t.length-1],this.Utils.whitespace);)t.pop();t.push("\n");for(var n=0;n<this.indent_level;n++)t.push(this.indent_string)}},this.print_token=function(e){this.output.push(e)},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}).printer(e,r,i,o,a);;){var l=n.get_token();if(n.token_text=l[0],n.token_type=l[1],"TK_EOF"===n.token_type)break;switch(n.token_type){case"TK_TAG_START":n.print_newline(!1,n.output),n.print_token(n.token_text),n.indent(),n.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===n.last_token&&""===n.last_text){var c=n.token_text.match(/\w+/)[0],d=n.output[n.output.length-1].match(/<\s*(\w+)/);(null===d||d[1]!==c)&&n.print_newline(!0,n.output)}n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var u=n.token_text.match(/^\s*<([a-z]+)/i);u&&n.Utils.in_array(u[1],s)||n.print_newline(!1,n.output),n.print_token(n.token_text),n.current_mode="CONTENT";break;case"TK_CONTENT":""!==n.token_text&&n.print_token(n.token_text),n.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==n.token_text){n.output.push("\n");var h=n.token_text;if("TK_SCRIPT"==n.token_type)var p="function"==typeof js_beautify&&js_beautify;else if("TK_STYLE"==n.token_type)var p="function"==typeof css_beautify&&css_beautify;if("keep"==t.indent_scripts)var m=0;else if("separate"==t.indent_scripts)var m=-n.indent_level;else var m=1;var x=n.get_full_indent(m);if(p)h=p(h.replace(/^\s*/,x),t);else{var g=h.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(n.indent_string).length-1,f=n.get_full_indent(m-g);h=h.replace(/^\s*/,x).replace(/\r\n|\r|\n/g,"\n"+f).replace(/\s*$/,"")}h&&(n.print_token(h),n.print_newline(!0,n.output))}n.current_mode="TAG"}n.last_token=n.token_type,n.last_text=n.token_text}return n.output.join("")}}},10366:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/create/generate/[id]",function(){return n(83624)}])},71537:function(e,t,n){"use strict";n.d(t,{z:function(){return eh}});var i=n(52322);n(98248),n(61219);var r=n(55671),o=n(62202),a=n(18200),s=n(81674),l=n(94523),c=n(97729),d=n.n(c),u=n(5632),h=n(2784),p=n(43997),m=n(14274),x=n(93202),g=n(2013);let f=e=>{let t=["malformed","encoded","illegal"];return e.includes("URIError")&&e.split(" ").some(e=>t.includes(e))};class j 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,t){if("dev"===m.v.APPLICATION_ENVIRONMENT)throw e}static getDerivedStateFromError(e){return{hasError:!0,errMessage:e.message,shouldMountChildren:!1}}handleError(e){if("dev"===m.v.APPLICATION_ENVIRONMENT)throw Error("[ErrorBoundary]: ".concat(e.message))}handleUnhandledRejection(e){let t=this.props.unhandledRejectionFilter(e);if(t){var n;let t=(null===(n=e.reason)||void 0===n?void 0:n.message)||"";this.setState({hasError:!0,errMessage:t})}}render(){let e=!0===f(this.state.errMessage)?{opacity:"0.65",starOverlay:!1}:{};return(0,i.jsxs)(i.Fragment,{children:[this.state.hasError&&(0,i.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)}}j.defaultProps={unhandledRejectionFilter:e=>{var t;return!!f((null===(t=e.reason)||void 0===t?void 0:t.message)||"")||e.reason instanceof x.YBv&&!1===document.hidden||e.reason instanceof x.R5s}
1},n(61036),n(62376),n(6991),n(76298),n(4466),n(43839),n(40917);var v=n(11050),b=n(42005);let C=()=>{let e=(0,h.useRef)(!1),t=(0,h.useRef)(new Map);(0,h.useEffect)(()=>{if("production"!==m.v.APPLICATION_ENVIRONMENT)return;let n=()=>{if(e.current)return;let n=t.current.get("total"),i=t.current.get("notTrusted"),r=i/n>.5;r&&n>5&&(e.current=!0,b.c.track(v.xW.NOT_TRUSTED_EVENTS_DETECTED,{totalEvents:n,notTrustedEvents:i}))},i=e=>{e.isTrusted||t.current.set("notTrusted",(t.current.get("notTrusted")||0)+1),t.current.set("total",(t.current.get("total")||0)+1),n()};return document.addEventListener("paste",i,{capture:!0}),document.addEventListener("mousedown",i,{capture:!0}),document.addEventListener("keydown",i,{capture:!0}),()=>{document.removeEventListener("paste",i,{capture:!0}),document.removeEventListener("mousedown",i,{capture:!0}),document.removeEventListener("keydown",i,{capture:!0})}},[])};var y=n(79254),_=n(27354),w=n(42111),k=n(32019),S=n(99092),I=n(36651);let E=(e,t)=>{S.H.init(m.v.HIGHLIGHT_PROJECT_ID,{environment:m.v.APPLICATION_ENVIRONMENT,sessionShortcut:!!t&&"shift+command+0",enableStrictPrivacy:e,enableSegmentIntegration:!0,networkRecording:{enabled:!0,recordHeadersAndBody:!0}}),v.co.loadSdkPromise.then(e=>{e&&e.addSourceMiddleware(S.LZ)})},A=e=>{let{children:t}=e,{user:n,anonymousUser:r,isGammaOrgUser:o,isUserLoading:a}=(0,I.SE)(),{enabled:s,enableStrictPrivacy:l}=(0,w.ye)("highlight");return(0,h.useEffect)(()=>{s&&!a&&n&&E(l,o)},[l,s,o,a,n]),(0,h.useEffect)(()=>{if(!a){if(n){let{id:e,displayName:t,email:i,profileImageUrl:r}=n;S.H.identify(e,{highlightDisplayName:t,email:i,avatar:r})}else if(null==r?void 0:r.id){let{id:e,displayName:t}=r;S.H.identify("",{anonDisplayName:t||"",anonId:e})}}},[n,r,a]),(0,i.jsx)(i.Fragment,{children:t})};var T=n(34881),N=n(87254),P=n(5879),R=n(44754);let G=e=>{let{children:t}=e;return(0,R.b)(),(0,i.jsx)(P.bd,{i18n:N.ag,children:t})};var O=n(18875),M=n(17292),z=n(55478),L=n(76332),U=n(6912),D=n(27902),F=n(21733),H=n(78462),W=n(72354),K=n(1163),B=n(2953);let q="get-gamma-pro",V=e=>{var t,n;let{children:r}=e,{currentWorkspace:o,isUserLoading:a}=(0,F.SE)(),[s,l]=(0,h.useState)(!1),c=(0,D.z$)(),d=(0,w.ye)("upsellUXEnabled_Pro"),{data:u,refetch:p}=(0,L.FaU)({variables:{workspaceId:null==o?void 0:o.id,includeExpired:!0},skip:!(null==o?void 0:o.id)}),m=null==u?void 0:u.subscription;(0,U.ET)({subscription:m,workspace:o,autoLaunch:!0});let{data:x}=(0,L.kNl)({variables:{workspaceId:null==o?void 0:o.id},skip:!o}),g=null==x?void 0:null===(t=x.products)||void 0===t?void 0:t.find(e=>"pro"===e.key),f=null==g?void 0:null===(n=g.prices)||void 0===n?void 0:n.find(e=>e.frequencyUnit===L.C_B.Year),j=(0,K.K9)(o),{isOpen:v,onOpen:b,onClose:C}=(0,z.q)({id:"upsell-modal"}),y=(0,h.useRef)(null),_=(0,h.useCallback)(e=>{let{onOpenCallback:t,onCloseCallback:n,insufficientCreditsWarning:i,segmentEvent:r}=e;d&&(l(!!i),null==t||t(),b(),null==c||c.track(r),y.current=n||null)},[c,b,d]),k=(0,h.useCallback)(()=>{var e;null==y||null===(e=y.current)||void 0===e||e.call(y),C(),y.current=null,l(!1)},[C]),[S,I]=(0,h.useState)({openUpsellModal:_,product:j,subscription:m,proYearlyProductPrice:f});return(0,h.useEffect)(()=>{let e="true"===(0,H.SJ)()[q];e&&!a&&o&&(b(),(0,T.lO)({query:{...(0,H.SJ)(),[q]:void 0},emitChange:!1}))},[b,o,a]),(0,h.useEffect)(()=>{I({openUpsellModal:_,refetchSubscription:p,product:j,subscription:m,proYearlyProductPrice:f})},[_,j,m,f,p]),(0,i.jsxs)(B.P.Provider,{value:S,children:[r,(0,i.jsx)(W.b,{insufficientCreditsWarning:s,isUpsellModalOpen:v,closeUpsellModal:k}),(0,i.jsx)(U.S1,{})]})};var Y=n(99268),J=n(25944),X=n(19902);let Z="no_org_id",Q=e=>{let{children:t}=e;(0,J.iZ)();let{user:n,anonymousUser:r,currentWorkspace:o,isUserLoading:a}=(0,I.SE)();return(0,h.useEffect)(()=>{let e=(0,X.K)();(0,Y.$n)(e.get()),e.fetch().then(Y.$n).catch(()=>{})},[]),(0,h.useEffect)(()=>{let e;if(!a){if(n){let{id:t,email:i}=n,r=!!i&&i.endsWith("@gamma.app"),a=(null==o?void 0:o.id)||Z;e={userId:t,isGammaUser:r,userOrgId:a,anonymousUser:!1,gammaUserFirstName:r?n.firstName:""}}else e={userId:"anonymous_user",isGammaUser:!1,userOrgId:Z,anonymousUser:!0,gammaUserFirstName:""};(0,Y.$n)(e)}},[a,n,r,o]),(0,i.jsx)(i.Fragment,{children:t})};var $=n(54839),ee=n(91994),et=n(89311),en=n(95426),ei=n(1198),er=n(90221),eo=n(60742),ea=n(13265),es=n(90383);s.vc.autoAddCss=!1;let el=(0,ee.bh)(),ec=(0,x.RqP)(),ed=(0,x.PGq)(),eu=(0,o.B1)(l.qZ,{styles:{global:{".ProseMirror":{outline:"0 none"}}}});((e,t)=>
1{let n=(0,$.I)({theme:t});e.globalToast=n})(window,eu),(0,eo.Lq)(),M.F7.initialize(),(0,T.lt)(),v.co.init(),(0,O.S1)(),(0,_.u7)(),(0,en.a)("appMainBundleLoaded"),console.log("\uD83D\uDE80 GammaApp main wrapper imported"),w.VH.get("debugLogging")||(window.console.debug=()=>{});let eh=e=>function(t){return(0,i.jsx)(ep,{children:(0,i.jsx)(e,{...t})})},ep=e=>{let{children:t}=e;console.log("\uD83D\uDE80 GammaApp main wrapper rendered");let n=(0,u.useRouter)();(0,et.l)(),(0,ea.k)(),C(),(0,h.useEffect)(()=>{let e=(e,t)=>{let{shallow:n}=t;console.debug("[GammaApp - handleRouteChange] App is changing to ".concat(e," ").concat(n?"with":"without"," shallow routing"))};return n.events.on("routeChangeStart",e),()=>{n.events.off("routeChangeStart",e)}},[n]);let o=(0,ei.aY)();return(0,i.jsx)(p.zt,{store:el,children:(0,i.jsx)(G,{children:(0,i.jsx)(a.x,{theme:eu,resetCSS:!0,children:(0,i.jsx)(j,{children:(0,i.jsx)(r.e,{client:ec,children:(0,i.jsxs)(x.mdV,{client:ed,children:[(0,i.jsx)(ex,{}),(0,i.jsx)(y.H6,{}),(0,i.jsx)(O.GQ,{}),(0,i.jsxs)(I.fS,{children:[(0,i.jsx)(D.qA,{children:(0,i.jsx)(w.dF,{children:(0,i.jsx)(V,{children:(0,i.jsx)(x.Imj,{children:(0,i.jsx)(Q,{children:(0,i.jsx)(A,{children:(0,i.jsx)(ei.dv,{value:o,children:(0,i.jsx)(k.u,{children:t})})})})})})})}),(0,i.jsx)(w.MG,{})]})]})})})})})})},em="A new medium for presenting ideas, powered by AI. Beautiful, engaging content with none of the formatting and design work.",ex=()=>{let e=m.v.APPLICATION_ENVIRONMENT;return(0,i.jsxs)(d(),{children:[(0,i.jsx)("title",{children:"Gamma"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0, viewport-fit=cover"}),(0,i.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,i.jsx)("link",{rel:"shortcut icon",href:"production"===e?"/favicons/favicon-transparent-96x96.png":"staging"===e?"/favicons/favicon_staging.jpg":"/favicons/favicon_local.jpg"}),(0,i.jsx)("meta",{content:em,name:"description"},"description"),(0,i.jsx)("meta",{content:"Gamma",property:"og:title"},"og:title"),(0,i.jsx)("meta",{content:em,property:"og:description"},"og:description"),(0,i.jsx)("meta",{content:m.v.OG_IMAGE_URL,property:"og:image"},"og:image"),(0,i.jsx)("meta",{content:"Gamma",property:"twitter:title"},"twitter:title"),(0,i.jsx)("meta",{content:em,property:"twitter:description"},"twitter:description"),(0,i.jsx)("meta",{content:m.v.OG_IMAGE_URL,property:"twitter:image"},"twitter:image"),(0,i.jsx)("meta",{property:"og:type",content:"website"},"og:type"),(0,i.jsx)("meta",{content:"summary_large_image",name:"twitter:card"},"twitter:card"),(0,i.jsx)("link",{href:"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900",rel:"stylesheet"}),(0,i.jsx)("link",{rel:"stylesheet",href:"https://use.typekit.net/tiw2cwq.css"}),!(0,er.l6)()&&!(0,es.wg)()&&(0,i.jsx)("script",{async:!0,src:"https://cdn.optimizely.com/js/20579410255.js"}),(0,i.jsx)("script",{src:"//cdn.iframe.ly/embed.js",async:!0,charSet:"utf-8"})]})}},60510:function(e,t,n){"use strict";n.d(t,{r:function(){return O},h:function(){return M}});var i=n(52322),r=n(38035),o=n(17993),a=n(77533),s=n(62614),l=n(81672),c=n(42946),d=n(49929),u=n(2784),h=n(90221),p=n(90439),m=n(93441),x=n(89458),g=n(90383),f=n(18733),j=n(5879),v=n(42111),b=n(78462),C=n(94199),y=n(11082),_=n(64173),w=n(31807),k=n(6912),S=n(48832),I=n(11050),E=n(36651),A=n(81640),T=n(12265),N=n(11942),P=n(88640);let R=[{Component:()=>{let e=(0,v.ye)("outageButterbar");if(!e.enabled)return null;let{header:t,text:n,buttonLink:r,buttonText:o,key:a,pathnameRegexp:s}=e;return(0,i.jsx)(M,{definition:{key:a,header:t,text:n,buttonText:o,buttonLink:r,conditions:()=>!s||null!==window.location.pathname.match(new RegExp(s))}})},key:"outage-butterbar"},{Component:()=>{let e=(0,v.ye)("openAiStatus");return"NORMAL"===e?null:(0,i.jsx)(M,{definition:{key:"ai-service-status",header:(0,i.jsx)(j.cC,{id:"1Agl06"}),text:(0,i.jsx)(j.cC,{id:"cCl6WD"}),ttl:86400,conditions:()=>(0,b._r)(window.location.pathname)}})},key:"ai-service-status-butterbar"},{Component:()=>{var e,t,n;let{user:r,currentWorkspace:o}=(0,E.SE)(),{subscription:a,product:s}
1=(0,A.z)(),{launchFailedPaymentFlow:l,failedPaymentFlowEnabled:c}=(0,k.ET)({subscription:a,workspace:o,autoLaunch:!1});if(!a||!s)return null;let d=(0,T.K)(),{name:u,dontChurnMessage:h}=d[s],{status:p,expirationTime:m,id:x}=a,g=(0,S.p6)(m,"MMMM do, yyyy"),f=(null==a?void 0:null===(e=a.createdByUser)||void 0===e?void 0:e.id)===(null==r?void 0:r.id),v=(0,N._8)(),b=m>Date.now();if(!("unpaid"===p||"past_due"===p)&&!b)return null;let _=v&&(f||!(null==a?void 0:a.createdByUser))?(0,i.jsx)(j.cC,{id:"velw1T",values:{expirationFormatted:g,GAMMA_PROPER_NOUN:C.N6,productName:u},components:{0:(0,i.jsx)(y.r,{href:v,isExternal:!0,textDecoration:"underline"})}}):(0,i.jsx)(j.cC,{id:"9aBOfk",values:{expirationFormatted:g,GAMMA_PROPER_NOUN:C.N6,productName:u,0:null===(t=a.createdByUser)||void 0===t?void 0:t.displayName,1:null===(n=a.createdByUser)||void 0===n?void 0:n.email},components:{0:(0,i.jsx)("b",{}),1:(0,i.jsx)("b",{})}});return(0,i.jsx)(M,{definition:{key:"payment-overdue-".concat(x),header:(0,i.jsx)(j.cC,{id:"gosJne",values:{productName:u}}),text:(0,i.jsxs)(i.Fragment,{children:[h," ",_]}),buttonText:(0,i.jsx)(j.cC,{id:"WLvqZR"}),buttonLink:c?void 0:v,buttonOnClick:c?l:void 0}})},key:"payment-overdue-butterbar"},{Component:()=>{let{subscription:e,openUpsellModal:t}=(0,A.z)();if(!e)return null;let{status:n,expirationTime:r,id:o}=e,a=new Date>(0,w.Z)(r)&&new Date<(0,_.Z)((0,w.Z)(r),{days:10});if(!a)return null;let s=()=>t({segmentEvent:I.AA.GAMMA_PRO_UPSELL_SUBSCRIPTION_EXPIRED_BUTTERBAR}),l=(0,i.jsx)(y.r,{onClick:s,isExternal:!0,textDecoration:"underline",children:(0,i.jsx)(j.cC,{id:"mj68q/"})});return(0,i.jsx)(M,{definition:{key:"subscription-expired-".concat(o),header:(0,i.jsx)(j.cC,{id:"5nhH6A"}),text:(0,i.jsxs)(i.Fragment,{children:["unpaid"===n||"past_due"===n?(0,i.jsx)(j.cC,{id:"QdgXJv"}):""," ",l]}),buttonText:(0,i.jsx)(j.cC,{id:"kwkhPe"}),buttonOnClick:s}})},key:"subscription-expired-butterbar"},{Component:()=>{var e,t,n;let{user:r}=(0,E.SE)(),{subscription:o,product:a}=(0,A.z)();if(!o||!a)return null;let{status:s,expirationTime:l,id:c,cancellationRequestedTime:d}=o,u="canceled"!=s&&d&&new Date<(0,w.Z)(l)&&new Date>(0,_.Z)((0,w.Z)(l),{days:-7});if(!u)return null;let h=(null==o?void 0:null===(e=o.createdByUser)||void 0===e?void 0:e.id)===(null==r?void 0:r.id),p=(0,N._8)(),m=(0,S.p6)(l,"MMMM do, yyyy"),x=(0,T.K)(),{name:g,dontChurnMessage:f}=x[a],v=!h&&(null==o?void 0:o.createdByUser)?(0,i.jsx)(j.cC,{id:"z4DeyC",values:{expirationFormatted:m,GAMMA_PROPER_NOUN:C.N6,productName:g,0:null===(t=o.createdByUser)||void 0===t?void 0:t.displayName,1:null===(n=o.createdByUser)||void 0===n?void 0:n.email},components:{0:(0,i.jsx)("b",{}),1:(0,i.jsx)("b",{})}}):(0,i.jsx)(j.cC,{id:"qP91+f",values:{expirationFormatted:m,GAMMA_PROPER_NOUN:C.N6,productName:g},components:{0:(0,i.jsx)(y.r,{href:p,isExternal:!0,textDecoration:"underline"})}});return(0,i.jsx)(M,{definition:{key:"subscription-ending-soon-".concat(c),header:(0,i.jsx)(j.cC,{id:"THJAvC",values:{productName:g}}),text:(0,i.jsxs)(i.Fragment,{children:[f," ",v]}),buttonText:(0,i.jsx)(j.cC,{id:"3jHA5d"}),buttonLink:p}})},key:"upcoming-cancellation-butterbar"},{key:"tablet-browser-warning",header:(0,i.jsx)(j.cC,{id:"JAtlMu",values:{GAMMA_PROPER_NOUN:C.N6}}),text:(0,i.jsx)(j.cC,{id:"9JlCFS",values:{GAMMA_PROPER_NOUN:C.N6}}),conditions:()=>(0,h.dA)(),dismissKey:P.H.lastDismissedPreferredBrowserMessage},{key:"desktop-browser-warning",header:(0,i.jsx)(j.cC,{id:"3S0+Wy",values:{GAMMA_PROPER_NOUN:C.N6}}),text:(0,i.jsx)(j.cC,{id:"Tf7VpJ"}),conditions:()=>G()&&(0,h.ds)(),dismissKey:P.H.lastDismissedPreferredBrowserMessage}],G=()=>(0,h.jP)()||!(0,h.i7)()&&!(0,h.G6)()&&!(0,h.NA)(),O=e=>{let{isViewOnly:t}=e,n=(0,m.gF)();if(t||!n||(0,h.l6)()||p.cx||(0,g.wg)())return null;let o=R.map(e=>"Component"in e?(0,i.jsx)(e.Component,{},e.key):(0,i.jsx)(M,{definition:e},e.key));return(0,i.jsx)(r.k,{"data-testid":"butterbar",direction:"column",top:0,pos:"relative",zIndex:"banner",sx:{"> *:not(:first-child)":{display:"none"}},children:o})},M=e=>{let{definition:t}=e,{key:n,dismissKey:h="butterbar-dismiss-".concat(n),header:p,text:m,buttonText:g,buttonLink:j,buttonOnClick:v=j?()=>window.open(j,"_blank"):void 0,conditions:b,ttl:C}=t,[y,_]=(0,x.I)(h,!1);return((0,u.useEffect)(()=>
1{if(!(C&&y))return;let e=new Date().getTime(),t=new Date(y).getTime(),n=e-t>1e3*C;n&&f.W.removeItem(h)},[h,y,C]),b&&!b()||y)?null:(0,i.jsxs)(r.k,{direction:"row",bg:"indigo.500",color:"white",py:3,px:4,align:"center",fontSize:"sm",children:[(0,i.jsxs)(o.g,{flex:"1",align:"start",spacing:0,children:[(0,i.jsx)(a.x,{fontWeight:"bold",children:p}),(0,i.jsx)(a.x,{opacity:"0.7",fontSize:"xs",children:m})]}),g&&v&&(0,i.jsx)(s.z,{variant:"plain",size:"sm",mr:4,rightIcon:j?(0,i.jsx)(d.G,{icon:c.wlW}):void 0,onClick:v,children:g}),(0,i.jsx)(l.P,{onClick:()=>{_(String(new Date))}})]})}},2013:function(e,t,n){"use strict";n.d(t,{q:function(){return y}});var i=n(52322),r=n(38035),o=n(77533),a=n(49259),s=n(87436),l=n(95897),c=n(28535),d=n(89511),u=n(11121),h=n(44438),p=n(42822),m=n(62614),x=n(75009),g=n(94523),f=n(5879),j=n(3543),v=n(92981);let b=(0,i.jsx)(f.cC,{id:"HiX9QN"}),C={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:t=b,showDisclosure:n=!1,opacity:y=1,starOverlay:_=!0,backgroundColor:w=g.qZ.colors.trueblue[900],...k}=e,S=_?C:{};return(0,i.jsx)(r.k,{"data-error-component":!0,w:"100vw",h:"100vh",overflow:"hidden",zIndex:99999,backgroundColor:(0,j.tT)(w,y),...k,children:(0,i.jsx)(r.k,{...S,justifyContent:"center",alignItems:"center",flex:1,p:[4,16],left:"50%",top:"50%",children:(0,i.jsxs)(v.qX,{lede:"",title:(0,i.jsx)(f.cC,{id:"HbR60U"}),stackProps:{shadow:"lg-dark",position:"relative"},children:[(0,i.jsx)(o.x,{children:(0,i.jsx)(f.cC,{id:"1gm+lP"})}),n&&(0,i.jsx)(a.U,{allowToggle:!0,pt:4,children:(0,i.jsxs)(s.Q,{children:[(0,i.jsxs)(l.K,{px:0,_hover:{bgColor:"none"},borderStyle:"none",children:[(0,i.jsx)(c.xu,{flex:"1",textAlign:"left",children:(0,i.jsx)(f.cC,{id:"qug3k/"})}),(0,i.jsx)(d.X,{})]}),(0,i.jsx)(u.H,{pb:4,children:(0,i.jsx)(h.E,{colorScheme:"red",children:t})})]})}),(0,i.jsx)(p.M,{children:(0,i.jsx)(m.z,{variant:"solid",size:"lg",m:6,onClick:()=>{window.location.reload()},children:(0,i.jsx)(f.cC,{id:"C6f2hU"})})}),(0,i.jsx)(x.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}})]})})})}},4661:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var i=n(52322),r=n(38035),o=n(60510);let a=e=>{let{children:t,withFooter:n,isViewOnly:a}=e;return(0,i.jsxs)(r.k,{direction:"column",width:"100%",height:"100%",minHeight:"var(--100vh)",bgColor:"gray.100",color:"gray.800",children:[(0,i.jsx)(o.r,{isViewOnly:a}),(0,i.jsx)(r.k,{zIndex:"1",id:"main",flex:"1",justifyContent:"center",alignItems:"center",direction:"column",position:"relative",children:t}),n&&(0,i.jsxs)(r.k,{fontSize:"12px",color:"gray.400",pb:8,id:"footer",justifyContent:"center",children:["\xa9 ",new Date().getFullYear()," Gamma Tech, Inc."]})]})};function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withFooter:!1,isViewOnly:!1},{withFooter:n,isViewOnly:r}=t,o=t=>(0,i.jsx)(a,{withFooter:n,isViewOnly:r,children:(0,i.jsx)(e,{...t})});return"getInitialProps"in e&&(o.getInitialProps=e.getInitialProps),o}},79254:function(e,t,n){"use strict";n.d(t,{$C:function(){return h},H6:function(){return u},Uj:function(){return p}});var i=n(52322),r=n(5632),o=n(45847),a=n.n(o),s=n(14274),l=n(93441),c=n(34385);let d=["/signin","/signup","/invitations/workspaces/[workspaceId]"],u=()=>{let e=(0,r.useRouter)().pathname;return!(0,l.gF)()||d.includes(e)?null:(0,i.jsx)("style",{children:".grecaptcha-badge { visibility: hidden; }"})},h=()=>(0,i.jsx)(a(),{src:"https://www.google.com/recaptcha/enterprise.js?render=".concat(s.v.RECAPTCHA_SCORING_KEY),async:!0,defer:!0}),p=async e=>(await (0,c.X)(50,100)(()=>!!window.grecaptcha).catch(()=>{throw Error("Timed out waiting for grecaptcha")}),new Promise((t,n)=>{grecaptcha.enterprise.ready(async()=>{try{let n=await grecaptcha.enterprise.execute(s.v.RECAPTCHA_SCORING_KEY,{action:e});t(n)}catch(e){console.log(e),n(e)}})}))},90980:function(e,t,n){"use strict";n.d(t,{H:function(){return u}});var i=n(52322),r=n(29117),o=n(19376),a=n(77533),s=n(54933),l=n(49929),c=n(94523),d=n(5879);let u=e=>{let{charCount:t,max:n,shouldShow:u,units:h,...p}=e,m=t>n?(0,i.jsx)(d.cC,{id:"YEfcBv"}):(0,i.jsx)(d.cC,{id:"ZSr/Fa"});return(0,i.jsx)(c.kH,{label:u?m:"",placement:"top",children:(0,i.jsxs)(r.U,{p:1,px:2,borderRadius:"md",display:"inline-flex",bg:t>n?"red.200":t>=.9*n?"orange.200":"transparent",color:t>n?"red.700":t>=.9*n?"orange.700":"gray.600",fontSize:"sm",cursor:"help",zIndex:1,opacity:u?1:0,transitionProperty:"common",transitionDuration:"normal",borderWidth:"1px",borderColor:t>n?"red.300":t>=.9*n?"orange.300":"transparent",...p,children:[t>n?(0,i.jsx)(l.G,{icon:s.ik8}):(0,i.jsx)(o.D,{value:t/n*100,color:"blackAlpha.700",trackColor:"blackAlpha.200",thickness:"12px",size:4}),(0,i.jsxs)(a.x,{children:[t,"/",n,h?" ".concat(h):""]})]})})}},24551:function(e,t,n){"use strict";n.d(t,{C:function(){return w},O:function(){return k}});var i=n(52322),r=n(38035),o=n(17993),a=n(62614),s=n(67109),l=n(42946),c=n(49929),d=n(5879),u=n(55388),h=n(2689),p=n.n(h),m=n(2784),x=n(91994),g=n(62040),f=n(90507),j=n(28858),v=n(46741),b=n(76282),C=n(74720),y=n(14874);let _={...j.I,...C.R,...v.dE},w="ai-card-editor",k=(0,m.memo)(e=>{let{...t}=e,n=(0,x.CG)(b.$X),s=(0,u.jE)({...t,extensions:y.XL});s&&(s.editorId=w);let h=(0,x.CG)(b.g8),j=(0,x.CG)(b.CC);(0,m.useEffect)(()=>{s&&s.setEditable(!n)},[n,s]);let v=(0,m.useCallback)(()=>
1{null==s||s.chain().insertContentAt(null==s?void 0:s.state.doc.content.size,{type:"card",content:[{type:"paragraph"}]}).selectInsertedNode().run()},[s]);return(0,g.n)(s),(0,i.jsxs)(r.k,{flex:"1",direction:"column",sx:_,p:{base:2,md:3},children:[(0,i.jsx)(f.kg,{editor:s,style:{wordBreak:"break-word",display:"flex",flexDirection:"column"}}),n&&(0,i.jsx)(o.g,{children:p()(h-j).map(e=>(0,i.jsx)(S,{},e))}),!n&&(0,i.jsx)(a.z,{boxShadow:"none",leftIcon:(0,i.jsx)(c.G,{icon:l.r8p,fixedWidth:!0}),onClick:v,children:(0,i.jsx)(d.cC,{id:"sFY+gw"})})]})});k.displayName="AICardEditor";let S=()=>(0,i.jsx)(s.O,{height:14,width:"100%",borderRadius:"md"})},93546:function(e,t,n){"use strict";n.d(t,{e:function(){return U}});var i=n(52322),r=n(17993),o=n(28535),a=n(38035),s=n(29117),l=n(75768),c=n(37417),d=n(62614),u=n(77533),h=n(5740),p=n(36474),m=n(43297),x=n(97143),g=n(42946),f=n(49929),j=n(94523),v=n(5879),b=n(2784),C=n(90980),y=n(45760),_=n(91994),w=n(86581),k=n(7208),S=n(74153),I=n(1071),E=n(76282),A=n(75258),T=n(24551),N=n(55388),P=n(62040),R=n(90507),G=n(46741),O=n(74720),M=n(14874);let z={...O.R,...G.dE},L=(0,b.memo)(e=>{let{...t}=e,n=(0,N.jE)({...t,extensions:M.uJ});return(0,P.n)(n),(0,i.jsx)(a.k,{flex:"1",direction:"column",sx:z,children:(0,i.jsx)(R.kg,{editor:n,style:{wordBreak:"break-word",flex:1,display:"flex",flexDirection:"column"}})})});L.displayName="AIFreeformEditor";let U=(0,b.memo)(e=>{let{showAddBreaks:t,showTopbar:n=!1,hideFooter:m=!1,containerProps:x,onEditorUpdate:N,showContentTip:P,onAddClick:R,isAdding:G}=e,O=(0,_.CG)(E.Vn),z=(0,_.CG)(E.$X),{setEditorInstance:U}=(0,y.vZ)(),F=(0,S.ex)({debounce:500}),H=(0,_.qr)(),[W]=(0,S.Ns)("editorMode"),K=(0,b.useRef)(!1),B=(0,b.useCallback)(e=>{let t,{editor:n,transaction:i}=e;if(K.current&&i.docChanged){if(null==N||N({editor:n}),"structured"===W){let e=[];n.state.doc.forEach(t=>{let n=(0,w.MF)(t);e.push(n)}),t=e.join("\n\n---\n\n")}else t=(0,w.MF)(n.state.doc);F({content:t})}},[N,F,W]),q=(0,_.CG)(E.mO),V=(0,b.useCallback)(e=>{let{editor:t}=e;U(t);let n=(0,E.au)(H.getState()),i=(0,w.c8)(n),r=(0,M.dW)(i,W).content.toJSON();t.commands.setContent(r),K.current=!0},[U,H,W]),{isAddingBreaks:Y,canAddBreaks:J,canRemoveBreaks:X,removeSectionBreaks:Z,addSectionBreaks:Q}=(0,k.N)(),$="structured"===W,ee=(0,_.CG)(E.au),et=0===ee.length,en=(0,_.CG)(E.CC),{maxTokens:ei}=(0,I.ml)();return(0,i.jsxs)(r.g,{borderRadius:"md",spacing:3,align:"start",opacity:O?.75:1,pointerEvents:O?"none":"inherit",cursor:O?"not-allowed":void 0,h:"100%",children:[P&&(0,i.jsxs)(o.xu,{fontSize:"sm",pos:"relative",w:"100%",children:[(0,i.jsx)(v.cC,{id:"4b3oEV"})," ",(0,i.jsx)(j.Yq,{label:(0,i.jsx)(v.cC,{id:"tztPjl"})})]}),(0,i.jsxs)(a.k,{flex:"1",w:"100%",bg:"white",borderRadius:"lg",boxShadow:"sm",direction:"column",children:[n&&(0,i.jsxs)(s.U,{position:"relative",py:2,px:4,borderBottom:"1px",borderColor:"var(--chakra-colors-chakra-border-color)",justifyContent:"center",children:[(0,i.jsx)(A.x,{}),t&&(0,i.jsx)(l.h,{position:"absolute",top:"2",right:"2",size:"sm",children:J&&(0,i.jsx)(c.M,{in:!0,initialScale:.6,children:(0,i.jsx)(j.kH,{label:(0,i.jsx)(v.cC,{id:"SuUA6H"}),placement:"top",children:(0,i.jsx)(d.z,{boxShadow:"none",isLoading:Y,leftIcon:(0,i.jsx)(f.G,{icon:g.EQg,fixedWidth:!0}),onClick:()=>Q(ee),children:(0,i.jsx)(u.x,{display:{base:"none",sm:"block"},children:(0,i.jsx)(v.cC,{id:"I6SWEy"})})})})})})]}),(0,i.jsxs)(a.k,{fontSize:"sm",direction:"column",flex:"1",pos:"relative",sx:{".ProseMirror":{padding:"freeform"===W?6:0,fontSize:"16px"}},...x,children:["freeform"===W?(0,i.jsx)(L,{onUpdate:B,onCreate:V}):(0,i.jsx)(T.O,{onUpdate:B,onCreate:V}),et&&!z&&"freeform"===W&&(0,i.jsx)(o.xu,{pos:"absolute",top:6,left:6,pointerEvents:"none",color:"gray.500",fontSize:"md",children:(0,i.jsx)(v.cC,{id:"xafDnF"})})]}),!m&&(0,i.jsxs)(s.U,{fontSize:"sm",px:4,py:3,alignItems:"center",color:"gray.500",children:[$?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.k,{flex:"1",children:(0,i.jsx)(u.x,{children:(0,i.jsx)(v.cC,{id:"Psk6LY",values:{cardCount:en}})})}),(0,i.jsx)(a.k,{flex:"2",justifyContent:"center",display:{base:"none",md:"flex"},children:(0,i.jsx)(u.x,{children:(0,i.jsx)(v.cC,{id:"c3ugvF",components:{0:(0,i.jsx)(h.T,{})}})})}),(0,i.jsx)(a.k,{flex:"1",justifyContent:"flex-end",children:(0,i.jsx)(C.H,{charCount:q,max:ei,shouldShow:!0,bg:"white",borderColor:"white",fontFamily:"mono"})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.L,{flex:"1"}),(0,i.jsx)(a.k,{flex:"2",justifyContent:"center",children:(0,i.jsx)(D,{})}),(0,i.jsx)(a.k,{flex:"1",justifyContent:"flex-end",children:(0,i.jsx)(C.H,{charCount:q,max:ei,shouldShow:!0,bg:"white",borderColor:"white",fontFamily:"mono"})})]}),R&&(0,i.jsx)(d.z,{variant:"solid",size:"sm",onClick:R,isLoading:G,leftIcon:(0,i.jsx)(f.G,{icon:g.JyM}),children:(0,i.jsx)(v.cC,{id:"sFY+gw"})})]})]})]})});U.displayName="AIGeneratorContent";let D=(0,b.memo)(()=>(0,i.jsx)(j.kH,{placement:"top",bg:"gray.900",label:(0,i.jsxs)(m.K,{spacing:1,fontFamily:"mono",children:[(0,i.jsx)(u.x,{children:"# Heading 1"}),(0,i.jsx)(u.x,{children:"## Heading 1"}),(0,i.jsx)(u.x,{children:"### Heading 3"}),(0,i.jsx)(u.x,{children:"- Item 1"}),(0,i.jsx)(u.x,{children:"- Item 2"}),(0,i.jsx)(u.x,{children:"- Item 3"}
1),(0,i.jsx)(u.x,{children:"--- Divider"})]}),children:(0,i.jsxs)(u.x,{cursor:"help",children:[(0,i.jsx)(u.x,{as:"span",color:"gray.400",mr:1,children:(0,i.jsx)(f.G,{icon:x.cCZ})}),(0,i.jsx)(v.cC,{id:"u6Hp4N"})]})}));D.displayName="MarkdownTip"},74720:function(e,t,n){"use strict";n.d(t,{R:function(){return r}});var i=n(40212);let r={".ProseMirror":{flex:1,...i.U},".block":{my:"0.75rem",":first-child":{mt:"0px !important"},":last-child":{mb:"0px !important"}},".block-heading":{fontWeight:"bold",lineHeight:"1.25",_first:{mt:0}},h1:{fontSize:"1.5em"},h2:{fontSize:"1.25em"},h3:{fontSize:"1.125em"},"a[href]":{color:"var(--chakra-colors-trueblue-600)",textDecoration:"underline"}}},14874:function(e,t,n){"use strict";n.d(t,{XL:function(){return ej},uJ:function(){return ef},dW:function(){return ev}});var i=n(72338),r=n(86900),o=n(42626),a=n(74902),s=n(36518),l=n(71391),c=n(86509),d=n(9432),u=n(70675),h=n(38438),p=n(39615),m=n(39475),x=n(77381),g=n(6085),f=n(3402),j=n(17487),v=n(72762),b=n(73528),C=n(99173),y=n(41889),_=n(13653),w=n(59799),k=n(90507),S=n(47577),I=n(52322),E=n(28535);let A=e=>{let{selected:t}=e;return(0,I.jsx)(k.T5,{children:(0,I.jsx)(E.xu,{pos:"relative",draggable:"true","data-drag-handle":!0,cursor:"grab",contentEditable:"false",position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",height:"1.25rem",color:t?"trueblue.400":"gray.400",lineHeight:"1rem",fontWeight:"800",children:"---"})})},T=/^(---|___|—-)/,N=i.NB.create({name:"sectionBreak",group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML:()=>[{tag:"hr"}],renderHTML(e){let{HTMLAttributes:t}=e;return["hr",(0,i.P1)(t)]},addNodeView:()=>(0,k.fW)(A),addInputRules(){return[(0,S.ok)({find:T,type:this.type})]}});var P=n(60491),R=n(90062),G=n(91073),O=n(27191),M=n(52780);let z=new O.Sy({props:{decorations:e=>{let{doc:t}=e,n=[],i=1;return t.descendants((e,t)=>{"card"===e.type.name&&(n.push(M.p.node(t,t+e.nodeSize,{},{number:i,isSectionCardPluginDecoration:!0})),i++)}),0==n.length?M.EH.empty:M.EH.create(t,n)}}}),L=e=>{let t=e.find(e=>e.spec.isSectionCardPluginDecoration);return t?t.spec:{number:0,isSectionCardPluginDecoration:!0}};var U=n(29117),D=n(77533),F=n(38035),H=n(32899),W=n(10625),K=n(67046),B=n(332),q=n(99058),V=n(25481),Y=n(27599),J=n(42946),X=n(49929),Z=n(94523),Q=n(5879),$=n(87254),ee=n(2784),et=n(5026),en=n(76282),ei=n(91994),er=n(90221),eo=n(3543);let ea={r:235,g:248,b:255},es={r:255,g:245,b:255},el={r:107,g:70,b:193},ec={r:43,g:108,b:176},ed=(e,t,n,i)=>i?{bg:"gray.100",text:"gray.600"}:{bg:(0,eo.Py)(ea,es,e/Math.min(n,t)),text:(0,eo.Py)(ec,el,e/Math.min(n,t))},eu=e=>{let{decorations:t,editor:n,getPos:i}=e,{number:r}=L(t),o=(0,ei.CG)(en.CC),{maxCards:a,canUpgrade:s}=(0,et.hw)(),l=r>a,c=r===o,d=ed(r,o,a,l),u=(0,ee.useCallback)(()=>{let e=i(),t=n.view.state.doc.nodeAt(e);if(!t){console.error("[SectionCardView] Cannot append card. Node unknown");return}let r=e+t.nodeSize;n.chain().insertContentAt(r,{type:"card",content:[{type:"paragraph"}]}).focus().selectInsertedNode().run()},[n,i]),h=(0,ee.useCallback)(()=>{n.commands.selectNodeAtPos(i())},[n,i]),p=(0,ee.useCallback)(()=>{let e=i(),t=n.view.state.doc.nodeAt(e);if(!t){console.error("[SectionCardView] Cannot delete card. Node unknown");return}n.chain().deleteRange({from:e,to:e+t.nodeSize}).selectInsideNodeAtPos(e).focus().run()},[n,i]),m=(0,ee.useCallback)(()=>{let e=i(),t=n.view.state.doc.nodeAt(e);if(!t){console.error("[SectionCardView] Cannot focus card. Node unknown");return}n.chain().selectInsideNodeAtPos(e).focus().run()},[n,i]),x=(0,_.Od)(t);return(0,I.jsxs)(k.T5,{role:"group",children:[(0,I.jsxs)(U.U,{className:"card",border:"1px solid",borderColor:x?"var(--chakra-ring-color)":"blackAlpha.100",shadow:"sm",_hover:{shadow:"md"},transitionProperty:"box-shadow",transitionDuration:"normal",bg:"white",borderRadius:"md",spacing:0,align:"stretch","data-selection-ring":!0,pos:"relative",my:3,mt:1===r?0:void 0,role:"group",children:[!(0,er.s2)()&&(0,I.jsx)(E.xu,{position:"absolute",color:d.text,zIndex:"1",top:"3.5",left:"0",pointerEvents:"none",opacity:"0",_groupHover:{opacity:.75},children:(0,I.jsx)(X.G,{icon:J.Okg,fixedWidth:!0})}),l&&(0,I.jsx)(E.Cd,{size:"6px",position:"absolute",zIndex:"2",top:"1.5",left:"1.5",bg:"sunglow.400"}),(0,I.jsx)(Z.kH,{label:l&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(D.x,{children:[(0,I.jsx)(Q.cC,{id:"rayOuP"})," "]}),(0,I.jsx)(D.x,{color:"gray.400",children:s?(0,I.jsx)(Q.cC,{id:"W8sobv",values:{MAX_CARDS_PRO:et.Fv}}):(0,I.jsx)(Q.cC,{id:"yLG7qf"})})]}),placement:"top",children:(0,I.jsx)(F.k,{dir:"column",align:"start",justify:"center",pr:1,pl:2,py:{base:3.5,md:4},w:12,cursor:l?"help":"grab","data-drag-handle":!0,contentEditable:!1,onClick:h,fontSize:r>=100?"xs":"sm",fontFamily:"mono",fontWeight:"600",borderLeftRadius:"inherit",userSelect:"none",transitionProperty:"filter",transitionDuration:"normal",_hover:{filter:"brightness(0.95)"},bg:d.bg,color:d.text,children:r})}),(0,I.jsx)(E.xu,{p:{base:3,md:4},flex:1,color:l?"gray.600":void 0,position:"relative",children:(0,I.jsx)(k.ms,{})}),(0,I.jsx)(ep,{addCard:u,focusCard:m,deleteCard:p})]}),!(0,er.s2)()&&!c&&(0,I.jsx)(eh,{addCard:u})]})},eh=(0,ee.memo)(e=>{let{addCard:t}=e;return(0,I.jsxs)(F.k,{w:"100%",h:1,borderRadius:"md",bg:"trueblue.200",transitionProperty:"opacity",transitionDuration:"slow",opacity:0,_hover:{opacity:1},_focusWithin:{opacity:1},contentEditable:!1,my:1,dir:"column",align:"center",justify:"center",pos:"absolute",transform:"translateY(-0.75rem)",zIndex:1,children:[(0,I.jsx)(E.xu,{pos:"absolute",top:-2,bottom:-2,left:0,right:0}
1),(0,I.jsx)(Z.kH,{placement:"top",label:$.ag._({id:"sFY+gw"}),shortcut:"---",children:(0,I.jsx)(H.h,{pos:"absolute",variant:"solid",icon:(0,I.jsx)(X.G,{icon:J.r8p}),"aria-label":"Add card",isRound:!0,size:"xs",onClick:t,tabIndex:-1})})]})});eh.displayName="CardDivider";let ep=(0,ee.memo)(e=>{let{addCard:t,deleteCard:n,focusCard:i}=e;return(0,I.jsx)(U.U,{pr:{base:2,md:2.5},pt:{base:2,md:3},alignSelf:"start",children:(0,er.s2)()?(0,I.jsx)(W.v,{children:e=>{let{onClose:r}=e;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(K.j,{onClick:i,as:H.h,colorScheme:"gray",variant:"ghost",size:"sm",icon:(0,I.jsx)(X.G,{icon:J.S6C,fixedWidth:!0})}),(0,I.jsx)(B.h,{children:(0,I.jsxs)(q.q,{zIndex:"tooltip",children:[(0,I.jsx)(V.s,{onClick:()=>{r(),t()},icon:(0,I.jsx)(X.G,{icon:J.L26,fixedWidth:!0}),children:(0,I.jsx)(Q.cC,{id:"90n2YU"})}),(0,I.jsx)(Y.R,{}),(0,I.jsx)(V.s,{onClick:()=>{n(),r()},color:"red",icon:(0,I.jsx)(X.G,{icon:J.Vui,fixedWidth:!0}),children:(0,I.jsx)(Q.cC,{id:"nabda1"})})]})})]})}}):(0,I.jsx)(Z.kH,{label:(0,I.jsx)(Q.cC,{id:"nabda1"}),placement:"top",children:(0,I.jsx)(H.h,{colorScheme:"gray",variant:"ghost",opacity:"0",_groupHover:{opacity:1},_focus:{opacity:1},transitionProperty:"opacity",transitionDuration:"slow",size:"sm",onClick:n,"aria-label":$.ag._({id:"nabda1"}),icon:(0,I.jsx)(X.G,{icon:J.Vui,fixedWidth:!0})})})})});ep.displayName="CardActions";let em=/^(---|___|—-)$/,ex=i.NB.create({name:"card",content:"block+",selectable:!0,draggable:!0,isolating:!0,parseHTML:()=>[{tag:"section"}],renderHTML(e){let{HTMLAttributes:t}=e;return["section",(0,i.P1)(t),0]},addNodeView:()=>(0,k.fW)(eu),addProseMirrorPlugins:()=>[z],addInputRules:()=>[new i.VK({find:em,handler:e=>{let{state:t,range:n}=e,{tr:i}=t;(0,P.X)({tr:i.deleteRange(n.from,n.to),dispatch:!0})}})],addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.mergeCardsOnDelete(!1),Delete:()=>this.editor.commands.mergeCardsOnDelete(!0),Tab:()=>this.editor.commands.selectNextCard(!0),"Shift-Tab":()=>this.editor.commands.selectNextCard(!1)}},addCommands:()=>({selectNextCard:e=>t=>{let{state:n,dispatch:r,commands:o}=t;if(!r)return!0;let{selection:a}=n,s=(0,i.Kk)(G.KH)(a);if(!s||!a.empty)return!1;let l=n.doc.resolve(s.pos),c=l.index();if(e){if(c===l.parent.childCount-1)return!1;o.selectInsideNodeAtPos(s.pos+s.node.nodeSize)}else{if(0===c)return!1;let e=l.posAtIndex(c-1);o.selectInsideNodeAtPos(e)}return!0},mergeCardsOnDelete:e=>t=>{let{tr:n,state:r,dispatch:o}=t;if(!o)return!0;let{selection:a}=r,s=(0,i.Kk)(G.KH)(a);if(!s||!a.empty)return!1;try{let t=(0,R.pt)(a,e);if(!t)return!1;return e?(0,R.Yh)(s.pos,n,r):(0,R.Gq)(s.pos,n)}catch(e){return console.debug("[CardCommands] mergeCardsOnDelete failed",e),!1}}})}),eg=[c.A,x.l,y.d,h.n,p.x,j.Hy,l.X,r.d8,m.v,d.Tx,u.Z.configure({openOnClick:!1}),b.aV,v.g,C.k,w.U,g.m,s.f,a.m.configure({color:"var(--chakra-colors-trueblue-200)",width:3,class:"ProseMirror-dropcursor"}),_.Jn],ef=[...eg,N,o.B.extend({content:"block+"})],ej=[...eg,ex,o.B.extend({content:"card+"})],ev=(e,t)=>{let n=(0,i.J1)("freeform"===t?ef:ej);return"structured"===t&&(e=e.split("<hr>").map(e=>"<section>".concat(e,"</section>")).join("\n")),(0,f.T)(e,n)}},23082:function(e,t,n){"use strict";n.d(t,{m:function(){return ej}});var i=n(52322),r=n(42946),o=n(5879),a=n(97729),s=n.n(a),l=n(5632),c=n(2784),d=n(51874),u=n(704),h=n(45760),p=n(76282),m=n(18153),x=n(91994),g=n(44754),f=n(74153),j=n(87651),v=n(43297),b=n(74409),C=n(17190),y=n(43305),_=n(75816),w=n(4123),k=n(28535),S=n(17993),I=n(93546),E=n(42822),A=n(62614),T=n(49929),N=n(33872),P=n(62141),R=n(47821);let G=(0,c.memo)(()=>{let e=(0,x.CG)(p.RB),t=(0,R.Ao)(),{goToScreen:n}=(0,u.R)(),a=(0,c.useCallback)(()=>{n("promptEditor",{generateId:e})},[e,n]);return(0,i.jsxs)(v.K,{w:"100%",position:"relative",spacing:2,children:[(0,i.jsx)(b.X,{size:"sm",fontWeight:"regular",color:"gray.800",children:(0,i.jsx)(o.cC,{id:"Tz0i8g"})}),(0,i.jsx)(k.xu,{p:"4",pb:6,border:"none",bg:"white",borderRadius:"md",boxShadow:"sm",children:(0,i.jsxs)(v.K,{spacing:4,children:[(0,i.jsx)(P.B,{}),t&&(0,i.jsx)(N.$3,{}),(0,i.jsx)(N.p3,{})]})}),e&&(0,i.jsx)(E.M,{children:(0,i.jsx)(A.z,{mt:2,size:"sm",colorScheme:"gray",variant:"link",onClick:a,rightIcon:(0,i.jsx)(T.G,{icon:r.gr5}),children:(0,i.jsx)(o.cC,{id:"02C6JB"})})})]})});G.displayName="SimpleAIGeneratorSettings";let O=(0,c.memo)(()=>{let e=(0,x.CG)(p.RB);return(0,i.jsx)(k.xu,{w:"100%",children:(0,i.jsx)(j.U,{in:"existing"==(e?"existing":"new"),children:(0,i.jsxs)(S.g,{w:"100%",spacing:4,children:[(0,i.jsxs)(v.K,{w:"100%",position:"relative",spacing:2,children:[(0,i.jsx)(b.X,{size:"sm",fontWeight:"regular",color:"gray.800",children:(0,i.jsx)(o.cC,{id:"dD7NPy"})}),(0,i.jsx)(I.e,{containerProps:{minH:{base:"30vh",lg:"30vh"},overflow:"auto",w:"100%"},showContentTip:!1})]}),(0,i.jsx)(G,{})]})})})});O.displayName="OutlineEditor";var M=n(70065),z=n(29117),L=n(74105),U=n(85573),D=n(92768),F=n(32899),H=n(75768),W=n(38035),K=n(74008),B=n(77533),q=n(20437),V=n(54933),Y=n(94523),J=n(87254),X=n(46152),Z=n.n(X);let Q=()=>
1({deck:[{prompt:J.ag._({id:"qlwKtq"}),icon:V._C7,type:"fun"},{prompt:J.ag._({id:"P4NNIM"}),icon:V.xEp,type:"fun"},{prompt:J.ag._({id:"lxdJmZ"}),icon:V.SvR,type:"fun"},{prompt:J.ag._({id:"M7U1p2"}),icon:V.nkk,type:"fun"},{prompt:J.ag._({id:"J6sCsQ"}),icon:V.Poi,type:"fun"},{prompt:J.ag._({id:"I2RSm2"}),icon:V.dyi,type:"work"},{prompt:J.ag._({id:"eIHwsO"}),type:"fun",icon:V.dER},{prompt:J.ag._({id:"2GuYO+"}),icon:V.FcG,type:"work"},{prompt:J.ag._({id:"XZUS53"}),type:"fun",icon:V.QmK},{prompt:J.ag._({id:"nn97aN"}),type:"fun",icon:V.Fli},{prompt:J.ag._({id:"NOzvim"}),type:"work",icon:V.wWp},{prompt:J.ag._({id:"QASHwu"}),type:"work",icon:V.SoD},{prompt:J.ag._({id:"t/ny5a"}),type:"fun",icon:V.FVb},{prompt:J.ag._({id:"4pkbqe"}),type:"fun",icon:V.ytF},{prompt:J.ag._({id:"raFuzm"}),type:"fun",icon:V.xTf},{prompt:J.ag._({id:"HPvhIn"}),type:"work",icon:V.Stf},{prompt:J.ag._({id:"sXxsO8"}),type:"fun",icon:V.Elv},{prompt:J.ag._({id:"oRQ3AS"}),type:"fun",icon:V.io7},{prompt:J.ag._({id:"5mHzsl"}),type:"work",icon:V.IOb}],webpage:[{prompt:J.ag._({id:"o8jXBg"}),icon:V.V3X,type:"work"},{prompt:J.ag._({id:"0hgAA3"}),icon:V.J9Y,type:"work"},{prompt:J.ag._({id:"h+l7+s"}),icon:V.wKO,type:"work"},{prompt:J.ag._({id:"AItsa8"}),icon:V.d19,type:"fun"},{prompt:J.ag._({id:"XrkZJq"}),type:"work",icon:V._jT},{prompt:J.ag._({id:"gElU4S"}),type:"work",icon:V.fGT},{prompt:J.ag._({id:"MfwlJs"}),type:"fun",icon:V.RcT},{prompt:J.ag._({id:"dQYE0e"}),type:"work",icon:V.Zr4}],document:[{prompt:J.ag._({id:"CoQWsB"}),icon:V.uqx,type:"work"},{prompt:J.ag._({id:"P3ZE6a"}),type:"work",icon:V.GTN},{prompt:J.ag._({id:"9HiZDb"}),type:"work",icon:V.cYw},{prompt:J.ag._({id:"Jqvt0L"}),type:"work",icon:V.mNe},{prompt:J.ag._({id:"pdW8CP"}),type:"work",icon:V.Wx7},{prompt:J.ag._({id:"3cKebJ"}),type:"fun",icon:V.thV},{prompt:J.ag._({id:"meKpPw"}),type:"work",icon:V.tq6},{prompt:J.ag._({id:"ZQpymk"}),icon:V.N6K,type:"work"},{prompt:J.ag._({id:"etsxle"}),type:"work",icon:V.lhK},{prompt:J.ag._({id:"you5yT"}),icon:V.RRR,type:"fun"},{prompt:J.ag._({id:"4yv77g"}),icon:V.S$C,type:"fun"},{prompt:J.ag._({id:"bT0M+P"}),type:"fun",icon:V.LBu},{prompt:J.ag._({id:"ww+l5h"}),type:"fun",icon:V.vWT}]});var $=n(22902),ee=n(63304),et=n(93202),en=n(42111),ei=n(21733);let er=()=>{let[e]=(0,et.JBp)(),t=(0,c.useCallback)(async t=>{var n;let{prompt:i,format:r,locale:o,editorMode:a}=t,s=await e({variables:{input:{workspaceId:(0,ei.n_)(),generationType:et.FJd.Generate,input:{format:r,prompt:i,settings:{...ee.zJ,imageProvider:en.VH.get("aiGeneratorDefaultImageProvider"),locale:o,editorMode:a}}}}});return null===(n=s.data)||void 0===n?void 0:n.createDocGeneration},[e]);return t};var eo=n(5026),ea=n(50634),es=n(48525),el=n(45302),ec=n(36651),ed=n(50896);let eu=e=>e.replace(/^- /gm,"").split("\n").join("\n\n---\n\n"),eh=(0,c.memo)(()=>{let e=(0,M.p)(),t=(0,x.TL)(),{onDocGenerationLoaded:n,webpageOnly:a}=(0,u.R)(),s=er(),l=(0,c.useRef)(null),[d,m]=(0,c.useState)(!1),g=(0,x.CG)(p.RB),y=g?"existing":"new",{canUpgrade:_}=(0,eo.hw)(),[w,S]=(0,f.Q_)(),I=(0,c.useRef)(w),[E,N]=(0,f.Ns)("locale"),P=(0,x.CG)(p.g8),R=(0,x.CG)(p.$X),G=(0,el.jw)(E),O=(0,f.vS)(),{getEditorInstance:J}=(0,h.vZ)(),[X,et]=(0,c.useState)(a?"webpage":"deck"),{generate:en}=(0,ea.j)("GenerateOutlineSimple",{onStart(){t((0,p.tX)(!0)),O("",!1)},onContent(e){let t=eu(e);O(t,!1)},onComplete(e){var n;O(eu(e),!0),null===(n=J())||void 0===n||n.commands.focus("start"),t((0,p.tX)(!1))},timeout:3e4}),ei=(0,c.useCallback)(async()=>{let t=(0,ec.n_)();if(t)try{let{promise:e}=en({variables:{topic:w,numBullets:P||ee.Qk,format:X,language:G.englishName||"English"},workspaceId:t});await e}catch(t){console.error("[PromptAndOutlineSettings] error generating outline: ".concat(t.message)),e({status:"error",title:(0,i.jsx)(o.cC,{id:"RVmL+P"}),description:(0,i.jsx)(o.cC,{id:"fuwKpE"}),duration:5e3,isClosable:!0,position:"top"})}finally{(0,p.tX)(!1)}},[en,G.englishName,P,w,X,e]),eh=(0,c.useCallback)(async()=>{R||(ei(),m(!1))},[R,ei]),ex=(0,c.useCallback)(async()=>{if(!R){try{let r=await s({prompt:w,format:X,locale:E,editorMode:"structured"});if(!r){e({title:(0,i.jsx)(o.cC,{id:"SlfejT"}),description:(0,i.jsx)(o.cC,{id:"J/Ajhz"}),status:"error",duration:5e3,isClosable:!0}),console.error("[PromptAndOutlingSettings]: No docGeneration found. This is unexpected.");return}t((0,p.Gn)(r)),null==n||n(r.id),ei()}catch(e){console.error("[PromptAndOutlineSettings]: Error creating doc generation: ".concat(e.message))}m(!1)}},[s,t,R,E,ei,n,w,X,e]),eg=(0,c.useMemo)(()=>Q(),[]),ef=(0,c.useCallback)(e=>{var t,n;if("Enter"===e.key){if(e.preventDefault(),R)return;g?eh():ex(),m(!1),null==l||null===(t=l.current)||void 0===t||t.blur()}"Escape"===e.key&&d&&(m(!1),null===(n=l.current)||void 0===n||n.blur())},[g,R,ex,eh,d]),ej=(0,c.useCallback)(()=>{eb(Z()(eg[X]))},[eg,X]),[ev,eb]=(0,c.useState)(Z()(eg[X]));return(0,i.jsxs)(k.xu,{w:"100%",mt:{base:"2",md:"4"},children:[!1===a&&(0,i.jsx)(j.U,{in:"new"===y,children:(0,i.jsx)(C.W,{maxW:"sm",px:0,children:(0,i.jsx)($.FQ,{hideCheckbox:!0,setSelectedFormat:e=>{et(e),eb(Z()(eg[e]))},selectedFormat:X})})}),(0,i.jsx)(v.K,{spacing:{base:2,md:4},w:"100%",children:(0,i.jsxs)(k.xu,{w:"100%",textAlign:"center",children:[(0,i.jsxs)(v.K,{direction:{base:"column",sm:"row"},alignItems:{base:"flex-start",sm:"center"},justifyContent:"space-between",mb:"2",children:["existing"===y&&(0,i.jsx)(b.X,{size:"sm",fontWeight:"regular",color:"gray.800",textAlign:"left",children:(0,i.jsx)(o.cC,{id:"W9uQXX"})}),(0,i.jsxs)(z.U,{maxW:"100%",overflowX:"hidden",children:[_?(0,i.jsx)(ed.J,{cardCount:P,onChange:e=>{t((0,p.Go)(Number(e)))},maxCards:eo.ix}):(0,i.jsx)(ed.Y,{onIncrement:()=>{P!==eo.Fv&&t((0,p.O_)())},onDecrement:()=>{t((0,p.Jr)())},maxCards:eo.Fv,cardCount:P,size:"sm"}),(0,i.jsx)(es.k,{locale:G,setLocale:N,buttonProps:{variant:"plain",size:"sm",textAlign:"left"}})]})]}),(0,i.jsxs)(L.B,{mb:"5",bg:"white",boxShadow:w?"sm":"lg",border:"none",borderRadius:"md",display:"flex",alignItems:"center",gap:"0",children:[(0,i.jsx)(U.I,{color:"gray.800",fontWeight:"500",borderColor:"transparent",fontSize:{base:"md",md:"lg"},height:{base:"14",md:"16"}
1,placeholder:em(),value:w,ref:l,onKeyDown:ef,onChange:e=>{S(e.target.value)},maxLength:140,_focus:{boxShadow:"var(--chakra-shadows-lg), var(--chakra-shadows-outline)"},onFocus:()=>{I.current=w,m(!0)},onBlur:()=>{m(!1)}}),"existing"===y&&!d&&(0,i.jsx)(D.xW,{h:"100%",border:"none",bg:"none",p:{base:2,md:3},children:(0,i.jsx)(Y.kH,{label:(0,i.jsx)(o.cC,{id:"2b2I/9"}),placement:"top",children:(0,i.jsx)(F.h,{variant:"ghost",bg:"gray.50",color:"trueblue.400","aria-label":"Regenerate outline",isLoading:R,icon:(0,i.jsx)(T.G,{fixedWidth:!0,icon:V.SbL}),onClick:eh})})})]}),(0,i.jsx)(j.U,{in:!R&&"existing"===y&&d,children:(0,i.jsx)(v.K,{onFocusCapture:()=>{m(!0)},children:(0,i.jsxs)(H.h,{mx:"auto",size:"md",mb:"4",children:[(0,i.jsx)(A.z,{variant:"plain",onClick:()=>{m(!1),S(I.current)},children:(0,i.jsx)(o.cC,{id:"dEgA5A"})}),(0,i.jsx)(A.z,{variant:"solid",onClick:eh,children:(0,i.jsx)(o.cC,{id:"4tE6l+"})})]})})}),(0,i.jsx)(j.U,{in:!!("new"===y&&w),children:(0,i.jsx)(W.k,{w:"100%",justifyContent:"center",children:(0,i.jsx)(A.z,{isDisabled:!w||R,size:"lg",minW:{base:"100%",md:"16em"},onClick:ex,variant:"solid",rightIcon:(0,i.jsx)(T.G,{icon:V.eFW}),children:(0,i.jsx)(o.cC,{id:"4tE6l+"})})})})]})}),(0,i.jsx)(j.U,{in:"new"===y&&!w,children:(0,i.jsxs)(v.K,{width:"100%",spacing:4,children:[(0,i.jsxs)(z.U,{w:"100%",spacing:"3",alignItems:"center",h:"10",children:[(0,i.jsx)(K.i,{borderColor:"blackAlpha.400"}),(0,i.jsx)(B.x,{flexShrink:"0",color:"gray.600",children:(0,i.jsx)(o.cC,{id:"MxB2DA"})}),(0,i.jsx)(K.i,{borderColor:"blackAlpha.400"})]}),(0,i.jsx)(q.M,{columns:{base:1,md:3},spacing:{base:2,md:3},children:ev.slice(0,3).map((e,t)=>(0,i.jsx)(ep,{starterPrompt:e,setPrompt:S},t))}),(0,i.jsx)(W.k,{justify:"center",w:"100%",children:(0,i.jsx)(A.z,{variant:"plain",size:{base:"sm",md:"md"},leftIcon:(0,i.jsx)(T.G,{icon:r.a_u}),onClick:ej,children:(0,i.jsx)(o.cC,{id:"gH5Gbn"})})})]})})]})});eh.displayName="PromptAndOutlineSettings";let ep=e=>{let{setPrompt:t,starterPrompt:n}=e,o=(0,c.useCallback)(()=>{t("".concat(n.prompt))},[n,t]);return(0,i.jsxs)(v.K,{as:A.z,direction:"row",alignItems:"flex-start",whiteSpace:"normal",textAlign:"left",display:"inline-flex",boxShadow:"sm",variant:"unstyled",h:"auto",p:3,spacing:3,bg:"whiteAlpha.700",border:"2px solid",borderColor:"transparent",borderRadius:"md",cursor:"pointer",_hover:{borderColor:"purple.400"},onClick:o,role:"group",minH:{base:"44px",md:"16"},children:[(0,i.jsx)(B.x,{color:"purple.300",_groupHover:{color:"purple.500"},children:(0,i.jsx)(T.G,{icon:n.icon,fixedWidth:!0})}),(0,i.jsx)(B.x,{title:n.prompt,fontSize:"sm",color:"gray.800",fontWeight:"medium",noOfLines:{base:2,md:3},flex:"1",children:n.prompt}),(0,i.jsx)(B.x,{fontSize:"sm",color:"blackAlpha.400",_groupHover:{color:"purple.500"},children:(0,i.jsx)(T.G,{icon:r.r8p,fixedWidth:!0})})]})},em=()=>J.ag._({id:"BiLwIi"}),ex=(0,c.memo)(e=>{let{goToThemeStep:t}=e,{skipThemeStep:n}=(0,u.R)(),r=(0,x.CG)(p.RB);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.U,{in:"new"==(r?"existing":"new"),children:(0,i.jsx)(v.K,{alignContent:"center",pt:{base:"9",md:"8vh"},w:"100%",children:(0,i.jsxs)(v.K,{spacing:{base:2,md:4},mb:{base:5,md:8},w:"100%",children:[(0,i.jsx)(b.X,{textAlign:"center",color:"gray.800",fontWeight:"600",fontFamily:"p22-mackinac-pro",w:"100%",size:{base:"xl",md:"2xl"},children:(0,i.jsx)(o.cC,{id:"ziAjHi"})}),(0,i.jsx)(b.X,{size:{base:"sm",md:"md"},textAlign:"center",fontWeight:"500",color:"blackAlpha.700",children:(0,i.jsx)(o.cC,{id:"yMWCRe"})})]})})}),(0,i.jsxs)(C.W,{maxW:"3xl",width:"100%",pb:"150px",children:[(0,i.jsx)(eh,{}),(0,i.jsx)(O,{})]}),r&&(0,i.jsx)(w.U,{cta:n?(0,i.jsx)(_.j,{children:(0,i.jsx)(o.cC,{id:"ziAjHi"})}):(0,i.jsx)(y.O,{onClick:t})})]})});ex.displayName="OutlineStep";var eg=n(13734),ef=n(8484);let ej=(0,c.memo)(e=>{let{autosetLocale:t}=e,[n,a]=(0,c.useState)("outline"),{webpageOnly:j,skipThemeStep:v,onGenerateSuccess:b}=(0,u.R)(),{query:C}=(0,l.useRouter)(),y=C.ref,_=(0,x.CG)(p.RB);(0,m.j)({queryKey:"ref"});let w=(0,x.TL)(),k=(0,x.qr)(),[S,I]=(0,f.Ns)("locale");(0,c.useEffect)(()=>{t&&I((0,g.K)())},[w,I,k]),(0,c.useEffect)(()=>()=>{w((0,p.mc)())},[]);let E=(0,c.useCallback)(()=>{a("outline")},[]),A=(0,c.useCallback)(()=>{v||a("theme")},[v]),T="new"==(_?"existing":"new")||"theme"===n?void 0:(0,i.jsx)(o.cC,{id:"ziAjHi"}),N=(0,c.useMemo)(()=>{let e;let t=("dashboard"===y||"sites-dashboard"==y)&&"outline"===n,a=t?(0,i.jsx)(o.cC,{id:"i0qMbr"}):(0,i.jsx)(o.cC,{id:"iH8pgl"}),s=t?r.J9Y:r.acZ,l={};return"theme"===n&&(l={position:"absolute"},e=E),{navLabel:a,navIcon:s,onClick:e,options:{ref:y},styleProps:l}},[E,y,n]);return(0,i.jsx)(h.jX,{children:(0,i.jsxs)(d.v4,{children:[(0,i.jsx)(s(),{children:(0,i.jsx)("title",{children:(0,i.jsx)(o.cC,{id:"EixifW"})})}),(0,i.jsx)(ef.D,{...N,pageTitle:T}),"outline"===n?(0,i.jsx)(ex,{goToThemeStep:A}):(0,i.jsx)(eg.O,{})]})})});ej.displayName="CreateGeneratePage"},22902:function(e,t,n){"use strict";n.d(t,{FQ:function(){return j},_J:function(){return g},qe:function(){return f}});var i=n(52322),r=n(43297),o=n(62614),a=n(28535),s=n(77533),l=n(82655),c=n(42946),d=n(54933),u=n(49929),h=n(94523),p=n(87254),m=n(2784),x=n(90221);let g={deck:{label:()=>p.ag._({id:"FOoDGS"}),selectedIcon:d.s2,icon:l.s2,description:()=>p.ag._({id:"EPYCou"})},document:{label:()=>p.ag._({id:"7Zdnlq"}),selectedIcon:d.OEL,icon:l.OEL,description:()=>p.ag._({id:"nM2WM0"})},webpage:{label:()=>p.ag._({id:"YVokw8"}),selectedIcon:d.tc$,icon:l.tc$,description:()=>p.ag._({id:"C90Qtf"})}},f=e=>{let{label:t,icon:n,description:l,selectedIcon:h,isSelected:p,onClick:m,hideCheckbox:g}=e,f="purple.500";return(0,i.jsxs)(r.K,{as:o.z,h:"auto",textShadow:"none",variant:"plain",p:{base:2.5,sm:3},minW:24,spacing:1,w:"100%",cursor:"pointer",textAlign:"center",transition:"all 300ms ease",border:"2px s
1olid",bg:p?"white":"whiteAlpha.800",borderRadius:"md",boxShadow:"sm",borderColor:p?f:"whiteAlpha.400",color:p?"trueblue.700":"gray.800",onClick:m,_hover:(0,x.s2)()?{color:"gray.800"}:{bg:"trueblue.50",borderColor:"trueblue.400"},position:"relative",children:[!g&&(0,i.jsx)(a.xu,{fontSize:"md",position:"absolute",left:1.5,top:1.5,color:p?f:"gray.200",children:(0,i.jsx)(u.G,{icon:p?d.f8k:c.diR})}),(0,i.jsx)(a.xu,{fontSize:{base:"lg",sm:"xl"},color:p?"trueblue.600":"trueblue.300",children:(0,i.jsx)(u.G,{icon:p?h:n})}),(0,i.jsx)(s.x,{fontSize:"sm",fontWeight:"500",noOfLines:1,children:t}),l&&(0,i.jsx)(s.x,{mt:2,fontSize:"xs",fontWeight:"500",whiteSpace:"normal",children:l})]})},j=(0,m.memo)(e=>{let{setSelectedFormat:t,selectedFormat:n,hideCheckbox:o}=e;return(0,i.jsx)(r.K,{direction:"row",mb:4,w:"100%",justifyContent:"center",children:Object.entries(g).map(e=>{let[r,{label:s,icon:l,selectedIcon:c,description:d}]=e;return(0,i.jsx)(h.kH,{placement:"top",label:d(),children:(0,i.jsx)(a.xu,{flex:"1",children:(0,i.jsx)(f,{label:s(),icon:l,selectedIcon:c,hideCheckbox:o,onClick:()=>{t(r)},isSelected:r===n})})},r)})})});j.displayName="FormatPickerComponent"},21723:function(e,t,n){"use strict";n.d(t,{B:function(){return c}});var i=n(52322),r=n(38035),o=n(2784),a=n(71113),s=n(67496),l=n(51874);let c=(0,o.memo)(e=>{let{id:t,children:n}=e,{isLoading:o}=(0,s.HL)({id:t});return o?(0,i.jsx)(r.k,{...l.ZQ,w:"100%",h:"100%",flex:1,alignSelf:"center",children:(0,i.jsx)(a.AA,{})}):(0,i.jsx)(i.Fragment,{children:n})});c.displayName="LoadDocGenerationPage"},704:function(e,t,n){"use strict";n.d(t,{R:function(){return o},u:function(){return r}});var i=n(2784);let r=(0,i.createContext)({goToScreen:()=>{throw Error("goToScreen not available. Did you forget to wrap your component in RouterNavigationContext?")},goBack:()=>{throw Error("goBack not available. Did you forget to wrap your component in RouterNavigationContext?")},onDocGenerationLoaded:()=>{},navEnabled:!0,webpageOnly:!1,skipThemeStep:!1}),o=()=>(0,i.useContext)(r)},14581:function(e,t,n){"use strict";n.d(t,{$:function(){return l}});var i=n(52322),r=n(5632),o=n(2784),a=n(34881),s=n(704);function l(e){return(0,o.memo)(t=>{let{back:n,push:l,replace:c,query:d}=(0,r.useRouter)(),u="sites-dashboard"===d.ref,h=(0,o.useMemo)(()=>({goToScreen:(e,t)=>{let{generateId:n="",ref:i}=t||{},r=i?"?ref="+i:"";switch(e){case"createWithAI":l("/create"+r);break;case"createImport":l("/create/import"+r);break;case"createPaste":l("/create/paste"+r);break;case"createGenerate":l("/create/generate/"+n+r);break;case"legacyGuidedMode":l("/generate"+r);break;case"promptEditor":l("/generate/"+n+r);break;case"home":l("/");break;default:throw Error("invalid screen")}},goBack:e=>{let{ref:t}=e||{};"dashboard"===t?c("/"):n()},onDocGenerationLoaded:e=>{(0,a.lO)({pathname:"/create/generate/".concat(e),emitChange:!1})},navEnabled:!0,webpageOnly:u,skipThemeStep:!1}),[n,l,c,u]);return(0,i.jsx)(s.u.Provider,{value:h,children:(0,i.jsx)(e,{...t})})})}},13734:function(e,t,n){"use strict";n.d(t,{O:function(){return Q}});var i=n(52322),r=n(38035),o=n(2784),a=n(91994),s=n(14324),l=n(67613),c=n(46409),d=n(90221),u=n(93441),h=n(28535),p=n(17993),m=n(62614),x=n(28165),g=n(54933),f=n(49929),j=n(5879),v=n(41004),b=n(4742),C=n.n(b),y=n(9850),_=n.n(y),w=n(86113),k=n(27333),S=n(52394),I=n(83947),E=n(31709),A=n(32186),T=n(96933),N=n(87205),P=n(74153),R=n(75816),G=n(50260),O=n(22569);let M=e=>{let{theme:t}=e,n=t||G.mU,{isLoadingThemes:r}=(0,s.a)(),o=(0,O.R5)(n),a=(0,G.wj)(n),l=(0,O.wh)(o,a),c=r?{}:l;return(0,i.jsx)(h.xu,{...c,w:"100vw",h:"100%",position:"fixed",zIndex:-1,opacity:1,"data-theme-picker-background":!0,transitionProperty:"background-color, background-image",transitionDuration:"1s",inset:"0px"})}
1,z=(0,v.E)(h.xu),L=e=>{let{card:t,theme:n,...r}=e,a=(0,o.useMemo)(()=>{if(t)return(0,E.vL)({docFlags:{cardLayoutsEnabled:!0}},[t])},[t]);return(0,i.jsx)(z,{pointerEvents:"none",sx:{"*":{backdropFilter:"none !important",transitionProperty:"background-color, color, border-color, padding, margin, width, maxWidth, fontSize",transitionDuration:".15s",[".button .".concat(k.A8)]:{transitionProperty:"none"}},".doc-content-wrapper *[data-doc-background-element], .motion-present-mode-bg":{display:"none"},".card-wrapper,.card-body,.doc-content-wrapper":{padding:0,margin:0,minHeight:"auto"},"[data-card-body]":{"--card-color-transparent":"var(--card-color)","--card-width":"60rem"}},...r,children:a&&n&&(0,i.jsx)(A.m,{content:a,initialContent:a,theme:n})})},U=(e,t,n)=>{let i=0,r=e=>{var o;return null===(o=e.content)||void 0===o?void 0:o.map(e=>{var o,a,s,l,c,d,u;let h={...e,attrs:{...e.attrs}};if("image"===e.type){let e=t.shift();e&&(h.attrs.src=e.imageUrl,h.attrs.tempUrl=e.imageUrl)}if("cardAccentLayoutItem"===e.type&&(null===(s=e.attrs)||void 0===s?void 0:null===(a=s.background)||void 0===a?void 0:null===(o=a.image)||void 0===o?void 0:o.src)){let e=null==n?void 0:null===(u=n.config)||void 0===u?void 0:null===(d=u.accentBackgrounds)||void 0===d?void 0:d[i];e&&(i++,h.attrs.background=e)}if("smartLayoutCell"===e.type&&(null===(c=e.attrs)||void 0===c?void 0:null===(l=c.image)||void 0===l?void 0:l.src)==="custom"){let e=t.shift();e&&(h.attrs.image.src=e.imageUrl,h.attrs.image.tempUrl=e.imageUrl)}return e.content&&(h.content=r(h)),h})};return Object.assign({},e,{content:r(e)})},D=e=>{e&&requestAnimationFrame(()=>{var t;return null===(t=document.querySelector('[data-theme-id="'.concat(e,'"]')))||void 0===t?void 0:t.scrollIntoView({behavior:"smooth"})})},F=e=>{let{images:t}=e,n=(0,a.TL)(),s=(0,a.CG)(l.ez),c=(0,a.CG)(l.$b),[d,u]=(0,P.Ns)("themeId"),h=s.find(e=>d===e.id);(0,o.useEffect)(()=>{if(d||!(null==s?void 0:s.length))return;n((0,l.uG)({activeView:"standard"}));let e=C()(c);e&&(u(e.id),D(e.id))},[n,d,c,s,u]);let v=(0,o.useMemo)(()=>{let e=_()((0,w.s)()),n=U(e,_()(t),h);return n.content[0].content||[]},[h,t]),b=(0,o.useCallback)(()=>{if(!s)return;let e=C()(s);e&&(u(e.id),(null==e?void 0:e.workspaceId)?n((0,l.uG)({activeView:"custom"})):n((0,l.uG)({activeView:"standard"})),D(null==e?void 0:e.id))},[n,u,s]),y=(0,T.i)({base:0,"4xl":300})||0,k=(0,T.i)({base:600,xl:250,"4xl":0})||0,E=(0,T.i)({base:0,xl:1})||0,G=(0,T.i)({base:.5,lg:.6,xl:.7,"2xl":.85,"3xl":1,"4xl":1.125});return(0,o.useEffect)(function(){s&&0!==s.length&&Promise.all(s.map(e=>{var t,n,i,r,o,a,s,l,c,d;(null===(i=e.config.accentBackgrounds)||void 0===i?void 0:null===(n=i[0])||void 0===n?void 0:null===(t=n.image)||void 0===t?void 0:t.src)&&(0,N.GN)(null===(l=e.config.accentBackgrounds)||void 0===l?void 0:null===(s=l[0].image)||void 0===s?void 0:s.src),(null===(a=e.config.accentBackgrounds)||void 0===a?void 0:null===(o=a[1])||void 0===o?void 0:null===(r=o.image)||void 0===r?void 0:r.src)&&(0,N.GN)(null===(d=e.config.accentBackgrounds)||void 0===d?void 0:null===(c=d[1].image)||void 0===c?void 0:c.src)}))},[s]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(M,{theme:h}),(0,i.jsxs)(r.k,{zIndex:1,py:0,px:6,sx:A.n,"data-theme-desktop-root":!0,position:"relative",children:[(0,i.jsx)(x.xB,{styles:{html:{overflowX:"hidden",overflowY:"auto"}}}),(0,i.jsxs)(r.k,{direction:"column",pos:"relative",flex:1,h:"100%",transform:"scale(".concat(G,")"),justifyContent:"center",alignItems:"center",ml:[40,35,30,20,0],"data-id":"theme-picker-desktop-cards",children:[(0,i.jsx)(L,{pos:"absolute",theme:h,card:v[2],initial:{opacity:0}
1,animate:{opacity:1,translateX:0,transition:{opacity:{duration:.5,delay:0,ease:"easeOut"},default:{duration:2,ease:"easeOut"}}},zIndex:1}),(0,i.jsx)(L,{pos:"absolute",theme:h,card:v[0],initial:{translateX:0,opacity:0},animate:{translateX:y,translateY:k,rotate:-E,opacity:1,transition:{default:{duration:2,delay:.5,ease:"easeOut"}}}}),(0,i.jsx)(L,{pos:"absolute",theme:h,card:v[1],initial:{translateX:0,opacity:0},transformOrigin:"center",animate:{translateX:-y,translateY:-k,rotate:E,opacity:1,transition:{default:{duration:2,delay:.5,ease:"easeOut"}}}})]}),(0,i.jsxs)(r.k,{w:"420px",p:6,direction:"column",justifyContent:"center",bg:"whiteAlpha.900",borderRadius:"lg",h:"calc(100vh - var(--chakra-sizes-20))",minH:"700px",mb:4,shadow:"md",pos:"relative",position:"sticky",mt:6,children:[(0,i.jsx)(I.v,{title:(0,i.jsx)(j.cC,{id:"cQGp8b"}),description:(0,i.jsxs)(p.g,{w:"100%",align:"center",justify:"center",children:[(0,i.jsx)(R.j,{w:"100%",children:(0,i.jsx)(j.cC,{id:"ziAjHi"})}),(0,i.jsx)(m.z,{w:"100%",leftIcon:(0,i.jsx)(f.G,{icon:g.a_u,color:"var(--chakra-colors-trueblue-800)"}),size:"md",onClick:b,children:(0,i.jsx)(j.cC,{id:"B8w15Q"})})]}),stackProps:{pb:4},currentTheme:h}),(0,i.jsx)(S.t,{shouldScrollToCurrent:!0,currentTheme:h,setTheme:e=>{u(null==e?void 0:e.id)},flexProps:{overflowY:"auto",mx:-6,px:3}})]})]})]})};var H=n(43297),W=n(74409),K=n(77533),B=n(75768),q=n(29117),V=n(42946),Y=n(43997),J=n(8393),X=n(18438);let Z=()=>{let e=(0,o.useRef)(!1),t=(0,a.CG)(l.Y3),n=(0,a.CG)(l.$b),[s,c]=(0,P.Ns)("themeId",{debounce:500}),[d,u]=(0,o.useState)(()=>t.find(e=>e.id===s)),p=(0,Y.I0)(),g=(0,a.CG)(l.C0),v=(0,a.CG)(l.FM),b=d?(0,G.wj)(d):void 0;(0,o.useEffect)(()=>{if(s||!(null==n?void 0:n.length)||e.current)return;let t=C()(n);if(t){var i;p((0,l.uG)({activeView:"standard"})),u(t),null===(i=document.querySelector('[data-theme-mobile-preview="'.concat(t.id,'"]')))||void 0===i||i.scrollIntoView(),e.current=!0}},[p,n,s]),(0,o.useEffect)(()=>{var t;!e.current&&s&&d&&(d.workspaceId?p((0,l.uG)({activeView:"custom"})):p((0,l.uG)({activeView:"standard"})),null===(t=document.querySelector('[data-theme-mobile-preview="'.concat(d.id,'"]')))||void 0===t||t.scrollIntoView(),e.current=!0)},[p,d,s]);let y=(0,o.useCallback)(e=>{let{scrollLeft:n,scrollWidth:i,clientWidth:r}=e.target,o=Math.round(n/(i-r)*(t.length-1)),a=t[o];a.id!==(null==d?void 0:d.id)&&u(a)},[t,null==d?void 0:d.id,u]),_=(0,o.useCallback)(()=>{(null==d?void 0:d.id)&&c(d.id)},[null==d?void 0:d.id,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(M,{theme:d}),(0,i.jsxs)(H.K,{spacing:0,h:"100%",w:"100vw",children:[(0,i.jsx)(x.xB,{styles:{html:{height:"100%"},body:{height:"100%"}}}),(0,i.jsxs)(H.K,{spacing:0,mx:"auto",zIndex:1,px:6,pt:20,sx:A.n,w:"100%",children:[(0,i.jsxs)(H.K,{align:"center",spacing:1,children:[(0,i.jsx)(W.X,{letterSpacing:"-0.04em",fontWeight:"700",fontFamily:"p22-mackinac-pro",color:b?"#FFFFFF":"#0a1629",w:"100%",size:"2xl",transitionProperty:"common",transitionDuration:"normal",children:(0,i.jsx)(j.cC,{id:"cQGp8b"})}),(0,i.jsx)(K.x,{fontSize:"lg",color:b?"#FFFFFF":"#0a1629",letterSpacing:"-0.04em",transitionProperty:"common",transitionDuration:"normal",children:(0,i.jsx)(j.cC,{id:"950yV9"})})]}),g&&(0,i.jsxs)(B.h,{variant:"ghost",size:"sm",borderRadius:"full",w:"100%",pt:2,justifyContent:"center",children:[(0,i.jsx)(m.z,{borderRadius:"full",leftIcon:(0,i.jsx)(f.G,{icon:V.D0h,fixedWidth:!0}),"data-theme-picker-active-view-button":"custom",colorScheme:"custom"===v?"trueblue":"gray",bg:"custom"===v?"trueblue.100":"gray.100",onClick:()=>p((0,l.uG)({activeView:"custom"})),children:(0,i.jsx)(j.cC,{id:"8Tg/JR"})}),(0,i.jsx)(m.z,{borderRadius:"full",leftIcon:(0,i.jsx)(h.xu,{w:3.5,children:(0,i.jsx)(J.Y,{})}),"data-theme-picker-active-view-button":"standard",colorScheme:"standard"===v?"trueblue":"gray",bg:"standard"===v?"trueblue.100":"gray.100",onClick:()=>p((0,l.uG)({activeView:"standard"})),children:(0,i.jsx)(j.cC,{id:"TJBHlP"})})]})]}),(0,i.jsx)(r.k,{zIndex:1,pos:"relative",overflow:"auto",py:8,sx:{"scroll-snap-type":"x mandatory"},onScroll:y,children:(0,i.jsx)(q.U,{flex:1,spacing:6,px:12,pt:1,children:t.map(e=>(0,i.jsx)(X.L,{isSelected:e.id===(null==d?void 0:d.id),theme:e},e.id))})}),(0,i.jsx)(r.k,{px:6,py:4,mb:2,justify:"center",zIndex:9,w:"100%",children:(0,i.jsx)(R.j,{size:"lg",w:"100%",onClick:_,children:(0,i.jsx)(j.cC,{id:"ziAjHi"})})})]})]})},Q=(0,o.memo)(e=>{let{images:t=[]}=e;(0,s.a)();let n=(0,a.CG)(l.ez);return(0,u.gF)()&&(null==n?void 0:n.length)?(0,i.jsxs)(r.k,{direction:"column",justifyContent:"flex-start",flex:1,w:"100vw",h:"100%",children:[(0,i.jsx)(c.Y,{}),(0,d.s2)()?(0,i.jsx)(Z,{}):(0,i.jsx)(F,{images:t})]}):null});Q.displayName="ThemeStep"},8484:function(e,t,n){"use strict";n.d(t,{D:function(){return h}});var i=n(52322),r=n(29117),o=n(38035),a=n(62614),s=n(74409),l=n(42946),c=n(49929),d=n(5879),u=n(704);let h=e=>{let{navLabel:t=(0,i.jsx)(d.cC,{id:"iH8pgl"}),navIcon:n=l.acZ,onClick:h,options:p,pageTitle:m,pageIcon:x,rightItem:g,centerItem:f,styleProps:j}=e,{goBack:v,navEnabled:b}=(0,u.R)();return(0,i.jsxs)(r.U,{px:4,position:"relative",zIndex:"10",width:"100%",spacing:3,alignItems:"flex",...j,children:[(0,i.jsx)(o.k,{flex:"1",children:b&&(0,i.jsx)(a.z,{size:"sm",leftIcon:(0,i.jsx)(c.G,{icon:n,fixedWidth:!0}),variant:"plain",bg:"white",borderRadius:"md",boxShadow:"sm",border:"none",onClick:()=>{h?h():v(p)},children:t})}),(0,i.jsx)(o.k,{flex:"3",align:"center",justify:"center",children:f||(0,i.jsxs)(r.U,{justifyContent:"center",w:"100%",children:[x&&x,m&&(0,i.jsx)(s.X,{fontWeight:"600",fontSize:{base:"md",sm:"lg",md:"xl"},fontFamily:"p22-mackinac-pro",children:m})]})}),(0,i.jsx)(o.k,{flex:"1",justifyContent:"flex-end",alignItems:"center",children:g})]})}},75258:function(e,t,n){"use strict";n.d(t,{D:function(){return g},x:function(){return f}});var i=n(52322),r=n(75768),o=n(62614),a=n(42946),s=n(49929),l=n(94523),c=n(87254),d=n(2784),u=n(76282),h=n(91994),p=n(7208),m=n(74153),x=n(96933);let g={freeform:{label:()=>c.ag._({id:"Jn5DbR"}),icon:a.elf,description:()=>c.ag._({id:"f15rRF"}),tip:()=>c.ag._({id:"y8DgoV"})},structured:{label:()=>c.ag._({id:"2PPaNm"}),icon:a.s2,description:()=>c.ag._({id:"on9ayD"}),tip:()=>c.ag._({id:"G7ngQL"})}},f=(0,d.memo)(()=>{let[e,t]=(0,m.Ns)("editorMode"),n=(0,h.CG)(u.Vn),{onChangeMode:a}=(0,p.N)(),c=(0,x.i)({base:!1,sm:!0});return(0,i.jsx)(r.h,{isAttached:!0,isDisabled:n,children:Object.entries(g).map(n=>{let[r,{label:d,description:u,icon:h}]=n,p=r===e;return(0,i.jsx)(l.kH,{label:u(),placement:"top",children:(0,i.jsx)(o.z,{size:"sm",leftIcon:c?(0,i.jsx)(s.G,{icon:h,fixedWidth:!0}):void 0,variant:p?"plainSelected":"plain",onClick:()=>{t(r),a()},boxShadow:"none",children:d()})},r)})})});f.displayName="ModeSwitcher"},33872:function(e,t,n){"use strict";n.d(t,{$3:function(){return O},Td:function(){return R},p3:function(){return M}});var i=n(52322),r=n(17993),o=n(10625),a=n(67046),s=n(62614),l=n(75009),c=n(332),d=n(99058),u=n(25481),h=n(28535),p=n(82554),m=n(77533),x=n(35183),g=n(97166),f=n(29494),j=n(42946),v=n(54933),b=n(49929),C=n(5879),y=n(87254),_=n(2784),w=n(42111),k=n(99787),S=n(47821),I=n(9883),E=n(68728),A=n(61185),T=n(67964),N=n(74153),P=n(39092);let R=(0,_.memo)(()=>{let[e]=(0,N.Ns)("imageProvider"),t=A.s[e]||k.QT,[n]=(0,N.Ns)("imageLicense"),o=(0,E.E)(n),[a]=(0,N.Ns)("imageStyle",{debounce:500});return(0,i.jsx)(P.j,{label:(0,i.jsx)(C.cC,{id:"an5hVd"}),colorScheme:"trueblue",icon:v.VmB,values:[null==t?void 0:t.label(),"web"===e&&o,"aiGenerated"===e&&a],children:(0,i.jsxs)(r.g,{spacing:4,children:[(0,i.jsx)(O,{}),(0,i.jsx)(M,{})]})})});R.displayName="ImageSettingsGroup";let G=(0,_.memo)(e=>{let{provider:t,setProvider:n}=e,r=(0,S.Ao)();return(0,i.jsxs)(o.v,{children:[(0,i.jsx)(a.j,{as:s.z,variant:"plain",boxShadow:"sm",w:"100%",textAlign:"left",rightIcon:(0,i.jsx)(b.G,{icon:j.ptq}),leftIcon:t.image?(0,i.jsx)(l.E,{h:"1em",w:"1em",objectFit:"cover",src:t.image.src}):t.icon?(0,i.jsx)(b.G,{icon:t.icon,color:"var(--chakra-colors-trueblue-600)",fixedWidth:!0}):void 0,size:"sm",children:t.label()||(0,i.jsx)(C.cC,{id:"wdxz7K"})}),(0,i.jsx)(c.h,{children:(0,i.jsx)(d.q,{zIndex:"tooltip",maxH:"60vh",overflowY:"auto",children:Object.entries(A.s).map(e=>{let[t,{label:o,icon:a,image:s,badge:c,description:d}]=e;return"aiGenerated"!==t||r?(0,i.jsxs)(u.s,{icon:s?(0,i.jsx)(l.E,{display:"inline",mr:2,h:"1em",w:"1em",objectFit:"contain",src:s.src}):a?(0,i.jsx)(h.xu,{display:"inline",mr:2,color:"trueblue.600",children:(0,i.jsx)(b.G,{icon:a})}):void 0,onClick:()=>n(t),children:[o(),c&&(0,i.jsx)(p.C,{ml:2,colorScheme:"green",children:c()}),d&&(0,i.jsx)(m.x,{fontSize:"xs",color:"gray.500",children:d()})]},t):null})})})]})});G.displayName="ImageProviderPicker";let O=()=>{let[e,t]=(0,N.Ns)("imageProvider"),n=A.s[e]||k.QT;return(0,i.jsxs)(x.NI,{children:[(0,i.jsx)(g.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(C.cC,{id:"qA0pmh"})}),(0,i.jsx)(G,{provider:n,setProvider:t})]})},M=()=>{let[e]=(0,N.Ns)("imageProvider"),[t,n]=(0,N.Ns)("imageLicense"),[r,o]=(0,N.Ns)("imageStyle",{debounce:500}),a=(0,T.Y)("ai_premium_models"),s=(0,w.ye)("aiGeneratedImagesDefaultModel"),[l,c]=(0,N.Ns)("imageModel");return(0,i.jsxs)(i.Fragment,{children:["web"===e&&(0,i.jsxs)(x.NI,{children:[(0,i.jsx)(g.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(C.cC,{id:"6TSHCF"})}),(0,i.jsx)(E.A,{value:t,onChange:n})]}),"aiGenerated"===e&&(0,i.jsxs)(x.NI,{children:[(0,i.jsx)(g.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(C.cC,{id:"X2yiuT"})}),(0,i.jsx)(f.g,{value:r,onChange:e=>o(e.target.value),placeholder:y.ag._({id:"5x/foo"}),rows:2})]}),"aiGenerated"===e&&a&&(0,i.jsxs)(x.NI,{children:[(0,i.jsx)(g.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(C.cC,{id:"emv9SK"})}),(0,i.jsx)(I.q,{value:l||s,setValue:c})]})]})}},39092:function(e,t,n){"use strict";n.d(t,{i:function(){return b},j:function(){return v}});var i=n(52322),r=n(87436),o=n(95897),a=n(29117),s=n(28535),l=n(43297),c=n(77533),d=n(36474),u=n(89511),h=n(11121
1),p=n(67109),m=n(49929),x=n(2784),g=n(76282),f=n(91994);let j={_groupHover:{color:"purple.600"}},v=(0,x.memo)(e=>{let{icon:t,colorScheme:n="gray",label:x,values:v=[],children:b}=e,C=(0,f.CG)(g.RB);return(0,i.jsx)(r.Q,{border:"none",children:e=>{let{isExpanded:r}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.K,{_focus:{boxShadow:"none",outline:"none"},py:2,p:3,outline:"none",transitionProperty:"common",transitionDuration:"normal",bg:"transparent",_hover:{bg:"".concat(n,".50")},children:(0,i.jsxs)(a.U,{width:"100%",spacing:"3",align:"start",children:[(0,i.jsx)(s.xu,{...j,display:"inline",fontSize:"sm",color:"".concat(n,".300"),children:(0,i.jsx)(m.G,{icon:t,fixedWidth:!0})}),(0,i.jsxs)(l.K,{spacing:0,align:"start",textAlign:"left",children:[(0,i.jsx)(c.x,{...j,fontWeight:"700",children:x}),!r&&(0,i.jsx)(c.x,{fontSize:"sm",fontWeight:"500",noOfLines:2,...j,children:v.filter(Boolean).join(" \xb7 ")})]}),(0,i.jsx)(d.L,{}),(0,i.jsx)(u.X,{...j})]})}),(0,i.jsxs)(h.H,{p:4,pt:3,pb:6,children:[C&&b,!C&&(0,i.jsxs)(l.K,{spacing:4,pt:2,align:"start",children:[(0,i.jsx)(p.O,{w:"100%",height:"30px"}),(0,i.jsx)(p.O,{w:"100%",height:"30px"}),(0,i.jsx)(p.O,{w:"100%",height:"30px"})]})]})]})}})});v.displayName="SettingsGroup";let b=e=>{let{children:t}=e;return(0,i.jsx)(c.x,{fontSize:"sm",color:"gray.500",children:t})}},62141:function(e,t,n){"use strict";n.d(t,{B:function(){return N},o:function(){return I}});var i=n(52322),r=n(17993),o=n(35183),a=n(97166),s=n(75768),l=n(62614),c=n(43297),d=n(29494),u=n(87651),h=n(54933),p=n(49929),m=n(94523),x=n(5879),g=n(87254),f=n(2784),j=n(48525),v=n(45302),b=n(63304),C=n(74153),y=n(54012),_=n(39092),w=n(89099),k=n(16556);let S=(0,f.memo)(e=>{let{tagsList:t,onClick:n}=e;return(0,i.jsx)(w.E,{pb:"2",align:"flex-start",w:"100%",children:t.map(e=>(0,i.jsx)(w.U,{children:(0,i.jsx)(k.Vp,{cursor:"pointer",colorScheme:"purple",boxShadow:"sm",_hover:{color:"white",bg:"purple.600"},onClick:()=>{n(e.value)},children:e.label})},e.label))})});S.displayName="SettingsTags";let I=(0,f.memo)(()=>{var e;let[t]=(0,C.Ns)("locale"),n=(0,v.jw)(t),[o]=(0,C.Ns)("textAmount"),[a]=(0,C.Ns)("textMode"),s=null===(e=A.find(e=>e.key===a))||void 0===e?void 0:e.label();return(0,i.jsx)(_.j,{label:(0,i.jsx)(x.cC,{id:"OuNFIM"}),colorScheme:"blue",icon:h.elf,values:[s,"preserve"!==a&&(0,y.XL)(o).label,"generate"===a&&n.displayName],children:(0,i.jsxs)(r.g,{spacing:4,children:[(0,i.jsx)(E,{}),"preserve"!==a&&(0,i.jsx)(N,{}),"generate"===a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P,{}),(0,i.jsx)(G,{})]}),(0,i.jsx)(T,{})]})})});I.displayName="TextSettingsGroup";let E=()=>{let[e,t]=(0,C.Ns)("textMode");return(0,i.jsxs)(o.NI,{children:[(0,i.jsx)(a.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(x.cC,{id:"OuNFIM"})}),(0,i.jsx)(s.h,{size:"sm",isAttached:!0,width:"100%",children:A.map(n=>(0,i.jsx)(m.kH,{placement:"top",label:n.tip(),children:(0,i.jsx)(l.z,{variant:n.key===e?"plainSelected":"plain",boxShadow:"none",leftIcon:(0,i.jsx)(p.G,{icon:n.icon}),onClick:()=>t(n.key),width:"100%",children:n.label()})},n.label()))})]})},A=[{label:()=>g.ag._({id:"ziAjHi"}),key:"generate",icon:h.ddb,tip:()=>g.ag._({id:"8mt5hR"})},{label:()=>g.ag._({id:"NIvI2q"}),key:"condense",icon:h.G_A,tip:()=>g.ag._({id:"owZbal"})},{label:()=>g.ag._({id:"c0sF7y"}),key:"preserve",icon:h.byT,tip:()=>g.ag._({id:"RPSHJC"})}],T=()=>{let[e,t]=(0,C.Ns)("locale"),n=(0,v.jw)(e);return(0,i.jsxs)(o.NI,{children:[(0,i.jsx)(a.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(x.cC,{id:"f6Pzgf"})}),(0,i.jsx)(j.k,{locale:n,setLocale:t,buttonProps:{variant:"plain",size:"sm",width:"100%",textAlign:"left"}})]})},N=()=>{let[e,t]=(0,C.Ns)("textAmount"),[n]=(0,C.Ns)("textMode"),r=(0,f.useMemo)(()=>(0,b.kq)(),[]);return(0,i.jsxs)(o.NI,{children:[(0,i.jsx)(a.l,{fontSize:"sm",fontWeight:"semibold",children:"condense"===n?(0,i.jsx)(x.cC,{id:"z7tEVo"}):(0,i.jsx)(x.cC,{id:"UmJg9q"})}),(0,i.jsx)(s.h,{size:"sm",isAttached:!0,width:"100%",children:Object.entries(r).map(n=>{let[r,{label:o,description:a,icon:s}]=n;return(0,i.jsx)(m.kH,{placement:"top",label:a,children:(0,i.jsx)(l.z,{variant:e===r?"plainSelected":"plain",boxShadow:"none",onClick:()=>t(r),leftIcon:(0,i.jsx)(p.G,{icon:s}),width:"100%",textAlign:"left",children:o})},r)})})]})},P=()=>{let[e,t]=(0,C.Ns)("audience",{debounce:500}),n=(0,f.useMemo)(()=>R(),[]);return(0,i.jsxs)(o.NI,{children:[(0,i.jsx)(a.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(x.cC,{id:"CfNFS9"})}),(0,i.jsxs)(c.K,{spacing:3,children:[(0,i.jsx)(d.g,{size:"sm",minH:16,value:e,onCh
1ange:e=>t(e.target.value)}),(0,i.jsx)(u.U,{in:""===e||null===e,children:(0,i.jsx)(S,{tagsList:n,onClick:e=>{t(e)}})})]})]})},R=()=>[{label:g.ag._({id:"9N+p+g"}),value:g.ag._({id:"pCuan7"})},{label:g.ag._({id:"Y9OrUQ"}),value:g.ag._({id:"no1XFa"})},{label:g.ag._({id:"vINKFZ"}),value:g.ag._({id:"H13RWO"})},{label:g.ag._({id:"5AIqvu"}),value:g.ag._({id:"hqe36h"})},{label:g.ag._({id:"bNrMlq"}),value:g.ag._({id:"kImdWQ"})}],G=()=>{let[e,t]=(0,C.Ns)("tone",{debounce:500}),n=(0,f.useMemo)(()=>O(),[]);return(0,i.jsxs)(o.NI,{children:[(0,i.jsx)(a.l,{fontSize:"sm",fontWeight:"semibold",children:(0,i.jsx)(x.cC,{id:"uAQyzk"})}),(0,i.jsxs)(c.K,{spacing:"3",children:[(0,i.jsx)(d.g,{size:"sm",minH:16,value:e,onChange:e=>t(e.target.value)}),(0,i.jsx)(u.U,{in:""===e||null===e,children:(0,i.jsx)(S,{tagsList:n,onClick:e=>{t(e)}})})]})]})},O=()=>[{label:g.ag._({id:"Oojfbh"}),value:g.ag._({id:"L7fEtA"})},{label:g.ag._({id:"hzExWo"}),value:g.ag._({id:"F64cR2"})},{label:g.ag._({id:"wanXT9"}),value:"Precise and detailed writing suitable for technical documents, manuals, and guides. Emphasize accuracy and clarity"},{label:g.ag._({id:"ChasOQ"}),value:g.ag._({id:"lVYl+I"})},{label:g.ag._({id:"wTl0UK"}),value:g.ag._({id:"sFGQvg"})},{label:g.ag._({id:"4Nl9R0"}),value:g.ag._({id:"cspP/G"})}]},50896:function(e,t,n){"use strict";n.d(t,{J:function(){return S},Y:function(){return k}});var i=n(52322),r=n(75768),o=n(32899),a=n(62614),s=n(29117),l=n(77533),c=n(28535),d=n(10625),u=n(67046),h=n(332),p=n(99058),m=n(44035),x=n(39237),g=n(42946),f=n(49929),j=n(94523),v=n(5879),b=n(87254),C=n(2784),y=n(62131),_=n(81640),w=n(11050);let k=(0,C.memo)(e=>{let{onIncrement:t,onDecrement:n,maxCards:d,cardCount:u,...h}=e,p={boxShadow:"sm",bg:"white"};return(0,i.jsxs)(r.h,{isAttached:!0,flex:"1",...h,children:[null!=u&&(0,i.jsx)(o.h,{display:"flex",onClick:n,icon:(0,i.jsx)(f.G,{icon:g.Kl4}),"aria-label":b.ag._({id:"MrRUp2"}),width:2,...p}),(0,i.jsx)(a.z,{flex:"1",...p,_hover:{color:"inherit"},cursor:"default",children:(0,i.jsx)(j.kH,{label:(0,i.jsx)(v.cC,{id:"ukrE78"}),placement:"top",children:(0,i.jsx)(s.U,{spacing:1,cursor:"help",children:(0,i.jsxs)(l.x,{children:[(0,i.jsx)(c.xu,{as:"span",css:{fontVariantNumeric:"tabular-nums"},children:u})," ",(0,i.jsx)(v.cC,{id:"MU+gFM",values:{0:null!=u?u:0}})]})})})}),null!=u&&(0,i.jsx)(o.h,{display:"flex",onClick:t,icon:(0,i.jsx)(f.G,{icon:g.r8p}),"aria-label":b.ag._({id:"sFY+gw"}),width:2,isDisabled:u>=d,...p})]})});k.displayName="CardCountStepper";let S=(0,C.memo)(e=>{let{cardCount:t,maxCards:n,onChange:r}=e,{openUpsellModal:o}=(0,_.z)(),c=(0,C.useMemo)(()=>[...Array(n)],[n]),j=(0,C.useMemo)(()=>["15","20","25"],[]),b=()=>{o({segmentEvent:w.AA.GAMMA_UPSELL_CALLOUT_AI_GENERATE_LONGER})};return(0,i.jsxs)(d.v,{children:[(0,i.jsx)(u.j,{size:"sm",boxShadow:"none",minW:"32",textAlign:"left",as:a.z,rightIcon:(0,i.jsx)(f.G,{size:"xs",icon:g.ptq}),children:(0,i.jsx)(v.cC,{id:"fFAIng",values:{0:null!=t?t:0}})}),(0,i.jsx)(h.h,{children:(0,i.jsx)(p.q,{zIndex:"tooltip",children:(0,i.jsxs)(m._,{onChange:e=>{let t=Number(e);if(t>10){b();return}r(t)},value:"".concat(t),children:[c.map((e,t)=>{let n=t+1;return(0,i.jsx)(x.i,{value:"".concat(n),children:(0,i.jsx)(v.cC,{id:"bM4Wv5",values:{count:n}})},n)}),j.map(e=>{let t=Number(e);return(0,i.jsx)(x.i,{bg:"trueblue.50",border:"1px solid white",_hover:{bg:"trueblue.50",borderColor:"trueblue.200"},value:"".concat(t),children:(0,i.jsxs)(s.U,{spacing:"3",children:[(0,i.jsx)(l.x,{w:"100%",children:(0,i.jsx)(v.cC,{id:"bM4Wv5",values:{count:t}})}),(0,i.jsx)(y.ER,{product:"pro"})]})},t)})]})})})]})});S.displayName="CardCountDropdown"},43305:function(e,t,n){"use strict";n.d(t,{O:function(){return g}});var i=n(52322),r=n(62614),o=n(29117),a=n(54933),s=n(49929),l=n(94523),c=n(5879),d=n(2784),u=n(85420),h=n(97763),p=n(25566),m=n(74153);let x=()=>{let[e]=(0,m.Ns)("imageProvider");return"aiGenerated"===e?"generateV2WithImages":"generateV2"},g=(0,d.memo)(e=>{let{onClick:t}=e,n=x(),{hasEnoughCreditsToGenerateDeck:d}=(0,h.qO)(),m=(0,h.YO)(t,"generateV2",p.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_V2);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(l.kH,{label:(0,i.jsx)(c.cC,{id:"mTJ1YV"}),isDisabled:d,shouldWrapChildren:!0,children:(0,i.jsx)(r.z,{variant:"solid",w:"100%",rightIcon:(0,i.jsxs)(o.U,{children:[(0,i.jsx)(u.J,{type:n}),(0,i.jsx)(s.G,{icon:a.eFW})]}),onClick:m,size:{base:"md",lg:"lg"},children:(0,i.jsx)(c.cC,{id:"xGVfLh"})})})})});g.displayName="ContinueToThemePickerButton"},75816:function(e,t,n){"use strict";n.d(t,{j:function(){return W}});var i=n(52322),r=n(62614),o=n(54933),a=n(49929),s=n(94523),l=n(87254),c=n(2784),d=n(704),u=n(97763),h=n(11050),p=n(5632),m=n(39486),x=n(9449),g=n(22537),f=n(39122),j=n(93202),v=n(42111),b=n(67964),C=n(91994),y=n(84405),_=n(31181),w=n(1504
11),k=n(50260),S=n(14027),I=n(36651),E=n(45302),A=n(76282);let T=e=>{let t=(0,b.Y)("ai_premium_models"),n=(0,v.ye)("generatorGPT4"),i=(0,v.ye)("anthropicGenerate"),r=(0,v.ye)("mistralGenerate"),o=r?"mistralai/Mistral-7B-Instruct-v0.2":i?"claude-instant-1.2":"gpt-3.5-turbo-1106",a=r?"mistralai/Mixtral-8x7B-Instruct-v0.1":i?"claude-2.1":"gpt-4-1106-preview",s=(0,c.useCallback)(i=>{if(!t&&!n)return o;let r="generate"!==i.textMode&&!i.parallel,s=e>=800&&!i.parallel,l=i.numCards&&i.numCards>=12&&!i.parallel;return r||l||s?a:o},[t,n,e,o,a]);return s};var N=n(43019),P=n(50634),R=n(57124),G=n(78462),O=n(96796);let M=()=>{let{push:e}=(0,p.useRouter)(),[t]=(0,j.V$$)(),n=(0,v.ye)("createSiteAi"),i=(0,R._O)(),{generate:r}=(0,P.j)("DetermineSiteMetadata",{}),[o]=(0,j.gVY)(),[a]=(0,j.Iyu)(),[s]=(0,j.D1_)(),d=(0,c.useCallback)(async n=>{let{workspaceId:i,docId:c,themeId:d,generateVars:u,firstCards:h}=n,p=h[0]?(0,N.getCardTitle)(h[0].content):void 0,{data:m}=await t({variables:{input:{workspaceId:i,name:p||l.ag._({id:"h3eRam"}),routes:[{docId:c,path:"/"}],themeId:d}}}),x=null==m?void 0:m.createSite;if(!x){console.error("[CreateSiteModal] Failed to create site, no site returned"),e("/docs/".concat(c,"?source=").concat(f.VY));return}try{let e=h.map(e=>e.raw).join("\n"),{language:t,instructions:n,input:l}=u,{promise:d}=r({workspaceId:i,variables:{topic:n||"",input:l,language:t,pageHtml:e}}),p=await d,{title:m,subdomain:g}=(0,O.R)(p),f="string"==typeof g&&g.length<=60&&/^[a-z0-9-]+$/.test(g.toLowerCase()),j=[];f&&j.push(o({variables:{input:{siteId:x.id,name:g.toLowerCase()}}})),m&&j.push(...[a({variables:{input:{siteId:x.id,name:m}}}),s({variables:{id:c,title:m}})]),await Promise.all(j)}catch(e){console.error("(caught) useGenerateSite error: ".concat(e))}let g=(0,G.yQ)({docId:c,params:{source:f.VY}});e(g)},[t,e,r,o,a,s]);return{canCreateSite:n&&i,createSiteWithAIAndRedirect:d}};var z=n(5026),L=n(1071),U=n(56920),D=n(37164);let F=()=>{let{push:e}=(0,p.useRouter)(),[t]=(0,j.qbt)(),{generate:n}=(0,P.j)("DeterminePageMetadata",{}),[i]=(0,j.D1_)(),r=(0,c.useCallback)(async r=>{let{site:o,docId:a,workspaceId:s,generateVars:l,firstCards:c}=r;try{let{language:e,instructions:r,input:d}=l,u=o.routes.map(e=>{var t;return{title:null===(t=e.doc)||void 0===t?void 0:t.title,path:e.path}}),h=c.map(e=>e.raw).join("\n"),p=c[0]?(0,N.getCardTitle)(c[0].content):void 0,m=!0,{promise:x}=n({workspaceId:s,variables:{topic:r||"",input:d,language:e,otherPages:u,pageHtml:h}}),g=await x,{path:f,title:j}=(0,O.R)(g);j||(j=p||"Untitled page",m=!1),f||(f=(0,U.IR)(j)),o.routes.some(e=>e.path===f)&&(f="".concat(f,"-").concat((0,D.x0)(6))),await Promise.all([t({variables:{input:{siteId:o.id,docId:a,path:(0,w.fJ)(f),offline:!1}},refetchQueries:["GetSite"]}),i({variables:{id:a,title:j,titleEdited:m}})])}catch(e){console.error("(caught) useSetPageMetadataWithAI error: ".concat(e))}let d=(0,G.yQ)({docId:a,params:{source:f.VY}});e(d)},[n,e,t,i]);return{setPageMetadataWithAIAndRedirect:r}},H=e=>{let{onSuccess:t}=e,{push:n}=(0,p.useRouter)(),i=(0,C.qr)(),r=(0,C.CG)(_.lH),{canCreateSite:o,createSiteWithAIAndRedirect:a}=M(),{setPageMetadataWithAIAndRedirect:s}=F(),[d]=(0,j.Kb4)(),u=(0,v.ye)("generatorLazyImages"),[h,N]=(0,c.useState)(!1),P=(0,v.ye)("streamResumingEnabled"),R=(0,C.CG)(A.mO),G=!0,O="",{maxTokens:U}=(0,L.ml)(),{maxCards:D}=(0,z.hw)();R>U&&(G=!1,O=l.ag._({id:"ZcJO3k",values:{maxTokens:U}}));let H=T(R),W=(0,j.jLg)(j.vGj),K=(0,c.useCallback)(async()=>{var e;let l=i.getState(),c=(0,A.RB)(l),h=(0,A.U6)(l);if(!h)throw Error("Cannot generate with no docGenerateInputId");N(!0);let p=(0,I.n_)(),C=(0,A.au)(l),_=(0,A.lb)(l),T=(0,E.jw)((0,A.Mn)("locale")(l)),G=(0,A.Mn)("textAmount")(l),O=(0,A.Mn)("audience")(l),M=(0,A.Mn)("tone")(l),z=(0,A.Lh)(l),L=(0,A.CC)(l),U=(0,A.Mn)("imageLicense")(l),F=(0,A.Mn)("imageProvider")(l),K=(0,A.Mn)("imageModel")(l)||v.VH.get("aiGeneratedImagesDefaultModel"),B=(0,A.Mn)("imageStyle")(l),q=(0,A.Mn)("textMode")(l),V=(0,A.Mn)("editorMode")(l),Y=(0,A.PB)(l),J={instructions:_,input:C,language:T.englishName,numCards:Math.min(L,D),format:z,textAmou
1nt:G,audience:O,tone:M,textMode:q,editorMode:V,imageProvider:"aiGenerated"===F?"aiGenerated":"web"},X=(0,A.Mn)("themeId")(l),Z=X?(await W({id:X})).data.theme:void 0;"aiGenerated"===F&&!B&&Z&&(B=(0,k.A)(Z));let Q=o&&"webpage"===z,$=(0,w.Vr)(r)||Q,ee=await d({variables:{docGenerateInputId:h,options:{themeId:$?void 0:X||S.g.id,orgAccess:$?j.y3$.Manage:void 0}}}),et=null===(e=ee.data)||void 0===e?void 0:e.generateDoc,en=null==et?void 0:et.docGenerateInput.id;if(!en)throw Error("No docGenerateInput.id to use as interactionId");if(!et)throw Error("Could not create doc");let ei=v.VH.get("generateParallel"),er=ei&&"structured"===V&&(J.numCards>=10||R>=2e3)&&(v.VH.get("generateParallelFree")||(0,b.uL)("ai_premium_models")),eo=H({numCards:L,editorMode:V,textMode:q,parallel:er,textAmount:G}),ea={docFormatKey:z,imageOptions:{license:U,provider:F,generateStyle:B,model:K},lazyImages:"aiGenerated"===F||u,theme:Z},{input:es,instructions:el,...ec}=J;g.a.trackRequestSent(i,{interface:"wizard",streaming:!0,interactionId:en,inputContent:J.input,inputMessage:J.instructions,inputData:{options:ea,isGenerateV2:!0,isAdvancedMode:"generate"!==Y,isParallel:er,generationType:Y,...ec,textAmount:G,format:z,language:J.language,model:eo},docId:et.id,docGenerationId:c,docGenerateInputId:en});let{stream:ed,cancel:eu}=(0,x.ZE)({promptKey:er?"GenerateDeckParallel":"GenerateDeck",interactionId:en,variables:{...J,model:eo},workspaceId:p},{streamId:et.id,streamResumingEnabled:P,retries:3}),eh=await (0,m.m3)({stream:ed,onCancel:eu,interactionId:en,options:ea,bufferCards:1,store:i,docId:et.id}).promise;(0,y.Q)({doc_id:et.id,source:j.L17.AiGenerated,extra:"v2"}),!r&&Q?await a({workspaceId:p,docId:et.id,generateVars:J,themeId:X,firstCards:eh.cards}):r?(await s({docId:et.id,site:r,workspaceId:p,generateVars:J,firstCards:eh.cards}),null==t||t()):n("/docs/".concat(et.id,"?source=").concat(f.VY))},[o,H,a,s,d,W,u,D,t,n,r,i,P,R]);return{generate:K,isGenerating:h,canGenerate:G,cantGenerateReason:O}},W=(0,c.memo)(e=>{let{children:t,onClick:n,...p}=e,{onGenerateSuccess:m}=(0,d.R)(),{isGenerating:x,generate:g,canGenerate:f,cantGenerateReason:j}=H({onSuccess:m}),v=(0,c.useCallback)(async()=>{null==n||n(),await g()},[n,g]),b=(0,u.YO)(v,"generateV2",h.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_V2);return(0,i.jsx)(s.kH,{label:j,shouldWrapChildren:!0,children:(0,i.jsx)(r.z,{leftIcon:(0,i.jsx)(a.G,{icon:o.JyM}),variant:"solid",isLoading:x,loadingText:l.ag._({id:"NOdFZR"}),isDisabled:x,onClick:b,size:{base:"md",lg:"lg"},...p,children:t})})});W.displayName="GenerateButton"},4123:function(e,t,n){"use strict";n.d(t,{U:function(){return O}});var i=n(52322),r=n(43297),o=n(38035),a=n(29117),s=n(76282),l=n(14764),c=n(91994),d=n(25566),u=n(77533),h=n(94523),p=n(5879),m=n(2784),x=n(50896),g=n(74153),f=n(5026);let j=(0,m.memo)(e=>{let{...t}=e,n=(0,c.CG)(s.CC),[o,a]=(0,g.Ns)("numCards"),{maxCards:l}=(0,f.hw)(),d=(0,m.useCallback)(()=>{n&&a(Math.min(n+1,l))},[n,a,l]),j=(0,m.useCallback)(()=>{n&&1!==n&&a(n-1)},[n,a]),[v]=(0,g.Ns)("editorMode"),b=n>l,C=Math.min(n,l);return"structured"===v?(0,i.jsx)(h.kH,{label:(0,i.jsx)(p.cC,{id:"Zne1Sw"}),placement:"top",children:(0,i.jsxs)(r.K,{spacing:{base:.5,sm:2},flex:"1",justifyContent:"center",alignItems:"center",direction:{base:"column-reverse",sm:"row"},children:[(0,i.jsx)(u.x,{cursor:"help",fontSize:b?"xs":"lg",fontWeight:b?void 0:"600",textDecoration:b?"line-through":void 0,color:b?"gray.500":void 0,css:{textWrap:"nowrap"},textAlign:"center",children:(0,i.jsx)(p.cC,{id:"AZLIlg",values:{cardCount:n}})}),b&&(0,i.jsx)(u.x,{fontSize:{base:"md",sm:"lg"},fontWeight:"600",lineHeight:"1",children:(0,i.jsx)(p.cC,{id:"gcpsjO",values:{adjustedCardCount:C}})})]})}):(0,i.jsx)(x.Y,{maxCards:l,cardCount:n,onIncrement:d,onDecrement:j,...t})});j.displayName="CardCountSettings";var v=n(62614),b=n(28535),C=n(54933),y=n(49929),_=n(97763),w=n(62131),k=n(2953),S=n(11050),I=n(1071);let E=e=>{let{product:t,title:n,subtitle:r,isWarning:o=!1,onClick:s,cta:l}=e;return(0,i.jsxs)(a.U,{borderRadius:"md",bg:o?"sunglow.100":"trueblue.100",px:{base:2,md:3},pl:4,py:2,children:[t&&(0,i.jsx)(w.ER,{product:t}),(0,i.jsxs)(u.x,{py:1,fontSize:{base:"xs",sm:"sm"},noOfLines:2,lineHeight:"1.3",flex:"1",children:[(0,i.jsx)("strong",{children:n})," ",r]}),l&&s&&(0,i.jsx)(v.z,{onClick:s,variant:"ghost",color:"trueblue.500",bg:"trueblue.50",size:"sm",leftIcon:(0,i.jsx)(b.xu,{display:{base:"none",sm:"block"},children:(0,i.jsx)(y.G,{icon:C.JyM,fixedWidth:!0})}),children:l})]})},A=(0,m.memo)(()=>{let{hasEnoughCreditsToGenerateDeck:e}=(0,_.qO)(),{openUpsellModal:t}=(0,k.z)();return e?null:(0,i.jsx)(E,{product:"pro",isWarning:!0,onClick:()=>t({segmentEvent:S.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_V2}),title:(0,i.jsx)(p.cC,{id:"Lhlq0w"}),subtitle:(0,i.jsx)(p.cC,{id:"cl2O0R"}),cta:(0,i.jsx)(p.cC,{id:"kwkhPe"})})});A.displayName="NotEnoughCreditsUpsellWarning";let T=(0,m.memo)(()=>{let e=(0,c.CG)(s.mO),{maxTokens:t,canUpgrade:n}=(0,I.ml)(),{openUpsellModal:r}=(0,k.z)();return!e||e<t?null:e>=t&&n?(0,i.jsx)(E,{product:"pro",isWarning:!0,onClick:()=>r({segmentEvent:S.AA.GAMMA_UPSELL_CALLOUT_AI_GENERATE_LONGER}),title:(0,i.jsx)(p.cC,{id:"265FwR"}),subtitle:(0,i.jsx)(p.cC,{id:"kaOsNu",values:{0:I.Jv.toLocaleStr
1ing()}}),cta:(0,i.jsx)(p.cC,{id:"kwkhPe"})}):(0,i.jsx)(E,{isWarning:!0,title:(0,i.jsx)(p.cC,{id:"mWVxkj"}),subtitle:(0,i.jsx)(p.cC,{id:"qTSTz6",values:{0:I.Jv.toLocaleString()}})})});T.displayName="MaxTokensUpsellWarning";let N=(0,m.memo)(()=>{let e=(0,c.CG)(s.CC),[t]=(0,g.Ns)("editorMode"),{maxCards:n,canUpgrade:r}=(0,f.hw)(),{openUpsellModal:o}=(0,k.z)();return!e||e<n||e===n&&"structured"===t?null:"freeform"===t&&e>=n&&r?(0,i.jsx)(E,{product:"pro",onClick:()=>o({segmentEvent:S.AA.GAMMA_UPSELL_CALLOUT_AI_GENERATE_LONGER}),title:(0,i.jsx)(p.cC,{id:"6/00Zu",values:{MAX_CARDS_PRO:f.Fv}}),cta:(0,i.jsx)(p.cC,{id:"kwkhPe"})}):"freeform"===t?null:r?(0,i.jsx)(E,{product:"pro",isWarning:!0,onClick:()=>o({segmentEvent:S.AA.GAMMA_UPSELL_CALLOUT_AI_GENERATE_LONGER}),title:(0,i.jsx)(p.cC,{id:"dHdJAv",values:{maxCards:n}}),subtitle:(0,i.jsx)(p.cC,{id:"c4NYWT",values:{MAX_CARDS_PRO:f.Fv}}),cta:(0,i.jsx)(p.cC,{id:"kwkhPe"})}):(0,i.jsx)(E,{isWarning:!0,title:(0,i.jsx)(p.cC,{id:"dHdJAv",values:{maxCards:n}}),subtitle:(0,i.jsx)(p.cC,{id:"yLG7qf"})})});N.displayName="CardCountUpsellWarning";var P=n(41004);let R=(0,P.E)(o.k),G=(0,m.memo)(e=>{let{children:t}=e;return(0,i.jsx)(R,{bg:"white",py:3,position:"fixed",zIndex:"10",initial:{opacity:0,bottom:-10},animate:{opacity:1,bottom:0},exit:{opacity:0,bottom:0},borderTop:"1px solid",borderColor:"blackAlpha.200",px:{base:3,md:4},direction:"column",align:"center",w:"100%",children:t})});G.displayName="StickyBottomBar";let O=e=>{let{cta:t}=e,n=(0,c.CG)(s.Vn),u=(0,c.CG)(s.$X);if(u)return null;let h=(0,i.jsx)(l.r,{modalId:"ai-credits-modal-generate-v2",variant:"ghost",justify:"flex-end",segmentEvent:d.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_V2,alignSelf:"center"});return(0,i.jsx)(G,{children:(0,i.jsxs)(r.K,{w:"100%",direction:{base:"column-reverse",md:"row"},spacing:{base:2,md:4},alignItems:{base:"center",md:"flex-end"},children:[(0,i.jsx)(o.k,{flex:"1",children:h}),(0,i.jsxs)(r.K,{w:"2xl",maxW:"100%",overflow:"hidden",children:[(0,i.jsx)(A,{}),(0,i.jsx)(N,{}),(0,i.jsx)(T,{}),(0,i.jsxs)(a.U,{spacing:{base:2,md:3},opacity:n?.75:1,pointerEvents:n?"none":"inherit",cursor:n?"not-allowed":"default",children:[(0,i.jsx)(j,{size:{base:"md",lg:"lg"}}),(0,i.jsx)(o.k,{flex:"1",alignItems:"stretch",flexDirection:"column",children:t})]})]}),(0,i.jsx)(o.k,{flex:"1",display:{base:"none",md:"flex"}})]})})}},45760:function(e,t,n){"use strict";n.d(t,{jX:function(){return s},vZ:function(){return a}});var i=n(52322),r=n(2784);let o=r.createContext({});function a(){let e=(0,r.useContext)(o);return e}let s=e=>{let{children:t}=e,n=r.useRef();return(0,i.jsx)(o.Provider,{value:{setEditorInstance:e=>{n.current=e},getEditorInstance:()=>n.current},children:t})}},7208:function(e,t,n){"use strict";n.d(t,{N:function(){return S}});var i=n(52322),r=n(70065),o=n(43297),a=n(28535),s=n(77533),l=n(75768),c=n(62614),d=n(54933),u=n(49929),h=n(87254),p=n(2784),m=n(36528),x=n(54691),g=n(31490),f=n(91994),j=n(6997);let v="\n{{input}}\n\n###\n\nThe text above contains the outline for my presentation. Find the lines that should be slide breaks.\n\nIf the text I give you contains clear slide numbering, always use that to split it up.\nOtherwise, if there are clear section headings, use those.\nIf there is no obvious break, use your best judgement to split the content into slides by subject matter.\n\nRespond with a list of line numbers that represent the start of a new slide. Each line number should be on its own line without the ".concat(">>>"," symbol. For example,\n1\n4\n18\n").trim(),b=new j.u({params:{temperature:.5,model:"gpt-3.5-turbo"},variables:["input"],systemPrompt:"\nI am a slide designer who will be turning a presentation outline into a slide deck. I need your help identifying where the slide boundaries are in the presentation. Respond only with line numbers, each number on its own line.\n".trim(),userPrompt:v});var C=n(76282),y=n(74153);let _=e=>{let t=e.split("\n"),n=1;return t.map(e=>""===e.trim()?e:"".concat(n++).concat(">>>").concat(e)).join("\n")},w=(e,t)=>(t.forEach(t=>{e=e.replace("".concat(t).concat(">>>"),"---\n\n".concat(t).concat(">>>"))}),e),k=e=>{let t=e.split("\n");return t.map(e=>{let t=e.split(">>>");return t.length>1?t[1]:e}).join("\n")},S=()=>{let[e,t]=(0,p.useState)(!1),[n,j]=(0,y.Ns)("editorMode"),v=(0,y.vS)(),S=(0,f.CG)(C.Kd),I=(0,f.CG)(C.MH),E=(0,r.p)(),A=(0,p.useRef)(null),T=(0,f.CG)(C.Vn);(0,p.useEffect)(()=>{T&&A.current&&(E.close(A.current),A.current=null)},[E,T]);let N=(0,p.useCallback)(()=>{let e=(0,f.bh)().getState(),t=(0,C.au)(e),n=t.replace(/\n\n---\n\n/g,"\n\n");v(n);let r=h.ag._({id:"a7V4Kp"}),p=h.ag._({id:"jpA4hO"}),m=h.ag._({id:"9uI/rE"}),x=h.ag._({id:"DPfwMq"}),g=E({render:()=>(0,i.jsxs)(o.K,{p:4,shadow:"lg",borderRadius:"lg",bg:"green.100",spacing:4,direction:{base:"column",md:"row"},children:[(0,i.jsx)(a.xu,{color:"green.600",fontSize:"xl",children:(0,i.jsx)(u.G,{icon:d.fV7})}),(0,i.jsxs)(a.xu,{children:[(0,i.jsx)(s.x,{noOfLines:1,fontWeight:"600",children:r}),(0,i.jsx)(s.x,{fontSize:"xs",noOfLines:1,color:"blackAlpha.800",children:p})]}),(0,i.jsxs)(l.h,{children:[(0,i.jsx)(c.z,{size:"md",variant:"solid",onClick:()=>E.close(g),rightIcon:(0,i.jsx)(u.G,{icon:d.LEp}),children:x}),(0,i.jsx)(c.z,{size:"md",colorScheme:"gray",variant:"ghost",onClick:()=>{v(t),E.close(g)}
1,children:m})]})]}),status:"success",duration:5e3,position:"top",containerStyle:{maxW:"none"}})},[v,E]),P=(0,p.useCallback)(async e=>{let r=(0,g.nZ)(),p=_(e),f=b.prepare({variables:{input:p},interactionId:r}),C=h.ag._({id:"P0CwEw"}),y=E({title:C,status:"loading",duration:1e4,position:"top"}),S=await (0,m.oO)(f),I=await (0,x.I)(S,r,{retries:0});if(!I)throw Error("Response is undefined");let A=I.split("\n").map(e=>parseInt(e)),T=k(w(p,A));console.debug("Splitting cards",{numberedContent:p,resp:I,lineBreaks:A,newContent:T}),E.close(y),v(T),j("structured"),t(!1);let N=h.ag._({id:"0+Fg4H"}),P=h.ag._({id:"YbORTh"}),R=h.ag._({id:"9uI/rE"}),G=h.ag._({id:"DPfwMq"}),O=E({render:()=>(0,i.jsxs)(o.K,{p:4,shadow:"lg",borderRadius:"lg",bg:"green.100",spacing:4,direction:{base:"column",md:"row"},children:[(0,i.jsx)(a.xu,{color:"green.600",fontSize:"xl",children:(0,i.jsx)(u.G,{icon:d.fV7})}),(0,i.jsxs)(a.xu,{children:[(0,i.jsx)(s.x,{noOfLines:1,fontWeight:"600",children:N}),(0,i.jsx)(s.x,{fontSize:"xs",noOfLines:1,color:"blackAlpha.800",children:P})]}),(0,i.jsxs)(l.h,{children:[(0,i.jsx)(c.z,{size:"md",variant:"solid",onClick:()=>E.close(O),rightIcon:(0,i.jsx)(u.G,{icon:d.LEp}),children:G}),(0,i.jsx)(c.z,{size:"md",colorScheme:"gray",variant:"ghost",onClick:()=>{v(e),j(n),E.close(O)},children:R})]})]}),status:"success",duration:5e3,position:"top",containerStyle:{maxW:"none"}})},[n,v,j,E]),R=(0,p.useCallback)(()=>{let e=(0,f.bh)().getState();A.current&&(E.close(A.current),A.current=null);let n=(0,C.Kd)(e);if(!n)return;let r=(0,C.au)(e),d=h.ag._({id:"CObmXw"}),u=h.ag._({id:"+JxrYy"}),p=h.ag._({id:"goXuxS"}),m=h.ag._({id:"6Uau97"});A.current=E({render:()=>(0,i.jsxs)(o.K,{p:4,shadow:"lg",borderRadius:"lg",bg:"trueblue.100",spacing:4,direction:{base:"column",md:"row"},children:[(0,i.jsxs)(a.xu,{children:[(0,i.jsx)(s.x,{noOfLines:1,fontWeight:"600",children:d}),(0,i.jsx)(s.x,{fontSize:"xs",noOfLines:1,color:"blackAlpha.800",children:u})]}),(0,i.jsxs)(l.h,{children:[(0,i.jsx)(c.z,{variant:"solid",size:"md",onClick:()=>{P(r),t(!0),E.close(A.current)},children:p}),(0,i.jsx)(c.z,{variant:"plain",size:"md",onClick:()=>{E.close(A.current)},children:m})]})]}),status:"info",duration:8e3,position:"top"})},[P,E]);return(0,p.useEffect)(()=>()=>{A.current&&(E.close(A.current),A.current=null)},[E]),{addSectionBreaks:P,isAddingBreaks:e,canAddBreaks:S,canRemoveBreaks:I,removeSectionBreaks:N,onChangeMode:R}}},74153:function(e,t,n){"use strict";n.d(t,{Ns:function(){return g},Q_:function(){return x},ex:function(){return p},ip:function(){return m},o7:function(){return h},vS:function(){return f}});var i=n(2784),r=n(45760),o=n(93202),a=n(91994),s=n(86581),l=n(33522),c=n(24551),d=n(14874),u=n(76282);let h=()=>{let e=(0,a.qr)(),t=(0,a.TL)(),[n]=(0,o.NCT)(),r=(0,i.useCallback)(async()=>{var i;let r=(0,u.d_)(e.getState()),o=r.id,a=await n({variables:{docGenerateInputId:o,input:{}}}),s=null===(i=a.data)||void 0===i?void 0:i.updateDocGenerationDraftInput;s&&s.draftInput&&o!==s.draftInput.id&&t((0,u.Gn)(s))},[t,e,n]);return r},p=e=>{var t;let n=(0,a.qr)(),r=(0,a.TL)(),[s]=(0,o.NCT)(),c=(0,i.useCallback)(async e=>{var t;let i=(0,u.RB)(n.getState()),o=(0,u.U6)(n.getState());if(!i||!o)return;let{format:a,...l}=e,c={format:a,...l},d=(0,u.br)(n.getState());c.settings&&(c.settings={...d,...c.settings});let h=(0,u.U6)(n.getState()),p=await s({variables:{docGenerateInputId:o,input:c}}),m=null===(t=p.data)||void 0===t?void 0:t.updateDocGenerationDraftInput;m&&m.draftInput&&h!==m.draftInput.id&&r((0,u.Gn)(m))},[r,n,s]),d=(0,l.Kt)(c,null!==(t=null==e?void 0:e.debounce)&&void 0!==t?t:0),h=(0,i.useCallback)(function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];r((0,u.Zx)(e)),t&&d(e)},[d,r]);return h},m=()=>{let e=p(),t=(0,i.useCallback)(function(t){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];e({format:t},n)},[e]),n=(0,a.CG)(u.Lh);return[n,t]},x=()=>{let e=p({debounce:500}),t=(0,i.useCallback)(function(t){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];e({prompt:t},n)},[e]),n=(0,a.CG)(u.lb);return[n,t]},g=(e,t)=>{let n=p(t),r=(0,i.useCallback)(function(t){let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n({settings:{[e]:t}},i)},[e,n]),o=(0,a.CG)((0,u.Mn)(e));return[o,r]},f=e=>{let t=p(e),{getEditorInstance:n}=(0,r.vZ)(),o=(0,i.useCallback)(function(e){let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=n();if(r){let t=r.editorId===c.C,n=(0,s.c8)(e),i=(0,d.dW)(n,t?"structured":"freeform").content.toJSON();r.commands.setContent(i)}t({content:e},i)},[t,n]);return o}},96796:function(e,t,n){"use strict";n.d(t,{R:function(){return v},d:function(){return j}});var i=n(5632),r=n(2784),o=n(63304),a=n(67496),s=n(28918),l=n(31490),c=n(39122),d=n(93202),u=n(42111),h=n(21733),p=n(50634),m=n(45302);let x=e=>{if(!e)throw Error("Response is undefined");let t=v(e),n=(0,m.jw)(t.locale);
1return{settings:{tone:t.tone,audience:t.audience,locale:n.key,textAmount:g(t.text_amount,["sm","md","lg"],"md")}}},g=(e,t,n)=>e?t&&!t.includes(e)?n:e:void 0,f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new URLSearchParams("");return t.generateOutline&&n.append(a.nx,"1"),t.generateSettings&&n.append(a.Cb,"1"),"/generate/".concat(e,"?").concat(n.toString())},j=()=>{let{push:e}=(0,i.useRouter)(),[t,n]=(0,r.useState)(!1),[a]=(0,d.JBp)(),{generate:m}=(0,p.j)("DetermineGenerateSettings",{}),g=(0,r.useCallback)(async(t,i)=>{var r;let d=(0,l.nZ)();n(!0);let p=(0,s.d)(i.content,c.VN),g=await m({variables:{input:p},workspaceId:(0,h.n_)(),interactionId:d}).promise,j=x(g),{settings:v,format:b,...C}=i,y=await a({variables:{input:{workspaceId:(0,h.n_)(),generationType:t,input:{interactionId:d,settings:{...o.zJ,imageProvider:u.VH.get("aiGeneratorDefaultImageProvider"),...j.settings,...v},...C,format:b}}}});n(!1),e(f(null===(r=y.data)||void 0===r?void 0:r.createDocGeneration.id))},[a,e]);return{guessSettings:g,isLoading:t}},v=e=>{let t=e.split("\n"),n={};return t.forEach(e=>{let[t,i]=e.split(": ");t&&i&&(n[t.trim().toLowerCase()]=i.trim())}),n}},67496:function(e,t,n){"use strict";n.d(t,{Cb:function(){return h},HL:function(){return p},nx:function(){return u}});var i=n(9850),r=n.n(i),o=n(5632),a=n(2784),s=n(76282),l=n(93202),c=n(91994),d=n(704);let u="generateOutline",h="generateSettings",p=e=>{let{id:t}=e,n=(0,o.useRouter)(),i=(0,c.TL)(),r=(0,c.qr)(),{goToScreen:u}=(0,d.R)(),[h,p]=(0,a.useState)(!0),[x]=(0,l.UCC)({variables:{id:t}});return(0,a.useEffect)(()=>{n&&r&&x&&x().then(e=>{let{data:t}=e;if(null==t?void 0:t.docGeneration)return t.docGeneration;throw Error("Could not load docGeneration")}).then(e=>{i((0,s.Gn)(m(e))),p(!1)}).catch(()=>{u("createWithAI")})},[i,x,u,n,r]),{isLoading:h}},m=e=>({...e,docGenerateInputs:e.docGenerateInputs.map(x),draftInput:e.draftInput?x(e.draftInput):void 0}),x=e=>{let t=r()(e);return t.settings.textMode||(t.settings.preserveText?t.settings.textMode="preserve":t.settings.textMode="generate",delete t.settings.preserveText),t}},1071:function(e,t,n){"use strict";n.d(t,{Jv:function(){return r},ml:function(){return o}});var i=n(57124);let r=1e4,o=()=>{let e=(0,i.Y)("ai_premium_models");return{maxTokens:e?r:5e3,canUpgrade:!e}}},39486:function(e,t,n){"use strict";n.d(t,{Nl:function(){return g},m3:function(){return f},c1:function(){return x}});var i=n(95993),r=n(41774),o=n(22537),a=n(6501);class s extends i.GJ{constructor(e,t){super({transform:async(t,n)=>{if("data"!==t.event){n.enqueue(t);return}let{data:i}=t,r=await (0,a.sj)(i,{cardIndex:this.index,docFormatKey:e.docFormatKey,imageOptions:e.imageOptions,loadImages:!e.lazyImages,theme:e.theme}),o={index:this.index,cardComplete:!0,content:r,id:r.attrs.id,raw:i};n.enqueue({id:t.id,event:"data",data:o}),this.index++}}),this.index=0,null!=t&&(this.index=t+1)}}let l=e=>{let t=e.match(/(<[^>]+>|<\/[^>]+>)|\S+/g);if(!t)throw Error("Could not parse tokens");return t};class c extends i.GJ{constructor(e){super({transform:async(t,n)=>{if("data"!==t.event){n.enqueue(t);return}let i=t.data,r=performance.now()-this.startTime,o=l(i.raw);e({index:this.index,duration:r,numTokens:o.length}),this.index++,this.startTime=performance.now(),n.enqueue(t)}}),this.index=0,this.startTime=performance.now()}}class d extends i.GJ{constructor(){super({transform:async(e,t)=>{"done"===e.event||"cancel"===e.event?t.enqueue({...e,content:this.content}):(this.content+=e.data.raw||"",t.enqueue(e))}}),this.content=""}}class u extends i.GJ{constructor(){let e=(e,t)=>{for(;;){let n=this._buffer.match(/<section\b[^>]*>(?:(?!<\/?section\b)[\s\S])*<\/section>/i);if(!n)break;let i=n[0],r=n.index;this._buffer=this._buffer.slice(r+i.length);let o=i+"\n\n";e.enqueue({id:t,event:"data",data:o})}};super({transform:async(t,n)=>{if("data"===t.event){if(!t.data)return;this._buffer+=t.data,e(n,t.id);return}this.lastId=t.id,n.enqueue(t)},flush:async t=>{e(t,this.lastId)}}),this._buffer=""}}class h extends i.GJ{constructor(){super({transform(e,t){if("done"===e.event){t.enqueue({id:e.id,event:"done",finishReason:e.data,content:""});return}if("cancel"===e.event){t.enqueue({id:e.id,event:"cancel",content:""});return}if("content"===e.event){t.enqueue({id:e.id,event:"data",data:e.data});return}console.error("[StreamMessageEventParser] unknown event type",e)}})}}var p=n(1010);let m="CANCEL",x=e=>new i.GJ({transform(t,n){e(t),n.enqueue(t)}}),g=e=>{let{stream:t,docId:n,lastCompletedCardId:i,lastCompletedCardIndex:a,interactionId:s,options:l,store:c}=e,d=j(t,l,a),[u,h]=d.tee(),m=u.pipeThrough(x(e=>{"done"===e.event&&o.a.trackStreamResponse(c,{interactionId:s,outputContent:e.content})}));(0,p.GO)(m,{}),c.dispatch((0,r.kO)({stream:{id:s,status:"running",stream:h,docId:n,isResuming:!0,lastCompletedCardId:i}}));let g=(0,r.oH)(n)(c.getState());if(!g)throw Error("Expected valid StreamResponse when resuming from stream");return g},f=e=>{let t,{stream:n,onCancel:i,interactionId:a,options:s,bufferCards:l=2,docId:d,store:u}=e,h=j(n,s),[g,f]=h.tee(),v=g.pipeThrough(new c(e=>{u.dispatch((0,r.Ms)({interactionId:a,data:e}))})).pipeThrough(x(e=>{"done"===e.event&&o.a.trackStreamResponse(u,{interactionId:a,outputContent:e.content})}));u.dispatch((0,r.kO)({stream:{id:a,status:"running",stream:f,isResuming:!1,docId:d}}));
1let b=new Promise((e,n)=>{t=n;let i=[];(0,p.GO)(v,{onError:e=>{n(e)},onMessage(t){if("done"===t.event){e({status:"READY",cards:i});return}if("data"===t.event){let n=t.data.index+1;i.push(t.data),n>=l&&e({status:"READY",cards:i})}}})}).catch(e=>{if(e===m)return{status:"CANCELED",cards:[]};throw e}),C=!1;return{promise:b,cancel:()=>{C||(console.log("[AIStream] cancelling..."),C=!0,i(),null==t||t(m))}}},j=(e,t,n)=>e.pipeThrough(new h).pipeThrough(new u).pipeThrough(new s(t,n)).pipeThrough(x(e=>{"data"===e.event&&console.log("[AIStream] processed card ".concat(e.data.index+1))})).pipeThrough(new d).pipeThrough(x(e=>{"done"===e.event&&console.log("[AIStream] done (".concat(e.finishReason,")")),"cancel"===e.event&&console.log("[AIStream] cancelled")}))},22537:function(e,t,n){"use strict";n.d(t,{a:function(){return s}});var i=n(1163),r=n(36651),o=n(31490),a=n(41774);let s={trackRequestSent(e,t){console.log("[AIStream] EVENT: ai.request.sent"),t.product=(0,i.K9)((0,r.rW)()),(0,o.hq)(t);let n=performance.now();e.dispatch((0,a.Jh)({...t,startTime:n}))},trackStreamError(e,t){e.dispatch((0,a.fj)({endTime:performance.now(),interactionId:t.interactionId}));let n=(0,a.Sn)(t.interactionId)(e.getState());if(!n)return;let{startTime:i,...r}=n,{errorName:s,errorMessage:l,errorCode:c}=t,d={...r,errorName:s,errorMessage:l,errorCode:c,outputMessage:"",latency:performance.now()-i};console.log("[AIStream] EVENT: ai.request.error"),(0,o.pQ)(d)},trackStreamAbort(e,t){let n=(0,a.Sn)(t.interactionId)(e.getState());if(!n)return;let{startTime:i,...r}=n,s={...r,abortReason:t.abortReason,timeToAbort:performance.now()-i};console.log("[AIStream] EVENT: ai.request.abort"),(0,o.mV)(s)},trackStreamStart(e,t){e.dispatch((0,a.af)(t));let n=(0,a.Sn)(t.interactionId)(e.getState());if(!n)return;let{startTime:i,...r}=n,s={...r,timeToStart:performance.now()-i};console.log("[AIStream] EVENT: ai.request.streamStart"),(0,o.qZ)(s)},trackStreamResponse(e,t){e.dispatch((0,a.fj)({endTime:performance.now(),...t}));let n=(0,a.Sn)(t.interactionId)(e.getState());if(!n)return;let{startTime:i,...r}=n;console.log("[AIStream] EVENT: ai.request.response"),(0,o.o)(r)},trackStreamComplete(e,t,n){let i=(0,a.Sn)(t)(e.getState());if(!i)return;let{startTime:r,...s}=i,l={...s,timeToComplete:performance.now()-r,...n};console.log("[AIStream] EVENT: ai.request.complete"),(0,o.gb)(l)}}},6912:function(e,t,n){"use strict";n.d(t,{S1:function(){return b},B_:function(){return _},ET:function(){return C}});var i=n(2784),r=n(14274),o=n(88232),a=n(42111),s=n(49152),l=n(44663),c=n(1163),d=n(11050),u=n(90221),h=n(23284),p=n(90383),m=n(87254),x=n(82108),g=n.n(x),f=n(94199);let j=(e,t)=>{let n=g()(t);return{[e]:{next:m.ag._({id:"hXzOVo"}),back:m.ag._({id:"iH8pgl"}),nevermind:m.ag._({id:"CKyk7Q"}),goToAccount:m.ag._({id:"C9yTHG",values:{GAMMA_PROPER_NOUN:f.N6}}),getHelp:m.ag._({id:"pWsyuL"}),declineOffer:m.ag._({id:"aIFikE"}),confirmAndCancel:m.ag._({id:"G9nPRC"}),pauseSubscription:m.ag._({id:"2RgEmU"}),cancelSubscription:m.ag._({id:"dEgA5A"}),discountSubscription:m.ag._({id:"qG4Wa/"}),claimOffer:m.ag._({id:"/Gl/RK"}),discountOff:m.ag._({id:"Bdtwnw"}),discountFor:m.ag._({id:"sQv06Y"}),discountForever:m.ag._({id:"FsOOWf"}),discountOneTime:m.ag._({id:"HpXCa4"}),day:m.ag._({id:"5YWExy"}),month:m.ag._({id:"obrMay"}),year:m.ag._({id:"/Tw548"}),error:m.ag._({id:"wTrpxV"}),genericErrorDescription:m.ag._({id:"PUjJ3A"}),cancelNow:m.ag._({id:"EiakwV"}),applyingDiscount:m.ag._({id:"8kSYjw"}),applyingCancel:m.ag._({id:"VpuvNv"}),applyingResume:m.ag._({id:"eIoGiX"}),applyingPause:m.ag._({id:"UD7gOq"}),discountApplied:m.ag._({id:"jdYyiz"}),discountAppliedMessage:m.ag._({id:"DhHX6G"}),pauseApplied:m.ag._({id:"eeITvj"}),pauseAppliedMessage:m.ag._({id:"nm0VaE"}),pauseAppliedResumeMessage:m.ag._({id:"qOe0SS"}),pauseScheduledMessage:m.ag._({id:"mqRc6d"}),until:m.ag._({id:"C51N+0"}),cancelApplied:m.ag._({id:"Wcg6zu"}),cancelAppliedMessage:m.ag._({id:"8vN97Y"}),cancelAppliedDateMessage:m.ag._({id:"BS/SGu"}),howLongToPausePrompt:m.ag._({id:"HLyJ9n"}),whatCouldWeHaveDone:m.ag._({id:"fcbm8H"}),weReadEveryAnswer:m.ag._({id:"nkuKRd"}
1),applyingCustomerAction:m.ag._({id:"PXwF+s"}),loading:m.ag._({id:"Z3FXyt"}),pauseWallCardPunch:m.ag._({id:"iL2TQ6"}),pauseWallCta:m.ag._({id:"TvXj47"}),pauseWallCardHeading:m.ag._({id:"kHm8Fg"}),scheduledToReactivate:m.ag._({id:"aH7vi8"}),resumeApplied:m.ag._({id:"diOgYK"}),resumeAppliedMessage:m.ag._({id:"YqFvUY"}),resumeNextChargeMessage:m.ag._({id:"VDqPUf"}),resumeNextChargeMessageWithoutAmount:m.ag._({id:"RrvVAn"}),resumeAccountDataInfo:m.ag._({id:"dJCJXA"}),subscriptionPauseNotice:m.ag._({id:"fpxliT"}),failedPaymentNotice:m.ag._({id:"Vxg5vO"}),chargedMultipleTimeNotice:m.ag._({id:"lAlv46"}),failedPaymentCardPunch:m.ag._({id:"KEZrHg",values:{GAMMA_PROPER_NOUN:f.N6,productName:n}}),resumeHey:m.ag._({id:"hdOctW"}),invoicePaidTitle:m.ag._({id:"aJGfDL"}),logout:m.ag._({id:"W+3RJN"}),note:m.ag._({id:"ycCSuD"}),discount:m.ag._({id:"HmpVeZ"}),discountNoticeHeadline:m.ag._({id:"5P1dmt"}),discountNoticePrepend:m.ag._({id:"yjadEY"}),discountOverride:m.ag._({id:"JfBDWL"}),discountValidUntil:m.ag._({id:"uXxNua"}),updateBilling:m.ag._({id:"tQilrI"}),extendTrialCTA:m.ag._({id:"m3l7VI"}),extendTrialPunch:m.ag._({id:"s5pINo"}),extendTrialOfferTitle:m.ag._({id:"SyzXYh"}),trialExtended:m.ag._({id:"fezME2"}),trialExtendedMessage:m.ag._({id:"QE4mUs"}),applyingTrialExtension:m.ag._({id:"vI2q9R"}),switchPlanCTA:m.ag._({id:"P2mx2L"}),changePlanHighlights:m.ag._({id:"qbgW+C"}),changePlanOfferPunch:m.ag._({id:"MRkiFP"}),planChanged:m.ag._({id:"ByFtyh"}),planChangedMessage:m.ag._({id:"Pf5z1G"}),applyingPlanChange:m.ag._({id:"9vKKLI"}),surveyStepTag:m.ag._({id:"cSUBI1"}),freeFormStepTag:m.ag._({id:"cSUBI1"}),finalConfirmation:m.ag._({id:"1/oP/N"}),offerDiscountTag:m.ag._({id:"LTgtxG"}),offerChangePlanTag:m.ag._({id:"ENMJv2"}),offerExtendTrialTag:m.ag._({id:"MWKntz"}),offerRedirectTag:m.ag._({id:"cvpAvL"}),offerContactTag:m.ag._({id:"cvpAvL"}),offerPauseTag:m.ag._({id:"+T6DGl"}),completeTag:m.ag._({id:"K5c1e7"}),errorTag:m.ag._({id:"EuvbIW"}),offerAccepted:m.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(r.v.CHURNKEY_APP_ID,"';\n      a.async = true;\n      const b = document.getElementsByTagName('script')[0];\n      b.parentNode.insertBefore(a, b);\n    }\n  }();\n"),b=()=>{let e=!(0,u.l6)()&&!(0,p.wg)();return(0,h.G)(e,v),null},C=e=>{let{subscription:t,workspace:n,autoLaunch:d=!0}=e,u=(0,a.ye)("churnkeyFailedPaymentWallEnabled"),h=(0,s.l)(),p=(0,c.K9)(n),m=(0,l.G)(),x=(0,i.useCallback)(async()=>{if(t&&p&&u)return(0,o.d6)("churnkey").then(e=>{var n,i;if(!e||!t.billingSubscriptionId||!(null===(n=t.createdByUser)||void 0===n?void 0:n.billingCustomerId)){console.error("[Churnkey] launchFailedPayment Missing hmac or subscription data",{hmac:e,subscription:t});return}console.debug("[Churnkey] launchFailedPayment - launching churnkey with:",{hmac:e,appId:r.v.CHURNKEY_APP_ID,subscriptionId:t.billingSubscriptionId,customerId:null===(i=t.createdByUser)||void 0===i?void 0:i.billingCustomerId}),y({authHash:e,subscription:t,localeKey:h,productKey:p,launchIntercomUI:m})})},[t,p,u,h,m]);return(0,i.useEffect)(()=>{d&&x()},[x,d]),{launchFailedPaymentFlow:x,failedPaymentFlowEnabled:u}},y=async e=>{var t,n;let{authHash:i,subscription:o,localeKey:a,productKey:s,launchIntercomUI:l}=e;null===(n=window.churnkey)||void 0===n||n.check("failed-payment",{subscriptionId:o.billingSubscriptionId,customerId:null===(t=o.createdByUser)||void 0===t?void 0:t.billingCustomerId,authHash:i,customerAttributes:{language:a},i18n:{lang:a,messages:j(a,s)},appId:r.v.CHURNKEY_APP_ID,mode:r.v.CHURNKEY_MODE,provider:"stripe",softWall:!0,forceCheck:!1,gracePeriodDays:3,ignoreInvoicesWithoutAttempt:!1,handleSupportRequest(){var e;l(),d.co.track(d.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"failed-payment-wall",subscriptionId:o.billingSubscriptionId,customerId:null===(e=o.createdByUser)||void 0===e?void 0:e.billingCustomerId})},async handleCancel(e){var t,n;return d.co.track(d.AA.CANCEL_SUBSCRIPTION_CLICK,{source:"failed-payment-wall",subscriptionId:o.billingSubscriptionId,customerId:null===(t=o.createdByUser)||void 0===t?void 0:t.billingCustomerId}),console.debug("[launchChurnkeyFailedPayment.handleCancel]",{subscriptionId:o.billingSubscriptionId,customerId:null===(n=o.createdByUser)||void 0===n?void 0:n.billingCustomerId,customer:e}),w({authHash:i,subscription:o,localeKey:a,productKey:s,launchIntercomUI:l,customerAttributes:{viaFailedPayment:!0}}).catch(e=>y({authHash:i,subscription:o,localeKey:a,productKey:s,launchIntercomUI:l}))},onFailedPaymentWallActivated(){var e;d.co.track(d.AA.CHURNKEY_FAILED_PAYMENT_WALL_SHOWN,{subscriptionId:o.billingSubscriptionId,customerId:null===(e=o.createdByUser)||void 0===e?void 0:e.b
1illingCustomerId})},onUpdatePaymentInformation(){var e;d.co.track(d.AA.CHURNKEY_PAYMENT_METHOD_UPDATED,{source:"failed-payment-wall",subscriptionId:o.billingSubscriptionId,customerId:null===(e=o.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onFailedPaymentWallClose(){var e;d.co.track(d.AA.CHURNKEY_FAILED_PAYMENT_WALL_CLOSED,{subscriptionId:o.billingSubscriptionId,customerId:null===(e=o.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onCancel(){var e;d.co.track(d.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"failed-payment-wall",subscriptionId:o.billingSubscriptionId,customerId:null===(e=o.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onError(e,t){console.warn('Churnkey check("failed-payment", ...) error',e,t)}})},_=(e,t)=>{let n=(0,a.ye)("churnkeyCancelFlowEnabled"),r=(0,s.l)(),d=(0,c.K9)(t),u=(0,l.G)(),h=(0,i.useCallback)(()=>{if(e&&d&&n)return(0,o.d6)("churnkey").then(t=>{var n;if(!t||!e.billingSubscriptionId||!(null===(n=e.createdByUser)||void 0===n?void 0:n.billingCustomerId)){console.debug("[Churnkey] handleCancel - Missing hmac or subscription data",{hmac:t,subscription:e});return}return w({authHash:t,subscription:e,localeKey:r,productKey:d,launchIntercomUI:u})})},[n,r,d,e,u]);return{launchCancelFlow:h,cancelFlowEnabled:n}},w=async e=>{let{authHash:t,subscription:n,localeKey:i,productKey:o,customerAttributes:a={},launchIntercomUI:s}=e;return new Promise((e,l)=>{var u,h,p;null===(p=window.churnkey)||void 0===p||p.init("show",{subscriptionId:n.billingSubscriptionId,customerId:null===(u=n.createdByUser)||void 0===u?void 0:u.billingCustomerId,authHash:t,customerAttributes:{language:i,frequency:null===(h=(0,c.OJ)(n))||void 0===h?void 0:h.frequencyUnit,productKey:o,...a},i18n:{lang:i,messages:j(i,o)},appId:r.v.CHURNKEY_APP_ID,mode:r.v.CHURNKEY_MODE,provider:"stripe",record:!0,handleSupportRequest(){var e;s(),d.co.track(d.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"cancel-flow",subscriptionId:n.billingSubscriptionId,customerId:null===(e=n.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onCancel(e,t,i){var r;d.co.track(d.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"cancel-flow",subscriptionId:n.billingSubscriptionId,customerId:null===(r=n.createdByUser)||void 0===r?void 0:r.billingCustomerId,surveyResponse:t,freeformFeedback:i}),console.debug("[launchChurnkeyCancelFlow.onCancel]",{surveyResponse:t,freeformFeedback:i})},onGoToAccount(t){console.debug("[launchChurnkeyCancelFlow.onGoToAccount]",{sessionResults:t}),e({sessionResults:t})},onClose(t){if(console.debug("[launchChurnkeyCancelFlow.onClose]",{sessionResults:t}),!t||t.aborted){l("Churnkey cancel flow aborted");return}e({sessionResults:t})},onError(e){console.warn("[launchChurnkeyCancelFlow.onError]",{message:e}),l({message:e})}})})}},25944:function(e,t,n){"use strict";n.d(t,{bf:function(){return x},iZ:function(){return p},lh:function(){return h},wK:function(){return m}});var i=n(2784),r=n(42111),o=n(91994),a=n(47968),s=n(90604),l=n(56400),c=n(99268);let d=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,t)=>{let n=(0,o.CG)(a.Pw),r=(0,i.useRef)(n);(0,i.useEffect)(()=>{r.current=n},[n]),(0,i.useEffect)(()=>{if(e)return window.addEventListener("keydown",n,!0),()=>{window.removeEventListener("keydown",n,!0)};function n(e){let n=e.target.closest(".ProseMirror");if(!n||!r.current||!d(t))return;let i=performance.now();requestAnimationFrame(()=>{let t=e.key;" "===t&&(t="Space");let n=performance.now()-i;(0,c.EF)({...(0,l.H)(),key:t,duration:n})})}},[e,r,t])},p=()=>{let e=(0,r.ye)("rumSampleRate");(0,i.useEffect)(()=>{(0,c._k)(e)},[e])},m=e=>{let t=(0,i.useCallback)(t=>{let{isFullscreen:n=!1}=t;if(!e)return;let i=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-i;(0,c.gG)({...(0,l.H)(),toMode:s.q.SLIDE_VIEW,duration:e,isFullscreen:n})})})},[e]),n=(0,i.useCallback)(t=>{let{isFullscreen:n=!1}=t;if(!e)return;let i=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-i;(0,c.gG)({...(0,l.H)(),toMode:s.q.DOC_VIEW,duration:e,isFullscreen:n})})})},[e]);return{recordExitSlideModePerformance:n,recordEnterSlideModePerformance:t}},x=()=>{let[e]=(0,i.useState)(()=>new u),t=(0,i.useCallback)(()=>{e.setupProvider()},[e]),n=(0,i.useCallback)(()=>{e.downloadDoc()},[e]),r=(0,i.useCallback)(()=>{e.onCreate();let t=e.report();if(null===t){console.warn("[HoneycombDocLoadTimer] failed to generate doc timings");return}(0,c.Py)({...(0,l.H)(),duration:t.onCreate}),(0,c.aZ)({...(0,l.H)(),duration:t.downloadDoc})},[e]);return{timeOnCreate:r,timeOnSetupProvider:t,timeOnDownloadDoc:n}}},89311:function(e,t,n){"use strict";n.d(t,{l:function(){return s}});
1var i=n(5632),r=n(2784),o=n(7e4),a=n(88640);let s=()=>{let{pathname:e,isReady:t}=(0,i.useRouter)(),n=(0,r.useRef)(!1),[s,l]=(0,o.X)(a.H.lastHomeUrl,"/");(0,r.useEffect)(()=>{if(n.current||!t)return;let i="/inspiration"===e||"/templates"===e?e:"/";l(i),n.current=!0},[l,t,e])}},84405:function(e,t,n){"use strict";n.d(t,{J:function(){return a},Q:function(){return o}});var i=n(11050),r=n(25566);let o=e=>{let{doc_id:t,source:n,source_doc_id:o,channel:a,extra:s}=e;null===i.co||void 0===i.co||i.co.track(r.AA.DOC_CREATED,{doc_id:t,source_doc_id:o,source:n,channel:a,extra:s})},a=e=>{let{docId:t,type:n,source:o}=e;if(!t){console.debug("[trackDocShareLinkCopiedEvent]: doc_id is required");return}null===i.co||void 0===i.co||i.co.track(r.AA.DOC_SHARELINK_COPIED,{doc_id:t,source:o,type:n})}},30233:function(e,t,n){"use strict";n.d(t,{S:function(){return a}});var i=n(52322),r=n(69251),o=n(67109);let a=e=>{let{size:t}=e;return(0,i.jsx)(r.r,{gap:4,flex:1,my:2,templateColumns:{base:"repeat(2, minmax(0, 1fr))"},children:Array(t).fill(!0).map((e,t)=>(0,i.jsx)(o.O,{h:"9em",borderRadius:"base"},t))})}},26838:function(e,t,n){"use strict";n.d(t,{o:function(){return es}});var i=n(52322),r=n(56581),o=n(29117),a=n(77533),s=n(70065),l=n(55478),c=n(28535),d=n(38035),u=n(36474),h=n(5879),p=n(87254),m=n(2784),x=n(90763),g=n(93202),f=n(48832),j=n(11050),v=n(50260),b=n(10625),C=n(67046),y=n(32899),_=n(332),w=n(99058),k=n(27599),S=n(25481),I=n(42946),E=n(54933),A=n(49929),T=n(94523),N=n(82282),P=n(31807),R=n(47749),G=n(29318);let O=(0,m.memo)(e=>{let{theme:t}=e,n=(0,G.eo)({theme:t}),r=t.name.replace(R.Qk,"");return(0,i.jsxs)(b.v,{isLazy:!0,children:[(0,i.jsx)(C.j,{as:y.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,i.jsx)(A.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,i.jsx)(h.cC,{id:"7L01XJ"})}),(0,i.jsx)(_.h,{children:(0,i.jsxs)(w.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)(c.xu,{px:4,py:0,maxWidth:"300px",children:[(0,i.jsx)(a.x,{noOfLines:3,children:r}),t.createdTime&&(0,i.jsx)(a.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"MXSt4t",values:{0:(0,N.Z)((0,P.Z)(t.createdTime),"PPP")}})}),t.createdBy&&(0,i.jsx)(T.kH,{label:t.createdBy.email,children:(0,i.jsx)(a.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"t490IT",values:{0:t.createdBy.displayName}})})})]}),(0,i.jsx)(k.R,{}),(0,i.jsx)(S.s,{icon:(0,i.jsx)(A.G,{icon:E.XnX,fixedWidth:!0}),onClick:n,children:(0,i.jsx)(h.cC,{id:"yKu/3Y"})})]})})]})});var M=n(53596),z=n(36651),L=n(14274),U=n(8393),D=n(21733);let F=(0,m.memo)(e=>{let{onCustomizeThemeClick:t,onEditThemeClick:n}=e,{isGammaOrgUser:r}=(0,D.SE)(),o=r&&"production"!==L.v.APPLICATION_ENVIRONMENT;return(0,i.jsxs)(b.v,{isLazy:!0,children:[(0,i.jsx)(C.j,{as:y.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,i.jsx)(A.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,i.jsx)(h.cC,{id:"7L01XJ"})}),(0,i.jsx)(_.h,{children:(0,i.jsxs)(w.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(S.s,{icon:(0,i.jsx)(A.G,{icon:I.Mw$,fixedWidth:!0}),onClick:t,children:(0,i.jsx)(h.cC,{id:"XZd6AM"})}),o&&(0,i.jsx)(S.s,{color:"orange.500",icon:(0,i.jsx)(c.xu,{boxSize:"4",children:(0,i.jsx)(U.Y,{})}),onClick:n,children:"Edit theme"}),(0,i.jsx)(k.R,{}),(0,i.jsx)(c.xu,{px:4,py:0,maxW:56,children:(0,i.jsx)(a.x,{fontSize:"sm",color:"gray.600",children:(0,i.jsx)(h.cC,{id:"FV8ABd"})})})]})})]})});var H=n(29705),W=n(92850),K=n(26468),B=n(22226),q=n(54326),V=n(97217),Y=n(11082),J=n(67109),X=n(50250),Z=n(75768),Q=n(62614),$=n(2338),ee=n(5632),et=n(94199),en=n(91994),ei=n(47968);let er=e=>{let{theme:t,isOpen:n,onClose:r}=e,{asPath:o}=(0,ee.useRouter)(),[s,l]=(0,m.useState)(),[c,d]=(0,m.useState)(),u=(0,en.CG)(ei.yx),p=(0,G.EW)({theme:t,showLinkToDashboard:!!u}),{data:x,loading:f}=(0,g.gec)({variables:{id:null==t?void 0:t.id},skip:!t||"new"===t.id});(0,m.useEffect)(()=>{var e,t;!f&&x&&((null===(e=x.theme)||void 0===e?void 0:e.docCount)&&l(x.theme.docCount),(null===(t=x.theme)||void 0===t?void 0:t.siteCount)&&d(x.theme.siteCount))},[f,x,l,d]);let j=(0,m.useMemo)(()=>{let e=0;return s&&s>0&&(e+=s),c&&c>0&&(e+=c),e},[s,c]);return(0,i.jsxs)(W.u_,{closeOnOverlayClick:!1,isOpen:n,onClose:r,size:"lg",children:[(0,i.jsx)(K.Z,{}),(0,i.jsxs)(B.h,{children:[(0,i.jsx)(q.x,{children:(0,i.jsx)(h.cC,{id:"oh7Knm",values:{0:t.name}})}),(0,i.jsx)(V.f,{children:j>0?(0,i.jsxs)(a.x,{mb:2,children:[(0,i.jsx)(h.cC,{id:"uSopl9",values:{totalCount:j,GAMMA_ARTIFACT_PROPER_NOUN:et.Yc,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:et.aq}})," ",(0,i.jsx)(h.cC,{id:"c+lbSJ",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:et.aq}})," ","/#themes"!==o&&(0,i.jsx)(h.cC,{id:"kLomb7",components:{0:(0,i.jsx)(Y.r,{color:"trueblue.500",colorScheme:"trueblue",href:v.oH,textDecoration:"underline",isExternal:!0}),1:(0,i.jsx)(H.h,{mx:"2px"})}})]}):f?(0,i.jsx)(J.O,{h:"1em",mb:2}):(0,i.jsx)(a.x,{mb:2,children:(0,i.jsx)(h.cC,{id:"KNTN0L",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:et.aq}})})}),(0,i.jsx)(X.m,{children:(0,i.jsxs)(Z.h,{children:[(0,i.jsx)(Q.z,{variant:"ghost",onClick:r,children:(0,i.jsx)(h.cC,{id:"dEgA5A"})}),(0,i.jsx)(Q.z,{variant:"ghost",colorScheme:"red",onClick:()=>{p(),r()},children:(0,i.jsx)(h.cC,{id:"zck3yw"})})]})}),(0,i.jsx)($.o,{})]})]})},eo=(0,m.memo)(e=>{let{theme:t,openThemeEditorWithThisTheme:n,onDuplicate:r,onArchiveThemeModalOpen:o,isArchiveThemeModalOpen:s,onArchiveThemeModalClose:l}=e,{canMakeStandard:d,convertToStandard:u}=(0,G.Xm)(t);return(0,i.jsxs)(b.v,{isLazy:!0,children:[(0,i.jsx)(C.j,{as:y.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,i.jsx)(A.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,i.jsx)(h.cC,{id:"7L01XJ"})}),(0,i.jsx)(_.h,{children:(0,i.jsxs)(w.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)(c.xu,{px:4,py:0,maxWidth:"300px",children:[(0,i.jsx)(a.x,{noOfLines:3,children:t.name}),t.createdTime&&(0,i.jsx)(a.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"MXSt4t",values:{0:(0,N.Z)((0,P.Z)(t.createdTime),"PPP")}})}),t.createdBy&&(0,i.jsx)(T.kH,{label:t.createdBy.email,children:(0,i.jsx)(a.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"t490IT",values:{0:t.createdBy.displayName}})})})]}),(0,i.jsx)(k.R,{}),(0,i.jsx)(S.s,{icon:(0,i.jsx)(A.G,{icon:I.q2v,fixedWidth:!0}),onClick:n,children:(0,i.jsx)(h.cC,{id:"ePK91l"})}),(0,i.jsx)(S.s,{icon:(0,i.jsx)(A.G,{icon:I.WM4,fixedWidth:!0}),onClick:r,children:(0,i.jsx)(h.cC,{id:"euc6Ns"})}),(0,i.jsx)(k.R,{}),d&&(0,i.jsx)(S.s,{color:"orange.500",icon:(0,i.jsx)(c.xu,{boxSize:"4",children:(0,i.jsx)(U.Y,{})}),onClick:u,children:(0,i.jsx)(h.cC,{id:"thLYdn"})}),(0,i.jsx)(S.s,{color:"red.500",icon:(0,i.jsx)(A.G,{icon:I.N2j,fixedWidth:!0}),onClick:o,children:(0,i.jsx)(h.cC,{id:"B495Gs"})})]})}),s&&(0,i.jsx)(_.h,{children:(0,i.jsx)(er,{theme:t,isOpen:!0,onClose:l})})]})}),ea=e=>{let{isChecked:t,name:n}=e;return(0,i.jsxs)(o.U,{spacing:1,alignItems:"flex-start",children:[t&&(0,i.jsx)(r.n,{w:3,h:"auto",mr:1,mt:1,color:"trueblue.700"}),(0,i.jsx)(a.x,{fontSize:"sm",noOfLines:1,"data-testid":"theme-name",color:t?"trueblue.700":void 0,children:n})]})},es=(0,m.memo)(e=>{var t,n,r,a;let{theme:b,onThemeClicked:C,isChecked:y=!1,onEditClick:_,variant:w="outline"}=e,k=(0,j.z$)(),S=(0,s.p)(),I="ghost"===w,E=(0,m.useRef)(null),A=(0,m.useCallback)(e=>()=>{_&&(e?_((0,v.mg)(b,!0)):_(b))},[_,b]),{isOpen:T,onOpen:N,onClose:P}=(0,l.q)({id:"ArchiveThemeModalDisclosure"}),{user:R,currentWorkspace:G}=(0,z.SE)(),[L]=(0,g.gFs)(),U=b.name.replace(v.Qk,""),D=(0,m.useCallback)(()=>
1{if(!R||!G)return;let{id:e,...t}=b;L({variables:{id:e},update:(e,t)=>{let{data:n}=t;(null==n?void 0:n.duplicateTheme)&&e.writeQuery({query:g.$LR,variables:{workspaceId:b.workspaceId,archived:!1},data:{themes:[n.duplicateTheme]}})},optimisticResponse:{duplicateTheme:{id:"temp",__typename:"Theme",...t,name:"".concat(U," (copy)"),archived:!1,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(t=>{let{data:n}=t;n&&(null==k||k.track(j.AA.THEME_DUPLICATED,{theme_id:n.duplicateTheme.id,source_theme_id:e,name:U}),null==k||k.track(j.AA.THEME_CREATED,{theme_id:n.duplicateTheme.id,name:n.duplicateTheme.name,type:"duplicate"}),S({title:p.ag._({id:"DvRoa4",values:{0:n.duplicateTheme.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}))}).catch(e=>{console.error("Couldn't duplicate theme ".concat(b.name," error: ").concat(e)),S({title:p.ag._({id:"aOi88n",values:{err:e}}),status:"error",duration:3e3,position:"top",isClosable:!1})})},[R,G,b,L,U,k,S]),H=b.workspaceId&&!!(null===(t=b.createdBy)||void 0===t?void 0:t.displayName),W=!!C,K=!_;return(0,i.jsxs)(c.xu,{ref:E,bgColor:y?"trueblue.100":I?void 0:"linen.50",textAlign:"left",tabIndex:W?0:void 0,borderRadius:"md",transitionProperty:I?"common":"none",transitionDuration:"normal",outline:"none",onClick:()=>null==C?void 0:C(b),onKeyPress:e=>{W&&"Enter"===e.key&&(null==C||C(b))},_hover:W?{shadow:I||y?void 0:"lg",bgColor:y?"trueblue.100":I?"trueblue.50":"gray.100"}:void 0,_focus:{boxShadow:y||!W?void 0:"outline"},shadow:I?void 0:"md",p:I?2:0,"data-theme-id":b.id,"data-testid":y?"current-theme-preview":void 0,cursor:W?"pointer":void 0,children:[(0,i.jsx)(M.n,{theme:b,minH:"9em",maxH:"9em"}),(0,i.jsxs)(d.k,{align:"baseline",mt:1,direction:"column",p:I?0:2,children:[H&&(0,i.jsx)(d.k,{my:2,children:(0,i.jsx)(ea,{name:U,isChecked:y})}),(0,i.jsxs)(o.U,{alignItems:"flex-start",w:"100%",children:[H?(0,i.jsx)(x.l,{createdByYou:(null===(n=b.createdBy)||void 0===n?void 0:n.id)===(null==R?void 0:R.id),createdByName:null===(r=b.createdBy)||void 0===r?void 0:r.displayName,createdByProfileImageUrl:null===(a=b.createdBy)||void 0===a?void 0:a.profileImageUrl,timestampDescription:b.updatedTime&&(0,i.jsx)(h.cC,{id:"E1dtM3",values:{0:(0,f.Dw)(b.updatedTime)}})}):(0,i.jsx)(ea,{name:U,isChecked:y}),(0,i.jsx)(u.L,{}),K?null:b.workspaceId&&!b.archived?(0,i.jsx)(eo,{theme:b,openThemeEditorWithThisTheme:A(!1),onDuplicate:D,onArchiveThemeModalOpen:N,isArchiveThemeModalOpen:T,onArchiveThemeModalClose:P}):b.workspaceId&&!0===b.archived?(0,i.jsx)(O,{theme:b}):(0,i.jsx)(F,{onCustomizeThemeClick:A(!0),onEditThemeClick:A(!1)})]})]})]})});es.displayName="ThemePreview"},52394:function(e,t,n){"use strict";n.d(t,{t:function(){return R}});var i=n(52322),r=n(38035),o=n(36474),a=n(43297),s=n(42822),l=n(77533),c=n(62614),d=n(42946),u=n(49929),h=n(5879),p=n(2784),m=n(91994),x=n(30233),g=n(29705),f=n(47443),j=n(52929),v=n(28535),b=n(80877),C=n(74444),y=n(11082),_=n(94199),w=n(50260);let k=e=>{let{openThemeEditor:t}=e;return(0,i.jsxs)(a.K,{bg:"gray.100",p:4,textAlign:"left",spacing:4,borderRadius:"md",my:2,children:[(0,i.jsx)(l.x,{textAlign:"center",fontWeight:"700",children:(0,i.jsx)(h.cC,{id:"yNvg2Q"})}),(0,i.jsx)(l.x,{fontSize:"sm",color:"gray.700",children:(0,i.jsx)(h.cC,{id:"qYwzxB"})}),(0,i.jsx)(c.z,{onClick:t,variant:"solid",leftIcon:(0,i.jsx)(u.G,{icon:d.JyM}),"data-testid":"new-theme-button",children:(0,i.jsx)(h.cC,{id:"srRMnJ"})})]})};var S=n(67613),I=n(69251),E=n(26838);let A=e=>{let{themes:t,currentThemeId:n,setTheme:r,openThemeEditor:o}=e;return(0,i.jsx)(I.r,{gap:1,flex:1,my:2,templateColumns:{base:"repeat(2, minmax(0, 1fr))"},children:[...t].map(e=>(0,i.jsx)(E.o,{theme:e,isChecked:!!(n&&e.id===n),onEditClick:o,onThemeClicked:r,variant:"ghost"},e.id))})},T=(0,p.memo)(e=>{let{currentTheme:t,setTheme:n,openThemeEditor:r,openThemeEditorWithDefaultTheme:o}=e,s=(0,m.CG)(S.Y3),l=(0,m.CG)(S.C0);return!l&&r?(0,i.jsxs)(a.K,{spacing:8,children:[o&&(0,i.jsx)(k,{openThemeEditor:o}),(0,i.jsx)(A,{themes:s,currentThemeId:null==t?void 0:t.id,setTheme:n,openThemeEditor:r})]}):(0,i.jsxs)(i.Fragment,{children:[(null==t?void 0:t.archived)?(0,i.jsxs)(f.b,{status:"warning",mb:4,children:[(0,i.jsx)(j.z,{}),(0,i.jsxs)(v.xu,{children:[(0,i.jsx)(b.C,{children:(0,i.jsx)(h.cC,{id:"i7yZxh",values:{GAMMA_ARTIFACT_PROPER_NOUN:_.Yc}})}),(0,i.jsx)(C.X,{children:(0,i.jsx)(h.cC,{id:"jH2g5C",components:{0:(0,i.jsx)(y.r,{textDecoration:"underline",isExternal:!0,href:w.oH}),1:(0,i.jsx)(g.h,{mx:"2px"})}})})]})]}):null,(0,i.jsx)(a.K,{spacing:2,children:(0,i.jsx)(v.xu,{width:"100%",mx:0,children:(0,i.jsx)(A,{themes:s,currentThemeId:null==t?void 0:t.id,setTheme:n,openThemeEditor:r})})})]})});T.displayName="ThemePickerBodyInner";var N=n(93441),P=n(14324);let R=e=>{let{setTheme:t,openThemeEditor:n,openThemeEditorWithDefaultTheme:g,currentTheme:f,openBackgroun
1dPanel:j,shouldScrollToCurrent:v=!0,flexProps:b}=e,{isLoadingThemes:C}=(0,P.a)(),y=(0,m.CG)(S.FM);return(0,N.vm)(()=>{v&&!C&&"search"!==y&&(C||requestAnimationFrame(()=>{var e;return null===(e=document.querySelector('[data-theme-id="'.concat(null==f?void 0:f.id,'"]')))||void 0===e?void 0:e.scrollIntoView()}))},[C,null==f?void 0:f.id,y,v],[C,y]),(0,p.useEffect)(()=>{var e;null===(e=document.querySelector("[data-theme-picker-scroll-container]"))||void 0===e||e.scrollTo(0,0)},[y]),(0,i.jsxs)(r.k,{direction:"column",flex:1,h:"fit-content",...b,children:[C?(0,i.jsx)(x.S,{size:4}):(0,i.jsx)(T,{currentTheme:f,setTheme:t,openThemeEditor:n,openThemeEditorWithDefaultTheme:g}),j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.L,{}),(0,i.jsxs)(a.K,{mt:12,mb:4,p:8,border:"1px solid",borderColor:"gray.200",spacing:4,bgColor:"gray.50",borderRadius:"md",align:"center",justifyContent:"center",children:[(0,i.jsx)(s.M,{children:(0,i.jsx)(l.x,{fontSize:"sm",children:(0,i.jsx)(h.cC,{id:"UNfHm4"})})}),(0,i.jsx)(c.z,{size:"sm",w:"fit-content",leftIcon:(0,i.jsx)(u.G,{icon:d.UHQ}),onClick:j,children:(0,i.jsx)(h.cC,{id:"+EZioz"})})]})]})]})}},83947:function(e,t,n){"use strict";n.d(t,{v:function(){return E}});var i=n(52322),r=n(24624),o=n(43297),a=n(74409),s=n(36474),l=n(62614),c=n(2338),d=n(28535),u=n(75768),h=n(32899),p=n(87651),m=n(85573),x=n(89099),g=n(16556),f=n(42946),j=n(49929),v=n(5879),b=n(87254),C=n(2784),y=n(8393),_=n(91994),w=n(67613),k=n(36651),S=n(93441);let I={dark:{label:(0,i.jsx)(v.cC,{id:"pvnfJD"})},light:{label:(0,i.jsx)(v.cC,{id:"1njn7W"})},professional:{label:(0,i.jsx)(v.cC,{id:"Oojfbh"})},colorful:{label:(0,i.jsx)(v.cC,{id:"Op7PhG"})}},E=(0,C.memo)(e=>{let{title:t,description:n,showDrawerCloseButton:E,openThemeEditorWithDefaultTheme:A,stackProps:T,currentTheme:N}=e,P=(0,_.TL)(),R=(0,_.CG)(w.FM),G=(0,_.CG)(w.s1),O=(0,C.useRef)(null),{currentWorkspace:M}=(0,k.SE)(),[z,L]=(0,C.useState)(""),U=(0,_.CG)(w.C0),D=(0,C.useCallback)(()=>{P((0,w.uG)({activeView:"search"})),setTimeout(()=>{var e;null===(e=O.current)||void 0===e||e.focus()},200)},[P]),F=(0,C.useCallback)(e=>{P((0,w.ql)({searchQuery:e}))},[P]),H=(0,S.Kt)(F,500),W=(0,C.useCallback)(e=>{L(e),H(e)},[H]),K=(0,C.useCallback)(e=>{let t=[...G];G.includes(e)?t=t.filter(t=>t!==e):t.push(e),P((0,w.LT)({filterKeywords:t}))},[G,P]);return(0,S.vm)(()=>{"search"!==R&&(N&&N.workspaceId?P((0,w.uG)({activeView:"custom"})):P((0,w.uG)({activeView:"standard"})))},[P,N,R],[N]),(0,C.useEffect)(()=>()=>{P((0,w.mc)())},[]),(0,i.jsxs)(o.K,{spacing:4,...T,children:[(0,i.jsxs)(o.K,{spacing:8,children:[(0,i.jsxs)(o.K,{spacing:4,children:[(0,i.jsxs)(o.K,{direction:"row",width:"100%",pr:E?10:void 0,children:[(0,i.jsx)(a.X,{fontSize:"3xl",children:t}),(0,i.jsx)(s.L,{}),!!A&&M&&U&&(0,i.jsx)(l.z,{size:"sm",variant:"solid",leftIcon:(0,i.jsx)(j.G,{icon:f.r8p}),onClick:A,"data-testid":"new-theme-button",children:(0,i.jsx)(v.cC,{id:"FiwgR9"})}),E&&(0,i.jsx)(c.o,{})]}),n?(0,i.jsx)(d.xu,{children:n}):(0,i.jsx)(i.Fragment,{})]}),U&&(0,i.jsxs)(u.h,{variant:"ghost",size:"sm",borderRadius:"full",w:"100%",children:[(0,i.jsx)(l.z,{borderRadius:"full",w:"50%",leftIcon:(0,i.jsx)(j.G,{icon:f.D0h,fixedWidth:!0}),"data-theme-picker-active-view-button":"custom",colorScheme:"custom"===R?"trueblue":"gray",bg:"custom"===R?"trueblue.100":"gray.100",onClick:()=>P((0,w.uG)({activeView:"custom"})),children:(0,i.jsx)(v.cC,{id:"8Tg/JR"})}),(0,i.jsx)(l.z,{borderRadius:"full",w:"50%",leftIcon:(0,i.jsx)(d.xu,{w:3.5,children:(0,i.jsx)(y.Y,{})}),"data-theme-picker-active-view-button":"standard",colorScheme:"standard"===R?"trueblue":"gray",bg:"standard"===R?"trueblue.100":"gray.100",onClick:()=>P((0,w.uG)({activeView:"standard"})),children:(0,i.jsx)(v.cC,{id:"TJBHlP"})}),(0,i.jsx)(h.h,{icon:(0,i.jsx)(r.G,{}),isRound:!0,"data-theme-picker-active-view-button":"search","aria-label":b.ag._({id:"A1taO8"}),variant:"ghost",colorScheme:"search"===R?"trueblue":"gray",bg:"search"===R?"trueblue.100":"gray.100",onClick:D})]})]}),(0,i.jsx)(p.U,{in:"search"===R,children:(0,i.jsx)(m.I,{ref:O,w:"100%",placeholder:b.ag._({id:"L0fOnm"}),value:z,onChange:e=>{W(e.target.value)}})}),(0,i.jsx)(p.U,{in:"standard"===R,children:(0,i.jsx)(x.E,{children:Object.entries(I).map(e=>{let[t,{label:n}]=e,r=G.includes(t);return(0,i.jsx)(g.Vp,{size:"md",letterSpacing:"normal",cursor:"pointer",onClick:()=>{K(t)},_hover:{bgColor:r?"trueblue.200":"blackAlpha.200"},colorScheme:r?"trueblue":"blackAlpha",children:n},t)})})})]})});E.displayName="ThemePickerHeader"},62040:function(e,t,n){"use strict";n.d(t,{n:function(){return s}});var i=n(62564),r=n(2784),o=n(14274),a=n(42111);let s=e=>{let t=(0,a.ye)("debugLogging");(0,r.useEffect)(()=>
1{if(e){if(t){console.debug("[Prosemirror DevTools] Activating prosemirror-dev-tools");try{(0,i.h)(e.view)}catch(e){}}else(0,i.P)();return o.v.DEBUG_ENABLED&&(window.openPMDT=()=>(0,i.h)(e.view)),()=>{(0,i.P)(),delete window.openPMDT}}},[e,t])}},6085:function(e,t,n){"use strict";n.d(t,{m:function(){return c}});var i=n(72338),r=n(27191),o=n(37160),a=n(86581),s=n(18455),l=n(87008);let c=i.hj.create({name:"clipboardLight",addCommands:()=>({insertMarkdownAt:(e,t)=>n=>{let{state:i,tr:r}=n;try{let n=(0,a.aT)(t,i.schema);return r.replaceRange(e.from,e.to,n),!0}catch(e){return console.warn("(caught) [Clipboard] insertMarkdownAt error",e),!1}}}),addProseMirrorPlugins(){let e=this.editor;return[new r.Sy({key:new r.H$("clipboardLight"),props:{clipboardSerializer:{serializeFragment:t=>(0,l.Xb)(t,e.schema)},handlePaste:(t,n,i)=>(0,a.iO)(e,n)||(0,o.g)(t,n,i),transformPastedHTML:e=>(0,s.B)(e,!0)}})]}})},7603:function(e,t,n){"use strict";n.d(t,{o:function(){return a}});var i=n(89220),r=n(2784),o=n(36651);let a=()=>{let{push:e}=(0,i.useRouter)(),{userStatus:t}=(0,o.SE)();(0,r.useEffect)(()=>{"loggedOut"===t&&e("/signin?redirect_to=".concat(encodeURIComponent(window.location.href)))},[t,e])}},83624:function(e,t,n){"use strict";n.r(t);var i=n(52322),r=n(5632),o=n(71537),a=n(4661),s=n(23082),l=n(21723),c=n(14581),d=n(7603),u=n(13265);t.default=(0,o.z)((0,a.o)((0,c.$)(()=>{(0,d.o)();let e=(0,r.useRouter)(),t=(0,u.g)();return t&&e.isReady?(0,i.jsx)(l.B,{id:e.query.id,children:(0,i.jsx)(s.m,{autosetLocale:!1})}):null})))},7e4:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});var i=n(2784),r=n(18733);function o(e,t){let[n,o]=(0,i.useState)(()=>{try{let n=r.Q.getItem(e);if(null===n)return t;return JSON.parse(n)}catch(e){return console.error("[useSessionStorage.getItem] Error getting sessionStorage item",e),t}}),a=(0,i.useCallback)(t=>{try{r.Q.setItem(e,JSON.stringify(t)),o(t)}catch(e){console.error("[useSessionStorage.setItem] Error setting sessionStorage item",e)}},[e]);return[n,a]}},62376:function(){},6991:function(){},76298:function(){},4466:function(){},43839:function(){},24624:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var i=(0,n(67012).I)({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"})},52518:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var i=null}},function(e){e.O(0,[9774,7662,8433,2182,2812,8774,6694,4078,3273,9025,5333,4424,8707,146,3661,3016,2545,235,5112,3693,931,2808,6618,7603,2252,1537,6656,2681,8794,9718,6390,2888,179],function(){return e(e.s=10366)}),_N_E=e.O()}]);
2//# sourceMappingURL=[id]-d9da6352725bd616.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.