1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33],{4852:function(e,i,t){t.r(i),t.d(i,{default:function(){return C},formatHaikuText:function(){return k}});var l=t(7437),n=t(2067),s=t.n(n),o=t(2265),a=t(3159),r=t(5932),c=t(2053),d=t(7143),u=t(8998),m=t(5195);async function p(e){await new Promise(i=>{setTimeout(()=>i(!0),e)})}var h=t(3819),f=t(9422),v=t(3530),g=t(3098);let x=(e,i)=>['"'.concat((0,m.kC)(e.theme),'", '),"limericks.ai/".concat(e.id)],k=(e,i)=>{let t=x(e,i);return(null==e?void 0:e.poem.map((e,i)=>(0,m.OB)(e)).join("\n"))+"\nâ".concat(t.join(""),"\n")};function C(e){var i;let{user:t,mode:n,haiku:x,popPoem:k,styles:C,altStyles:b,fontSize:y,padding:j,onboardingElement:w,regeneratePoem:N,regenerateImage:R,saveHaiku:A,copyHaiku:_,switchMode:S,regenerating:I,updateLayout:Z}=e,E="showcase"==n,z=s()().format("YYYYMMDD"),D=(null==x?void 0:null===(i=x.layout)||void 0===i?void 0:i.custom)||d.No[d.nB],[M,T]=(0,o.useState)(!1),H=M||I,L=!!S,B=L&&!H&&!0,P=!!_&&!L,O=P&&!H,U=(null==x?void 0:x.createdBy)==(null==t?void 0:t.id)||(null==t?void 0:t.isAdmin)||(null==x?void 0:x.isDemo),Y=U&&!E,[F,W]=(0,o.useState)(!1),[G,Q]=(0,o.useState)(null==x?void 0:x.version),K=!!Z&&((null==t?void 0:t.isAdmin)||(null==x?void 0:x.createdBy)&&(null==x?void 0:x.createdBy)==(null==t?void 0:t.id))&&!H&&!0,J=N&&((null==t?void 0:t.isAdmin)||(null==x?void 0:x.createdBy)==(null==t?void 0:t.id))&&N,q=R&&((null==t?void 0:t.isAdmin)||(null==x?void 0:x.createdBy)==(null==t?void 0:t.id))&&R,X=J&&!H,$=q&&!H,[V,ee]=(0,o.useState)(x&&x.poem.map(e=>e.split(/\s+/).map(e=>e))),[ei,et]=(0,o.useState)(x&&x.poem.map(e=>e.split(/\s+/).map(e=>e))),[el,en]=(0,o.useState)(x&&x.poem.map(e=>e.split(/\s+/).map(e=>e))),[es,eo]=(0,o.useState)(),ea=[[(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)()],[(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)()],[(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)()],[(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)()],[(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)(),(0,o.useRef)()]],er=(0,o.useRef)(),[ec,ed]=(0,o.useState)(!1),[eu,em]=(0,o.useState)(!1),[ep,eh]=(0,o.useState)(),ef=[2e3,5,5,0,0,2e3],[ev,eg]=(0,o.useState)(!0),[ex,ek]=(0,o.useState)(0),[eC,eb]=(0,o.useState)(0),ey=e=>{W(!0),er.current=void 0},ej=(0,c.y1)(()=>{eo(x&&x.poem.map(e=>e.split(/\s+/).map(e=>e)));let e=ei.map(e=>e.join(" ").replaceAll(/(\.\.\.\s?)+/g,"..."));T(!0),A({...x,poem:e}).then(e=>{ee(e&&e.poem.map(e=>e.split(/\s+/).map(e=>e))),et(e&&e.poem.map(e=>e.split(/\s+/).map(e=>e))),en(e&&e.poem.map(e=>e.split(/\s+/).map(e=>e))),T(!1)})},2e3),ew=(0,c.y1)(()=>{ee(V.map(e=>[...e])),et(ei.map(e=>[...e]))},10),eN=async e=>{if(!H){let i=!1;e.forEach(e=>{let[t,l]=e;V[t][l]&&(V[t][l]="",ei[t][l]="...",i=!0)}),i&&ew(),ej()}},eR=async(e,i,t)=>{Y&&(er.current=setTimeout(()=>{eD(e,i,t)},250),F&&(em(eu=!0),e_(e,i,t)))},eA=async(e,i,t)=>{er.current&&clearTimeout(er.current),er.current=void 0,F&&(em(eu=!1),ed(ec=!1))},e_=async(e,i,t)=>{F&&eu&&(ec||ed(ec=!0),eN([[i,t]]))},[eS,eI]=(0,o.useState)(),[eZ,eE]=(0,o.useState)(),ez=(0,c.y1)(()=>{eE(eZ)},100),eD=async(e,i,t)=>{er.current&&(clearTimeout(er.current),er.current=void 0,W(F=!0),eR(e,i,t)),F&&(eI(eS=ea.map(e=>e.map(e=>(null==e?void 0:e.current)&&e.current.getBoundingClientRect()).filter(
1Boolean))),eh(ep=[i,t]),eZ=[e.clientX,e.clientY],ez())},eM=e=>{let i=e.touches[0],t=i.pageX,l=i.pageY,n=eZ&&eZ.length>=1&&eZ[0]||t,s=eZ&&eZ.length>=2&&eZ[1]||l;eZ=[t,l],ez();let o=eS&&eS.map((e,i)=>e.map((e,o)=>{let{x:a,y:r,width:c,height:d}=e;if(t>=a&&n<=a+c&&l>=r&&s<=r+d)return[i,o]})).flat().filter(Boolean),a=o&&o[0];a&&a.length>=2&&V[a[0]][a[1]]&&eN(o)},eT=(0,c.y1)(e=>{ep&&(eN([ep]),eh(ep=void 0)),eM(e)},1),eH=async e=>{F&&(eT(e),ec||ed(ec=!0))},eL=()=>{var e,i,n,s;return(0,l.jsxs)("div",{className:"poem-buttons onboarding-container group/actions _bg-yellow-200 flex flex-row md:gap-3 gap-[0.5rem]",onClick:e=>e.preventDefault(),children:[w&&["poem-actions"].includes(w)&&(0,l.jsx)("div",{className:"onboarding-focus"}),w&&["poem-and-poem-actions"].includes(w)&&(0,l.jsx)("div",{className:"onboarding-focus double"}),U&&(0,l.jsx)("div",{className:"".concat(H?"cursor-default":"cursor-pointer"," md:mt-[0.05rem] mt-[0.03rem]"),title:"Edit this haiku",onClick:e=>{e.preventDefault(),Y&&W(!F)},children:(0,l.jsx)(v.N,{styles:b||[],children:(0,l.jsx)(f.Z,{children:(0,l.jsx)(a.hWE,{className:"\n h-4 w-4 md:h-5 md:w-5 \n ".concat(F?"animate-pulse":"","\n ").concat(H||!Y?"opacity-60":Y?"opacity-100":"","\n ")})})})}),J&&(0,l.jsxs)("div",{className:"_bg-pink-200 md:mt-[-0.02rem] mt-[0]",children:[!(null==t?void 0:t.isAdmin)&&((null==t?void 0:null===(e=t.usage[z])||void 0===e?void 0:e.haikusRegenerated)||0)>=u.Q.DAILY_REGENERATE_HAIKU&&(0,l.jsx)("span",{title:"Exceeded daily limit: try again later",children:(0,l.jsx)(v.N,{styles:b||[],children:(0,l.jsx)(g.e,{sizeOverwrite:"\n h-[1.1rem] w-[1.1rem] md:h-6 md:w-6\n ".concat("poem-actions"==w?"opacity-100":"opacity-60","\n ")})})}),((null==t?void 0:t.isAdmin)||((null==t?void 0:null===(i=t.usage[z])||void 0===i?void 0:i.haikusRegenerated)||0)<u.Q.DAILY_REGENERATE_HAIKU)&&(0,l.jsx)("span",{title:"Regenerate this haiku with the same theme",children:(0,l.jsx)(v.N,{styles:b||[],children:(0,l.jsx)(f.Z,{children:(0,l.jsx)(g.e,{onClick:()=>X&&N(),sizeOverwrite:"\n h-[1.1rem] w-[1.1rem] md:h-6 md:w-6 \n ".concat(X||"poem-actions"==w?"cursor-pointer opacity-100":"opacity-60"," \n ")})})})})]}),q&&(0,l.jsxs)("div",{className:"_bg-pink-200 md:mt-[-0.05rem] mt-[-0.02rem] md:ml-[-0.2rem] ml-[-0.1rem]",children:[!(null==t?void 0:t.isAdmin)&&((null==t?void 0:null===(n=t.usage[z])||void 0===n?void 0:n.haikusRegenerated)||0)>=u.Q.DAILY_REGENERATE_HAIKU&&(0,l.jsx)("span",{title:"Exceeded daily limit: try again later",children:(0,l.jsx)(v.N,{styles:b||[],children:(0,l.jsx)(r.F2F,{className:"\n h-[1.2rem] w-[1.2rem] md:h-6 md:w-6 \n ".concat("poem-actions"==w?"opacity-100":"opacity-60","\n ")})})}),((null==t?void 0:t.isAdmin)||((null==t?void 0:null===(s=t.usage[z])||void 0===s?void 0:s.haikusRegenerated)||0)<u.Q.DAILY_REGENERATE_HAIKU)&&(0,l.jsx)("span",{title:"Regenerate this haiku's art with the same theme",children:(0,l.jsx)(v.N,{styles:b||[],children:(0,l.jsx)(f.Z,{children:(0,l.jsx)(r.F2F,{onClick:()=>$&&R(),className:"\n h-[1.2rem] w-[1.2rem] md:h-6 md:w-6 \n ".concat(X||"poem-actions"==w?"cursor-pointer opacity-100":"opacity-60"," \n ")})})})})]})]})};return(0,o.useEffect)(()=>{(null==x?void 0:x.version)&&x.version!=G&&(W(!1),Q(x.version))}
1,[null==x?void 0:x.version]),(0,o.useEffect)(()=>{let e;if(ev){let i=async e=>{if(e<x.poem.length)for(let i=0;i<x.poem[e].length;i++)eb(eC=i),i==x.poem[e].length-1?await p(0):await p(50)};e=setTimeout(async()=>{for(let e=0;e<x.poem.length+1;e++)ek(ex=e),ex>0&&await i(ex-1),await p(ef[e]);e=!1},0)}return()=>{e&&clearTimeout(e)}},[ev]),(0,l.jsxs)("div",{className:"relative h-full",children:[!E&&(0,l.jsx)("div",{className:"_bg-pink-100 fixed top-0 left-0 w-full h-full ".concat(H?" opacity-50":""),onClick:()=>F&&W(!1)}),(0,l.jsxs)("div",{className:"onboarding-container flex",style:{height:"100%"},children:[w&&["poem"].includes(w)&&(0,l.jsx)("div",{className:"onboarding-focus double"}),w&&["poem-and-poem-actions"].includes(w)&&(0,l.jsx)("div",{className:"onboarding-focus"}),(0,l.jsx)("div",{className:"h-full _bg-pink-200 _p-[2.5rem] ".concat(H?"animate-pulse":""),style:{cursor:E?"pointer":"",fontSize:y,width:"100vw",height:"min(100vh, 100dvh)",padding:"string"==typeof j?j:E?"32px 32px":"72px 32px"},onTouchMove:eH,onMouseLeave:eA,onMouseEnter:eA,children:(0,l.jsx)("div",{className:"h-full _bg-purple-200 flex flex-col _transition-all w-fit m-auto md:text-[26pt] sm:text-[22pt] text-[18pt]",onClick:e=>{if(er.current)return ey(e);if(console.log(">> app._components.HaikuPoem.handleClickHaiku()",{mode:n,haikuId:null==x?void 0:x.id,status:null==x?void 0:x.status,popPoem:k,haiku:x}),!F){if(O)return(0,h.Z)("haiku-copied",{userId:null==t?void 0:t.id,id:null==x?void 0:x.id,location:"haiku-poem"}),_();if(B)return(0,h.Z)("switched-mode",{userId:null==t?void 0:t.id,id:null==x?void 0:x.id}),S(E?"":"showcase")}},title:K?"Update layout":O?"Click to copy haiku poem":E?"Click to switch to edit mode":B?"Click to switch to showcase mode":K?"Click to change layout":"",style:{cursor:K?"row-resize":E?"pointer":"",fontSize:y},children:(0,l.jsx)(f.Z,{className:"h-full",color:F?null==x?void 0:x.color:null==x?void 0:x.bgColor,force:k||F||(null==x?void 0:x.version)&&x.version!=G,disabled:F||!O&&!B&&!K,active:!!(w&&w.includes("poem")),hoverSupported:!1,children:(0,l.jsx)("div",{className:"h-full inner-container _bg-yellow-200 flex flex-col justify-between gap-1",children:Array.apply(0,Array(2*el.length+1)).map((e,i)=>({spacer:!(i%2),i:Math.floor(i/2)})).map(e=>{let{spacer:i,i:t}=e;return(0,l.jsxs)("div",{className:"line-and-spacer ".concat(i?"spacer-"+t:"line-"+t," flex flex-col ").concat(i?"_flex-grow":"_flex-grow-0"),style:{flexGrow:i&&(null==D?void 0:D.spacing)&&(null==D?void 0:D.spacing[t])||0},children:[(null==D?void 0:D.spacing)&&i&&(0,l.jsx)("div",{className:"spacer _bg-orange-200 flex h-full w-full",style:{}}),!i&&t<el.length&&(0,l.jsx)("div",{className:"\n _bg-pink-200 line-container flex md:my-[0.05rem] sm:my-[0.03rem] my-[0.15rem] _transition-all leading-[1.0em] tracking-[0rem]\n ".concat((null==D?void 0:D.alignments[t])=="center"?"m-auto":(null==D?void 0:D.alignments[t])=="end"?"my-auto ml-auto":"my-auto mr-auto","\n "),children:(0,l.jsx)(v.N,{className:"_bg-yellow-200 ",styles:E?[...C,...C.slice(1,2)]:C,children:(0,l.jsx)("div",{className:"relative m-[0rem] _transition-all",children:(0,l.jsx)("div",{className:"poem-line-input poem-line-".concat(t," _bg-orange-400 flex flex-row flex-wrap items-center md:gap-[1.0rem] gap-[0.4rem] _opacity-50 md:min-h-[3.5rem] sm:min-h-[3rem] min-h-[2.5rem] \n ").concat(K?"cursor-row-resize":K?"cursor-row-resize":E||B?"cursor-pointer":""),style:{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",MozUserSelect:"none",msUserSelect:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",justifyContent:(null==D?void 0:D.alignments[t])||"start"},children:el[t].map((e,i)=>(0,l.jsx)("div",{ref:ea[t][i],className:"poem-line-word poem-line-word-".concat(i," _bg-yellow-200 relative _mx-[-0.7rem] \n ").concat(H?"cursor-wait opacity-50 animate-pulse":F?"cursor-crosshair opacity-80":K?"cursor-row-resize":O||B?"cursor-pointer":""),style:{transition:"opacity 0.5s ease-out",visibility:ev&&(t==ex-1&&i>=eC||t>=ex)?"hidden":"visible"},onMouseDown:e=>eR(e,t,i),onTouchStart:e=>eR(e,t,i),onMouseUp:e=>
1eA(e,t,i),onTouchEnd:e=>eA(e,t,i),onMouseMove:e=>e_(e,t,i),onPointerEnter:e=>eD(e,t,i),children:(0,l.jsx)("div",{className:"".concat(V[t][i]?"opacity-100":"opacity-20"," transition-opacity"),children:(0,l.jsxs)(f.Z,{color:null==x?void 0:x.color,force:!V[t][i]||!!(es&&es[t][i]&&es[t][i]!=el[t][i]),disabled:!F||F&&!V[t][i],hoverSupported:!0,children:[0==i&&(0,l.jsx)("span",{children:(0,m.OB)(el[t][i])}),0!=i&&(0,l.jsx)("span",{children:el[t][i]})]})})},"line-".concat(t,"-word-").concat(i)))})})})},t),!i&&t==el.length-1&&!E&&(P||J||U)&&(!ev||ex>=x.poem.length)&&(0,l.jsx)("div",{className:"flex flex-grow-0 justify-end relative h-0",children:(0,l.jsx)("div",{className:"absolute top-0 right-0 z-40",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:(0,l.jsx)(eL,{})})})]},"".concat(i?"spacer-"+t:"line-"+t))})})})})})]})]})}},7160:function(e,i,t){t.d(i,{R:function(){return u},Z:function(){return m}});
1var l=t(7437),n=t(1396),s=t.n(n),o=t(2265),a=t(9604),r=t.n(a),c=t(3530),d=t(5476);let u=["Tickling Leprachans","Milking Unicorns","Separating Green Skittles","Befriending Ghosts in the Attic","Arm Wrestling with Mannequins","Brewing Coffee for Sleepwalkers","Negotiating with Noisy Neighbors","Pillow Fighting with Pirates","Serenading Seahorses","Training Turtles for the Olympics","Playing Poker with Parrots","Crocheting Cozies for Bald Eagles","Waltzing with Washing Machines","Squishing Marshmallows on Millionaires","Sipping Secrets from Soup Spoons","Gossiping with Goldfishes","Knitting Sweaters for Snakes","Babysitting Bandicoots","Tickling Turtles with Feathers","Serenading Sandwiches at Midnight"];function m(e){let{styles:i=[]}=e;return(0,l.jsx)(o.Suspense,{fallback:(0,l.jsx)(s(),{href:"/",className:"".concat(r().className," _bg-pink-200 absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-full p-2 opacity-50 cursor-pointer z-50 md:text-[26pt] sm:text-[22pt] text-[16pt]"),style:{textDecoration:"none"},children:(0,l.jsx)(c.N,{styles:i,children:(0,l.jsx)("div",{className:"animate-pulse flex flex-col items-center",children:(0,l.jsx)("div",{className:"_bg-pink-200 relative text-center w-[80vw]",children:""})})})}),children:(0,l.jsx)(d.default,{styles:i})})}},9422:function(e,i,t){t.d(i,{Z:function(){return s}});var l=t(7437),n=t(2265);function s(e){let{color:i="#ffffff",active:t,disabled:s,force:o,hoverSupported:a,className:r,children:c}
1=e,[d,u]=(0,n.useState)(!1),m=()=>{u(!0),setTimeout(()=>u(!1),100)},p=()=>!s&&u(!0),h=()=>!s&&m();return(0,n.useEffect)(()=>{o&&m()},[o]),(0,l.jsx)("div",{className:r||"",style:{filter:"".concat(d||t?"drop-shadow(0px 0px 16px ".concat(i,")"):"")},onMouseDown:p,onPointerEnter:()=>a&&p(),onMouseUp:h,onPointerLeave:()=>a&&h(),children:c})}},3530:function(e,i,t){t.d(i,{N:function(){return n}});var l=t(7437);function n(e){let{styles:i,className:t,disabled:s,children:o}=e;return s?(0,l.jsx)("div",{className:t||"",children:o}):(0,l.jsxs)("div",{style:i[0],className:t||"",children:[i.length>0&&(0,l.jsx)(n,{styles:[...i.slice(1)],children:o}),0==i.length&&(0,l.jsx)(l.Fragment,{children:o})]})}},5476:function(e,i,t){t.r(i),t.d(i,{default:function(){return u}});var l=t(7437),n=t(1396),s=t.n(n),o=t(2265),a=t(3530),r=t(7160),c=t(9604),d=t.n(c);function u(e){let{styles:i=[]}=e,[t,n]=(0,o.useState)(""),[c,u]=(0,o.useState)();return(0,o.useEffect)(()=>(!c&&r.R.length>1&&setTimeout(()=>{n("Loading"),u(setInterval(()=>n(r.R[Math.floor(Math.random()*r.R.length)]),4500))},1500),()=>c&&clearInterval(c)),[]),(0,l.jsx)(s(),{href:"/",className:"".concat(d().className," _bg-pink-200 absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-full p-2 z-50 md:text-[26pt] sm:text-[22pt] text-[16pt]"),style:{textDecoration:"none"},children:(0,l.jsx)(a.N,{styles:i,children:(0,l.jsx)("div",{className:"flex flex-col items-center",children:(0,l.jsx)("div",{className:"_bg-pink-200 relative text-center w-[80vw] animate-pulse-offset",children:t?"".concat(t,"..."):""})})})})}},3098:function(e,i,t){t.d(i,{Z:function(){return x},e:function(){return g}});var l=t(7437),n=t(2067),s=t.n(n),o=t(1396),a=t.n(o),r=t(2265),c=t(6468),d=t(3530),u=t(9422),m=t(9604),p=t.n(m),h=t(3819),f=t(8998);let v=["There once was a man fromâ¦","There once was a man fromâ¦","There once was a man fromâ¦","There once was a man fromâ¦","There once was a man from Nantucket","There was a young man from Nantucket","But he followed the pair to Pawtucket","Then the pair followed Pa to Manhasset"];function g(e){let{onClick:i,sizeOverwrite:t,style:n,children:s}=e,o=(0,l.jsx)(c.UTX,{style:n,className:"_bg-orange-600 _hover: _text-purple-100 ".concat(t||"h-5 w-5 md:h-7 md:w-7 md:mt-[-0.3rem] mt-[-0.4rem]")});return(0,l.jsxs)(a(),{className:"generate-icon flex flex-row m-auto gap-2 hover:no-underline",style:{cursor:n||i?"pointer":"default"},href:"#",onClick:e=>{e.preventDefault(),i&&i(e)},children:[s&&(0,l.jsx)("div",{className:"".concat(p().className," _bg-yellow-200 md:mt-[-0.2rem] mt-[-0.2rem] md:text-[20pt] text-[16pt]"),children:s}),(0,l.jsx)("div",{className:"_bg-yellow-300 m-auto",children:o})]})}function x(e){var i;let{user:t,color:n,bgColor:o,styles:a,altStyles:c,generate:m,onboardingElement:p}=e,[x,k]=(0,r.useState)(!1),[C,b]=(0,r.useState)(!1),[y,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(v[0]),[R,A]=(0,r.useState)(),[_,S]=(0,r.useState)(1),I=(0,r.useRef)(),Z=p&&p.includes("generate"),E=s()().format("YYYYMMDD"),z=!(null==t?void 0:t.isAdmin)&&((null==t?void 0:null===(i=t.usage[E])||void 0===i?void 0:i.haikusCreated)||0)>=f.Q.DAILY_CREATE_HAIKU,D=()=>{k(!1),b(!1),j(!1),I.current.blur(),m(C||I.current.value?I.current.value:w.split("â¦").join()),I.current.value=""};return(0,r.useEffect)(()=>(R||A(setInterval(()=>{N(v[Math.floor(Math.random()*v.length)])},5e3)),()=>R&&clearInterval(R)),[]),(0,l.jsx)("div",{onMouseOver:()=>{z||k(!0)},onMouseOut:()=>{I.current.value||k(!1)},className:"GenerateInput _bg-pink-200 absolute\n top-[0.8rem] md:top-[0.8rem] right-[3.2rem] md:right-[3.8rem] md:left-1/2 lg:transform md:-translate-x-1/2\n w-[calc(100vw-6.5rem)] md:w-[600px]\n ",style:{zIndex:Z?"50":"20"},children:(0,l.jsxs)("div",{className:"onboarding-container",style:{width:"auto"},children:[Z&&(0,l.jsx)("div",{className:"onboarding-focus double"}),(0,l.jsx)(d.N,{styles:Z?a.slice(0,3):a.slice(0,2),children:(0,l.jsxs)("div",{className:"bg-yellow-200 flex flex-row gap-0",children:[(0,l.jsxs)("div",{className:"_bg-yellow-200 haiku-theme-input flex-grow text-[12pt] md:text-[16
1pt]",children:[(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n .haiku-theme-input textarea {\n background: none;\n _background: pink; /* for debugging */\n outline: 2px solid ".concat(o||"","88;\n background-color: ").concat(o||"#ffffff","44;\n caret-color: ").concat(n||"#000000",";\n border-radius: 5px;\n height: auto;\n WebkitTextStroke: 0.5px ").concat(o,";\n -webkit-text-stroke: 1.25px ").concat(n,"66;\n text-stroke: 1.0px ").concat(n,"66;\n }\n .haiku-theme-input.poem-line-",42," input {\n outline: none;\n background-color: ").concat(o||"#ffffff","44; \n }\n ").concat(Z?"":".haiku-theme-input textarea:focus"," {\n outline: 2px solid ").concat(o||"","88;\n background-color: ").concat(o||"#ffffff","66;\n }\n ").concat(Z?"":".haiku-theme-input textarea:focus::placeholder"," {\n opacity: 0;\n }\n .haiku-theme-input textarea::selection { \n background: ").concat(n||"#000000","66 \n }\n .haiku-theme-input textarea::placeholder {\n color: ").concat(n||"#000000",";\n -webkit-text-stroke: 1px ").concat(n,";\n text-stroke: 1px ").concat(n,";\n opacity: 0.4;\n text-align: center; \n }\n .haiku-theme-input textarea::-ms-input-placeholder { /* Edge 12 -18 */\n color: ").concat(n||"#000000",";\n text-stroke: 1px ").concat(n,";\n opacity: 0.4;\n text-align: center; \n }")}}),(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)("textarea",{rows:_,resize:"none",ref:I,maxLength:256,placeholder:"".concat(w),disabled:z,value:void 0,onChange:e=>{k(!0),S(Math.min(I.current.value.split("\n").length,5))},onFocus:()=>{(0,h.Z)("clicked-generate-haiku-input",{userId:null==t?void 0:t.id}),k(!0),b(!0),I.current.value||(I.current.value=w.split("â¦").join(" "),I.current.select())},onBlur:()=>{k(!1),b(!1)},onKeyDown:e=>{"Escape"==e.key?((0,h.Z)("cancelled-generate-haiku",{userId:null==t?void 0:t.id}),k(!1),I.current.value="",I.current.blur()):"Enter"!=e.key||e.shiftKey||z||!D||D()},className:"w-full absolute top-0 left-0\n pt-[0.1rem] pr-[2rem] md:pr-[2.6rem] pb-[0.1rem] pl-[0.7rem]\n mt-[-0.1rem] mr-[-0.1rem] mb-0 ml-0 md:mt-[0.1rem] md:mr-[0rem] \n ",style:{cursor:z?"not-allowed":"text",resize:"none"},title:z?"Exceeded daily limit: try again later":"Enter theme, subject or leave blank, and click the button to create a new haiku"})})]}),(0,l.jsx)("div",{className:"relative w-0",children:(0,l.jsx)("div",{className:"_bg-pink-200 p-[0.5rem] absolute md:top-[0.1rem] _top-[-0.5rem] md:right-[-0.1rem] right-[-0.2rem] z-20",style:{opacity:x?"1":"0.6"},onMouseDown:()=>!z&&j(!0),onMouseUp:()=>y&&!z&&D(),title:z?"Exceeded daily limit: try again later":"Create a new haiku",children:(0,l.jsx)(u.Z,{children:(0,l.jsx)(d.N,{styles:c.slice(0,2),children:(0,l.jsx)(g,{style:{cursor:z?"not-allowed":"pointer"}})})})})})]})})]})})}},3777:function(e,i,t){t.r(i),t.d(i,{NavOverlay:function(){return T}});
1var l=t(7437),n=t(2265),s=t(9604),o=t.n(s),a=t(9422),r=t(3530),c=t(1289),d=t(3819),u=t(1396),m=t.n(u),p=e=>{let{className:i,color:t="#555555"}=e;return(0,l.jsxs)("svg",{version:"1.1",className:i||"",viewBox:"0 0 1600 1600",width:"1280",height:"1280",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M0 0 C13.81545106 11.41122536 22.17004102 27.2041455 24.24145508 45.02197266 C24.73985906 61.29245115 19.82681548 76.98962774 8.80004883 89.22509766 C8.15036133 89.95857422 7.50067383 90.69205078 6.83129883 91.44775391 C-1.87676061 100.69142811 -11.9289164 106.41095629 -24.75854492 107.53759766 C-40.12558806 107.80689962 -54.65297758 104.82811714 -66.19995117 94.22509766 C-66.81612305 93.67466797 -67.43229492 93.12423828 -68.06713867 92.55712891 C-75.9962424 84.57516449 -80.85567292 73.07288674 -80.82495117 61.85009766 C-80.45289436 51.06174635 -77.15286569 43.11478333 -71.19995117 34.22509766 C-70.58120117 33.29697266 -69.96245117 32.36884766 -69.32495117 31.41259766 C-63.26976991 25.17932283 -56.06865356 22.17643548 -47.44995117 21.91259766 C-38.54227756 22.11103593 -31.52302638 23.87723258 -24.95776367 30.12353516 C-19.45222508 36.70571241 -16.79656148 44.34509286 -16.92260742 52.84619141 C-17.5608145 58.32039019 -19.9258725 62.06684432 -23.94995117 65.72509766 C-27.94393614 67.56847533 -30.88051768 67.94069243 -35.19995117 67.22509766 C-39.35990701 65.655303 -41.96442216 64.10785857 -44.19995117 60.22509766 C-45.57143625 56.60936426 -45.59505749 53.0444587 -45.19995117 49.22509766 C-43.74169594 46.89494857 -42.13817515 45.21177724 -40.19995117 43.22509766 C-44.61815737 40.27962686 -49.01653103 40.42518714 -54.19995117 41.22509766 C-56.33488048 43.42150239 -56.33488048 43.42150239 -57.19995117 46.22509766 C-57.71557617 46.72009766 -58.23120117 47.21509766 -58.76245117 47.72509766 C-61.24728146 50.31796404 -62.09224451 52.6939165 -62.34448242 56.27978516 C-62.04765764 64.90183845 -58.10262366 74.003681 -52.23901367 80.34619141 C-50.29258284 81.88871861 -48.4033724 83.08495528 -46.19995117 84.22509766 C-45.59666992 84.55896484 -44.99338867 84.89283203 -44.37182617 85.23681641 C-36.15928821 89.04978046 -25.8454172 88.16655589 -17.47729492 85.26416016 C-13.54764148 83.47121364 -10.38522362 81.1214253 -7.19995117 78.22509766 C-6.65467773 77.73396484 -6.1094043 77.24283203 -5.54760742 76.73681641 C1.44342901 69.567891 4.26400094 59.91675034 4.30004883 50.10009766 C4.00288571 37.61924665 0.53579079 26.85912539 -8.52807617 17.93212891 C-19.11807208 9.05717951 -32.14760757 3.31970513 -46.17260742 3.82275391 C-57.92935453 5.38526352 -67.9131385 10.30529523 -77.96948242 16.33447266 C-81.19995117 18.22509766 -81.19995117 18.22509766 -84.19995117 19.22509766 C-84.90389729 20.53913041 -85.56340775 21.87712336 -86.19995117 23.22509766 C-89.58307384 27.69955021 -89.58307384 27.69955021 -91.70385742 29.50634766 C-93.74888139 31.85572245 -94.31767976 34.18860776 -95.19995117 37.16259766 C-96.89203541 42.85223092 -96.89203541 42.85223092 -98.69995117 45.04150391 C-102.96932854 51.25656106 -102.75177055 60.49893049 -103.29760742 67.78369141 C-103.38107925 68.87628769 -103.46455109 69.96888397 -103.55055237 71.09458923 C-104.36836161 82.49264866 -104.63493093 93.86291146 -104.63745117 105.28759766 C-104.64018036 106.3861911 -104.64290955 107.48478455 -104.64572144 108.6166687 C-104.65390462 131.0778999 -103.048985 153.33990012 -101.06689453 175.69604492 C-100.84122943 178.248
165499 -100.61604246 180.80130738 -100.39135742 183.35400391 C-100.28317184 184.58155899 -100.17498627 185.80911407 -100.06352234 187.0738678 C-98.96171721 200.10878181 -98.52026762 213.14928504 -98.19995117 226.22509766 C-96.83531738 226.65375122 -96.83531738 226.65375122 -95.44311523 227.09106445 C-92.80200026 228.01457989 -90.68182811 228.93537793 -88.30932617 230.36962891 C-87.6092041 230.79244141 -86.90908203 231.21525391 -86.18774414 231.65087891 C-85.08003662 232.33730469 -85.08003662 232.33730469 -83.94995117 233.03759766 C-83.1663623 233.51970703 -82.38277344 234.00181641 -81.57543945 234.49853516 C-74.3380643 239.01810183 -67.45597739 243.97276951 -60.58276367 249.02197266 C-53.9049027 253.92634956 -47.07172282 258.59793755 -40.19995117 263.22509766 C-39.60762695 263.62712402 -39.01530273 264.02915039 -38.4050293 264.44335938 C-17.89460007 278.30561993 2.95570539 287.6749193 28.05004883 287.72509766 C28.75192322 287.72711182 29.45379761 287.72912598 30.17694092 287.73120117 C52.255565 287.68857956 72.32317411 282.15787255 88.56176758 266.55712891 C96.16711607 258.63323179 101.41700203 250.26726816 105.80004883 240.22509766 C106.23704102 239.25443359
1106.6740332 238.28376953 107.12426758 237.28369141 C113.14532943 221.41766527 111.3984691 200.00615556 104.98754883 184.47509766 C104.28456605 183.04525722 103.55421569 181.62861496 102.80004883 180.22509766 C102.36821289 179.40396484 101.93637695 178.58283203 101.49145508 177.73681641 C94.06748702 164.47829351 82.58752406 156.74661352 68.23754883 152.22509766 C54.91181732 149.20459851 42.39084429 151.48762031 30.42504883 157.85009766 C24.5710232 161.57451853 20.86967681 167.0858417 17.80004883 173.22509766 C16.89483447 186.11793641 17.16865794 197.82296462 25.05004883 208.72509766 C30.31001199 213.50688235 35.12008915 216.49629207 42.36254883 216.78759766 C49.01226366 216.45231792 53.7079683 214.47810746 58.23754883 209.60009766 C60.37757207 206.34726233 60.95620767 204.58632883 60.98754883 200.72509766 C61.00172852 199.93103516 61.0159082 199.13697266 61.03051758 198.31884766 C60.99671185 196.00476448 60.99671185 196.00476448 58.80004883 194.22509766 C56.18033235 194.50085729 54.22204537 194.98596628 51.92504883 196.28759766 C48.67443162 197.72169348 46.31383081 197.64917479 42.80004883 197.22509766 C38.48277102 194.87021885 38.48277102 194.87021885 36.80004883 192.22509766 C35.71477816 187.91314977 35.78874363 184.07227756 37.94848633 180.12744141 C41.66083819 175.50173314 45.54055369 172.59340219 51.56567383 171.91259766 C59.59604501 171.58976866 64.80303548 172.83792274 70.92504883 178.02587891 C73.01447021 180.00391569 74.92336256 182.04531825 76.80004883 184.22509766 C77.25895508 184.74716797 77.71786133 185.26923828 78.19067383 185.80712891 C82.25037464 191.45354377 81.50867422 198.62331209 80.80004883 205.22509766 C78.50128553 215.2595869 73.41326342 224.0629669 64.88598633 229.94384766 C54.57868498 236.27492414 44.78527234 237.418636 32.80004883 236.22509766 C22.42249902 233.66797765 13.25217342 227.29037103 7.14379883 218.51806641 C-0.73460202 205.07439984 -3.54141973 189.21285584 -0.54760742 173.88525391 C4.44695928 157.57252748 14.87268325 144.88068236 29.72998047 136.7355957 C34.2837746 134.36077096 38.8099360
17 132.43862613 43.80004883 131.22509766 C44.72817383 130.99822266 45.65629883 130.77134766 46.61254883 130.53759766 C67.18889485 128.52030883 83.68815223 134.66122052 99.80004883 147.22509766 C100.50000977 147.75748047 101.1999707 148.28986328 101.92114258 148.83837891 C116.57186491 160.71813967 125.84322039 178.79589971 128.80004883 197.22509766 C128.9934082 198.29824219 128.9934082 198.29824219 129.19067383 199.39306641 C129.52675292 201.67928862 129.68576215 203.91583447 129.80004883 206.22509766 C129.83259766 206.85013184 129.86514648 207.47516602 129.89868164 208.11914062 C130.39730794 219.1216573 129.44058435 228.72920927 125.80004883 239.22509766 C125.55335449 239.95792969 125.30666016 240.69076172 125.05249023 241.44580078 C121.60065502 251.54067062 117.65162512 259.92677418 110.80004883 268.22509766 C109.67491237 269.74583004 108.54990855 271.26666057 107.42504883 272.78759766 C92.62221135 291.44915232 71.76206029 302.82824709 48.26489258 306.82666016 C2.84514085 311.74813578 -31.76372324 294.81167903 -67.06518555 268.45947266 C-74.63055938 262.83698178 -82.43608655 257.61166101 -90.32348633 252.45458984 C-92.95968109 250.72730949 -95.58014801 248.97711673 -98.19995117 247.22509766 C-98.09682617 248.35947266 -97.99370117 249.49384766 -97.88745117 250.66259766 C-97.88745117 265.29814769 -105.01007041 280.56349613 -114.87573242 290.96728516 C-123.36015138 299.20929214 -133.96402422 305.10595619 -146.01245117 305.53759766 C-158.98966517 305.22299853 -171.1854798 298.28419512 -180.19995117 289.22509766 C-188.17419617 278.02878687 -190.40163559 267.70157949 -189.19995117 254.22509766 C-186.86139502 241.37783981 -178.57781244 230.84362792 -168.19995117 223.22509766 C-154.90188503 214.70810881 -139.91528555 213.77721882 -124.81323242 216.74853516 C-124.07802368 216.8899292 -123.34281494 217.03132324 -122.58532715 217.17700195 C-120.78952693 217.52288139 -118.99464085 217.87350133 -117.19995117 218.22509766 C-117.31064941 217.21012207 -117.42134766 216.19514648 -117.53540039 215.14941406 C-121.24132152 181.06228318 -121.24132152 181.06228318 -122.38745117 166.16259766 C-122.45883301 165.24752441 -122.53021484 164.33245117 -122.60375977 163.38964844 C-123.87653768 145.95598097 -124.43893235 128.5153127 -124.44995117 111.03759766 C-124.45062592 110.05952148 -124.45130066 109.08144531 -124.45199585 108.07373047 C-124.43515344 92.61523622 -123.95073471 77.47895048 -121.19995117 62.22509766 C-120.95051758 60.8208252 -120.95051758 60.8208252 -120.69604492 59.38818359 C-118.37868398 46.9645541 -114.63003225 36.10770658 -108.19995117 25.22509766 C-107.57088867 24.14744141 -106.94182617 23.06978516 -106.29370117 21.95947266 C-95.54515585 4.77942072 -78.19517099 -8.89195038 -58.32495117 -13.71240234 C-37.06953176 -17.53600293 -17.16242535 -13.36248474 0 0 Z ",fill:"#200D18",transform:"translate(218.199951171875,38.77490234375)"}),(0,l.jsx)("path",{d:"M0 0 C3.18970398 1.73983854 5.44695493 3.44695493 8 6 C8.87699336 12.23006974 8.19671557 17.59865301 5 23 C2.10329033 25.57485304 0.56049263 25.97884933 -3.3125 26.125 C-8.79074562 24.45367083 -13.28151814 20.94436958 -16.19921875 15.9453125 C-17.4166811 12.98776981 -17.4992407 11.18265946 -17 8 C-12.36805279 1.06628761 -8.30427689 -1.04675759 0 0 Z ",fill:"#2A191D",transform:"translate(71,161)"}),(0,l.jsx)("path",{d:"M0 0 C3.40569591 2.14706916 5.80960782 4.10417103 7 8 C7.32918423 12.19276756 7.13265033 15.94058121 6 20 C-5.35272665 21.70122462 -5.35272665 21.70122462 -9.12890625 20.09375 C-11.7973765 17.90012032 -14.11394112 15.34733356 -15 12 C-14.80743088 6.70434916 -13.69046589 3.80229819 -10 0 C-6.73498123 -1.63250939 -3.42268732 -0.85402947 0 0 Z ",fill:"#1C1118",transform:"translate(339,160)"}),(0,l.jsx)("path",{d:"M0 0 C5.36506998 0.96747164 8.41400168 3.48646473 11.8125 7.6875 C13.125 11.3125 13.125 11.3125 12.8125 14.6875 C10.4329147 18.07660633 8.9451611 19.44650828 4.875 20.3125 C0.12869718 19.34386677 -2.79021255 16.65640504 -5.5625 12.75 C-6.70898944 8.96658485 -6.74669437 5.9374639 -5.125 2.3125 C-3.1875 0.6875 -3.1875 0.6875 0 0 Z ",fill:"#090507",transform:"translate(353.1875,190.3125)"}),(0,l.jsx)("path",{d:"M0 0 C3.02419525 0.58803797 6.01758453 1.22678118 9 2 C9 2.66 9 3.32 9 4 C9.556875 4.12117188 10.11375 4.24234375 10.6875 4.3671875 C15.81564662 5.49330078 20.91192278 6.70485307 26 8 C26 8.66 26 9.32 26 10 C26.886875 9.979375 27.77375 9.95875 28.6875 9.9375 C31.67585373 9.99388403 34.08841946 10.40444944 37 11 C40.32911123 11.37959049 43.6632591 11.6954819 47 12 C47 12.33 47 12.66 47 13 C51.22910869 13.05817206 55.45811409 13.09365463 59.6875 13.125 C60.88568359 13.14175781 62.08386719 13.15851563 63.31835938 13.17578125 C64.47529297 13.18222656 65.63222656 13.18867188 66.82421875 13.1953125 C67.88729248 13.20578613 68.95036621 13.21625977 70.0456543 13.22705078 C73.09523249 12.99268108 75.21745166 12.21461631 78 11 C80.5078125 10.9453125 80.5078125 10.9453125 83.125 11.125 C90.66946627 11.27772199 96.80379996 8.62715638 103.4375 5.25 C106 4 106 4 110 4 C110 3.34 110 2.68 110 2 C111.32 2.33 112.64 2.66 114 3 C107.93131938 6.44603472 101.65619471 8.96200731 95.0625 11.1875 C93.97316162 11.56189209 93.97316162 11.56189209 92.86181641 11.94384766 C63.7769157 21.50980635 30.77316341 16.49752884 3.75 3.0625 C2.49274824 2.38835294 1.23882671 1.70743525 0 1 C0 0.67 0 0.34 0 0 Z ",fill:"#2E0307",transform:"translate(187,330)"}
1),(0,l.jsx)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1.48169379 11.68107438 0.87443394 21.82976806 -3 33 C-3.24669434 33.73283203 -3.49338867 34.46566406 -3.74755859 35.22070312 C-7.19939381 45.31557297 -11.14842371 53.70167652 -18 62 C-19.12513646 63.52073238 -20.25014028 65.04156291 -21.375 66.5625 C-27.68347847 74.56279769 -34.91065483 82.18107993 -44 87 C-44.66 87 -45.32 87 -46 87 C-46 86.01 -46 85.02 -46 84 C-43.525 83.505 -43.525 83.505 -41 83 C-40.67 82.01 -40.34 81.02 -40 80 C-39.01 80 -38.02 80 -37 80 C-37 79.01 -37 78.02 -37 77 C-34.525 76.505 -34.525 76.505 -32 76 C-32 74.68 -32 73.36 -32 72 C-26.88888889 68 -26.88888889 68 -24 68 C-23.896875 67.46375 -23.79375 66.9275 -23.6875 66.375 C-22.81907303 63.37497956 -21.44379704 60.7620465 -20 58 C-19.34 58 -18.68 58 -18 58 C-17.67 57.01 -17.34 56.02 -17 55 C-16.34 55 -15.68 55 -15 55 C-14.87625 54.401875 -14.7525 53.80375 -14.625 53.1875 C-14 51 -14 51 -12 48 C-11.34 48 -10.68 48 -10 48 C-9.9071875 46.63875 -9.9071875 46.63875 -9.8125 45.25 C-9.32834568 41.72058514 -8.11825002 38.91166445 -6.625 35.6875 C-1.81788196 24.62834983 -0.76278128 11.94147246 0 0 Z ",fill:"#3F0A11",transform:"translate(347,245)"}),(0,l.jsx)("path",{d:"M0 0 C0.33 0 0.66 0 1 0 C1.68824889 13.09584693 -0.34600205 23.79067524 -9 34 C-15.64688089 40.17801377 -24.08092769 45.16370766 -33.328125 45.09765625 C-34.12734375 45.09443359 -34.9265625 45.09121094 -35.75 45.08789062 C-36.575 45.07951172 -37.4 45.07113281 -38.25 45.0625 C-39.09046875 45.05798828 -39.9309375 45.05347656 -40.796875 45.04882812 C-42.86461401 45.03707961 -44.93231624 45.01914522 -47 45 C-42.50416959 42.07529312 -37.09945223 42.31971257 -31.90625 41.96484375 C-24.8
16528009 41.33871723 -19.83198613 38.88799075 -14 35 C-13.67 34.01 -13.34 33.02 -13 32 C-12.01 32 -11.02 32 -10 32 C-9.814375 31.0409375 -9.814375 31.0409375 -9.625 30.0625 C-9.41875 29.381875 -9.2125 28.70125 -9 28 C-8.34 27.67 -7.68 27.34 -7 27 C-6.34786708 24.97536745 -6.34786708 24.97536745 -6 23 C-5.34 23 -4.68 23 -4 23 C-1.25950761 15.36454007 -0.36740907 8.08299944 0 0 Z ",fill:"#40080C",transform:"translate(298,230)"}),(0,l.jsx)("path",{d:"M0 0 C0 3 0 3 -1.94921875 5.3046875 C-8.73428604 11.67355237 -14.9282191 15.32450906 -24 18 C-24.6496875 18.20109375 -25.299375 18.4021875 -25.96875 18.609375 C-34.84510541 20.31636642 -44.28790246 18.99133658 -53 17 C-53 16.67 -53 16.34 -53 16 C-52.17798096 16.01571045 -51.35596191 16.0314209 -50.5090332 16.04760742 C-46.77692572 16.11005073 -43.04492828 16.14902136 -39.3125 16.1875 C-38.01892578 16.21263672 -36.72535156 16.23777344 -35.39257812 16.26367188 C-34.14541016 16.27333984 -32.89824219 16.28300781 -31.61328125 16.29296875 C-30.46641846 16.3086792 -29.31955566 16.32438965 -28.13793945 16.34057617 C-24.64734023 15.96172408 -22.87341725 14.94949881 -20 13 C-19.030625 12.690625 -18.06125 12.38125 -17.0625 12.0625 C-13.07456416 10.67893042 -8.95473239 8.90946478 -7 5 C-5.34467377 3.98133771 -3.67739862 2.98189187 -2 2 C-1.34 1.34 -0.68 0.68 0 0 Z ",fill:"#480709",transform:"translate(225,127)"}),(0,l.jsx)("path",{d:"M0 0 C1 3 1 3 0 6 C-1.4375 7.6875 -1.4375 7.6875 -3 9 C-3.66 9 -4.32 9 -5 9 C-5.10441406 9.58007812 -5.20882812 10.16015625 -5.31640625 10.7578125 C-6.10376879 13.34036162 -7.22991656 14.79583972 -8.9375 16.875 C-11.47338372 20.12239066 -12.98804617 22.95218467 -14 27 C-14.66 27 -15.32 27 -16 27 C-16 28.65 -16 30.3 -16 32 C-16.33 32 -16.66 32 -17 32 C-17.55288243 22.74216024 -13.15914375 15.01611853 -7.56640625 7.90625 C-5.43614527 5.53399137 -3.27110511 3.2369898 -1 1 C-0.67 0.67 -0.34 0.34 0 0 Z ",fill:"#190A0F",transform:"translate(236,184)"})]})},h=t(9645),f=t.n(h);function v(e){let{mode:i,href:t,onClick:n,styles:s=[],altStyles:a=[],onboardingElement:c,iconOnly:d}=e,u="social-img"==i;c&&c.includes("logo");let h=(0,l.jsx)("span",{className:"".concat(f().className," tracking-[-2px] ml-[1px] mr-[2px] ").concat(u?"text-[80pt]":"text-[22pt] md:text-[28pt]"," font-semibold"),children:"AI"}),v=a?(0,l.jsx)(r.N,{styles:c?a.slice(0,1):a,children:h}):(0,l.jsx)("div",{children:h});return(0,l.jsxs)(m(),{onClick:()=>n&&n(),href:t||"/",className:"logo hover:no-underline ".concat(u?"text-[100pt]":"text-[26pt] md:text-[32pt]"),children:[d&&(0,l.jsx)("div",{className:"HaikuGeniusIcon absolute flex flex-row top-[0.6rem] left-[-0.1rem] md:top-[0.6rem] md:left-[-0.1rem] lg:top-[0.6rem] lg:left-[-0.1rem]",children:(0,l.jsx)(r.N,{styles:c?s.slice(0,1):s,children:(0,l.jsx)(p,{color:s[0].color,className:"h-[9rem] w-[9rem] md:h-[12rem] md:w-[12rem]"})})}),!d&&(0,l.jsxs)("div",{className:"HaikuGeniusIcon ".concat(o().className," flex flex-row"),children:[(0,l.jsx)(r.N,{styles:c?s.slice(0,1):s,children:"limericks"}),(0,l.jsx)("span",{className:"mt-[0.1rem] sm:mt-[0rem]",children:v})]})]})}var g=t(2067),x=t.n(g),k=t(6468),C=t(8910),b=t(1188),y=t(5195);let j=(e,i)=>(i.createdAt||0)-(e.createdAt||0);function w(e){let{styles:i,title:t,onboardingElement:n,onClick:s}=e;return(0,l.jsx)("div",{className:"_bg-pink-200 open-side-panel-icon ".concat(o().className," absolute top-0 right-0 md:p-[0.8rem] mt-[0.1rem] md:mt-[0.1rem] p-[0.6rem] ").concat("z-20"," cursor-pointer"),onClick:s,title:t,children:(0,l.jsx)(r.N,{styles:i,children:(0,l.jsx)(a.Z,{children:(0,l.jsxs)("div",{className:"onboarding-container",style:{width:"auto"},children:[!1,(0,l.jsx)(k.pLT,{className:"h-7 w-7 md:h-8 md:w-8"})]})})})})}function N(e){var i,t;let{user:s,mode:u,styles:p,altStyles:h,bgColor:f,onboardingElement:g,onShowAbout:N,onSelectHaiku:R,onClickLogo:A}=e,[_,S]=(0,n.useState)(!1),[I,Z]=(0,n.useState)(!1),[E,z]=(0,n.useState)(!1),D=b.t,[M,T]=(0,n.use
1State)(1),[H,L]=(0,n.useState)("haiku"),[B,P]=(0,n.useState)(),O=!!(g&&["side-panel","side-panel-and-bottom-links"].includes(g)),[U,Y,F,W,G,Q]=(0,c.Z)(e=>[(null==s?void 0:s.isAdmin)&&!B?e.allHaikus?Object.values(e.allHaikus):[]:e.haikus?Object.values(e.haikus):[],e.dailyHaikus?Object.values(e.dailyHaikus):[],e.dailyHaikudles?Object.values(e.dailyHaikudles):[],e.loaded,e.loading,e.load]),K=()=>{g||(Z(!0),setTimeout(()=>Z(!1),100),_||(0,d.Z)("side-panel-opened",{userId:null==s?void 0:s.id}),_&&z(!1),S(!_))},J=async e=>{"Escape"==e.key&&S(!1)},q=e=>"20dc0506,4a259044".split(",").includes(e),X=e=>{switch(B){case"generated":return!!e.generatedAt;case"liked":return!!e.likedAt;case"viewed":return!e.likedAt&&!!e.viewedAt}return!0},$=("haiku"==H?U:"dailyHaiku"==H?Y:F).filter(X).length>M*D,V=async e=>{e.preventDefault();let i=2*M;await Q({count:i*D+1,offset:M*D}),T(i)},ee=()=>{(0,d.Z)("clicked-open-side-panel",{userId:null==s?void 0:s.id}),_||E||z(!0),K()};return(0,n.useEffect)(()=>(document.body.addEventListener("keydown",J),()=>{document.body.removeEventListener("keydown",J)}),[]),(0,l.jsxs)("div",{className:"side-panel",children:[_&&(0,l.jsx)("div",{className:"_bg-blue-400 close-side-panel-hotspot absolute top-0 right-0 w-[100vw] h-[100vh] z-20",onClick:()=>_&&K()}),(0,l.jsx)(w,{styles:p,title:"Open side panel",onboardingElement:g,onClick:ee}),(0,l.jsx)("div",{className:"_bg-red-400 open-side-panel-hoverspot group absolute top-[4rem] right-[0rem] w-[1rem] mr-[0rem] h-[calc(100vh-4rem)] _z-50",style:{zIndex:99,display:_?"none":"block"},onMouseEnter:()=>!_&&!I&&K(),onClick:()=>_&&K()}),(0,l.jsx)("div",{className:"_bg-pink-200 absolute top-0 h-full ".concat(O?"z-50":"z-20"," ").concat(!O&&"transition-[right]"," _blur-[10px]"),style:{backgroundColor:"".concat((null===(i=p[p.length-1])||void 0===i?void 0:i.color)?(null===(t=p[p.length-1])||void 0===t?void 0:t.color)+"88":"RGBA(0, 0, 0, 0.5)"),backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",right:0,width:"27rem",maxWidth:"95vw",display:_?"block":"none"},onMouseLeave:()=>_&&!E&&K(),children:(0,l.jsxs)("div",{className:"_bg-pink-400 flex flex-col h-[100vh]",children:[(0,l.jsx)("div",{className:"block _sm:hidden",children:(0,l.jsx)("div",{className:"_bg-orange-400 flex flex-col h-[3rem]",children:(0,l.jsx)("div",{className:"".concat(o().className," absolute top-[-0.1rem] left-0 w-full ").concat(g&&["logo","logo-and-generate"].includes(g)?"z-50":"z-40"),children:(0,l.jsx)("div",{className:"flex flex-row justify-center",children:(0,l.jsx)(a.Z,{color:f,active:O,children:(0,l.jsx)(v,{styles:p,altStyles:h,mode:u||"haiku",href:"/".concat("haiku"!=u?"?mode=".concat(u):""),onClick:()=>{K(),A&&A()}})})})})})}),(0,l.jsx)("div",{className:"absolute top-0 right-0 z-50",children:(0,l.jsx)(w,{styles:p,title:"Close side panel",onboardingElement:g,onClick:ee})}),(0,l.jsxs)("div",{className:"_bg-yellow-400 flex flex-col h-full overflow-scroll px-3 md:px-4 sm:mt-[0.2rem] md:mt-[0.6rem]",children:[(0,l.jsxs)("div",{className:"py-2 text-[1.2rem] md:text-[1.2rem]",children:[(!(null==s?void 0:s.isAdmin)||"haiku"==H)&&(0,l.jsxs)("div",{className:"flex flex-row gap-3 group",children:[(null==s?void 0:s.isAdmin)&&(0,l.jsx)("div",{className:"cursor-pointer",title:"Show daily limerics",onClick:()=>L("dailyHaiku"),children:(0,l.jsx)(r.N,{styles:p,children:"All Limerics"})}),!(null==s?void 0:s.isAdmin)&&(0,l.jsx)(r.N,{styles:p,children:"Your Limericks"})]}),(null==s?void 0:s.isAdmin)&&"dailyHaiku"==H&&(0,l.jsx)("div",{className:"cursor-pointer",title:"Show all limerics",onClick:()=>L("haiku"),children:(0,l.jsx)(r.N,{styles:p,children:"Daily Limerics"})}),(null==s?void 0:s.isAdmin)&&"dailyHaikudle"==H&&(0,l.jsx)("div",{className:"cursor-pointer",title:"Show limericks",onClick:()=>L("haiku"),children:(0,l.jsx)(r.N,{styles:p,children:"Daily Haikudles"})})]}),"haiku"==H&&(I||_)&&U.filter(X).sort((null==s?void 0:s.isAdmin)?j:(e,i)=>(i.generatedAt||i.solvedAt||e.likedAt||i.viewedAt||0)-(e.generatedAt||e.solvedAt||e.likedAt||e.viewedAt||0)).slice(0,M*D).map((e,i)=>(0,l.jsx)(r.N,{styles:h,children:(0,l.jsxs)(m(),{href:"/".concat(e.haikuId||e.id),onClick:i=>{R&&(i.preventDefault(),K(),R(e.haikuId||e.id))},children:[(0,l.jsxs)("span",{className:"capitalize font-semibold",children:['"',e.theme,'"']}),(null==s?void 0:s.isAdmin)&&(0,l.jsxs)("span",{className:"font-normal",children:[" generated ",(0,y.Dm)(e.createdAt||0)," by ",e.createdBy==(null==s?void 0:s.id)?"you":"".concat(q(e.createdBy)?"admin":"user"," ").concat(e.createdBy)]}),!(null==s?void 0:s.isAdmin)&&e.generatedAt&&(0,l.jsxs)("span",{className:"font-normal",children:[" generated ",(0,y.Dm)(e.generatedAt)]}),!(null==s?void 0:s.isAdmin)&&!e.generatedAt&&e.solvedAt&&(0,l.jsxs)("span",{className:"font-normal",children:[" solved ",(0,y.Dm)(e.solvedAt),e.moves?" in ".concat(e.moves," move").concat(e.moves>1?"s":""):""]}),!(null==s?void 0:s.isAdmin)&&!e.generatedAt&&!e.solvedAt&&e.likedAt&&(0,l.jsxs)("span",{className:"font-normal",children:[" liked ",(0,y.Dm)(e.likedAt||0)]}),!(null==s?void 0:s.isAdmin)&&!e.generatedAt&&!e.solvedAt&&!e.likedAt&&e.viewedAt&&(0,l.jsxs)("span",{className:"font-normal",children:[" viewed ",(0,y.Dm)(e.viewedAt)]})]})},i)),["dailyHaiku","dailyHaikudle"].includes(H)&&(null==s?void 0:s.isAdmin)&&(I||_)&&("dailyHaiku"==H&&Y||F).sort((e,i)=>i.id-e.id).slice(0,M*D).map((e,i)=>(0,l.jsx)(r.N,{styles:h,children:(0,l.jsxs)(m(),{href:"/".concat(e.haikuId),onClick:i=>{R&&(i.preventDefault(),K(),R(e.haikuId))},children:[(0,l.jsxs)("span",{className:"capitalize font-semibold",children:['"',e.theme,'"']}),(0,l.jsxs)("span",{className:"font-normal",children:[" ",e.id==x()().format("YYYYMMDD")?"Today":x()(e.id).format("MMMM Do YYYY")]})]})},i)),$&&(0,l.jsx)("div",{className:"py-2 cursor-pointer",onClick:V,children:(0,l.jsx)(r.N,{styles:p,children:"Load more"})})]}),(0,l.jsx)("div",{className:"_bg-purple-400 flex flex-row justify-center px-2 pt-4 pb-2 h-fit w-full",children:(0,l.jsx)(r.N,{styles:p,children:(0,l.jsxs)("div",{className:"_bg-purple-200 flex flex-row gap-4",children:[(0,l.jsxs)(m(),{className:"flex flex-row gap-1",href:"#",title:"About",onClick:e=>{e.preventDefault(),(0,d.Z)("clicked-about",{userId:null==s?void 0:s.id,location:"side-panel"}),K(),N&&N()},children:[(0,l.jsx)(k.k$3,{className:"mt-[-0.2rem] md:mt-[-0.3rem] text-[2rem] md:text-[2.1rem]"}),(0,l.jsx)("div",{children:"About"})]},"about"),(0,l.jsxs)(m(),{className:"flex flex-row gap-1",href:"https://www.desmat.ca",target:"_blank",onClick:()=>{(0,d.Z)("clicked-web",{userId:null==s?void 0:s.id,location:"side-panel"}),K()},children:[(0,l.jsx)(C.bH4,{className:"mt-[-0.2rem] md:mt-[-0.3rem] text-[2rem] md:text-[2.1rem]"}),"desmat.ca"]},"web"),(0,l.jsxs)(m(),{className:"flex flex-row gap-2",href:"https://github.com/desmat/limerick",target:"_blank",onClick:()=>{(0,d.Z)("clicked-github",{userId:null==s?void 0:s.id,location:"side-panel"}),K()},children:[(0,l.jsx)(k.JOq,{className:"mt-[0rem] md:mt-[-0.1rem] text-[1.7rem] md:text-[1.8rem]"}),(0,l.jsx)("div",{className:"sm:block hidden",children:"github/desmat"}),(0,l.jsx)("div",{className:"block sm:hidden",children:"github"})]},"github")]})})})]})})]})}var R=t(4033),A=t(3159),_=t(7431),S=t(4606),I=t(9241),Z=t(5932);let E={en:{name:"English",nativeName:"English"}};
1function z(e){let{icon:i,className:t,title:s,disabled:o,links:a}=e,[r,c]=(0,n.useState)(!1);return(0,l.jsxs)("div",{className:"_bg-pink-200 flex flex-row relative",onMouseOver:()=>c(!0),onMouseOut:()=>c(!1),children:[(0,l.jsx)("div",{className:t,title:s,children:i}),(0,l.jsx)("div",{className:"_bg-yellow-200 flex flex-col gap-[0rem] absolute bottom-[-0rem] left-[0rem] p-[0rem] ".concat(o?"opacity-40":"cursor-pointer"),style:{display:r?"block":"none"},children:a.filter(Boolean).map((e,i)=>(0,l.jsx)("div",{className:"_bg-orange-200 absolute left-[-0.2rem] bottom-0 px-[0.2rem] py-[0rem]",style:{transform:"translate(0%, -".concat(r?100*i+100:0,"%)"),transition:"transform 1s ease, bottom 1s ease"},children:e},i))})]})}function D(e){let{mode:i,haiku:t,lang:s,styles:o,altStyles:u,backupInProgress:p,onboardingElement:h,onRefresh:f,onSwitchMode:v,onDelete:g,onSaveDailyHaiku:x,onShowAbout:b,onBackup:y,onCopyHaiku:j,onCopyLink:w,onLikeHaiku:N,onUploadImage:D,onUpdateImage:M,onPublishSocialImgs:T}=e;(0,R.useRouter)();let H=(0,c.Z)(e=>e.user),L=(0,n.useRef)();return(0,l.jsxs)("div",{className:"_bg-yellow-100 bottom-links relative flex flex-row gap-3 items-center justify-center _font-semibold",children:[(0,l.jsxs)("div",{className:"relative flex flex-row gap-2 items-center justify-center _font-semibold",children:[("haikudle"==i||(null==H?void 0:H.isAdmin))&&(0,l.jsx)("div",{className:b?"cursor-pointer relative":"opacity-40 relative",title:"About",onClick:()=>{b&&((0,d.Z)("clicked-about",{userId:null==H?void 0:H.id,location:"bottom-links"}),b())},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!b,children:(0,l.jsx)(k.k$3,{className:"text-[2rem] md:text-[2.25rem]"})})},"about"),!(null==H?void 0:H.isAdmin)&&(0,l.jsx)(m(),{href:"https://www.desmat.ca",target:"_blank",onClick:()=>{(0,d.Z)("clicked-web",{userId:null==H?void 0:H.id,location:"bottom-links"})},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,children:(0,l.jsx)(C.bH4,{className:"text-[2rem] md:text-[2.25rem]"})})},"web"),"haiku"==i&&!(null==H?void 0:H.isAdmin)&&(0,l.jsx)(m(),{href:"https://www.facebook.com/limericksai",target:"_blank",onClick:()=>{(0,d.Z)("clicked-facebook",{userId:null==H?void 0:H.id,location:"bottom-links"})},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,children:(0,l.jsx)(C.ntA,{className:"text-[2rem] md:text-[2.25rem]"})})},"facebook"),(null==H?void 0:H.isAdmin)&&(0,l.jsx)(r.N,{styles:(null==t?void 0:t.likedAt)?u.slice(0,1):o.slice(0,0),children:(0,l.jsxs)("div",{title:"".concat((null==t?void 0:t.likedAt)?"Un-like this haiku":"Like this haiku"," ").concat((null==H?void 0:H.isAdmin)?"(".concat(null==t?void 0:t.numLikes," like").concat((null==t?void 0:t.numLikes)&&!((null==t?void 0:t.numLikes)>1)?"":"s",")"):""),className:(null==t?void 0:t.id)&&N?"cursor-pointer relative":"opacity-40 relative",onClick:e=>(null==t?void 0:t.id)&&N&&N(),children:[(null==H?void 0:H.isAdmin)&&(null==t?void 0:t.numLikes)>0&&(0,l.jsx)("div",{className:"absolute top-[-0.1rem] right-[-0.1rem] rounded-full w-[0.6rem] h-[0.6rem] bg-red-600"}),(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!((null==t?void 0:t.id)&&N),children:(0,l.jsx)(k.fON,{className:"text-[1.75rem] md:text-[2rem]"})})]},"heart")}),(null==H?void 0:H.isAdmin)&&(0,l.jsx)(z,{className:(null==t?void 0:t.id)?"cursor-pointer":"opacity-40",title:"Switch mode",icon:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id),children:(0,l.jsx)(A.Lrt,{className:"text-[1.5rem] md:text-[1.75rem]"})}),links:[(0,l.jsx)(m(),{href:"/".concat(null==t?void 0:t.id),title:"Copy link to share",className:(null==t?void 0:t.id)&&w?"cursor-copy":"opacity-40",onClick:e=>{e.preventDefault(),(null==t?void 0:t.id)&&w&&w()},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!w,children:(0,l.jsx)(A.gjK,{className:"text-[1.5rem] md:text-[1.75rem] p-[0.2rem]"})})},"link"),(0,l.jsx)("div",{className:(null==t?void 0:t.id)&&j?"cursor-copy":"opacity-40",title:"Copy limerick poem",onClick:()=>{(null==t?void 0:t.id)&&j&&((0,d.Z)("haiku-copied",{userId:null==H?void 0:H.id,id:t.id,location:"bottom-links"}),j())},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!j,children:(0,l.jsx)(A.esY,{className:"text-[1.5rem] md:text-[1.75rem] p-[0.2rem] ml-[-0.1rem]"})})},"copy"),(0,l.jsx)(m(),{href:"/".concat(null==t?void 0:t.id),title:"Publish social images",className:(null==t?void 0:t.id)&&T?"curs
1or-pointer":"opacity-40",onClick:e=>{e.preventDefault(),(null==t?void 0:t.id)&&T&&T()},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!w,children:(0,l.jsx)(A.Jh6,{className:"text-[1.5rem] md:text-[1.75rem] p-[0.2rem]"})})},"publish-social-img")]},"share"),!(null==H?void 0:H.isAdmin)&&(0,l.jsx)("div",{className:(null==t?void 0:t.id)&&j?"cursor-copy":"opacity-40",title:"Copy limerick poem",onClick:()=>{(null==t?void 0:t.id)&&j&&((0,d.Z)("haiku-copied",{userId:null==H?void 0:H.id,id:t.id,location:"bottom-links"}),j())},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!j,children:(0,l.jsx)(A.esY,{className:"text-[1.5rem] md:text-[1.75rem] p-[0.2rem] ml-[-0.1rem]"})})},"copy"),!(null==H?void 0:H.isAdmin)&&(0,l.jsx)(m(),{href:"/".concat(null==t?void 0:t.id),title:"Copy link to share",className:(null==t?void 0:t.id)&&w?"cursor-copy":"opacity-40",onClick:e=>{e.preventDefault(),(null==t?void 0:t.id)&&w&&w()},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!w,children:(0,l.jsx)(A.Lrt,{className:"text-[1.5rem] md:text-[1.75rem] p-[0.2rem]"})})},"link"),(null==H?void 0:H.isAdmin)&&(0,l.jsx)("div",{className:(null==t?void 0:t.id)&&f?"cursor-pointer":"opacity-40",onClick:()=>(null==t?void 0:t.id)&&f&&f(),title:"Load random",children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!f,children:(0,l.jsx)(A.zLx,{className:"text-[1.5rem] md:text-[1.75rem]"})})},"refresh"),(null==H?void 0:H.isAdmin)&&(0,l.jsx)(z,{className:(null==t?void 0:t.id)?"cursor-pointer":"opacity-40",title:"Image options",disabled:!(null==t?void 0:t.bgImage),icon:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id),children:(0,l.jsx)(I.hE1,{className:"text-[1.75rem] md:text-[2rem]"})}),links:[(null==H?void 0:H.isAdmin)&&(null==t?void 0:t.id)&&(null==t?void 0:t.shared)&&(0,l.jsx)(m(),{className:(null==t?void 0:t.id)?"cursor-pointer":"opacity-40",title:"Download social media image",href:"".concat("https://v7atwtvflvdzlnnl.public.blob.vercel-storage.com","/social_img_limericks/").concat(null==t?void 0:t.id,"_").concat((null==t?void 0:t.version)||0,".png"),target:"_blank",children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.bgImage),children:(0,l.jsx)(S.Lwf,{className:"text-[1.75rem] md:text-[2rem] p-[0.15rem]"})})},"downloadSocialImage"),(null==H?void 0:H.isAdmin)&&(null==t?void 0:t.id)&&(0,l.jsx)(m(),{className:(null==t?void 0:t.id)?"cursor-pointer":"opacity-40",title:"Download background image",href:null==t?void 0:t.bgImage,target:"_blank",children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.bgImage),children:(0,l.jsx)(I.PBv,{className:"text-[1.75rem] md:text-[2rem]"})})},"downloadImage"),(null==H?void 0:H.isAdmin)&&(null==t?void 0:t.id)&&D&&(0,l.jsxs)("div",{className:"cursor-pointer",title:"Upload background image",onClick:()=>{(null==L?void 0:L.current)&&L.current.click()},children:[(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!D,children:(0,l.jsx)(I.EaH,{className:"text-[1.75rem] md:text-[2rem]"})}),(0,l.jsx)("input",{ref:L,type:"file",name:"file",accept:"image/png, image/jpg, image/jpeg, image/gif, image/svg",className:"hidden",onInput:e=>{var i,t;(null==L?void 0:null===(i=L.current)||void 0===i?void 0:i.files)&&D(null==L?void 0:null===(t=L.current)||void 0===t?void 0:t.files[0])}})]},"uploadImage"),(null==H?void 0:H.isAdmin)&&(null==t?void 0:t.id)&&M&&(0,l.jsx)("div",{className:"cursor-pointer",title:"Update background image from URL",onClick:M,children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!M,children:(0,l.jsx)(I.zLI,{className:"text-[1.75rem] md:text-[2rem]"})})},"uploadImageUrl")]},"imageOptions"),(null==H?void 0:H.isAdmin)&&(0,l.jsx)("div",{className:(null==t?void 0:t.id)&&g?"cursor-pointer":"opacity-40",onClick:()=>(null==t?void 0:t.id)&&g&&g(),title:"Delete",children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!g,children:(0,l.jsx)(C.ZkW,{className:"text-[1.75rem] md:text-[2rem]"})})},"deleteHaiku"),(null==H?void 0:H.isAdmin)&&(0,l.jsx)("div",{className:(null==t?void 0:t.id)&&x?"cursor-pointer":"opacity-40",onClick:(null==t?void 0:t.id)&&x&&x,title:"Save as daily ".concat(i),children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id),children:(0,l.jsx)(k.p8f,{className:"text-[1.5rem] md:text-[1.75rem]"})})},"saveHaiku"),(null==H?void 0:H.isAdmin)&&(0,l.jsx)(z,{title:p?"Database backup in progress...":"Backup database",disabled:!(null==t?void 0:t.bgImage)||p||!y,className:p?"_opacity-50 animate-pulse cursor-not-allowed":y?"cursor-pointer":"opacity-40",icon:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id),children:(0,l.jsx)(S.oxP,{className:"text-[1.5rem] md:text-[1.75rem]"})}),links:[(0,l.jsx)("div",{onClick:()=>!p&&y&&y("backupHaiku"),title:p?"Database backup in progress...":"Backup specific haiku",className:p?"_opacity-50 animate-pulse cursor-not-allowed":y?"cursor-pointer":"opacity-40",children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:p||!(null==t?void 0:t.id)||!y,children:(0,l.jsx)(S._fB,{className:"text-[1.5rem] md:text-[1.75rem]"})})},"backupHaiku"),(0,l.jsx)("div",{onClick:()=>!p&&y&&y("backup"),title:p?"Database backup in progress...":"Backup database",className:p?"_opacity-50 animate-pulse cursor-not-allowed":y?"cursor-pointer":"opacity-40",children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:p||!(null==t?void 0:t.id)||!y,children:(0,l.jsx)(S.Q6k,{className:"text-[1.5rem] md:text-[1.75rem]"})})},"backupEntity"),(0,l.jsx)("div",{onClick:()=>!p&&y&&y("restore"),title:p?"Database backup in progress...":"Restore database",className:p?"_opacity-50 animate-pulse cursor-not-allowed":y?"cursor-pointer":"opacity-40",children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:p||!(null==t?void 0:t.id)||!y,children:(0,l.jsx)(S.qNN,{className:"text-[1.5rem] md:text-[1.75rem]"})})},"restore")]},"backupOptions"),!1,(null==H?void 0:H.isAdmin)&&(0,l.jsx)(z,{className:(null==t?void 0:t.id)?"cursor-pointer":"opacity-40",title:"Switch mode",icon:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id),children:(0,l.jsx)(_.alC,{className:"text-[1.75rem] md:text-[2rem]"})}),links:[(null==H?void 0:H.isAdmin)&&(null==t?void 0:t.id)&&(0,l.jsx)(m(),{href:"/".concat(t?null==t?void 0:t.id:"","?mode=showcase"),className:(null==t?void 0:t.id)&&v?"curs
1or-pointer":"opacity-40",title:"Switch to showcase mode ",onClick:e=>{(null==t?void 0:t.id)&&v&&v("showcase")},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!v,children:(0,l.jsx)(A.a1O,{className:"text-[1.75rem] md:text-[2rem] p-[0.1rem]"})})},"showcaseImgMode"),(null==H?void 0:H.isAdmin)&&(null==t?void 0:t.id)&&(0,l.jsx)(m(),{href:"/".concat(t?null==t?void 0:t.id:"","?mode=social-img"),className:(null==t?void 0:t.id)&&v?"cursor-pointer":"opacity-40",title:"Switch to social-img mode ",onClick:e=>{(null==t?void 0:t.id)&&v&&v("social-img")},children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,disabled:!(null==t?void 0:t.id)||!v,children:(0,l.jsx)(Z.n_t,{className:"text-[1.75rem] md:text-[2rem] p-[0.1rem]"})})},"socialImgMode")]},"modes")]}),"haiku"==i&&Object.entries(E).filter(e=>!s&&"en"!=e[0]||s&&s!=e[0]).map(e=>{let[i,n]=e;return(0,l.jsx)(m(),{href:"/".concat("en"!=i?"?lang=".concat(i):""),children:(0,l.jsx)(a.Z,{color:null==t?void 0:t.bgColor,children:n.nativeName})},i)})]})}var M=t(3098);function T(e){var i;let{mode:t,loading:s,styles:u,altStyles:m,haiku:p,lang:h,refreshDelay:f=864e5,backupInProgress:g,onboardingElement:x,onClickLogo:k,onClickGenerate:C,onClickRandom:b,onSwitchMode:y,onDelete:j,onSaveDailyHaiku:w,onShowAbout:R,onSelectHaiku:A,onChangeRefreshDelay:_,onBackup:S,onCopyHaiku:I,onCopyLink:Z,onLikeHaiku:E,onUploadImage:z,onUpdateImage:T,onCycleLayout:H,onPublishSocialImgs:L}=e,[B]=(0,c.Z)(e=>[e.user]),P=!!(x&&["bottom-links","side-panel-and-bottom-links"].includes(x)),O=async e=>{"Escape"==e.key&&["showcase","social-img"].includes(t)&&y&&(y(),e.preventDefault())},U=()=>{_(Math.min(2*f,2147483647))},Y=()=>{_(Math.max(f/2,1e3))};return(0,n.useEffect)(()=>(document.body.addEventListener("keydown",O),()=>{document.body.removeEventListener("keydown",O)}),[t,p]),(0,l.jsxs)("div",{className:"_bg-pink-200 nav-overlay relative h-full w-full z-1",children:[!s&&["haikudle","haiku"].includes(t)&&(0,l.jsx)(M.Z,{user:B,color:(null==p?void 0:p.color)||"#000000",bgColor:(null==p?void 0:p.bgColor)||"#ffffff",styles:u,altStyles:m,generate:C,onboardingElement:x}),["haikudle","haiku"].includes(t)&&(0,l.jsx)("div",{className:"".concat(o().className," absolute top-[-0.1rem] left-2.5 md:left-3.5 ").concat(x&&["logo","logo-and-generate"].includes(x||"")?"z-50":"z-20"," ").concat(s?"opacity-40":""),children:(0,l.jsxs)("div",{className:"onboarding-container",children:[x&&["logo","_logo-and-generate"].includes(x||"")&&(0,l.jsx)("div",{className:"onboarding-focus"}),x&&["_logo","logo-and-generate"].includes(x||"")&&(0,l.jsx)("div",{className:"onboarding-focus double"}),(0,l.jsx)(a.Z,{color:null==p?void 0:p.bgColor,active:"logo"==x,children:(0,l.jsx)(v,{iconOnly:!0,styles:u,altStyles:m,mode:t,href:"/".concat("haiku"!=t?"?mode=".concat(t):""),onClick:()=>{(0,d.Z)("clicked-logo",{userId:null==B?void 0:B.id}),k&&k()},onboardingElement:x})})]})}),["social-img","haikudle-social-img"].includes(t)&&(0,l.jsx)("div",{className:"".concat(o().className," absolute top-0 left-0 right-0 bottom-0 m-auto w-fit h-fit z-30"),children:(0,l.jsxs)(a.Z,{color:null==p?void 0:p.bgColor,children:[(0,l.jsx)(v,{styles:[...u,...u.slice(0,1)],altStyles:[...m,...m.slice(1,2)],mode:t,href:"/".concat("haiku"!=t?"?mode=".concat(t):"")}),(0,l.jsx)("div",{className:"_bg-pink-400 _opacity-50 absolute top-0 left-0 w-full h-full cursor-pointer",onClick:()=>y&&y()})]})}),(0,l.jsx)("div",{className:"absolute top-0 left-0 _bg-pink-200 min-w-[100vw] min-h-[100vh] z-10",style:{background:"radial-gradient(circle at center, white, #868686 35%, ".concat((null===(i=u[0])||void 0===i?void 0:i.color)||"#000000"," 70%)"),opacity:.2}}),["haiku","haikudle"].includes(t)&&(0,l.jsx)("div",{className:"fixed bottom-2 left-1/2 transform -translate-x-1/2 flex-grow items-end justify-center ".concat(x&&x.startsWith("bottom-links")?"z-50":"z-20"),children:(0,l.jsxs)("div",{className:"onboarding-container",children:[x&&["bottom-links","_side-panel-and-bottom-links"].includes(x)&&(0,l.jsx)("div",{className:"onboarding-focus"}),x&&["_bottom-links","side-panel-and-bottom-links"].includes(x)&&(0,l.jsx)("div",{className:"onboarding-focus double"}),(0,l.jsx)(a.Z,{disabled:!P,active:P,children:(0,l.jsx)(r.N,{styles:x&&!x.includes("bottom-links")?u.slice(0,1):u,disabled:"bottom-links-share"==x,children:(0,l.jsx)(D,{mode:t,lang:h,haiku:p,styles:u,altStyles:m,backupInProgress:g,onboardingElement:x,onRefresh:b,onSwitchMode:y,onDelete:j,onSaveDailyHaiku:w,onShowAbout:R,onBackup:S,onCopyHaiku
1:I,onCopyLink:Z,onLikeHaiku:E,onUploadImage:z,onUpdateImage:T,onPublishSocialImgs:L})})})]})}),["showcase","social-img"].includes(t)&&(0,l.jsxs)(l.Fragment,{children:[y&&(0,l.jsx)("div",{className:"_bg-pink-400 absolute top-0 left-0 ".concat((null==B?void 0:B.isAdmin)?"w-[10vw] z-40":"w-full z-10"," h-full cursor-w-resize"),title:"Exit showcase mode",onClick:()=>y()}),b&&(0,l.jsx)("div",{className:"_bg-orange-400 absolute top-0 right-0 w-[10vw] z-40 h-full cursor-e-resize",title:"Load random",onClick:()=>b()}),U&&U&&(0,l.jsx)("div",{className:"_bg-yellow-400 absolute bottom-0 left-0 w-[10vw] h-[10vw] z-40 cursor-pointer",title:"Increase refresh time",onClick:U}),Y&&(null==B?void 0:B.isAdmin)&&(0,l.jsx)("div",{className:"_bg-yellow-400 absolute bottom-0 right-0 w-[10vw] h-[10vw] z-40 cursor-pointer",title:"Decrease refresh time",onClick:Y}),H&&(0,l.jsx)("div",{className:"_bg-blue-200 w-[calc(80vw)] h-[4rem] left-[50%] translate-x-[-50%] top-0 fixed cursor-row-resize z-40",onClick:e=>{H(!0)},title:"Change layout"}),H&&(0,l.jsx)("div",{className:"_bg-blue-200 w-[calc(80vw)] h-[4rem] left-[50%] translate-x-[-50%] bottom-0 fixed cursor-row-resize z-40",onClick:e=>{H(!1)},title:"Change layout"})]}),!s&&["haiku","haikudle"].includes(t)&&(0,l.jsx)(N,{user:B,mode:t,styles:u,altStyles:m,bgColor:null==p?void 0:p.bgColor,onboardingElement:x,onShowAbout:R,onSelectHaiku:A,onClickLogo:k})]})}},8580:function(e,i,t){var l=t(4660),n=t(4810),s=t(2067),o=t.n(s);let a={message:void 0,type:void 0,onDismiss:()=>void 0,closeLabel:void 0,closeTimeout:void 0,closedTimestamp:void 0,style:void 0,customActions:void 0},r=(0,l.Ue)((0,n.mW)((e,i)=>({...a,reset:()=>{e(a)},_alert:async function(t,l){let{onDismiss:n,closeLabel:s,closeDelay:o,style:a,customActions:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(o){let{setCloseTimeout:e}=i();e(o)}e({message:l,type:l&&t,onDismiss:n,closeLabel:s,style:a,customActions:r})},error:async function(e){let{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()._alert("error",e,{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o})},warning:async function(e){let{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()._alert("warning",e,{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o})},info:async function(e){let{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()._alert("info",e,{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o})},success:async function(e){let{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()._alert("success",e,{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o})},plain:async function(e){let{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()._alert("plain",e,{onDismiss:t,closeLabel:l,closeDelay:n,style:s,customActions:o})},setCloseTimeout:async t=>{let{closeTimeout:l,reset:n}=i();l&&clearTimeout(l);let s=setTimeout(()=>e({closedTimestamp:o()().valueOf()}),t);e({closeTimeout:s})}})));i.Z=r},1289:function(e,i,t){var l=t(2067),n=t.n(l),s=t(4660),o=t(4810),a=t(1188),r=t(878),c=t(3819),d=t(8580);let u=(0,s.Ue)((0,o.mW)((e,i)=>({user:void 0,token:void 0,loaded:!1,loading:!1,haikus:{},allHaikus:{},dailyHaikus:{},dailyHaikudles:{},nextDailyHaikuId:void 0,nextDailyHaikudleId:void 0,getUser:async()=>{let{loaded:e,user:t,load:l}=i();return e?t:(await l()).user},getToken:async()=>{let{loaded:e,token:t,load:l}=i();return e?t:(await l()).token},load:async function(){var t,l;let n,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e({loading:!0});let{loadLocal:o,loadRemote:a,allHaikus:u,dailyHaikus:m,dailyHaikudles:p}=i(),h={album:s.album},f=(null===(t=window)||void 0===t?void 0:t.localStorage)&&window.localStorage.getItem("session");if(!f){let t=await i().createRemote(h);if(n=t.user,f=t.token,!n||!f){d.Z.getState().error("Unable to create session user and/or token: (unknown)"),e({loading:!1});return}(null===(l=window)||void 0===l?void 0:l.localStorage)&&window.localStorage.setItem("session",f||"")}let{user:v,haikus:g,allHaikus:x,dailyHaikus:k,dailyHaikudles:C,nextDailyHaikuId:b,nextDailyHaikudleId:y}=await a(f,s);return n?(0,c.Z)("user-session-created",{userId:n.id,isAdmin:n.isAdmin,isAnonymous:n.isAnonymous,host:n.host}):(0,c.Z)("user-session-loaded",{userId:v.id,isAdmin:v.isAdmin,isAnonymous:v.isAnonymous,host:v.host}),e({user:h={...n,...v},token:f,loaded:!0,loading:!1,haikus:g?(0,r.Qr)(g,{keyFn:e=>e.haikuId}):{},allHaikus:{...u,...x?(0,r.Qr)(x,{keyFn:e=>e.haikuId}):{}},dailyHaikus:{...m,...k?(0,r.Qr)(k,{keyFn:e=>e.haikuId}):{}},dailyHaikudles:{...p,...C?(0,r.Qr)(C,{keyFn:e=>e.haikuId}):{}},nextDailyHaikuId:b,nextDailyHaikudleId:y}),{user:h,token:f,haikus:g,allHaikus:{...u,...x},dailyHaikus:{...m,...k},dailyHaikudles:{...p,...C},nextDailyHaikuId:b,nextDailyHaikudleId:y}},update:async i=>{e({user:i})},incUserUsage:async(i,t)=>{let l=n()().format("YYYYMMDD"),s=(null==i?void 0:i.usage[l])&&(null==i?void 0:i.usage[l])||{},o=s[t]||0;e({user:{...i,usage:{...s,[l]:{...s[t],[t]:o+1}}}})},save:async t=>{var l;let{user:n,token:s}=await i().saveRemote(t);return(null===(l=window)||void 0===l?void 0:l.localStorage)&&window.localStorage.setItem("session",s||""),e({user:n,token:s}),{user:n,token:s}},loadRemote:async function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=(0,r.cr)({...i.count&&{count:i.count}||{count:a.t+1},...i.offset&&{offset:i.offset}||{}}),l=await fetch("/api/user".concat(t?"?".concat(t):""),{headers:{Authorization:"Bearer ".concat(e)}});return 200!=l.status?((0,c.Z)("error",{type:"fetch-user",code:l.status,token:e}),d.Z.getState().error("Error fetching haikus: ".concat(l.status," (").concat(l.statusText,")")),{}):l.json()},createRemote:async e=>{let i=await fetch("/api/user",{method:"POST",body:JSON.stringify({user:e})});if(200!=i.status)return(0,c.Z)("error",{type:"post-user",code:i.status}),d.Z.getState().error("Error posting user session: ".concat(i.status," (").concat(i.statusText,")")),{};let{user:t,token:l}=await i.json();return{user:t,token:l}},saveRemote:async e=>{let t=await i().getToken(),l=await fetch("/api/user/".concat(e.id),{...t&&{headers:{Authorization:"Bearer ".concat(t)}}||{},method:"PUT",body:JSON.stringify({user:e})});if(200!=l.status)return(0,c.Z)("error",{type:"put-user",code:l.status}),d.Z.getState().error("Error saving user session: ".concat(l.status," (").concat(l.statusText,")")),{};let{user:n,token:s}=await l.json();return{user:n,token:s}},addUserHaiku:async(e,t)=>{let{user:l,haikus:n,allHaikus:s}=i(),o=await i().getToken(),a=await fetch("/api/user/".concat(l.id,"/haikus"),{...o&&{headers:{Authorization:"Bearer ".concat(o)}}||{},method:"POST",body:JSON.stringify({haiku:e,action:t})});if(200!=a.status)return(0,c.Z)("error",{type:"put-user",code:a.status}),d.Z.getState().error("Error saving user session: ".concat(a.status," (").concat(a.statusText,")")),{};let{userHaiku:r}=await a.json();u.setState({haikus:{...n,[e.id]:r},allHaikus:l.isAdmin&&{...s,[e.id]:r}})}})));i.Z=u},7143:function(e,i,t){t.d(i,{No:function(){return a},Zn:function(){return c},nB:function(){return o},s3:function(){return r}});let[l,n,s]=["start","center","end"],o=4,a=[{spacing:[0,0,0,0,0,32],alignments:[l,l,l,l,l]},{spacing:[0,0,0,0,0,32],alignments:[l,l,l,s,n]},{spacing:[0,0,0,0,0,32],alignments:[n,n,n,n,n]},{spacing:[0,0,0,0,0,32],alignments:[s,s,s,s,s]}
1,{spacing:[0,1,20,2,8,0],alignments:[l,l,l,s,l]},{spacing:[0,1,20,2,8,0],alignments:[l,l,l,s,n]},{spacing:[0,10,10,10,10,0],alignments:[l,l,l,l,l]},{spacing:[0,10,10,10,10,0],alignments:[l,l,l,s,l]},{spacing:[0,10,10,10,10,0],alignments:[l,l,l,s,n]},{spacing:[0,10,10,10,10,0],alignments:[n,n,n,n,n]},{spacing:[0,10,10,10,10,0],alignments:[s,s,s,s,s]},{spacing:[0,15,15,2,5,0],alignments:[l,l,l,s,l]},{spacing:[0,15,15,2,5,0],alignments:[l,l,l,s,n]},{spacing:[10,10,10,10,10,10],alignments:[l,l,l,l,l]},{spacing:[10,10,10,10,10,10],alignments:[l,l,l,s,l]},{spacing:[10,10,10,10,10,10],alignments:[l,l,l,s,n]},{spacing:[10,10,10,10,10,10],alignments:[n,n,n,n,n]},{spacing:[10,10,10,10,10,10],alignments:[s,s,s,s,s]},{spacing:[20,5,10,2,5,5],alignments:[l,l,l,s,l]},{spacing:[20,5,10,2,5,5],alignments:[l,l,l,s,n]},{spacing:[32,0,0,0,0,32],alignments:[l,l,l,l,l]},{spacing:[32,0,0,0,0,32],alignments:[l,l,l,s,l]},{spacing:[32,0,0,0,0,32],alignments:[l,l,l,s,n]},{spacing:[32,0,0,0,0,32],alignments:[n,n,n,n,n]},{spacing:[32,0,0,0,0,32],alignments:[s,s,s,s,s]},{spacing:[32,0,0,0,0,0],alignments:[l,l,l,l,l]},{spacing:[32,0,0,0,0,0],alignments:[l,l,l,s,l]},{spacing:[32,0,0,0,0,0],alignments:[l,l,l,s,n]},{spacing:[32,0,0,0,0,0],alignments:[n,n,n,n,n]},{spacing:[32,0,0,0,0,0],alignments:[s,s,s,s,s]}],r=5,c=[{bgImagePosition:"center 0%",bgImageSize:"calc(100% + 1024px)"},{bgImagePosition:"center 0%",bgImageSize:"calc(100% + 512px)"},{bgImagePosition:"center 0%",bgImageSize:"calc(100% + 256px)"},{bgImagePosition:"center 0%",bgImageSize:"calc(100% + 128px)"},{bgImagePosition:"center 0%",bgImageSize:"calc(100% + 56px)"},{bgImagePosition:"",bgImageSize:""},{bgImagePosition:"center 100%",bgImageSize:"calc(100% + 56px)"},{bgImagePosition:"center 100%",bgImageSize:"calc(100% + 128px)"},{bgImagePosition:"center 100%",bgImageSize:"calc(100% + 256px)"},{bgImagePosition:"center 100%",bgImageSize:"calc(100% + 512px)"},{bgImagePosition:"center 100%",bgImageSize:"calc(100% + 1024px)"}]},8998:function(e,i,t){t.d(i,{Q:function(){return l}});let l={DAILY_CREATE_HAIKU:10,DAILY_REGENERATE_HAIKU:20}},1188:function(e,i,t){t.d(i,{t:function(){return l}});let l=20},5195:function(e,i,t){t.d(i,{Dm:function(){return o},OB:function(){return r},Od:function(){return c},kC:function(){return a},zq:function(){return d}});var l=t(2067),n=t.n(l),s=t(3819);function o(e){let i=n()(),t=n()(e),l=i.diff(t,"seconds");return l>=0&&l<40?"just now":l<0&&l>-40?"now":n()(e).fromNow()}function a(e){return e&&e.split(/\s+/).map(e=>e&&"".concat(e.substring(0,1).toUpperCase()).concat(e.substring(1))).join(" ")}function r(e){return(e&&"string"!=typeof e&&(0,s.Z)("assertion-failed",{type:"upperCaseFirstLetter",typeof:typeof e,value:JSON.stringify(e)}),e&&"string"==typeof e)?e.substring(0,1).toUpperCase()+e.substring(1):""}function c(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"".concat(i?"un-":"").concat(e.endsWith("e")?e.substring(0,e.length-1):e,"ing")}function d(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"".concat(i?"un-":"").concat(e.endsWith("e")?e.substring(0,e.length-1):e,"ed")}},878:function(e,i,t){t.d(i,{DZ:function(){return c},PU:function(){return o},Qr:function(){return r},Vj:function(){return n},cr:function(){return a},un:function(){return s}});var l=t(1872);function n(){return(0,l.Z)().substring(0,8)}function s(e){let i=0,t;if(0===e.length)return i;for(t=0;t<e.length;t++)i=(i<<5)-i+e.charCodeAt(t)|0;return i}function o(e){return e&&e.replace(/[.,]/,"").toLowerCase()}function a(e){return Object.entries(e).map(e=>e.join("=")).join("&")}function r(e,i){let t=(null==i?void 0:i.keyFn)||function(e){return e.id},l=(null==i?void 0:i.valFn)||function(e){return e};return e.map(e=>[t(e),l(e)]).reduce((e,i)=>{let[t,l]=i;return Object.assign(e,{[t]:l})},{})}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>{let[i,t]=e;return t};return Object.entries(e).map(e=>i(e))}},3819:function(e,i,t){t.d(i,{Z:function(){return n}});var l=t(4363);function n(e,i){(0,l.j)(e,i)}}}]);
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.