PageSourceSearch

https://irmawrites.com/assets/home--2aNeQGP.js

js irmawrites.com collected 2026-10-07 17:42:18 UTC 61,228 bytes, 21 lines download raw bytes

1import{r as S,l as i,n as Z}from"./jsx-runtime-QevHBTpY.js";const ee="root",te=r=>r.find(t=>t?.id===ee)?.loaderData?.origin??"",D=(r,e)=>/^https?:\/\//.test(e)?e:`${r}${e.startsWith("/")?e:`/${e}`}`;function se({matches:r,location:e},t){const s=te(r),n=D(s,t.path??e.pathname),o=t.image?D(s,t.image):"",a=[{title:t.title},{name:"description",content:t.description},{property:"og:title",content:t.title},{property:"og:description",content:t.description},{property:"og:type",content:t.type??"website"},{name:"twitter:card",content:o?"summary_large_image":"summary"},{name:"twitter:title",content:t.title},{name:"twitter:description",content:t.description}];s&&a.push({tagName:"link",rel:"canonical",href:n},{property:"og:url",content:n}),o&&a.push({property:"og:image",content:o},{name:"twitter:image",content:o}),t.noindex&&a.push({name:"robots",content:"noindex"});for(const c of[t.jsonLd??[]].flat())a.push({"script:ld+json":c});return a}const ie=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=(...r)=>r.filter((e,t,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===t).join(" ").trim();var ne={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const re=S.forwardRef(({color:r="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:s,className:n="",children:o,iconNode:a,...c},l)=>S.createElement("svg",{ref:l,...ne,width:e,height:e,stroke:r,strokeWidth:s?Number(t)*24/Number(e):t,className:_("lucide",n),...c},[...a.map(([h,v])=>S.createElement(h,v)),...Array.isArray(o)?o:[o]]));const g=(r,e)=>{const t=S.forwardRef(({className:s,...n},o)=>S.createElement(re,{ref:o,iconNode:e,className:_(`lucide-${ie(r)}`,s),...n}));return t.displayName=`${r}`,t};const R=g("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const k=g("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);const oe=g("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const H=g("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);const ae=g("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);const ce=g("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const le=g("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const A=g("Leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);const he=g("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);const de=g("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);const G=g("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);const ue=g("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const pe=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
1],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function me(){const[r,e]=S.useState(!1);return i.jsxs("header",{className:"site-header",children:[i.jsxs("a",{className:"brand",href:"#",children:[i.jsx(A,{size:30,strokeWidth:1.5}),i.jsxs("span",{children:["Irma L. Hersel",i.jsx("small",{children:"CHILDREN’S AUTHOR & STORYTELLER"})]})]}),i.jsx("button",{className:"menu-toggle","aria-label":r?"Close navigation":"Open navigation","aria-expanded":r,onClick:()=>e(!r),children:r?i.jsx(pe,{}):i.jsx(he,{})}),i.jsxs("nav",{className:r?"open":"","aria-label":"Main navigation",children:[[["Books","books"],["About Irma","about"],["Awards & Press","awards"],["Author Visits","visits"],["Resources","resources"]].map(([t,s])=>i.jsx("a",{href:`#${s}`,onClick:()=>e(!1),children:t},s)),i.jsxs("a",{href:"#contact",className:"header-contact",onClick:()=>e(!1),children:["Let’s connect ",i.jsx(k,{size:15})]})]})]})}function ge(){return i.jsxs("footer",{className:"site-footer",children:[i.jsxs("div",{children:[i.jsxs("a",{className:"brand",href:"#",children:[i.jsx(A,{size:26,strokeWidth:1.5}),i.jsxs("span",{children:["Irma L. Hersel",i.jsx("small",{children:"STORIES ROOTED IN WONDER."})]})]}),i.jsxs("p",{children:["© ",new Date().getUTCFullYear()," Irma L. Hersel. All rights reserved."]})]}),i.jsxs("nav",{"aria-label":"Footer navigation",children:[i.jsx("a",{href:"#books",children:"Books"}),i.jsx("a",{href:"#resources",children:"Teacher resources"}),i.jsx("a",{href:"#contact",children:"Contact"}),i.jsx("a",{href:"#","aria-label":"Back to top",children:i.jsx(oe,{size:19})})]})]})}const K=[{title:"Where Chocolate Grows",subtitle:"A Sweet Journey of Curiosity and Discovery",category:"THE AWARD-WINNING STORY",image:"https://m.media-amazon.com/images/I/61lVOp0GyCL._SL1250_.jpg",description:"Follow a sweet trail of discovery, from the cacao tree to a familiar favorite. A story that brings curiosity, culture, and family together.",link:"https://www.amazon.com/Where-Chocolate-Grows-Curiosity-Discovery/dp/B0G1GS7MW9",color:"cacao",retailers:[{name:"Amazon",url:"https://www.amazon.com/Where-Chocolate-Grows-Curiosity-Discovery/dp/B0G1GS7MW9"},{name:"Target",url:"https://www.target.com/p/where-chocolate-grows-by-irma-l-hersel-paperback/-/A-1009800177"},{name:"Walmart",url:"https://www.walmart.com/ip/Where-Chocolate-Grows-A-Sweet-Journey-of-Curiosity-and-Discovery-Paperback-9798218798260/18631457029"},{name:"Books-A-Million",url:"https://www.booksamillion.com/p/Chocolate-Grows/Irma-L-Hersel/9798218798260"}]},{title:"Where Nopalitos Grow",subtitle:"A little curiosity. A world of discovery.",category:"CULTURE & FAMILY",image:"https://m.media-amazon.com/images/I/61L1wMgw7+L._SL1250_.jpg",description:"Explore nopalitos, family traditions, and the joy of learning about the things that grow around us. An invitation to look a little closer.",link:"https://www.amazon.com/Where-Nopalitos-Grow-Cactus/dp/B0CMZH31GN",color:"nopal",retailers:[{name:"Amazon",url:"https://www.amazon.com/Where-Nopalitos-Grow-Cactus/dp/B0CMZH31GN"},{name:"Walmart",url:"https://www.walmart.com/ip/Where-Nopalitos-Grow-Paperback-9798218315818/5152635380"},{name:"Books-A-Million",url:"https://www.booksamillion.com/p/Nopalitos-Grow/Irma-L-Hersel/9798218315818"},{name:"Barnes & Noble",url:"https://www.barnesandnoble.com/search?q=irma%20hersel"}]},{title:"Pretend Chocolate Shop - Where Chocolate Grows Activity Book",subtitle:"",category:"PRETEND CHOCOLATE SHOP",coverTitle:"Where Chocolate Grows",coverSubtitle:"Activity Book",image:"https://m.media-amazon.com/images/I/71ZBtMF6k8L._SL1250_.jpg",description:"Keep the discovery going with a pretend chocolate shop! Bring bilingual learning and hands-on exploration into imaginative play.",link:"https://www.amazon.com/dp/B0H9HGX46F",color:"shop",retailers:[{name:"Amazon",url:"https://www.amazon.com/dp/B0H9HGX46F"},{name:"ThriftBooks",url:"https://www.thriftbooks.com/w/where-chocolate-grows-pretend-chocolate-shop-activity-book-a-screen-free-bilingual-spanish-english-pretend-play-workbook-with-cut-and-paste--play-money-menus-and-creative-learning-fun_irma-l-hersel/59926893/"},{name:"Barnes & Noble",url:"https://www.barnesandnoble.com/search?q=irma%20hersel"}]}];function be(){return i.jsxs("section",{className:"hero",children:[i.jsx("div",{className:"hero-art"}),i.jsxs("div",{className:"hero-content",children:[i.jsxs("p",{className:"eyebrow",children:[i.jsx(A,{size:16})," LITTLE QUESTIONS. BIG DISCOVERIES."]}),i.jsxs("h1",{children:["Every story plants",i.jsx("br",{}),"a seed of ",i.jsx("em",{children:"curiosity."})]}),i.jsxs("p",{className:"hero-intro",children:["Meet Irma L. Hersel, award-winning children’s author.",i.jsx("br",{className:"desktop-break"})," Discover stories rooted in family, culture, and the",i.jsx("br",{className:"desktop-break"})," wonderful world around us."]}),i.jsxs("div",{className:"actions",children:[i.jsxs("a",{className:"button",href:"#books",children:["Explore the books ",i.jsx(R,{size:17})]}),i.jsxs("a",{className:"text-link",href:"#about",children:["Meet Irma ",i.jsx(R,{size:16})]})]}),i.jsxs("div",{className:"hero-note",children:[i.jsx("span",{className:"tiny-leaf",children:"✦"})," For curious kids. And the grown-ups who help them grow."]})]}),i.jsx("div",{className:"hero-books","aria-label":"Discover Irma’s three books",children:K.map((r,e)=>i.jsxs("a",{className:`hero-book hero-book-${e}`,href:"#books",children:[i.jsx("img",{src:r.image,alt:""}),i.jsxs("span",{children:[r.title,i.jsx("small",{children:e===2?"Pretend Chocolate Shop Activity Book":r.subtitle})]}),i.jsx("b",{children:"IRMA L. HERSEL"})]},r.subtitle))}),i.jsxs("div",{className:"award-seal",children:[i.jsx(H,{size:31}),i.jsxs("span",{children:["PURPLE DRAGONFLY",i.jsx("br",{}),"BOOK AWARDS"]}),i.jsx("strong",{children:"First Place"}),i.jsx("small",{children:"Cultural Diversity"})]}),i.jsxs("div",{className:"hero-bottom",children:[i.jsx("span",{children:"ROOTED IN CULTURE"}),i.jsx("span",{children:"INSPIRED BY NATURE"}),i.jsx("span",{children:"MADE FOR DISCOVERY"})]})]})}function fe(){return i.jsxs("section",{id:"books",className:"books-section section",children:[i.jsxs("div",{className:"section-heading",children:[i.jsxs("div",{children:[i.jsx("p",{className:"eyebrow",children:"01 / STORIES TO GROW WITH"}),i.jsx("h2",{children:"A little wonder on every page."})]}),i.jsxs("p",{children:["From cacao trees to cactus gardens,",i.jsx("br",{}
1),"there’s a whole world waiting to be discovered."]})]}),i.jsx("div",{className:"book-grid",children:K.map((r,e)=>i.jsxs("article",{className:"book-item",children:[i.jsxs("a",{href:r.link,target:"_blank",rel:"noopener noreferrer",className:`book-stage ${r.color}`,"aria-label":`Find ${r.title} ${r.subtitle} on Amazon`,children:[i.jsxs("div",{className:"book-cover",children:[i.jsx("img",{src:r.image,alt:`Story-inspired illustration for ${r.title}`,loading:"lazy"}),i.jsxs("div",{className:"cover-title",children:[i.jsx("span",{children:r.coverTitle??r.title}),r.coverSubtitle?i.jsx("small",{children:r.coverSubtitle}):null]}),i.jsx("span",{className:"cover-author",children:"IRMA L. HERSEL"})]}),e===0&&i.jsxs("span",{className:"book-award",children:[i.jsx(H,{size:15})," FIRST PLACE WINNER"]})]}),i.jsx("p",{className:"book-category",children:r.category}),i.jsx("h3",{children:r.title}),r.subtitle?i.jsx("p",{className:"book-subtitle",children:r.subtitle}):null,i.jsx("p",{className:"book-description",children:r.description}),i.jsxs("div",{className:"retailer-row",children:[i.jsxs("span",{className:"retailer-label",children:[i.jsx(de,{size:13})," Available at"]}),i.jsx("div",{className:"retailer-links",children:r.retailers.map(t=>i.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"retailer-link",children:[t.name,i.jsx(k,{size:12})]},t.url))})]})]},r.subtitle))}),i.jsx("p",{className:"art-note",children:"Story-inspired illustrations shown. Visit the retailer for official covers, editions, and current pricing. Purchases are completed on the retailer’s site."})]})}function ye(){return i.jsxs("section",{className:"about-section",id:"about",children:[i.jsxs("div",{className:"about-art",children:[i.jsx("span",{className:"large-index",children:"02"}),i.jsx(G,{size:150,strokeWidth:.7}),i.jsxs("blockquote",{children:["“A world of wonder",i.jsx("br",{}),"starts with a",i.jsx("br",{}),i.jsx("em",{children:"little curiosity."}),"”"]}),i.jsx("small",{children:"THE SPIRIT OF IRMA’S STORIES"})]}),i.jsxs("div",{className:"about-copy",children:[i.jsx("p",{className:"eyebrow",children:"MEET THE AUTHOR"}),i.jsxs("figure",{className:"author-portrait",children:[i.jsx("img",{src:"https://horizons-cdn.hostinger.com/671d655b-dd5d-4e62-ad9d-57c112ab841e/fdc95c2bbdb1218dc1ab9473709f57cb.jpg",alt:"Irma L. Hersel"}),i.jsxs("figcaption",{children:[i.jsx("strong",{children:"Irma L. Hersel"}),i.jsx("span",{children:"Children’s author"})]})]}),i.jsxs("h2",{children:["Stories with roots.",i.jsx("br",{}),"Discovery with heart."]}),i.jsx("p",{children:"Her stories are written in English with Spanish words woven throughout, alongside a simple glossary that welcomes a wide range of readers while supporting language development and cultural connection."}),i.jsx("p",{children:"Inspired by childhood visits to Mexico and memories shared with her late cousin, Irma’s work reflects the importance of family, identity, and curiosity."}),i.jsx("p",{children:"A first-generation Mexican American raised in Holland, Michigan, Irma holds a Bachelor of Fine Arts from Kendall College of Art & Design at Ferris State University and an MBA from California Lutheran University. She brings a distinctive perspective shaped by creativity, culture, and education."}),i.jsx("p",{children:"Her books are often used in classrooms, dual language programs, and family learning environments to spark curiosity, build confidence, and help children better understand the world around them."}),i.jsx("p",{children:"Irma lives in Camarillo, California, with her husband and their cats, Stripey & Blue."}),i.jsxs("a",{className:"text-link",href:"#contact",children:["Say hello to Irma ",i.jsx(R,{size:16})]})]})]})}function we(){return i.jsxs("section",{className:"section awards-section",id:"awards",children:[i.jsx("p",{className:"eyebrow",children:"03 / AWARDS & PRESS"}),i.jsxs("div",{className:"award-feature",children:[i.jsx("div",{className:"award-icon",children:i.jsx("img",{src:"https://images.squarespace-cdn.com/content/v1/61a90c7007a0f72206136a3c/ccb2d1f8-5ed1-44a1-b158-7226709a84fa/2026_Seal_Purple-Dragonfly_Book-Award-Contest-01.png",alt:"Purple Dragonfly Book Award seal"})}),i.jsxs("div",{children:[i.jsx("span",{className:"award-label",children:"A STORY WORTH CELEBRATING"}),i.jsx("h2",{children:"First Place. A world of possibilities."}),i.jsxs("p",{children:[i.jsx("em",{children:"Where Chocolate Grows"})," received ",i.jsx("strong",{children:"First Place in Cultural Diversity"})," in the Purple Dragonfly Book Awards—a celebration of stories that bring us closer."]}
1)]})]}),i.jsxs("div",{className:"press-row",children:[i.jsx("span",{children:"IN THE PRESS"}),i.jsxs("a",{href:"https://www.altoonamirror.com/life/area-life/2026/01/where-chocolate-grows-written-for-young-readers/",target:"_blank",rel:"noopener noreferrer",children:["Altoona Mirror ",i.jsx(k,{size:16})]}),i.jsxs("a",{href:"https://www.noozhawk.com/ventura-childrens-author-releases-bilingual-chocolate-shop-activity-book/",target:"_blank",rel:"noopener noreferrer",children:["Noozhawk ",i.jsx(k,{size:16})]}),i.jsxs("a",{href:"#contact",children:["Press & interview inquiries ",i.jsx(k,{size:16})]})]})]})}const je=[{src:"https://horizons-cdn.hostinger.com/671d655b-dd5d-4e62-ad9d-57c112ab841e/305f4dbcc8ea6647eb59670ea924d3d2.jpg",alt:"Irma L. Hersel at Camarillo Public Library, holding Where Chocolate Grows beside a guest"},{src:"https://horizons-cdn.hostinger.com/671d655b-dd5d-4e62-ad9d-57c112ab841e/35283f17c41f0639883fa3bde01feba6.jpg",alt:"Irma L. Hersel presenting at Camarillo Public Library during an author visit"}];function xe(){return i.jsxs("section",{className:"visits-section section",id:"visits",children:[i.jsxs("div",{children:[i.jsx("p",{className:"eyebrow",children:"04 / AUTHOR VISITS & EVENTS"}),i.jsxs("h2",{children:["Bring a little wonder",i.jsx("br",{}),"to your community."]}),i.jsx("p",{children:"Planning a school visit, library storytime, or family literacy event? Start a conversation with Irma about bringing her stories to your young readers."}),i.jsxs("a",{href:"#contact",className:"button",children:["Inquire about an author visit ",i.jsx(R,{size:16})]}),i.jsx("small",{className:"visit-note",children:"Contact Irma for availability and event details."})]}),i.jsxs("div",{className:"visit-list",children:[i.jsxs("div",{children:[i.jsx(ae,{}),i.jsxs("span",{children:[i.jsx("h3",{children:"Schools & classrooms"}),i.jsx("p",{children:"Make room for curiosity, culture, and conversation."})]})]}),i.jsxs("div",{children:[i.jsx(ue,{}),i.jsxs("span",{children:[i.jsx("h3",{children:"Libraries & families"}),i.jsx("p",{children:"Gather around stories that connect generations."})]})]}),i.jsxs("div",{children:[i.jsx(G,{}),i.jsxs("span",{children:[i.jsx("h3",{children:"Learning through discovery"}),i.jsx("p",{children:"Explore the world beyond the pages of a book."})]})]})]}),i.jsxs("figure",{className:"visit-gallery",children:[i.jsx("figcaption",{children:"Library visits · Camarillo Public Library"}),je.map(r=>i.jsx("img",{src:r.src,alt:r.alt},r.src))]})]})}function Se(){function r(){const e=`CURIOSITY STARTERS
2A companion conversation sheet for families and educators
3
4BEFORE READING
5What do you think chocolate is made from?
6What foods does your family grow or prepare together?
7
8AFTER READING
9What surprised you?
10What would you like to learn more about?
11Draw a plant you discovered and label its parts.
12
13EXPLORE TOGETHER
14Choose a food and investigate where it comes from.
15Learn its name in another language.
16Imagine a shop: draw a sign, create a menu, and take turns welcoming customers.
17
18Adult guidance: supervise food and plant activities and check allergies.
19
20Website-created discussion prompts, not an official publisher teaching guide.
21`,t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=utf-8"})),s=document.createElement("a");s.href=t,s.download="curiosity-starters.txt",s.click(),URL.revokeObjectURL(t)}return i.jsxs("section",{id:"resources",className:"section resources-section",children:[i.jsxs("div",{className:"section-heading",children:[i.jsxs("div",{children:[i.jsx("p",{className:"eyebrow",children:"05 / TEACHER RESOURCES"}),i.jsx("h2",{children:"Let the learning keep growing."})]}),i.jsxs("p",{children:["A story is just the beginning.",i.jsx("br",{}),"Take curiosity into the classroom—and home."]})]}),i.jsxs("div",{className:"resource-row",children:[i.jsx("span",{className:"resource-number",children:"01"}),i.jsxs("div",{children:[i.jsx("h3",{children:"Curiosity starters"}),i.jsx("p",{children:"Simple before-and-after reading prompts for shared discovery."}),i.jsx("small",{children:"FREE DOWNLOAD · TEXT FORMAT"})]}),i.jsxs("button",{className:"outline-button",onClick:r,children:["Download prompts ",i.jsx(le,{size:16})]})]}),i.jsxs("div",{className:"resource-row",children:[i.jsx("span",{className:"resource-number",children:"02"}),i.jsxs("div",{children:[i.jsx("h3",{children:"Play, imagine, discover"}),i.jsx("p",{children:"Explore bilingual, hands-on play with the Pretend Chocolate Shop Activity Book."}
21),i.jsx("small",{children:"ACTIVITY BOOK · EXTERNAL RETAILER"})]}),i.jsxs("a",{className:"text-link",href:"https://www.amazon.com/s?k=Irma+Hersel+Pretend+Chocolate+Shop+Activity+Book",target:"_blank",rel:"noopener noreferrer",children:["Explore the activity book ",i.jsx(k,{size:16})]})]})]})}class d extends Error{constructor(e){super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,d.prototype),e!==null&&typeof e=="object"&&(this.originalError=e.originalError,this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort||e.name==="AbortError"||e.message==="Aborted",e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof d||(this.originalError=e),this.name="ClientResponseError "+this.status,this.message=this.response?.message,this.message||(this.isAbort?this.message="The request was aborted (most likely autocancelled; you can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation).":this.originalError?.cause?.message?.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong."),this.cause=this.originalError}get data(){return this.response}toJSON(){return{...this}}}const E=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function ve(r,e){const t={};if(typeof r!="string")return t;const s=Object.assign({},{}).decode||Ce;let n=0;for(;n<r.length;){const o=r.indexOf("=",n);if(o===-1)break;let a=r.indexOf(";",n);if(a===-1)a=r.length;else if(a<o){n=r.lastIndexOf(";",o-1)+1;continue}const c=r.slice(n,o).trim();if(t[c]===void 0){let l=r.slice(o+1,a).trim();l.charCodeAt(0)===34&&(l=l.slice(1,-1));try{t[c]=s(l)}catch{t[c]=l}}n=a+1}return t}function B(r,e,t){const s=Object.assign({},t||{}),n=s.encode||ke;if(!E.test(r))throw new TypeError("argument name is invalid");const o=n(e);if(o&&!E.test(o))throw new TypeError("argument val is invalid");let a=r+"="+o;if(s.maxAge!=null){const c=s.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");a+="; Max-Age="+Math.floor(c)}if(s.domain){if(!E.test(s.domain))throw new TypeError("option domain is invalid");a+="; Domain="+s.domain}if(s.path){if(!E.test(s.path))throw new TypeError("option path is invalid");a+="; Path="+s.path}if(s.expires){if(!(function(l){return Object.prototype.toString.call(l)==="[object Date]"||l instanceof Date})(s.expires)||isNaN(s.expires.valueOf()))throw new TypeError("option expires is invali
21d");a+="; Expires="+s.expires.toUTCString()}if(s.httpOnly&&(a+="; HttpOnly"),s.secure&&(a+="; Secure"),s.priority)switch(typeof s.priority=="string"?s.priority.toLowerCase():s.priority){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return a}function Ce(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function ke(r){return encodeURIComponent(r)}const Oe=typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal;let $;function O(r){if(r)try{const e=decodeURIComponent($(r.split(".")[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(e)||{}}catch{}return{}}function V(r,e=0){let t=O(r);return!(Object.keys(t).length>0&&(!t.exp||t.exp-e>Date.now()/1e3))}$=typeof atob!="function"||Oe?r=>{let e=String(r).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,s,n=0,o=0,a="";s=e.charAt(o++);~s&&(t=n%4?64*t+s:s,n++%4)?a+=String.fromCharCode(255&t>>(-2*n&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);return a}:atob;const F="pb_auth";class P{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!V(this.token)}get isSuperuser(){let e=O(this.token);return e.type=="auth"&&(this.record?.collectionName=="_superusers"||!this.record?.collectionName&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),O(this.token).type=="auth"&&!this.isSuperuser}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=F){const s=ve(e||"")[t]||"";let n={};try{n=JSON.parse(s),(typeof n===null||typeof n!="object"||Array.isArray(n))&&(n={})}catch{}this.save(n.token||"",n.record||n.model||null)}exportToCookie(e,t=F){const s={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},n=O(this.token);s.expires=n?.exp?new Date(1e3*n.exp):new Date("1970-01-01"),e=Object.assign({},s,e);const o={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let a=B(t,JSON.stringify(o),e);const c=typeof Blob<"u"?new Blob([a]).size:a.length;if(o.record&&c>4096){o.record={id:o.record?.id,email:o.record?.email};const l=["collectionId","collectionName","verified"];for(const h in this.record)l.includes(h)&&(o.record[h]=this.record[h]);a=B(t,JSON.stringify(o),e)}return a}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.record),()=>{for(let s=this._onChangeCallbacks.length-1;s>=0;s--)if(this._onChangeCallbacks[s]==e)return delete this._onChangeCallbacks[s],void this._onChangeCallbacks.splice(s,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.record)}}class Re extends P{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&window?.localStorage){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&window?.localStorage){let s=t;typeof t!="string"&&(s=JSON.stringify(t)),window.localStorage.setItem(e,s)}else this.storageFallback[e]=t}_storageRemove(e){typeof window<"u"&&window?.localStorage&&window.localStorage?.removeItem(e),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&window?.localStorage&&window.addEventListener&&window.addEventListener("storage",(e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)}))}}class f{constructor(e){this.client=e}}class Ee extends f{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then((()=>!0))}async testEmail(e,t,s,n){return n=Object.assign({method:"POST",body:{email:t,template:s,collection:e}},n),this.client.send("/api/settings/test/email",n).then((()=>!0))}async generateAppleClientSecret(e,t,s,n,o,a){return a=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:s,privateKey:n,duration:o}},a),this.client.send("/api/settings/apple/generate-client-secret",a)}}const Ae=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function L(r){if(r){r.query=r.query||{};for(let e in r)Ae.includes(e)||(r.query[e]=r[e],delete r[e])}}function q(r){const e=[];for(const t in r){const s=encodeURIComponent(t),n=Array.isArray(r[t])?r[t]:[r[t]];for(let o of n)o=Te(o),o!==null&&e.push(s+"="+o)}return e.join("&")}function Te(r){return r==null?null:r instanceof Date?encodeURIComponent(r.toISOString().replace("T"," ")):encodeURIComponent(typeof r=="object"?JSON.stringify(r):r)}class J extends f{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[],this.pendingSubmits=[],this.isProcessingPendingSubmits=!1}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}
vendor: 21,000 bytes, line 21
21async subscribe(e,t,s){if(!e)throw new Error("topic must be set.");let n=e;if(s){L(s=Object.assign({},s));const a="options="+encodeURIComponent(JSON.stringify({query:s.query,headers:s.headers}));n+=(n.includes("?")?"&":"?")+a}const o=function(a){const c=a;let l;try{l=JSON.parse(c?.data)}catch{}t(l||{})};return this.subscriptions[n]||(this.subscriptions[n]=[]),this.subscriptions[n].push(o),this.isConnected?this.subscriptions[n].length===1?await this.submitSubscriptions():this.eventSource?.addEventListener(n,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,o)}async unsubscribe(e){if(e){const t=this.getSubscriptionsByTopic(e);for(let s in t)if(this.hasSubscriptionListeners(s)){for(let n of this.subscriptions[s])this.eventSource?.removeEventListener(s,n);delete this.subscriptions[s]}}else this.subscriptions={};await this.submitSubscriptions()}async unsubscribeByPrefix(e){let t=!1;for(let s in this.subscriptions)if((s+"?").startsWith(e)){t=!0;for(let n of this.subscriptions[s])this.eventSource?.removeEventListener(s,n);delete this.subscriptions[s]}t&&await this.submitSubscriptions()}async unsubscribeByTopicAndListener(e,t){const s=this.getSubscriptionsByTopic(e);for(let n in s){if(!Array.isArray(this.subscriptions[n])||!this.subscriptions[n].length)continue;let o=!1;for(let a=this.subscriptions[n].length-1;a>=0;a--)this.subscriptions[n][a]===t&&(o=!0,delete this.subscriptions[n][a],this.subscriptions[n].splice(a,1),this.eventSource?.removeEventListener(n,t));o&&(this.subscriptions[n].length||delete this.subscriptions[n])}await this.submitSubscriptions()}hasSubscriptionListeners(e){if(this.subscriptions=this.subscriptions||{},e)return!!this.subscriptions[e]?.length;for(let t in this.subscriptions)if(this.subscriptions[t]?.length)return!0;return!1}async submitSubscriptions(){return new Promise(((e,t)=>{this.pendingSubmits.push({resolve:e,reject:t}),this.pendingSubmits.length==1&&queueMicrotask((()=>this.finalizePendingSubscriptions()))}))}async finalizePendingSubscriptions(){if(this.isProcessingPendingSubmits||!this.pendingSubmits.length)return;const e=this.pendingSubmits.slice();this.pendingSubmits=[],this.isProcessingPendingSubmits=!0;try{await this.sendSubscriptions();for(let t of e)t.resolve()}catch(t){for(let s of e)t?s.reject(t):s.resolve()}finally{this.isProcessingPendingSubmits=!1,this.pendingSubmits.length>0&&await this.finalizePendingSubscriptions()}}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let s in this.subscriptions)(s+"?").startsWith(e)&&(t[s]=this.subscriptions[s]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}async sendSubscriptions(){if(this.clientId){if(!this.hasSubscriptionListeners())return this.disconnect();if(this.hasUnsentSubscriptions())return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch((e=>{if(!e?.isAbort)throw e}))}}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise(((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length==1&&queueMicrotask((()=>this.initConnect()))}))}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout((()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))}),this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",(e=>{const t=e;this.clientId=t?.lastEventId,this.lastSentSubscriptions=[],this.submitSubscriptions().then((async()=>{let s=3;for(;this.hasUnsentSubscriptions()&&s>0;)s--,await this.submitSubscriptions();for(let o of this.pendingConnects)o.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const n=this.getSubscriptionsByTopic("PB_CONNECT");for(let o in n)for(let a of n[o])a(e);this.hasUnsentSubscriptions()&&await this.submitSubscriptions()})).catch((s=>{this.clientId="",this.lastSentSubscriptions=[],this.connectErrorHandler(s)}))}))}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let s of this.pendingConnects)s.reject(new d(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout((()=>{this.initConnect()}),t)}disconnect(e=!1){if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),this.eventSource?.close(),this.eventSource=null,this.clientId="",this.lastSentSubscriptions=[],!e){this.reconnectAttempts=0;for(let t of this.pendingConnects)t.resolve();this.pendingConnects=[]}}}class Y extends f{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let s=1e3;return(t=Object.assign({},e,t)).batch&&(s=t.batch,delete t.batch),this._getFullList(s,t)}async getList(e=1,t=30,s){return(s=Object.assign({method:"GET"},s)).query=Object.assign({page:e,perPage:t},s.query),this.client.send(this.baseCrudPath,s).then((n=>(n.items=n.items?.map((o=>this.decode(o)))||[],n)))}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then((s=>{if(!s?.items?.length)throw new d({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return s.items[0]}))}async getOne(e,t){if(!e)throw new d({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then((s=>this.decode(s)))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then((s=>this.decode(s)))}async update(e,t,s){return s=Object.assign({method:"PATCH",body:t},s),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),s).then((n=>this.decode(n)))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then((()=>!0))}_getFullList(e=1e3,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let s=[],n=async o=>this.getList(o,e||1e3,t).then((a=>{const c=a.items;return s=s.concat(c),c.length==a.perPage?n(o+1):s}));return n(1)}}function x(r,e,t,s){const n=s!==void 0;return n||t!==void 0?n?(console.warn(r),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,s),e):Object.assign(e,t):e}function T(r){r._resetAutoRefresh?.()}class Ie extends Y{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(e,t,s){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,s)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const s=Object.assign({},e,t);return super.getFullList(s)}async getList(e=1,t=30,s){return super.getList(e,t,s)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,s){return super.update(e,t,s).then((n=>{if(this.client.authStore.record?.id===n?.id&&(this.client.authStore.record?.collectionId===this.collectionIdOrName||this.client.authStore.record?.collectionName===this.collectionIdOrName)){let o=Object.assign({},this.client.authStore.record.expand),a=Object.assign({},this.client.authStore.record,n);o&&(a.expand=Object.assign(o,n.expand)),this.client.authStore.save(this.client.authStore.token,a)}return n}))}async delete(e,t){return super.delete(e,t).then((s=>(!s||this.client.authStore.record?.id!==e||this.client.authStore.record?.collectionId!==this.collectionIdOrName&&this.client.authStore.record?.collectionName!==this.collectionIdOrName||this.client.authStore.clear(),s)))}authResponse(e){const t=this.decode(e?.record||{});return this.client.authStore.save(e?.token,t),Object.assign({},e,{token:e?.token||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e)}async authWithPassword(e,t,s){let n;s=Object.assign({method:"POST",body:{identity:e,password:t}},s),this.isSuperusers&&(n=s.autoRefreshThreshold,delete s.autoRefreshThreshold,s.autoRefresh||T(this.client));let o=await this.client.send(this.baseCollectionPath+"/auth-with-password",s);return o=this.authResponse(o),n&&this.isSuperusers&&(function(c,l,h,v){T(c);const y=c.beforeSend,w=c.authStore.record,j=c.authStore.onChange(((u,p)=>{(!u||p?.id!=w?.id||(p?.collectionId||w?.collectionId)&&p?.collectionId!=w?.collectionId)&&T(c)}));c._resetAutoRefresh=function(){j(),c.beforeSend=y,delete c._resetAutoRefresh},c.beforeSend=async(u,p)=>{const U=c.authStore.token;if(p.query?.autoRefresh)return y?y(u,p):{url:u,sendOptions:p};let m=c.authStore.isValid;if(m&&V(c.authStore.token,l))try{await h()}catch{m=!1}m||await v();const C=p.headers||{};for(let b in C)if(b.toLowerCase()=="authorization"&&U==C[b]&&c.authStore.token){C[b]=c.authStore.token;break}return p.headers=C,y?y(u,p):{url:u,sendOptions:p}}})(this.client,n,(()=>this.authRefresh({autoRefresh:!0})),(()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s)))),o}async authWithOAuth2Code(e,t,s,n,o,a,c){let l={method:"POST",body:{provider:e,code:t,codeVerifier:s,redirectURL:n,createData:o}};return l=x("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",l,a,c),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then((h=>this.authResponse(h)))}authWithOAuth2(...e){if(e.length>1||typeof e?.[0]=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code(e?.[0]||"",e?.[1]||"",e?.[2]||"",e?.[3]||"",e?.[4]||{},e?.[5]||{},e?.[6]||{});const t=e?.[0]||{};let s=null;t.urlCallback||(s=M(void 0));const n=new J(this.client);function o(){s?.close(),n.unsubscribe()}const a={},c=t.requestKey;return c&&(a.requestKey=c),this.listAuthMethods(a).then((l=>{const h=l.oauth2.providers.find((y=>y.name===t.provider));if(!h)throw new d(new Error(`Missing or invalid provider "${t.provider}".`));const v=this.client.buildURL("/api/oauth2-redirect");return new Promise((async(y,w)=>{const j=c?this.client.cancelControllers?.[c]:void 0;j&&(j.signal.onabort=()=>{o(),w(new d({isAbort:!0,message:"manually cancelled"}))}),n.onDisconnect=u=>{u.length&&w&&(o(),w(new d(new Error("realtime connection interrupted"))))};try{await n.subscribe("@oauth2",(async m=>{const C=n.clientId;try{if(!m.state||C!==m.state)throw new Error("State parameters don't match.");if(m.error||!m.code)throw new Error("OAuth2 redirect error or missing code: "+m.error);const b=Object.assign({},t);delete b.provider,delete b.scopes,delete b.createData,delete b.urlCallback,j?.signal?.onabort&&(j.signal.onabort=null);const X=await this.authWithOAuth2Code(h.name,m.code,h.codeVerifier,v,t.createData,b);y(X)}catch(b){w(new d(b))}o()}));const u={state:n.clientId};t.scopes?.length&&(u.scope=t.scopes.join(" "));const p=this._replaceQueryParams(h.authURL+v,u);await(t.urlCallback||function(m){s?s.location.href=m:s=M(m)})(p)}catch(u){j?.signal?.onabort&&(j.signal.onabort=null),o(),w(new d(u))}}))})).catch((l=>{throw o(),l}))}async authRefresh(e,t){let s={method:"POST"};return s=x("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",s,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",s).then((n=>this.authResponse(n)))}async requestPasswordReset(e,t,s){let n={method:"POST",body:{email:e}};return n=x("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",n,t,s),this.client.send(this.baseCollectionPath+"/request-password-reset",n).then((()=>!0))}async confirmPasswordReset(e,t,s,n,o){let a={method:"POST",body:{token:e,password:t,passwordConfirm:s}};return a=x("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",a,n,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",a).then((()=>!0))}async requestVerification(e,t,s){let n={method:"POST",body:{email:e}};return n=x("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",n,t,s),this.client.send(this.baseCollectionPath+"/request-verification",n).then((()=>!0))}async confirmVerification(e,t,s){let n={method:"POST",body:{token:e}};return n=x("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",n,t,s),this.client.send(this.baseCollectionPath+"/confirm-verification",n).then((()=>{const o=O(e),a=this.client.authStore.record;return a&&!a.verified&&a.id===o.id&&a.collectionId===o.collectionId&&(a.verified=!0,this.client.authStore.save(this.client.authStore.token,a)),!0}))}async requestEmailChange(e,t,s){let n={method:"POST",body:{newEmail:e}};return n=x("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",n,t,s),this.client.send(this.baseCollectionPath+"/request-email-change",n).then((()=>!0))}async confirmEmailChange(e,t,s,n){let o={method:"POST",body:{token:e,password:t}};return o=x("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,s,n),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then((()=>{const a=O(e),c=this.client.authStore.record;return c&&c.id===a.id&&c.collectionId===a.collectionId&&this.client.authStore.clear(),!0}))}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,s){const n=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(n.id,s).then((()=>!0))}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,s){return s=Object.assign({method:"POST",body:{otpId:e,password:t}},s),this.client.send(this.baseCollectionPath+"/auth-with-otp",s).then((n=>this.authResponse(n)))}async impersonate(e,t,s){(s=Object.assign({method:"POST",body:{duration:t}},s)).headers=s.headers||{},s.headers.Authorization||(s.headers.Authorization=this.client.authStore.token);const n=new Q(this.client.baseURL,new P,this.client.lang),o=await n.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),s);return n.authStore.save(o?.token,this.decode(o?.record||{})),n}_replaceQueryParams(e,t={}){let s=e,n="";e.indexOf("?")>=0&&(s=e.substring(0,e.indexOf("?")),n=e.substring(e.indexOf("?")+1));const o={},a=n.split("&");for(const c of a){if(c=="")continue;const l=c.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let c in t)t.hasOwnProperty(c)&&(t[c]==null?delete o[c]:o[c]=t[c]);n="";for(let c in o)o.hasOwnProperty(c)&&(n!=""&&(n+="&"),n+=encodeURIComponent(c.replace(/%20/g,"+"))+"="+encodeURIComponent(o[c].replace(/%20/g,"+")));return n!=""?s+"?"+n:s}}function M(r){if(typeof window>"u"||!window?.open)throw new d(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,s=window.innerWidth,n=window.innerHeight;e=e>s?s:e,t=t>n?n:t;let o=s/2-e/2,a=n/2-t/2;return window.open(r,"popup_window","width="+e+",height="+t+",top="+a+",left="+o+",resizable,menubar=no")}class Ne extends Y{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,s){return s=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},s),this.client.send(this.baseCrudPath+"/import",s).then((()=>!0))}async truncate(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/truncate",t).then((()=>!0))}async getScaffolds(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/scaffolds",e)}async getAllOAuth2Providers(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/meta/oauth2-providers",e)}async dryRunViewQuery(e,t){return t=Object.assign({method:"POST",body:{query:e}},t),this.client.send(this.baseCrudPath+"/meta/dry-run-view",t)}}class Pe extends f{async getList(e=1,t=30,s){return(s=Object.assign({method:"GET"},s)).query=Object.assign({page:e,perPage:t},s.query),this.client.send("/api/logs",s)}async getOne(e,t){if(!e)throw new d({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}async truncate(e){return e=Object.assign({method:"DELETE"},e),this.client.send("/api/logs",e).then((()=>!0))}}class Le extends f{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class qe extends f{getUrl(e,t,s={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,s)}getURL(e,t,s={}){if(!t||!e?.id||!e?.collectionId&&!e?.collectionName)return"";const n=[];n.push("api"),n.push("files"),n.push(encodeURIComponent(e.collectionId||e.collectionName)),n.push(encodeURIComponent(e.id)),n.push(encodeURIComponent(t));let o=this.client.buildURL(n.join("/"));s.download===!1&&delete s.download;const a=q(s);return a&&(o+=(o.includes("?")?"&":"?")+a),o}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then((t=>t?.token||""))}}class Ue extends f{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then((()=>!0))}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then((()=>!0))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then((()=>!0))}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then((()=>!0))}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl(
21) with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class De extends f{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/crons",e)}async run(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/crons/${encodeURIComponent(e)}`,t).then((()=>!0))}}class Be extends f{async run(e,t){return t=Object.assign({method:"POST",body:{query:e}},t),this.client.send("/api/sql",t)}}function I(r){return typeof Blob<"u"&&r instanceof Blob||typeof File<"u"&&r instanceof File||r!==null&&typeof r=="object"&&r.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function N(r){return r&&(r.constructor?.name==="FormData"||typeof FormData<"u"&&r instanceof FormData)}function W(r){for(const e in r){const t=Array.isArray(r[e])?r[e]:[r[e]];for(const s of t)if(I(s))return!0}return!1}const Fe=/^[\-\.\d]+$/;function z(r){if(typeof r!="string")return r;if(r=="true")return!0;if(r=="false")return!1;if((r[0]==="-"||r[0]>="0"&&r[0]<="9")&&Fe.test(r)){let e=+r;if(""+e===r)return e}return r}class Me extends f{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new We(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,s=[];for(let n=0;n<this.requests.length;n++){const o=this.requests[n];if(s.push({method:o.method,url:o.url,headers:o.headers,body:o.json}),o.files)for(let a in o.files){const c=o.files[a]||[];for(let l of c)t.append("requests."+n+"."+a,l)}}return t.append("@jsonPayload",JSON.stringify({requests:s})),e=Object.assign({method:"POST",body:t},e),this.client.send("/api/batch",e)}}class We{constructor(e,t){this.requests=[],this.requests=e,this.collectionIdOrName=t}upsert(e,t){t=Object.assign({body:e||{}},t);const s={method:"PUT",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(s,t),this.requests.push(s)}create(e,t){t=Object.assign({body:e||{}},t);const s={method:"POST",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records"};this.prepareRequest(s,t),this.requests.push(s)}update(e,t,s){s=Object.assign({body:t||{}},s);const n={method:"PATCH",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(n,s),this.requests.push(n)}delete(e,t){t=Object.assign({},t);const s={method:"DELETE",url:"/api/collections/"+encodeURIComponent(this.collectionIdOrName)+"/records/"+encodeURIComponent(e)};this.prepareRequest(s,t),this.requests.push(s)}prepareRequest(e,t){if(L(t),e.headers=t.headers,e.json={},e.files={},t.query!==void 0){const n=q(t.query);n&&(e.url+=(e.url.includes("?")?"&":"?")+n)}let s=t.body;N(s)&&(s=(function(o){let a={};return o.forEach(((c,l)=>{if(l==="@jsonPayload"&&typeof c=="string")try{let h=JSON.parse(c);Object.assign(a,h)}catch(h){console.warn("@jsonPayload error:",h)}else a[l]!==void 0?(Array.isArray(a[l])||(a[l]=[a[l]]),a[l].push(z(c))):a[l]=z(c)})),a})(s));for(const n in s){const o=s[n];if(I(o))e.files[n]=e.files[n]||[],e.files[n].push(o);else if(Array.isArray(o)){const a=[],c=[];for(const l of o)I(l)?a.push(l):c.push(l);if(a.length>0&&a.length==o.length){e.files[n]=e.files[n]||[];for(let l of a)e.files[n].push(l)}else if(e.json[n]=c,a.length>0){let l=n;n.startsWith("+")||n.endsWith("+")||(l+="+"),e.files[l]=e.files[l]||[];for(let h of a)e.files[l].push(h)}}else e.json[n]=o}}}RegExp.escape||(RegExp.escape=function(r){return r.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")});class Q{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,s="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=s,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new P:this.authStore=new Re,this.collections=new Ne(this),this.files=new qe(this),this.logs=new Pe(this),this.settings=new Ee(this),this.realtime=new J(this),this.health=new Le(this),this.backups=new Ue(this),this.crons=new De(this),this.sql=ne
21w Be(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Me(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Ie(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;const s={};for(const o in t)s["{:"+o+"}"]=t[o];const n=Object.keys(s).map((o=>RegExp.escape(o))).join("|");return n?e.replace(new RegExp(n,"g"),(o=>(function(c){switch(typeof c){case"boolean":case"number":return""+c;case"string":return JSON.stringify(c);default:if(c==null)return"null";if(c instanceof Date)return JSON.stringify(c.toISOString().replace("T"," "));const l=JSON.stringify(c);return l.startsWith("[")||l.startsWith("{")?JSON.stringify(l):l}})(s[o]))):e}getFileUrl(e,t,s={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(e,t,s)}buildUrl(e){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(e)}buildURL(e){let t=this.baseURL;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=window.location.origin?.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseURL),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let s=this.buildURL(e);if(this.beforeSend){const n=Object.assign({},await this.beforeSend(s,t));n.url!==void 0||n.options!==void 0?(s=n.url||s,t=n.options||t):Object.keys(n).length&&(t=n,console?.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const n=q(t.query);n&&(s+=(s.includes("?")?"&":"?")+n),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(s,t).then((async n=>{let o={};try{o=await n.json()}catch(a){if(t.signal?.aborted||a?.name=="AbortError"||a?.message=="Aborted")throw a}if(this.afterSend&&(o=await this.afterSend(n,o,t)),n.status>=400)throw new d({url:n.url,status:n.status,data:o});return o})).catch((n=>{throw new d(n)}))}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=(function(n){if(typeof FormData>"u"||n===void 0||typeof n!="object"||n===null||N(n)||!W(n))return n;const o=new FormData;for(const a in n){const c=n[a];if(c!==void 0)if(typeof c!="object"||W({data:c})){const l=Array.isArray(c)?c:[c];for(let h of l)o.append(a,h)}else{let l={};l[a]=c,o.append("@jsonPayload",JSON.stringify(l))}}return o})(t.body),L(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||N(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const s=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(s);const n=new AbortController;this.cancelControllers[s]=n,t.signal=n.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let s in e)if(s.toLowerCase()==t)return e[s];return null}}const ze="/hcgi/platform",_e=new Q(ze);function He(){const[r,e]=S.useState("idle");async function t(s){s.preventDefault();const n=s.currentTarget,o=new FormData(n);e("sending");try{await _e.collection("author_inquiries").create({name:o.get("name"),email:o.get("email"),topic:o.get("topic"),message:o.get("message")}),e("success"),n.reset()}catch{e("error")}}return i.jsxs("section",{id:"contact",className:"contact-section section",children:[i.jsxs("div",{children:[i.jsx("p",{className:"eyebrow",children:"06 / LET’S CONNECT"}),i.jsxs("h2",{children:["Great discoveries",i.jsx("br",{}),"start with ",i.jsx("em",{children:"hello."})]}),i.jsx("p",{children:"Have a question about a book? Planning an author visit? Interested in a press interview? Leave a message for Irma."}),i.jsx(A,{className:"contact-leaf",size:82,strokeWidth:.7})]}),i.jsxs("form",{onSubmit:t,children:[i.jsxs("div",{className:"form-pair",children:[i.jsxs("label",{children:["Your name",i.jsx("input",{name:"name",required:!0,maxLength:120,autoComplete:"name",placeholder:"First and last name"})]}),i.jsxs("label",{children:["Email address",i.jsx("input",{name:"email",type:"email",required:!0,autoComplete:"email",placeholder:"[email protected]"})]})]}),i.jsxs("label",{children:["I’m reaching out about",i.jsxs("select",{name:"topic",defaultValue:"Author visit",children:[i.jsx("option",{children:"Author visit"}),i.jsx("option",{children:"Books & general questions"}),i.jsx("option",{children:"Teacher resources"}),i.jsx("option",{children:"Press & interviews"}),i.jsx("option",{children:"Other"})]})]}),i.jsxs("label",{children:["Your message",i.jsx("textarea",{name:"message",rows:4,required:!0,minLength:10,maxLength:5e3,placeholder:"Tell Irma a little about what you have in mind…"})]}),i.jsxs("div",{className:"form-bottom",children:[i.jsx("small",{children:"Your details are used only to respond to your inquiry."}),i.jsxs("button",{className:"button",disabled:r==="sending",children:[r==="sending"?"Sending…":"Send message",i.jsx(R,{size:16})]})]}),i.jsxs("div",{"aria-live":"polite",children:[r==="success"&&i.jsxs("p",{className:"form-success",children:[i.jsx(ce,{size:17}
21)," Thank you! Your inquiry has been saved for Irma to review."]}),r==="error"&&i.jsx("p",{className:"form-error",children:"Your message couldn’t be saved. Please try again."})]})]})]})}function Ke({matches:r,location:e}){return se({matches:r,location:e},{title:"Irma L. Hersel | Children’s Books Rooted in Wonder",description:"Discover award-winning children’s author Irma L. Hersel and stories celebrating family, culture, bilingual learning, and curiosity. Explore books, author visits, and teacher resources."})}const $e=Z(function(){return i.jsxs(i.Fragment,{children:[i.jsx(me,{}),i.jsxs("main",{children:[i.jsx(be,{}),i.jsx(fe,{}),i.jsx(ye,{}),i.jsx(we,{}),i.jsx(xe,{}),i.jsx(Se,{}),i.jsx(He,{})]}),i.jsx(ge,{})]})});export{$e as default,Ke as meta};

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.