@zanichelli/zanichelli-it-frontend-kit 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-BLzQAHAI.js → index-BKkNg6ed.js} +498 -358
- package/dist/cjs/index.cjs.js +0 -3
- package/dist/cjs/loader.cjs.js +2 -5
- package/dist/cjs/zanichelli-it-frontend-kit.cjs.js +3 -6
- package/dist/cjs/zanit-back-to-top_4.cjs.entry.js +75 -62
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/back-to-top/back-to-top.js +3 -4
- package/dist/collection/components/menubar/menu/menu.js +0 -1
- package/dist/collection/components/menubar/menubar.js +12 -11
- package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js +12 -13
- package/dist/collection/components/menubar/search-form/search-form.js +14 -12
- package/dist/collection/components/menubar/search-form/suggestions.js +0 -1
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/utils/subjects.api.js +0 -1
- package/dist/collection/utils/utils.js +0 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1335
- package/dist/components/p-BMtMaJq9.js +1 -0
- package/dist/components/p-BXeRLfHX.js +1 -0
- package/dist/components/zanit-back-to-top.js +1 -88
- package/dist/components/zanit-menubar.js +1 -455
- package/dist/components/zanit-mobile-menubar.js +1 -9
- package/dist/components/zanit-search-form.js +1 -9
- package/dist/esm/{index-DSdvvVFj.js → index-CFgcJxsy.js} +498 -358
- package/dist/esm/index.js +0 -3
- package/dist/esm/loader.js +3 -6
- package/dist/esm/zanichelli-it-frontend-kit.js +4 -7
- package/dist/esm/zanit-back-to-top_4.entry.js +75 -62
- package/dist/types/components/back-to-top/back-to-top.d.ts +2 -1
- package/dist/types/components/menubar/menubar.d.ts +2 -1
- package/dist/types/components/menubar/mobile-menubar/mobile-menubar.d.ts +2 -1
- package/dist/types/components/menubar/search-form/search-form.d.ts +3 -2
- package/dist/types/components.d.ts +35 -8
- package/dist/types/stencil-public-runtime.d.ts +169 -11
- package/dist/zanichelli-it-frontend-kit/index.esm.js +0 -2
- package/dist/zanichelli-it-frontend-kit/p-93d8b277.entry.js +1 -0
- package/dist/zanichelli-it-frontend-kit/p-CFgcJxsy.js +2 -0
- package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js +1 -2
- package/package.json +17 -15
- package/www/build/index.esm.js +0 -2
- package/www/build/p-93d8b277.entry.js +1 -0
- package/www/build/p-CFgcJxsy.js +2 -0
- package/www/build/p-ec9829f4.js +1 -0
- package/www/build/zanichelli-it-frontend-kit.esm.js +1 -2
- package/www/index.html +2 -1
- package/dist/cjs/index-BLzQAHAI.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/zanichelli-it-frontend-kit.cjs.js.map +0 -1
- package/dist/cjs/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.cjs.js.map +0 -1
- package/dist/cjs/zanit-back-to-top_4.cjs.entry.js.map +0 -1
- package/dist/collection/components/back-to-top/back-to-top.js.map +0 -1
- package/dist/collection/components/menubar/menu/menu.js.map +0 -1
- package/dist/collection/components/menubar/menubar.js.map +0 -1
- package/dist/collection/components/menubar/mobile-menubar/mobile-menubar.js.map +0 -1
- package/dist/collection/components/menubar/search-form/search-form.js.map +0 -1
- package/dist/collection/components/menubar/search-form/suggestions.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/utils/index.js.map +0 -1
- package/dist/collection/utils/subjects.api.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-BlgoYKK3.js +0 -246
- package/dist/components/p-BlgoYKK3.js.map +0 -1
- package/dist/components/p-DqMqkNnl.js +0 -386
- package/dist/components/p-DqMqkNnl.js.map +0 -1
- package/dist/components/zanit-back-to-top.js.map +0 -1
- package/dist/components/zanit-menubar.js.map +0 -1
- package/dist/components/zanit-mobile-menubar.js.map +0 -1
- package/dist/components/zanit-search-form.js.map +0 -1
- package/dist/esm/index-DSdvvVFj.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/zanichelli-it-frontend-kit.js.map +0 -1
- package/dist/esm/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.js.map +0 -1
- package/dist/esm/zanit-back-to-top_4.entry.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/index.esm.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/loader.esm.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/p-62cc02c2.entry.js +0 -2
- package/dist/zanichelli-it-frontend-kit/p-62cc02c2.entry.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js +0 -3
- package/dist/zanichelli-it-frontend-kit/p-DSdvvVFj.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/zanichelli-it-frontend-kit.esm.js.map +0 -1
- package/dist/zanichelli-it-frontend-kit/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
- package/www/build/index.esm.js.map +0 -1
- package/www/build/loader.esm.js.map +0 -1
- package/www/build/p-62cc02c2.entry.js +0 -2
- package/www/build/p-62cc02c2.entry.js.map +0 -1
- package/www/build/p-DSdvvVFj.js +0 -3
- package/www/build/p-DSdvvVFj.js.map +0 -1
- package/www/build/p-fe3aec03.js +0 -2
- package/www/build/zanichelli-it-frontend-kit.esm.js.map +0 -1
- package/www/build/zanit-back-to-top.zanit-menubar.zanit-mobile-menubar.zanit-search-form.entry.esm.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,a as t,h as i,H as a,F as r,c as n}from"./p-DSdvvVFj.js";const s=".sc-zanit-back-to-top-h{opacity:1;transition:all 0.2s linear;visibility:visible}.hidden.sc-zanit-back-to-top-h{opacity:0;visibility:hidden}.sc-zanit-back-to-top-h .z-fab.sc-zanit-back-to-top{--color-primary01:var(--gray950);outline:1px solid var(--color-white)}";const o=class{constructor(t){e(this,t)}resizeObserver;mutationObserver;get host(){return t(this)}showFab=false;currentPageHeight;isMobile=false;pageMinHeight=1600;scrollMinHeight=800;handleScroll(){this.updateFabVisibility()}handleResize=()=>{const e=document.body.scrollHeight;if(e!==this.currentPageHeight){this.currentPageHeight=e;this.updateFabVisibility()}};connectedCallback(){this.currentPageHeight=document.body.scrollHeight;this.resizeObserver=new ResizeObserver(this.handleResize);this.resizeObserver.observe(document.body);this.mutationObserver=new MutationObserver(this.handleResize);this.mutationObserver.observe(document.body,{childList:true,subtree:true});this.updateFabVisibility();const e=window.matchMedia("(width < 768px)");this.isMobile=e.matches;e.onchange=e=>{this.isMobile=e.matches}}disconnectedCallback(){this.resizeObserver.disconnect();this.mutationObserver.disconnect()}updateFabVisibility(){this.showFab=this.currentPageHeight>this.pageMinHeight&&window.scrollY>this.scrollMinHeight}scroll(){window.scrollTo({top:0,behavior:"smooth"})}render(){return i(a,{key:"3abd8ab70075d8042285d8ed6fab0729c4b5ec42",class:{hidden:!this.showFab},"aria-hidden":this.showFab?"false":"true"},i("button",{key:"11b149d5f1d75720d4bdd329e9897da782092ed1",class:{"z-fab":true,"z-fab-extended":!this.isMobile},onClick:()=>this.scroll()},i("z-icon",{key:"fbdff1419da6d20ab594ffd11c58d7bf25fb7aa6",name:"back-top"}),i("span",{key:"0292f761b5459c372f003ed514abbd3403570c75"},"Torna su")))}};o.style=s;const h=(e,t)=>t.composedPath().filter((e=>e!==document&&e!==window.window)).some((t=>e.contains(t)));const c=(e,t)=>{e.tabIndex=-1;t.tabIndex=0;t.focus({preventScroll:true})};const d=e=>e.key==="ArrowUp";const u=e=>e.key==="ArrowDown";const l=e=>e.key==="Tab";const m=e=>e.key==="Escape";const p="default";const b={id:p,label:p};const f=e=>{const t=e.reduce(((e,t)=>{const i=e.find((({group:e})=>e.id===(t.group?.id||b.id)));if(!i){e.push({group:t.group??b,items:[t]})}else{i.items.push(t)}return e}),[]);return t.sort(((e,t)=>e.group.id===p?1:t.group.id===p?-1:0))};const g=({controlledBy:e,items:t,currentPath:a=[],onItemKeyDown:r})=>{if(!t?.length){return null}const n=f(t);const s=t=>a.includes(e)&&a.includes(t.id);return i("div",{class:"menu-wrapper",role:"none"},i("div",{class:"menu","aria-labelledby":e??undefined,role:"menu"},n.map((({group:e,items:t})=>i("div",{class:{group:true,highlight:t.some((e=>e.highlight))}},e.id!==p?i("div",{class:"group-name",id:e.id},e.label):n.length>1?i("div",{class:"group-name"}):null,i("ul",{class:"menu-list",role:"group","aria-labelledby":e.id!==p?e.id:undefined},t.map((e=>i("li",{role:"none"},e.href&&i("a",{class:{"menu-item":true,active:s(e)},href:e.href,role:"menuitem",tabIndex:-1,"aria-current":s(e)?"page":"false",onKeyDown:e=>r(e),target:e.target},e.label))))))))))};var w;(function(e){e["DEV"]="dev";e["TEST"]="test";e["PROD"]="prod"})(w||(w={}));const x={dev:"https://zanichelli-shop-dev.s3.eu-west-1.amazonaws.com",test:"https://zanichelli-shop-test.s3.eu-west-1.amazonaws.com",prod:"https://zanichelli-shop.s3.eu-west-1.amazonaws.com"};async function y(e){try{const t=await fetch(`${x[e]}/categories.json`);if(!t.ok){throw new Error(`HTTP ${t.status}`)}return await t.json()}catch(e){console.error("Error fetching subjects:",e);return{}}}const v=":host{position:relative;z-index:2;display:flex;width:100%;background-color:#fff;color:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}:host nav{width:100%}.shadow-wrapper{position:relative;z-index:1;display:flex;width:100%}.shadow-wrapper::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}.width-limiter{position:relative;display:flex;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);margin:0 auto}.shadow-wrapper+.shadow-wrapper{z-index:0}.sub-menubar>ul{gap:28px}.width-limiter>ul,.sub-menubar>ul{position:relative;z-index:3;display:flex;width:100%;align-items:center;padding:0 var(--grid-margin);margin-right:auto;margin-left:auto;gap:20px}.shadow-wrapper>.width-limiter,.shadow-wrapper>ul{width:100%;max-width:var(--zanit-menubar-max-width, 1366px)}ul.menubar{height:3rem;padding-right:0}.menubar z-ghost-loading{display:block;width:120px;height:1.25rem}.menubar>li[role='separator']{width:1px;height:1.25rem;background-color:#000}.menubar-item{position:relative;display:flex;align-items:center;padding:14px 0;font-size:1rem;gap:8px;line-height:1.25rem}.menubar .menubar-item{text-transform:uppercase}.menubar-item [data-text]{display:flex;flex-direction:column}.menubar-item.active>[data-text],.menubar-item:hover>[data-text],.menubar-item:focus:focus-visible>[data-text]{font-weight:var(--font-bd)}.menubar-item>[data-text]::after{height:0;content:attr(data-text) / '';font-weight:var(--font-bd);letter-spacing:normal;pointer-events:none;user-select:none;visibility:hidden}.sub-menubar .menubar-item.active::after{position:absolute;z-index:-1;bottom:0;left:-4px;width:calc(100% + 8px);height:4px;background-color:var(--red500);content:''}zanit-search-form{margin-left:auto}";const k=".menu-wrapper{width:100%;background-color:#fff}.menu{position:relative;display:flex;width:100%;flex-direction:column;gap:32px 0}.menu .group{display:flex;flex-direction:column}.menu .group .group-name{border-bottom:1px solid currentcolor;margin-bottom:4px;color:var(--red500);font-size:0.875rem;font-weight:var(--font-md)}.menu .group .menu-list{display:flex;flex-direction:column;gap:8px}.menu .group .menu-list .menu-item{display:block;border-bottom:2px solid transparent;font-size:0.875rem;font-weight:var(--font-md)}.menu .menu-list .menu-item.active,.menu .menu-list .menu-item:hover{border-bottom-color:var(--red500)}.menu .group.highlight .menu-list .menu-item{font-size:1rem}@media (width >= 768px){.menu-wrapper{position:absolute;top:100%;left:0;display:flex;justify-content:center;box-shadow:var(--shadow-1)}.menu{display:grid;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);padding:16px var(--grid-margin);gap:0 24px;grid-auto-columns:minmax(0, max-content);grid-auto-flow:column;grid-template-rows:minmax(0, max-content) max-content}.menu .group{display:grid;grid-row:1 / -1;grid-template-columns:1fr;grid-template-rows:subgrid}@supports not (grid-template-rows: subgrid){.menu .group{grid-template-rows:repeat(auto-fit, minmax(0, max-content))}}.menu .group .group-name{border:none;margin-bottom:16px}.menu .group .menu-list .menu-item{font-size:1rem}.menu .group.highlight .menu-list .menu-item{font-size:1.5rem}}";const z=class{constructor(t){e(this,t)}get host(){return t(this)}items=[];openMenu=undefined;openNavbar=undefined;currentPath=[];isMobile=false;loading=false;data;current=undefined;searchQuery=undefined;searchEnv=w.PROD;searchArea;timerId;async parseData(e){if(!e){return}if(e instanceof URL){this.items=await this.fetchData(e)}else if(e instanceof Promise){this.loading=true;this.items=await e;this.loading=false}else if(typeof e==="string"){try{this.items=JSON.parse(e);if(!Array.isArray(this.items)||!this.items?.every((e=>e))){throw new Error("Expected an array of MenubarItem objects.")}}catch{let t;try{t=new URL(e)}catch{throw new Error("Invalid string provided for `data` property: not a valid url or JSON.")}this.items=await this.fetchData(t)}}else if(Array.isArray(e)&&e.every((e=>e))){this.items=e}else{throw new Error("Invalid `data` property value. Expected an url, a JSON or an array/promise of MenubarItem objects.")}}onItemsChange(){this.initTabindex()}onCurrentChange(){this.currentPath=this.current?.split("/").filter(Boolean)||[]}async connectedCallback(){const e=window.matchMedia("(width < 768px)");this.isMobile=e.matches;e.onchange=e=>{this.isMobile=e.matches;this.initTabindex();this.openMenu=undefined};await this.parseData(this.data);this.onCurrentChange();this.initTabindex()}handleOutsideClick(e){if(!this.openMenu||h(this.host,e)){return}this.openMenu=undefined}handleKeydown(e){switch(e.key){case"Escape":{if(this.openMenu){e.preventDefault();const t=this.openMenu;this.openMenu=undefined;setTimeout((()=>{const e=this.host.shadowRoot.getElementById(t);if(e){e.focus()}}),0)}break}case"Tab":this.openMenu=undefined;break}}handleMouseover(){clearTimeout(this.timerId)}handleMouseout(e){this.timerId=window.setTimeout((()=>{if(!this.openMenu||h(this.host,e)){return}this.openMenu=undefined}),500)}handleFocusout(e){const t=e.relatedTarget;if(!this.openMenu||this.host.shadowRoot.querySelector(".menu")?.contains(t)){return}this.openMenu=undefined}async fetchData(e){try{this.loading=true;const t=await(await fetch(e)).json();this.loading=false;if(!Array.isArray(t)||!t.every((e=>e))){throw new Error("Invalid data structure. Expected an array of MenuItem objects.")}return t}catch(e){this.loading=false;console.error("Error fetching menubar data:",e);throw new Error("Failed to fetch menubar data from the provided URL.",{cause:e})}}initTabindex(){setTimeout((()=>{this.host.shadowRoot.querySelectorAll('[role="menubar"]')?.forEach((e=>{e.querySelectorAll('[role="menuitem"]')?.forEach(((e,t)=>e.setAttribute("tabindex",t===0?"0":"-1")))}))}),100)}isActive(e){if(this.currentPath.length===0){return false}if(this.currentPath.includes(e.id)){return true}if(e.menuItems?.length){return e.menuItems.some((e=>e.id===this.current))}if(e.navbarItems?.length){const t=e.navbarItems.some((e=>this.isActive(e)));if(t){return true}}return false}showMenu(e){this.openMenu=undefined;if(!e.menuItems?.length){return}this.openMenu=e.id}getParentMenubarElements(e){return Array.from(e?.closest('[role="menubar"]')?.querySelectorAll(':scope > li a[role="menuitem"]')??[])}focusPreviousItem(e){this.openMenu=undefined;const t=this.getParentMenubarElements(e);const i=t.indexOf(e);const a=t[(i-1+t.length)%t.length];c(e,a);if(a.ariaHasPopup==="true"&&this.openMenu){this.openMenu=a.id}}focusNextItem(e){this.openMenu=undefined;const t=this.getParentMenubarElements(e);const i=t.indexOf(e);const a=t[(i+1)%t.length];c(e,a);if(a.ariaHasPopup==="true"&&this.openMenu){this.openMenu=a.id}}handleItemKeydown(e,t){const i=e.target;switch(e.key){case"Home":{e.preventDefault();e.stopPropagation();const t=this.getParentMenubarElements(i)[0];c(i,t);break}case"End":{e.preventDefault();e.stopPropagation();const t=this.getParentMenubarElements(i).pop();c(i,t);break}case"ArrowUp":{if(!t.menuItems?.length){break}e.preventDefault();e.stopPropagation();this.openMenu=t.id;setTimeout((()=>{const e=Array.from(this.host.shadowRoot.querySelectorAll(`[aria-labelledby=${t.id}] [role="menuitem"]`));c(i,e[e.length-1])}),100);break}case"ArrowRight":{e.preventDefault();e.stopPropagation();this.focusNextItem(i);break}case"ArrowDown":{if(!t.menuItems?.length){break}this.openItemMenu(t);break}case"ArrowLeft":{e.preventDefault();e.stopPropagation();this.focusPreviousItem(i);break}case" ":{e.preventDefault();e.stopPropagation();if(this.openMenu===t.id){this.openMenu=undefined;break}else if(t.menuItems?.length){this.openItemMenu(t);break}}}}getPreviousGroup(e){const t=Array.from(e?.closest('[role="menu"]')?.querySelectorAll('[role="group"]')??[]);const i=t.indexOf(e);return t[i-1]}getNextGroup(e){const t=Array.from(e?.closest('[role="menu"]')?.querySelectorAll('[role="group"]')??[]);const i=t.indexOf(e);return t[i+1]}openItemMenu(e){this.openMenu=e.id;setTimeout((()=>{const t=this.host.shadowRoot.querySelector(`[aria-labelledby=${e.id}] [role="menuitem"]`);t.tabIndex=0;t.focus({preventScroll:true})}),100)}handleMenuKeydown(e){const t=e.target;const i=Array.from(t.closest('[role="menu"]')?.querySelectorAll('[role="menuitem"]')??[]);const a=i.indexOf(t);switch(e.key){case"ArrowUp":{e.preventDefault();e.stopPropagation();const r=i[a-1]||i[i.length-1];c(t,r);break}case"ArrowRight":{e.preventDefault();e.stopPropagation();const i=t.closest("[role=group]");const a=this.getNextGroup(i);if(!a){t.tabIndex=-1;const e=t.closest('[role="menu"][aria-labelledby]').getAttribute("aria-labelledby");const i=this.host.shadowRoot.getElementById(e);this.focusNextItem(i);break}const r=a.querySelectorAll('[role="menuitem"]')??[];c(t,r[0]);break}case"ArrowDown":{e.preventDefault();e.stopPropagation();const r=i[a+1]||i[0];c(t,r);break}case"ArrowLeft":{e.preventDefault();e.stopPropagation();const i=t.closest("[role=group]");const a=this.getPreviousGroup(i);if(!a){t.tabIndex=-1;const e=t.closest('[role="menu"][aria-labelledby]').getAttribute("aria-labelledby");const i=this.host.shadowRoot.getElementById(e);this.focusPreviousItem(i);break}const r=a.querySelectorAll('[role="menuitem"]')??[];c(t,r[0]);break}case"Home":e.preventDefault();e.stopPropagation();c(t,i[0]);break;case"End":e.preventDefault();e.stopPropagation();c(t,i[i.length-1]);break}}render(){if(this.isMobile){return i("zanit-mobile-menubar",{items:this.items,currentPath:this.currentPath,searchQuery:this.searchQuery,loading:this.loading,searchArea:this.searchArea,searchEnv:this.searchEnv})}return i("nav",{"aria-label":"Zanichelli.it"},i("div",{class:"shadow-wrapper"},i("div",{class:"width-limiter"},i("ul",{class:"menubar",role:"menubar","aria-label":"Zanichelli.it"},this.loading&&[...new Array(4)].map(((e,t)=>i(r,null,i("li",{role:"none"},i("div",{class:"menubar-item"},i("z-ghost-loading",null))),t<3&&i("li",{role:"separator"})))),this.items?.map(((e,t)=>i(r,null,i("li",{role:"none"},i("a",{class:{"menubar-item":true,active:this.isActive(e)},href:e.href,id:e.id,role:"menuitem",tabIndex:-1,"aria-expanded":e.menuItems?.length?this.openMenu===e.id?"true":"false":undefined,"aria-haspopup":e.menuItems?.length?"true":"false","aria-current":this.current.includes(e.id)?"page":"false",onPointerOver:()=>this.showMenu(e),onKeyDown:t=>this.handleItemKeydown(t,e),target:e.target},i("span",{"data-text":e.label},e.label),e.menuItems?.length>0&&i("z-icon",{name:this.openMenu===e.id?"chevron-up":"chevron-down",width:"0.875rem",height:"0.875rem"}))),t<this.items?.length-1&&i("li",{role:"separator"}))))),i("zanit-search-form",{searchQuery:this.searchQuery,searchArea:this.searchArea,searchEnv:this.searchEnv,onResetSearch:()=>this.searchQuery=undefined})),this.items.map((e=>this.openMenu===e.id&&i(g,{controlledBy:e.id,items:e.menuItems,currentPath:this.currentPath,onItemKeyDown:e=>this.handleMenuKeydown(e)})))),this.items?.filter((e=>this.isActive(e))).map((e=>e.navbarItems?.length&&i("nav",{class:{"sub-menubar":true,"shadow-wrapper":true},"aria-label":`Sezioni: ${e.label}`},i("ul",{role:"menubar"},e.navbarItems.map((t=>i(r,null,i("li",{role:"none"},i("a",{class:{"menubar-item":true,active:this.isActive(t)},href:t.href,id:t.id,role:"menuitem",tabIndex:-1,"aria-haspopup":t.menuItems?.length?"true":"false","aria-expanded":t.menuItems?.length?this.openMenu===t.id?"true":"false":undefined,"aria-current":this.current.includes(t.id)?"page":"false",onPointerOver:()=>this.showMenu(t),onKeyDown:e=>this.handleItemKeydown(e,t),target:e.target},i("span",null,t.label),t.menuItems?.length>0&&i("z-icon",{name:this.openMenu===t.id?"chevron-up":"chevron-down",width:"0.75rem",height:"0.75rem"}))))))),e.navbarItems.map((e=>this.openMenu===e.id&&i(g,{controlledBy:e.id,items:e.menuItems,currentPath:this.currentPath,onItemKeyDown:e=>this.handleMenuKeydown(e)})))))))}static get delegatesFocus(){return true}static get watchers(){return{data:["parseData"],items:["onItemsChange"],current:["onCurrentChange"]}}};z.style=v+k;const S=":host{position:relative;z-index:2;display:block;width:100%;max-width:100%;height:3rem;background-color:#fff;color:var(--gray900);fill:var(--gray900);font-family:var(--font-family-sans)}:host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}ul{padding:0;margin:0;list-style:none}a{color:var(--gray900);cursor:pointer;text-decoration:none}button{all:unset;cursor:pointer}nav{display:flex;width:100%;align-items:center;padding-left:var(--grid-margin);gap:8px}nav::after{position:absolute;top:0;right:0;width:100%;height:100%;background:transparent;box-shadow:var(--shadow-1);content:'';pointer-events:none}z-logo{margin:8px 0}.mobile-menu{position:absolute;top:100%;left:0;display:flex;overflow:auto;width:100%;max-height:calc(100vh - 48px - var(--zanit-menubar-top-offset, 0px));flex-direction:column;padding:16px var(--grid-margin) 32px;background-color:#fff;box-shadow:var(--shadow-2);gap:8px}.mobile-menu li{width:100%}.mobile-menu .items-container{display:flex;min-height:256px;flex-direction:column;gap:8px}.mobile-menu .items-container z-ghost-loading{width:40%;height:1.2rem}.mobile-menu .items-container .menubar-item{display:block;width:100%;padding:8px 0;font-size:1rem;text-align:left}.mobile-menu .items-container li:not(:last-child) .menubar-item{border-bottom:1px solid #000}[role='menuitem'].parent{display:flex;width:fit-content;align-items:center;padding:0;border:none;font-size:0.875rem;gap:8px}zanit-search-form{margin-left:auto}";const C=".menu-wrapper{width:100%;background-color:#fff}.menu{position:relative;display:flex;width:100%;flex-direction:column;gap:32px 0}.menu .group{display:flex;flex-direction:column}.menu .group .group-name{border-bottom:1px solid currentcolor;margin-bottom:4px;color:var(--red500);font-size:0.875rem;font-weight:var(--font-md)}.menu .group .menu-list{display:flex;flex-direction:column;gap:8px}.menu .group .menu-list .menu-item{display:block;border-bottom:2px solid transparent;font-size:0.875rem;font-weight:var(--font-md)}.menu .menu-list .menu-item.active,.menu .menu-list .menu-item:hover{border-bottom-color:var(--red500)}.menu .group.highlight .menu-list .menu-item{font-size:1rem}@media (width >= 768px){.menu-wrapper{position:absolute;top:100%;left:0;display:flex;justify-content:center;box-shadow:var(--shadow-1)}.menu{display:grid;width:100%;max-width:var(--zanit-menubar-max-width, 1366px);padding:16px var(--grid-margin);gap:0 24px;grid-auto-columns:minmax(0, max-content);grid-auto-flow:column;grid-template-rows:minmax(0, max-content) max-content}.menu .group{display:grid;grid-row:1 / -1;grid-template-columns:1fr;grid-template-rows:subgrid}@supports not (grid-template-rows: subgrid){.menu .group{grid-template-rows:repeat(auto-fit, minmax(0, max-content))}}.menu .group .group-name{border:none;margin-bottom:16px}.menu .group .menu-list .menu-item{font-size:1rem}.menu .group.highlight .menu-list .menu-item{font-size:1.5rem}}";const A=class{constructor(t){e(this,t)}get host(){return t(this)}currentPath=[];items=[];searchQuery=undefined;loading=false;searchEnv=w.PROD;searchArea;lastCurrent=undefined;parentItem=undefined;menuItems=undefined;menuType=undefined;open;onItemsChange(){this.lastCurrent=this.currentPath?.length?this.currentPath[this.currentPath.length-1]:undefined;this.setupData(this.items)}setupData(e,t){if(this.lastCurrent===undefined){this.parentItem=undefined;this.menuType="menubar";this.menuItems=e;return}for(const i of e){if(i.id===this.lastCurrent){this.parentItem=t;this.menuType=i.menuItems?.length?"menu":"menubar";this.menuItems=i.menuItems||i.navbarItems;return}if(this.currentPath.length>1&&i.id===this.currentPath[this.currentPath.length-2]&&i.menuItems?.some((({id:e})=>e===this.lastCurrent))){this.parentItem=i;this.menuType=i.menuItems?.length?"menu":"menubar";this.menuItems=i.menuItems||i.navbarItems;return}if(i.navbarItems?.length){this.setupData(i.navbarItems,i)}}}get menuItemsElement(){return Array.from(this.host.shadowRoot.querySelectorAll('[role="menuitem"]'))}initTabindex(){this.menuItemsElement.forEach(((e,t)=>e.setAttribute("tabindex",t===0?"0":"-1")))}toggleMenu(){if(this.open){this.open=false}else{this.open=true;setTimeout((()=>{this.initTabindex();this.menuItemsElement[0]?.focus({preventScroll:true})}),200)}}handleItemKeydown(e){switch(e.key){case"ArrowUp":{e.preventDefault();e.stopPropagation();const t=this.menuItemsElement;const i=t.indexOf(e.target);const a=t[(i-1+t.length)%t.length];c(t[i],a);break}case"ArrowDown":{e.preventDefault();e.stopPropagation();const t=this.menuItemsElement;const i=t.indexOf(e.target);const a=t[(i+1)%t.length];c(t[i],a);break}case"Home":{e.preventDefault();e.stopPropagation();c(e.target,this.menuItemsElement[0]);break}case"End":{e.preventDefault();e.stopPropagation();c(e.target,this.menuItemsElement.pop());break}}}connectedCallback(){this.lastCurrent=this.currentPath?.length?this.currentPath[this.currentPath.length-1]:undefined;this.setupData(this.items)}handleOutsideClick(e){if(h(this.host,e)){return}this.open=false}handleKeydown(e){switch(e.key){case"Escape":this.open=false;break;case"Tab":if(h(this.host,e)){break}this.open=false;break}}handleFocusout(e){if(h(this.host,e)){return}this.open=false}render(){return i("nav",{key:"76079ce1e66f1b568f6e7eac1f67b91af0f2f48a","aria-label":"Zanichelli.it"},i("button",{key:"630b16be60aba3d7027fbe4b9e19e440cb454267",class:"burger-button",type:"button","aria-expanded":this.open?"true":"false","aria-controls":"mobile-menu","aria-label":this.open?"Chiudi menù":"Apri menù",onClick:()=>this.toggleMenu()},i("z-icon",{key:"4c86d84d421ab93fb1c815c5a667dd55ce8254ac",name:this.open?"multiply":"burger-menu",width:"1.5rem",height:"1.5rem"})),i("z-logo",{key:"03c7b8613698098cf3a1ff4b1b8d649cb7d5b92a",imageAlt:"Logo Zanichelli",link:"/",height:32,width:126}),i("zanit-search-form",{key:"5a1385991eebcf17ac8c275c8c69f6662f75e3b7",searchQuery:this.searchQuery,onResetSearch:()=>this.searchQuery=undefined,searchArea:this.searchArea,searchEnv:this.searchEnv}),this.open&&i("ul",{key:"bc627e55f902beaac658f02d90ed78836fde193b",class:"mobile-menu",role:"menubar"},!this.loading&&this.currentPath&&this.currentPath.length>0&&i("li",{key:"4708f9ee160d62a6cbf6333e11c1b9d02ae3d34c",role:"none"},i("a",{key:"9fd59125f8cb87f6c86108eea7ba79a04bc4d68c",class:"parent",href:this.parentItem?.href??"/",id:this.parentItem?.id??undefined,role:"menuitem",tabIndex:-1,onKeyDown:e=>this.handleItemKeydown(e),target:this.parentItem?.target},i("z-icon",{key:"615bc59a1f058a745bdadd90c6f51f9abc757df1",name:"arrow-left",width:"0.5rem",height:"0.5rem"}),i("span",{key:"66a80691639e97b2d7d7d61cc45f8b47dcdabafe"},this.parentItem?.label||"Home"))),this.loading?i("div",{class:"items-container",role:"none"},[...new Array(4)].map((()=>i("li",{role:"none"},i("div",{class:"menubar-item",role:"none"},i("z-ghost-loading",null)))))):this.menuType==="menu"?i(g,{items:this.menuItems,controlledBy:this.parentItem?.id,currentPath:this.currentPath,onItemKeyDown:e=>this.handleItemKeydown(e)}):this.menuItems?.length>0&&i("div",{class:"items-container",role:"none"},this.menuItems.map((e=>i("li",{role:"none"},i("a",{class:{"menu-item":this.menuType==="menu","menubar-item":this.menuType==="menubar"},href:e.href,id:e.id,role:"menuitem","aria-current":this.lastCurrent===e.id?"page":"false",tabIndex:-1,onKeyDown:e=>this.handleItemKeydown(e),target:e.target},i("span",{"data-text":e.label},e.label))))))))}static get delegatesFocus(){return true}static get watchers(){return{items:["onItemsChange"],currentPath:["onItemsChange"]}}};A.style=S+C;var I;(function(e){e["SCUOLA"]="Scuola";e["UNIVERSITÀ"]="Università";e["GIURIDICO"]="Giuridico";e["DIZIONARI"]="Dizionari";e["SAGGISTICA"]="Saggistica"})(I||(I={}));const E=Object.keys(I);function D(e,t,i){const a=_(e,t);const r=a.length>0;const n=r?e.toUpperCase():undefined;const s=[];if(i)s.push(T(e,i));s.push(T(e));if(r){if(i){const t=[...a.filter((e=>e===i)),...a.filter((e=>e!==i)).sort(((e,t)=>R(e)-R(t)))];t.forEach((t=>s.push(j(e,t,n))))}else{a.sort(((e,t)=>R(e)-R(t))).forEach((t=>s.push(j(e,t,n))))}}return s}const T=(e,t)=>({id:P(`word-${e}-${t}`),label:K(e,t),aria_label:O(e,t,false),url:$({q:e,...t?{area:t}:{},user_query:e}),...M(e,e,t)});const j=(e,t,i)=>({id:P(`subj-${e}-${t}-${i}`),label:K(e,t),aria_label:O(e,t,true),url:$({area:t,materia:i,user_query:e}),...M(e,undefined,t,i)});const P=e=>e.split("").map((e=>e.charCodeAt(0).toString(16))).join("");const $=e=>`/ricerca?${new URLSearchParams(e).toString()}`;const M=(e,t,i,a)=>({user_query:e,...t?{query:t}:{},...i?{area:i}:{},...a?{subject:a}:{}});const K=(e,t)=>`<mark>${e}</mark> in <strong>${t?`${I[t]??t}`:`tutto il sito`}</strong>`;const O=(e,t,i=false)=>`Cerca la ${i?`materia`:`parola`} ${e} ${t?`nel catalogo ${I[t]??t}`:`in tutto il sito`}`;function _(e,t){const i=Q(e);return Object.entries(t).filter((([,e])=>e.some((e=>e.toLowerCase()===i)))).map((([e])=>e))}const Q=e=>e.toLowerCase().replace(/\s+/g," ");const R=e=>{const t=E.indexOf(e);return t>=0?t:100};const q=":host,*,::before,::after{box-sizing:border-box}*:focus:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}button{all:unset;cursor:pointer}.searchbar{--searchbar-button-x-padding:14px;--searchbar-button-icon-width:1.75rem;--closed-searchbar-width:calc((var(--searchbar-button-x-padding) * 2) + var(--searchbar-button-icon-width) + 1px);position:absolute;z-index:5;top:0;right:0;display:flex;width:var(--closed-searchbar-width);height:3rem;justify-content:flex-end;transition:width 0.4s ease-in-out}.searchbar.searchbar-open{width:100%}.searchbar .input-wrapper{display:flex;overflow:hidden;width:100%;align-items:center;padding:8px;padding-left:var(--grid-margin);background-color:#fff;gap:8px;transition-duration:0.4s;transition-property:padding-right, padding-left, width;transition-timing-function:ease-in-out}.searchbar:not(.searchbar-open) .input-wrapper{overflow:hidden;width:0;padding:0}.searchbar button[type='reset']{--z-icon-width:1rem;--z-icon-height:1rem;display:flex;align-items:center;cursor:pointer}.searchbar input{z-index:1;width:100%;height:100%;padding:0;border:none;background-color:#fff;font-family:var(--font-family-sans);font-size:1rem}.searchbar.searchbar-open input:first-child{padding-left:4px;margin-left:-4px;}.searchbar input[type='search']::-webkit-search-cancel-button,.searchbar input[type='search']::-webkit-search-decoration{appearance:none}.searchbar input::placeholder{color:var(--gray500)}.searchbar .searchbar-button{display:flex;align-items:center;justify-content:center;padding:10px var(--searchbar-button-x-padding);border-left:1px solid #000;background:var(--zanit-accent-color);font-family:inherit;font-size:inherit;gap:64px;line-height:1}.searchbar .searchbar-button:focus-visible{z-index:1}.searchbar-button z-icon{--z-icon-width:var(--searchbar-button-icon-width);--z-icon-height:var(--searchbar-button-icon-width)}.suggestions-wrapper{position:absolute;z-index:4;top:3rem;left:50%;width:100vw;border-top:1px solid var(--gray200);margin-left:-50vw;background:#fff;box-shadow:var(--shadow-1)}.suggestions-wrapper.hidden{display:none}.suggestions{display:flex;width:100%;flex-direction:column;align-items:stretch;padding:var(--space-unit);margin:0 auto}.suggestion-head{padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray700);font-size:0.875rem;font-weight:var(--font-md);line-height:1.125rem}.suggestion{display:flex;padding:calc(var(--space-unit) * 0.75) var(--space-unit);color:var(--gray900);cursor:pointer;font-size:1rem;gap:var(--space-unit);line-height:1.5rem}.suggestion:hover,.suggestion[aria-selected='true']{background:var(--gray100)}.suggestion strong{font-weight:var(--font-bd)}.suggestion mark{background-color:var(--red50)}.suggestion z-icon{--z-icon-height:1.125rem;margin-top:0.125rem}.suggestions z-divider{margin:var(--space-unit) 0}@media (width < 1152px){.searchbar .searchbar-button>.searchbar-button-label{display:none}}@media (width >= 768px){.searchbar{--searchbar-button-x-padding:16px;--searchbar-button-icon-width:2rem}.searchbar .input-wrapper{gap:14px}.searchbar button[type='reset']{--z-icon-width:1.5rem;--z-icon-height:1.5rem}.searchbar input,.searchbar .searchbar-button{font-size:1.5rem}.searchbar .searchbar-button{padding:8px var(--searchbar-button-x-padding)}.suggestions{padding:var(--space-unit) calc(var(--space-unit) * 2)}}@media (width >= 1152px){.searchbar{--closed-searchbar-width:190px}}@media (width >= 1366px){.searchbar .searchbar-button{border-right:1px solid #000}.suggestions{max-width:1366px;padding:var(--space-unit) calc(var(--space-unit) * 3)}}";const H=class{constructor(t){e(this,t);this.search=n(this,"search");this.resetSearch=n(this,"resetSearch")}formElement;subjectsByArea={};timer;get host(){return t(this)}showSearchbar=false;_searchQuery=undefined;suggestions=[];activeSuggestion="";showSuggestions=false;searchQuery=undefined;searchEnv=w.PROD;searchArea;onSearchQueryChange(){this._searchQuery=this.searchQuery;if(this.searchQuery){this.openSearchbar()}this.resetSuggestions()}onSearchAreaChange(){this.resetSuggestions()}onShowSearchbarChange(){if(!this.showSearchbar){this.showSuggestions=false}}onShowSuggestionsChange(){this.activeSuggestion=""}search;resetSearch;async connectedCallback(){this.subjectsByArea=await y(this.searchEnv);this.showSearchbar=!!this.searchQuery;this._searchQuery=this.searchQuery}handleOutsideClick(e){if(this.showSearchbar&&this.host&&!h(this.host,e)){this.showSearchbar=false}}handleEsc(e){if(!m(e)){return}if(this.showSuggestions){this.showSuggestions=false}else{this.showSearchbar=false}}handleTab(e){if(!l(e)){return}this.showSuggestions=false;if(!h(this.host,e)){this.showSearchbar=false}}openSearchbar(){this.showSearchbar=true;setTimeout((()=>{const e=this.host.shadowRoot.querySelector("#searchbar-input");e.focus({preventScroll:true})}),500)}resetSearchQuery(){this.searchQuery=undefined;this.resetSearch.emit()}resetSuggestions(){this.suggestions=[];this.showSuggestions=false}handleInputChange(e){this._searchQuery=e.target.value;if(!this._searchQuery){this.searchQuery=undefined}this.updateSuggestions()}updateSuggestions(){clearTimeout(this.timer);const e=(this._searchQuery||"").trim();if(e.length<3){this.resetSuggestions();return}this.timer=setTimeout((()=>{this.resetSuggestions();this.suggestions=D(e,this.subjectsByArea,this.searchArea?.toUpperCase());this.showSuggestions=true}),300)}onSearchSubmit(e){e.preventDefault();if(!this._searchQuery){return}if(this.activeSuggestion){const e=this.suggestions.find((e=>e.id===this.activeSuggestion));if(e){this.submitSuggestionSearch(e);this.showSuggestions=false;return}}this.showSearchbar=false;const t=this.search.emit({query:this._searchQuery,area:this.searchArea});if(t.defaultPrevented){return}this.formElement.submit()}submitSuggestionSearch(e){const t=this.search.emit({user_query:e.user_query,query:e.query,area:e.area,subject:e.subject});if(!t.defaultPrevented){window.location.href=e.url}}handleSuggestionsNav(e){if(!u(e)&&!d(e)){return}if(!this.suggestions.length){return}const t=this.suggestions.map((e=>e.id));if(!t.length){return}e.preventDefault();e.stopPropagation();if(!this.showSuggestions){this.showSuggestions=true}let i=null;const a=t[0];const r=t[t.length-1];const n=t.indexOf(this.activeSuggestion);if(n<0){i=u(e)?a:r}else{if(u(e)){i=t[n+1]||r}else{i=t[n-1]||a}}this.activeSuggestion=i}renderSuggestions(){const e=(e,t)=>i("span",{key:t,class:"suggestion-head","aria-hidden":"true"},e);return i("div",{class:{"suggestions-wrapper":true,hidden:!this.showSuggestions||!this.suggestions.length},onPointerOver:e=>e.preventDefault()},i("div",{id:"search-suggestions",class:"suggestions",role:"listbox","aria-label":"Seleziona tra i suggerimenti"},this.suggestions.map(((t,a)=>{const r=[];if(a===0){r.push(e("Cerca la parola","word-head"))}else if(t.subject&&!this.suggestions[a-1].subject){r.push(i("z-divider",{"aria-hidden":"true"}));r.push(e("Cerca la materia","subj-head"))}r.push(i("span",{key:a,id:t.id,class:"suggestion",role:"option","aria-label":t.aria_label,"aria-selected":this.activeSuggestion===t.id?"true":undefined,onClick:()=>this.submitSuggestionSearch(t)},i("z-icon",{name:"left-magnifying-glass"}),i("span",{"aria-hidden":"true",innerHTML:t.label})));return r}))))}render(){return i(a,{key:"9535c68b8cd3e76a55785cb993bed5026f84a589"},i("form",{key:"26271b8f9034b3ea64bbea6ff413e75d0e857612",class:{searchbar:true,"searchbar-open":this.showSearchbar},ref:e=>this.formElement=e,role:"search","aria-label":"Cerca nel sito",method:"get",action:"/ricerca",onSubmit:e=>this.onSearchSubmit(e),onReset:()=>this.resetSearchQuery()},!!this.searchArea&&i("input",{key:"90e9dc4252a02a00db5160d374bd4ea42c4dce17",type:"hidden",name:"area",value:this.searchArea}),i("div",{key:"6189f91f8cbf9086c1dcddac5a1b649065d4319c",class:"input-wrapper",role:"none"},this.searchQuery&&i("button",{key:"6292dc5e90576b49993ed15d908c675b501568d9",type:"reset","aria-label":"Svuota campo di ricerca",disabled:!this.showSearchbar,"aria-hidden":!this.showSearchbar?"true":undefined,tabIndex:!this.showSearchbar?-1:0},i("z-icon",{key:"67f07f13b459afad718d2687f5feea4271d6ec6a",name:"multiply-circled"})),i("input",{key:"ee4f88993f3bf1ba768eaf1b6ff63cd346bd552e",id:"searchbar-input",name:"q",type:"search",disabled:!this.showSearchbar,placeholder:"Cerca per parola chiave o ISBN",value:this.searchQuery,required:true,autocomplete:"off",role:"combobox","aria-autocomplete":"list","aria-expanded":this.showSuggestions?"true":"false","aria-controls":"search-suggestions","aria-activedescendant":this.activeSuggestion,"aria-label":"Cerca per parola chiave o ISBN","aria-hidden":!this.showSearchbar?"true":undefined,tabIndex:!this.showSearchbar?-1:0,onInput:e=>this.handleInputChange(e),onKeyDown:e=>{if(m(e)){e.preventDefault()}this.handleSuggestionsNav(e)}})),i("button",{key:"4e0feaeaff7bcecaf6a29409a6accac895810fdf",class:"searchbar-button","aria-label":this.showSearchbar?"Esegui ricerca":"Apri il campo di ricerca","aria-controls":"searchbar-input",type:this.showSearchbar?"submit":"button",onClick:()=>this.openSearchbar()},this.showSearchbar?null:i("span",{class:"searchbar-button-label"},"Cerca"),i("z-icon",{key:"49eec7e6f04c34df57fcf99f405d1c3ada1fcdfb",name:"search"}))),this.renderSuggestions())}static get watchers(){return{searchQuery:["onSearchQueryChange"],searchArea:["onSearchAreaChange"],showSearchbar:["onShowSearchbarChange"],showSuggestions:["onShowSuggestionsChange"]}}};H.style=q;export{o as zanit_back_to_top,z as zanit_menubar,A as zanit_mobile_menubar,H as zanit_search_form};
|
|
2
|
-
//# sourceMappingURL=p-62cc02c2.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["backToTopCss","ZanitBackTop","resizeObserver","mutationObserver","showFab","currentPageHeight","isMobile","pageMinHeight","scrollMinHeight","handleScroll","this","updateFabVisibility","handleResize","newHeight","document","body","scrollHeight","connectedCallback","ResizeObserver","observe","MutationObserver","childList","subtree","mobileMediaQuery","window","matchMedia","matches","onchange","mql","disconnectedCallback","disconnect","scrollY","scroll","scrollTo","top","behavior","render","h","Host","key","class","hidden","onClick","name","containsTarget","ancestor","event","composedPath","filter","el","some","contains","moveFocus","current","next","tabIndex","focus","preventScroll","isArrowUpKey","isArrowDownKey","isTabKey","isEscKey","DEFAULT_GROUP_KEY","DEFAULT_GROUP","id","label","getGroupedItems","items","groups","reduce","grouped","item","itemGroup","find","group","push","sort","a","b","Menu","controlledBy","currentPath","onItemKeyDown","length","isActive","includes","role","undefined","map","highlight","href","active","onKeyDown","target","SearchEnv","S3_SHOP_URL","dev","test","prod","async","getSubjectsByArea","searchEnv","response","fetch","ok","Error","status","json","err","console","error","menubarCss","menuCss","ZanitMenubar","openMenu","openNavbar","loading","data","searchQuery","PROD","searchArea","timerId","parseData","URL","fetchData","Promise","JSON","parse","Array","isArray","every","url","onItemsChange","initTabindex","onCurrentChange","split","Boolean","handleOutsideClick","host","handleKeydown","preventDefault","menuTriggerId","setTimeout","menuTrigger","shadowRoot","getElementById","handleMouseover","clearTimeout","handleMouseout","handleFocusout","relatedTarget","querySelector","cause","querySelectorAll","forEach","menubar","index","setAttribute","menuItems","menuItem","navbarItems","navbarItem","showMenu","getParentMenubarElements","itemEl","from","closest","focusPreviousItem","menubarElements","currentIndex","indexOf","prevItem","ariaHasPopup","focusNextItem","nextItem","handleItemKeydown","stopPropagation","firstItem","lastItem","pop","openItemMenu","getPreviousGroup","groupContainer","getNextGroup","firstMenuItem","handleMenuKeydown","itemElement","currentGroup","nextGroup","getAttribute","focusedItem","nextGroupItems","prevGroup","prevGroupItems","_","Fragment","onPointerOver","width","height","onResetSearch","subitem","mobileMenubarCss","ZanitMobileMenubar","lastCurrent","parentItem","menuType","open","setupData","parent","menuItemsElement","toggleMenu","type","imageAlt","link","AREA_LABELS","AREA_ORDER","Object","keys","buildSuggestions","query","subjectsByArea","selectedArea","matchingSubjectAreas","findSubjectAreas","hasSubject","subject","toUpperCase","suggestions","buildWordSuggestion","orderedSubjectAreas","area","getAreaOrder","buildSubjectSuggestion","subjectArea","user_query","buildId","buildLabel","aria_label","buildAriaLabel","buildUrl","q","buildDetail","materia","string","c","charCodeAt","toString","join","params","URLSearchParams","isSubject","cleanedQuery","cleanSearch","entries","subjects","toLowerCase","s","replace","searchFormCss","ZanitSearchForm","formElement","timer","showSearchbar","_searchQuery","activeSuggestion","showSuggestions","onSearchQueryChange","openSearchbar","resetSuggestions","onSearchAreaChange","onShowSearchbarChange","onShowSuggestionsChange","search","resetSearch","handleEsc","handleTab","searchbarInput","resetSearchQuery","emit","handleInputChange","value","updateSuggestions","trim","onSearchSubmit","suggestion","submitSuggestionSearch","searchEv","defaultPrevented","submit","ev","location","handleSuggestionsNav","options","o","nextId","firstId","lastId","currOption","renderSuggestions","renderHeading","e","k","innerHTML","searchbar","ref","method","action","onSubmit","onReset","disabled","placeholder","required","autocomplete","onInput"],"sources":["src/components/back-to-top/back-to-top.css?tag=zanit-back-to-top&encapsulation=scoped","src/components/back-to-top/back-to-top.tsx","src/utils/utils.ts","src/components/menubar/menu/menu.tsx","src/utils/subjects.api.ts","src/components/menubar/menubar.css?tag=zanit-menubar&encapsulation=shadow","src/components/menubar/menu/menu.css?tag=zanit-menubar&encapsulation=shadow","src/components/menubar/menubar.tsx","src/components/menubar/mobile-menubar/mobile-menubar.css?tag=zanit-mobile-menubar&encapsulation=shadow","src/components/menubar/menu/menu.css?tag=zanit-mobile-menubar&encapsulation=shadow","src/components/menubar/mobile-menubar/mobile-menubar.tsx","src/components/menubar/search-form/suggestions.ts","src/components/menubar/search-form/search-form.css?tag=zanit-search-form&encapsulation=shadow","src/components/menubar/search-form/search-form.tsx"],"sourcesContent":[":host {\n opacity: 1;\n transition: all 0.2s linear;\n visibility: visible;\n}\n\n:host.hidden {\n opacity: 0;\n visibility: hidden;\n}\n\n:host .z-fab {\n --color-primary01: var(--gray950);\n\n outline: 1px solid var(--color-white);\n}\n","import { Component, Element, Host, Listen, Prop, State, h } from '@stencil/core';\n\n/**\n * Back to top floating action button component.\n * Appears on scroll, given a min height for both scroll height and page height.\n */\n@Component({\n tag: 'zanit-back-to-top',\n styleUrls: ['back-to-top.css'],\n shadow: false,\n scoped: true,\n})\nexport class ZanitBackTop {\n private resizeObserver: ResizeObserver;\n private mutationObserver: MutationObserver;\n\n @Element() host: HTMLZanitBackToTopElement;\n\n /** Indicates whether the back-to-top button is visible and usable. */\n @State()\n showFab: boolean = false;\n\n /** Indicates the current height of the page. */\n @State()\n currentPageHeight: number;\n\n /** Indicates if the viewport is mobile. */\n @State()\n isMobile: boolean = false;\n\n /** Min page height from which the back-to-top button must appear. */\n @Prop()\n pageMinHeight: number = 1600;\n\n /** Min scroll height from which the back-to-top button must appear. */\n @Prop()\n scrollMinHeight: number = 800;\n\n @Listen('scroll', { target: 'window', passive: true })\n handleScroll() {\n this.updateFabVisibility();\n }\n\n private handleResize = () => {\n const newHeight = document.body.scrollHeight;\n if (newHeight !== this.currentPageHeight) {\n this.currentPageHeight = newHeight;\n this.updateFabVisibility();\n }\n };\n\n connectedCallback() {\n this.currentPageHeight = document.body.scrollHeight;\n this.resizeObserver = new ResizeObserver(this.handleResize);\n this.resizeObserver.observe(document.body);\n this.mutationObserver = new MutationObserver(this.handleResize);\n this.mutationObserver.observe(document.body, { childList: true, subtree: true });\n this.updateFabVisibility();\n\n const mobileMediaQuery = window.matchMedia('(width < 768px)');\n this.isMobile = mobileMediaQuery.matches;\n mobileMediaQuery.onchange = (mql) => {\n this.isMobile = mql.matches;\n };\n }\n\n disconnectedCallback() {\n this.resizeObserver.disconnect();\n this.mutationObserver.disconnect();\n }\n\n private updateFabVisibility() {\n this.showFab = this.currentPageHeight > this.pageMinHeight && window.scrollY > this.scrollMinHeight;\n }\n\n private scroll() {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n }\n\n render() {\n return (\n <Host\n class={{ hidden: !this.showFab }}\n aria-hidden={this.showFab ? 'false' : 'true'}\n >\n <button\n class={{ 'z-fab': true, 'z-fab-extended': !this.isMobile }}\n onClick={() => this.scroll()}\n >\n <z-icon name=\"back-top\" />\n <span>Torna su</span>\n </button>\n </Host>\n );\n }\n}\n","/**\n * Check if an element contains an event target by checking its composedPath.\n * Useful when an event target may come from a component's shadow DOM.\n */\nexport const containsTarget = (ancestor: HTMLElement, event: Event) => {\n return event\n .composedPath()\n .filter((el) => el !== document && el !== window.window)\n .some((el) => ancestor.contains(el as HTMLElement));\n};\n\n/** Move the focus to `next` element, set tabindex to 0 for `next` and -1 to `current`. */\nexport const moveFocus = (current: HTMLElement, next: HTMLElement) => {\n current.tabIndex = -1;\n next.tabIndex = 0;\n next.focus({ preventScroll: true });\n};\n\n/** Check if event key is ArrowUp */\nexport const isArrowUpKey = (event: KeyboardEvent) => event.key === 'ArrowUp';\n\n/** Check if event key is ArrowDown */\nexport const isArrowDownKey = (event: KeyboardEvent) => event.key === 'ArrowDown';\n\n/** Check if event key is Tab */\nexport const isTabKey = (event: KeyboardEvent) => event.key === 'Tab';\n\n/** Check if event key is Escape */\nexport const isEscKey = (event: KeyboardEvent) => event.key === 'Escape';\n","import { FunctionalComponent, h } from '@stencil/core';\nimport { MenuItem } from '../../../utils';\n\n/**\n * Menu of items that can be grouped.\n * @member {string} controlledBy - The HTML id of the element that controls the menu.\n * @member {MenuItem[]} items - The items to show in the menu.\n * @member {string[]} currentPath - Path of current item.\n * @member {function} onItemKeyDown - The function to call when a key is pressed from a menuitem.\n */\nexport interface MenuProps {\n controlledBy?: string;\n items?: MenuItem[];\n currentPath?: string[];\n onItemKeyDown?: (event: KeyboardEvent) => void;\n}\n\nconst DEFAULT_GROUP_KEY = 'default';\nconst DEFAULT_GROUP = {\n id: DEFAULT_GROUP_KEY,\n label: DEFAULT_GROUP_KEY,\n};\n\n/** Get the items grouped by their group. */\nconst getGroupedItems = (items: MenuItem[]) => {\n const groups = items.reduce<{ group: MenuProps['items'][number]['group']; items: MenuItem[] }[]>((grouped, item) => {\n const itemGroup = grouped.find(({ group }) => group.id === (item.group?.id || DEFAULT_GROUP.id));\n if (!itemGroup) {\n grouped.push({ group: item.group ?? DEFAULT_GROUP, items: [item] });\n } else {\n itemGroup.items.push(item);\n }\n\n return grouped;\n }, []);\n\n // Sort to keep default group at the end\n return groups.sort((a, b) => (a.group.id === DEFAULT_GROUP_KEY ? 1 : b.group.id === DEFAULT_GROUP_KEY ? -1 : 0));\n};\n\n/**\n * Floating menu component. It shows a list of items that can be grouped.\n */\nexport const Menu: FunctionalComponent<MenuProps> = ({ controlledBy, items, currentPath = [], onItemKeyDown }) => {\n if (!items?.length) {\n return null;\n }\n\n const groups = getGroupedItems(items);\n\n const isActive = (item: MenuItem) => currentPath.includes(controlledBy) && currentPath.includes(item.id);\n\n return (\n <div\n class=\"menu-wrapper\"\n role=\"none\"\n >\n <div\n class=\"menu\"\n aria-labelledby={controlledBy ?? undefined}\n role=\"menu\"\n >\n {groups.map(({ group, items }) => (\n <div class={{ group: true, highlight: items.some((item) => item.highlight) }}>\n {group.id !== DEFAULT_GROUP_KEY ? (\n <div\n class=\"group-name\"\n id={group.id}\n >\n {group.label}\n </div>\n ) : groups.length > 1 ? (\n // empty div to keep the same height as the other groups\n <div class=\"group-name\" />\n ) : null}\n <ul\n class=\"menu-list\"\n role=\"group\"\n aria-labelledby={group.id !== DEFAULT_GROUP_KEY ? group.id : undefined}\n >\n {items.map((item) => (\n <li role=\"none\">\n {item.href && (\n <a\n class={{\n 'menu-item': true,\n 'active': isActive(item),\n }}\n href={item.href}\n role=\"menuitem\"\n tabIndex={-1}\n aria-current={isActive(item) ? 'page' : 'false'}\n onKeyDown={(event) => onItemKeyDown(event)}\n target={item.target}\n >\n {item.label}\n </a>\n )}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n );\n};\n","export enum SearchEnv {\n DEV = 'dev',\n TEST = 'test',\n PROD = 'prod',\n}\n\nconst S3_SHOP_URL: Record<string, string> = {\n dev: 'https://zanichelli-shop-dev.s3.eu-west-1.amazonaws.com',\n test: 'https://zanichelli-shop-test.s3.eu-west-1.amazonaws.com',\n prod: 'https://zanichelli-shop.s3.eu-west-1.amazonaws.com',\n};\n\nexport async function getSubjectsByArea(searchEnv: SearchEnv): Promise<Record<string, string[]>> {\n try {\n const response = await fetch(`${S3_SHOP_URL[searchEnv]}/categories.json`);\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}`);\n }\n return await response.json();\n } catch (err) {\n console.error('Error fetching subjects:', err);\n return {};\n }\n}\n",":host {\n --zanit-menubar-max-width: ;\n --zanit-menubar-top-offset: ;\n\n position: relative;\n z-index: 2;\n display: flex;\n width: 100%;\n background-color: #fff;\n color: var(--gray900);\n font-family: var(--font-family-sans);\n}\n\n:host,\n*,\n::before,\n::after {\n box-sizing: border-box;\n}\n\n*:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\nul {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\na {\n color: var(--gray900);\n cursor: pointer;\n text-decoration: none;\n}\n\nbutton {\n all: unset;\n cursor: pointer;\n}\n\n:host nav {\n width: 100%;\n}\n\n.shadow-wrapper {\n position: relative;\n z-index: 1;\n display: flex;\n width: 100%;\n}\n\n.shadow-wrapper::after {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background: transparent;\n box-shadow: var(--shadow-1);\n content: '';\n pointer-events: none;\n}\n\n.width-limiter {\n position: relative;\n display: flex;\n width: 100%;\n max-width: var(--zanit-menubar-max-width, 1366px);\n margin: 0 auto;\n}\n\n.shadow-wrapper + .shadow-wrapper {\n z-index: 0;\n}\n\n.sub-menubar > ul {\n gap: 28px;\n}\n\n.width-limiter > ul,\n.sub-menubar > ul {\n position: relative;\n z-index: 3;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 0 var(--grid-margin);\n margin-right: auto;\n margin-left: auto;\n gap: 20px;\n}\n\n.shadow-wrapper > .width-limiter,\n.shadow-wrapper > ul {\n width: 100%;\n max-width: var(--zanit-menubar-max-width, 1366px);\n}\n\nul.menubar {\n height: 3rem;\n padding-right: 0;\n}\n\n.menubar z-ghost-loading {\n display: block;\n width: 120px;\n height: 1.25rem;\n}\n\n/* separator bar */\n.menubar > li[role='separator'] {\n width: 1px;\n height: 1.25rem;\n background-color: #000;\n}\n\n.menubar-item {\n position: relative;\n display: flex;\n align-items: center;\n padding: 14px 0;\n font-size: 1rem;\n gap: 8px;\n line-height: 1.25rem;\n}\n\n.menubar .menubar-item {\n text-transform: uppercase;\n}\n\n.menubar-item [data-text] {\n display: flex;\n flex-direction: column;\n}\n\n.menubar-item.active > [data-text],\n.menubar-item:hover > [data-text],\n.menubar-item:focus:focus-visible > [data-text] {\n font-weight: var(--font-bd);\n}\n\n/* To avoid size changes in the element, when it is hovered and becomes bold,\nwe put the same text already bold with height 0, so as to always occupy the maximum necessary width. */\n.menubar-item > [data-text]::after {\n height: 0;\n content: attr(data-text) / '';\n font-weight: var(--font-bd);\n letter-spacing: normal;\n pointer-events: none;\n user-select: none;\n visibility: hidden;\n}\n\n/* active item bottom border */\n.sub-menubar .menubar-item.active::after {\n position: absolute;\n z-index: -1;\n bottom: 0;\n left: -4px;\n width: calc(100% + 8px); /* the border is 4px per side larger than its container */\n height: 4px;\n background-color: var(--red500);\n content: '';\n}\n\nzanit-search-form {\n margin-left: auto;\n}\n",".menu-wrapper {\n width: 100%;\n background-color: #fff;\n}\n\n.menu {\n position: relative;\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 32px 0;\n}\n\n.menu .group {\n display: flex;\n flex-direction: column;\n}\n\n.menu .group .group-name {\n border-bottom: 1px solid currentcolor;\n margin-bottom: 4px;\n color: var(--red500);\n font-size: 0.875rem;\n font-weight: var(--font-md);\n}\n\n.menu .group .menu-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.menu .group .menu-list .menu-item {\n display: block;\n border-bottom: 2px solid transparent;\n font-size: 0.875rem;\n font-weight: var(--font-md);\n}\n\n.menu .menu-list .menu-item.active,\n.menu .menu-list .menu-item:hover {\n border-bottom-color: var(--red500);\n}\n\n.menu .group.highlight .menu-list .menu-item {\n font-size: 1rem;\n}\n\n@media (width >= 768px) {\n .menu-wrapper {\n position: absolute;\n top: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n box-shadow: var(--shadow-1);\n }\n\n .menu {\n display: grid;\n width: 100%;\n max-width: var(--zanit-menubar-max-width, 1366px);\n padding: 16px var(--grid-margin);\n gap: 0 24px;\n grid-auto-columns: minmax(0, max-content);\n grid-auto-flow: column;\n grid-template-rows: minmax(0, max-content) max-content;\n }\n\n .menu .group {\n display: grid;\n grid-row: 1 / -1;\n grid-template-columns: 1fr;\n grid-template-rows: subgrid;\n }\n\n @supports not (grid-template-rows: subgrid) {\n .menu .group {\n grid-template-rows: repeat(auto-fit, minmax(0, max-content));\n }\n }\n\n .menu .group .group-name {\n border: none;\n margin-bottom: 16px;\n }\n\n .menu .group .menu-list .menu-item {\n font-size: 1rem;\n }\n\n .menu .group.highlight .menu-list .menu-item {\n font-size: 1.5rem;\n }\n}\n","import { Component, Element, Fragment, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { MenubarItem, containsTarget, moveFocus } from '../../utils';\nimport { Menu } from './menu/menu';\nimport { SearchEnv } from '../../utils/subjects.api';\n\n/**\n * Main menubar component. Each item can have a menu with subitems\n * When a main menubar item is the current active one, a sub-menubar is shown and each subitem can have a menu with subitems.\n * @cssprop {--zanit-menubar-max-width} Maximum width of the menubar.\n */\n@Component({\n tag: 'zanit-menubar',\n styleUrls: ['menubar.css', 'menu/menu.css'],\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class ZanitMenubar {\n @Element() host: HTMLZanitMenubarElement;\n\n /** Menubar items extracted from `data`. */\n @State()\n items: MenubarItem[] = [];\n\n /** ID of the currently open menu. */\n @State()\n openMenu: string | undefined = undefined;\n\n /** ID of the item to show the subitems navbar for. */\n @State()\n openNavbar: string | undefined = undefined;\n\n /** IDs of the current prop */\n @State()\n currentPath: string[] = [];\n\n @State()\n isMobile: boolean = false;\n\n @State()\n loading: boolean = false;\n\n /** The data to build the menu (as an array of `MenubarItem` or a JSON array) or the url to fetch to retrieve it. */\n @Prop()\n data: Promise<MenubarItem[]> | MenubarItem[] | URL | string;\n\n /** Path of the current item. */\n @Prop()\n current: string | undefined = undefined;\n\n /** Initial search query. */\n @Prop({ mutable: true })\n searchQuery: string | undefined = undefined;\n\n /** Environment for search suggestions */\n @Prop() searchEnv: SearchEnv = SearchEnv.PROD;\n\n /** Search area (e.g. \"SCUOLA\", \"UNIVERSITÀ\", \"DIZIONARI\"). */\n @Prop() searchArea?: string | undefined;\n\n private timerId: number;\n\n /** Setup the list of items. */\n @Watch('data')\n async parseData(data: typeof this.data) {\n if (!data) {\n return;\n }\n\n if (data instanceof URL) {\n this.items = await this.fetchData(data);\n } else if (data instanceof Promise) {\n this.loading = true;\n this.items = await data;\n this.loading = false;\n } else if (typeof data === 'string') {\n try {\n this.items = JSON.parse(data);\n if (!Array.isArray(this.items) || !this.items?.every((item) => item satisfies MenubarItem)) {\n throw new Error('Expected an array of MenubarItem objects.');\n }\n } catch {\n let url: URL;\n try {\n url = new URL(data);\n } catch {\n throw new Error('Invalid string provided for `data` property: not a valid url or JSON.');\n }\n\n this.items = await this.fetchData(url);\n }\n } else if (Array.isArray(data) && data.every((item) => item satisfies MenubarItem)) {\n this.items = data;\n } else {\n throw new Error(\n 'Invalid `data` property value. Expected an url, a JSON or an array/promise of MenubarItem objects.'\n );\n }\n }\n\n @Watch('items')\n onItemsChange() {\n this.initTabindex();\n }\n\n @Watch('current')\n onCurrentChange() {\n this.currentPath = this.current?.split('/').filter(Boolean) || [];\n }\n\n async connectedCallback() {\n const mobileMediaQuery = window.matchMedia('(width < 768px)');\n this.isMobile = mobileMediaQuery.matches;\n mobileMediaQuery.onchange = (mql) => {\n this.isMobile = mql.matches;\n this.initTabindex();\n this.openMenu = undefined;\n };\n await this.parseData(this.data);\n this.onCurrentChange();\n this.initTabindex();\n }\n\n /** Close any open menu when clicking outside. */\n @Listen('click', { target: 'document', passive: true })\n handleOutsideClick(event: MouseEvent) {\n if (!this.openMenu || containsTarget(this.host, event)) {\n return;\n }\n\n this.openMenu = undefined;\n }\n\n /** Close any open menu when pressing Escape or Tab.\n * Uses document-level listener to ensure Escape works from any focus location within the menu.\n */\n @Listen('keydown', { target: 'document', passive: true })\n handleKeydown(event: KeyboardEvent) {\n switch (event.key) {\n case 'Escape': {\n if (this.openMenu) {\n event.preventDefault();\n // Return focus to the menu trigger after closing\n const menuTriggerId = this.openMenu;\n this.openMenu = undefined;\n // Use setTimeout(0) to defer focus until after Stencil's render cycle completes\n setTimeout(() => {\n const menuTrigger = this.host.shadowRoot.getElementById(menuTriggerId);\n if (menuTrigger) {\n menuTrigger.focus();\n }\n }, 0);\n }\n break;\n }\n case 'Tab':\n this.openMenu = undefined;\n break;\n }\n }\n\n @Listen('mouseover', { passive: true })\n handleMouseover() {\n clearTimeout(this.timerId);\n }\n\n /**\n * Automatically close any open menu on mouseout after with a little delay.\n * The delay is useful to avoid immediate closing when the pointer briefly leaves the component.\n */\n @Listen('mouseout', { passive: true })\n handleMouseout(event: MouseEvent) {\n this.timerId = window.setTimeout(() => {\n if (!this.openMenu || containsTarget(this.host, event)) {\n return;\n }\n\n this.openMenu = undefined;\n }, 500);\n }\n\n /** Close the menu when it loses focus. */\n @Listen('focusout', { passive: true })\n handleFocusout(event: FocusEvent) {\n const relatedTarget = event.relatedTarget as HTMLElement;\n if (!this.openMenu || this.host.shadowRoot.querySelector('.menu')?.contains(relatedTarget)) {\n return;\n }\n\n this.openMenu = undefined;\n }\n\n /** Fetch data from passed URL. */\n private async fetchData(url: URL) {\n try {\n this.loading = true;\n const data = await (await fetch(url)).json();\n this.loading = false;\n if (!Array.isArray(data) || !data.every((item) => item satisfies MenubarItem)) {\n throw new Error('Invalid data structure. Expected an array of MenuItem objects.');\n }\n\n return data as MenubarItem[];\n } catch (error) {\n this.loading = false;\n console.error('Error fetching menubar data:', error);\n throw new Error('Failed to fetch menubar data from the provided URL.', { cause: error });\n }\n }\n\n /** Initialize tabindex on menuitems of menubars, setting -1 to all but the first one. */\n private initTabindex() {\n setTimeout(() => {\n this.host.shadowRoot.querySelectorAll('[role=\"menubar\"]')?.forEach((menubar) => {\n menubar\n .querySelectorAll('[role=\"menuitem\"]')\n ?.forEach((item, index) => item.setAttribute('tabindex', index === 0 ? '0' : '-1'));\n });\n }, 100);\n }\n\n /** Indicates whether the element has to be highlighted by checking whether it is set as current or one of its descendants is. */\n private isActive(item: MenubarItem) {\n if (this.currentPath.length === 0) {\n return false;\n }\n\n if (this.currentPath.includes(item.id)) {\n return true;\n }\n\n if (item.menuItems?.length) {\n return item.menuItems.some((menuItem) => menuItem.id === this.current);\n }\n\n if (item.navbarItems?.length) {\n const isActive = item.navbarItems.some((navbarItem) => this.isActive(navbarItem));\n if (isActive) {\n return true;\n }\n }\n\n return false;\n }\n\n /** Opens the menu associated with the menubar `item`, if any. */\n private showMenu(item: MenubarItem) {\n this.openMenu = undefined; // close any open menu first\n if (!item.menuItems?.length) {\n return;\n }\n\n this.openMenu = item.id;\n }\n\n /** Get all elements with `menuitem` role inside parent's `menubar`. * */\n private getParentMenubarElements(itemEl: HTMLElement) {\n return Array.from(\n itemEl?.closest('[role=\"menubar\"]')?.querySelectorAll(':scope > li a[role=\"menuitem\"]') ?? []\n ) as HTMLElement[];\n }\n\n /** Move the focus to the previous menubar item, or the last one. Then open its menu if any other menu was open. */\n private focusPreviousItem(itemEl: HTMLElement) {\n this.openMenu = undefined; // close any open menu first\n const menubarElements = this.getParentMenubarElements(itemEl);\n const currentIndex = menubarElements.indexOf(itemEl);\n const prevItem = menubarElements[(currentIndex - 1 + menubarElements.length) % menubarElements.length]; // get previous item or last one\n moveFocus(itemEl, prevItem);\n // open the item's menu if any other menu was open\n if (prevItem.ariaHasPopup === 'true' && this.openMenu) {\n this.openMenu = prevItem.id;\n }\n }\n\n /** Move the focus to the next menubar item, or the first one. Then open its menu if any other menu was open. */\n private focusNextItem(itemEl: HTMLElement) {\n this.openMenu = undefined; // close any open menu first\n const menubarElements = this.getParentMenubarElements(itemEl);\n const currentIndex = menubarElements.indexOf(itemEl);\n const nextItem = menubarElements[(currentIndex + 1) % menubarElements.length]; // get next item or first one\n moveFocus(itemEl, nextItem);\n // open the item's menu if any other menu was open\n if (nextItem.ariaHasPopup === 'true' && this.openMenu) {\n this.openMenu = nextItem.id;\n }\n }\n\n /** Handles keyboard navigation on menubar items. */\n private handleItemKeydown(event: KeyboardEvent, item: MenubarItem) {\n const target = event.target as HTMLElement;\n switch (event.key) {\n case 'Home': {\n event.preventDefault();\n event.stopPropagation();\n const firstItem = this.getParentMenubarElements(target)[0];\n moveFocus(target, firstItem);\n break;\n }\n case 'End': {\n event.preventDefault();\n event.stopPropagation();\n const lastItem = this.getParentMenubarElements(target).pop();\n moveFocus(target, lastItem);\n break;\n }\n case 'ArrowUp': {\n if (!item.menuItems?.length) {\n break;\n }\n event.preventDefault();\n event.stopPropagation();\n this.openMenu = item.id;\n // focus last item of the menu\n setTimeout(() => {\n const menuItems = Array.from(\n this.host.shadowRoot.querySelectorAll(`[aria-labelledby=${item.id}] [role=\"menuitem\"]`)\n ) as HTMLElement[];\n moveFocus(target, menuItems[menuItems.length - 1]);\n }, 100);\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n event.stopPropagation();\n this.focusNextItem(target);\n break;\n }\n case 'ArrowDown': {\n if (!item.menuItems?.length) {\n break;\n }\n\n this.openItemMenu(item);\n break;\n }\n case 'ArrowLeft': {\n event.preventDefault();\n event.stopPropagation();\n this.focusPreviousItem(target);\n break;\n }\n case ' ': {\n event.preventDefault();\n event.stopPropagation();\n if (this.openMenu === item.id) {\n this.openMenu = undefined;\n break;\n } else if (item.menuItems?.length) {\n this.openItemMenu(item);\n break;\n }\n }\n }\n }\n\n /** Get the previous element with `role=group`. */\n private getPreviousGroup(groupContainer: HTMLElement) {\n const groups = Array.from(\n groupContainer?.closest('[role=\"menu\"]')?.querySelectorAll('[role=\"group\"]') ?? []\n ) as HTMLElement[];\n const currentIndex = groups.indexOf(groupContainer);\n\n return groups[currentIndex - 1];\n }\n\n /** Get the next element with `role=group`. */\n private getNextGroup(groupContainer: HTMLElement) {\n const groups = Array.from(\n groupContainer?.closest('[role=\"menu\"]')?.querySelectorAll('[role=\"group\"]') ?? []\n ) as HTMLElement[];\n const currentIndex = groups.indexOf(groupContainer);\n\n return groups[currentIndex + 1];\n }\n\n private openItemMenu(item: MenubarItem) {\n this.openMenu = item.id;\n setTimeout(() => {\n // focus first item of the menu\n const firstMenuItem = this.host.shadowRoot.querySelector(\n `[aria-labelledby=${item.id}] [role=\"menuitem\"]`\n ) as HTMLElement;\n firstMenuItem.tabIndex = 0;\n firstMenuItem.focus({ preventScroll: true });\n }, 100);\n }\n\n /** Handles keyboard navigation events from `Menu` component. */\n private handleMenuKeydown(event: KeyboardEvent) {\n const itemElement = event.target as HTMLElement;\n const items = Array.from(\n itemElement.closest('[role=\"menu\"]')?.querySelectorAll('[role=\"menuitem\"]') ?? []\n ) as HTMLElement[];\n const currentIndex = items.indexOf(itemElement);\n switch (event.key) {\n case 'ArrowUp': {\n event.preventDefault();\n event.stopPropagation();\n const prevItem = items[currentIndex - 1] || items[items.length - 1];\n moveFocus(itemElement, prevItem);\n break;\n }\n // Move the focus to the first item of the next group if any, otherwise move it to the next menubar item\n case 'ArrowRight': {\n event.preventDefault();\n event.stopPropagation();\n const currentGroup = itemElement.closest('[role=group]') as HTMLElement;\n const nextGroup = this.getNextGroup(currentGroup);\n if (!nextGroup) {\n itemElement.tabIndex = -1;\n const menuTriggerId = itemElement.closest('[role=\"menu\"][aria-labelledby]').getAttribute('aria-labelledby');\n const focusedItem = this.host.shadowRoot.getElementById(menuTriggerId);\n this.focusNextItem(focusedItem);\n break;\n }\n\n const nextGroupItems = (nextGroup.querySelectorAll('[role=\"menuitem\"]') ?? []) as HTMLElement[];\n moveFocus(itemElement, nextGroupItems[0]);\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n event.stopPropagation();\n const nextItem = items[currentIndex + 1] || items[0];\n moveFocus(itemElement, nextItem);\n break;\n }\n // Move the focus to the first item of the previous group if any, otherwise move it to the previous menubar item\n case 'ArrowLeft': {\n event.preventDefault();\n event.stopPropagation();\n const currentGroup = itemElement.closest('[role=group]') as HTMLElement;\n const prevGroup = this.getPreviousGroup(currentGroup);\n if (!prevGroup) {\n itemElement.tabIndex = -1;\n const menuTriggerId = itemElement.closest('[role=\"menu\"][aria-labelledby]').getAttribute('aria-labelledby');\n const focusedItem = this.host.shadowRoot.getElementById(menuTriggerId);\n this.focusPreviousItem(focusedItem);\n break;\n }\n\n const prevGroupItems = (prevGroup.querySelectorAll('[role=\"menuitem\"]') ?? []) as HTMLElement[];\n moveFocus(itemElement, prevGroupItems[0]);\n break;\n }\n case 'Home':\n // Move to the first menu item\n event.preventDefault();\n event.stopPropagation();\n moveFocus(itemElement, items[0]);\n break;\n case 'End':\n // Move to the last menu item\n event.preventDefault();\n event.stopPropagation();\n moveFocus(itemElement, items[items.length - 1]);\n break;\n }\n }\n\n render() {\n if (this.isMobile) {\n return (\n <zanit-mobile-menubar\n items={this.items}\n currentPath={this.currentPath}\n searchQuery={this.searchQuery}\n loading={this.loading}\n searchArea={this.searchArea}\n searchEnv={this.searchEnv}\n />\n );\n }\n\n return (\n <nav aria-label=\"Zanichelli.it\">\n <div class=\"shadow-wrapper\">\n <div class=\"width-limiter\">\n <ul\n class=\"menubar\"\n role=\"menubar\"\n aria-label=\"Zanichelli.it\"\n >\n {this.loading &&\n [...new Array(4)].map((_, index) => (\n <Fragment>\n <li role=\"none\">\n <div class=\"menubar-item\">\n <z-ghost-loading></z-ghost-loading>\n </div>\n </li>\n {index < 3 && <li role=\"separator\"></li>}\n </Fragment>\n ))}\n {this.items?.map((item, index) => (\n <Fragment>\n <li role=\"none\">\n <a\n class={{\n 'menubar-item': true,\n 'active': this.isActive(item),\n }}\n href={item.href}\n id={item.id}\n role=\"menuitem\"\n tabIndex={-1}\n aria-expanded={\n item.menuItems?.length ? (this.openMenu === item.id ? 'true' : 'false') : undefined\n }\n aria-haspopup={item.menuItems?.length ? 'true' : 'false'}\n aria-current={this.current.includes(item.id) ? 'page' : 'false'}\n onPointerOver={() => this.showMenu(item)}\n onKeyDown={(event) => this.handleItemKeydown(event, item)}\n target={item.target}\n >\n <span data-text={item.label}>{item.label}</span>\n {item.menuItems?.length > 0 && (\n <z-icon\n name={this.openMenu === item.id ? 'chevron-up' : 'chevron-down'}\n width=\"0.875rem\"\n height=\"0.875rem\"\n />\n )}\n </a>\n </li>\n {index < this.items?.length - 1 && <li role=\"separator\"></li>}\n </Fragment>\n ))}\n </ul>\n <zanit-search-form\n searchQuery={this.searchQuery}\n searchArea={this.searchArea}\n searchEnv={this.searchEnv}\n onResetSearch={() => (this.searchQuery = undefined)}\n />\n </div>\n\n {this.items.map(\n (item) =>\n this.openMenu === item.id && (\n <Menu\n controlledBy={item.id}\n items={item.menuItems}\n currentPath={this.currentPath}\n onItemKeyDown={(event) => this.handleMenuKeydown(event)}\n />\n )\n )}\n </div>\n\n {this.items\n ?.filter((item) => this.isActive(item))\n .map(\n (item) =>\n item.navbarItems?.length && (\n <nav\n class={{ 'sub-menubar': true, 'shadow-wrapper': true }}\n aria-label={`Sezioni: ${item.label}`}\n >\n <ul role=\"menubar\">\n {item.navbarItems.map((subitem) => (\n <Fragment>\n <li role=\"none\">\n <a\n class={{\n 'menubar-item': true,\n 'active': this.isActive(subitem),\n }}\n href={subitem.href}\n id={subitem.id}\n role=\"menuitem\"\n tabIndex={-1}\n aria-haspopup={subitem.menuItems?.length ? 'true' : 'false'}\n aria-expanded={\n subitem.menuItems?.length ? (this.openMenu === subitem.id ? 'true' : 'false') : undefined\n }\n aria-current={this.current.includes(subitem.id) ? 'page' : 'false'}\n onPointerOver={() => this.showMenu(subitem)}\n onKeyDown={(event) => this.handleItemKeydown(event, subitem)}\n target={item.target}\n >\n <span>{subitem.label}</span>\n {subitem.menuItems?.length > 0 && (\n <z-icon\n name={this.openMenu === subitem.id ? 'chevron-up' : 'chevron-down'}\n width=\"0.75rem\"\n height=\"0.75rem\"\n />\n )}\n </a>\n </li>\n </Fragment>\n ))}\n </ul>\n {item.navbarItems.map(\n (subitem) =>\n this.openMenu === subitem.id && (\n <Menu\n controlledBy={subitem.id}\n items={subitem.menuItems}\n currentPath={this.currentPath}\n onItemKeyDown={(event) => this.handleMenuKeydown(event)}\n />\n )\n )}\n </nav>\n )\n )}\n </nav>\n );\n }\n}\n",":host {\n position: relative;\n z-index: 2;\n display: block;\n width: 100%;\n max-width: 100%;\n height: 3rem;\n background-color: #fff;\n color: var(--gray900);\n fill: var(--gray900);\n font-family: var(--font-family-sans);\n}\n\n:host,\n*,\n::before,\n::after {\n box-sizing: border-box;\n}\n\n*:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\nul {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\na {\n color: var(--gray900);\n cursor: pointer;\n text-decoration: none;\n}\n\nbutton {\n all: unset;\n cursor: pointer;\n}\n\nnav {\n display: flex;\n width: 100%;\n align-items: center;\n padding-left: var(--grid-margin);\n gap: 8px;\n}\n\nnav::after {\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background: transparent;\n box-shadow: var(--shadow-1);\n content: '';\n pointer-events: none;\n}\n\nz-logo {\n margin: 8px 0;\n}\n\n.mobile-menu {\n position: absolute;\n top: 100%;\n left: 0;\n display: flex;\n overflow: auto;\n width: 100%;\n max-height: calc(100vh - 48px - var(--zanit-menubar-top-offset, 0px));\n flex-direction: column;\n padding: 16px var(--grid-margin) 32px;\n background-color: #fff;\n box-shadow: var(--shadow-2);\n gap: 8px;\n}\n\n.mobile-menu li {\n width: 100%;\n}\n\n.mobile-menu .items-container {\n display: flex;\n min-height: 256px;\n flex-direction: column;\n gap: 8px;\n}\n\n.mobile-menu .items-container z-ghost-loading {\n width: 40%;\n height: 1.2rem;\n}\n\n.mobile-menu .items-container .menubar-item {\n display: block;\n width: 100%;\n padding: 8px 0;\n font-size: 1rem;\n text-align: left;\n}\n\n.mobile-menu .items-container li:not(:last-child) .menubar-item {\n border-bottom: 1px solid #000;\n}\n\n[role='menuitem'].parent {\n display: flex;\n width: fit-content;\n align-items: center;\n padding: 0;\n border: none;\n font-size: 0.875rem;\n gap: 8px;\n}\n\nzanit-search-form {\n margin-left: auto;\n}\n",".menu-wrapper {\n width: 100%;\n background-color: #fff;\n}\n\n.menu {\n position: relative;\n display: flex;\n width: 100%;\n flex-direction: column;\n gap: 32px 0;\n}\n\n.menu .group {\n display: flex;\n flex-direction: column;\n}\n\n.menu .group .group-name {\n border-bottom: 1px solid currentcolor;\n margin-bottom: 4px;\n color: var(--red500);\n font-size: 0.875rem;\n font-weight: var(--font-md);\n}\n\n.menu .group .menu-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.menu .group .menu-list .menu-item {\n display: block;\n border-bottom: 2px solid transparent;\n font-size: 0.875rem;\n font-weight: var(--font-md);\n}\n\n.menu .menu-list .menu-item.active,\n.menu .menu-list .menu-item:hover {\n border-bottom-color: var(--red500);\n}\n\n.menu .group.highlight .menu-list .menu-item {\n font-size: 1rem;\n}\n\n@media (width >= 768px) {\n .menu-wrapper {\n position: absolute;\n top: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n box-shadow: var(--shadow-1);\n }\n\n .menu {\n display: grid;\n width: 100%;\n max-width: var(--zanit-menubar-max-width, 1366px);\n padding: 16px var(--grid-margin);\n gap: 0 24px;\n grid-auto-columns: minmax(0, max-content);\n grid-auto-flow: column;\n grid-template-rows: minmax(0, max-content) max-content;\n }\n\n .menu .group {\n display: grid;\n grid-row: 1 / -1;\n grid-template-columns: 1fr;\n grid-template-rows: subgrid;\n }\n\n @supports not (grid-template-rows: subgrid) {\n .menu .group {\n grid-template-rows: repeat(auto-fit, minmax(0, max-content));\n }\n }\n\n .menu .group .group-name {\n border: none;\n margin-bottom: 16px;\n }\n\n .menu .group .menu-list .menu-item {\n font-size: 1rem;\n }\n\n .menu .group.highlight .menu-list .menu-item {\n font-size: 1.5rem;\n }\n}\n","import { Component, Element, h, Listen, Prop, State, Watch } from '@stencil/core';\nimport { MenubarItem, MenuItem } from '../../../utils';\nimport { Menu } from '../menu/menu';\nimport { containsTarget, moveFocus } from '../../../utils';\nimport { SearchEnv } from '../../../utils/subjects.api';\n\n/** Mobile menubar component. */\n@Component({\n tag: 'zanit-mobile-menubar',\n styleUrls: ['mobile-menubar.css', '../menu/menu.css'],\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class ZanitMobileMenubar {\n @Element() host: HTMLZanitMobileMenubarElement;\n\n /** IDs path of the current item. */\n @Prop() currentPath: string[] = [];\n\n /** Menubar items. */\n @Prop() items: MenubarItem[] = [];\n\n /** Initial search query. */\n @Prop({ mutable: true }) searchQuery: string | undefined = undefined;\n\n /** Whether the menubar is loading the data. */\n @Prop() loading: boolean = false;\n\n /** Environment for search suggestions */\n @Prop() searchEnv: SearchEnv = SearchEnv.PROD;\n\n /** Search area (e.g. \"SCUOLA\", \"UNIVERSITÀ\", \"DIZIONARI\"). */\n @Prop() searchArea?: string | undefined;\n\n /** Last active item ID. */\n @State() lastCurrent: string | undefined = undefined;\n @State() parentItem: MenubarItem | undefined = undefined;\n @State() menuItems: MenubarItem[] | MenuItem[] | undefined = undefined;\n /** Whether the items to render come from a menubar or a menu. */\n @State() menuType: 'menubar' | 'menu' | undefined = undefined;\n @State() open: boolean;\n\n @Watch('items')\n @Watch('currentPath')\n onItemsChange() {\n this.lastCurrent = this.currentPath?.length ? this.currentPath[this.currentPath.length - 1] : undefined;\n this.setupData(this.items);\n }\n\n /**\n * Find the current item and take its parent, `menuItems` or the `navbarItems`.\n */\n private setupData(items: MenubarItem[], parent?: MenubarItem) {\n // If no current item is defined, we show all items\n if (this.lastCurrent === undefined) {\n this.parentItem = undefined;\n this.menuType = 'menubar';\n this.menuItems = items;\n return;\n }\n\n for (const item of items) {\n if (item.id === this.lastCurrent) {\n this.parentItem = parent;\n this.menuType = item.menuItems?.length ? 'menu' : 'menubar';\n this.menuItems = item.menuItems || item.navbarItems;\n return;\n }\n\n if (\n this.currentPath.length > 1 &&\n item.id === this.currentPath[this.currentPath.length - 2] &&\n item.menuItems?.some(({ id }) => id === this.lastCurrent)\n ) {\n this.parentItem = item;\n this.menuType = item.menuItems?.length ? 'menu' : 'menubar';\n this.menuItems = item.menuItems || item.navbarItems;\n return;\n }\n\n if (item.navbarItems?.length) {\n this.setupData(item.navbarItems, item);\n }\n }\n }\n\n private get menuItemsElement() {\n return Array.from(this.host.shadowRoot.querySelectorAll('[role=\"menuitem\"]')) as HTMLElement[];\n }\n\n /** Initialize tabindex on menuitems, setting -1 to all but the first one. */\n private initTabindex() {\n this.menuItemsElement.forEach((item, index) => item.setAttribute('tabindex', index === 0 ? '0' : '-1'));\n }\n\n private toggleMenu() {\n if (this.open) {\n this.open = false;\n } else {\n this.open = true;\n setTimeout(() => {\n this.initTabindex();\n this.menuItemsElement[0]?.focus({ preventScroll: true });\n }, 200);\n }\n }\n\n /** Handles keyboard navigation on mobile menu. */\n private handleItemKeydown(event: KeyboardEvent) {\n switch (event.key) {\n case 'ArrowUp': {\n event.preventDefault();\n event.stopPropagation();\n const items = this.menuItemsElement;\n const currentIndex = items.indexOf(event.target as HTMLElement);\n const prevItem = items[(currentIndex - 1 + items.length) % items.length];\n moveFocus(items[currentIndex], prevItem);\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n event.stopPropagation();\n const items = this.menuItemsElement;\n const currentIndex = items.indexOf(event.target as HTMLElement);\n const nextItem = items[(currentIndex + 1) % items.length];\n moveFocus(items[currentIndex], nextItem);\n break;\n }\n case 'Home': {\n event.preventDefault();\n event.stopPropagation();\n moveFocus(event.target as HTMLElement, this.menuItemsElement[0]);\n break;\n }\n case 'End': {\n event.preventDefault();\n event.stopPropagation();\n moveFocus(event.target as HTMLElement, this.menuItemsElement.pop());\n break;\n }\n }\n }\n\n connectedCallback() {\n this.lastCurrent = this.currentPath?.length ? this.currentPath[this.currentPath.length - 1] : undefined;\n this.setupData(this.items);\n }\n\n /** Close the menu when clicking outside. */\n @Listen('click', { target: 'document', passive: true })\n handleOutsideClick(event: MouseEvent) {\n if (containsTarget(this.host, event)) {\n return;\n }\n\n this.open = false;\n }\n\n /** Close the menu when pressing Escape or Tab. */\n @Listen('keydown', { passive: true })\n handleKeydown(event: KeyboardEvent) {\n switch (event.key) {\n case 'Escape':\n this.open = false;\n break;\n case 'Tab':\n if (containsTarget(this.host, event)) {\n break;\n }\n\n this.open = false;\n break;\n }\n }\n\n /** Close the menu when the focus goes out. */\n @Listen('focusin', { target: 'document', passive: true })\n handleFocusout(event: FocusEvent) {\n if (containsTarget(this.host, event)) {\n return;\n }\n\n this.open = false;\n }\n\n render() {\n return (\n <nav aria-label=\"Zanichelli.it\">\n <button\n class=\"burger-button\"\n type=\"button\"\n aria-expanded={this.open ? 'true' : 'false'}\n aria-controls=\"mobile-menu\"\n aria-label={this.open ? 'Chiudi menù' : 'Apri menù'}\n onClick={() => this.toggleMenu()}\n >\n <z-icon\n name={this.open ? 'multiply' : 'burger-menu'}\n width=\"1.5rem\"\n height=\"1.5rem\"\n ></z-icon>\n </button>\n\n <z-logo\n imageAlt=\"Logo Zanichelli\"\n link=\"/\"\n height={32}\n width={126}\n ></z-logo>\n\n <zanit-search-form\n searchQuery={this.searchQuery}\n onResetSearch={() => (this.searchQuery = undefined)}\n searchArea={this.searchArea}\n searchEnv={this.searchEnv}\n />\n\n {this.open && (\n <ul\n class=\"mobile-menu\"\n role=\"menubar\"\n >\n {!this.loading && this.currentPath && this.currentPath.length > 0 && (\n <li role=\"none\">\n <a\n class=\"parent\"\n href={this.parentItem?.href ?? '/'}\n id={this.parentItem?.id ?? undefined}\n role=\"menuitem\"\n tabIndex={-1}\n onKeyDown={(event) => this.handleItemKeydown(event)}\n target={this.parentItem?.target}\n >\n <z-icon\n name=\"arrow-left\"\n width=\"0.5rem\"\n height=\"0.5rem\"\n ></z-icon>\n <span>\n {/* Show the 'Home' label if the current item is a root child. */}\n {this.parentItem?.label || 'Home'}\n </span>\n </a>\n </li>\n )}\n\n {this.loading ? (\n <div\n class=\"items-container\"\n role=\"none\"\n >\n {[...new Array(4)].map(() => (\n <li role=\"none\">\n <div\n class=\"menubar-item\"\n role=\"none\"\n >\n <z-ghost-loading></z-ghost-loading>\n </div>\n </li>\n ))}\n </div>\n ) : this.menuType === 'menu' ? (\n <Menu\n items={this.menuItems}\n controlledBy={this.parentItem?.id}\n currentPath={this.currentPath}\n onItemKeyDown={(event) => this.handleItemKeydown(event)}\n />\n ) : (\n this.menuItems?.length > 0 && (\n <div\n class=\"items-container\"\n role=\"none\"\n >\n {this.menuItems.map((item) => (\n <li role=\"none\">\n <a\n class={{\n 'menu-item': this.menuType === 'menu',\n 'menubar-item': this.menuType === 'menubar',\n }}\n href={item.href}\n id={item.id}\n role=\"menuitem\"\n aria-current={this.lastCurrent === item.id ? 'page' : 'false'}\n tabIndex={-1}\n onKeyDown={(event) => this.handleItemKeydown(event)}\n target={item.target}\n >\n <span data-text={item.label}>{item.label}</span>\n </a>\n </li>\n ))}\n </div>\n )\n )}\n </ul>\n )}\n </nav>\n );\n }\n}\n","enum AREA_LABELS {\n SCUOLA = 'Scuola',\n UNIVERSITÀ = 'Università',\n GIURIDICO = 'Giuridico',\n DIZIONARI = 'Dizionari',\n SAGGISTICA = 'Saggistica',\n}\n\nconst AREA_ORDER = Object.keys(AREA_LABELS);\n\nexport type SearchSuggestion = {\n id: string;\n label: string;\n aria_label: string;\n url: string;\n user_query: string;\n query?: string;\n area?: string;\n subject?: string;\n};\n\nexport function buildSuggestions(\n query: string,\n subjectsByArea: Record<string, string[]>,\n selectedArea?: string\n): SearchSuggestion[] {\n const matchingSubjectAreas = findSubjectAreas(query, subjectsByArea);\n const hasSubject = matchingSubjectAreas.length > 0;\n const subject = hasSubject ? query.toUpperCase() : undefined;\n\n const suggestions: SearchSuggestion[] = [];\n\n if (selectedArea) suggestions.push(buildWordSuggestion(query, selectedArea));\n\n suggestions.push(buildWordSuggestion(query));\n\n if (hasSubject) {\n if (selectedArea) {\n const orderedSubjectAreas = [\n ...matchingSubjectAreas.filter((area) => area === selectedArea),\n ...matchingSubjectAreas\n .filter((area) => area !== selectedArea)\n .sort((a, b) => getAreaOrder(a) - getAreaOrder(b)),\n ];\n orderedSubjectAreas.forEach((area) => suggestions.push(buildSubjectSuggestion(query, area, subject)));\n } else {\n matchingSubjectAreas\n .sort((a, b) => getAreaOrder(a) - getAreaOrder(b))\n .forEach((subjectArea) => suggestions.push(buildSubjectSuggestion(query, subjectArea, subject)));\n }\n }\n\n return suggestions;\n}\n\nconst buildWordSuggestion = (user_query: string, area?: string): SearchSuggestion => {\n return {\n id: buildId(`word-${user_query}-${area}`),\n label: buildLabel(user_query, area),\n aria_label: buildAriaLabel(user_query, area, false),\n url: buildUrl({ q: user_query, ...(area ? { area } : {}), user_query }),\n ...buildDetail(user_query, user_query, area),\n };\n};\n\nconst buildSubjectSuggestion = (user_query: string, area: string, subject: string): SearchSuggestion => {\n return {\n id: buildId(`subj-${user_query}-${area}-${subject}`),\n label: buildLabel(user_query, area),\n aria_label: buildAriaLabel(user_query, area, true),\n url: buildUrl({ area, materia: subject, user_query }),\n ...buildDetail(user_query, undefined, area, subject),\n };\n};\n\nconst buildId = (string: string) =>\n string\n .split('')\n .map((c) => c.charCodeAt(0).toString(16))\n .join('');\n\nconst buildUrl = (params: Record<string, string>): string => {\n return `/ricerca?${new URLSearchParams(params).toString()}`;\n};\n\nconst buildDetail = (user_query: string, query?: string, area?: string, subject?: string) => ({\n user_query,\n ...(query ? { query } : {}),\n ...(area ? { area } : {}),\n ...(subject ? { subject } : {}),\n});\n\nconst buildLabel = (user_query: string, area?: string) => {\n return `<mark>${user_query}</mark> in <strong>${area ? `${AREA_LABELS[area] ?? area}` : `tutto il sito`}</strong>`;\n};\n\nconst buildAriaLabel = (user_query: string, area?: string, isSubject: boolean = false) => {\n return `Cerca la ${isSubject ? `materia` : `parola`} ${user_query} ${area ? `nel catalogo ${AREA_LABELS[area] ?? area}` : `in tutto il sito`}`;\n};\n\nfunction findSubjectAreas(query: string, subjectsByArea: Record<string, string[]>): string[] {\n const cleanedQuery = cleanSearch(query);\n return Object.entries(subjectsByArea)\n .filter(([, subjects]) => subjects.some((subject) => subject.toLowerCase() === cleanedQuery))\n .map(([area]) => area);\n}\n\n/** Clear search string: lowercase, remove multiple spaces */\nconst cleanSearch = (s: string) => s.toLowerCase().replace(/\\s+/g, ' ');\n\nconst getAreaOrder = (area: string) => {\n const index = AREA_ORDER.indexOf(area);\n return index >= 0 ? index : 100;\n};\n",":host,\n*,\n::before,\n::after {\n box-sizing: border-box;\n}\n\n*:focus:focus-visible {\n box-shadow: var(--shadow-focus-primary);\n outline: none;\n}\n\nbutton {\n all: unset;\n cursor: pointer;\n}\n\n.searchbar {\n --searchbar-button-x-padding: 14px;\n --searchbar-button-icon-width: 1.75rem;\n\n /* button horizontal padding + icon size + left border */\n --closed-searchbar-width: calc((var(--searchbar-button-x-padding) * 2) + var(--searchbar-button-icon-width) + 1px);\n\n position: absolute;\n z-index: 5;\n top: 0;\n right: 0;\n display: flex;\n width: var(--closed-searchbar-width);\n height: 3rem;\n justify-content: flex-end;\n transition: width 0.4s ease-in-out;\n}\n\n.searchbar.searchbar-open {\n width: 100%;\n}\n\n.searchbar .input-wrapper {\n display: flex;\n overflow: hidden;\n width: 100%;\n align-items: center;\n padding: 8px;\n padding-left: var(--grid-margin);\n background-color: #fff;\n gap: 8px;\n transition-duration: 0.4s;\n transition-property: padding-right, padding-left, width;\n transition-timing-function: ease-in-out;\n}\n\n.searchbar:not(.searchbar-open) .input-wrapper {\n overflow: hidden;\n width: 0;\n padding: 0;\n}\n\n.searchbar button[type='reset'] {\n --z-icon-width: 1rem;\n --z-icon-height: 1rem;\n\n display: flex;\n align-items: center;\n cursor: pointer;\n}\n\n.searchbar input {\n z-index: 1;\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n background-color: #fff;\n font-family: var(--font-family-sans);\n font-size: 1rem;\n}\n\n.searchbar.searchbar-open input:first-child {\n padding-left: 4px;\n margin-left: -4px; /* per evitare che la focus shadow vada fuori dallo schermo */\n}\n\n.searchbar input[type='search']::-webkit-search-cancel-button,\n.searchbar input[type='search']::-webkit-search-decoration {\n appearance: none;\n}\n\n.searchbar input::placeholder {\n color: var(--gray500);\n}\n\n.searchbar .searchbar-button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 10px var(--searchbar-button-x-padding);\n border-left: 1px solid #000;\n background: var(--zanit-accent-color);\n font-family: inherit;\n font-size: inherit;\n gap: 64px;\n line-height: 1;\n}\n\n.searchbar .searchbar-button:focus-visible {\n z-index: 1;\n}\n\n.searchbar-button z-icon {\n --z-icon-width: var(--searchbar-button-icon-width);\n --z-icon-height: var(--searchbar-button-icon-width);\n}\n\n.suggestions-wrapper {\n position: absolute;\n z-index: 4;\n top: 3rem;\n left: 50%;\n width: 100vw;\n border-top: 1px solid var(--gray200);\n margin-left: -50vw;\n background: #fff;\n box-shadow: var(--shadow-1);\n}\n\n.suggestions-wrapper.hidden {\n display: none;\n}\n\n.suggestions {\n display: flex;\n width: 100%;\n flex-direction: column;\n align-items: stretch;\n padding: var(--space-unit);\n margin: 0 auto;\n}\n\n.suggestion-head {\n padding: calc(var(--space-unit) * 0.75) var(--space-unit);\n color: var(--gray700);\n font-size: 0.875rem;\n font-weight: var(--font-md);\n line-height: 1.125rem;\n}\n\n.suggestion {\n display: flex;\n padding: calc(var(--space-unit) * 0.75) var(--space-unit);\n color: var(--gray900);\n cursor: pointer;\n font-size: 1rem;\n gap: var(--space-unit);\n line-height: 1.5rem;\n}\n\n.suggestion:hover,\n.suggestion[aria-selected='true'] {\n background: var(--gray100);\n}\n\n.suggestion strong {\n font-weight: var(--font-bd);\n}\n\n.suggestion mark {\n background-color: var(--red50);\n}\n\n.suggestion z-icon {\n --z-icon-height: 1.125rem;\n\n margin-top: 0.125rem;\n}\n\n.suggestions z-divider {\n margin: var(--space-unit) 0;\n}\n\n@media (width < 1152px) {\n .searchbar .searchbar-button > .searchbar-button-label {\n display: none;\n }\n}\n\n@media (width >= 768px) {\n .searchbar {\n --searchbar-button-x-padding: 16px;\n --searchbar-button-icon-width: 2rem;\n }\n\n .searchbar .input-wrapper {\n gap: 14px;\n }\n\n .searchbar button[type='reset'] {\n --z-icon-width: 1.5rem;\n --z-icon-height: 1.5rem;\n }\n\n .searchbar input,\n .searchbar .searchbar-button {\n font-size: 1.5rem;\n }\n\n .searchbar .searchbar-button {\n padding: 8px var(--searchbar-button-x-padding);\n }\n\n .suggestions {\n padding: var(--space-unit) calc(var(--space-unit) * 2);\n }\n}\n\n@media (width >= 1152px) {\n .searchbar {\n --closed-searchbar-width: 190px;\n }\n}\n\n@media (width >= 1366px) {\n .searchbar .searchbar-button {\n border-right: 1px solid #000;\n }\n\n .suggestions {\n max-width: 1366px;\n padding: var(--space-unit) calc(var(--space-unit) * 3);\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, State, Watch } from '@stencil/core';\nimport { containsTarget, isArrowDownKey, isArrowUpKey, isEscKey, isTabKey, SearchEvent } from '../../../utils';\nimport { getSubjectsByArea, SearchEnv } from '../../../utils/subjects.api';\nimport { buildSuggestions, SearchSuggestion } from './suggestions';\n\n@Component({\n tag: 'zanit-search-form',\n styleUrl: 'search-form.css',\n shadow: true,\n})\nexport class ZanitSearchForm {\n private formElement: HTMLFormElement;\n private subjectsByArea: Record<string, string[]> = {};\n private timer: NodeJS.Timeout;\n\n @Element() host: HTMLZanitSearchFormElement;\n\n /** Indicates whether the searchbar is visible and usable. */\n @State()\n showSearchbar: boolean = false;\n\n /** Search query to apply. */\n @State()\n _searchQuery: string | undefined = undefined;\n\n /** Search suggestions to show in the autocomplete dropdown. */\n @State() suggestions: SearchSuggestion[] = [];\n\n /** Active suggestion - used for keyboard navigation */\n @State() activeSuggestion: string = '';\n\n /** Show suggestions list */\n @State() showSuggestions: boolean = false;\n\n /** Initial search query */\n @Prop({ mutable: true })\n searchQuery: string | undefined = undefined;\n\n /** Environment for search suggestions */\n @Prop() searchEnv: SearchEnv = SearchEnv.PROD;\n\n /** Search area (e.g. \"SCUOLA\", \"UNIVERSITÀ\", \"DIZIONARI\"). */\n @Prop() searchArea?: string | undefined;\n\n @Watch('searchQuery')\n onSearchQueryChange() {\n this._searchQuery = this.searchQuery;\n if (this.searchQuery) {\n this.openSearchbar();\n }\n this.resetSuggestions();\n }\n\n @Watch('searchArea')\n onSearchAreaChange() {\n this.resetSuggestions();\n }\n\n @Watch('showSearchbar')\n onShowSearchbarChange() {\n if (!this.showSearchbar) {\n this.showSuggestions = false;\n }\n }\n\n @Watch('showSuggestions')\n onShowSuggestionsChange() {\n this.activeSuggestion = '';\n }\n\n /** Emitted on search form submission. */\n @Event({ cancelable: true }) search: EventEmitter<SearchEvent>;\n\n @Event() resetSearch: EventEmitter<void>;\n\n async connectedCallback() {\n this.subjectsByArea = await getSubjectsByArea(this.searchEnv);\n this.showSearchbar = !!this.searchQuery;\n this._searchQuery = this.searchQuery;\n }\n\n /** Close open searchbar when clicking outside. */\n @Listen('click', { target: 'document', passive: true })\n handleOutsideClick(event: MouseEvent) {\n if (this.showSearchbar && this.host && !containsTarget(this.host, event)) {\n this.showSearchbar = false;\n }\n }\n\n /** Close the searchbar/suggestions when pressing Escape. */\n @Listen('keydown', { passive: true })\n handleEsc(event: KeyboardEvent) {\n if (!isEscKey(event)) {\n return;\n }\n\n if (this.showSuggestions) {\n this.showSuggestions = false;\n } else {\n this.showSearchbar = false;\n }\n }\n\n /** Close the searchbar/suggestions when pressing Tab. */\n @Listen('keyup', { target: 'document', passive: true })\n handleTab(event: KeyboardEvent) {\n if (!isTabKey(event)) {\n return;\n }\n\n this.showSuggestions = false;\n\n if (!containsTarget(this.host, event)) {\n this.showSearchbar = false;\n }\n }\n\n private openSearchbar() {\n this.showSearchbar = true;\n setTimeout(() => {\n const searchbarInput = this.host.shadowRoot.querySelector('#searchbar-input') as HTMLInputElement;\n searchbarInput.focus({ preventScroll: true });\n }, 500);\n }\n\n private resetSearchQuery() {\n this.searchQuery = undefined;\n this.resetSearch.emit();\n }\n\n private resetSuggestions() {\n this.suggestions = [];\n this.showSuggestions = false;\n }\n\n private handleInputChange(event: InputEvent) {\n this._searchQuery = (event.target as HTMLInputElement).value;\n if (!this._searchQuery) {\n this.searchQuery = undefined;\n }\n\n this.updateSuggestions();\n }\n\n private updateSuggestions() {\n clearTimeout(this.timer);\n\n const query = (this._searchQuery || '').trim();\n\n if (query.length < 3) {\n this.resetSuggestions();\n return;\n }\n\n this.timer = setTimeout(() => {\n this.resetSuggestions();\n this.suggestions = buildSuggestions(query, this.subjectsByArea, this.searchArea?.toUpperCase());\n this.showSuggestions = true;\n }, 300);\n }\n\n private onSearchSubmit(event: Event) {\n event.preventDefault();\n if (!this._searchQuery) {\n return;\n }\n\n if (this.activeSuggestion) {\n const suggestion = this.suggestions.find((s) => s.id === this.activeSuggestion);\n if (suggestion) {\n this.submitSuggestionSearch(suggestion);\n this.showSuggestions = false;\n return;\n }\n }\n\n this.showSearchbar = false;\n\n const searchEv = this.search.emit({ query: this._searchQuery, area: this.searchArea });\n // do not submit the form if the event default behavior was prevented\n if (searchEv.defaultPrevented) {\n return;\n }\n\n this.formElement.submit();\n }\n\n private submitSuggestionSearch(suggestion: SearchSuggestion) {\n const ev = this.search.emit({\n user_query: suggestion.user_query,\n query: suggestion.query,\n area: suggestion.area,\n subject: suggestion.subject,\n });\n if (!ev.defaultPrevented) {\n window.location.href = suggestion.url;\n }\n }\n\n private handleSuggestionsNav(event: KeyboardEvent) {\n if (!isArrowDownKey(event) && !isArrowUpKey(event)) {\n return;\n }\n\n if (!this.suggestions.length) {\n return;\n }\n\n const options = this.suggestions.map((o) => o.id);\n\n if (!options.length) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (!this.showSuggestions) {\n this.showSuggestions = true;\n }\n\n let nextId = null;\n const firstId = options[0];\n const lastId = options[options.length - 1];\n const currOption = options.indexOf(this.activeSuggestion);\n if (currOption < 0) {\n nextId = isArrowDownKey(event) ? firstId : lastId;\n } else {\n if (isArrowDownKey(event)) {\n nextId = options[currOption + 1] || lastId;\n } else {\n nextId = options[currOption - 1] || firstId;\n }\n }\n this.activeSuggestion = nextId;\n }\n\n private renderSuggestions() {\n const renderHeading = (label: string, key: string) => (\n <span\n key={key}\n class=\"suggestion-head\"\n aria-hidden=\"true\"\n >\n {label}\n </span>\n );\n\n return (\n <div\n class={{ 'suggestions-wrapper': true, 'hidden': !this.showSuggestions || !this.suggestions.length }}\n onPointerOver={(e) => e.preventDefault()}\n >\n <div\n id=\"search-suggestions\"\n class=\"suggestions\"\n role=\"listbox\"\n aria-label=\"Seleziona tra i suggerimenti\"\n >\n {this.suggestions.map((suggestion, k) => {\n const items = [];\n\n if (k === 0) {\n items.push(renderHeading('Cerca la parola', 'word-head'));\n } else if (suggestion.subject && !this.suggestions[k - 1].subject) {\n items.push(<z-divider aria-hidden=\"true\" />);\n items.push(renderHeading('Cerca la materia', 'subj-head'));\n }\n\n items.push(\n <span\n key={k}\n id={suggestion.id}\n class=\"suggestion\"\n role=\"option\"\n aria-label={suggestion.aria_label}\n aria-selected={this.activeSuggestion === suggestion.id ? 'true' : undefined}\n onClick={() => this.submitSuggestionSearch(suggestion)}\n >\n <z-icon name=\"left-magnifying-glass\" />\n <span\n aria-hidden=\"true\"\n innerHTML={suggestion.label}\n />\n </span>\n );\n\n return items;\n })}\n </div>\n </div>\n );\n }\n\n render() {\n return (\n <Host>\n <form\n class={{ 'searchbar': true, 'searchbar-open': this.showSearchbar }}\n ref={(el) => (this.formElement = el)}\n role=\"search\"\n aria-label=\"Cerca nel sito\"\n method=\"get\"\n action=\"/ricerca\"\n onSubmit={(event) => this.onSearchSubmit(event)}\n onReset={() => this.resetSearchQuery()}\n >\n {!!this.searchArea && (\n <input\n type=\"hidden\"\n name=\"area\"\n value={this.searchArea}\n />\n )}\n\n <div\n class=\"input-wrapper\"\n role=\"none\"\n >\n {this.searchQuery && (\n <button\n type=\"reset\"\n aria-label=\"Svuota campo di ricerca\"\n disabled={!this.showSearchbar}\n aria-hidden={!this.showSearchbar ? 'true' : undefined}\n tabIndex={!this.showSearchbar ? -1 : 0}\n >\n <z-icon name=\"multiply-circled\" />\n </button>\n )}\n <input\n id=\"searchbar-input\"\n name=\"q\"\n type=\"search\"\n disabled={!this.showSearchbar}\n placeholder=\"Cerca per parola chiave o ISBN\"\n value={this.searchQuery}\n required\n autocomplete=\"off\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={this.showSuggestions ? 'true' : 'false'}\n aria-controls=\"search-suggestions\"\n aria-activedescendant={this.activeSuggestion}\n aria-label=\"Cerca per parola chiave o ISBN\"\n aria-hidden={!this.showSearchbar ? 'true' : undefined}\n tabIndex={!this.showSearchbar ? -1 : 0}\n onInput={(event) => this.handleInputChange(event)}\n onKeyDown={(e) => {\n // INFO: prevent ESC from clearing input\n if (isEscKey(e)) {\n e.preventDefault();\n }\n\n this.handleSuggestionsNav(e);\n }}\n />\n </div>\n\n <button\n class=\"searchbar-button\"\n aria-label={this.showSearchbar ? 'Esegui ricerca' : 'Apri il campo di ricerca'}\n aria-controls=\"searchbar-input\"\n type={this.showSearchbar ? 'submit' : 'button'}\n onClick={() => this.openSearchbar()}\n >\n {this.showSearchbar ? null : <span class=\"searchbar-button-label\">Cerca</span>}\n <z-icon name=\"search\"></z-icon>\n </button>\n </form>\n\n {this.renderSuggestions()}\n </Host>\n );\n }\n}\n"],"mappings":"uEAAA,MAAMA,EAAe,wQ,MCYRC,EAAY,M,yBACfC,eACAC,iB,0BAMRC,QAAmB,MAInBC,kBAIAC,SAAoB,MAIpBC,cAAwB,KAIxBC,gBAA0B,IAG1B,YAAAC,GACEC,KAAKC,qB,CAGCC,aAAe,KACrB,MAAMC,EAAYC,SAASC,KAAKC,aAChC,GAAIH,IAAcH,KAAKL,kBAAmB,CACxCK,KAAKL,kBAAoBQ,EACzBH,KAAKC,qB,GAIT,iBAAAM,GACEP,KAAKL,kBAAoBS,SAASC,KAAKC,aACvCN,KAAKR,eAAiB,IAAIgB,eAAeR,KAAKE,cAC9CF,KAAKR,eAAeiB,QAAQL,SAASC,MACrCL,KAAKP,iBAAmB,IAAIiB,iBAAiBV,KAAKE,cAClDF,KAAKP,iBAAiBgB,QAAQL,SAASC,KAAM,CAAEM,UAAW,KAAMC,QAAS,OACzEZ,KAAKC,sBAEL,MAAMY,EAAmBC,OAAOC,WAAW,mBAC3Cf,KAAKJ,SAAWiB,EAAiBG,QACjCH,EAAiBI,SAAYC,IAC3BlB,KAAKJ,SAAWsB,EAAIF,OAAO,C,CAI/B,oBAAAG,GACEnB,KAAKR,eAAe4B,aACpBpB,K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iCAAgC,eAC7B9P,KAAK4P,cAAgB,OAAS/K,UAC5ChC,UAAW7C,KAAK4P,eAAgB,EAAK,EACrCmD,QAAU3Q,GAAUpC,KAAK6Q,kBAAkBzO,GAC3C8C,UAAYgN,IAEV,GAAI/O,EAAS+O,GAAI,CACfA,EAAEhK,gB,CAGJlI,KAAKyR,qBAAqBS,EAAE,KAKlCvQ,EAAA,UAAAE,IAAA,2CACEC,MAAM,mBAAkB,aACZ9B,KAAK4P,cAAgB,iBAAmB,2BACtC,kCACdnD,KAAMzM,KAAK4P,cAAgB,SAAW,SACtC5N,QAAS,IAAMhC,KAAKiQ,iBAEnBjQ,KAAK4P,cAAgB,KAAOjO,EAAA,QAAMG,MAAM,0BAAqC,SAC9EH,EAAA,UAAAE,IAAA,2CAAQI,KAAK,aAIhBjC,KAAKgS,oB","ignoreList":[]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const e="zanichelli-it-frontend-kit";const t={hydratedSelectorName:"hydrated",lazyLoad:true,updatable:true};const i=()=>{};const l=":root{--font-md:500}.title-1,.title-2,.title-3,.title-4,.title-5,.title-6,.title-1-rg,.title-2-rg,.title-3-rg,.title-4-rg,.title-5-rg,.title-6-rg,.title-1-lt,.title-2-lt,.title-3-lt,.title-4-lt,.title-5-lt,.title-6-lt,.title-1-sb,.title-2-sb,.title-3-sb,.title-4-sb,.title-5-sb,.title-6-sb,.title-1-bd,.title-2-bd,.title-3-bd,.title-4-bd,.title-5-bd,.title-6-bd,.title-1-md,.title-2-md,.title-3-md,.title-4-md,.title-5-md,.title-6-md{font-family:var(--font-family-serif);font-weight:var(--font-rg)}.title-1-lt,.title-2-lt,.title-3-lt,.title-4-lt,.title-5-lt,.title-6-lt,.heading-1-lt,.heading-2-lt,.heading-3-lt,.heading-4-lt,.body-1-lt,.body-2-lt,.body-3-lt,.body-4-lt,.body-5-lt,.body-6-lt,.body-7-lt,.interactive-1-lt,.interactive-2-lt{font-weight:var(--font-lt)}.title-1-md,.title-2-md,.title-3-md,.title-4-md,.title-5-md,.title-6-md,.heading-1-md,.heading-2-md,.heading-3-md,.heading-4-md,.body-1-md,.body-2-md,.body-3-md,.body-4-md,.body-5-md,.body-6-md,.body-7-md,.interactive-1-md,.interactive-2-md{font-weight:var(--font-md)}.title-1-rg,.title-2-rg,.title-3-rg,.title-4-rg,.title-5-rg,.title-6-rg,.heading-1-rg,.heading-2-rg,.heading-3-rg,.heading-4-rg,.body-1-rg,.body-2-rg,.body-3-rg,.body-4-rg,.body-5-rg,.body-6-rg,.body-7-rg,.interactive-1-rg,.interactive-2-rg{font-weight:var(--font-rg)}.title-1-sb,.title-2-sb,.title-3-sb,.title-4-sb,.title-5-sb,.title-6-sb,.heading-1-sb,.heading-2-sb,.heading-3-sb,.heading-4-sb,.body-2-sb,.body-3-sb,.body-4-sb,.body-5-sb,.body-6-sb,.body-7-sb,.interactive-1-sb,.interactive-2-sb{font-weight:var(--font-sb)}.title-1-bd,.title-2-bd,.title-3-bd,.title-4-bd,.title-5-bd,.title-6-bd,.heading-1-bd,.heading-2-bd,.heading-3-bd,.heading-4-bd,.body-1-bd,.body-2-bd,.body-3-bd,.body-4-bd,.body-5-bd,.body-6-bd,.body-7-bd,.interactive-1-bd,.interactive-2-bd{font-weight:var(--font-bd)}.font-lt{font-weight:var(--font-lt)}.font-rg{font-weight:var(--font-rg)}.font-md{font-weight:var(--font-md)}.font-sb{font-weight:var(--font-sb)}.font-bd{font-weight:var(--font-bd)}.font-it{font-style:italic}.font-serif{font-family:var(--font-family-serif)}.font-sans{font-family:var(--font-family-sans)}.title-1,.title-1-sb,.title-1-bd,.title-1-rg,.title-1-lt,.title-1-md{font-size:72px;line-height:80px}.title-2,.title-2-sb,.title-2-bd,.title-2-rg,.title-2-lt,.title-2-md{font-size:48px;line-height:52px}.title-3,.title-3-sb,.title-3-bd,.title-3-rg,.title-3-lt,.title-3-md{font-size:2rem;line-height:2.75rem;}.title-4,.title-4-sb,.title-4-bd,.title-4-rg,.title-4-lt,.title-4-md{font-size:1.75rem;line-height:2rem;}.title-5,.title-5-sb,.title-5-bd,.title-5-rg,.title-5-lt,.title-5-md{font-size:1.5rem;line-height:1.75rem;}.title-6,.title-6-sb,.title-6-bd,.title-6-rg,.title-6-lt,.title-6-md{font-size:1.25rem;line-height:1.75rem;}.heading-1,.heading-1-sb,.heading-1-bd,.heading-1-rg,.heading-1-lt,.heading-1-md{font-size:2rem;line-height:2.75rem;}.heading-2,.heading-2-sb,.heading-2-bd,.heading-2-rg,.heading-2-lt,.heading-2-md{font-size:1.75rem;line-height:2rem;}.heading-3,.heading-3-sb,.heading-3-bd,.heading-3-rg,.heading-3-lt,.heading-3-md{font-size:1.5rem;line-height:1.75rem;}.heading-4,.heading-4-sb,.heading-4-bd,.heading-4-rg,.heading-4-lt,.heading-4-md{font-size:1.125rem;line-height:1.375rem;}.body-1,.body-1-sb,.body-1-bd,.body-1-rg,.body-1-lt,.body-1-md{font-size:1.5rem;line-height:2rem;}.body-2,.body-2-sb,.body-2-bd,.body-2-rg,.body-2-lt,.body-2-md{font-size:1.25rem;line-height:1.75rem;}.body-3,.body-3-sb,.body-3-bd,.body-3-rg,.body-3-lt,.body-3-md{font-size:1.125rem;line-height:1.5rem;}.body-4,.body-4-sb,.body-4-bd,.body-4-rg,.body-4-lt,.body-4-md{font-size:1rem;line-height:1.5rem;}.body-5,.body-5-sb,.body-5-bd,.body-5-rg,.body-5-lt,.body-5-md{font-size:0.875rem;line-height:1.125rem;}.body-6,.body-6-sb,.body-6-bd,.body-6-rg,.body-6-lt,.body-6-md{font-size:0.75rem;line-height:1rem;}.body-7,.body-7-sb,.body-7-bd,.body-7-rg,.body-7-lt,.body-7-md{font-size:0.625rem;line-height:0.875rem;}.interactive-1,.interactive-1-sb,.interactive-1-bd,.interactive-1-rg,.interactive-1-lt,.interactive-1-md{font-size:1rem;line-height:1.5rem;}.interactive-2,.interactive-2-sb,.interactive-2-bd,.interactive-2-rg,.interactive-2-lt,.interactive-2-md{font-size:0.875rem;line-height:1.125rem;}@media (width < 768px){.mobile-title-1,.mobile-title-1-sb,.mobile-title-1-bd,.mobile-title-1-rg,.mobile-title-1-lt,.mobile-title-1-md{font-size:4.5rem;line-height:5rem;}.mobile-title-2,.mobile-title-2-sb,.mobile-title-2-bd,.mobile-title-2-rg,.mobile-title-2-lt,.mobile-title-2-md{font-size:3rem;line-height:3.25rem;}.mobile-title-3,.mobile-title-3-sb,.mobile-title-3-bd,.mobile-title-3-rg,.mobile-title-3-lt,.mobile-title-3-md{font-size:2rem;line-height:2.75rem;}.mobile-title-4,.mobile-title-4-sb,.mobile-title-4-bd,.mobile-title-4-rg,.mobile-title-4-lt,.mobile-title-4-md{font-size:1.75rem;line-height:2rem;}.mobile-title-5,.mobile-title-5-sb,.mobile-title-5-bd,.mobile-title-5-rg,.mobile-title-5-lt,.mobile-title-5-md{font-size:1.5rem;line-height:1.75rem;}.mobile-title-6,.mobile-title-6-sb,.mobile-title-6-bd,.mobile-title-6-rg,.mobile-title-6-lt,.mobile-title-6-md{font-size:1.25rem;line-height:1.75rem;}.mobile-heading-1,.mobile-heading-1-sb,.mobile-heading-1-bd,.mobile-heading-1-rg,.mobile-heading-1-lt,.mobile-heading-1-md{font-size:2rem;line-height:2.75rem;}.mobile-heading-2,.mobile-heading-2-sb,.mobile-heading-2-bd,.mobile-heading-2-rg,.mobile-heading-2-lt,.mobile-heading-2-md{font-size:1.75rem;line-height:2rem;}.mobile-heading-3,.mobile-heading-3-sb,.mobile-heading-3-bd,.mobile-heading-3-rg,.mobile-heading-3-lt,.mobile-heading-3-md{font-size:1.5rem;line-height:1.75rem;}.mobile-heading-4,.mobile-heading-4-sb,.mobile-heading-4-bd,.mobile-heading-4-rg,.mobile-heading-4-lt,.mobile-heading-4-md{font-size:1.125rem;line-height:1.375rem;}.mobile-body-1,.mobile-body-1-sb,.mobile-body-1-bd,.mobile-body-1-rg,.mobile-body-1-lt,.mobile-body-1-md{font-size:1.5rem;line-height:2rem;}.mobile-body-2,.mobile-body-2-sb,.mobile-body-2-bd,.mobile-body-2-rg,.mobile-body-2-lt,.mobile-body-2-md{font-size:1.25rem;line-height:1.75rem;}.mobile-body-3,.mobile-body-3-sb,.mobile-body-3-bd,.mobile-body-3-rg,.mobile-body-3-lt,.mobile-body-3-md{font-size:1.125rem;line-height:1.5rem;}.mobile-body-4,.mobile-body-4-sb,.mobile-body-4-bd,.mobile-body-4-rg,.mobile-body-4-lt,.mobile-body-4-md{font-size:1rem;line-height:1.5rem;}.mobile-body-5,.mobile-body-5-sb,.mobile-body-5-bd,.mobile-body-5-rg,.mobile-body-5-lt,.mobile-body-5-md{font-size:0.875rem;line-height:1.125rem;}.mobile-body-6,.mobile-body-6-sb,.mobile-body-6-bd,.mobile-body-6-rg,.mobile-body-6-lt,.mobile-body-6-md{font-size:0.75rem;line-height:1rem;}.mobile-body-7,.mobile-body-7-sb,.mobile-body-7-bd,.mobile-body-7-rg,.mobile-body-7-lt,.mobile-body-7-md{font-size:0.625rem;line-height:0.875rem;}.mobile-interactive-1,.mobile-interactive-1-sb,.mobile-interactive-1-bd,.mobile-interactive-1-rg,.mobile-interactive-1-lt,.mobile-interactive-1-md{font-size:1rem;line-height:1.5rem;}.mobile-interactive-2,.mobile-interactive-2-sb,.mobile-interactive-2-bd,.mobile-interactive-2-rg,.mobile-interactive-2-lt,.mobile-interactive-2-md{font-size:0.875rem;line-height:1.125rem;}}@media (width >= 768px) and (width < 1152px){.tablet-title-1,.tablet-title-1-sb,.tablet-title-1-bd,.tablet-title-1-rg,.tablet-title-1-lt,.tablet-title-1-md{font-size:4.5rem;line-height:5rem;}.tablet-title-2,.tablet-title-2-sb,.tablet-title-2-bd,.tablet-title-2-rg,.tablet-title-2-lt,.tablet-title-2-md{font-size:3rem;line-height:3.25rem;}.tablet-title-3,.tablet-title-3-sb,.tablet-title-3-bd,.tablet-title-3-rg,.tablet-title-3-lt,.tablet-title-3-md{font-size:2rem;line-height:2.75rem;}.tablet-title-4,.tablet-title-4-sb,.tablet-title-4-bd,.tablet-title-4-rg,.tablet-title-4-lt,.tablet-title-4-md{font-size:1.75rem;line-height:2rem;}.tablet-title-5,.tablet-title-5-sb,.tablet-title-5-bd,.tablet-title-5-rg,.tablet-title-5-lt,.tablet-title-5-md{font-size:1.5rem;line-height:1.75rem;}.tablet-title-6,.tablet-title-6-sb,.tablet-title-6-bd,.tablet-title-6-rg,.tablet-title-6-lt,.tablet-title-6-md{font-size:1.25rem;line-height:1.75rem;}.tablet-heading-1,.tablet-heading-1-sb,.tablet-heading-1-bd,.tablet-heading-1-rg,.tablet-heading-1-lt,.tablet-heading-1-md{font-size:2rem;line-height:2.75rem;}.tablet-heading-2,.tablet-heading-2-sb,.tablet-heading-2-bd,.tablet-heading-2-rg,.tablet-heading-2-lt,.tablet-heading-2-md{font-size:1.75rem;line-height:2rem;}.tablet-heading-3,.tablet-heading-3-sb,.tablet-heading-3-bd,.tablet-heading-3-rg,.tablet-heading-3-lt,.tablet-heading-3-md{font-size:1.5rem;line-height:1.75rem;}.tablet-heading-4,.tablet-heading-4-sb,.tablet-heading-4-bd,.tablet-heading-4-rg,.tablet-heading-4-lt,.tablet-heading-4-md{font-size:1.125rem;line-height:1.375rem;}.tablet-body-1,.tablet-body-1-sb,.tablet-body-1-bd,.tablet-body-1-rg,.tablet-body-1-lt,.tablet-body-1-md{font-size:1.5rem;line-height:2rem;}.tablet-body-2,.tablet-body-2-sb,.tablet-body-2-bd,.tablet-body-2-rg,.tablet-body-2-lt,.tablet-body-2-md{font-size:1.25rem;line-height:1.75rem;}.tablet-body-3,.tablet-body-3-sb,.tablet-body-3-bd,.tablet-body-3-rg,.tablet-body-3-lt,.tablet-body-3-md{font-size:1.125rem;line-height:1.5rem;}.tablet-body-4,.tablet-body-4-sb,.tablet-body-4-bd,.tablet-body-4-rg,.tablet-body-4-lt,.tablet-body-4-md{font-size:1rem;line-height:1.5rem;}.tablet-body-5,.tablet-body-5-sb,.tablet-body-5-bd,.tablet-body-5-rg,.tablet-body-5-lt,.tablet-body-5-md{font-size:0.875rem;line-height:1.125rem;}.tablet-body-6,.tablet-body-6-sb,.tablet-body-6-bd,.tablet-body-6-rg,.tablet-body-6-lt,.tablet-body-6-md{font-size:0.75rem;line-height:1rem;}.tablet-body-7,.tablet-body-7-sb,.tablet-body-7-bd,.tablet-body-7-rg,.tablet-body-7-lt,.tablet-body-7-md{font-size:0.625rem;line-height:0.875rem;}.tablet-interactive-1,.tablet-interactive-1-sb,.tablet-interactive-1-bd,.tablet-interactive-1-rg,.tablet-interactive-1-lt,.tablet-interactive-1-md{font-size:1rem;line-height:1.5rem;}.tablet-interactive-2,.tablet-interactive-2-sb,.tablet-interactive-2-bd,.tablet-interactive-2-rg,.tablet-interactive-2-lt,.tablet-interactive-2-md{font-size:0.875rem;line-height:1.125rem;}}@media (width >= 1152px){.desktop-title-1,.desktop-title-1-sb,.desktop-title-1-bd,.desktop-title-1-rg,.desktop-title-1-lt,.desktop-title-1-md{font-size:4.5rem;line-height:5rem;}.desktop-title-2,.desktop-title-2-sb,.desktop-title-2-bd,.desktop-title-2-rg,.desktop-title-2-lt,.desktop-title-2-md{font-size:3rem;line-height:3.25rem;}.desktop-title-3,.desktop-title-3-sb,.desktop-title-3-bd,.desktop-title-3-rg,.desktop-title-3-lt,.desktop-title-3-md{font-size:2rem;line-height:2.75rem;}.desktop-title-4,.desktop-title-4-sb,.desktop-title-4-bd,.desktop-title-4-rg,.desktop-title-4-lt,.desktop-title-4-md{font-size:1.75rem;line-height:2rem;}.desktop-title-5,.desktop-title-5-sb,.desktop-title-5-bd,.desktop-title-5-rg,.desktop-title-5-lt,.desktop-title-5-md{font-size:1.5rem;line-height:1.75rem;}.desktop-title-6,.desktop-title-6-sb,.desktop-title-6-bd,.desktop-title-6-rg,.desktop-title-6-lt,.desktop-title-6-md{font-size:1.25rem;line-height:1.75rem;}.desktop-heading-1,.desktop-heading-1-sb,.desktop-heading-1-bd,.desktop-heading-1-rg,.desktop-heading-1-lt,.desktop-heading-1-md{font-size:2rem;line-height:2.75rem;}.desktop-heading-2,.desktop-heading-2-sb,.desktop-heading-2-bd,.desktop-heading-2-rg,.desktop-heading-2-lt,.desktop-heading-2-md{font-size:1.75rem;line-height:2rem;}.desktop-heading-3,.desktop-heading-3-sb,.desktop-heading-3-bd,.desktop-heading-3-rg,.desktop-heading-3-lt,.desktop-heading-3-md{font-size:1.5rem;line-height:1.75rem;}.desktop-heading-4,.desktop-heading-4-sb,.desktop-heading-4-bd,.desktop-heading-4-rg,.desktop-heading-4-lt,.desktop-heading-4-md{font-size:1.125rem;line-height:1.375rem;}.desktop-body-1,.desktop-body-1-sb,.desktop-body-1-bd,.desktop-body-1-rg,.desktop-body-1-lt,.desktop-body-1-md{font-size:1.5rem;line-height:2rem;}.desktop-body-2,.desktop-body-2-sb,.desktop-body-2-bd,.desktop-body-2-rg,.desktop-body-2-lt,.desktop-body-2-md{font-size:1.25rem;line-height:1.75rem;}.desktop-body-3,.desktop-body-3-sb,.desktop-body-3-bd,.desktop-body-3-rg,.desktop-body-3-lt,.desktop-body-3-md{font-size:1.125rem;line-height:1.5rem;}.desktop-body-4,.desktop-body-4-sb,.desktop-body-4-bd,.desktop-body-4-rg,.desktop-body-4-lt,.desktop-body-4-md{font-size:1rem;line-height:1.5rem;}.desktop-body-5,.desktop-body-5-sb,.desktop-body-5-bd,.desktop-body-5-rg,.desktop-body-5-lt,.desktop-body-5-md{font-size:0.875rem;line-height:1.125rem;}.desktop-body-6,.desktop-body-6-sb,.desktop-body-6-bd,.desktop-body-6-rg,.desktop-body-6-lt,.desktop-body-6-md{font-size:0.75rem;line-height:1rem;}.desktop-body-7,.desktop-body-7-sb,.desktop-body-7-bd,.desktop-body-7-rg,.desktop-body-7-lt,.desktop-body-7-md{font-size:0.625rem;line-height:0.875rem;}.desktop-interactive-1,.desktop-interactive-1-sb,.desktop-interactive-1-bd,.desktop-interactive-1-rg,.desktop-interactive-1-lt,.desktop-interactive-1-md{font-size:1rem;line-height:1.5rem;}.desktop-interactive-2,.desktop-interactive-2-sb,.desktop-interactive-2-bd,.desktop-interactive-2-rg,.desktop-interactive-2-lt,.desktop-interactive-2-md{font-size:0.875rem;line-height:1.125rem;}}z-button.zanit-button{--color-primary01:var(--red500);--color-hover-primary:var(--red800);--color-pressed-primary:var(--red400);--color-button-secondary:transparent;--color-primary02:transparent;--color-primary03:transparent}z-button.zanit-button-dark{--color-primary01:var(--gray950);--color-hover-primary:#000;--color-pressed-primary:var(--gray950);--color-button-secondary:transparent;--color-primary02:transparent;--color-primary03:transparent}:root{--zanit-accent-color:#ffe74c;--shadow-focus-primary:0 0 0 2px #fff, 0 0 2px 5px var(--gray950)}.zanit-link,.zanit-link-inverse{color:currentcolor;font-family:inherit;text-decoration:underline solid 12% var(--red500);text-underline-offset:28%}.zanit-link-inverse{color:var(--color-text-inverse);text-decoration-color:var(--color-text-inverse)}";var o=Object.defineProperty;var n=(e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:true})};var r=(e,t)=>{var i;const l=t.t;const o=Object.entries((i=l.i)!=null?i:{});o.map((([i,[l]])=>{if(l&31||l&32){const l=e[i];const o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),i);Object.defineProperty(e,i,{get(){return o.get.call(this)},set(e){o.set.call(this,e)},configurable:true,enumerable:true});e[i]=t.l.has(i)?t.l.get(i):l}}))};var d=e=>{if(e.__stencil__getHostRef){return e.__stencil__getHostRef()}return void 0};var s=(e,t)=>{e.__stencil__getHostRef=()=>t;t.o=e;{r(e,t)}};var b=(e,t)=>{const i={m:0,$hostElement$:e,t,l:new Map};{i.h=new Promise((e=>i.v=e));e["s-p"]=[];e["s-rc"]=[]}const l=i;e.__stencil__getHostRef=()=>l;return l};var a=(e,t)=>t in e;var m=(e,t)=>(0,console.error)(e,t);var f=new Map;var h=(e,t,i)=>{const l=e.p.replace(/-/g,"_");const o=e.u;if(!o){return void 0}const n=f.get(o);if(n){return n[l]}
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${o}.entry.js${""}`).then((e=>{{f.set(o,e)}return e[l]}),(e=>{m(e,t.$hostElement$)}))};var c=new Map;var g="sty-id";var y="{visibility:hidden}.hydrated{visibility:inherit}";var v="slot-fb{display:contents}slot-fb[hidden]{display:none}";var p=typeof window!=="undefined"?window:{};var u={m:0,k:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,i,l)=>e.addEventListener(t,i,l),rel:(e,t,i,l)=>e.removeEventListener(t,i,l),ce:(e,t)=>new CustomEvent(e,t)};var k=(()=>{var e;let t=false;try{(e=p.document)==null?void 0:e.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=true}}))}catch(e){}return t})();var z=e=>Promise.resolve(e);var w=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false})();var $=false;var S=[];var j=[];var x=(e,t)=>i=>{e.push(i);if(!$){$=true;if(t&&u.m&4){C(E)}else{u.raf(E)}}};var O=e=>{for(let t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){m(e)}}e.length=0};var E=()=>{O(S);{O(j);if($=S.length>0){u.raf(E)}}};var C=e=>z().then(e);var M=x(j,true);var N=e=>e!=null&&e!==void 0;var P=e=>{e=typeof e;return e==="object"||e==="function"};function U(e){var t,i,l;return(l=(i=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:i.getAttribute("content"))!=null?l:void 0}var R=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var D={};n(D,{err:()=>A,map:()=>F,ok:()=>W,unwrap:()=>L,unwrapErr:()=>H});var W=e=>({isOk:true,isErr:false,value:e});var A=e=>({isOk:false,isErr:true,value:e});function F(e,t){if(e.isOk){const i=t(e.value);if(i instanceof Promise){return i.then((e=>W(e)))}else{return W(i)}}if(e.isErr){const t=e.value;return A(t)}throw"should never get here"}var L=e=>{if(e.isOk){return e.value}else{throw e.value}};var H=e=>{if(e.isErr){return e.value}else{throw e.value}};function T(e){const t=this.attachShadow({mode:"open",delegatesFocus:!!(e.m&16)});if(w){const e=new CSSStyleSheet;e.replaceSync(l);t.adoptedStyleSheets.push(e)}}var I=(e,t="")=>{{return()=>{}}};var V=(e,t)=>{{return()=>{}}};var q=(e,t,...i)=>{let l=null;let o=null;let n=false;let r=false;const d=[];const s=t=>{for(let i=0;i<t.length;i++){l=t[i];if(Array.isArray(l)){s(l)}else if(l!=null&&typeof l!=="boolean"){if(n=typeof e!=="function"&&!P(l)){l=String(l)}if(n&&r){d[d.length-1].$+=l}else{d.push(n?G(null,l):l)}r=n}}};s(i);if(t){if(t.key){o=t.key}{const e=t.className||t.class;if(e){t.class=typeof e!=="object"?e:Object.keys(e).filter((t=>e[t])).join(" ")}}}if(typeof e==="function"){return e(t===null?{}:t,d,B)}const b=G(e,null);b.S=t;if(d.length>0){b.j=d}{b.O=o}return b};var G=(e,t)=>{const i={m:0,C:e,$:t,M:null,j:null};{i.S=null}{i.O=null}return i};var Y={};var _=e=>e&&e.C===Y;var B={forEach:(e,t)=>e.map(J).forEach(t),map:(e,t)=>e.map(J).map(t).map(K)};var J=e=>({vattrs:e.S,vchildren:e.j,vkey:e.O,vname:e.N,vtag:e.C,vtext:e.$});var K=e=>{if(typeof e.vtag==="function"){const t={...e.vattrs};if(e.vkey){t.key=e.vkey}if(e.vname){t.name=e.vname}return q(e.vtag,t,...e.vchildren||[])}const t=G(e.vtag,e.vtext);t.S=e.vattrs;t.j=e.vchildren;t.O=e.vkey;t.N=e.vname;return t};var Q=e=>{const t=R(e);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")};Q("::slotted");Q(":host");Q(":host-context");var X=(e,t)=>{if(e!=null&&!P(e)){if(t&4){return e==="false"?false:e===""||!!e}if(t&2){return typeof e==="string"?parseFloat(e):typeof e==="number"?e:NaN}if(t&1){return String(e)}return e}return e};var Z=e=>d(e).$hostElement$;var ee=(e,t,i)=>{const l=Z(e);return{emit:e=>te(l,t,{bubbles:true,composed:true,cancelable:true,detail:e})}};var te=(e,t,i)=>{const l=u.ce(t,i);e.dispatchEvent(l);return l};var ie=new WeakMap;var le=(e,t,i)=>{let l=c.get(e);if(w&&i){l=l||new CSSStyleSheet;if(typeof l==="string"){l=t}else{l.replaceSync(t)}}else{l=t}c.set(e,l)};var oe=(e,t,i)=>{var l;const o=re(t);const n=c.get(o);if(!p.document){return o}e=e.nodeType===11?e:p.document;if(n){if(typeof n==="string"){e=e.head||e;let i=ie.get(e);let r;if(!i){ie.set(e,i=new Set)}if(!i.has(o)){{r=document.querySelector(`[${g}="${o}"]`)||p.document.createElement("style");r.innerHTML=n;const i=(l=u.P)!=null?l:U(p.document);if(i!=null){r.setAttribute("nonce",i)}if(!(t.m&1)){if(e.nodeName==="HEAD"){const t=e.querySelectorAll("link[rel=preconnect]");const i=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(r,(i==null?void 0:i.parentNode)===e?i:null)}else if("host"in e){if(w){const t=new CSSStyleSheet;t.replaceSync(n);e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");if(t){t.innerHTML=n+t.innerHTML}else{e.prepend(r)}}}else{e.append(r)}}if(t.m&1){e.insertBefore(r,null)}}if(t.m&4){r.innerHTML+=v}if(i){i.add(o)}}}else if(!e.adoptedStyleSheets.includes(n)){e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}}return o};var ne=e=>{const t=e.t;const i=e.$hostElement$;const l=t.m;const o=I("attachStyles",t.p);const n=oe(i.shadowRoot?i.shadowRoot:i.getRootNode(),t);if(l&10){i["s-sc"]=n;i.classList.add(n+"-h")}o()};var re=(e,t)=>"sc-"+e.p;var de=(e,t,i,l,o,n,r)=>{if(i===l){return}let d=a(e,t);let s=t.toLowerCase();if(t==="class"){const t=e.classList;const o=be(i);let n=be(l);{t.remove(...o.filter((e=>e&&!n.includes(e))));t.add(...n.filter((e=>e&&!o.includes(e))))}}else if(t==="key");else if(t==="ref"){if(l){l(e)}}else if(!d&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"){t=t.slice(3)}else if(a(p,s)){t=s.slice(2)}else{t=s[2]+t.slice(3)}if(i||l){const o=t.endsWith(ae);t=t.replace(me,"");if(i){u.rel(e,t,i,o)}if(l){u.ael(e,t,l,o)}}}else{const r=P(l);if((d||r&&l!==null)&&true){try{if(!e.tagName.includes("-")){const o=l==null?"":l;if(t==="list"){d=false}else if(i==null||e[t]!=o){if(typeof e.__lookupSetter__(t)==="function"){e[t]=o}else{e.setAttribute(t,o)}}}else if(e[t]!==l){e[t]=l}}catch(e){}}if(l==null||l===false){if(l!==false||e.getAttribute(t)===""){{e.removeAttribute(t)}}}else if((!d||n&4||o)&&!r&&e.nodeType===1){l=l===true?"":l;{e.setAttribute(t,l)}}}};var se=/\s/;var be=e=>{if(typeof e==="object"&&e&&"baseVal"in e){e=e.baseVal}if(!e||typeof e!=="string"){return[]}return e.split(se)};var ae="Capture";var me=new RegExp(ae+"$");var fe=(e,t,i,l)=>{const o=t.M.nodeType===11&&t.M.host?t.M.host:t.M;const n=e&&e.S||{};const r=t.S||{};{for(const e of he(Object.keys(n))){if(!(e in r)){de(o,e,n[e],void 0,i,t.m)}}}for(const e of he(Object.keys(r))){de(o,e,n[e],r[e],i,t.m)}};function he(e){return e.includes("ref")?[...e.filter((e=>e!=="ref")),"ref"]:e}var ce;var ge;var ye=false;var ve=(e,t,i)=>{const l=t.j[i];let o=0;let n;let r;if(l.$!==null){n=l.M=p.document.createTextNode(l.$)}else{if(!p.document){throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.")}n=l.M=p.document.createElement(l.C);{fe(null,l,ye)}if(N(ce)&&n["s-si"]!==ce){n.classList.add(n["s-si"]=ce)}if(l.j){for(o=0;o<l.j.length;++o){r=ve(e,l,o);if(r){n.appendChild(r)}}}}n["s-hn"]=ge;return n};var pe=(e,t,i,l,o,n)=>{let r=e;let d;if(r.shadowRoot&&r.tagName===ge){r=r.shadowRoot}for(;o<=n;++o){if(l[o]){d=ve(null,i,o);if(d){l[o].M=d;Se(r,d,t)}}}};var ue=(e,t,i)=>{for(let l=t;l<=i;++l){const t=e[l];if(t){const e=t.M;$e(t);if(e){e.remove()}}}};var ke=(e,t,i,l,o=false)=>{let n=0;let r=0;let d=0;let s=0;let b=t.length-1;let a=t[0];let m=t[b];let f=l.length-1;let h=l[0];let c=l[f];let g;let y;while(n<=b&&r<=f){if(a==null){a=t[++n]}else if(m==null){m=t[--b]}else if(h==null){h=l[++r]}else if(c==null){c=l[--f]}else if(ze(a,h,o)){we(a,h,o);a=t[++n];h=l[++r]}else if(ze(m,c,o)){we(m,c,o);m=t[--b];c=l[--f]}else if(ze(a,c,o)){we(a,c,o);Se(e,a.M,m.M.nextSibling);a=t[++n];c=l[--f]}else if(ze(m,h,o)){we(m,h,o);Se(e,m.M,a.M);m=t[--b];h=l[++r]}else{d=-1;{for(s=n;s<=b;++s){if(t[s]&&t[s].O!==null&&t[s].O===h.O){d=s;break}}}if(d>=0){y=t[d];if(y.C!==h.C){g=ve(t&&t[r],i,d)}else{we(y,h,o);t[d]=void 0;g=y.M}h=l[++r]}else{g=ve(t&&t[r],i,r);h=l[++r]}if(g){{Se(a.M.parentNode,g,a.M)}}}}if(n>b){pe(e,l[f+1]==null?null:l[f+1].M,i,l,r,f)}else if(r>f){ue(t,n,b)}};var ze=(e,t,i=false)=>{if(e.C===t.C){if(!i){return e.O===t.O}if(i&&!e.O&&t.O){e.O=t.O}return true}return false};var we=(e,i,l=false)=>{const o=i.M=e.M;const n=e.j;const r=i.j;const d=i.$;if(d===null){{fe(e,i,ye)}if(n!==null&&r!==null){ke(o,n,i,r,l)}else if(r!==null){if(e.$!==null){o.textContent=""}pe(o,null,i,r,0,r.length-1)}else if(!l&&t.updatable&&n!==null){ue(n,0,n.length-1)}}else if(e.$!==d){o.data=d}};var $e=e=>{{e.S&&e.S.ref&&e.S.ref(null);e.j&&e.j.map($e)}};var Se=(e,t,i)=>{if(typeof t["s-sn"]==="string"&&!!t["s-sr"]&&!!t["s-cr"]){je(t["s-cr"],t,e,t.parentElement)}{return e==null?void 0:e.insertBefore(t,i)}};function je(e,t,i,l){var o,n;let r;if(e&&typeof t["s-sn"]==="string"&&!!t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(r=t["s-si"]||e.parentNode["s-sc"])){const e=t["s-sn"];const d=t["s-hn"];(o=i.classList)==null?void 0:o.add(r+"-s");if(l&&((n=l.classList)==null?void 0:n.contains(r+"-s"))){let t=(l.__childNodes||l.childNodes)[0];let i=false;while(t){if(t["s-sn"]!==e&&t["s-hn"]===d&&!!t["s-sr"]){i=true;break}t=t.nextSibling}if(!i)l.classList.remove(r+"-s")}}}var xe=(e,t,i=false)=>{const l=e.$hostElement$;const o=e.U||G(null,null);const n=_(t);const r=n?t:q(null,null,t);ge=l.tagName;if(i&&r.S){for(const e of Object.keys(r.S)){if(l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)){r.S[e]=l[e]}}}r.C=null;r.m|=4;e.U=r;r.M=o.M=l.shadowRoot||l;{ce=l["s-sc"]}we(o,r,i)};var Oe=(e,t)=>{if(t&&!e.R&&t["s-p"]){const i=t["s-p"].push(new Promise((l=>e.R=()=>{t["s-p"].splice(i-1,1);l()})))}};var Ee=(e,t)=>{{e.m|=16}if(e.m&4){e.m|=512;return}Oe(e,e.D);const i=()=>Ce(e,t);return M(i)};var Ce=(e,t)=>{const i=e.$hostElement$;const l=I("scheduleUpdate",e.t.p);const o=e.o;if(!o){throw new Error(`Can't render component <${i.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`)}let n;if(t){{e.m|=256;if(e.W){e.W.map((([e,t])=>We(o,e,t,i)));e.W=void 0}}n=We(o,"componentWillLoad",void 0,i)}else{n=We(o,"componentWillUpdate",void 0,i)}n=Me(n,(()=>We(o,"componentWillRender",void 0,i)));l();return Me(n,(()=>Pe(e,o,t)))};var Me=(e,t)=>Ne(e)?e.then(t).catch((e=>{console.error(e);t()})):t();var Ne=e=>e instanceof Promise||e&&e.then&&typeof e.then==="function";var Pe=async(e,t,i)=>{var l;const o=e.$hostElement$;const n=I("update",e.t.p);const r=o["s-rc"];if(i){ne(e)}const d=I("render",e.t.p);{Ue(e,t,o,i)}if(r){r.map((e=>e()));o["s-rc"]=void 0}d();n();{const t=(l=o["s-p"])!=null?l:[];const i=()=>Re(e);if(t.length===0){i()}else{Promise.all(t).then(i);e.m|=4;t.length=0}}};var Ue=(e,t,i,l)=>{try{t=t.render();{e.m&=-17}{e.m|=2}{{{xe(e,t,l)}}}}catch(t){m(t,e.$hostElement$)}return null};var Re=e=>{const t=e.t.p;const i=e.$hostElement$;const l=I("postUpdate",t);const o=e.o;const n=e.D;We(o,"componentDidRender",void 0,i);if(!(e.m&64)){e.m|=64;{Ae(i)}We(o,"componentDidLoad",void 0,i);l();{e.v(i);if(!n){De()}}}else{We(o,"componentDidUpdate",void 0,i);l()}{if(e.R){e.R();e.R=void 0}if(e.m&512){C((()=>Ee(e,false)))}e.m&=-517}};var De=t=>{C((()=>te(p,"appload",{detail:{namespace:e}})))};var We=(e,t,i,l)=>{if(e&&e[t]){try{return e[t](i)}catch(e){m(e,l)}}return void 0};var Ae=e=>{var i;return e.classList.add((i=t.hydratedSelectorName)!=null?i:"hydrated")};var Fe=(e,t)=>d(e).l.get(t);var Le=(e,t,i,l)=>{const o=d(e);if(!o){throw new Error(`Couldn't find host element for "${l.p}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`)}const n=o.$hostElement$;const r=o.l.get(t);const s=o.m;const b=o.o;i=X(i,l.i[t][0]);const a=Number.isNaN(r)&&Number.isNaN(i);const f=i!==r&&!a;if((!(s&8)||r===void 0)&&f){o.l.set(t,i);if(b){if(l.A&&s&128){const e=l.A[t];if(e){e.map((e=>{try{b[e](i,r,t)}catch(e){m(e,n)}}))}}if((s&(2|16))===2){if(b.componentShouldUpdate){if(b.componentShouldUpdate(i,r,t)===false){return}}Ee(o,false)}}}};var He=(e,i,l)=>{var o,n;const r=e.prototype;if(i.i||(i.A||e.watchers)){if(e.watchers&&!i.A){i.A=e.watchers}const s=Object.entries((o=i.i)!=null?o:{});s.map((([e,[t]])=>{if(t&31||l&2&&t&32){const{get:o,set:n}=Object.getOwnPropertyDescriptor(r,e)||{};if(o)i.i[e][0]|=2048;if(n)i.i[e][0]|=4096;if(l&1||!o){Object.defineProperty(r,e,{get(){{if((i.i[e][0]&2048)===0){return Fe(this,e)}const t=d(this);const l=t?t.o:r;if(!l)return;return l[e]}},configurable:true,enumerable:true})}Object.defineProperty(r,e,{set(o){const r=d(this);if(n){const l=t&32?this[e]:r.$hostElement$[e];if(typeof l==="undefined"&&r.l.get(e)){o=r.l.get(e)}else if(!r.l.get(e)&&l){r.l.set(e,l)}n.apply(this,[X(o,t)]);o=t&32?this[e]:r.$hostElement$[e];Le(this,e,o,i);return}{if((l&1)===0||(i.i[e][0]&4096)===0){Le(this,e,o,i);if(l&1&&!r.o){r.h.then((()=>{if(i.i[e][0]&4096&&r.o[e]!==r.l.get(e)){r.o[e]=o}}))}return}const n=()=>{const l=r.o[e];if(!r.l.get(e)&&l){r.l.set(e,l)}r.o[e]=X(o,t);Le(this,e,r.o[e],i)};if(r.o){n()}else{r.h.then((()=>n()))}}}})}}));if(l&1){const l=new Map;r.attributeChangedCallback=function(e,o,n){u.jmp((()=>{var s;const b=l.get(e);if(this.hasOwnProperty(b)&&t.lazyLoad){n=this[b];delete this[b]}else if(r.hasOwnProperty(b)&&typeof this[b]==="number"&&this[b]==n){return}else if(b==null){const t=d(this);const l=t==null?void 0:t.m;if(l&&!(l&8)&&l&128&&n!==o){const l=t.o;const r=(s=i.A)==null?void 0:s[e];r==null?void 0:r.forEach((t=>{if(l[t]!=null){l[t].call(l,n,o,e)}}))}return}const a=Object.getOwnPropertyDescriptor(r,b);n=n===null&&typeof this[b]==="boolean"?false:n;if(n!==this[b]&&(!a.get||!!a.set)){this[b]=n}}))};e.observedAttributes=Array.from(new Set([...Object.keys((n=i.A)!=null?n:{}),...s.filter((([e,t])=>t[0]&15)).map((([e,t])=>{const i=t[1]||e;l.set(i,e);return i}))]))}}return e};var Te=async(e,t,i,l)=>{let o;if((t.m&32)===0){t.m|=32;const l=i.u;if(l){const l=h(i,t);if(l&&"then"in l){const e=V();o=await l;e()}else{o=l}if(!o){throw new Error(`Constructor for "${i.p}#${t.F}" was not found`)}if(!o.isProxied){{i.A=o.watchers}He(o,i,2);o.isProxied=true}const n=I("createInstance",i.p);{t.m|=8}try{new o(t)}catch(t){m(t,e)}{t.m&=-9}{t.m|=128}n();Ie(t.o,e)}else{o=e.constructor;const i=e.localName;customElements.whenDefined(i).then((()=>t.m|=128))}if(o&&o.style){let e;if(typeof o.style==="string"){e=o.style}const t=re(i);if(!c.has(t)){const l=I("registerStyles",i.p);le(t,e,!!(i.m&1));l()}}}const n=t.D;const r=()=>Ee(t,true);if(n&&n["s-rc"]){n["s-rc"].push(r)}else{r()}};var Ie=(e,t)=>{{We(e,"connectedCallback",void 0,t)}};var Ve=e=>{if((u.m&1)===0){const t=d(e);const i=t.t;const l=I("connectedCallback",i.p);if(!(t.m&1)){t.m|=1;{let i=e;while(i=i.parentNode||i.host){if(i["s-p"]){Oe(t,t.D=i);break}}}if(i.i){Object.entries(i.i).map((([t,[i]])=>{if(i&31&&e.hasOwnProperty(t)){const i=e[t];delete e[t];e[t]=i}}))}{Te(e,t,i)}}else{Be(e,t,i.L);if(t==null?void 0:t.o){Ie(t.o,e)}else if(t==null?void 0:t.h){t.h.then((()=>Ie(t.o,e)))}}l()}};var qe=(e,t)=>{{We(e,"disconnectedCallback",void 0,t||e)}};var Ge=async e=>{if((u.m&1)===0){const t=d(e);{if(t.H){t.H.map((e=>e()));t.H=void 0}}if(t==null?void 0:t.o){qe(t.o,e)}else if(t==null?void 0:t.h){t.h.then((()=>qe(t.o,e)))}}if(ie.has(e)){ie.delete(e)}if(e.shadowRoot&&ie.has(e.shadowRoot)){ie.delete(e.shadowRoot)}};var Ye=(e,t={})=>{var i;if(!p.document){console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");return}const l=I();const o=[];const n=t.exclude||[];const r=p.customElements;const s=p.document.head;const a=s.querySelector("meta[charset]");const m=p.document.createElement("style");const f=[];let h;let c=true;Object.assign(u,t);u.k=new URL(t.resourcesUrl||"./",p.document.baseURI).href;let g=false;e.map((e=>{e[1].map((t=>{var i;const l={m:t[0],p:t[1],i:t[2],L:t[3]};if(l.m&4){g=true}{l.i=t[2]}{l.L=t[3]}{l.A=(i=t[4])!=null?i:{}}const s=l.p;const a=class extends HTMLElement{constructor(e){super(e);this.hasRegisteredEventListeners=false;e=this;b(e,l);if(l.m&1){{if(!e.shadowRoot){T.call(e,l)}else{if(e.shadowRoot.mode!=="open"){throw new Error(`Unable to re-use existing shadow root for ${l.p}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}}}}connectedCallback(){const e=d(this);if(!this.hasRegisteredEventListeners){this.hasRegisteredEventListeners=true;Be(this,e,l.L)}if(h){clearTimeout(h);h=null}if(c){f.push(this)}else{u.jmp((()=>Ve(this)))}}disconnectedCallback(){u.jmp((()=>Ge(this)));u.raf((()=>{var e;const t=d(this);const i=f.findIndex((e=>e===this));if(i>-1){f.splice(i,1)}if(((e=t==null?void 0:t.U)==null?void 0:e.M)instanceof Node&&!t.U.M.isConnected){delete t.U.M}}))}componentOnReady(){return d(this).h}};l.u=e[0];if(!n.includes(s)&&!r.get(s)){o.push(s);r.define(s,He(a,l,1))}}))}));if(o.length>0){if(g){m.textContent+=v}{m.textContent+=o.sort()+y}if(m.innerHTML.length){m.setAttribute("data-styles","");const e=(i=u.P)!=null?i:U(p.document);if(e!=null){m.setAttribute("nonce",e)}s.insertBefore(m,a?a.nextSibling:s.firstChild)}}c=false;if(f.length){f.map((e=>e.connectedCallback()))}else{{u.jmp((()=>h=setTimeout(De,30)))}}l()};var _e=(e,t)=>t;var Be=(e,t,i,l)=>{if(i&&p.document){i.map((([i,l,o])=>{const n=Ke(p.document,e,i);const r=Je(t,o);const d=Qe(i);u.ael(n,l,r,d);(t.H=t.H||[]).push((()=>u.rel(n,l,r,d)))}))}};var Je=(e,t)=>i=>{var l;try{{if(e.m&256){(l=e.o)==null?void 0:l[t](i)}else{(e.W=e.W||[]).push([t,i])}}}catch(t){m(t,e.$hostElement$)}};var Ke=(e,t,i)=>{if(i&4){return e}if(i&8){return p}return t};var Qe=e=>k?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0;var Xe=e=>u.P=e;export{_e as F,Y as H,Z as a,Ye as b,ee as c,i as g,q as h,z as p,s as r,Xe as s};
|
|
3
|
-
//# sourceMappingURL=p-DSdvvVFj.js.map
|