From 6ce389e470ba7e784a170b6b6be1b282c5d5b1c3 Mon Sep 17 00:00:00 2001 From: Bret Petersen Date: Tue, 27 Feb 2024 18:22:59 -0600 Subject: [PATCH] Updates --- assets/{index.438f2269.js => index.cbd9b427.js} | 4 ++-- index.html | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) rename assets/{index.438f2269.js => index.cbd9b427.js} (97%) diff --git a/assets/index.438f2269.js b/assets/index.cbd9b427.js similarity index 97% rename from assets/index.438f2269.js rename to assets/index.cbd9b427.js index c94b630..3c5fa7f 100644 --- a/assets/index.438f2269.js +++ b/assets/index.cbd9b427.js @@ -1,4 +1,4 @@ -import{b as re,g as ae,f as ve,a as e,u as S,F as v,j as a,r as c,h as ie,B as ye,L as q,i as be,k as M}from"./vendor.9c205b7b.js";import{B as w,Q as xe}from"./react-toastify.2531e5d2.js";import"./dotenv.d40bc9be.js";import{E as Ne}from"./@mui/icons-material.b07ec430.js";import{S as we,a as Q}from"./@splidejs/react-splide.ba4e8ea5.js";import{u as Ae}from"./styled-components.92c2543f.js";import{S as L}from"./short-unique-id.900f0fe1.js";import"./react-bootstrap.de549239.js";import{T,M as X,I as Se}from"./@mui/material.398feaae.js";import{m as ne}from"./framer-motion.9ec77cc7.js";import"./@emotion/react.d3c19799.js";import"./@emotion/styled.cd716cc6.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const d of s.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerpolicy&&(s.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?s.credentials="include":o.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();var oe,Z=re.exports;oe=Z.createRoot,Z.hydrateRoot;var U={},C={exports:{}};(function(r){function t(i){return i&&i.__esModule?i:{default:i}}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports})(C);var z={};const Me=ae(Ne);var ee;function $(){return ee||(ee=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Me}(z)),z}const R=ae(ve);var _e=C.exports;Object.defineProperty(U,"__esModule",{value:!0});var se=U.default=void 0,Ce=_e($()),Ie=R;se=U.default=(0,Ce.default)((0,Ie.jsx)("path",{d:"M10 8.64 15.27 12 10 15.36zM8 5v14l11-7z"}),"PlayArrowOutlined");var H={},Ge=C.exports;Object.defineProperty(H,"__esModule",{value:!0});var le=H.default=void 0,$e=Ge($()),Re=R;le=H.default=(0,$e.default)((0,Re.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");var J={},Le=C.exports;Object.defineProperty(J,"__esModule",{value:!0});var ce=J.default=void 0,ke=Le($()),De=R;ce=J.default=(0,ke.default)((0,De.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");const Oe=[{id:"4EBDTB",currentGroup:"Default Affirmations",groups:[{id:"fkuT6N",group:"Default Affirmations",affirmations:[{id:"iqjiu5",affirmation:"You got this"},{id:"xsNHVz",affirmation:"You\u2019ll figure it out"},{id:"fFTc4T",affirmation:"You\u2019re a smart cookie"},{id:"xxbx1b",affirmation:"I believe in you"},{id:"ogoSaR",affirmation:"Sucking at something is the first step towards being good at something"}]}]}],_=r=>{localStorage.setItem("affirmationsUnique",JSON.stringify(r))},P=()=>{let r=[];function t(){r=localStorage.getItem("affirmationsUnique")?JSON.parse(localStorage.getItem("affirmationsUnique")):Oe,localStorage.setItem("affirmationsUnique",JSON.stringify(r))}return t(),r},B=(r,t)=>{r[0].currentGroup=t;let i;return Object.entries(r[0].groups).forEach(n=>{const[o,s]=n;s.group===t&&(i=o)}),r[0].groups[i].affirmations},O=(r,t)=>{let i;return Object.entries(r[0].groups).forEach(n=>{const[o,s]=n;s.group===t&&(i=o)}),i},F=r=>{let t=[];return r&&r[0].groups.forEach(i=>{t.push(i.group)}),t};function l(r){return e(Pe,{className:"btn",onClick:r.run,children:r.text})}const Pe=Ae.div` +import{b as re,g as ae,f as ve,a as e,u as S,F as v,j as a,r as c,h as ie,B as ye,L as q,i as be,k as M}from"./vendor.9c205b7b.js";import{B as w,Q as xe}from"./react-toastify.2531e5d2.js";import"./dotenv.d40bc9be.js";import{E as Ne}from"./@mui/icons-material.b07ec430.js";import{S as we,a as Q}from"./@splidejs/react-splide.ba4e8ea5.js";import{u as Ae}from"./styled-components.92c2543f.js";import{S as L}from"./short-unique-id.900f0fe1.js";import"./react-bootstrap.de549239.js";import{T,M as X,I as Se}from"./@mui/material.398feaae.js";import{m as ne}from"./framer-motion.9ec77cc7.js";import"./@emotion/react.d3c19799.js";import"./@emotion/styled.cd716cc6.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const d of s.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function i(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerpolicy&&(s.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?s.credentials="include":o.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=i(o);fetch(o.href,s)}})();var oe,Z=re.exports;oe=Z.createRoot,Z.hydrateRoot;var U={},C={exports:{}};(function(r){function t(i){return i&&i.__esModule?i:{default:i}}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports})(C);var z={};const Me=ae(Ne);var ee;function $(){return ee||(ee=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Me}(z)),z}const R=ae(ve);var _e=C.exports;Object.defineProperty(U,"__esModule",{value:!0});var se=U.default=void 0,Ce=_e($()),Ie=R;se=U.default=(0,Ce.default)((0,Ie.jsx)("path",{d:"M10 8.64 15.27 12 10 15.36zM8 5v14l11-7z"}),"PlayArrowOutlined");var H={},Ge=C.exports;Object.defineProperty(H,"__esModule",{value:!0});var le=H.default=void 0,$e=Ge($()),Re=R;le=H.default=(0,$e.default)((0,Re.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");var J={},Le=C.exports;Object.defineProperty(J,"__esModule",{value:!0});var ce=J.default=void 0,De=Le($()),ke=R;ce=J.default=(0,De.default)((0,ke.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");const Oe=[{id:"4EBDTB",currentGroup:"Default Affirmations",groups:[{id:"fkuT6N",group:"Default Affirmations",affirmations:[{id:"iqjiu5",affirmation:"You got this"},{id:"xsNHVz",affirmation:"You\u2019ll figure it out"},{id:"fFTc4T",affirmation:"You\u2019re a smart cookie"},{id:"xxbx1b",affirmation:"I believe in you"},{id:"ogoSaR",affirmation:"Sucking at something is the first step towards being good at something"}]}]}],_=r=>{localStorage.setItem("affirmationsUnique",JSON.stringify(r))},P=()=>{let r=[];function t(){r=localStorage.getItem("affirmationsUnique")?JSON.parse(localStorage.getItem("affirmationsUnique")):Oe,localStorage.setItem("affirmationsUnique",JSON.stringify(r))}return t(),r},B=(r,t)=>{r[0].currentGroup=t;let i;return Object.entries(r[0].groups).forEach(n=>{const[o,s]=n;s.group===t&&(i=o)}),r[0].groups[i].affirmations},O=(r,t)=>{let i;return Object.entries(r[0].groups).forEach(n=>{const[o,s]=n;s.group===t&&(i=o)}),i},F=r=>{let t=[];return r&&r[0].groups.forEach(i=>{t.push(i.group)}),t};function l(r){return e(Pe,{className:"btn",onClick:r.run,children:r.text})}const Pe=Ae.div` border: 2px solid var(--primaryColor); background-color: var(--backgroundColor); color: var(--primaryColor); @@ -23,4 +23,4 @@ import{b as re,g as ae,f as ve,a as e,u as S,F as v,j as a,r as c,h as ie,B as y background-color: var(--primaryBtnColor); color: var(--backgroundColor); } -`,je=()=>{const r=S(),t=P(),i=t[0].currentGroup,n=B(t,i),o=()=>{r("/add",{state:{currentGroup:i,affirmationsData:t}})};return e(v,{children:e("section",{className:"home-slideshow",children:a(we,{options:{pagination:!1,pauseOnHover:!1,arrows:!1,type:"fade",rewind:!0,autoplay:!0,speed:500,width:"100vw",height:"100vh",interval:4e3},"aria-label":"My Affirmation Quotes",children:[n.length==0?a(Q,{className:"d-flex justify-content-center w-100",style:{width:"100vw!important"},children:[a("p",{children:["No affirmations present",e("br",{}),"in ",e("i",{children:i})," group"]}),e("div",{className:"pt-0 pb-0 mt-0 mb-0",children:e(l,{text:"Add Affirmation",run:()=>o()})})]}):n.map(s=>e(Q,{id:s.id,value:s.affirmation,"data-splide-interval":s.affirmation.length>60?"8000":"4000",children:e("p",{children:s.affirmation})},s.id)),e("div",{className:"splide__progress",children:e("div",{className:"splide__progress__bar"})})]})})})};var K={},Ee=C.exports;Object.defineProperty(K,"__esModule",{value:!0});var de=K.default=void 0,qe=Ee($()),ze=R;de=K.default=(0,qe.default)((0,ze.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");var Y={},Te=C.exports;Object.defineProperty(Y,"__esModule",{value:!0});var ue=Y.default=void 0,Be=Te($()),Fe=R;ue=Y.default=(0,Be.default)((0,Fe.jsx)("path",{d:"m19 15-1.41-1.41L13 18.17V2h-2v16.17l-4.59-4.59L5 15l7 7z"}),"South");var V={},Ue=C.exports;Object.defineProperty(V,"__esModule",{value:!0});var fe=V.default=void 0,He=Ue($()),Je=R;fe=V.default=(0,He.default)((0,Je.jsx)("path",{d:"M22 24H2v-4h20zM13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68-3.75-3.75 2.53-2.54 3.75 3.75z"}),"BorderColorSharp");const Ke=({affirmation:r,id:t,currentGroup:i,affirmationsData:n})=>{const o=S(),s=d=>{let x=d.target.closest("li").getAttribute("id");o("/edit",{state:{affirmationId:x}})};return e("li",{style:{listStyleType:"none"},id:t,className:"list-group-flush splide__slide__EDIT",children:e("div",{className:"card",children:a("div",{className:"card-body d-flex flex-row",children:[e("p",{className:"theme-switcher text-center",children:r}),e("button",{onClick:d=>{s(d)},className:"theme-switcher edit",children:e(fe,{fontSize:"small",style:{color:"white"}})})]})})},t)},Ye=({currentGroup:r,affirmationsData:t,affirmations:i})=>e(v,{children:a("div",{className:"MuiFormControl-root MuiTextField-root css-1u3bzj6-MuiFormControl-root-MuiTextField-root",style:{width:"100%",maxWidth:"500px",margin:"auto"},children:[a("label",{className:"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiFormLabel-filled MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root","data-shrink":"true",htmlFor:"outlined-select-currency",id:"outlined-select-currency-label",children:["Group: ",e("i",{style:{color:"#303030"},children:r})]}),a("div",{className:"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl MuiInputBase-multiline css-dpjnhs-MuiInputBase-root-MuiOutlinedInput-root",style:{borderRadius:"5px"},children:[a("div",{className:"d-grid gap-2 p-3 pt-4",children:[i.length?i.map(({affirmation:n,id:o},s)=>e(Ke,{affirmation:n,id:s,currentGroup:r,affirmationsData:t},o)):a("p",{className:"mb-2",children:[e("i",{children:"No affirmations present"}),e("br",{}),e("small",{className:"text-muted",children:"add an affirmation above ^"})]}),i.length?e("div",{className:"pt-3",children:e("p",{children:e("i",{children:"End of list"})})}):null]}),e("fieldset",{"aria-hidden":"true",className:"MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline aff-wrap-gradient",children:e("legend",{className:"css-14lo706",children:a("span",{children:["Group: ",r]})})})]})]})}),Ve=({currentGroup:r,affirmationsData:t,affirmations:i})=>{const n=S(),o=()=>{n("/add",{state:{currentGroup:r,affirmationsData:t}})};return a(v,{children:[e("div",{className:"pt-4 pb-0",children:e(l,{text:"Add Affirmation",run:()=>o()})}),e("div",{className:"pt-0 pb-2",children:e(ue,{style:{color:"rgb(150, 150, 150)"}})}),e(Ye,{affirmationsData:t,currentGroup:r,affirmations:i})]})},A=({children:r})=>{const t=c.exports.useRef(null);return t.current||(t.current=document.createElement("div")),c.exports.useEffect(()=>{const i=document.getElementById("modal");return i.appendChild(t.current),()=>i.removeChild(t.current)},[]),re.exports.createPortal(e("div",{children:r}),t.current)},te=new L,We=class{constructor(r,t){this.id=te.rnd(),this.uid=te.rnd(),this.group=r,this.affirmations=[]}},Qe=new L,Xe=()=>{const r=S(),[t,i]=c.exports.useState(P()),[n,o]=c.exports.useState(t[0].currentGroup),[s,d]=c.exports.useState(F(t)),[f,x]=c.exports.useState(B(t,n)),[N,h]=c.exports.useState(!1),[m,p]=c.exports.useState(!1),[k,I]=c.exports.useState(!1),[G,g]=c.exports.useState(""),y="+ Create new group",j=()=>{const u=B(t,n);x(u),t[0].currentGroup=n,_(t)},D=()=>{d(F(t))},me=()=>{let u=t[0].groups;const b=O(t,n);u=u.slice(0,Number(b)).concat(u.slice(Number(b)+1)),t[0].groups=u,w.success(`Group '${n}' deleted!`,{position:"bottom-center"}),o(t[0].groups[0].group),_(t),r("/current"),console.log("this is after the 'navigate' that is being skipped")};c.exports.useEffect(()=>{j(),D()},[n]);const pe=()=>{const u=document.getElementById("name").value;if(s.includes(u))alert("You already have a group with this name. Please name your group anything else to continue creating it.");else if(!u)alert("You have not entered any text. Please name your group to continue creating it.");else{const b=t[0].groups.length+1,E=new We(u,b);t[0].groups.push({id:Qe.rnd(),group:E.group,affirmations:E.affirmations}),_(t),h(!1),o(u),w.success(`Group '${u}' added!`,{position:"bottom-center"})}},W=()=>{const u=O(t,n),b="/affirmations-vite/shared?query=",he=[t[0].groups[u]].flat(),ge=JSON.stringify(he);g(`${BASE_URL}${b}${ge}`),I(!0)};return a(v,{children:[a("div",{className:"search-params",children:[a(T,{style:{width:"100%",maxWidth:"500px",textAlign:"left"},select:!0,id:"outlined-select-currency",label:"Please select or create new group",value:n,onChange:u=>{let b=u.target.value;b==y?h(!0):o(b)},children:[t[0].groups.map(u=>e(X,{id:u.id,style:{fontFamily:"Poppins"},value:u.group,children:u.group},u.id)),e(X,{style:{fontFamily:"Poppins"},value:y,children:y})]}),e("ul",{className:"list-group cards pb-3",children:e(ne.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{ease:"easeInOut",duration:.5,delay:.125},children:e(Ve,{currentGroup:n,affirmationsData:t,affirmations:f})})}),a("div",{className:"d-flex justify-content-between pt-2 pb-2",style:{maxWidth:"500px",margin:"auto"},children:[e("div",{style:{visibility:"hidden"},children:e(l,{"aria-label":"layout spacer"})}),!f.length==0?e(l,{text:"Share Group","aria-label":"share group",run:()=>W()}):e("div",{style:{visibility:"hidden"},children:e(l,{text:"Share Group","aria-label":"share group",run:()=>W()})}),e(Se,{disableRipple:!0,disableFocusRipple:!0,size:"small","aria-label":"delete",className:"btnGroupDelete",onClick:()=>p(!0),children:e(de,{fontSize:"medium"})})]})]}),N?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Creating new group?"}),a("div",{className:"buttons",children:[e("form",{children:e(T,{required:!0,autoFocus:!0,className:"w-100 mb-2 mt-1",type:"text",id:"name",label:"Group name",variant:"outlined",name:"name",minLength:"1",maxLength:"100",size:"20"})}),a("div",{className:"d-flex justify-content-center",children:[e(l,{text:"Cancel",run:()=>h(!1)}),e(l,{text:"Create Group",run:()=>pe()})]})]})]})}):null,m?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Delete this group?"}),e("p",{children:n}),a("div",{className:"buttons",children:[e(l,{text:"Abort!",run:()=>p(!1)}),e(l,{text:"Confirm",run:()=>me()})]})]})}):null,k?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Share this group?"}),e("p",{children:n}),e("label",{style:{display:"flex",flexDirection:"column",padding:"8px"},children:e("textarea",{style:{height:"200px",fontSize:"10px"},type:"text",readOnly:!0,value:G})}),a("div",{className:"buttons",children:[e(l,{text:"Close",run:()=>I(!1)}),e(l,{text:"Copy to clipboard",run:()=>{navigator.clipboard.writeText(G),w.success(`Sharable '${n}' URL copied to clipboard!`,{position:"bottom-center"})}})]})]})}):null]})},Ze=()=>e(v,{children:e(ne.div,{initial:{opacity:0},animate:{opacity:1},transition:{ease:"easeOut",duration:.5},children:a("section",{className:"traditional__layout",children:[e("h1",{className:"pb-3",children:"Saved Affirmations"}),e(Xe,{})]})})});const et=()=>{const r=S(),t=ie(),[i,n]=c.exports.useState(!1),[o,s]=c.exports.useState(!1),[d,f]=c.exports.useState(P()),[x,N]=c.exports.useState(d[0].currentGroup);let h=O(d,x),m=t.state.affirmationId,p=d[0].groups[h].affirmations[m].affirmation;const k=()=>{let g=d[0].groups[h].affirmations,y=g.slice(0,Number(m)).concat(g.slice(Number(m)+1));d[0].groups[h].affirmations=y,w.success(`Affirmation '${p}' deleted!`,{position:"bottom-center"}),_(d),r("/current")};function I(){const g=document.getElementById("affirmationText").value;g?g==p?(w.info("No changes were made \u{1F9D0} Try again?",{position:"bottom-center"}),r("/current")):(d[0].groups[h].affirmations[m].affirmation=g,_(d),w.success(`Update to '${g}', success!`,{position:"bottom-center"}),r("/current")):n(!0)}function G(){r("/current")}return a(v,{children:[a("section",{className:"traditional__layout addAffirmation",children:[e("h1",{className:"pb-2",children:"Edit Affirmation"}),e("div",{className:"pb-2",children:e("p",{children:"Edit your affirmation below"})}),e("form",{className:"align-items-center pb-3",children:e("textarea",{className:"",id:"affirmationText",defaultValue:p})}),a("div",{className:"flex",children:[e(l,{text:"Cancel",run:()=>G()}),e(l,{text:"Update Affirmation",run:()=>I()}),e(l,{text:"Delete Affirmation",run:()=>s(!0)})]})]}),i?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Affirmation text is empty"}),e("p",{children:"Please add text and try again"}),e("div",{className:"buttons",children:e(l,{text:"Understood",run:()=>n(!1)})})]})}):null,o?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Delete this affirmation"}),e("p",{children:"Are you sure?"}),a("div",{className:"buttons",children:[e(l,{text:"Abort",run:()=>s(!1)}),e(l,{text:"Delete",run:()=>{k(),s(!1)}})]})]})}):null]})};new L;const tt=class{constructor(r,t){this.affirmation=r,this.id=t}},rt=()=>{const r=S(),t=ie(),i=new L,[n,o]=c.exports.useState(!1);let s=t.state.affirmationsData,d=t.state.currentGroup,f=O(s,d);const x=()=>{const h=document.getElementById("affirmationText").value;if(!h)o(!0);else{const m=i.rnd(),p=new tt(h,m);s[0].groups[f].affirmations.unshift({id:p.id,affirmation:p.affirmation}),_(s),w.success(`Affirmation '${p.affirmation}' added!`,{position:"bottom-center"}),r("/current")}},N=()=>{r("/current")};return a(v,{children:[a("section",{className:"traditional__layout addAffirmation",children:[e("h1",{className:"font-bold pb-2",children:"Add Affirmation"}),e("div",{className:"pb-2",children:e("p",{children:"Enter your affirmation below"})}),e("form",{className:"align-items-center pb-3",children:e("textarea",{autoFocus:!0,className:"",id:"affirmationText",placeholder:"Type/paste your affirmation here"})}),a("div",{className:"flex",children:[e(l,{text:"Cancel",run:()=>N()}),e(l,{text:"Add Affirmation",run:()=>x()})]})]}),n?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Affirmation text is empty"}),e("p",{children:"Please add text and try again"}),e("div",{className:"buttons",children:e(l,{text:"Understood",run:()=>o(!1)})})]})}):null]})},at="/affirmations-vite/assets/Af-logo.08741b66.svg",it=()=>e(v,{children:a("section",{className:"traditional__layout addAffirmation",children:[e("div",{children:e("img",{src:at,alt:"Affirmations app SVG logo"})}),e("h1",{className:"font-bold text-purple-600 pb-2 pt-2",children:"About this application"}),a("div",{className:"about",children:[e("p",{className:"pb-3",children:"This application gives you an editable slideshow of affirmations for your inspirational viewing pleasure. Keep yourself inspired!"}),e("h2",{children:"What can I do?"}),a("p",{className:"pb-3",children:["Feel free to ",e("i",{children:"add"})," your own affirmations, ",e("i",{children:"edit"})," existing ones, ",e("i",{children:"erase"})," them all to start from scratch, and ",e("i",{children:"load"})," ","in the default affirmations that you started with."]}),e("h2",{children:"Noteable tidbit"}),e("p",{className:"pb-3",children:"This app uses localStorage to save your affirmations. If that means nothing to you here is what you need to know. Your affirmations are stored in your web browser (as opposed to a database) so if you keep using this device and this browser you will always see your affirmations. This means you will only have access to your personal affirmations specifically on this device and broswer."})]})]})}),nt=({affirmation:r,id:t,currentGroup:i,affirmationsData:n})=>(S(),e("li",{style:{listStyleType:"none"},id:t,className:"list-group-flush splide__slide__EDIT",children:e("div",{className:"card",children:e("div",{className:"card-body d-flex flex-row",children:e("p",{className:"theme-switcher text-center",style:{paddingRight:"unset"},children:r})})})},t)),ot=({sharedAffirmations:r})=>{const[t,i]=c.exports.useState(JSON.parse(r)[0].affirmations),[n,o]=c.exports.useState(JSON.parse(r)[0].group);return a(v,{children:[e("div",{className:"pt-3",children:a("p",{children:["List of ",e("i",{children:n})," affirmations"]})}),e("div",{className:"d-grid gap-2 p-3 pt-1",children:t.length?t.map(({affirmation:s,id:d},f)=>e(nt,{affirmation:s,id:f},d)):e("h1",{children:"No Affirmations present"})})]})},st=new L,lt=r=>{const t=S(),[i,n]=c.exports.useState(!1),[o,s]=c.exports.useState(!1),d=new URLSearchParams(window.location.search),[f,x]=c.exports.useState(P()),[N,h]=c.exports.useState(d.get("query")),m=JSON.parse(N)[0].group,[p,k]=c.exports.useState(F(f)),I=()=>{p.includes(m)?s(!0):n(!0)},G=()=>{t("/about")},g=()=>{const y=document.getElementById("name").value;if(p.includes(y))alert("You already have a group with this name. Please name your group anything else to continue creating it.");else if(!y)alert("You have not entered any text. Please name your group to continue creating it.");else{const j=f[0].groups.length;let D=JSON.parse(N);D[0].group=y,f[0].groups.push(D[0]),f[0].groups[j].id=st.rnd(),_(f),t("/"),w.success(`Group '${y}' added. Enjoy!`,{position:"bottom-center"})}};return a(v,{children:[a("section",{className:"traditional__layout",children:[e("h1",{className:"pb-2",children:"Incoming Affirmations"}),a("div",{className:"d-flex flex-column justify-content-center",children:[a("p",{className:"mb-3",style:{width:"385px",margin:"0 auto"},children:["Someone has sent you a list of affirmations titled"," ",e("i",{children:m}),"."]}),e("div",{className:"flex",children:e(l,{text:"Accept & view",run:()=>I()})})]}),e(ot,{sharedAffirmations:N}),e("div",{className:"flex",children:e(l,{text:"About this site",run:()=>G()})})]}),o?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Rename new group"}),a("p",{children:["You already have a group named ",e("i",{children:m}),"."]}),a("div",{className:"buttons",children:[e("form",{children:e(T,{required:!0,autoFocus:!0,className:"w-100 mb-2 mt-1",type:"text",id:"name",label:"Rename group to continue",variant:"outlined",name:"name",minLength:"1",maxLength:"100",size:"20"})}),e(l,{text:"Cancel",run:()=>s(!1)}),e(l,{text:"Rename",run:()=>{g(),s(!1)}})]})]})}):null,i?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Import this group?"}),e("p",{children:m}),a("div",{className:"buttons",children:[e(l,{text:"Abort!",run:()=>n(!1)}),e(l,{text:"Confirm",run:()=>{g(),n(!1)}})]})]})}):null]})};const ct=()=>{const[r,t]=c.exports.useState(!1);c.exports.useState(!1);const i="/affirmations-vite/",n=()=>{t(o=>!o)};return e(v,{children:a(ye,{children:[a("nav",{className:"theme-switcher btm-gradient",children:[e("div",{id:"appName",className:"theme-switcher",children:"Affirmations"}),e("button",{id:"hamburger",className:r?"opened":"",onClick:n,"aria-label":"Main Menu",children:a("svg",{width:"40",height:"40",viewBox:"0 0 100 100",children:[e("path",{className:"theme-switcher line line1",d:"M 20,29.000046 H 80.000231 C 80.000231,29.000046 94.498839,28.817352 94.532987,66.711331 94.543142,77.980673 90.966081,81.670246 85.259173,81.668997 79.552261,81.667751 75.000211,74.999942 75.000211,74.999942 L 25.000021,25.000058"}),e("path",{className:"theme-switcher line line2",d:"M 20,50 H 80"}),e("path",{className:"theme-switcher line line3",d:"M 20,70.999954 H 80.000231 C 80.000231,70.999954 94.498839,71.182648 94.532987,33.288669 94.543142,22.019327 90.966081,18.329754 85.259173,18.331003 79.552261,18.332249 75.000211,25.000058 75.000211,25.000058 L 25.000021,74.999942"})]})}),a("ul",{id:"menu",className:r?"opened":"",children:[e("li",{children:e(q,{to:`${i}`,onClick:n,className:"theme-switcher",children:e(se,{fontSize:"large"})})}),e("li",{children:e(q,{to:`${i}current`,onClick:n,className:"theme-switcher",children:e(le,{fontSize:"large"})})}),e("li",{children:e(q,{to:`${i}about`,onClick:n,children:e(ce,{fontSize:"large"})})})]})]}),e("main",{children:a(be,{children:[e(M,{path:`${i}`,element:e(je,{})}),e(M,{path:`${i}current`,element:e(Ze,{})}),e(M,{path:`${i}add`,element:e(rt,{})}),e(M,{path:`${i}edit`,element:e(et,{})}),e(M,{path:`${i}shared`,element:e(lt,{})}),e(M,{path:`${i}about`,element:e(it,{})}),e(M,{path:"*",element:e("p",{children:"Path not resolved"})})]})}),e(xe,{})]})})},dt=document.getElementById("root"),ut=oe(dt);ut.render(e(ct,{})); +`,je=()=>{const r=S(),t=P(),i=t[0].currentGroup,n=B(t,i),o=()=>{r("/add",{state:{currentGroup:i,affirmationsData:t}})};return e(v,{children:e("section",{className:"home-slideshow",children:a(we,{options:{pagination:!1,pauseOnHover:!1,arrows:!1,type:"fade",rewind:!0,autoplay:!0,speed:500,width:"100vw",height:"100vh",interval:4e3},"aria-label":"My Affirmation Quotes",children:[n.length==0?a(Q,{className:"d-flex justify-content-center w-100",style:{width:"100vw!important"},children:[a("p",{children:["No affirmations present",e("br",{}),"in ",e("i",{children:i})," group"]}),e("div",{className:"pt-0 pb-0 mt-0 mb-0",children:e(l,{text:"Add Affirmation",run:()=>o()})})]}):n.map(s=>e(Q,{id:s.id,value:s.affirmation,"data-splide-interval":s.affirmation.length>60?"8000":"4000",children:e("p",{children:s.affirmation})},s.id)),e("div",{className:"splide__progress",children:e("div",{className:"splide__progress__bar"})})]})})})};var K={},Ee=C.exports;Object.defineProperty(K,"__esModule",{value:!0});var de=K.default=void 0,qe=Ee($()),ze=R;de=K.default=(0,qe.default)((0,ze.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");var Y={},Te=C.exports;Object.defineProperty(Y,"__esModule",{value:!0});var ue=Y.default=void 0,Be=Te($()),Fe=R;ue=Y.default=(0,Be.default)((0,Fe.jsx)("path",{d:"m19 15-1.41-1.41L13 18.17V2h-2v16.17l-4.59-4.59L5 15l7 7z"}),"South");var V={},Ue=C.exports;Object.defineProperty(V,"__esModule",{value:!0});var fe=V.default=void 0,He=Ue($()),Je=R;fe=V.default=(0,He.default)((0,Je.jsx)("path",{d:"M22 24H2v-4h20zM13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68-3.75-3.75 2.53-2.54 3.75 3.75z"}),"BorderColorSharp");const Ke=({affirmation:r,id:t,currentGroup:i,affirmationsData:n})=>{const o=S(),s=d=>{let x=d.target.closest("li").getAttribute("id");o("/edit",{state:{affirmationId:x}})};return e("li",{style:{listStyleType:"none"},id:t,className:"list-group-flush splide__slide__EDIT",children:e("div",{className:"card",children:a("div",{className:"card-body d-flex flex-row",children:[e("p",{className:"theme-switcher text-center",children:r}),e("button",{onClick:d=>{s(d)},className:"theme-switcher edit",children:e(fe,{fontSize:"small",style:{color:"white"}})})]})})},t)},Ye=({currentGroup:r,affirmationsData:t,affirmations:i})=>e(v,{children:a("div",{className:"MuiFormControl-root MuiTextField-root css-1u3bzj6-MuiFormControl-root-MuiTextField-root",style:{width:"100%",maxWidth:"500px",margin:"auto"},children:[a("label",{className:"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiFormLabel-filled MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root","data-shrink":"true",htmlFor:"outlined-select-currency",id:"outlined-select-currency-label",children:["Group: ",e("i",{style:{color:"#303030"},children:r})]}),a("div",{className:"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl MuiInputBase-multiline css-dpjnhs-MuiInputBase-root-MuiOutlinedInput-root",style:{borderRadius:"5px"},children:[a("div",{className:"d-grid gap-2 p-3 pt-4",children:[i.length?i.map(({affirmation:n,id:o},s)=>e(Ke,{affirmation:n,id:s,currentGroup:r,affirmationsData:t},o)):a("p",{className:"mb-2",children:[e("i",{children:"No affirmations present"}),e("br",{}),e("small",{className:"text-muted",children:"add an affirmation above ^"})]}),i.length?e("div",{className:"pt-3",children:e("p",{children:e("i",{children:"End of list"})})}):null]}),e("fieldset",{"aria-hidden":"true",className:"MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline aff-wrap-gradient",children:e("legend",{className:"css-14lo706",children:a("span",{children:["Group: ",r]})})})]})]})}),Ve=({currentGroup:r,affirmationsData:t,affirmations:i})=>{const n=S(),o=()=>{n("/add",{state:{currentGroup:r,affirmationsData:t}})};return a(v,{children:[e("div",{className:"pt-4 pb-0",children:e(l,{text:"Add Affirmation",run:()=>o()})}),e("div",{className:"pt-0 pb-2",children:e(ue,{style:{color:"rgb(150, 150, 150)"}})}),e(Ye,{affirmationsData:t,currentGroup:r,affirmations:i})]})},A=({children:r})=>{const t=c.exports.useRef(null);return t.current||(t.current=document.createElement("div")),c.exports.useEffect(()=>{const i=document.getElementById("modal");return i.appendChild(t.current),()=>i.removeChild(t.current)},[]),re.exports.createPortal(e("div",{children:r}),t.current)},te=new L,We=class{constructor(r,t){this.id=te.rnd(),this.uid=te.rnd(),this.group=r,this.affirmations=[]}},Qe=new L,Xe=()=>{const r=S(),[t,i]=c.exports.useState(P()),[n,o]=c.exports.useState(t[0].currentGroup),[s,d]=c.exports.useState(F(t)),[f,x]=c.exports.useState(B(t,n)),[N,h]=c.exports.useState(!1),[m,p]=c.exports.useState(!1),[D,I]=c.exports.useState(!1),[G,g]=c.exports.useState(""),y="+ Create new group",j=()=>{const u=B(t,n);x(u),t[0].currentGroup=n,_(t)},k=()=>{d(F(t))},me=()=>{let u=t[0].groups;const b=O(t,n);u=u.slice(0,Number(b)).concat(u.slice(Number(b)+1)),t[0].groups=u,w.success(`Group '${n}' deleted!`,{position:"bottom-center"}),o(t[0].groups[0].group),_(t),r("/current"),console.log("this is after the 'navigate' that is being skipped")};c.exports.useEffect(()=>{j(),k()},[n]);const pe=()=>{const u=document.getElementById("name").value;if(s.includes(u))alert("You already have a group with this name. Please name your group anything else to continue creating it.");else if(!u)alert("You have not entered any text. Please name your group to continue creating it.");else{const b=t[0].groups.length+1,E=new We(u,b);t[0].groups.push({id:Qe.rnd(),group:E.group,affirmations:E.affirmations}),_(t),h(!1),o(u),w.success(`Group '${u}' added!`,{position:"bottom-center"})}},W=()=>{const u=O(t,n),b="/affirmations-vite/shared?query=",he=[t[0].groups[u]].flat(),ge=JSON.stringify(he);g(`${BASE_URL}${b}${ge}`),I(!0)};return a(v,{children:[a("div",{className:"search-params",children:[a(T,{style:{width:"100%",maxWidth:"500px",textAlign:"left"},select:!0,id:"outlined-select-currency",label:"Please select or create new group",value:n,onChange:u=>{let b=u.target.value;b==y?h(!0):o(b)},children:[t[0].groups.map(u=>e(X,{id:u.id,style:{fontFamily:"Poppins"},value:u.group,children:u.group},u.id)),e(X,{style:{fontFamily:"Poppins"},value:y,children:y})]}),e("ul",{className:"list-group cards pb-3",children:e(ne.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{ease:"easeInOut",duration:.5,delay:.125},children:e(Ve,{currentGroup:n,affirmationsData:t,affirmations:f})})}),a("div",{className:"d-flex justify-content-between pt-2 pb-2",style:{maxWidth:"500px",margin:"auto"},children:[e("div",{style:{visibility:"hidden"},children:e(l,{"aria-label":"layout spacer"})}),!f.length==0?e(l,{text:"Share Group","aria-label":"share group",run:()=>W()}):e("div",{style:{visibility:"hidden"},children:e(l,{text:"Share Group","aria-label":"share group",run:()=>W()})}),e(Se,{disableRipple:!0,disableFocusRipple:!0,size:"small","aria-label":"delete",className:"btnGroupDelete",onClick:()=>p(!0),children:e(de,{fontSize:"medium"})})]})]}),N?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Creating new group?"}),a("div",{className:"buttons",children:[e("form",{children:e(T,{required:!0,autoFocus:!0,className:"w-100 mb-2 mt-1",type:"text",id:"name",label:"Group name",variant:"outlined",name:"name",minLength:"1",maxLength:"100",size:"20"})}),a("div",{className:"d-flex justify-content-center",children:[e(l,{text:"Cancel",run:()=>h(!1)}),e(l,{text:"Create Group",run:()=>pe()})]})]})]})}):null,m?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Delete this group?"}),e("p",{children:n}),a("div",{className:"buttons",children:[e(l,{text:"Abort!",run:()=>p(!1)}),e(l,{text:"Confirm",run:()=>me()})]})]})}):null,D?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Share this group?"}),e("p",{children:n}),e("label",{style:{display:"flex",flexDirection:"column",padding:"8px"},children:e("textarea",{style:{height:"200px",fontSize:"10px"},type:"text",readOnly:!0,value:G})}),a("div",{className:"buttons",children:[e(l,{text:"Close",run:()=>I(!1)}),e(l,{text:"Copy to clipboard",run:()=>{navigator.clipboard.writeText(G),w.success(`Sharable '${n}' URL copied to clipboard!`,{position:"bottom-center"})}})]})]})}):null]})},Ze=()=>e(v,{children:e(ne.div,{initial:{opacity:0},animate:{opacity:1},transition:{ease:"easeOut",duration:.5},children:a("section",{className:"traditional__layout",children:[e("h1",{className:"pb-3",children:"Saved Affirmations"}),e(Xe,{})]})})});const et=()=>{const r=S(),t=ie(),[i,n]=c.exports.useState(!1),[o,s]=c.exports.useState(!1),[d,f]=c.exports.useState(P()),[x,N]=c.exports.useState(d[0].currentGroup);let h=O(d,x),m=t.state.affirmationId,p=d[0].groups[h].affirmations[m].affirmation;const D=()=>{let g=d[0].groups[h].affirmations,y=g.slice(0,Number(m)).concat(g.slice(Number(m)+1));d[0].groups[h].affirmations=y,w.success(`Affirmation '${p}' deleted!`,{position:"bottom-center"}),_(d),r("/current")};function I(){const g=document.getElementById("affirmationText").value;g?g==p?(w.info("No changes were made \u{1F9D0} Try again?",{position:"bottom-center"}),r("/current")):(d[0].groups[h].affirmations[m].affirmation=g,_(d),w.success(`Update to '${g}', success!`,{position:"bottom-center"}),r("/current")):n(!0)}function G(){r("/current")}return a(v,{children:[a("section",{className:"traditional__layout addAffirmation",children:[e("h1",{className:"pb-2",children:"Edit Affirmation"}),e("div",{className:"pb-2",children:e("p",{children:"Edit your affirmation below"})}),e("form",{className:"align-items-center pb-3",children:e("textarea",{className:"",id:"affirmationText",defaultValue:p})}),a("div",{className:"flex",children:[e(l,{text:"Cancel",run:()=>G()}),e(l,{text:"Update Affirmation",run:()=>I()}),e(l,{text:"Delete Affirmation",run:()=>s(!0)})]})]}),i?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Affirmation text is empty"}),e("p",{children:"Please add text and try again"}),e("div",{className:"buttons",children:e(l,{text:"Understood",run:()=>n(!1)})})]})}):null,o?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Delete this affirmation"}),e("p",{children:"Are you sure?"}),a("div",{className:"buttons",children:[e(l,{text:"Abort",run:()=>s(!1)}),e(l,{text:"Delete",run:()=>{D(),s(!1)}})]})]})}):null]})};new L;const tt=class{constructor(r,t){this.affirmation=r,this.id=t}},rt=()=>{const r=S(),t=ie(),i=new L,[n,o]=c.exports.useState(!1);let s=t.state.affirmationsData,d=t.state.currentGroup,f=O(s,d);const x=()=>{const h=document.getElementById("affirmationText").value;if(!h)o(!0);else{const m=i.rnd(),p=new tt(h,m);s[0].groups[f].affirmations.unshift({id:p.id,affirmation:p.affirmation}),_(s),w.success(`Affirmation '${p.affirmation}' added!`,{position:"bottom-center"}),r("/current")}},N=()=>{r("/current")};return a(v,{children:[a("section",{className:"traditional__layout addAffirmation",children:[e("h1",{className:"font-bold pb-2",children:"Add Affirmation"}),e("div",{className:"pb-2",children:e("p",{children:"Enter your affirmation below"})}),e("form",{className:"align-items-center pb-3",children:e("textarea",{autoFocus:!0,className:"",id:"affirmationText",placeholder:"Type/paste your affirmation here"})}),a("div",{className:"flex",children:[e(l,{text:"Cancel",run:()=>N()}),e(l,{text:"Add Affirmation",run:()=>x()})]})]}),n?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Affirmation text is empty"}),e("p",{children:"Please add text and try again"}),e("div",{className:"buttons",children:e(l,{text:"Understood",run:()=>o(!1)})})]})}):null]})},at="/affirmations-vite/assets/Af-logo.08741b66.svg",it=()=>e(v,{children:a("section",{className:"traditional__layout addAffirmation",children:[e("div",{children:e("img",{src:at,alt:"Affirmations app SVG logo"})}),e("h1",{className:"font-bold text-purple-600 pb-2 pt-2",children:"About this application"}),a("div",{className:"about",children:[e("p",{className:"pb-3",children:"This application gives you an editable slideshow of affirmations for your inspirational viewing pleasure. Keep yourself inspired!"}),e("h2",{children:"What can I do?"}),a("p",{className:"pb-3",children:["Feel free to ",e("i",{children:"add"})," your own affirmations, ",e("i",{children:"edit"})," existing ones, ",e("i",{children:"erase"})," them all to start from scratch, and ",e("i",{children:"load"})," ","in the default affirmations that you started with."]}),e("h2",{children:"Noteable tidbit"}),e("p",{className:"pb-3",children:"This app uses localStorage to save your affirmations. If that means nothing to you here is what you need to know. Your affirmations are stored in your web browser (as opposed to a database) so if you keep using this device and this browser you will always see your affirmations. This means you will only have access to your personal affirmations specifically on this device and broswer."})]})]})}),nt=({affirmation:r,id:t,currentGroup:i,affirmationsData:n})=>(S(),e("li",{style:{listStyleType:"none"},id:t,className:"list-group-flush splide__slide__EDIT",children:e("div",{className:"card",children:e("div",{className:"card-body d-flex flex-row",children:e("p",{className:"theme-switcher text-center",style:{paddingRight:"unset"},children:r})})})},t)),ot=({sharedAffirmations:r})=>{const[t,i]=c.exports.useState(JSON.parse(r)[0].affirmations),[n,o]=c.exports.useState(JSON.parse(r)[0].group);return a(v,{children:[e("div",{className:"pt-3",children:a("p",{children:["List of ",e("i",{children:n})," affirmations"]})}),e("div",{className:"d-grid gap-2 p-3 pt-1",children:t.length?t.map(({affirmation:s,id:d},f)=>e(nt,{affirmation:s,id:f},d)):e("h1",{children:"No Affirmations present"})})]})},st=new L,lt=r=>{const t=S(),[i,n]=c.exports.useState(!1),[o,s]=c.exports.useState(!1),d=new URLSearchParams(window.location.search),[f,x]=c.exports.useState(P()),[N,h]=c.exports.useState(d.get("query")),m=JSON.parse(N)[0].group,[p,D]=c.exports.useState(F(f)),I=()=>{p.includes(m)?s(!0):n(!0)},G=()=>{t("/about")},g=()=>{const y=document.getElementById("name").value;if(p.includes(y))alert("You already have a group with this name. Please name your group anything else to continue creating it.");else if(!y)alert("You have not entered any text. Please name your group to continue creating it.");else{const j=f[0].groups.length;let k=JSON.parse(N);k[0].group=y,f[0].groups.push(k[0]),f[0].groups[j].id=st.rnd(),_(f),t("/"),w.success(`Group '${y}' added. Enjoy!`,{position:"bottom-center"})}};return a(v,{children:[a("section",{className:"traditional__layout",children:[e("h1",{className:"pb-2",children:"Incoming Affirmations"}),a("div",{className:"d-flex flex-column justify-content-center",children:[a("p",{className:"mb-3",style:{width:"385px",margin:"0 auto"},children:["Someone has sent you a list of affirmations titled"," ",e("i",{children:m}),"."]}),e("div",{className:"flex",children:e(l,{text:"Accept & view",run:()=>I()})})]}),e(ot,{sharedAffirmations:N}),e("div",{className:"flex",children:e(l,{text:"About this site",run:()=>G()})})]}),o?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Rename new group"}),a("p",{children:["You already have a group named ",e("i",{children:m}),"."]}),a("div",{className:"buttons",children:[e("form",{children:e(T,{required:!0,autoFocus:!0,className:"w-100 mb-2 mt-1",type:"text",id:"name",label:"Rename group to continue",variant:"outlined",name:"name",minLength:"1",maxLength:"100",size:"20"})}),e(l,{text:"Cancel",run:()=>s(!1)}),e(l,{text:"Rename",run:()=>{g(),s(!1)}})]})]})}):null,i?e(A,{children:a("div",{className:"modal-container",children:[e("h2",{children:"Import this group?"}),e("p",{children:m}),a("div",{className:"buttons",children:[e(l,{text:"Abort!",run:()=>n(!1)}),e(l,{text:"Confirm",run:()=>{g(),n(!1)}})]})]})}):null]})};const ct=()=>{const[r,t]=c.exports.useState(!1);c.exports.useState(!1);const i="/affirmations-vite/",n=()=>{t(o=>!o)};return e(v,{children:a(ye,{children:[a("nav",{className:"theme-switcher btm-gradient",children:[e("div",{id:"appName",className:"theme-switcher",children:"Affirmations"}),e("button",{id:"hamburger",className:r?"opened":"",onClick:n,"aria-label":"Main Menu",children:a("svg",{width:"40",height:"40",viewBox:"0 0 100 100",children:[e("path",{className:"theme-switcher line line1",d:"M 20,29.000046 H 80.000231 C 80.000231,29.000046 94.498839,28.817352 94.532987,66.711331 94.543142,77.980673 90.966081,81.670246 85.259173,81.668997 79.552261,81.667751 75.000211,74.999942 75.000211,74.999942 L 25.000021,25.000058"}),e("path",{className:"theme-switcher line line2",d:"M 20,50 H 80"}),e("path",{className:"theme-switcher line line3",d:"M 20,70.999954 H 80.000231 C 80.000231,70.999954 94.498839,71.182648 94.532987,33.288669 94.543142,22.019327 90.966081,18.329754 85.259173,18.331003 79.552261,18.332249 75.000211,25.000058 75.000211,25.000058 L 25.000021,74.999942"})]})}),a("ul",{id:"menu",className:r?"opened":"",children:[e("li",{children:e(q,{to:`${i}`,onClick:n,className:"theme-switcher",children:e(se,{fontSize:"large"})})}),e("li",{children:e(q,{to:`${i}current`,onClick:n,className:"theme-switcher",children:e(le,{fontSize:"large"})})}),e("li",{children:e(q,{to:`${i}about`,onClick:n,children:e(ce,{fontSize:"large"})})})]})]}),e("main",{children:a(be,{children:[e(M,{path:`${i}`,element:e(je,{})}),e(M,{path:`${i}current`,element:e(Ze,{})}),e(M,{path:`${i}add`,element:e(rt,{})}),e(M,{path:`${i}edit`,element:e(et,{})}),e(M,{path:`${i}shared`,element:e(lt,{})}),e(M,{path:`${i}about`,element:e(it,{})}),e(M,{path:"*",element:e("p",{children:"Path not resolved"})})]})}),e(xe,{})]})})},dt=document.getElementById("root"),ut=oe(dt);ut.render(e(ct,{})); diff --git a/index.html b/index.html index 14b090f..acb6bb1 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ + Affirmations - +