Plugin Directory

Changeset 3802072


Ignore:
Timestamp:
11/14/2026 02:20:45 PM (40 hours ago)
Author:
softiconai
Message:

Welcome: pick Block or Shortcode first (each opens the editor with an empty Flipbook block and the steps written under the PDF picker, and a note once the PDF is picked); after activation the dashboard's Welcome when the opt-in is already answered. No version change.

Location:
softicon-flipbook
Files:
2 added
24 edited

Legend:

Unmodified
Added
Removed
  • softicon-flipbook/tags/1.7.0/assets/css/dashboard.css

    r3800561 r3802072  
    176176}
    177177
    178 .alfb-hero .alfb-actions {
     178/* Welcome: "Block or Shortcode?" in the hero */
     179.alfb-choice {
     180        margin-top: 24px;
     181}
     182
     183.alfb-hero .alfb-choice h3 {
     184        margin: 0 0 12px;
     185        color: #fff;
     186        font-size: 16px;
     187}
     188
     189.alfb-choice-cards {
     190        display: grid;
     191        grid-template-columns: repeat(2, minmax(0, 1fr));
     192        gap: 12px;
     193}
     194
     195.alfb-choice-card {
     196        display: flex;
     197        flex-direction: column;
     198        gap: 6px;
     199        padding: 16px 18px;
     200        border: 2px solid transparent;
     201        border-radius: 12px;
     202        background: #fff;
     203        color: var(--alfb-ink);
     204        text-decoration: none;
     205        transition: transform 0.15s, box-shadow 0.15s;
     206}
     207
     208.alfb-choice-card:hover,
     209.alfb-choice-card:focus {
     210        color: var(--alfb-ink);
     211        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
     212        transform: translateY(-2px);
     213}
     214
     215.alfb-choice-card:focus-visible {
     216        outline: 2px solid var(--alfb-amber);
     217        outline-offset: 2px;
     218}
     219
     220.alfb-choice-card.is-fit {
     221        border-color: #fbbf24;
     222}
     223
     224.alfb-choice-icon {
     225        width: 32px;
     226        height: 32px;
     227        border-radius: 8px;
     228        background: #ccfbf1;
     229        color: var(--alfb-teal);
     230        font-size: 20px;
     231        line-height: 32px;
     232        text-align: center;
     233}
     234
     235.alfb-choice-card strong {
    179236        display: flex;
    180237        flex-wrap: wrap;
    181         gap: 10px;
    182         margin-top: 22px;
     238        align-items: center;
     239        gap: 8px;
     240        font-size: 16px;
     241}
     242
     243.alfb-choice-fit {
     244        padding: 2px 8px;
     245        border-radius: 999px;
     246        background: #fef3c7;
     247        color: #92400e;
     248        font-size: 11px;
     249        font-weight: 600;
     250}
     251
     252.alfb-hero .alfb-choice-text {
     253        color: #50575e;
     254        font-size: 13px;
     255        line-height: 1.5;
     256}
     257
     258.alfb-choice-go {
     259        margin-top: auto;
     260        padding-top: 4px;
     261        color: var(--alfb-teal);
     262        font-weight: 600;
     263}
     264
     265.alfb-hero .alfb-choice-more {
     266        display: flex;
     267        flex-wrap: wrap;
     268        gap: 18px;
     269        margin-top: 14px;
     270        font-size: 13px;
     271}
     272
     273.alfb-choice-more a {
     274        color: #fff;
     275}
     276
     277.alfb-choice-more a:hover,
     278.alfb-choice-more a:focus {
     279        color: #fde68a;
     280}
     281
     282@media (max-width: 600px) {
     283        .alfb-choice-cards {
     284                grid-template-columns: 1fr;
     285        }
    183286}
    184287
  • softicon-flipbook/tags/1.7.0/build/dashboard.asset.php

    r3800561 r3802072  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'dd4ad171029094f39fe4');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'e9171b997dfcd5a87a66');
  • softicon-flipbook/tags/1.7.0/build/dashboard.js

    r3800561 r3802072  
    11(()=>{"use strict";const e={n:t=>{const o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var a in o)e.o(o,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:o[a]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.React,o=window.wp.element,a=window.wp.hooks,l=window.wp.i18n,n=window.wp.apiFetch;var s=e.n(n);const i=(e,t)=>(e.groups||[]).find(e=>e.items.some(e=>e.key===t)),r=(e,t)=>{let o="";try{o=window.localStorage.getItem("alfb-group-"+t.key)||""}catch(e){}const a=t.items.map(e=>e.key),l=a.filter(t=>!e.lockedTabs.includes(t));return"#/"+(a.includes(o)&&l.includes(o)?o:l[0]||a[0])},c=({config:e,active:o,unlock:a})=>(0,t.createElement)("header",{className:"alfb-dash-head"},(0,t.createElement)("a",{className:"alfb-dash-brand",href:"#/welcome"},(0,t.createElement)("img",{src:e.icon,alt:"",width:"36",height:"36"}),(0,t.createElement)("strong",null,e.pro?(0,l.__)("Flipbook Pro","softicon-flipbook"):(0,l.__)("Flipbook","softicon-flipbook")),(0,t.createElement)("span",{className:"alfb-version"},"v",e.version)),(0,t.createElement)("nav",{className:"alfb-dash-tabs","aria-label":(0,l.__)("Flipbook dashboard","softicon-flipbook")},e.tabs.map((n,s)=>{const c=i(e,n.key);if(c){if(e.tabs.findIndex(t=>i(e,t.key)===c)!==s)return null;const n=!!c.items.find(e=>e.key===o),p=c.items.every(t=>e.lockedTabs.includes(t.key));return(0,t.createElement)("a",{key:c.key,href:r(e,c),className:(n?"is-active":"")+(p?" is-locked":"")||void 0,"aria-current":n?"page":void 0,onClick:p?e=>{e.preventDefault(),a()}:void 0},c.label,p&&(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-label":(0,l.__)("Locked","softicon-flipbook")}))}const p=e.lockedTabs.includes(n.key);return(0,t.createElement)("a",{key:n.key,href:"#/"+n.key,className:(n.key===o?"is-active":"")+(p?" is-locked":"")||void 0,"aria-current":n.key===o?"page":void 0,onClick:p?e=>{e.preventDefault(),a()}:void 0},n.label,p&&(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-label":(0,l.__)("Locked","softicon-flipbook")}))})),(0,t.createElement)("div",{className:"alfb-dash-end"},(0,t.createElement)("a",{className:"alfb-dash-more",href:"https://wordpress.org/plugins/author/softiconai/",target:"_blank",rel:"noopener noreferrer"},(0,l.__)("Our plugins","softicon-flipbook")),e.pro&&!e.locked?(0,t.createElement)("span",{className:"alfb-pro-on"},(0,t.createElement)("span",{className:"dashicons dashicons-yes-alt","aria-hidden":"true"}),(0,l.__)("Pro active","softicon-flipbook")):(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber alfb-upgrade",href:"#/pricing"},(0,t.createElement)("span",{className:"dashicons dashicons-unlock","aria-hidden":"true"}),(0,l.__)("Upgrade to Pro","softicon-flipbook")))),p=e=>{const t=new URL(e),o=t.searchParams.get("v")||("youtu.be"===t.hostname?t.pathname.slice(1):""),a=t.searchParams.get("list");return o?`https://www.youtube-nocookie.com/embed/${encodeURIComponent(o)}?autoplay=1&rel=0`:a?`https://www.youtube-nocookie.com/embed/videoseries?list=${encodeURIComponent(a)}&autoplay=1&rel=0`:""},d=({video:e,onClose:a})=>{const n=(0,o.useRef)();return(0,o.useEffect)(()=>{const t=n.current;e&&t&&!t.open&&t.showModal()},[e]),(0,t.createElement)("dialog",{ref:n,className:"alfb-video-popup","aria-label":e?.title||(0,l.__)("Video tutorial","softicon-flipbook"),onClose:a,onClick:e=>e.target===n.current&&n.current.close()},(0,t.createElement)("button",{type:"button",className:"alfb-video-close","aria-label":(0,l.__)("Close","softicon-flipbook"),onClick:()=>n.current.close()},(0,t.createElement)("span",{className:"dashicons dashicons-no-alt","aria-hidden":"true"})),(0,t.createElement)("div",{className:"alfb-video-frame"},e&&(0,t.createElement)("iframe",{src:p(e.url),title:e.title,allow:"autoplay; encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0})))},m=e=>{const t=window.location.hash.replace(/^#\/?/,"").split(/[/?]/)[0];if(t)return t;const o=new URLSearchParams(window.location.search).get("tab");return o&&e.includes(o)?o:e[0]},f=({notice:e,tab:a})=>{const[n,s]=(0,o.useState)(!0),[i]=(0,o.useState)(a),r="warning"!==e.type;return(0,o.useEffect)(()=>{r&&a!==i&&s(!1)},[r,a,i]),(0,o.useEffect)(()=>{const e=new URL(window.location.href);e.searchParams.has("alfb_fs")&&(e.searchParams.delete("alfb_fs"),window.history.replaceState(window.history.state,"",e.toString()))},[]),n?(0,t.createElement)("div",{className:"notice inline alfb-notice notice-"+e.type+(r?" is-dismissible":""),role:"status"},(0,t.createElement)("p",null,e.text),r&&(0,t.createElement)("button",{type:"button",className:"notice-dismiss",onClick:()=>s(!1)},(0,t.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Dismiss this notice.","softicon-flipbook")))):null},h=({review:e})=>{const[a,n]=(0,o.useState)(!0);if(!a)return null;const i=e=>{n(!1),s()({path:"/alfb/v1/dashboard/review",method:"POST",data:{answer:e}}).catch(()=>{})};return(0,t.createElement)("div",{className:"notice inline alfb-notice alfb-review notice-info",role:"status"},(0,t.createElement)("p",null,(0,t.createElement)("strong",null,(0,l.__)("Enjoying SoftIcon Flipbook?","softicon-flipbook"))," ",(0,l.__)("A quick review on WordPress.org helps other people find it, and it means a lot to our small team.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-review-actions"},(0,t.createElement)("a",{className:"button button-primary",href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>i("done")},(0,l.__)("Leave a review","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"button",onClick:()=>i("later")},(0,l.__)("Maybe later","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"button-link",onClick:()=>i("done")},(0,l.__)("I already did","softicon-flipbook"))))},b=({config:e,tabs:n})=>{const[s]=(0,o.useState)(()=>(e=>e.tabs.map(e=>e.key))(e)),r=(e=>{const[t,a]=(0,o.useState)(()=>m(e));return(0,o.useEffect)(()=>{const t=()=>{a(m(e)),window.scrollTo(0,0)};return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[e]),t})(s),[p,b]=(0,o.useState)(null),[u,k]=(0,o.useState)(!1),_=()=>k(!0),E="videos"===r?"welcome":r,y=s.includes(E)&&n[E]?E:s[0],g=n[y],w=e.lockedTabs.includes(y);(0,o.useEffect)(()=>{w&&k(!0)},[w]);const v=i(e,y);(0,o.useEffect)(()=>{if(v)try{window.localStorage.setItem("alfb-group-"+v.key,y)}catch(e){}},[v,y]),(0,o.useEffect)(()=>{"videos"===r&&document.getElementById("alfb-videos")?.scrollIntoView({behavior:"smooth"})},[r]);const N=w?(0,t.createElement)("div",{className:"alfb-card alfb-status"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("This is a Pro feature.","softicon-flipbook")):(0,t.createElement)(g,{config:e,play:b,unlock:_});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(c,{config:e,active:y,unlock:_}),(0,t.createElement)("div",{className:"alfb-dash-body"},e.notice&&(0,t.createElement)(f,{notice:e.notice,tab:y}),e.review&&(0,t.createElement)(h,{review:e.review}),v?(0,t.createElement)("div",{className:"alfb-group"},(0,t.createElement)("nav",{className:"alfb-group-nav","aria-label":v.label},(0,t.createElement)("span",{className:"alfb-group-title"},v.label),v.items.map(o=>{const a=e.lockedTabs.includes(o.key);return(0,t.createElement)("a",{key:o.key,href:"#/"+o.key,className:o.key===y?"is-active":void 0,"aria-current":o.key===y?"page":void 0,onClick:a?e=>{e.preventDefault(),_()}:void 0},(0,t.createElement)("span",{className:"alfb-group-icon dashicons dashicons-"+(o.icon||"admin-generic"),"aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,o.label,a&&(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-label":(0,l.__)("Locked","softicon-flipbook")}),!e.pro&&(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),o.text&&(0,t.createElement)("small",null,o.text)))})),(0,t.createElement)("div",{className:"alfb-group-main"},N)):N),(0,t.createElement)(d,{video:p,onClose:()=>b(null)}),(0,a.applyFilters)("alfb.dashboard.popup",null,{open:u,onClose:()=>k(!1),config:e}))},u=({url:e,title:o,play:a,className:l,children:n})=>(0,t.createElement)("a",{className:l,href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button||(t.preventDefault(),a({url:e,title:o}))}},n),k=window.wp.primitives,_=((0,t.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(k.Path,{d:"M12 6.5C10.3 5.3 8 4.75 5 4.75H3v13h2c3 0 5.3.55 7 1.75 1.7-1.2 4-1.75 7-1.75h2v-13h-2c-3 0-5.3.55-7 1.75m-1.25 10.6c-1.5-.6-3.4-.9-5.75-.85V6.25c2.5 0 4.4.45 5.75 1.4zm8.25-.85c-2.35-.05-4.25.25-5.75.85V7.65c1.35-.95 3.25-1.4 5.75-1.4z"})),(e,o=!1)=>(0,t.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,t.createElement)(k.Path,{d:e,fillRule:o?"evenodd":void 0}))),E=(_("M6 2.5h7.6L19.5 8.4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M6 4v16h12V9.5h-5.5V4zm8 .6V8h3.4zM8 12.5h8V14H8zm0 3h8V17H8z",!0),_("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m0 1.5v10.4l4.2-4.2 2.8 2.8 4.3-4.7 3.7 4V6zM8.5 10.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5",!0),_("M2 4.5h14v10H2zm1.5 1.5v7h11V6zM6 16.5h6V18H6zM17 8h5v12.5h-5zm1.5 1.5V19h2V9.5z",!0),_("M2.5 5h8.5v14H2.5zM4 6.5v11h5.5v-11zM13 5h8.5v14H13zm1.5 1.5v11H20v-11z",!0),_("M6.5 3h11v18h-11zM8 4.5v15h8v-15zM10 8h4v1.5h-4zm0 3h4v1.5h-4z",!0),_("M3 6.5h8.25v11H3zM4.5 8v8h5.25V8zM12.75 6.5H21v11h-8.25zm1.5 1.5v8h5.25V8z",!0),_("M1.5 4.5h21v15h-21zM3 6v12h8.25V6zm9.75 0v12H21V6z",!0),_("M6 2.5h12A1.5 1.5 0 0 1 19.5 4v16a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M8 4v16h10V4zm2.5 3H16v1.5h-5.5z",!0),_("M4 7h16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2m0 1.5a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5zM7 11.25h10v1.5H7z",!0),_("M3 7h18v1.5H3zm0 4.5h12V13H3zm0 4.5h7.5v1.5H3z"),_("M4 5h16v1.5H4zm0 4h10v1.5H4zm0 4h16v1.5H4zm0 4h10v1.5H4z"),_("M4 5h16v1.5H4zm3 4h10v1.5H7zm-3 4h16v1.5H4zm3 4h10v1.5H7z"),_("M4 5h16v1.5H4zm6 4h10v1.5H10zm-6 4h16v1.5H4zm6 4h10v1.5H10z"),(e,o=!1)=>(0,t.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,t.createElement)(k.Path,{d:e,fillRule:o?"evenodd":void 0}))),y=(E("M12 2.75a9.25 9.25 0 1 1 0 18.5 9.25 9.25 0 0 1 0-18.5m0 1.5a7.75 7.75 0 1 0 0 15.5 7.75 7.75 0 0 0 0-15.5M11.2 10.6h1.6V17h-1.6zm0-3.4h1.6v1.7h-1.6z",!0),E("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m5.5 4v7l6-3.5z"),E("M4.5 4h15A1.5 1.5 0 0 1 21 5.5v10a1.5 1.5 0 0 1-1.5 1.5H10l-5 4v-4h-.5A1.5 1.5 0 0 1 3 15.5v-10A1.5 1.5 0 0 1 4.5 4M7 8.5V10h10V8.5zm0 3V13h7v-1.5z",!0),E("M12 2.75l2.85 5.95 6.55.75-4.85 4.5 1.3 6.5L12 17.2l-5.85 3.25 1.3-6.5L2.6 9.45l6.55-.75z"),E("M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z"),(0,l.__)("General","softicon-flipbook"),(0,l.__)("Style","softicon-flipbook"),(0,l.__)("Auto","softicon-flipbook"),(0,l.__)("Two pages","softicon-flipbook"),(0,l.__)("One page","softicon-flipbook"),(0,l.__)("PDF file","softicon-flipbook"),(0,l.__)("Images","softicon-flipbook"),"&list=PLJEAefIarF4g"),g={overview:"https://www.youtube.com/watch?v=5geq69DXoN8"+y,add:"https://www.youtube.com/watch?v=KGP_xpi8NGo"+y,design:"https://www.youtube.com/watch?v=qqQeZQkX5ms"+y,reading:"https://www.youtube.com/watch?v=1J7wCaUvugc"+y,lightbox:"https://www.youtube.com/watch?v=XBJuUV9HpkA"+y,settings:"https://www.youtube.com/watch?v=H9IxgIocY68"+y,promo:"https://www.youtube.com/watch?v=Oj9sHOZbb3A"+y,shortcode:"https://www.youtube.com/watch?v=slQlR4GTghg"+y,autoplay:"https://www.youtube.com/watch?v=bkuMUupI92Y"+y,rtl:"https://www.youtube.com/watch?v=MzZs4jJInFA"+y,shelf:"https://www.youtube.com/watch?v=9UY2KNYzkGk"+y,buttons:"https://www.youtube.com/watch?v=fS5RMGkPQXk"+y,leads:"https://www.youtube.com/watch?v=GxbrW_pyAdA"+y,protect:"https://www.youtube.com/watch?v=5UNgRO22s_Q"+y,hotspots:"https://www.youtube.com/watch?v=D7WiNswbHi8"+y,branding:"https://www.youtube.com/watch?v=iOr2NJ0yaAA"+y,analytics:"https://www.youtube.com/watch?v=ET4JXhOO-2s"+y,field:"https://www.youtube.com/watch?v=BGlS_IKKagM"+y,bookmarks:"https://www.youtube.com/watch?v=4-D5HxqV1yg"+y,pro:"https://www.youtube.com/watch?v=LtCj7-J2qXI"+y},w=((0,l.__)("Classic","softicon-flipbook"),(0,l.__)("Hardcover","softicon-flipbook"),(0,l.__)("Cover","softicon-flipbook"),(0,l.__)("Button","softicon-flipbook"),(0,l.__)("Text link","softicon-flipbook"),(0,l.__)("Left","softicon-flipbook"),(0,l.__)("Center","softicon-flipbook"),(0,l.__)("Right","softicon-flipbook"),(0,l.__)("Video tutorials","softicon-flipbook"),(0,l.__)("Get support","softicon-flipbook"),(0,l.__)("Rate Flipbook","softicon-flipbook"),(0,l.__)("More plugins","softicon-flipbook"),"alfb_start_tab"),v=e=>`[softicon_flipbook id="${e}"]`,N=({text:e,label:a})=>{const[n,s]=(0,o.useState)(!1);return(0,t.createElement)("button",{type:"button",className:"alfb-copy"+(n?" is-copied":""),"aria-label":a,onClick:()=>(e=>{if(window.navigator.clipboard&&window.isSecureContext)return window.navigator.clipboard.writeText(e);const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.append(t),t.select();const o=document.execCommand("copy");return t.remove(),o?Promise.resolve():Promise.reject()})(e).then(()=>{s(!0),setTimeout(()=>s(!1),1600)}).catch(()=>{})},(0,t.createElement)("span",{className:"dashicons "+(n?"dashicons-yes":"dashicons-admin-page"),"aria-hidden":"true"}),n?(0,l.__)("Copied","softicon-flipbook"):(0,l.__)("Copy","softicon-flipbook"))},S=({text:e,label:o})=>(0,t.createElement)("div",{className:"alfb-code"},(0,t.createElement)("code",null,e),(0,t.createElement)(N,{text:e,label:o})),x=({start:e})=>(0,t.createElement)("div",{className:"alfb-start-books"},(0,t.createElement)("h4",null,(0,l.__)("Your flipbooks","softicon-flipbook")),e.books.length?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("ul",null,e.books.map(e=>(0,t.createElement)("li",{key:e.id},(0,t.createElement)("a",{className:"alfb-start-book",href:e.edit},e.title),(0,t.createElement)(S,{text:v(e.id),label:(0,l.sprintf)(/* translators: %s: flipbook title */ /* translators: %s: flipbook title */
    22(0,l.__)("Copy the shortcode of %s","softicon-flipbook"),e.title)})))),(0,t.createElement)("p",{className:"alfb-start-more"},e.total>e.books.length&&(0,t.createElement)("a",{href:e.allBooks},(0,l.sprintf)(/* translators: %d: number of flipbooks */ /* translators: %d: number of flipbooks */
    3 (0,l._n)("See all %d flipbook","See all %d flipbooks",e.total,"softicon-flipbook"),e.total)),(0,t.createElement)("a",{href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))):(0,t.createElement)("div",{className:"alfb-start-empty"},(0,t.createElement)("p",null,(0,l.__)("No flipbooks yet. Make one and its shortcode shows up here, ready to copy.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))),C=({url:e,title:o,play:a})=>(0,t.createElement)(u,{className:"alfb-start-video",url:e,title:o,play:a},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,t.createElement)("span",null,o)),F=({n:e,title:o,children:a,action:l})=>(0,t.createElement)("li",{className:"alfb-start-step"},(0,t.createElement)("span",{className:"alfb-step"},e),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,o),a,l)),P=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(F,{n:1,title:(0,l.__)("Make the flipbook","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Go to Flipbook → All Flipbooks → Add a flipbook. It opens with the Flipbook block: pick the PDF and the look, then publish.","softicon-flipbook"))),(0,t.createElement)(F,{n:2,title:(0,l.__)("Copy its shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every flipbook has a shortcode in the All Flipbooks list and in the block's Help panel. Your flipbooks are listed here too.","softicon-flipbook")))),I=({config:e,play:a})=>{const n={...e.start,newPage:e.urls.newPage,pro:e.pro},s=(e=>[{key:"block",icon:"block-default",label:(0,l.__)("Block editor","softicon-flipbook"),on:!e.classic,steps:(0,t.createElement)(t.Fragment,null,(0,t.createElement)(F,{n:1,title:(0,l.__)("Add the Flipbook block","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newPage},(0,l.__)("Create a flipbook page","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In any page or post, click <b>+</b> and search for <b>Flipbook</b>, or type <code>/flipbook</code> in an empty line.","softicon-flipbook"),{b:(0,t.createElement)("strong",null),code:(0,t.createElement)("code",null)}))),(0,t.createElement)(F,{n:2,title:(0,l.__)("Pick a PDF or images","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Upload a PDF, choose one from the Media Library, paste a link, or build the book from your own images.","softicon-flipbook"))),(0,t.createElement)(F,{n:3,title:(0,l.__)("Choose the look and publish","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Classic or Hardcover, on the page or in a popup: every setting is in the block's sidebar, and the editor shows the finished book.","softicon-flipbook")))),video:[g.add,(0,l.__)("Add a flipbook in 36 seconds","softicon-flipbook")]},{key:"classic",icon:"editor-paste-text",label:(0,l.__)("Classic editor","softicon-flipbook"),on:e.classic,books:!0,steps:(0,t.createElement)(t.Fragment,null,P(e),(0,t.createElement)(F,{n:3,title:(0,l.__)("Paste it in the Classic Editor","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Paste the shortcode where the book goes, in the Visual or the Text tab, then update the page. It works in text widgets too.","softicon-flipbook")),(0,t.createElement)(S,{text:v(e.books[0]?.id||123),label:(0,l.__)("Copy the shortcode","softicon-flipbook")}))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]},{key:"builders",icon:"layout",label:(0,l.__)("Elementor & builders","softicon-flipbook"),on:e.elementor,books:!0,steps:(0,t.createElement)(t.Fragment,null,P(e),(0,t.createElement)(F,{n:3,title:(0,l.__)("Add a Shortcode widget","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In <b>Elementor</b>, drag the <b>Shortcode</b> widget onto the page and paste the shortcode; the book shows in Elementor's preview too. Other builders work the same way:","softicon-flipbook"),{b:(0,t.createElement)("strong",null)})),(0,t.createElement)("ul",{className:"alfb-start-builders"},(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Divi")," – ",(0,l.__)("Code module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Beaver Builder")," – ",(0,l.__)("HTML or Text Editor module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"WPBakery")," – ",(0,l.__)("Text Block","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Bricks, Oxygen")," – ",(0,l.__)("Shortcode element","softicon-flipbook"))))),video:[g.shortcode,(0,l.__)("The shortcode in Elementor and more","softicon-flipbook")]},{key:"theme",icon:"editor-code",label:(0,l.__)("Theme / PHP","softicon-flipbook"),on:!1,books:!0,steps:(0,t.createElement)(t.Fragment,null,e.blockTheme&&(0,t.createElement)(F,{n:1,title:(0,l.__)("Block theme: add the block to a template","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.siteEditor},(0,l.__)("Open the Site Editor","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Your theme is a block theme. In Appearance → Editor → Templates, open a template and add the Flipbook block like on any page.","softicon-flipbook"))),(0,t.createElement)(F,{n:e.blockTheme?2:1,title:(0,l.__)("Any theme: print the shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("Make the flipbook under All Flipbooks, then show it from a template file, such as <code>single.php</code>, with:","softicon-flipbook"),{code:(0,t.createElement)("code",null)})),(0,t.createElement)(S,{text:`<?php echo do_shortcode( '${v(e.books[0]?.id||123)}' ); ?>`,label:(0,l.__)("Copy the PHP code","softicon-flipbook")})),(0,t.createElement)(F,{n:e.blockTheme?3:2,title:(0,l.__)("One book for every post","softicon-flipbook")},e.pro?(0,t.createElement)("p",null,(0,l.__)('Keep each post\'s PDF in a Meta Box or ACF field, put one flipbook in the template, and turn on "PDF from a custom field" in its Source panel: every post shows its own book.',"softicon-flipbook")):(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("With Pro, one flipbook in a template shows each post's own PDF from a Meta Box or ACF field. <a>See Pro</a>","softicon-flipbook"),{a:(0,t.createElement)("a",{href:"#/pricing"})})))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]}])(n),[i,r]=(0,o.useState)(()=>{const e=(()=>{try{return window.localStorage.getItem(w)}catch(e){return null}})();return s.some(t=>t.key===e)?e:n.classic?"classic":n.elementor?"builders":"block"}),c=e=>{r(e);try{window.localStorage.setItem(w,e)}catch(e){}},p=s.find(e=>e.key===i)||s[0];return(0,t.createElement)("section",{className:"alfb-start"},(0,t.createElement)("header",{className:"alfb-start-head"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Getting started","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Pick where you build your pages; the steps follow.","softicon-flipbook")))),(0,t.createElement)("div",{className:"alfb-start-tabs",role:"tablist","aria-label":(0,l.__)("Where you build your pages","softicon-flipbook"),onKeyDown:e=>{const t=s.findIndex(e=>e.key===i),o={ArrowRight:t+1,ArrowLeft:t-1,Home:0,End:s.length-1}[e.key];if(void 0===o)return;e.preventDefault();const a=s[(o+s.length)%s.length].key;c(a),e.currentTarget.querySelector(`[data-tab="${a}"]`)?.focus()}},s.map(e=>(0,t.createElement)("button",{key:e.key,type:"button",role:"tab",id:"alfb-start-tab-"+e.key,"data-tab":e.key,"aria-selected":e.key===i,"aria-controls":"alfb-start-panel",tabIndex:e.key===i?0:-1,className:e.key===i?"is-active":"",onClick:()=>c(e.key)},(0,t.createElement)("span",{className:"dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("span",null,e.label),e.on&&"block"!==e.key&&(0,t.createElement)("span",{className:"alfb-start-on"},(0,l.__)("On this site","softicon-flipbook"))))),(0,t.createElement)("div",{className:"alfb-start-body",role:"tabpanel",id:"alfb-start-panel","aria-labelledby":"alfb-start-tab-"+p.key},(0,t.createElement)("ol",{className:"alfb-start-steps"},p.steps),(0,t.createElement)("aside",{className:"alfb-start-side"},p.books?(0,t.createElement)(x,{start:n}):(0,t.createElement)("div",{className:"alfb-start-books"},(0,t.createElement)("h4",null,(0,l.__)("Fastest start","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("A new page opens with a sample book already in place; swap in your own PDF.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:n.newPage},(0,l.__)("Create a flipbook","softicon-flipbook"))),(0,t.createElement)(C,{url:p.video[0],title:p.video[1],play:a}))))},A=({config:e,play:o})=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("section",{className:"alfb-hero"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Turn any PDF into a book people enjoy reading","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-actions"},(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:e.urls.newPage},(0,l.__)("Create a flipbook","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-ghost",href:"#/demos"},(0,l.__)("See the demos","softicon-flipbook")))),(0,t.createElement)(u,{className:"alfb-hero-video",url:e.urls.playlist,title:(0,l.__)("Video tutorials","softicon-flipbook"),play:o},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch the video tutorials","softicon-flipbook"))),(0,t.createElement)(I,{config:e,play:o}),(0,t.createElement)("h2",{className:"alfb-title",id:"alfb-videos"},(0,l.__)("Video tutorials","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-grid alfb-videos"},e.videos.map(e=>(0,t.createElement)(u,{key:e.url,className:"alfb-card alfb-video",url:e.url,title:e.title,play:o},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"}),e.title)))),L={},M=e=>{const[t,a]=(0,o.useState)(()=>L[e]||{loading:!0});return(0,o.useEffect)(()=>{if(L[e])return;let t=!0;return s()({path:e}).then(e=>({data:e}),e=>({error:e.message||(0,l.__)("Something went wrong. Please try again.","softicon-flipbook")})).then(o=>{L[e]=o,t&&a(o)}),()=>{t=!1}},[e]),t},T=JSON.parse('{"attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}}}'),D=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],O=Object.fromEntries(Object.entries(T.attributes).map(([e,t])=>[e,t.default])),z=e=>(e=>{const{source:t,pdfUrl:o,images:a,pageMode:l,bookStyle:n,sideArrows:s,showCover:i,startPage:r,startWith:c,bookTitle:p,theme:d,autoplay:m,autoplaySeconds:f,autoplayLoop:h,rtl:b,phoneFullscreen:u,maxHeight:k,maxHeightTablet:_,maxHeightPhone:E,showDownload:y,showPrint:g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:C,showShare:F,flipSound:P}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?a:[],pageMode:["auto","double","single"].includes(l)?l:"auto",bookStyle:"hardcover"===n?"hardcover":"flat",sideArrows:!!s,showCover:i,startPage:Math.max(1,parseInt(r,10)||1),title:(p||"").trim(),startWith:["thumbnails","contents"].includes(c)?c:"book",theme:["dark","auto"].includes(d)?d:"light",autoplay:!!m,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==h,rtl:!!b,phoneFullscreen:!!u,maxHeight:Math.min(2e3,Math.max(200,parseInt(k,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(E,10)>0?Math.min(2e3,Math.max(200,parseInt(E,10))):0,showDownload:y,showPrint:!!g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:!1!==C,showShare:!!F,flipSound:P}})({...O,...e}),H=e=>{const t={};return[["bgColor","--alfb-bg"],["toolbarBg","--alfb-bar-bg"],["toolbarColor","--alfb-bar-color"],["coverColor","--alfb-cover"]].forEach(([o,a])=>{const l=(n="string"==typeof(n=e[o])?n.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(n)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(n)&&[...n.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>D.includes(e))?n:void 0);var n;l&&(t[a]=l)}),t},V={"alfb-block":""},$=(0,o.memo)(({attributes:e,config:o})=>(0,t.createElement)("div",{className:"alfb_wrapper wp-block-softicon-flipbook",...V,"data-alfb":JSON.stringify(o),style:H(e),tabIndex:"0",role:"region","aria-label":(0,l.__)("Flipbook","softicon-flipbook")},(0,t.createElement)("div",{className:"alfb_stage"},(0,t.createElement)("div",{className:"alfb_loading"},(0,t.createElement)("span",{className:"alfb_spinner"}))))),B=(0,o.memo)(({attributes:e,config:o})=>{const a={...O,...e},n=(a.lightboxText||"").trim(),s=n||(0,l.__)("Read the flipbook","softicon-flipbook"),i="cover"===a.lightboxTrigger,r={...H(a),...i?{"--alfb-lb-width":Math.min(600,Math.max(120,a.lightboxWidth))+"px"}:{}};return(0,t.createElement)("div",{className:"alfb_lb wp-block-softicon-flipbook alfb_lb_"+a.lightboxAlign+(i?" alfb_lb_draw":""),...V,"data-alfb":JSON.stringify(o),style:r},i?(0,t.createElement)("a",{className:"alfb_lb_trigger alfb_lb_cover",href:o.pdf,"aria-haspopup":"dialog","aria-label":n?void 0:s},(0,t.createElement)("span",{className:"alfb_lb_img"}),n&&(0,t.createElement)("span",{className:"alfb_lb_caption"},n)):(0,t.createElement)("a",{className:"alfb_lb_trigger "+("button"===a.lightboxTrigger?"alfb_lb_button wp-element-button":"alfb_lb_link"),href:o.pdf,"aria-haspopup":"dialog"},s))}),U=({book:e})=>{if(e.Component)return(0,t.createElement)(e.Component,{...e});const o=e.config||z(e.attributes);return"lightbox"===e.attributes?.displayMode?(0,t.createElement)(B,{attributes:e.attributes,config:o}):(0,t.createElement)($,{attributes:e.attributes||{},config:o})},W=({unlock:e})=>{const{data:o}=M("/alfb/v1/dashboard/plans");return(o?.pro_only||[]).filter(e=>e.featured).map(o=>(0,t.createElement)("article",{key:o.title,className:"alfb-card alfb-demo is-pro"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,o.title," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("p",null,o.text)),(0,t.createElement)("div",{className:"alfb-demo-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})),(0,t.createElement)("footer",null,(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/compare",onClick:e?t=>{t.preventDefault(),e()}:void 0},(0,l.__)("Available in Pro","softicon-flipbook")))))},q=({config:e,unlock:n})=>{const s=(0,o.useMemo)(()=>(0,a.applyFilters)("alfb.dashboard.demos",(e=>{const t={pdfUrl:e+"spring-catalog.pdf",maxHeight:420},o={pdfUrl:e+"room-guide.pdf",maxHeight:420};return[{key:"classic",title:(0,l.__)("Classic book","softicon-flipbook"),text:(0,l.__)("The default look: two pages side by side, one page on phones, and the full toolbar.","softicon-flipbook"),books:[{attributes:t}]},{key:"hardcover",title:(0,l.__)("Hardcover","softicon-flipbook"),text:(0,l.__)("Pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows.","softicon-flipbook"),books:[{attributes:{...t,bookStyle:"hardcover",sideArrows:!0,coverColor:"#0f766e"}}]},{key:"guide",title:(0,l.__)("Chapters and links","softicon-flipbook"),text:(0,l.__)("A PDF with bookmarks gets a table of contents, and the links inside it can be clicked.","softicon-flipbook"),books:[{attributes:o}]},{key:"covers",row:!0,title:(0,l.__)("Covers that open a popup","softicon-flipbook"),text:(0,l.__)("Only the covers show on the page. A click opens the book over the page, and it loads only then.","softicon-flipbook"),books:[{attributes:{...t,displayMode:"lightbox",lightboxText:(0,l.__)("Spring Living 2026","softicon-flipbook"),lightboxWidth:170}},{attributes:{...o,displayMode:"lightbox",lightboxText:(0,l.__)("Room Guide 2026","softicon-flipbook"),lightboxWidth:170,bookStyle:"hardcover",sideArrows:!0}}]},{key:"button",title:(0,l.__)("A button that opens a popup","softicon-flipbook"),text:(0,l.__)("A theme-styled button, or a plain text link, opens the book in a popup.","softicon-flipbook"),books:[{attributes:{...o,displayMode:"lightbox",lightboxTrigger:"button",lightboxText:(0,l.__)("Open the room guide","softicon-flipbook")}}]}]})(e.urls.demo),e),[e]);return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"))},[]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",{className:"alfb-lead"},(0,l.__)("These are real flipbooks, try them. Add one to any page with the Flipbook block.","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-demos"},s.map(e=>(0,t.createElement)("article",{key:e.key,className:"alfb-card alfb-demo"+(e.pro?" is-pro":"")},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,e.title,e.pro&&(0,t.createElement)(t.Fragment,null," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook")))),(0,t.createElement)("p",null,e.text)),(0,t.createElement)("div",{className:"alfb-demo-view"+(e.row?" is-row":"")},e.books.map((e,o)=>(0,t.createElement)(U,{key:o,book:e}))))),(!e.pro||e.locked)&&(0,t.createElement)(W,{unlock:e.locked?n:null})))};var R=Object.defineProperty,G=(e,t,o)=>((e,t,o)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o)(e,"symbol"!=typeof t?t+"":t,o);const j={Log(...e){console&&console.log&&console.log(...e)},Error(...e){console&&console.error&&console.error(...e)},Warn(...e){console&&console.warn&&console.warn(...e)},Debug(...e){console&&console.debug&&console.debug(...e)}},K=2147483647;function Y(e){return typeof e>"u"||"function"==typeof e||"object"==typeof e&&null!==e}function J(e){const t={};Object.entries(e).forEach(([e,o])=>{Y(o)||(t[e]=o)});const{sandbox:o}=e;return o&&o.ctx&&o.token&&(t.s_ctx_ts=o.ctx,t.sandbox=o.token),t}function Q(){return typeof window>"u"}function X(e,t){if(null==e)throw new Error(t)}class Z{constructor(e){G(this,"styleElement"),G(this,"bodyScrollDisableClassName"),G(this,"isFlashingBrowser"),G(this,"overflow",{x:0,y:0}),G(this,"metaColorSchemeValue",null),G(this,"metaColorSchemeElement",null),this.guid=e,this.bodyScrollDisableClassName=`is-fs-checkout-open-${this.guid}`,this.styleElement=document.createElement("style"),this.styleElement.textContent+=this.getBasicStyle(),this.isFlashingBrowser=function(){let e=!1;try{const t=navigator.userAgent.toLowerCase();/edge\/|trident\/|msie /.test(t)?e=!0:-1!==t.indexOf("safari")&&(t.indexOf("chrome")>-1||(e=!0))}catch{}return e}()||!Q()&&!!document.querySelector("#___gatsby"),this.metaColorSchemeElement=document.head.querySelector('meta[name="color-scheme"]')}addStyle(e){this.styleElement.textContent+=e}attach(){return document.head.appendChild(this.styleElement),this}remove(){return document.head.contains(this.styleElement)&&document.head.removeChild(this.styleElement),this}disableBodyScroll(){this.backupScrollPosition(),document.body.classList.add(this.bodyScrollDisableClassName)}enableBodyScroll(){document.body.classList.remove(this.bodyScrollDisableClassName),this.restoreScrollPosition()}disableMetaColorScheme(){this.metaColorSchemeElement&&(this.metaColorSchemeValue=this.metaColorSchemeElement.getAttribute("content"),this.metaColorSchemeElement.setAttribute("content","light"))}enableMetaColorScheme(){this.metaColorSchemeElement&&this.metaColorSchemeValue&&(this.metaColorSchemeElement.setAttribute("content",this.metaColorSchemeValue),this.metaColorSchemeValue=null)}getBasicStyle(){return`body.${this.bodyScrollDisableClassName} { overflow: hidden !important; }`}backupScrollPosition(){this.overflow={x:document.documentElement.scrollTop,y:document.documentElement.scrollLeft}}restoreScrollPosition(){document.documentElement.scrollTop=this.overflow.x,document.documentElement.scrollLeft=this.overflow.y}}const ee=class e{constructor(e,t,o="Loading Freemius Checkout"){G(this,"loaderElement"),G(this,"isOpen",!1),G(this,"loaderElementId"),this.style=e,this.loaderElementId=`fs-loader-${this.style.guid}`,this.loaderElement=document.createElement("div"),this.loaderElement.id=this.loaderElementId,this.loaderElement.innerHTML=`<img src="${t}" alt="${o}" />`,this.style.addStyle(this.getStyle())}show(){return this.isOpen||(this.loaderElement.classList.add("show"),document.body.appendChild(this.loaderElement),this.isOpen=!0),this}hide(){return this.isOpen?(this.loaderElement.classList.remove("show"),this.isOpen=!1,setTimeout(()=>{this.hideImmediate()},e.TRANSITION_TIME),this):this}hideImmediate(){return this.loaderElement.parentNode&&(this.loaderElement.classList.remove("show"),this.loaderElement.parentNode.removeChild(this.loaderElement),this.isOpen=!1),this}getStyle(){return`#${this.loaderElementId} { display: none; position: fixed; z-index: ${K-1}; width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; text-align: left; background: rgba(0, 0, 0, 0.6); transition: opacity ${e.TRANSITION_TIME}ms ease-out; will-change: opacity; opacity: 0; } #${this.loaderElementId}.show { opacity: 1; display: block; } #${this.loaderElementId} img { position: absolute; top: 40%; left: 50%; width: auto; height: auto; margin-left: -25px; background: #fff; padding: 10px; border-radius: 50%; box-shadow: 2px 2px 2px rgba(0,0,0,0.1); }`}};G(ee,"TRANSITION_TIME",200);let te=ee;const oe=class e{constructor(e,t,o,a,l){G(this,"postman",null),G(this,"iFrame"),G(this,"iFrameWrapper"),G(this,"loadedEventListeners",new Set),G(this,"closedEventListeners",new Set),this.baseUrl=e,this.visibleClass=a,this.checkoutOptions=l;const{iFrame:n,iFrameWrapper:s}=this.attachIFrame(e,t,o);this.iFrame=n,this.iFrameWrapper=s,this.addEventListeners()}static getWrapperID(e){return`${e}-wrapper`}close(){this.postman?.post("close",null)}onClosed(e){this.closedEventListeners.add(e)}onLoaded(e){this.loadedEventListeners.add(e)}addToExitIntent(e){e.addListener(()=>{this.postman?.post("exit_intent",null),this.checkoutOptions.onExitIntent?.()})}attachIFrame(t,o,a){const l=`${t}/?${function(e){const t=[];return Object.keys(e).forEach(o=>{const a=function(e){return Y(e)?null:null===e?"null":!0===e?"1":!1===e?"0":encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}(e[o]);null!==a&&t.push(`${o}=${a}`)}),t.join("&")}(o)}#${encodeURIComponent(document.location.href)}`,n=document.createElement("iframe");n.id=a,n.src=l,n.setAttribute("allowTransparency","true"),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("style","background: rgba(0,0,0,0.003); border: 0 none transparent;"),n.setAttribute("frameborder","0"),n.setAttribute("data-testid",n.id);const s=this.checkoutOptions.modal_title??e.DEFAULT_TITLE;n.setAttribute("title",s);const i=document.createElement("div");return i.setAttribute("role","dialog"),i.setAttribute("aria-label",s),i.setAttribute("aria-modal","true"),i.setAttribute("data-testid",`${n.id}-wrapper`),i.id=e.getWrapperID(a),i.appendChild(n),document.body.appendChild(i),{iFrame:n,iFrameWrapper:i}}addEventListeners(){const{success:e,purchaseCompleted:t,cancel:o,track:a,afterOpen:l,afterClose:n}=this.checkoutOptions;this.postman=function(e,t){const o=e.contentWindow,a=e.src,l={};if(!o||!a)return null;const n=function(e){if(!(e&&e.origin&&e.origin.indexOf("js.stripe.com")>0||e.origin.indexOf("www.paypal.com")>0)&&e.origin===t&&e&&e.data&&"string"==typeof e.data&&"{"===e.data.charAt(0))try{const t=JSON.parse(e.data);"object"==typeof t&&t.type&&l[t.type]&&l[t.type].forEach(e=>{e(t.data)})}catch(e){j.Error(e)}};return window.addEventListener("message",n),{on(e,t){l[e]||(l[e]=[]),l[e].push(t)},one(e,t,o=!1){o&&delete l[e],!l[e]&&this.on(e,t)},destroy(){window.removeEventListener("message",n)},post(e,t){o.postMessage(JSON.stringify({type:e,data:t}),a.replace(/([^:]+:\/\/[^/]+).*/,"$1"))}}}(this.iFrame,this.baseUrl),this.postman?.one("upgraded",t=>{try{e?.(t)}catch(e){j.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.one("purchaseCompleted",e=>{try{t?.(e)}catch(e){j.Error(e)}},!0),this.postman?.one("canceled",()=>{try{o?.()}catch(e){j.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.on("track",e=>{try{a?.(e.event,e)}catch(e){j.Error(e)}}),this.postman?.one("loaded",()=>{this.dispatchOnLoaded(),this.iFrame?.classList.add(this.visibleClass);try{l?.()}catch(e){j.Error(e)}},!0)}removeIFrameAndPostman(){this.postman?.destroy(),this.postman=null,this.iFrame.remove(),this.iFrameWrapper.remove(),this.closedEventListeners.clear(),this.loadedEventListeners.clear()}dispatchOnLoaded(){this.loadedEventListeners.forEach(e=>e())}dispatchOnClosed(){this.closedEventListeners.forEach(e=>e())}};G(oe,"DEFAULT_TITLE","Checkout");let ae=oe;const le=class e{constructor(e,t,o){G(this,"iFrameID"),this.style=e,this.options=t,this.baseUrl=o,this.iFrameID=`fs-checkout-page-${this.style.guid}`}create(t){const o={...this.options,...t};return new ae(this.baseUrl,this.getQueryParams(o),this.iFrameID,e.VISIBLE_CLASS,o)}addStyle(){this.style.addStyle(this.getStyle())}getQueryParams(e){return{mode:"dialog",guid:this.style.guid,_fs_checkout:!0,...J(e)}}getStyle(){return`#${this.iFrameID} { z-index: ${K-1}; background: rgba(0,0,0,0.003); border: 0 none transparent; visibility: ${this.style.isFlashingBrowser?"hidden":"visible"}; margin: 0; padding: 0; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; -webkit-tap-highlight-color: transparent; overflow: hidden; } #${this.iFrameID}.${e.VISIBLE_CLASS} { visibility: visible; } #${ae.getWrapperID(this.iFrameID)} { z-index: ${K-1}; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; overflow: hidden; }`}};G(le,"VISIBLE_CLASS","show");let ne=le;class se{constructor(e,t,o,a,l){G(this,"checkoutIFrameBuilder"),G(this,"checkoutIFrame",null),G(this,"lastFocusedElement",null),this.style=e,this.exitIntent=t,this.loader=o,this.checkoutIFrameBuilder=new ne(this.style,l,a),this.checkoutIFrameBuilder.addStyle()}isOpen(){return null!==this.checkoutIFrame}open(e){return this.isOpen()||(this.backupFocusedElement(),this.style.attach(),this.style.disableBodyScroll(),this.style.disableMetaColorScheme(),this.loader.show(),this.exitIntent.attach(),this.checkoutIFrame=this.checkoutIFrameBuilder.create(e),this.checkoutIFrame.onLoaded(this.onLoaded.bind(this)),this.checkoutIFrame.onClosed(this.onClosed.bind(this)),this.checkoutIFrame.addToExitIntent(this.exitIntent)),this}close(){return this.checkoutIFrame?.close(),this.loader.hideImmediate(),this}onLoaded(){this.loader.hide()}onClosed(){this.checkoutIFrame=null,this.loader.hide(),this.style.enableBodyScroll(),this.style.enableMetaColorScheme(),this.exitIntent.detach(),this.restoreFocusedElement(),this.style.remove()}backupFocusedElement(){this.lastFocusedElement=document.activeElement??null}restoreFocusedElement(){this.lastFocusedElement&&(this.lastFocusedElement.focus?.(),this.lastFocusedElement=null)}}class ie{constructor(e){G(this,"exitIntentId"),G(this,"exitIntentDiv",null),G(this,"clearExitIntentListener",null),G(this,"listeners",[]),this.style=e,this.exitIntentId=`fs-exit-intent-${this.style.guid}`,this.style.addStyle(this.getStyle())}isAttached(){return null!==this.exitIntentDiv}addListener(...e){this.listeners.push(...e)}attach(...e){if(e&&this.addListener(...e),this.isAttached())return this;this.exitIntentDiv=document.createElement("div"),this.exitIntentDiv.id=this.exitIntentId,document.body.appendChild(this.exitIntentDiv);const t=document.documentElement;let o=null;const a=e=>{e.pageY<=20&&(o=window.setTimeout(()=>{try{this.fireListeners()}catch(e){j.Error(e)}},300))},l=()=>{o&&(clearTimeout(o),o=null)};return t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",l),this.clearExitIntentListener=()=>{o&&(clearTimeout(o),o=null),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",l)},this}detach(){return this.isAttached()?(this.exitIntentDiv?.remove(),this.exitIntentDiv=null,this.clearExitIntentListener?.(),this):this}fireListeners(){this.listeners.forEach(e=>{e()})}getStyle(){return`#${this.exitIntentId} { z-index: ${K}; border: 0; background: transparent; position: fixed; padding: 0; margin: 0; height: 10px; left: 0; right: 0; width: 100%; top: 0; }`}}const re=class e{constructor(e){G(this,"queryParams",null),this.url=e,this.queryParams=this.parseQueryStringForCart()}hasCart(){return null!==this.queryParams}getPluginID(){return X(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_id}getPluginPublicKey(){return X(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_public_key}matchesPluginID(e){const t=Number.parseInt(this.getPluginID(),10),o=Number.parseInt(e.toString(),10);return Number.isFinite(t)&&Number.isFinite(o)&&t===o}getCheckoutOptions(){X(this.queryParams,e.NO_CART_FOUND_MESSAGE);const t={plugin_id:"",public_key:""};return Object.entries(this.queryParams).forEach(([e,o])=>{"__fs_plugin_id"===e?t.plugin_id=o:"__fs_plugin_public_key"===e?t.public_key=o:t[e]=o}),t}parseQueryStringForCart(){const e=new URLSearchParams(this.url.search);if(!e.has("__fs_authorization"))return null;const t={};return e.forEach((e,o)=>{o.startsWith("__fs_")&&(t[o]=e)}),t}};G(re,"NO_CART_FOUND_MESSAGE","No cart was found");let ce=re;const pe="https://checkout.freemius.com";class de{constructor(e,t=!0,o=null){G(this,"options",{plugin_id:0,public_key:""}),G(this,"guid"),G(this,"baseUrl"),G(this,"style"),G(this,"loader"),G(this,"checkoutPopup"),G(this,"exitIntent"),G(this,"cart"),this.baseUrl=o??pe;const{plugin_id:a,product_id:l,public_key:n,loadingImageAlt:s,loadingImageUrl:i,...r}=e;if(!a&&!l)throw new Error("Must provide a product_id to options.");this.options={...r,public_key:n,plugin_id:l??a},this.guid=function(){const e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}(),!Q()&&(this.baseUrl=o??(window.FS?.__FS__IS_TEST__?"http://checkout.freemius-local.com:8080":pe),this.style=new Z(this.guid),this.loader=new te(this.style,i??`${this.baseUrl}/assets/img/spinner.svg`,s),this.exitIntent=new ie(this.style),this.checkoutPopup=new se(this.style,this.exitIntent,this.loader,this.baseUrl,this.options),this.cart=new ce(new URL(window.location.href)),t&&this.recoverCart())}async open(e){if(!Q()){if(this.checkoutPopup?.isOpen())return void j.Warn("Checkout popup already open. Please close it first before opening it again.");if(!document.body)return new Promise(t=>{document.addEventListener("DOMContentLoaded",()=>{this.checkoutPopup?.open(e),t()},{once:!0})});this.checkoutPopup?.open(e)}}close(){Q()||this.checkoutPopup?.close()}destroy(){Q()||this.close()}getGuid(){return this.guid}recoverCart(){if(this.cart?.hasCart()&&this.cart?.matchesPluginID(this.options.plugin_id)){const e=this.cart.getCheckoutOptions();this.open(e)}}}const me=({error:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-status",role:e?"alert":"status"},e?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"dashicons dashicons-warning","aria-hidden":"true"}),e):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"spinner is-active"}),(0,l.__)("Loading…","softicon-flipbook"))),fe={usd:"$",eur:"€",gbp:"£",aud:"A$",cad:"C$"},he="support@softiconai.com",be=(0,t.createElement)("a",{href:"mailto:"+he}),ue=({days:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-guarantee"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.__)("Try Pro without risk","softicon-flipbook")),(0,t.createElement)("p",null,e>0
    4 /* translators: %d: number of days */?(0,l.sprintf)((0,l.__)("If Pro is not right for you, tell us within %d days and you get all your money back, no questions asked.","softicon-flipbook"),e):(0,l.__)("If Pro is not right for you, tell us and we will make it right.","softicon-flipbook")),(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Any problem or question? Email us at %s, a real person from our team will help you.","softicon-flipbook"),"<a>"+he+"</a>"),{a:be})),(0,t.createElement)("p",{className:"alfb-guarantee-why"},(0,l.__)("We build SoftIcon Flipbook for the people who use it, and your satisfaction comes first.","softicon-flipbook")))),ke=({days:e})=>(0,t.createElement)("p",{className:"alfb-note alfb-promise"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),e>0&&(0,l.sprintf)((0,l.__)("%d-day money-back guarantee","softicon-flipbook"),e)+" · ",(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Questions? %s","softicon-flipbook"),"<a>"+he+"</a>"),{a:be})),_e=({price:e})=>(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,fe[e.currency]||e.currency.toUpperCase()+" "),e.price.toLocaleString(void 0,{minimumFractionDigits:Number.isInteger(e.price)?0:2,maximumFractionDigits:2}),(0,t.createElement)("span",null,{lifetime:(0,l.__)("one-time","softicon-flipbook"),annual:(0,l.__)("per year","softicon-flipbook"),monthly:(0,l.__)("per month","softicon-flipbook")}[e.cycle])),Ee=e=>"unlimited"===e?(0,l.__)("Unlimited websites","softicon-flipbook")
    5 /* translators: %d: number of websites */:(0,l.sprintf)((0,l._n)("%d website","%d websites",e,"softicon-flipbook"),e),ye=({checkout:e,plan:o,price:a,className:n})=>{const s=`${e.base}?plan_id=${o.id}&licenses=${a.licenses}&billing_cycle=${a.cycle}`;return(0,t.createElement)("a",{className:"alfb-btn alfb-btn-block "+n,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new de({product_id:e.product,plan_id:o.id,public_key:e.key}).open({licenses:a.licenses,billing_cycle:a.cycle})}catch(e){window.open(s,"_blank","noopener")}}}},(0,l.__)("Get Pro","softicon-flipbook")," →")},ge=({checkout:e,plan:o,className:a,children:l})=>{const n=o.trial_card?"paid":"free",s=`${e.base}?plan_id=${o.id}&trial=${n}`;return(0,t.createElement)("a",{className:a,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new de({product_id:e.product,plan_id:o.id,public_key:e.key}).open({trial:n})}catch(e){window.open(s,"_blank","noopener")}}}},l)},we=e=>(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
    6 (0,l._n)("Start %d-day free trial","Start %d-day free trial",e.trial,"softicon-flipbook"),e.trial),ve=({checkout:e,plan:o})=>(0,t.createElement)("div",{className:"alfb-card alfb-trial"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
    7 (0,l._n)("Try Pro free for %d day","Try Pro free for %d days",o.trial,"softicon-flipbook"),o.trial)),(0,t.createElement)("p",null,o.trial_card?(0,l.__)("Every Pro feature on one website. Cancel before the trial ends and you pay nothing.","softicon-flipbook"):(0,l.__)("Every Pro feature on one website, no card needed. When the trial ends, pick a plan or keep using the free plugin.","softicon-flipbook"))),(0,t.createElement)(ge,{checkout:e,plan:o,className:"alfb-btn alfb-btn-amber"},we(o)," →")),Ne=({data:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-no-plans"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("p",null,e.error?(0,l.__)("The Pro plans could not be loaded right now. Please try again later.","softicon-flipbook"):(0,l.__)("SoftIcon Flipbook Pro is coming soon.","softicon-flipbook"))),Se=({eyebrow:e,title:o,children:a})=>(0,t.createElement)("div",{className:"alfb-intro"},(0,t.createElement)("span",{className:"alfb-eyebrow"},e),(0,t.createElement)("h2",null,o),a),xe=()=>M("/alfb/v1/dashboard/plans"),Ce=({play:e})=>(0,t.createElement)("p",null,(0,t.createElement)(u,{url:g.pro,title:(0,l.__)("Every Pro feature in one minute","softicon-flipbook"),play:e},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"})," ",(0,l.__)("Watch every Pro feature in one minute","softicon-flipbook"))),Fe=({play:e})=>{const{data:o,error:a,loading:n}=xe();if(n||a)return(0,t.createElement)(me,{error:a});const s=o.pro,i=s&&"lifetime"===s.prices[0].cycle;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se,{eyebrow:(0,l.__)("Pricing","softicon-flipbook"),title:i?(0,l.__)("Pay once, use it for life","softicon-flipbook"):(0,l.__)("Pick your plan","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every plan has all Pro features; pick how many websites you need.","softicon-flipbook")),(0,t.createElement)(Ce,{play:e})),s&&s.trial>0&&o.checkout&&(0,t.createElement)(ve,{checkout:o.checkout,plan:s}),s?(0,t.createElement)("div",{className:"alfb-plans alfb-plans-3"},s.prices.map(e=>(0,t.createElement)("div",{className:"alfb-plan",key:e.licenses},(0,t.createElement)("span",{className:"alfb-tag"},Ee(e.licenses)),(0,t.createElement)("h3",null,s.title),(0,t.createElement)(_e,{price:e}),(0,t.createElement)(ye,{checkout:o.checkout,plan:s,price:e,className:"alfb-btn-teal"}),(0,t.createElement)("ul",{className:"alfb-checks"},(0,t.createElement)("li",null,Ee(e.licenses)),(0,t.createElement)("li",null,(0,l.__)("Every free feature","softicon-flipbook")),o.pro_only.map(e=>(0,t.createElement)("li",{key:e.title},e.title)))))):(0,t.createElement)(Ne,{data:o}),s&&(0,t.createElement)(ue,{days:o.money_back}),(0,t.createElement)("p",{className:"alfb-note"},(0,l.__)("Secure checkout by Freemius. Pro replaces the free plugin and keeps every book you made.","softicon-flipbook")," ",(0,t.createElement)("a",{href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook"))))},Pe=({yes:e})=>(0,t.createElement)("span",{className:"alfb-mark "+(e?"is-yes":"is-no")},(0,t.createElement)("span",{className:"dashicons "+(e?"dashicons-yes":"dashicons-no-alt"),"aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},e?(0,l.__)("Included","softicon-flipbook"):(0,l.__)("Not included","softicon-flipbook"))),Ie=({play:e})=>{const{data:a,error:n,loading:s}=xe(),[i,r]=(0,o.useState)("");if(s||n)return(0,t.createElement)(me,{error:n});const c=a.pro,p=i.trim().toLowerCase(),d=[[(0,l.__)("In Free and Pro","softicon-flipbook"),a.free,!0],[(0,l.__)("Only in Pro","softicon-flipbook"),a.pro_only,!1]].map(([e,t,o])=>[e,t.filter(t=>!p||e.toLowerCase().includes(p)||(t.title+" "+t.text).toLowerCase().includes(p)),o]).filter(([,e])=>e.length),m=a.free.length>0||a.pro_only.length>0;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se,{eyebrow:(0,l.__)("Compare","softicon-flipbook"),title:(0,l.__)("Free vs Pro at a glance","softicon-flipbook")},a.pro_only.length>0&&(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("See what you get when you upgrade. %s features are only in Pro.","softicon-flipbook"),"<strong>"+a.pro_only.length.toLocaleString()+"</strong>"),{strong:(0,t.createElement)("strong",null)})),(0,t.createElement)(Ce,{play:e})),(0,t.createElement)("div",{className:"alfb-plans"},(0,t.createElement)("div",{className:"alfb-plan"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("h3",null,(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free forever, everything you need to put books on your site.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,"$"),"0",(0,t.createElement)("span",null,(0,l.__)("forever","softicon-flipbook"))),(0,t.createElement)("span",{className:"alfb-have"},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),(0,l.__)("You already have it","softicon-flipbook"))),c&&(0,t.createElement)("div",{className:"alfb-plan is-pro"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Pro","softicon-flipbook")),(0,t.createElement)("h3",null,c.title),c.text&&(0,t.createElement)("p",null,c.text),(0,t.createElement)(_e,{price:c.prices[0]}),(0,t.createElement)(ye,{checkout:a.checkout,plan:c,price:c.prices[0],className:"alfb-btn-light"}),c.trial>0&&(0,t.createElement)(ge,{checkout:a.checkout,plan:c,className:"alfb-more-plans alfb-trial-link"},we(c)),c.prices.length>1&&(0,t.createElement)("a",{className:"alfb-more-plans",href:"#/pricing"},(0,l.__)("Plans for more websites","softicon-flipbook")))),c&&(0,t.createElement)(ke,{days:a.money_back}),!c&&(0,t.createElement)(Ne,{data:a}),m&&(0,t.createElement)("section",{className:"alfb-breakdown"},(0,t.createElement)("header",null,(0,t.createElement)("h3",{id:"alfb-breakdown-title"},(0,l.__)("Feature breakdown","softicon-flipbook")),(0,t.createElement)("label",{className:"alfb-filter"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Filter features","softicon-flipbook")),(0,t.createElement)("input",{type:"search",placeholder:(0,l.__)("Filter features…","softicon-flipbook"),value:i,onChange:e=>r(e.target.value)}))),(0,t.createElement)("table",{className:"alfb-compare","aria-labelledby":"alfb-breakdown-title"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,l.__)("Feature","softicon-flipbook")),(0,t.createElement)("th",{scope:"col"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("th",{scope:"col",className:"is-pro"},(0,l.__)("Pro","softicon-flipbook")))),d.map(([e,o,a])=>(0,t.createElement)("tbody",{key:e},(0,t.createElement)("tr",{className:"alfb-group"},(0,t.createElement)("th",{scope:"rowgroup",colSpan:"3"},e)),o.map(e=>(0,t.createElement)("tr",{key:e.title},(0,t.createElement)("th",{scope:"row"},e.title,e.text&&(0,t.createElement)("small",null,e.text)),(0,t.createElement)("td",null,(0,t.createElement)(Pe,{yes:a})),(0,t.createElement)("td",null,(0,t.createElement)(Pe,{yes:!0})))))),!d.length&&(0,t.createElement)("tbody",{className:"alfb-empty"},(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"3"},(0,l.__)("No features match.","softicon-flipbook")))))))},Ae={target:"_blank",rel:"noopener noreferrer"},Le="https://softiconai.com/",Me="support@softiconai.com",Te=({config:e,play:a})=>{const[n,s]=(0,o.useState)(""),[i,r]=(0,o.useState)(0),[c,p]=(0,o.useState)(!1),d=e.pro&&!e.locked,m=(e=>[[(0,l.__)("Plugin","softicon-flipbook"),(e.pro?"SoftIcon Flipbook Pro ":"SoftIcon Flipbook ")+e.version+(e.pro&&e.locked?" ("+(0,l.__)("no license","softicon-flipbook")+")":"")],["WordPress",e.site?.wp||""],["PHP",e.site?.php||""],[(0,l.__)("Theme","softicon-flipbook"),e.site?.theme||""],[(0,l.__)("Browser","softicon-flipbook"),window.navigator.userAgent.replace(/^Mozilla\/5\.0 /,"")]])(e),f=n.trim().toLowerCase(),h=[{q:(0,l.__)("How do I add a flipbook?","softicon-flipbook"),a:(0,l.__)("Edit a page, open the block inserter, search for Flipbook and add the block. Pick a PDF from your Media Library or upload one, and the book appears right away.","softicon-flipbook"),video:g.add},{q:(0,l.__)("Does it work with the Classic Editor, Elementor or other page builders?","softicon-flipbook"),a:(0,l.__)('Yes. Go to Flipbook → All Flipbooks, add a flipbook, set it up and publish it. The list shows its shortcode, such as [softicon_flipbook id="123"]; paste it where the flipbook should be.',"softicon-flipbook"),video:g.shortcode},{q:(0,l.__)("My PDF from another website does not load","softicon-flipbook"),a:(0,l.__)("Browsers only read a PDF from another website when that site allows it (CORS). Upload the PDF to your Media Library and it always works.","softicon-flipbook")},{q:(0,l.__)("Can the flipbook open in a popup?","softicon-flipbook"),a:(0,l.__)("Yes. Select the flipbook, open the Style tab and turn on Open in a lightbox under Display. A cover, a button or a text link shows on the page, and a click opens the book.","softicon-flipbook"),video:g.lightbox},{q:(0,l.__)("How do I link to a page of the book?","softicon-flipbook"),a:(0,l.__)('Add #page= and the number to the page address, for example example.com/catalog/#page=12. Links like <a href="#page=8"> on the same page turn the book there.',"softicon-flipbook"),video:g.reading},{q:(0,l.__)("How do I hide the download button?","softicon-flipbook"),a:(0,l.__)("Select the flipbook and turn off Download button in the Toolbar panel of the General tab.","softicon-flipbook")},{q:(0,l.__)("Does it work with caching and minify plugins?","softicon-flipbook"),a:(0,l.__)("Yes. The block tells its script where the plugin's files are, so combining or moving scripts does not break the flipbook. After an update, clear your cache once.","softicon-flipbook")},{q:(0,l.__)("Does it slow down my pages?","softicon-flipbook"),a:(0,l.__)("The page gets a 35 KB script (12 KB compressed). The PDF engine loads only when a flipbook comes near the screen, or when a lightbox is opened.","softicon-flipbook")}].filter(e=>!f||(e.q+" "+e.a).toLowerCase().includes(f)),b=[{icon:"tickets-alt",title:(0,l.__)("Open a support ticket","softicon-flipbook"),href:Le+"support/",main:!0,text:d?(0,l.__)("Use the email you bought Pro with, and the developers answer you.","softicon-flipbook"):(0,l.__)("Tell us what happened; the people who build the plugin answer.","softicon-flipbook"),cta:(0,l.__)("Write to us","softicon-flipbook")},{icon:"book",title:(0,l.__)("Documentation","softicon-flipbook"),href:Le+"docs/flipbook/",text:(0,l.__)("Guides for every setting, step by step.","softicon-flipbook"),cta:(0,l.__)("Read the docs","softicon-flipbook")},{icon:"video-alt3",title:(0,l.__)("Video tutorials","softicon-flipbook"),video:!0,text:(0,l.__)("Short videos, most under a minute.","softicon-flipbook"),cta:(0,l.__)("Watch here","softicon-flipbook")},{icon:"groups",title:(0,l.__)("Community forum","softicon-flipbook"),href:"https://wordpress.org/support/plugin/softicon-flipbook/",text:(0,l.__)("Ask in public on WordPress.org, and search past answers.","softicon-flipbook"),cta:(0,l.__)("Visit the forum","softicon-flipbook")}],k=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"alfb-hp-icon dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("strong",null,e.title,e.main&&(0,t.createElement)("em",null,(0,l.__)("Fastest","softicon-flipbook"))),(0,t.createElement)("small",null,e.text),(0,t.createElement)("b",null,e.cta," ",!e.video&&(0,t.createElement)("span",{"aria-hidden":"true"},"↗")));return(0,t.createElement)("div",{className:"alfb-hp"},(0,t.createElement)("header",{className:"alfb-hp-hero"},(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-hp-eyebrow"},(0,l.__)("Support","softicon-flipbook")),(0,t.createElement)("h2",null,(0,l.__)("How can we help?","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free or Pro, a real person reads every message: the developers who build SoftIcon Flipbook.","softicon-flipbook"))),(0,t.createElement)("label",{className:"alfb-hp-search"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("input",{type:"search",value:n,onChange:e=>{s(e.target.value),r(0)},placeholder:(0,l.__)("Search the answers","softicon-flipbook"),"aria-label":(0,l.__)("Search the answers","softicon-flipbook")}))),(0,t.createElement)("div",{className:"alfb-hp-ways"},b.map(o=>o.video?(0,t.createElement)(u,{key:o.title,className:"alfb-hp-way",url:e.urls.playlist,title:o.title,play:a},k(o)):(0,t.createElement)("a",{key:o.title,className:"alfb-hp-way"+(o.main?" is-main":""),href:o.href,...Ae},k(o)))),(0,t.createElement)("div",{className:"alfb-hp-body"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Quick answers","softicon-flipbook")),(0,t.createElement)("span",null,f?(0,l.sprintf)(/* translators: %d: the number of answers that match the search */ /* translators: %d: the number of answers that match the search */
    8 (0,l.__)("%d found","softicon-flipbook"),h.length):(0,l.__)("The questions people ask most","softicon-flipbook"))),h.map((e,o)=>(0,t.createElement)("div",{className:"alfb-hp-qa"+(i===o?" is-open":""),key:e.q},(0,t.createElement)("button",{type:"button","aria-expanded":i===o,onClick:()=>r(i===o?-1:o)},(0,t.createElement)("span",null,e.q),(0,t.createElement)("span",{className:"alfb-hp-chev dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})),i===o&&(0,t.createElement)("div",{className:"alfb-hp-answer"},(0,t.createElement)("p",null,e.a),e.video&&(0,t.createElement)(u,{url:e.video,title:e.q,play:a,className:"alfb-hp-watch"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch how","softicon-flipbook"))))),!h.length&&(0,t.createElement)("p",{className:"alfb-hp-none"},(0,l.__)("No quick answer for that.","softicon-flipbook")," ",(0,t.createElement)("a",{href:Le+"support/",...Ae},(0,l.__)("Ask us instead","softicon-flipbook")," ↗")),(0,t.createElement)("p",{className:"alfb-hp-more"},(0,t.createElement)("a",{href:"https://wordpress.org/plugins/softicon-flipbook/#faq",...Ae},(0,l.__)("All questions and answers","softicon-flipbook")," ↗"))),(0,t.createElement)("aside",{className:"alfb-hp-side"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Your site details","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"alfb-hp-copy"+(c?" is-done":""),onClick:()=>((e,t)=>{if(window.navigator.clipboard&&window.isSecureContext)return void window.navigator.clipboard.writeText(e).then(t);const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy")&&t(),o.remove()})(m.map(([e,t])=>e+": "+t).join("\n"),()=>{p(!0),setTimeout(()=>p(!1),1800)})},(0,t.createElement)("span",{className:"dashicons dashicons-"+(c?"yes":"clipboard"),"aria-hidden":"true"}),c?(0,l.__)("Copied","softicon-flipbook"):(0,l.__)("Copy","softicon-flipbook"))),(0,t.createElement)("dl",{className:"alfb-hp-details"},m.map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("dt",null,e),(0,t.createElement)("dd",{title:o},o)))),(0,t.createElement)("p",{className:"alfb-hp-note"},(0,l.__)("Paste these into your ticket with the address of the page and what you see. They are only copied, never sent.","softicon-flipbook"))),(0,t.createElement)("section",{className:"alfb-hp-panel alfb-hp-contact"},(0,t.createElement)("a",{href:"mailto:"+Me},(0,t.createElement)("span",{className:"dashicons dashicons-email-alt","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("small",null,Me))),d?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("a",{href:Le+"account/",...Ae},(0,t.createElement)("span",{className:"dashicons dashicons-admin-network","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Licenses and downloads","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("Your account","softicon-flipbook")))),(0,t.createElement)("a",{href:Le+"contact/",...Ae},(0,t.createElement)("span",{className:"dashicons dashicons-cart","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Sales and billing","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))):(0,t.createElement)("a",{href:"#/pricing"},(0,t.createElement)("span",{className:"dashicons dashicons-star-filled","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Pro plans","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))))),(0,t.createElement)("div",{className:"alfb-hp-love"},(0,t.createElement)("span",{className:"alfb-hp-stars","aria-hidden":"true"},"★★★★★"),(0,t.createElement)("div",null,(0,t.createElement)("strong",null,(0,l.__)("Enjoying SoftIcon Flipbook?","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("A review helps other people find it and keeps it free.","softicon-flipbook"))),(0,t.createElement)("a",{className:"alfb-hp-btn",href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",...Ae},(0,l.__)("Leave a review","softicon-flipbook")),(0,t.createElement)("a",{href:"https://wordpress.org/plugins/author/softiconai/",...Ae},(0,l.__)("More plugins","softicon-flipbook")),(0,t.createElement)("a",{href:"https://github.com/softiconai/softicon-flipbook",...Ae},(0,l.__)("Source on GitHub","softicon-flipbook"))))},De=({checked:e,onChange:o,label:a})=>(0,t.createElement)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":a,className:"alfb-try-switch"+(e?" is-on":""),onClick:()=>o(!e)},(0,t.createElement)("span",null)),Oe=({value:e,options:o,onChange:a,label:l})=>(0,t.createElement)("div",{className:"alfb-try-seg",role:"radiogroup","aria-label":l},o.map(([o,l])=>(0,t.createElement)("button",{type:"button",key:o,role:"radio","aria-checked":o===e,className:o===e?"is-on":"",onClick:()=>a(o)},l))),ze=["","#f6f7f7","#1f2937","#0f766e","#7a1f1f"],He={analytics:()=>{const[e,a]=(0,o.useState)(30),n=(0,o.useMemo)(()=>{const t=(o=e,()=>(o=(9301*o+49297)%233280)/233280);var o;const a=Array.from({length:e},(e,o)=>Math.round(18+40*t()+10*Math.sin(o/3))),l=a.reduce((e,t)=>e+t,0);return{bars:a,views:l,pages:Math.round(7.4*l),downloads:Math.round(.08*l),leads:Math.round(.03*l)}},[e]),s=Math.max(...n.bars),i=[[(0,l.__)("Spring catalog","softicon-flipbook"),.46],[(0,l.__)("Room guide","softicon-flipbook"),.31],[(0,l.__)("Price list","softicon-flipbook"),.23]];return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)(Oe,{label:(0,l.__)("Period","softicon-flipbook"),value:e,onChange:a,options:[[7,(0,l.__)("7 days","softicon-flipbook")],[30,(0,l.__)("30 days","softicon-flipbook")],[90,(0,l.__)("90 days","softicon-flipbook")]]})),(0,t.createElement)("div",{className:"alfb-try-stats"},[[(0,l.__)("Views","softicon-flipbook"),n.views],[(0,l.__)("Pages read","softicon-flipbook"),n.pages],[(0,l.__)("Pages per view","softicon-flipbook"),(n.pages/n.views).toFixed(1)],[(0,l.__)("Downloads","softicon-flipbook"),n.downloads],[(0,l.__)("Leads","softicon-flipbook"),n.leads]].map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("small",null,e),(0,t.createElement)("strong",null,Number(o).toLocaleString())))),(0,t.createElement)("div",{className:"alfb-try-chart","aria-label":(0,l.__)("Views per day","softicon-flipbook"),role:"img"},n.bars.map((e,o)=>(0,t.createElement)("i",{key:o,style:{height:e/s*100+"%"},title:String(e)}))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Views","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Pages read","softicon-flipbook")))),(0,t.createElement)("tbody",null,i.map(([e,o])=>(0,t.createElement)("tr",{key:e},(0,t.createElement)("td",null,e),(0,t.createElement)("td",null,Math.round(n.views*o).toLocaleString()),(0,t.createElement)("td",null,Math.round(n.pages*o).toLocaleString()))))))},leads:()=>{const[e,a]=(0,o.useState)(""),n=[["Amira Hassan","am***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("Today","softicon-flipbook")],["Jonas Weber","jo***@example.com",(0,l.__)("Room guide","softicon-flipbook"),5,(0,l.__)("Yesterday","softicon-flipbook")],["Priya Nair","pr***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("2 days ago","softicon-flipbook")],["Lucas Martin","lu***@example.com",(0,l.__)("Price list","softicon-flipbook"),2,(0,l.__)("3 days ago","softicon-flipbook")]].filter(t=>!e||t.join(" ").toLowerCase().includes(e.toLowerCase()));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)("input",{type:"search",className:"alfb-try-input",value:e,onChange:e=>a(e.target.value),placeholder:(0,l.__)("Search leads","softicon-flipbook"),"aria-label":(0,l.__)("Search leads","softicon-flipbook")}),(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Download CSV","softicon-flipbook"))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Name","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Asked at page","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("When","softicon-flipbook")))),(0,t.createElement)("tbody",null,n.map(e=>(0,t.createElement)("tr",{key:e[1]},e.map((e,o)=>(0,t.createElement)("td",{key:o},e)))))),!n.length&&(0,t.createElement)("p",{className:"alfb-try-empty"},(0,l.__)("No sample lead matches.","softicon-flipbook")))},defaults:({config:e})=>{const[a,n]=(0,o.useState)({showDownload:!0,showPrint:!1,showThumbnails:!0,showSearch:!0,showShare:!1,flipSound:!0,theme:"light",bgColor:"",bookStyle:"flat"}),s=(e,t)=>n(o=>({...o,[e]:t})),i={...a,sideArrows:"hardcover"===a.bookStyle,pdfUrl:e.urls.demo+"spring-catalog.pdf",maxHeight:380},r=JSON.stringify(a),c=(0,o.useRef)();return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"));const e=c.current?.querySelector("[data-alfb]");return()=>e?.alfb?.destroy?.()},[r]),(0,t.createElement)("div",{className:"alfb-try-split"},(0,t.createElement)("div",{className:"alfb-try-controls"},(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Toolbar on every book","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-chips"},[["showDownload","download",(0,l.__)("Download","softicon-flipbook")],["showPrint","printer",(0,l.__)("Print","softicon-flipbook")],["showThumbnails","grid-view",(0,l.__)("Thumbnails","softicon-flipbook")],["showSearch","search",(0,l.__)("Search","softicon-flipbook")],["showShare","share",(0,l.__)("Share","softicon-flipbook")],["flipSound","controls-volumeon",(0,l.__)("Sound","softicon-flipbook")]].map(([e,o,l])=>(0,t.createElement)("button",{type:"button",key:e,role:"switch","aria-checked":!!a[e],className:"alfb-try-chip"+(a[e]?" is-on":""),onClick:()=>s(e,!a[e])},(0,t.createElement)("span",{className:"dashicons dashicons-"+o,"aria-hidden":"true"}),l))),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Design","softicon-flipbook")),(0,t.createElement)(Oe,{label:(0,l.__)("Design","softicon-flipbook"),value:a.bookStyle,onChange:e=>s("bookStyle",e),options:[["flat",(0,l.__)("Classic","softicon-flipbook")],["hardcover",(0,l.__)("Hardcover","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Theme","softicon-flipbook")),(0,t.createElement)(Oe,{label:(0,l.__)("Theme","softicon-flipbook"),value:a.theme,onChange:e=>s("theme",e),options:[["light",(0,l.__)("Light","softicon-flipbook")],["dark",(0,l.__)("Dark","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Background","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-swatches"},ze.map(e=>(0,t.createElement)("button",{type:"button",key:e||"none",className:"alfb-try-swatch"+(e===a.bgColor?" is-on":"")+(e?"":" is-none"),style:e?{background:e}:void 0,onClick:()=>s("bgColor",e),"aria-label":e||(0,l.__)("Theme color","softicon-flipbook")})))),(0,t.createElement)("div",{className:"alfb-try-book",ref:c},(0,t.createElement)($,{key:r,attributes:i,config:z(i)})))},settings:()=>{const[e,a]=(0,o.useState)({analytics:!0,skipEditors:!0,leadEmail:!1}),n=[["analytics",(0,l.__)("Count opens and pages read","softicon-flipbook"),(0,l.__)("Reading analytics for every book. Nothing personal is stored and no cookies are set.","softicon-flipbook")],["skipEditors",(0,l.__)("Do not count logged-in editors","softicon-flipbook"),(0,l.__)("Your own visits while you work on the site are left out.","softicon-flipbook")],["leadEmail",(0,l.__)("Email me each new lead","softicon-flipbook"),(0,l.__)("Sent to the site admin email.","softicon-flipbook")]];return(0,t.createElement)(t.Fragment,null,n.map(([o,l,n])=>(0,t.createElement)("div",{className:"alfb-try-setting",key:o},(0,t.createElement)("div",null,(0,t.createElement)("strong",null,l),(0,t.createElement)("small",null,n)),(0,t.createElement)(De,{label:l,checked:e[o],onChange:t=>a({...e,[o]:t})}))),(0,t.createElement)("p",{className:"alfb-try-row"},(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Save settings","softicon-flipbook"))))}},Ve=({name:e,title:o,config:a})=>{const n=He[e];return(0,t.createElement)("section",{className:"alfb-try"},(0,t.createElement)("header",null,(0,t.createElement)("span",{className:"alfb-try-badge"},(0,t.createElement)("span",{className:"dashicons dashicons-visibility","aria-hidden":"true"}),(0,l.__)("Try it","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.sprintf)(/* translators: %s: the Pro feature, such as Reading analytics */ /* translators: %s: the Pro feature, such as Reading analytics */
    9 (0,l.__)("A working demo of %s with sample data. Click around; nothing is saved.","softicon-flipbook"),o))),(0,t.createElement)("div",{className:"alfb-try-body"},(0,t.createElement)(n,{config:a})))},$e=({name:e,config:o,play:a})=>{const n={analytics:{icon:"chart-bar",eyebrow:(0,l.__)("Insights","softicon-flipbook"),title:(0,l.__)("Reading analytics","softicon-flipbook"),text:(0,l.__)("See how many people open each book and how far they read.","softicon-flipbook"),video:g.analytics,points:[(0,l.__)("Views, pages read and downloads for every book","softicon-flipbook"),(0,l.__)("A chart per day, for 7, 30 or 90 days","softicon-flipbook"),(0,l.__)("No cookies and nothing personal stored","softicon-flipbook"),(0,l.__)("Download the numbers as a CSV file","softicon-flipbook")]},leads:{icon:"email-alt",eyebrow:(0,l.__)("Audience","softicon-flipbook"),title:(0,l.__)("Lead capture","softicon-flipbook"),text:(0,l.__)("Readers leave their email to keep reading after a few pages.","softicon-flipbook"),video:g.leads,points:[(0,l.__)("Choose after how many pages the form shows","softicon-flipbook"),(0,l.__)("Every lead saved on your own site","softicon-flipbook"),(0,l.__)("An email to you for each new lead","softicon-flipbook"),(0,l.__)("Download your leads as a CSV file","softicon-flipbook")]},defaults:{icon:"admin-appearance",eyebrow:(0,l.__)("Appearance","softicon-flipbook"),title:(0,l.__)("Site defaults","softicon-flipbook"),text:(0,l.__)("Set the toolbar, size, colors and more once, and every flipbook uses them. A book can still change any setting for itself.","softicon-flipbook"),video:g.settings,points:[(0,l.__)("Hide the download button on every book at once","softicon-flipbook"),(0,l.__)("Your brand colors and height on each new book","softicon-flipbook"),(0,l.__)("Right to left for every book on an Arabic, Hebrew or Urdu site","softicon-flipbook"),(0,l.__)("A live preview before you save","softicon-flipbook")]},settings:{icon:"admin-generic",eyebrow:(0,l.__)("Site","softicon-flipbook"),title:(0,l.__)("Settings","softicon-flipbook"),text:(0,l.__)("The site-wide switches for reading analytics and lead emails.","softicon-flipbook"),points:[(0,l.__)("Turn reading analytics on or off","softicon-flipbook"),(0,l.__)("Leave out your own visits while you work","softicon-flipbook"),(0,l.__)("Get an email for each new lead","softicon-flipbook")]}}[e];return(0,t.createElement)("div",{className:"alfb-pp-wrap"},(0,t.createElement)("div",{className:"alfb-pp"},(0,t.createElement)("header",{className:"alfb-pp-hero"},(0,t.createElement)("span",{className:"alfb-pp-icon dashicons dashicons-"+n.icon,"aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-pp-eyebrow"},n.eyebrow," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("h2",null,n.title),(0,t.createElement)("p",null,n.text))),(0,t.createElement)("div",{className:"alfb-pp-body"},(0,t.createElement)("ul",{className:"alfb-pp-points"},n.points.map(e=>(0,t.createElement)("li",{key:e},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),e))),(0,t.createElement)("div",{className:"alfb-pp-actions"},(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/pricing"},(0,l.__)("See Pro plans","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-pp-link",href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook")),n.video&&(0,t.createElement)(u,{url:n.video,title:n.title,play:a,className:"alfb-pp-link"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch it in action","softicon-flipbook"))))),(0,t.createElement)(Ve,{name:e,title:n.title,config:o}))},Be=()=>{const e=document.getElementById("alfb-dashboard"),l=window.alfbDashboard;if(!e||!l)return;const n=(0,a.applyFilters)("alfb.dashboard.tabs",{welcome:A,demos:q,...Object.fromEntries(["analytics","leads","defaults","settings"].map(e=>[e,o=>(0,t.createElement)($e,{name:e,...o})])),pricing:Fe,compare:Ie,help:Te},l);(0,o.createRoot)(e).render((0,t.createElement)(b,{config:l,tabs:n}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Be):Be()})();
     3(0,l._n)("See all %d flipbook","See all %d flipbooks",e.total,"softicon-flipbook"),e.total)),(0,t.createElement)("a",{href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))):(0,t.createElement)("div",{className:"alfb-start-empty"},(0,t.createElement)("p",null,(0,l.__)("No flipbooks yet. Make one and its shortcode shows up here, ready to copy.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))),C=({url:e,title:o,play:a})=>(0,t.createElement)(u,{className:"alfb-start-video",url:e,title:o,play:a},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,t.createElement)("span",null,o)),P=({n:e,title:o,children:a,action:l})=>(0,t.createElement)("li",{className:"alfb-start-step"},(0,t.createElement)("span",{className:"alfb-step"},e),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,o),a,l)),F=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(P,{n:1,title:(0,l.__)("Make the flipbook","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Go to Flipbook → All Flipbooks → Add a flipbook. It opens with the Flipbook block: pick the PDF and the look, then publish.","softicon-flipbook"))),(0,t.createElement)(P,{n:2,title:(0,l.__)("Copy its shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every flipbook has a shortcode in the All Flipbooks list and in the block's Help panel. Your flipbooks are listed here too.","softicon-flipbook")))),I=({config:e,play:a})=>{const n={...e.start,newPage:e.urls.newPage,pro:e.pro},s=(e=>[{key:"block",icon:"block-default",label:(0,l.__)("Block editor","softicon-flipbook"),on:!e.classic,steps:(0,t.createElement)(t.Fragment,null,(0,t.createElement)(P,{n:1,title:(0,l.__)("Add the Flipbook block","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newPage},(0,l.__)("Create a flipbook page","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In any page or post, click <b>+</b> and search for <b>Flipbook</b>, or type <code>/flipbook</code> in an empty line.","softicon-flipbook"),{b:(0,t.createElement)("strong",null),code:(0,t.createElement)("code",null)}))),(0,t.createElement)(P,{n:2,title:(0,l.__)("Pick a PDF or images","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Upload a PDF, choose one from the Media Library, paste a link, or build the book from your own images.","softicon-flipbook"))),(0,t.createElement)(P,{n:3,title:(0,l.__)("Choose the look and publish","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Classic or Hardcover, on the page or in a popup: every setting is in the block's sidebar, and the editor shows the finished book.","softicon-flipbook")))),video:[g.add,(0,l.__)("Add a flipbook in 36 seconds","softicon-flipbook")]},{key:"classic",icon:"editor-paste-text",label:(0,l.__)("Classic editor","softicon-flipbook"),on:e.classic,books:!0,steps:(0,t.createElement)(t.Fragment,null,F(e),(0,t.createElement)(P,{n:3,title:(0,l.__)("Paste it in the Classic Editor","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Paste the shortcode where the book goes, in the Visual or the Text tab, then update the page. It works in text widgets too.","softicon-flipbook")),(0,t.createElement)(S,{text:v(e.books[0]?.id||123),label:(0,l.__)("Copy the shortcode","softicon-flipbook")}))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]},{key:"builders",icon:"layout",label:(0,l.__)("Elementor & builders","softicon-flipbook"),on:e.elementor,books:!0,steps:(0,t.createElement)(t.Fragment,null,F(e),(0,t.createElement)(P,{n:3,title:(0,l.__)("Add a Shortcode widget","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In <b>Elementor</b>, drag the <b>Shortcode</b> widget onto the page and paste the shortcode; the book shows in Elementor's preview too. Other builders work the same way:","softicon-flipbook"),{b:(0,t.createElement)("strong",null)})),(0,t.createElement)("ul",{className:"alfb-start-builders"},(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Divi")," – ",(0,l.__)("Code module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Beaver Builder")," – ",(0,l.__)("HTML or Text Editor module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"WPBakery")," – ",(0,l.__)("Text Block","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Bricks, Oxygen")," – ",(0,l.__)("Shortcode element","softicon-flipbook"))))),video:[g.shortcode,(0,l.__)("The shortcode in Elementor and more","softicon-flipbook")]},{key:"theme",icon:"editor-code",label:(0,l.__)("Theme / PHP","softicon-flipbook"),on:!1,books:!0,steps:(0,t.createElement)(t.Fragment,null,e.blockTheme&&(0,t.createElement)(P,{n:1,title:(0,l.__)("Block theme: add the block to a template","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.siteEditor},(0,l.__)("Open the Site Editor","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Your theme is a block theme. In Appearance → Editor → Templates, open a template and add the Flipbook block like on any page.","softicon-flipbook"))),(0,t.createElement)(P,{n:e.blockTheme?2:1,title:(0,l.__)("Any theme: print the shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("Make the flipbook under All Flipbooks, then show it from a template file, such as <code>single.php</code>, with:","softicon-flipbook"),{code:(0,t.createElement)("code",null)})),(0,t.createElement)(S,{text:`<?php echo do_shortcode( '${v(e.books[0]?.id||123)}' ); ?>`,label:(0,l.__)("Copy the PHP code","softicon-flipbook")})),(0,t.createElement)(P,{n:e.blockTheme?3:2,title:(0,l.__)("One book for every post","softicon-flipbook")},e.pro?(0,t.createElement)("p",null,(0,l.__)('Keep each post\'s PDF in a Meta Box or ACF field, put one flipbook in the template, and turn on "PDF from a custom field" in its Source panel: every post shows its own book.',"softicon-flipbook")):(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("With Pro, one flipbook in a template shows each post's own PDF from a Meta Box or ACF field. <a>See Pro</a>","softicon-flipbook"),{a:(0,t.createElement)("a",{href:"#/pricing"})})))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]}])(n),[i,r]=(0,o.useState)(()=>{const e=(()=>{try{return window.localStorage.getItem(w)}catch(e){return null}})();return s.some(t=>t.key===e)?e:n.classic?"classic":n.elementor?"builders":"block"}),c=e=>{r(e);try{window.localStorage.setItem(w,e)}catch(e){}},p=s.find(e=>e.key===i)||s[0];return(0,t.createElement)("section",{className:"alfb-start"},(0,t.createElement)("header",{className:"alfb-start-head"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Getting started","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Pick where you build your pages; the steps follow.","softicon-flipbook")))),(0,t.createElement)("div",{className:"alfb-start-tabs",role:"tablist","aria-label":(0,l.__)("Where you build your pages","softicon-flipbook"),onKeyDown:e=>{const t=s.findIndex(e=>e.key===i),o={ArrowRight:t+1,ArrowLeft:t-1,Home:0,End:s.length-1}[e.key];if(void 0===o)return;e.preventDefault();const a=s[(o+s.length)%s.length].key;c(a),e.currentTarget.querySelector(`[data-tab="${a}"]`)?.focus()}},s.map(e=>(0,t.createElement)("button",{key:e.key,type:"button",role:"tab",id:"alfb-start-tab-"+e.key,"data-tab":e.key,"aria-selected":e.key===i,"aria-controls":"alfb-start-panel",tabIndex:e.key===i?0:-1,className:e.key===i?"is-active":"",onClick:()=>c(e.key)},(0,t.createElement)("span",{className:"dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("span",null,e.label),e.on&&"block"!==e.key&&(0,t.createElement)("span",{className:"alfb-start-on"},(0,l.__)("On this site","softicon-flipbook"))))),(0,t.createElement)("div",{className:"alfb-start-body",role:"tabpanel",id:"alfb-start-panel","aria-labelledby":"alfb-start-tab-"+p.key},(0,t.createElement)("ol",{className:"alfb-start-steps"},p.steps),(0,t.createElement)("aside",{className:"alfb-start-side"},p.books?(0,t.createElement)(x,{start:n}):(0,t.createElement)("div",{className:"alfb-start-books"},(0,t.createElement)("h4",null,(0,l.__)("Fastest start","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("A new page opens with a sample book already in place; swap in your own PDF.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:n.newPage},(0,l.__)("Create a flipbook","softicon-flipbook"))),(0,t.createElement)(C,{url:p.video[0],title:p.video[1],play:a}))))},A=(e,t)=>{const o=new URL(e,window.location.href);return o.searchParams.set("alfb_start",t),o.toString()},L=({config:e})=>{const{start:o,urls:a}=e,n=o.classic||o.elementor,s=[{key:"block",icon:"block-default",title:(0,l.__)("Block","softicon-flipbook"),text:(0,l.__)("Add the flipbook right inside a page or post, in the block editor.","softicon-flipbook"),action:(0,l.__)("Open a new page","softicon-flipbook"),href:A(a.newPage,"block"),fits:!n},{key:"shortcode",icon:"shortcode",title:(0,l.__)("Shortcode","softicon-flipbook"),text:(0,l.__)("Make the flipbook once, then paste its shortcode in the Classic Editor, Elementor or any page builder.","softicon-flipbook"),action:(0,l.__)("Make a flipbook","softicon-flipbook"),href:A(o.newBook,"shortcode"),fits:n}];return(0,t.createElement)("div",{className:"alfb-choice"},(0,t.createElement)("h3",null,(0,l.__)("How do you want to add your flipbook?","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-choice-cards"},s.map(e=>(0,t.createElement)("a",{key:e.key,className:"alfb-choice-card"+(e.fits?" is-fit":""),href:e.href},(0,t.createElement)("span",{className:"alfb-choice-icon dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("strong",null,e.title,e.fits&&(0,t.createElement)("span",{className:"alfb-choice-fit"},(0,l.__)("Fits this site","softicon-flipbook"))),(0,t.createElement)("span",{className:"alfb-choice-text"},e.text),(0,t.createElement)("span",{className:"alfb-choice-go"},e.action," →")))),(0,t.createElement)("p",{className:"alfb-choice-more"},(0,t.createElement)("a",{href:a.newPage},(0,l.__)("Or start from a sample book","softicon-flipbook")),(0,t.createElement)("a",{href:"#/demos"},(0,l.__)("See the demos","softicon-flipbook"))))},M=({config:e,play:o})=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("section",{className:"alfb-hero"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Turn any PDF into a book people enjoy reading","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor.","softicon-flipbook")),(0,t.createElement)(L,{config:e})),(0,t.createElement)(u,{className:"alfb-hero-video",url:e.urls.playlist,title:(0,l.__)("Video tutorials","softicon-flipbook"),play:o},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch the video tutorials","softicon-flipbook"))),(0,t.createElement)(I,{config:e,play:o}),(0,t.createElement)("h2",{className:"alfb-title",id:"alfb-videos"},(0,l.__)("Video tutorials","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-grid alfb-videos"},e.videos.map(e=>(0,t.createElement)(u,{key:e.url,className:"alfb-card alfb-video",url:e.url,title:e.title,play:o},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"}),e.title)))),T={},D=e=>{const[t,a]=(0,o.useState)(()=>T[e]||{loading:!0});return(0,o.useEffect)(()=>{if(T[e])return;let t=!0;return s()({path:e}).then(e=>({data:e}),e=>({error:e.message||(0,l.__)("Something went wrong. Please try again.","softicon-flipbook")})).then(o=>{T[e]=o,t&&a(o)}),()=>{t=!1}},[e]),t},O=JSON.parse('{"attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}}}'),H=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],z=Object.fromEntries(Object.entries(O.attributes).map(([e,t])=>[e,t.default])),V=e=>(e=>{const{source:t,pdfUrl:o,images:a,pageMode:l,bookStyle:n,sideArrows:s,showCover:i,startPage:r,startWith:c,bookTitle:p,theme:d,autoplay:m,autoplaySeconds:f,autoplayLoop:h,rtl:b,phoneFullscreen:u,maxHeight:k,maxHeightTablet:_,maxHeightPhone:E,showDownload:y,showPrint:g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:C,showShare:P,flipSound:F}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?a:[],pageMode:["auto","double","single"].includes(l)?l:"auto",bookStyle:"hardcover"===n?"hardcover":"flat",sideArrows:!!s,showCover:i,startPage:Math.max(1,parseInt(r,10)||1),title:(p||"").trim(),startWith:["thumbnails","contents"].includes(c)?c:"book",theme:["dark","auto"].includes(d)?d:"light",autoplay:!!m,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==h,rtl:!!b,phoneFullscreen:!!u,maxHeight:Math.min(2e3,Math.max(200,parseInt(k,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(E,10)>0?Math.min(2e3,Math.max(200,parseInt(E,10))):0,showDownload:y,showPrint:!!g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:!1!==C,showShare:!!P,flipSound:F}})({...z,...e}),B=e=>{const t={};return[["bgColor","--alfb-bg"],["toolbarBg","--alfb-bar-bg"],["toolbarColor","--alfb-bar-color"],["coverColor","--alfb-cover"]].forEach(([o,a])=>{const l=(n="string"==typeof(n=e[o])?n.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(n)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(n)&&[...n.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>H.includes(e))?n:void 0);var n;l&&(t[a]=l)}),t},$={"alfb-block":""},U=(0,o.memo)(({attributes:e,config:o})=>(0,t.createElement)("div",{className:"alfb_wrapper wp-block-softicon-flipbook",...$,"data-alfb":JSON.stringify(o),style:B(e),tabIndex:"0",role:"region","aria-label":(0,l.__)("Flipbook","softicon-flipbook")},(0,t.createElement)("div",{className:"alfb_stage"},(0,t.createElement)("div",{className:"alfb_loading"},(0,t.createElement)("span",{className:"alfb_spinner"}))))),R=(0,o.memo)(({attributes:e,config:o})=>{const a={...z,...e},n=(a.lightboxText||"").trim(),s=n||(0,l.__)("Read the flipbook","softicon-flipbook"),i="cover"===a.lightboxTrigger,r={...B(a),...i?{"--alfb-lb-width":Math.min(600,Math.max(120,a.lightboxWidth))+"px"}:{}};return(0,t.createElement)("div",{className:"alfb_lb wp-block-softicon-flipbook alfb_lb_"+a.lightboxAlign+(i?" alfb_lb_draw":""),...$,"data-alfb":JSON.stringify(o),style:r},i?(0,t.createElement)("a",{className:"alfb_lb_trigger alfb_lb_cover",href:o.pdf,"aria-haspopup":"dialog","aria-label":n?void 0:s},(0,t.createElement)("span",{className:"alfb_lb_img"}),n&&(0,t.createElement)("span",{className:"alfb_lb_caption"},n)):(0,t.createElement)("a",{className:"alfb_lb_trigger "+("button"===a.lightboxTrigger?"alfb_lb_button wp-element-button":"alfb_lb_link"),href:o.pdf,"aria-haspopup":"dialog"},s))}),W=({book:e})=>{if(e.Component)return(0,t.createElement)(e.Component,{...e});const o=e.config||V(e.attributes);return"lightbox"===e.attributes?.displayMode?(0,t.createElement)(R,{attributes:e.attributes,config:o}):(0,t.createElement)(U,{attributes:e.attributes||{},config:o})},q=({unlock:e})=>{const{data:o}=D("/alfb/v1/dashboard/plans");return(o?.pro_only||[]).filter(e=>e.featured).map(o=>(0,t.createElement)("article",{key:o.title,className:"alfb-card alfb-demo is-pro"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,o.title," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("p",null,o.text)),(0,t.createElement)("div",{className:"alfb-demo-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})),(0,t.createElement)("footer",null,(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/compare",onClick:e?t=>{t.preventDefault(),e()}:void 0},(0,l.__)("Available in Pro","softicon-flipbook")))))},G=({config:e,unlock:n})=>{const s=(0,o.useMemo)(()=>(0,a.applyFilters)("alfb.dashboard.demos",(e=>{const t={pdfUrl:e+"spring-catalog.pdf",maxHeight:420},o={pdfUrl:e+"room-guide.pdf",maxHeight:420};return[{key:"classic",title:(0,l.__)("Classic book","softicon-flipbook"),text:(0,l.__)("The default look: two pages side by side, one page on phones, and the full toolbar.","softicon-flipbook"),books:[{attributes:t}]},{key:"hardcover",title:(0,l.__)("Hardcover","softicon-flipbook"),text:(0,l.__)("Pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows.","softicon-flipbook"),books:[{attributes:{...t,bookStyle:"hardcover",sideArrows:!0,coverColor:"#0f766e"}}]},{key:"guide",title:(0,l.__)("Chapters and links","softicon-flipbook"),text:(0,l.__)("A PDF with bookmarks gets a table of contents, and the links inside it can be clicked.","softicon-flipbook"),books:[{attributes:o}]},{key:"covers",row:!0,title:(0,l.__)("Covers that open a popup","softicon-flipbook"),text:(0,l.__)("Only the covers show on the page. A click opens the book over the page, and it loads only then.","softicon-flipbook"),books:[{attributes:{...t,displayMode:"lightbox",lightboxText:(0,l.__)("Spring Living 2026","softicon-flipbook"),lightboxWidth:170}},{attributes:{...o,displayMode:"lightbox",lightboxText:(0,l.__)("Room Guide 2026","softicon-flipbook"),lightboxWidth:170,bookStyle:"hardcover",sideArrows:!0}}]},{key:"button",title:(0,l.__)("A button that opens a popup","softicon-flipbook"),text:(0,l.__)("A theme-styled button, or a plain text link, opens the book in a popup.","softicon-flipbook"),books:[{attributes:{...o,displayMode:"lightbox",lightboxTrigger:"button",lightboxText:(0,l.__)("Open the room guide","softicon-flipbook")}}]}]})(e.urls.demo),e),[e]);return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"))},[]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",{className:"alfb-lead"},(0,l.__)("These are real flipbooks, try them. Add one to any page with the Flipbook block.","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-demos"},s.map(e=>(0,t.createElement)("article",{key:e.key,className:"alfb-card alfb-demo"+(e.pro?" is-pro":"")},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,e.title,e.pro&&(0,t.createElement)(t.Fragment,null," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook")))),(0,t.createElement)("p",null,e.text)),(0,t.createElement)("div",{className:"alfb-demo-view"+(e.row?" is-row":"")},e.books.map((e,o)=>(0,t.createElement)(W,{key:o,book:e}))))),(!e.pro||e.locked)&&(0,t.createElement)(q,{unlock:e.locked?n:null})))};var j=Object.defineProperty,K=(e,t,o)=>((e,t,o)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o)(e,"symbol"!=typeof t?t+"":t,o);const Y={Log(...e){console&&console.log&&console.log(...e)},Error(...e){console&&console.error&&console.error(...e)},Warn(...e){console&&console.warn&&console.warn(...e)},Debug(...e){console&&console.debug&&console.debug(...e)}},J=2147483647;function Q(e){return typeof e>"u"||"function"==typeof e||"object"==typeof e&&null!==e}function X(e){const t={};Object.entries(e).forEach(([e,o])=>{Q(o)||(t[e]=o)});const{sandbox:o}=e;return o&&o.ctx&&o.token&&(t.s_ctx_ts=o.ctx,t.sandbox=o.token),t}function Z(){return typeof window>"u"}function ee(e,t){if(null==e)throw new Error(t)}class te{constructor(e){K(this,"styleElement"),K(this,"bodyScrollDisableClassName"),K(this,"isFlashingBrowser"),K(this,"overflow",{x:0,y:0}),K(this,"metaColorSchemeValue",null),K(this,"metaColorSchemeElement",null),this.guid=e,this.bodyScrollDisableClassName=`is-fs-checkout-open-${this.guid}`,this.styleElement=document.createElement("style"),this.styleElement.textContent+=this.getBasicStyle(),this.isFlashingBrowser=function(){let e=!1;try{const t=navigator.userAgent.toLowerCase();/edge\/|trident\/|msie /.test(t)?e=!0:-1!==t.indexOf("safari")&&(t.indexOf("chrome")>-1||(e=!0))}catch{}return e}()||!Z()&&!!document.querySelector("#___gatsby"),this.metaColorSchemeElement=document.head.querySelector('meta[name="color-scheme"]')}addStyle(e){this.styleElement.textContent+=e}attach(){return document.head.appendChild(this.styleElement),this}remove(){return document.head.contains(this.styleElement)&&document.head.removeChild(this.styleElement),this}disableBodyScroll(){this.backupScrollPosition(),document.body.classList.add(this.bodyScrollDisableClassName)}enableBodyScroll(){document.body.classList.remove(this.bodyScrollDisableClassName),this.restoreScrollPosition()}disableMetaColorScheme(){this.metaColorSchemeElement&&(this.metaColorSchemeValue=this.metaColorSchemeElement.getAttribute("content"),this.metaColorSchemeElement.setAttribute("content","light"))}enableMetaColorScheme(){this.metaColorSchemeElement&&this.metaColorSchemeValue&&(this.metaColorSchemeElement.setAttribute("content",this.metaColorSchemeValue),this.metaColorSchemeValue=null)}getBasicStyle(){return`body.${this.bodyScrollDisableClassName} { overflow: hidden !important; }`}backupScrollPosition(){this.overflow={x:document.documentElement.scrollTop,y:document.documentElement.scrollLeft}}restoreScrollPosition(){document.documentElement.scrollTop=this.overflow.x,document.documentElement.scrollLeft=this.overflow.y}}const oe=class e{constructor(e,t,o="Loading Freemius Checkout"){K(this,"loaderElement"),K(this,"isOpen",!1),K(this,"loaderElementId"),this.style=e,this.loaderElementId=`fs-loader-${this.style.guid}`,this.loaderElement=document.createElement("div"),this.loaderElement.id=this.loaderElementId,this.loaderElement.innerHTML=`<img src="${t}" alt="${o}" />`,this.style.addStyle(this.getStyle())}show(){return this.isOpen||(this.loaderElement.classList.add("show"),document.body.appendChild(this.loaderElement),this.isOpen=!0),this}hide(){return this.isOpen?(this.loaderElement.classList.remove("show"),this.isOpen=!1,setTimeout(()=>{this.hideImmediate()},e.TRANSITION_TIME),this):this}hideImmediate(){return this.loaderElement.parentNode&&(this.loaderElement.classList.remove("show"),this.loaderElement.parentNode.removeChild(this.loaderElement),this.isOpen=!1),this}getStyle(){return`#${this.loaderElementId} { display: none; position: fixed; z-index: ${J-1}; width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; text-align: left; background: rgba(0, 0, 0, 0.6); transition: opacity ${e.TRANSITION_TIME}ms ease-out; will-change: opacity; opacity: 0; } #${this.loaderElementId}.show { opacity: 1; display: block; } #${this.loaderElementId} img { position: absolute; top: 40%; left: 50%; width: auto; height: auto; margin-left: -25px; background: #fff; padding: 10px; border-radius: 50%; box-shadow: 2px 2px 2px rgba(0,0,0,0.1); }`}};K(oe,"TRANSITION_TIME",200);let ae=oe;const le=class e{constructor(e,t,o,a,l){K(this,"postman",null),K(this,"iFrame"),K(this,"iFrameWrapper"),K(this,"loadedEventListeners",new Set),K(this,"closedEventListeners",new Set),this.baseUrl=e,this.visibleClass=a,this.checkoutOptions=l;const{iFrame:n,iFrameWrapper:s}=this.attachIFrame(e,t,o);this.iFrame=n,this.iFrameWrapper=s,this.addEventListeners()}static getWrapperID(e){return`${e}-wrapper`}close(){this.postman?.post("close",null)}onClosed(e){this.closedEventListeners.add(e)}onLoaded(e){this.loadedEventListeners.add(e)}addToExitIntent(e){e.addListener(()=>{this.postman?.post("exit_intent",null),this.checkoutOptions.onExitIntent?.()})}attachIFrame(t,o,a){const l=`${t}/?${function(e){const t=[];return Object.keys(e).forEach(o=>{const a=function(e){return Q(e)?null:null===e?"null":!0===e?"1":!1===e?"0":encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}(e[o]);null!==a&&t.push(`${o}=${a}`)}),t.join("&")}(o)}#${encodeURIComponent(document.location.href)}`,n=document.createElement("iframe");n.id=a,n.src=l,n.setAttribute("allowTransparency","true"),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("style","background: rgba(0,0,0,0.003); border: 0 none transparent;"),n.setAttribute("frameborder","0"),n.setAttribute("data-testid",n.id);const s=this.checkoutOptions.modal_title??e.DEFAULT_TITLE;n.setAttribute("title",s);const i=document.createElement("div");return i.setAttribute("role","dialog"),i.setAttribute("aria-label",s),i.setAttribute("aria-modal","true"),i.setAttribute("data-testid",`${n.id}-wrapper`),i.id=e.getWrapperID(a),i.appendChild(n),document.body.appendChild(i),{iFrame:n,iFrameWrapper:i}}addEventListeners(){const{success:e,purchaseCompleted:t,cancel:o,track:a,afterOpen:l,afterClose:n}=this.checkoutOptions;this.postman=function(e,t){const o=e.contentWindow,a=e.src,l={};if(!o||!a)return null;const n=function(e){if(!(e&&e.origin&&e.origin.indexOf("js.stripe.com")>0||e.origin.indexOf("www.paypal.com")>0)&&e.origin===t&&e&&e.data&&"string"==typeof e.data&&"{"===e.data.charAt(0))try{const t=JSON.parse(e.data);"object"==typeof t&&t.type&&l[t.type]&&l[t.type].forEach(e=>{e(t.data)})}catch(e){Y.Error(e)}};return window.addEventListener("message",n),{on(e,t){l[e]||(l[e]=[]),l[e].push(t)},one(e,t,o=!1){o&&delete l[e],!l[e]&&this.on(e,t)},destroy(){window.removeEventListener("message",n)},post(e,t){o.postMessage(JSON.stringify({type:e,data:t}),a.replace(/([^:]+:\/\/[^/]+).*/,"$1"))}}}(this.iFrame,this.baseUrl),this.postman?.one("upgraded",t=>{try{e?.(t)}catch(e){Y.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.one("purchaseCompleted",e=>{try{t?.(e)}catch(e){Y.Error(e)}},!0),this.postman?.one("canceled",()=>{try{o?.()}catch(e){Y.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.on("track",e=>{try{a?.(e.event,e)}catch(e){Y.Error(e)}}),this.postman?.one("loaded",()=>{this.dispatchOnLoaded(),this.iFrame?.classList.add(this.visibleClass);try{l?.()}catch(e){Y.Error(e)}},!0)}removeIFrameAndPostman(){this.postman?.destroy(),this.postman=null,this.iFrame.remove(),this.iFrameWrapper.remove(),this.closedEventListeners.clear(),this.loadedEventListeners.clear()}dispatchOnLoaded(){this.loadedEventListeners.forEach(e=>e())}dispatchOnClosed(){this.closedEventListeners.forEach(e=>e())}};K(le,"DEFAULT_TITLE","Checkout");let ne=le;const se=class e{constructor(e,t,o){K(this,"iFrameID"),this.style=e,this.options=t,this.baseUrl=o,this.iFrameID=`fs-checkout-page-${this.style.guid}`}create(t){const o={...this.options,...t};return new ne(this.baseUrl,this.getQueryParams(o),this.iFrameID,e.VISIBLE_CLASS,o)}addStyle(){this.style.addStyle(this.getStyle())}getQueryParams(e){return{mode:"dialog",guid:this.style.guid,_fs_checkout:!0,...X(e)}}getStyle(){return`#${this.iFrameID} { z-index: ${J-1}; background: rgba(0,0,0,0.003); border: 0 none transparent; visibility: ${this.style.isFlashingBrowser?"hidden":"visible"}; margin: 0; padding: 0; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; -webkit-tap-highlight-color: transparent; overflow: hidden; } #${this.iFrameID}.${e.VISIBLE_CLASS} { visibility: visible; } #${ne.getWrapperID(this.iFrameID)} { z-index: ${J-1}; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; overflow: hidden; }`}};K(se,"VISIBLE_CLASS","show");let ie=se;class re{constructor(e,t,o,a,l){K(this,"checkoutIFrameBuilder"),K(this,"checkoutIFrame",null),K(this,"lastFocusedElement",null),this.style=e,this.exitIntent=t,this.loader=o,this.checkoutIFrameBuilder=new ie(this.style,l,a),this.checkoutIFrameBuilder.addStyle()}isOpen(){return null!==this.checkoutIFrame}open(e){return this.isOpen()||(this.backupFocusedElement(),this.style.attach(),this.style.disableBodyScroll(),this.style.disableMetaColorScheme(),this.loader.show(),this.exitIntent.attach(),this.checkoutIFrame=this.checkoutIFrameBuilder.create(e),this.checkoutIFrame.onLoaded(this.onLoaded.bind(this)),this.checkoutIFrame.onClosed(this.onClosed.bind(this)),this.checkoutIFrame.addToExitIntent(this.exitIntent)),this}close(){return this.checkoutIFrame?.close(),this.loader.hideImmediate(),this}onLoaded(){this.loader.hide()}onClosed(){this.checkoutIFrame=null,this.loader.hide(),this.style.enableBodyScroll(),this.style.enableMetaColorScheme(),this.exitIntent.detach(),this.restoreFocusedElement(),this.style.remove()}backupFocusedElement(){this.lastFocusedElement=document.activeElement??null}restoreFocusedElement(){this.lastFocusedElement&&(this.lastFocusedElement.focus?.(),this.lastFocusedElement=null)}}class ce{constructor(e){K(this,"exitIntentId"),K(this,"exitIntentDiv",null),K(this,"clearExitIntentListener",null),K(this,"listeners",[]),this.style=e,this.exitIntentId=`fs-exit-intent-${this.style.guid}`,this.style.addStyle(this.getStyle())}isAttached(){return null!==this.exitIntentDiv}addListener(...e){this.listeners.push(...e)}attach(...e){if(e&&this.addListener(...e),this.isAttached())return this;this.exitIntentDiv=document.createElement("div"),this.exitIntentDiv.id=this.exitIntentId,document.body.appendChild(this.exitIntentDiv);const t=document.documentElement;let o=null;const a=e=>{e.pageY<=20&&(o=window.setTimeout(()=>{try{this.fireListeners()}catch(e){Y.Error(e)}},300))},l=()=>{o&&(clearTimeout(o),o=null)};return t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",l),this.clearExitIntentListener=()=>{o&&(clearTimeout(o),o=null),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",l)},this}detach(){return this.isAttached()?(this.exitIntentDiv?.remove(),this.exitIntentDiv=null,this.clearExitIntentListener?.(),this):this}fireListeners(){this.listeners.forEach(e=>{e()})}getStyle(){return`#${this.exitIntentId} { z-index: ${J}; border: 0; background: transparent; position: fixed; padding: 0; margin: 0; height: 10px; left: 0; right: 0; width: 100%; top: 0; }`}}const pe=class e{constructor(e){K(this,"queryParams",null),this.url=e,this.queryParams=this.parseQueryStringForCart()}hasCart(){return null!==this.queryParams}getPluginID(){return ee(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_id}getPluginPublicKey(){return ee(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_public_key}matchesPluginID(e){const t=Number.parseInt(this.getPluginID(),10),o=Number.parseInt(e.toString(),10);return Number.isFinite(t)&&Number.isFinite(o)&&t===o}getCheckoutOptions(){ee(this.queryParams,e.NO_CART_FOUND_MESSAGE);const t={plugin_id:"",public_key:""};return Object.entries(this.queryParams).forEach(([e,o])=>{"__fs_plugin_id"===e?t.plugin_id=o:"__fs_plugin_public_key"===e?t.public_key=o:t[e]=o}),t}parseQueryStringForCart(){const e=new URLSearchParams(this.url.search);if(!e.has("__fs_authorization"))return null;const t={};return e.forEach((e,o)=>{o.startsWith("__fs_")&&(t[o]=e)}),t}};K(pe,"NO_CART_FOUND_MESSAGE","No cart was found");let de=pe;const me="https://checkout.freemius.com";class fe{constructor(e,t=!0,o=null){K(this,"options",{plugin_id:0,public_key:""}),K(this,"guid"),K(this,"baseUrl"),K(this,"style"),K(this,"loader"),K(this,"checkoutPopup"),K(this,"exitIntent"),K(this,"cart"),this.baseUrl=o??me;const{plugin_id:a,product_id:l,public_key:n,loadingImageAlt:s,loadingImageUrl:i,...r}=e;if(!a&&!l)throw new Error("Must provide a product_id to options.");this.options={...r,public_key:n,plugin_id:l??a},this.guid=function(){const e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}(),!Z()&&(this.baseUrl=o??(window.FS?.__FS__IS_TEST__?"http://checkout.freemius-local.com:8080":me),this.style=new te(this.guid),this.loader=new ae(this.style,i??`${this.baseUrl}/assets/img/spinner.svg`,s),this.exitIntent=new ce(this.style),this.checkoutPopup=new re(this.style,this.exitIntent,this.loader,this.baseUrl,this.options),this.cart=new de(new URL(window.location.href)),t&&this.recoverCart())}async open(e){if(!Z()){if(this.checkoutPopup?.isOpen())return void Y.Warn("Checkout popup already open. Please close it first before opening it again.");if(!document.body)return new Promise(t=>{document.addEventListener("DOMContentLoaded",()=>{this.checkoutPopup?.open(e),t()},{once:!0})});this.checkoutPopup?.open(e)}}close(){Z()||this.checkoutPopup?.close()}destroy(){Z()||this.close()}getGuid(){return this.guid}recoverCart(){if(this.cart?.hasCart()&&this.cart?.matchesPluginID(this.options.plugin_id)){const e=this.cart.getCheckoutOptions();this.open(e)}}}const he=({error:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-status",role:e?"alert":"status"},e?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"dashicons dashicons-warning","aria-hidden":"true"}),e):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"spinner is-active"}),(0,l.__)("Loading…","softicon-flipbook"))),be={usd:"$",eur:"€",gbp:"£",aud:"A$",cad:"C$"},ue="support@softiconai.com",ke=(0,t.createElement)("a",{href:"mailto:"+ue}),_e=({days:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-guarantee"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.__)("Try Pro without risk","softicon-flipbook")),(0,t.createElement)("p",null,e>0
     4/* translators: %d: number of days */?(0,l.sprintf)((0,l.__)("If Pro is not right for you, tell us within %d days and you get all your money back, no questions asked.","softicon-flipbook"),e):(0,l.__)("If Pro is not right for you, tell us and we will make it right.","softicon-flipbook")),(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Any problem or question? Email us at %s, a real person from our team will help you.","softicon-flipbook"),"<a>"+ue+"</a>"),{a:ke})),(0,t.createElement)("p",{className:"alfb-guarantee-why"},(0,l.__)("We build SoftIcon Flipbook for the people who use it, and your satisfaction comes first.","softicon-flipbook")))),Ee=({days:e})=>(0,t.createElement)("p",{className:"alfb-note alfb-promise"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),e>0&&(0,l.sprintf)((0,l.__)("%d-day money-back guarantee","softicon-flipbook"),e)+" · ",(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Questions? %s","softicon-flipbook"),"<a>"+ue+"</a>"),{a:ke})),ye=({price:e})=>(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,be[e.currency]||e.currency.toUpperCase()+" "),e.price.toLocaleString(void 0,{minimumFractionDigits:Number.isInteger(e.price)?0:2,maximumFractionDigits:2}),(0,t.createElement)("span",null,{lifetime:(0,l.__)("one-time","softicon-flipbook"),annual:(0,l.__)("per year","softicon-flipbook"),monthly:(0,l.__)("per month","softicon-flipbook")}[e.cycle])),ge=e=>"unlimited"===e?(0,l.__)("Unlimited websites","softicon-flipbook")
     5/* translators: %d: number of websites */:(0,l.sprintf)((0,l._n)("%d website","%d websites",e,"softicon-flipbook"),e),we=({checkout:e,plan:o,price:a,className:n})=>{const s=`${e.base}?plan_id=${o.id}&licenses=${a.licenses}&billing_cycle=${a.cycle}`;return(0,t.createElement)("a",{className:"alfb-btn alfb-btn-block "+n,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new fe({product_id:e.product,plan_id:o.id,public_key:e.key}).open({licenses:a.licenses,billing_cycle:a.cycle})}catch(e){window.open(s,"_blank","noopener")}}}},(0,l.__)("Get Pro","softicon-flipbook")," →")},ve=({checkout:e,plan:o,className:a,children:l})=>{const n=o.trial_card?"paid":"free",s=`${e.base}?plan_id=${o.id}&trial=${n}`;return(0,t.createElement)("a",{className:a,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new fe({product_id:e.product,plan_id:o.id,public_key:e.key}).open({trial:n})}catch(e){window.open(s,"_blank","noopener")}}}},l)},Ne=e=>(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
     6(0,l._n)("Start %d-day free trial","Start %d-day free trial",e.trial,"softicon-flipbook"),e.trial),Se=({checkout:e,plan:o})=>(0,t.createElement)("div",{className:"alfb-card alfb-trial"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
     7(0,l._n)("Try Pro free for %d day","Try Pro free for %d days",o.trial,"softicon-flipbook"),o.trial)),(0,t.createElement)("p",null,o.trial_card?(0,l.__)("Every Pro feature on one website. Cancel before the trial ends and you pay nothing.","softicon-flipbook"):(0,l.__)("Every Pro feature on one website, no card needed. When the trial ends, pick a plan or keep using the free plugin.","softicon-flipbook"))),(0,t.createElement)(ve,{checkout:e,plan:o,className:"alfb-btn alfb-btn-amber"},Ne(o)," →")),xe=({data:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-no-plans"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("p",null,e.error?(0,l.__)("The Pro plans could not be loaded right now. Please try again later.","softicon-flipbook"):(0,l.__)("SoftIcon Flipbook Pro is coming soon.","softicon-flipbook"))),Ce=({eyebrow:e,title:o,children:a})=>(0,t.createElement)("div",{className:"alfb-intro"},(0,t.createElement)("span",{className:"alfb-eyebrow"},e),(0,t.createElement)("h2",null,o),a),Pe=()=>D("/alfb/v1/dashboard/plans"),Fe=({play:e})=>(0,t.createElement)("p",null,(0,t.createElement)(u,{url:g.pro,title:(0,l.__)("Every Pro feature in one minute","softicon-flipbook"),play:e},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"})," ",(0,l.__)("Watch every Pro feature in one minute","softicon-flipbook"))),Ie=({play:e})=>{const{data:o,error:a,loading:n}=Pe();if(n||a)return(0,t.createElement)(he,{error:a});const s=o.pro,i=s&&"lifetime"===s.prices[0].cycle;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ce,{eyebrow:(0,l.__)("Pricing","softicon-flipbook"),title:i?(0,l.__)("Pay once, use it for life","softicon-flipbook"):(0,l.__)("Pick your plan","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every plan has all Pro features; pick how many websites you need.","softicon-flipbook")),(0,t.createElement)(Fe,{play:e})),s&&s.trial>0&&o.checkout&&(0,t.createElement)(Se,{checkout:o.checkout,plan:s}),s?(0,t.createElement)("div",{className:"alfb-plans alfb-plans-3"},s.prices.map(e=>(0,t.createElement)("div",{className:"alfb-plan",key:e.licenses},(0,t.createElement)("span",{className:"alfb-tag"},ge(e.licenses)),(0,t.createElement)("h3",null,s.title),(0,t.createElement)(ye,{price:e}),(0,t.createElement)(we,{checkout:o.checkout,plan:s,price:e,className:"alfb-btn-teal"}),(0,t.createElement)("ul",{className:"alfb-checks"},(0,t.createElement)("li",null,ge(e.licenses)),(0,t.createElement)("li",null,(0,l.__)("Every free feature","softicon-flipbook")),o.pro_only.map(e=>(0,t.createElement)("li",{key:e.title},e.title)))))):(0,t.createElement)(xe,{data:o}),s&&(0,t.createElement)(_e,{days:o.money_back}),(0,t.createElement)("p",{className:"alfb-note"},(0,l.__)("Secure checkout by Freemius. Pro replaces the free plugin and keeps every book you made.","softicon-flipbook")," ",(0,t.createElement)("a",{href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook"))))},Ae=({yes:e})=>(0,t.createElement)("span",{className:"alfb-mark "+(e?"is-yes":"is-no")},(0,t.createElement)("span",{className:"dashicons "+(e?"dashicons-yes":"dashicons-no-alt"),"aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},e?(0,l.__)("Included","softicon-flipbook"):(0,l.__)("Not included","softicon-flipbook"))),Le=({play:e})=>{const{data:a,error:n,loading:s}=Pe(),[i,r]=(0,o.useState)("");if(s||n)return(0,t.createElement)(he,{error:n});const c=a.pro,p=i.trim().toLowerCase(),d=[[(0,l.__)("In Free and Pro","softicon-flipbook"),a.free,!0],[(0,l.__)("Only in Pro","softicon-flipbook"),a.pro_only,!1]].map(([e,t,o])=>[e,t.filter(t=>!p||e.toLowerCase().includes(p)||(t.title+" "+t.text).toLowerCase().includes(p)),o]).filter(([,e])=>e.length),m=a.free.length>0||a.pro_only.length>0;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ce,{eyebrow:(0,l.__)("Compare","softicon-flipbook"),title:(0,l.__)("Free vs Pro at a glance","softicon-flipbook")},a.pro_only.length>0&&(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("See what you get when you upgrade. %s features are only in Pro.","softicon-flipbook"),"<strong>"+a.pro_only.length.toLocaleString()+"</strong>"),{strong:(0,t.createElement)("strong",null)})),(0,t.createElement)(Fe,{play:e})),(0,t.createElement)("div",{className:"alfb-plans"},(0,t.createElement)("div",{className:"alfb-plan"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("h3",null,(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free forever, everything you need to put books on your site.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,"$"),"0",(0,t.createElement)("span",null,(0,l.__)("forever","softicon-flipbook"))),(0,t.createElement)("span",{className:"alfb-have"},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),(0,l.__)("You already have it","softicon-flipbook"))),c&&(0,t.createElement)("div",{className:"alfb-plan is-pro"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Pro","softicon-flipbook")),(0,t.createElement)("h3",null,c.title),c.text&&(0,t.createElement)("p",null,c.text),(0,t.createElement)(ye,{price:c.prices[0]}),(0,t.createElement)(we,{checkout:a.checkout,plan:c,price:c.prices[0],className:"alfb-btn-light"}),c.trial>0&&(0,t.createElement)(ve,{checkout:a.checkout,plan:c,className:"alfb-more-plans alfb-trial-link"},Ne(c)),c.prices.length>1&&(0,t.createElement)("a",{className:"alfb-more-plans",href:"#/pricing"},(0,l.__)("Plans for more websites","softicon-flipbook")))),c&&(0,t.createElement)(Ee,{days:a.money_back}),!c&&(0,t.createElement)(xe,{data:a}),m&&(0,t.createElement)("section",{className:"alfb-breakdown"},(0,t.createElement)("header",null,(0,t.createElement)("h3",{id:"alfb-breakdown-title"},(0,l.__)("Feature breakdown","softicon-flipbook")),(0,t.createElement)("label",{className:"alfb-filter"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Filter features","softicon-flipbook")),(0,t.createElement)("input",{type:"search",placeholder:(0,l.__)("Filter features…","softicon-flipbook"),value:i,onChange:e=>r(e.target.value)}))),(0,t.createElement)("table",{className:"alfb-compare","aria-labelledby":"alfb-breakdown-title"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,l.__)("Feature","softicon-flipbook")),(0,t.createElement)("th",{scope:"col"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("th",{scope:"col",className:"is-pro"},(0,l.__)("Pro","softicon-flipbook")))),d.map(([e,o,a])=>(0,t.createElement)("tbody",{key:e},(0,t.createElement)("tr",{className:"alfb-group"},(0,t.createElement)("th",{scope:"rowgroup",colSpan:"3"},e)),o.map(e=>(0,t.createElement)("tr",{key:e.title},(0,t.createElement)("th",{scope:"row"},e.title,e.text&&(0,t.createElement)("small",null,e.text)),(0,t.createElement)("td",null,(0,t.createElement)(Ae,{yes:a})),(0,t.createElement)("td",null,(0,t.createElement)(Ae,{yes:!0})))))),!d.length&&(0,t.createElement)("tbody",{className:"alfb-empty"},(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"3"},(0,l.__)("No features match.","softicon-flipbook")))))))},Me={target:"_blank",rel:"noopener noreferrer"},Te="https://softiconai.com/",De="support@softiconai.com",Oe=({config:e,play:a})=>{const[n,s]=(0,o.useState)(""),[i,r]=(0,o.useState)(0),[c,p]=(0,o.useState)(!1),d=e.pro&&!e.locked,m=(e=>[[(0,l.__)("Plugin","softicon-flipbook"),(e.pro?"SoftIcon Flipbook Pro ":"SoftIcon Flipbook ")+e.version+(e.pro&&e.locked?" ("+(0,l.__)("no license","softicon-flipbook")+")":"")],["WordPress",e.site?.wp||""],["PHP",e.site?.php||""],[(0,l.__)("Theme","softicon-flipbook"),e.site?.theme||""],[(0,l.__)("Browser","softicon-flipbook"),window.navigator.userAgent.replace(/^Mozilla\/5\.0 /,"")]])(e),f=n.trim().toLowerCase(),h=[{q:(0,l.__)("How do I add a flipbook?","softicon-flipbook"),a:(0,l.__)("Edit a page, open the block inserter, search for Flipbook and add the block. Pick a PDF from your Media Library or upload one, and the book appears right away.","softicon-flipbook"),video:g.add},{q:(0,l.__)("Does it work with the Classic Editor, Elementor or other page builders?","softicon-flipbook"),a:(0,l.__)('Yes. Go to Flipbook → All Flipbooks, add a flipbook, set it up and publish it. The list shows its shortcode, such as [softicon_flipbook id="123"]; paste it where the flipbook should be.',"softicon-flipbook"),video:g.shortcode},{q:(0,l.__)("My PDF from another website does not load","softicon-flipbook"),a:(0,l.__)("Browsers only read a PDF from another website when that site allows it (CORS). Upload the PDF to your Media Library and it always works.","softicon-flipbook")},{q:(0,l.__)("Can the flipbook open in a popup?","softicon-flipbook"),a:(0,l.__)("Yes. Select the flipbook, open the Style tab and turn on Open in a lightbox under Display. A cover, a button or a text link shows on the page, and a click opens the book.","softicon-flipbook"),video:g.lightbox},{q:(0,l.__)("How do I link to a page of the book?","softicon-flipbook"),a:(0,l.__)('Add #page= and the number to the page address, for example example.com/catalog/#page=12. Links like <a href="#page=8"> on the same page turn the book there.',"softicon-flipbook"),video:g.reading},{q:(0,l.__)("How do I hide the download button?","softicon-flipbook"),a:(0,l.__)("Select the flipbook and turn off Download button in the Toolbar panel of the General tab.","softicon-flipbook")},{q:(0,l.__)("Does it work with caching and minify plugins?","softicon-flipbook"),a:(0,l.__)("Yes. The block tells its script where the plugin's files are, so combining or moving scripts does not break the flipbook. After an update, clear your cache once.","softicon-flipbook")},{q:(0,l.__)("Does it slow down my pages?","softicon-flipbook"),a:(0,l.__)("The page gets a 35 KB script (12 KB compressed). The PDF engine loads only when a flipbook comes near the screen, or when a lightbox is opened.","softicon-flipbook")}].filter(e=>!f||(e.q+" "+e.a).toLowerCase().includes(f)),b=[{icon:"tickets-alt",title:(0,l.__)("Open a support ticket","softicon-flipbook"),href:Te+"support/",main:!0,text:d?(0,l.__)("Use the email you bought Pro with, and the developers answer you.","softicon-flipbook"):(0,l.__)("Tell us what happened; the people who build the plugin answer.","softicon-flipbook"),cta:(0,l.__)("Write to us","softicon-flipbook")},{icon:"book",title:(0,l.__)("Documentation","softicon-flipbook"),href:Te+"docs/flipbook/",text:(0,l.__)("Guides for every setting, step by step.","softicon-flipbook"),cta:(0,l.__)("Read the docs","softicon-flipbook")},{icon:"video-alt3",title:(0,l.__)("Video tutorials","softicon-flipbook"),video:!0,text:(0,l.__)("Short videos, most under a minute.","softicon-flipbook"),cta:(0,l.__)("Watch here","softicon-flipbook")},{icon:"groups",title:(0,l.__)("Community forum","softicon-flipbook"),href:"https://wordpress.org/support/plugin/softicon-flipbook/",text:(0,l.__)("Ask in public on WordPress.org, and search past answers.","softicon-flipbook"),cta:(0,l.__)("Visit the forum","softicon-flipbook")}],k=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"alfb-hp-icon dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("strong",null,e.title,e.main&&(0,t.createElement)("em",null,(0,l.__)("Fastest","softicon-flipbook"))),(0,t.createElement)("small",null,e.text),(0,t.createElement)("b",null,e.cta," ",!e.video&&(0,t.createElement)("span",{"aria-hidden":"true"},"↗")));return(0,t.createElement)("div",{className:"alfb-hp"},(0,t.createElement)("header",{className:"alfb-hp-hero"},(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-hp-eyebrow"},(0,l.__)("Support","softicon-flipbook")),(0,t.createElement)("h2",null,(0,l.__)("How can we help?","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free or Pro, a real person reads every message: the developers who build SoftIcon Flipbook.","softicon-flipbook"))),(0,t.createElement)("label",{className:"alfb-hp-search"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("input",{type:"search",value:n,onChange:e=>{s(e.target.value),r(0)},placeholder:(0,l.__)("Search the answers","softicon-flipbook"),"aria-label":(0,l.__)("Search the answers","softicon-flipbook")}))),(0,t.createElement)("div",{className:"alfb-hp-ways"},b.map(o=>o.video?(0,t.createElement)(u,{key:o.title,className:"alfb-hp-way",url:e.urls.playlist,title:o.title,play:a},k(o)):(0,t.createElement)("a",{key:o.title,className:"alfb-hp-way"+(o.main?" is-main":""),href:o.href,...Me},k(o)))),(0,t.createElement)("div",{className:"alfb-hp-body"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Quick answers","softicon-flipbook")),(0,t.createElement)("span",null,f?(0,l.sprintf)(/* translators: %d: the number of answers that match the search */ /* translators: %d: the number of answers that match the search */
     8(0,l.__)("%d found","softicon-flipbook"),h.length):(0,l.__)("The questions people ask most","softicon-flipbook"))),h.map((e,o)=>(0,t.createElement)("div",{className:"alfb-hp-qa"+(i===o?" is-open":""),key:e.q},(0,t.createElement)("button",{type:"button","aria-expanded":i===o,onClick:()=>r(i===o?-1:o)},(0,t.createElement)("span",null,e.q),(0,t.createElement)("span",{className:"alfb-hp-chev dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})),i===o&&(0,t.createElement)("div",{className:"alfb-hp-answer"},(0,t.createElement)("p",null,e.a),e.video&&(0,t.createElement)(u,{url:e.video,title:e.q,play:a,className:"alfb-hp-watch"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch how","softicon-flipbook"))))),!h.length&&(0,t.createElement)("p",{className:"alfb-hp-none"},(0,l.__)("No quick answer for that.","softicon-flipbook")," ",(0,t.createElement)("a",{href:Te+"support/",...Me},(0,l.__)("Ask us instead","softicon-flipbook")," ↗")),(0,t.createElement)("p",{className:"alfb-hp-more"},(0,t.createElement)("a",{href:"https://wordpress.org/plugins/softicon-flipbook/#faq",...Me},(0,l.__)("All questions and answers","softicon-flipbook")," ↗"))),(0,t.createElement)("aside",{className:"alfb-hp-side"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Your site details","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"alfb-hp-copy"+(c?" is-done":""),onClick:()=>((e,t)=>{if(window.navigator.clipboard&&window.isSecureContext)return void window.navigator.clipboard.writeText(e).then(t);const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy")&&t(),o.remove()})(m.map(([e,t])=>e+": "+t).join("\n"),()=>{p(!0),setTimeout(()=>p(!1),1800)})},(0,t.createElement)("span",{className:"dashicons dashicons-"+(c?"yes":"clipboard"),"aria-hidden":"true"}),c?(0,l.__)("Copied","softicon-flipbook"):(0,l.__)("Copy","softicon-flipbook"))),(0,t.createElement)("dl",{className:"alfb-hp-details"},m.map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("dt",null,e),(0,t.createElement)("dd",{title:o},o)))),(0,t.createElement)("p",{className:"alfb-hp-note"},(0,l.__)("Paste these into your ticket with the address of the page and what you see. They are only copied, never sent.","softicon-flipbook"))),(0,t.createElement)("section",{className:"alfb-hp-panel alfb-hp-contact"},(0,t.createElement)("a",{href:"mailto:"+De},(0,t.createElement)("span",{className:"dashicons dashicons-email-alt","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("small",null,De))),d?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("a",{href:Te+"account/",...Me},(0,t.createElement)("span",{className:"dashicons dashicons-admin-network","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Licenses and downloads","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("Your account","softicon-flipbook")))),(0,t.createElement)("a",{href:Te+"contact/",...Me},(0,t.createElement)("span",{className:"dashicons dashicons-cart","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Sales and billing","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))):(0,t.createElement)("a",{href:"#/pricing"},(0,t.createElement)("span",{className:"dashicons dashicons-star-filled","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Pro plans","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))))),(0,t.createElement)("div",{className:"alfb-hp-love"},(0,t.createElement)("span",{className:"alfb-hp-stars","aria-hidden":"true"},"★★★★★"),(0,t.createElement)("div",null,(0,t.createElement)("strong",null,(0,l.__)("Enjoying SoftIcon Flipbook?","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("A review helps other people find it and keeps it free.","softicon-flipbook"))),(0,t.createElement)("a",{className:"alfb-hp-btn",href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",...Me},(0,l.__)("Leave a review","softicon-flipbook")),(0,t.createElement)("a",{href:"https://wordpress.org/plugins/author/softiconai/",...Me},(0,l.__)("More plugins","softicon-flipbook")),(0,t.createElement)("a",{href:"https://github.com/softiconai/softicon-flipbook",...Me},(0,l.__)("Source on GitHub","softicon-flipbook"))))},He=({checked:e,onChange:o,label:a})=>(0,t.createElement)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":a,className:"alfb-try-switch"+(e?" is-on":""),onClick:()=>o(!e)},(0,t.createElement)("span",null)),ze=({value:e,options:o,onChange:a,label:l})=>(0,t.createElement)("div",{className:"alfb-try-seg",role:"radiogroup","aria-label":l},o.map(([o,l])=>(0,t.createElement)("button",{type:"button",key:o,role:"radio","aria-checked":o===e,className:o===e?"is-on":"",onClick:()=>a(o)},l))),Ve=["","#f6f7f7","#1f2937","#0f766e","#7a1f1f"],Be={analytics:()=>{const[e,a]=(0,o.useState)(30),n=(0,o.useMemo)(()=>{const t=(o=e,()=>(o=(9301*o+49297)%233280)/233280);var o;const a=Array.from({length:e},(e,o)=>Math.round(18+40*t()+10*Math.sin(o/3))),l=a.reduce((e,t)=>e+t,0);return{bars:a,views:l,pages:Math.round(7.4*l),downloads:Math.round(.08*l),leads:Math.round(.03*l)}},[e]),s=Math.max(...n.bars),i=[[(0,l.__)("Spring catalog","softicon-flipbook"),.46],[(0,l.__)("Room guide","softicon-flipbook"),.31],[(0,l.__)("Price list","softicon-flipbook"),.23]];return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)(ze,{label:(0,l.__)("Period","softicon-flipbook"),value:e,onChange:a,options:[[7,(0,l.__)("7 days","softicon-flipbook")],[30,(0,l.__)("30 days","softicon-flipbook")],[90,(0,l.__)("90 days","softicon-flipbook")]]})),(0,t.createElement)("div",{className:"alfb-try-stats"},[[(0,l.__)("Views","softicon-flipbook"),n.views],[(0,l.__)("Pages read","softicon-flipbook"),n.pages],[(0,l.__)("Pages per view","softicon-flipbook"),(n.pages/n.views).toFixed(1)],[(0,l.__)("Downloads","softicon-flipbook"),n.downloads],[(0,l.__)("Leads","softicon-flipbook"),n.leads]].map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("small",null,e),(0,t.createElement)("strong",null,Number(o).toLocaleString())))),(0,t.createElement)("div",{className:"alfb-try-chart","aria-label":(0,l.__)("Views per day","softicon-flipbook"),role:"img"},n.bars.map((e,o)=>(0,t.createElement)("i",{key:o,style:{height:e/s*100+"%"},title:String(e)}))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Views","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Pages read","softicon-flipbook")))),(0,t.createElement)("tbody",null,i.map(([e,o])=>(0,t.createElement)("tr",{key:e},(0,t.createElement)("td",null,e),(0,t.createElement)("td",null,Math.round(n.views*o).toLocaleString()),(0,t.createElement)("td",null,Math.round(n.pages*o).toLocaleString()))))))},leads:()=>{const[e,a]=(0,o.useState)(""),n=[["Amira Hassan","am***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("Today","softicon-flipbook")],["Jonas Weber","jo***@example.com",(0,l.__)("Room guide","softicon-flipbook"),5,(0,l.__)("Yesterday","softicon-flipbook")],["Priya Nair","pr***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("2 days ago","softicon-flipbook")],["Lucas Martin","lu***@example.com",(0,l.__)("Price list","softicon-flipbook"),2,(0,l.__)("3 days ago","softicon-flipbook")]].filter(t=>!e||t.join(" ").toLowerCase().includes(e.toLowerCase()));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)("input",{type:"search",className:"alfb-try-input",value:e,onChange:e=>a(e.target.value),placeholder:(0,l.__)("Search leads","softicon-flipbook"),"aria-label":(0,l.__)("Search leads","softicon-flipbook")}),(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Download CSV","softicon-flipbook"))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Name","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Asked at page","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("When","softicon-flipbook")))),(0,t.createElement)("tbody",null,n.map(e=>(0,t.createElement)("tr",{key:e[1]},e.map((e,o)=>(0,t.createElement)("td",{key:o},e)))))),!n.length&&(0,t.createElement)("p",{className:"alfb-try-empty"},(0,l.__)("No sample lead matches.","softicon-flipbook")))},defaults:({config:e})=>{const[a,n]=(0,o.useState)({showDownload:!0,showPrint:!1,showThumbnails:!0,showSearch:!0,showShare:!1,flipSound:!0,theme:"light",bgColor:"",bookStyle:"flat"}),s=(e,t)=>n(o=>({...o,[e]:t})),i={...a,sideArrows:"hardcover"===a.bookStyle,pdfUrl:e.urls.demo+"spring-catalog.pdf",maxHeight:380},r=JSON.stringify(a),c=(0,o.useRef)();return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"));const e=c.current?.querySelector("[data-alfb]");return()=>e?.alfb?.destroy?.()},[r]),(0,t.createElement)("div",{className:"alfb-try-split"},(0,t.createElement)("div",{className:"alfb-try-controls"},(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Toolbar on every book","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-chips"},[["showDownload","download",(0,l.__)("Download","softicon-flipbook")],["showPrint","printer",(0,l.__)("Print","softicon-flipbook")],["showThumbnails","grid-view",(0,l.__)("Thumbnails","softicon-flipbook")],["showSearch","search",(0,l.__)("Search","softicon-flipbook")],["showShare","share",(0,l.__)("Share","softicon-flipbook")],["flipSound","controls-volumeon",(0,l.__)("Sound","softicon-flipbook")]].map(([e,o,l])=>(0,t.createElement)("button",{type:"button",key:e,role:"switch","aria-checked":!!a[e],className:"alfb-try-chip"+(a[e]?" is-on":""),onClick:()=>s(e,!a[e])},(0,t.createElement)("span",{className:"dashicons dashicons-"+o,"aria-hidden":"true"}),l))),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Design","softicon-flipbook")),(0,t.createElement)(ze,{label:(0,l.__)("Design","softicon-flipbook"),value:a.bookStyle,onChange:e=>s("bookStyle",e),options:[["flat",(0,l.__)("Classic","softicon-flipbook")],["hardcover",(0,l.__)("Hardcover","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Theme","softicon-flipbook")),(0,t.createElement)(ze,{label:(0,l.__)("Theme","softicon-flipbook"),value:a.theme,onChange:e=>s("theme",e),options:[["light",(0,l.__)("Light","softicon-flipbook")],["dark",(0,l.__)("Dark","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Background","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-swatches"},Ve.map(e=>(0,t.createElement)("button",{type:"button",key:e||"none",className:"alfb-try-swatch"+(e===a.bgColor?" is-on":"")+(e?"":" is-none"),style:e?{background:e}:void 0,onClick:()=>s("bgColor",e),"aria-label":e||(0,l.__)("Theme color","softicon-flipbook")})))),(0,t.createElement)("div",{className:"alfb-try-book",ref:c},(0,t.createElement)(U,{key:r,attributes:i,config:V(i)})))},settings:()=>{const[e,a]=(0,o.useState)({analytics:!0,skipEditors:!0,leadEmail:!1}),n=[["analytics",(0,l.__)("Count opens and pages read","softicon-flipbook"),(0,l.__)("Reading analytics for every book. Nothing personal is stored and no cookies are set.","softicon-flipbook")],["skipEditors",(0,l.__)("Do not count logged-in editors","softicon-flipbook"),(0,l.__)("Your own visits while you work on the site are left out.","softicon-flipbook")],["leadEmail",(0,l.__)("Email me each new lead","softicon-flipbook"),(0,l.__)("Sent to the site admin email.","softicon-flipbook")]];return(0,t.createElement)(t.Fragment,null,n.map(([o,l,n])=>(0,t.createElement)("div",{className:"alfb-try-setting",key:o},(0,t.createElement)("div",null,(0,t.createElement)("strong",null,l),(0,t.createElement)("small",null,n)),(0,t.createElement)(He,{label:l,checked:e[o],onChange:t=>a({...e,[o]:t})}))),(0,t.createElement)("p",{className:"alfb-try-row"},(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Save settings","softicon-flipbook"))))}},$e=({name:e,title:o,config:a})=>{const n=Be[e];return(0,t.createElement)("section",{className:"alfb-try"},(0,t.createElement)("header",null,(0,t.createElement)("span",{className:"alfb-try-badge"},(0,t.createElement)("span",{className:"dashicons dashicons-visibility","aria-hidden":"true"}),(0,l.__)("Try it","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.sprintf)(/* translators: %s: the Pro feature, such as Reading analytics */ /* translators: %s: the Pro feature, such as Reading analytics */
     9(0,l.__)("A working demo of %s with sample data. Click around; nothing is saved.","softicon-flipbook"),o))),(0,t.createElement)("div",{className:"alfb-try-body"},(0,t.createElement)(n,{config:a})))},Ue=({name:e,config:o,play:a})=>{const n={analytics:{icon:"chart-bar",eyebrow:(0,l.__)("Insights","softicon-flipbook"),title:(0,l.__)("Reading analytics","softicon-flipbook"),text:(0,l.__)("See how many people open each book and how far they read.","softicon-flipbook"),video:g.analytics,points:[(0,l.__)("Views, pages read and downloads for every book","softicon-flipbook"),(0,l.__)("A chart per day, for 7, 30 or 90 days","softicon-flipbook"),(0,l.__)("No cookies and nothing personal stored","softicon-flipbook"),(0,l.__)("Download the numbers as a CSV file","softicon-flipbook")]},leads:{icon:"email-alt",eyebrow:(0,l.__)("Audience","softicon-flipbook"),title:(0,l.__)("Lead capture","softicon-flipbook"),text:(0,l.__)("Readers leave their email to keep reading after a few pages.","softicon-flipbook"),video:g.leads,points:[(0,l.__)("Choose after how many pages the form shows","softicon-flipbook"),(0,l.__)("Every lead saved on your own site","softicon-flipbook"),(0,l.__)("An email to you for each new lead","softicon-flipbook"),(0,l.__)("Download your leads as a CSV file","softicon-flipbook")]},defaults:{icon:"admin-appearance",eyebrow:(0,l.__)("Appearance","softicon-flipbook"),title:(0,l.__)("Site defaults","softicon-flipbook"),text:(0,l.__)("Set the toolbar, size, colors and more once, and every flipbook uses them. A book can still change any setting for itself.","softicon-flipbook"),video:g.settings,points:[(0,l.__)("Hide the download button on every book at once","softicon-flipbook"),(0,l.__)("Your brand colors and height on each new book","softicon-flipbook"),(0,l.__)("Right to left for every book on an Arabic, Hebrew or Urdu site","softicon-flipbook"),(0,l.__)("A live preview before you save","softicon-flipbook")]},settings:{icon:"admin-generic",eyebrow:(0,l.__)("Site","softicon-flipbook"),title:(0,l.__)("Settings","softicon-flipbook"),text:(0,l.__)("The site-wide switches for reading analytics and lead emails.","softicon-flipbook"),points:[(0,l.__)("Turn reading analytics on or off","softicon-flipbook"),(0,l.__)("Leave out your own visits while you work","softicon-flipbook"),(0,l.__)("Get an email for each new lead","softicon-flipbook")]}}[e];return(0,t.createElement)("div",{className:"alfb-pp-wrap"},(0,t.createElement)("div",{className:"alfb-pp"},(0,t.createElement)("header",{className:"alfb-pp-hero"},(0,t.createElement)("span",{className:"alfb-pp-icon dashicons dashicons-"+n.icon,"aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-pp-eyebrow"},n.eyebrow," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("h2",null,n.title),(0,t.createElement)("p",null,n.text))),(0,t.createElement)("div",{className:"alfb-pp-body"},(0,t.createElement)("ul",{className:"alfb-pp-points"},n.points.map(e=>(0,t.createElement)("li",{key:e},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),e))),(0,t.createElement)("div",{className:"alfb-pp-actions"},(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/pricing"},(0,l.__)("See Pro plans","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-pp-link",href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook")),n.video&&(0,t.createElement)(u,{url:n.video,title:n.title,play:a,className:"alfb-pp-link"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch it in action","softicon-flipbook"))))),(0,t.createElement)($e,{name:e,title:n.title,config:o}))},Re=()=>{const e=document.getElementById("alfb-dashboard"),l=window.alfbDashboard;if(!e||!l)return;const n=(0,a.applyFilters)("alfb.dashboard.tabs",{welcome:M,demos:G,...Object.fromEntries(["analytics","leads","defaults","settings"].map(e=>[e,o=>(0,t.createElement)(Ue,{name:e,...o})])),pricing:Ie,compare:Le,help:Oe},l);(0,o.createRoot)(e).render((0,t.createElement)(b,{config:l,tabs:n}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Re):Re()})();
  • softicon-flipbook/tags/1.7.0/build/index.asset.php

    r3800561 r3802072  
    1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => '24ea7157b30d401f3552');
     1<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'e3f5adb137a1c8e136ee');
  • softicon-flipbook/tags/1.7.0/build/index.css

    r3792467 r3802072  
    1 .block-editor-block-inspector:has(.siSettings),.siSettings{--wp-admin-theme-color:#059669;--wp-admin-theme-color--rgb:5,150,105;--wp-admin-theme-color-darker-10:#047857;--wp-admin-theme-color-darker-20:#065f46;--wp-components-color-accent:#059669;--wp-components-color-accent-darker-10:#047857;--wp-components-color-accent-darker-20:#065f46;--wpds-color-stroke-focus:#059669;--wpds-color-background-interactive-brand-strong:#059669;--wpds-color-background-interactive-brand-strong-active:#047857;--wpds-color-background-interactive-brand-weak-active:#dcf5ec;--wpds-color-background-surface-brand:#dcf5ec;--wpds-color-background-thumb-brand:#059669;--wpds-color-background-thumb-brand-active:#059669;--wpds-color-foreground-interactive-brand:#059669;--wpds-color-foreground-interactive-brand-active:#047857;--wpds-color-stroke-interactive-brand:#059669;--wpds-color-stroke-interactive-brand-active:#047857;--wpds-color-stroke-surface-brand:#b0e6d2;--wpds-color-stroke-surface-brand-strong:#059669}.siSettings .components-tab-panel__tabs{border-bottom:1px solid #e0e0e0;display:flex}.siSettings .components-tab-panel__tabs-item{color:#50575e;flex:1;font-weight:500;height:48px;justify-content:center}.siSettings .components-tab-panel__tabs-item:after{background:transparent;height:3px}.siSettings .components-tab-panel__tabs-item.is-active{background:#dcf5ec;color:#059669;font-weight:600}.siSettings .components-tab-panel__tabs-item.is-active:after{background:#059669}.siSettings .components-external-link,.siSettings .components-tab-panel__tabs-item:hover:not(.is-active),.siSettings a{color:#059669}.siSettings .components-toggle-control .components-form-toggle.is-checked .components-form-toggle__track{background:#059669;border-color:#059669}.siPanel{position:relative;transition:background-color .2s}.siPanel>.components-panel__body-title .components-panel__body-toggle{font-weight:600;transition:color .15s,background-color .15s}.siPanel:not(.is-opened)>.components-panel__body-title:hover{background:#f0faf6}.siPanel:not(.is-opened)>.components-panel__body-title:hover .components-panel__body-toggle{color:#059669}.siPanel.is-opened{background:#fff;border:1px solid #059669;margin-top:-1px;z-index:1}.siPanel.is-opened>.components-panel__body-title{background:#dcf5ec;margin:-16px -16px 16px}.siPanel.is-opened>.components-panel__body-title .components-panel__arrow,.siPanel.is-opened>.components-panel__body-title .components-panel__body-toggle{color:#059669}.siFields{display:flex;flex-direction:column;gap:20px;padding:4px 0 8px}.siFields .components-base-control,.siFields .components-base-control__field,.siFields>*{margin-bottom:0;margin-top:0}.siFields .components-base-control__help{margin-bottom:0;margin-top:6px}.siFields p{margin:0}.siColors{display:flex;flex-direction:column;gap:4px}.siColorRow{display:block}.siColorToggle.components-button{align-items:center;border-radius:6px;color:#1e1e1e;display:flex;font-size:13px;gap:12px;height:40px;padding:0 4px 0 0;width:100%}.siColorToggle.components-button:hover,.siColorToggle.components-button[aria-expanded=true]{background:transparent;color:#059669}.siColorToggle.components-button .component-color-indicator{border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);flex:none;height:26px;margin:0;width:26px}.siColorToggle.components-button .component-color-indicator.is-empty{background:repeating-conic-gradient(#e0e0e0 0 25%,#fff 0 50%) 50%/8px 8px}.siColorToggle.components-button .siColorName{flex:1;text-align:left}.siColorPopover{padding:16px;width:260px}.siFieldHead{align-items:center;display:flex;gap:6px;margin-bottom:8px}.siFieldLabel{color:#1e1e1e;font-size:13px;font-weight:500;line-height:1.4}.siFieldLine{background:#e0e0e0;flex:1;height:1px;margin-left:4px}.siReset.components-button{font-size:12px;height:26px;padding:0 10px}.siTip{align-items:center;background:none;border:0;border-radius:50%;color:#8c8f94;cursor:help;display:inline-flex;height:20px;justify-content:center;margin:0;padding:0;width:20px}.siTip svg{fill:currentColor;height:16px;width:16px}.siTip:focus-visible,.siTip:hover{background:#dcf5ec;color:#059669;outline:none}.siToggleRow{align-items:center;display:flex;gap:6px}.siToggleRow .components-toggle-control{margin:0}.siTilesGrid{display:grid;gap:8px}.siTile{align-items:center;background:#fff;border:1px solid #dcdcde;border-radius:10px;color:#3c434a;cursor:pointer;display:flex;flex-direction:column;font-size:12px;font-weight:600;gap:6px;justify-content:center;line-height:1.2;margin:0;min-height:68px;padding:10px 6px;text-align:center;transition:border-color .15s,background .15s,color .15s,box-shadow .15s}.siTile svg{fill:currentColor;height:24px;width:24px}.siTile:hover{background:#dcf5ec;border-color:#059669;color:#059669}.siTile:focus-visible{outline:2px solid #059669;outline-offset:2px}.siTile.is-selected{border-color:transparent;box-shadow:0 4px 10px rgba(5,150,105,.25)}.siBadge,.siTile.is-selected{background:#059669;color:#fff}.siBadge{border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.04em;line-height:1.2;margin-left:8px;padding:3px 8px;text-transform:uppercase;vertical-align:1px}.siHelpCards{display:grid;gap:8px;grid-template-columns:1fr 1fr}.siHelpCard{align-items:center;background:#059669;border-radius:10px;box-shadow:0 4px 10px rgba(5,150,105,.2);color:#fff!important;display:flex;flex-direction:column;font-size:12.5px;font-weight:600;gap:8px;justify-content:center;min-height:86px;padding:12px 8px;text-align:center;text-decoration:none;transition:transform .15s,box-shadow .15s}.siHelpCard svg{fill:currentColor;height:26px;width:26px}.siHelpCard:focus-visible,.siHelpCard:hover{background:#047857;box-shadow:0 8px 16px rgba(5,150,105,.3);color:#fff;transform:translateY(-2px)}.siHelpCard:focus-visible{outline:2px solid #047857;outline-offset:2px}.components-tooltip.siTipBubble{background:#1e1e1e;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.2);color:#fff;font-size:12px;line-height:1.45;max-width:240px;padding:8px 11px;text-align:left;white-space:normal}.alfbHelp{color:#757575;font-size:12px;margin:8px 0 0}.alfbPlaceholderHelp{flex-basis:100%;font-size:13px;margin:12px 0 0}.alfbImages{display:grid;gap:4px;grid-template-columns:repeat(4,1fr);margin:0 0 12px}.alfbImages img{aspect-ratio:3/4;border-radius:2px;display:block;-o-object-fit:cover;object-fit:cover;width:100%}.alfbStack{align-items:flex-start;display:flex;flex-direction:column;gap:10px}.alfbStack p{margin:0;word-break:break-all}.alfbStack .alfbHelp{margin:0}.alfbFile{color:#1e1e1e;font-weight:600}.alfbCoverThumb{border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.2);display:block;max-height:128px;max-width:96px}.alfbButtons{display:flex;flex-wrap:wrap;gap:8px}.wp-block-softicon-flipbook .alfb_lb_trigger{cursor:default}.alfbProNotice p{color:#50575e;margin:0 0 8px}.alfbProNotice .dashicons{color:#ea8a10}.alfbProNoticeLink{font-weight:600}.alfbShortcode{margin-top:16px}.alfbShortcodeRow{display:flex;gap:6px;margin-top:8px}.alfbShortcodeRow input{flex:1;font-family:Menlo,Consolas,monospace;font-size:12px;min-width:0}.alfbDeviceHeights{display:grid;gap:8px 12px;grid-template-columns:1fr 1fr}.alfbDeviceHeights>:first-child{grid-column:1/-1}
     1.block-editor-block-inspector:has(.siSettings),.siSettings{--wp-admin-theme-color:#059669;--wp-admin-theme-color--rgb:5,150,105;--wp-admin-theme-color-darker-10:#047857;--wp-admin-theme-color-darker-20:#065f46;--wp-components-color-accent:#059669;--wp-components-color-accent-darker-10:#047857;--wp-components-color-accent-darker-20:#065f46;--wpds-color-stroke-focus:#059669;--wpds-color-background-interactive-brand-strong:#059669;--wpds-color-background-interactive-brand-strong-active:#047857;--wpds-color-background-interactive-brand-weak-active:#dcf5ec;--wpds-color-background-surface-brand:#dcf5ec;--wpds-color-background-thumb-brand:#059669;--wpds-color-background-thumb-brand-active:#059669;--wpds-color-foreground-interactive-brand:#059669;--wpds-color-foreground-interactive-brand-active:#047857;--wpds-color-stroke-interactive-brand:#059669;--wpds-color-stroke-interactive-brand-active:#047857;--wpds-color-stroke-surface-brand:#b0e6d2;--wpds-color-stroke-surface-brand-strong:#059669}.siSettings .components-tab-panel__tabs{border-bottom:1px solid #e0e0e0;display:flex}.siSettings .components-tab-panel__tabs-item{color:#50575e;flex:1;font-weight:500;height:48px;justify-content:center}.siSettings .components-tab-panel__tabs-item:after{background:transparent;height:3px}.siSettings .components-tab-panel__tabs-item.is-active{background:#dcf5ec;color:#059669;font-weight:600}.siSettings .components-tab-panel__tabs-item.is-active:after{background:#059669}.siSettings .components-external-link,.siSettings .components-tab-panel__tabs-item:hover:not(.is-active),.siSettings a{color:#059669}.siSettings .components-toggle-control .components-form-toggle.is-checked .components-form-toggle__track{background:#059669;border-color:#059669}.siPanel{position:relative;transition:background-color .2s}.siPanel>.components-panel__body-title .components-panel__body-toggle{font-weight:600;transition:color .15s,background-color .15s}.siPanel:not(.is-opened)>.components-panel__body-title:hover{background:#f0faf6}.siPanel:not(.is-opened)>.components-panel__body-title:hover .components-panel__body-toggle{color:#059669}.siPanel.is-opened{background:#fff;border:1px solid #059669;margin-top:-1px;z-index:1}.siPanel.is-opened>.components-panel__body-title{background:#dcf5ec;margin:-16px -16px 16px}.siPanel.is-opened>.components-panel__body-title .components-panel__arrow,.siPanel.is-opened>.components-panel__body-title .components-panel__body-toggle{color:#059669}.siFields{display:flex;flex-direction:column;gap:20px;padding:4px 0 8px}.siFields .components-base-control,.siFields .components-base-control__field,.siFields>*{margin-bottom:0;margin-top:0}.siFields .components-base-control__help{margin-bottom:0;margin-top:6px}.siFields p{margin:0}.siColors{display:flex;flex-direction:column;gap:4px}.siColorRow{display:block}.siColorToggle.components-button{align-items:center;border-radius:6px;color:#1e1e1e;display:flex;font-size:13px;gap:12px;height:40px;padding:0 4px 0 0;width:100%}.siColorToggle.components-button:hover,.siColorToggle.components-button[aria-expanded=true]{background:transparent;color:#059669}.siColorToggle.components-button .component-color-indicator{border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);flex:none;height:26px;margin:0;width:26px}.siColorToggle.components-button .component-color-indicator.is-empty{background:repeating-conic-gradient(#e0e0e0 0 25%,#fff 0 50%) 50%/8px 8px}.siColorToggle.components-button .siColorName{flex:1;text-align:left}.siColorPopover{padding:16px;width:260px}.siFieldHead{align-items:center;display:flex;gap:6px;margin-bottom:8px}.siFieldLabel{color:#1e1e1e;font-size:13px;font-weight:500;line-height:1.4}.siFieldLine{background:#e0e0e0;flex:1;height:1px;margin-left:4px}.siReset.components-button{font-size:12px;height:26px;padding:0 10px}.siTip{align-items:center;background:none;border:0;border-radius:50%;color:#8c8f94;cursor:help;display:inline-flex;height:20px;justify-content:center;margin:0;padding:0;width:20px}.siTip svg{fill:currentColor;height:16px;width:16px}.siTip:focus-visible,.siTip:hover{background:#dcf5ec;color:#059669;outline:none}.siToggleRow{align-items:center;display:flex;gap:6px}.siToggleRow .components-toggle-control{margin:0}.siTilesGrid{display:grid;gap:8px}.siTile{align-items:center;background:#fff;border:1px solid #dcdcde;border-radius:10px;color:#3c434a;cursor:pointer;display:flex;flex-direction:column;font-size:12px;font-weight:600;gap:6px;justify-content:center;line-height:1.2;margin:0;min-height:68px;padding:10px 6px;text-align:center;transition:border-color .15s,background .15s,color .15s,box-shadow .15s}.siTile svg{fill:currentColor;height:24px;width:24px}.siTile:hover{background:#dcf5ec;border-color:#059669;color:#059669}.siTile:focus-visible{outline:2px solid #059669;outline-offset:2px}.siTile.is-selected{border-color:transparent;box-shadow:0 4px 10px rgba(5,150,105,.25)}.siBadge,.siTile.is-selected{background:#059669;color:#fff}.siBadge{border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.04em;line-height:1.2;margin-left:8px;padding:3px 8px;text-transform:uppercase;vertical-align:1px}.siHelpCards{display:grid;gap:8px;grid-template-columns:1fr 1fr}.siHelpCard{align-items:center;background:#059669;border-radius:10px;box-shadow:0 4px 10px rgba(5,150,105,.2);color:#fff!important;display:flex;flex-direction:column;font-size:12.5px;font-weight:600;gap:8px;justify-content:center;min-height:86px;padding:12px 8px;text-align:center;text-decoration:none;transition:transform .15s,box-shadow .15s}.siHelpCard svg{fill:currentColor;height:26px;width:26px}.siHelpCard:focus-visible,.siHelpCard:hover{background:#047857;box-shadow:0 8px 16px rgba(5,150,105,.3);color:#fff;transform:translateY(-2px)}.siHelpCard:focus-visible{outline:2px solid #047857;outline-offset:2px}.components-tooltip.siTipBubble{background:#1e1e1e;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.2);color:#fff;font-size:12px;line-height:1.45;max-width:240px;padding:8px 11px;text-align:left;white-space:normal}.alfbHelp{color:#757575;font-size:12px;margin:8px 0 0}.alfbPlaceholderHelp{flex-basis:100%;font-size:13px;margin:12px 0 0}.alfbGuide{background:#f0fdfa;border-left:3px solid #0f766e;border-radius:4px;color:#1e1e1e;flex-basis:100%;font-size:13px;line-height:1.5;margin:4px 0 14px;padding:12px 16px 12px 34px}.alfbGuide li{margin:0 0 4px}.alfbGuide li:last-child{margin-bottom:0}.alfbImages{display:grid;gap:4px;grid-template-columns:repeat(4,1fr);margin:0 0 12px}.alfbImages img{aspect-ratio:3/4;border-radius:2px;display:block;-o-object-fit:cover;object-fit:cover;width:100%}.alfbStack{align-items:flex-start;display:flex;flex-direction:column;gap:10px}.alfbStack p{margin:0;word-break:break-all}.alfbStack .alfbHelp{margin:0}.alfbFile{color:#1e1e1e;font-weight:600}.alfbCoverThumb{border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.2);display:block;max-height:128px;max-width:96px}.alfbButtons{display:flex;flex-wrap:wrap;gap:8px}.wp-block-softicon-flipbook .alfb_lb_trigger{cursor:default}.alfbProNotice p{color:#50575e;margin:0 0 8px}.alfbProNotice .dashicons{color:#ea8a10}.alfbProNoticeLink{font-weight:600}.alfbShortcode{margin-top:16px}.alfbShortcodeRow{display:flex;gap:6px;margin-top:8px}.alfbShortcodeRow input{flex:1;font-family:Menlo,Consolas,monospace;font-size:12px;min-width:0}.alfbDeviceHeights{display:grid;gap:8px 12px;grid-template-columns:1fr 1fr}.alfbDeviceHeights>:first-child{grid-column:1/-1}
  • softicon-flipbook/tags/1.7.0/build/index.js

    r3800561 r3802072  
    1 (()=>{var e={919(e,t,o){"use strict";o(387);const i=window.wp.blocks,s=window.wp.data,a=window.wp.domReady;var n=o.n(a);const l=window.wp.hooks,r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"softicon/flipbook","version":"1.5.0","title":"Flipbook","category":"media","description":"Turn a PDF or a set of images into a page-turning flipbook.","keywords":["flipbook","pdf","magazine","catalog","brochure"],"textdomain":"softicon-flipbook","attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}},"supports":{"html":false,"align":["wide","full"],"spacing":{"margin":true}},"example":{"attributes":{"source":"images"}},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php"}'),h=window.React,c=window.wp.i18n,p=window.wp.element,d=window.wp.blockEditor,f=window.wp.components,u=window.wp.compose,b=(e,t,o=document)=>{const i=[];if(!t?.head||t===o)return i;const s=(e,s=t.head)=>{const a=o.getElementById(e);if(!a||t.getElementById(e))return null;const n=((e,t)=>{if("SCRIPT"!==e.tagName)return t.importNode(e,!0);const o=t.createElement("script");return[...e.attributes].forEach(({name:e,value:t})=>o.setAttribute(e,t)),o.async=!1,o.text=e.text,o})(a,t);return s.appendChild(n),i.push(e),n};return e.filter(Boolean).forEach(e=>{const{before:t,main:o,after:i}=(e=>{if(e.endsWith("-js")){const t=e.slice(0,-3);return{before:[`${t}-js-translations`,`${t}-js-extra`,`${t}-js-before`],main:e,after:[`${t}-js-after`]}}return e.endsWith("-css")?{before:[],main:e,after:[`${e.slice(0,-4)}-inline-css`]}:{before:[],main:e,after:[]}})(e);t.forEach(e=>s(e));const a=s(o);a&&"SCRIPT"===a.tagName&&a.src?a.addEventListener("load",()=>i.forEach(e=>s(e)),{once:!0}):i.forEach(e=>s(e))}),i},m=window.wp.primitives,g=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),_={info:g("M12 2.75a9.25 9.25 0 1 1 0 18.5 9.25 9.25 0 0 1 0-18.5m0 1.5a7.75 7.75 0 1 0 0 15.5 7.75 7.75 0 0 0 0-15.5M11.2 10.6h1.6V17h-1.6zm0-3.4h1.6v1.7h-1.6z",!0),video:g("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m5.5 4v7l6-3.5z"),support:g("M4.5 4h15A1.5 1.5 0 0 1 21 5.5v10a1.5 1.5 0 0 1-1.5 1.5H10l-5 4v-4h-.5A1.5 1.5 0 0 1 3 15.5v-10A1.5 1.5 0 0 1 4.5 4M7 8.5V10h10V8.5zm0 3V13h7v-1.5z",!0),star:g("M12 2.75l2.85 5.95 6.55.75-4.85 4.5 1.3 6.5L12 17.2l-5.85 3.25 1.3-6.5L2.6 9.45l6.55-.75z"),plugins:g("M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z")},k=(0,p.createContext)({open:null,toggle:()=>{}}),v=({initial:e,children:t})=>{const[o,i]=(0,p.useState)(e);return(0,h.createElement)(k.Provider,{value:{open:o,toggle:e=>i(t=>t===e?null:e)}},t)},w=({id:e,title:t,badge:o,children:i})=>{const{open:s,toggle:a}=(0,p.useContext)(k);return(0,h.createElement)(f.PanelBody,{className:"siPanel",title:(0,h.createElement)(h.Fragment,null,t,o&&(0,h.createElement)("span",{className:"siBadge"},o)),opened:s===e,onToggle:()=>a(e)},(0,h.createElement)("div",{className:"siFields"},i))},y=({text:e})=>(0,h.createElement)(f.Tooltip,{text:e,placement:"top",className:"siTipBubble"},(0,h.createElement)("button",{type:"button",className:"siTip","aria-label":e},_.info)),E=({label:e,tip:t,action:o})=>(0,h.createElement)("div",{className:"siFieldHead"},(0,h.createElement)("span",{className:"siFieldLabel"},e),t&&(0,h.createElement)(y,{text:t}),(0,h.createElement)("span",{className:"siFieldLine","aria-hidden":"true"}),o),x=({onClick:e,disabled:t})=>(0,h.createElement)(f.Button,{className:"siReset",variant:"secondary",size:"small",onClick:e,disabled:t},(0,c.__)("Reset","softicon-flipbook")),C=({label:e,tip:t,checked:o,onChange:i})=>(0,h.createElement)("div",{className:"siToggleRow"},(0,h.createElement)(f.ToggleControl,{label:e,checked:o,onChange:i,__nextHasNoMarginBottom:!0}),t&&(0,h.createElement)(y,{text:t})),M=({label:e,tip:t,value:o,options:i,onChange:s})=>(0,h.createElement)("div",{className:"siTiles"},(0,h.createElement)(E,{label:e,tip:t}),(0,h.createElement)("div",{className:"siTilesGrid",role:"radiogroup","aria-label":e,style:{gridTemplateColumns:`repeat(${i.length}, 1fr)`}},i.map(e=>(0,h.createElement)("button",{key:e.value,type:"button",role:"radio","aria-checked":o===e.value,className:"siTile"+(o===e.value?" is-selected":""),onClick:()=>s(e.value)},e.icon,(0,h.createElement)("span",null,e.label))))),P=({label:e,value:t,onChange:o})=>(0,h.createElement)(f.Dropdown,{className:"siColorRow",popoverProps:{placement:"left-start",offset:36},renderToggle:({isOpen:o,onToggle:i})=>(0,h.createElement)(f.Button,{className:"siColorToggle",onClick:i,"aria-expanded":o
    2 /* translators: %s: a color setting, like Background */,"aria-label":(0,c.sprintf)((0,c.__)("%s color","softicon-flipbook"),e)+(t?": "+t:"")},(0,h.createElement)("span",{className:"siColorName"},e),(0,h.createElement)(f.ColorIndicator,{colorValue:t||void 0,className:t?"":"is-empty"})),renderContent:()=>(0,h.createElement)("div",{className:"siColorPopover"},(0,h.createElement)(d.ColorPalette,{value:t,onChange:e=>o(e||""),clearable:!0}))}),T=({cards:e})=>(0,h.createElement)("div",{className:"siHelpCards"},e.map(e=>(0,h.createElement)("a",{key:e.href,className:"siHelpCard",href:e.href,target:"_blank",rel:"noopener noreferrer"},e.icon,(0,h.createElement)("span",null,e.label),(0,h.createElement)("span",{className:"screen-reader-text"},(0,c.__)("(opens in a new tab)","softicon-flipbook"))))),L=(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,h.createElement)(m.Path,{d:"M12 6.5C10.3 5.3 8 4.75 5 4.75H3v13h2c3 0 5.3.55 7 1.75 1.7-1.2 4-1.75 7-1.75h2v-13h-2c-3 0-5.3.55-7 1.75m-1.25 10.6c-1.5-.6-3.4-.9-5.75-.85V6.25c2.5 0 4.4.45 5.75 1.4zm8.25-.85c-2.35-.05-4.25.25-5.75.85V7.65c1.35-.95 3.25-1.4 5.75-1.4z"})),S=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),z={pdf:S("M6 2.5h7.6L19.5 8.4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M6 4v16h12V9.5h-5.5V4zm8 .6V8h3.4zM8 12.5h8V14H8zm0 3h8V17H8z",!0),images:S("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m0 1.5v10.4l4.2-4.2 2.8 2.8 4.3-4.7 3.7 4V6zM8.5 10.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5",!0),auto:S("M2 4.5h14v10H2zm1.5 1.5v7h11V6zM6 16.5h6V18H6zM17 8h5v12.5h-5zm1.5 1.5V19h2V9.5z",!0),twoPages:S("M2.5 5h8.5v14H2.5zM4 6.5v11h5.5v-11zM13 5h8.5v14H13zm1.5 1.5v11H20v-11z",!0),onePage:S("M6.5 3h11v18h-11zM8 4.5v15h8v-15zM10 8h4v1.5h-4zm0 3h4v1.5h-4z",!0),classic:S("M3 6.5h8.25v11H3zM4.5 8v8h5.25V8zM12.75 6.5H21v11h-8.25zm1.5 1.5v8h5.25V8z",!0),hardcover:S("M1.5 4.5h21v15h-21zM3 6v12h8.25V6zm9.75 0v12H21V6z",!0),cover:S("M6 2.5h12A1.5 1.5 0 0 1 19.5 4v16a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M8 4v16h10V4zm2.5 3H16v1.5h-5.5z",!0),button:S("M4 7h16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2m0 1.5a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5zM7 11.25h10v1.5H7z",!0),text:S("M3 7h18v1.5H3zm0 4.5h12V13H3zm0 4.5h7.5v1.5H3z"),alignLeft:S("M4 5h16v1.5H4zm0 4h10v1.5H4zm0 4h16v1.5H4zm0 4h10v1.5H4z"),alignCenter:S("M4 5h16v1.5H4zm3 4h10v1.5H7zm-3 4h16v1.5H4zm3 4h10v1.5H7z"),alignRight:S("M4 5h16v1.5H4zm6 4h10v1.5H10zm-6 4h16v1.5H4zm6 4h10v1.5H10z")},H=[{name:"general",title:(0,c.__)("General","softicon-flipbook"),className:"general"},{name:"style",title:(0,c.__)("Style","softicon-flipbook"),className:"style"}],N=[{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto",icon:z.auto},{label:(0,c.__)("Two pages","softicon-flipbook"),value:"double",icon:z.twoPages},{label:(0,c.__)("One page","softicon-flipbook"),value:"single",icon:z.onePage}],A=[{label:(0,c.__)("PDF file","softicon-flipbook"),value:"pdf",icon:z.pdf},{label:(0,c.__)("Images","softicon-flipbook"),value:"images",icon:z.images}],F="&list=PLJEAefIarF4g",B={overview:"https://www.youtube.com/watch?v=5geq69DXoN8"+F,add:"https://www.youtube.com/watch?v=KGP_xpi8NGo"+F,design:"https://www.youtube.com/watch?v=qqQeZQkX5ms"+F,reading:"https://www.youtube.com/watch?v=1J7wCaUvugc"+F,lightbox:"https://www.youtube.com/watch?v=XBJuUV9HpkA"+F,settings:"https://www.youtube.com/watch?v=H9IxgIocY68"+F,promo:"https://www.youtube.com/watch?v=Oj9sHOZbb3A"+F,shortcode:"https://www.youtube.com/watch?v=slQlR4GTghg"+F,autoplay:"https://www.youtube.com/watch?v=bkuMUupI92Y"+F,rtl:"https://www.youtube.com/watch?v=MzZs4jJInFA"+F,shelf:"https://www.youtube.com/watch?v=9UY2KNYzkGk"+F,buttons:"https://www.youtube.com/watch?v=fS5RMGkPQXk"+F,leads:"https://www.youtube.com/watch?v=GxbrW_pyAdA"+F,protect:"https://www.youtube.com/watch?v=5UNgRO22s_Q"+F,hotspots:"https://www.youtube.com/watch?v=D7WiNswbHi8"+F,branding:"https://www.youtube.com/watch?v=iOr2NJ0yaAA"+F,analytics:"https://www.youtube.com/watch?v=ET4JXhOO-2s"+F,field:"https://www.youtube.com/watch?v=BGlS_IKKagM"+F,bookmarks:"https://www.youtube.com/watch?v=4-D5HxqV1yg"+F,pro:"https://www.youtube.com/watch?v=LtCj7-J2qXI"+F},I=[{label:(0,c.__)("Classic","softicon-flipbook"),value:"flat",icon:z.classic},{label:(0,c.__)("Hardcover","softicon-flipbook"),value:"hardcover",icon:z.hardcover}],D=[{label:(0,c.__)("Cover","softicon-flipbook"),value:"cover",icon:z.cover},{label:(0,c.__)("Button","softicon-flipbook"),value:"button",icon:z.button},{label:(0,c.__)("Text link","softicon-flipbook"),value:"text",icon:z.text}],R=[{label:(0,c.__)("Left","softicon-flipbook"),value:"left",icon:z.alignLeft},{label:(0,c.__)("Center","softicon-flipbook"),value:"center",icon:z.alignCenter},{label:(0,c.__)("Right","softicon-flipbook"),value:"right",icon:z.alignRight}],V=[{href:"https://www.youtube.com/playlist?list=PLJEAefIarF4g",label:(0,c.__)("Video tutorials","softicon-flipbook"),icon:_.video},{href:"https://wordpress.org/support/plugin/softicon-flipbook/",label:(0,c.__)("Get support","softicon-flipbook"),icon:_.support},{href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",label:(0,c.__)("Rate Flipbook","softicon-flipbook"),icon:_.star},{href:"https://wordpress.org/plugins/author/softiconai/",label:(0,c.__)("More plugins","softicon-flipbook"),icon:_.plugins}],W=({text:e,href:t})=>(0,h.createElement)("div",{className:"alfbProNotice"},(0,h.createElement)("p",null,(0,h.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})," ",e),t&&(0,h.createElement)(f.ExternalLink,{href:t,className:"alfbProNoticeLink"},(0,c.__)("Unlock with Pro","softicon-flipbook"))),O=({value:e,onChange:t})=>{const[o,i]=(0,p.useState)(String(e));return(0,p.useEffect)(()=>i(String(e)),[e]),(0,h.createElement)(f.TextControl,{type:"number",min:1,label:(0,c.__)("Open at page","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:e=>{i(e),parseInt(e,10)>=1&&t(parseInt(e,10))},onBlur:()=>i(String(e)),__nextHasNoMarginBottom:!0})},U=window.alfbEditor||{},j=()=>{const[e,t]=(0,p.useState)(!1),{type:o,id:i,published:a}=(0,s.useSelect)(e=>{const t=e("core/editor");return{type:t?.getCurrentPostType(),id:t?.getCurrentPostId(),published:"publish"===t?.getEditedPostAttribute("status")}},[]);if("alfb_book"!==o||!i)return null;const n=`[softicon_flipbook id="${i}"]`;return(0,h.createElement)("div",{className:"alfbShortcode"},(0,h.createElement)(E,{label:(0,c.__)("Shortcode","softicon-flipbook"),tip:(0,c.__)("Paste it in the Classic Editor, Elementor or any page builder to show this flipbook there.","softicon-flipbook")}),(0,h.createElement)("div",{className:"alfbShortcodeRow"},(0,h.createElement)("input",{type:"text",readOnly:!0,value:n,onFocus:e=>e.target.select(),"aria-label":(0,c.__)("Shortcode","softicon-flipbook")}),(0,h.createElement)(f.Button,{variant:"secondary",onClick:e=>{const o=e.currentTarget.previousElementSibling,i=()=>{t(!0),setTimeout(()=>t(!1),1600)};window.navigator.clipboard&&window.isSecureContext?window.navigator.clipboard.writeText(n).then(i):(o.select(),o.ownerDocument.execCommand("copy")&&i())}},e?(0,c.__)("Copied","softicon-flipbook"):(0,c.__)("Copy","softicon-flipbook"))),!a&&(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("It shows the flipbook once it is published.","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shortcode},(0,c.__)("Where to paste it: the Classic Editor, Elementor and more","softicon-flipbook"))))},q=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>{const{source:s,pdfId:a,pdfUrl:n,images:r,pageMode:p,showCover:u,startPage:b,startWith:m,autoplay:g,autoplaySeconds:_,autoplayLoop:k,rtl:v,phoneFullscreen:y,showDownload:x,showPrint:P,showFullscreen:L,showZoom:S,showThumbnails:z,showContents:H,showLinks:F,showSearch:I,showShare:D,flipSound:R}=e,q=e=>o=>t({[e]:o}),$=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),Z=(()=>{const e=n?n.split("/").pop().split("?")[0]:"";try{return decodeURIComponent(e)}catch(t){return e}})();return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"help",title:(0,c.__)("Help","softicon-flipbook")},(0,h.createElement)(T,{cards:V}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.settings},(0,c.__)("Every setting explained, in 2 minutes","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("Email:","softicon-flipbook")," ",(0,h.createElement)("a",{href:"mailto:support@softiconai.com"},"support@softiconai.com")),(0,h.createElement)(j,null)),(0,h.createElement)(w,{id:"source",title:(0,c.__)("Source","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Pages from","softicon-flipbook"),value:s,options:A,onChange:q("source")}),"pdf"===s?(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("PDF","softicon-flipbook"),tip:(0,c.__)("PDFs from your Media Library always work. A link to a PDF on another website works only if that site allows it.","softicon-flipbook")}),Z&&(0,h.createElement)("p",{className:"alfbFile"},Z),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["application/pdf"],value:a,onSelect:o,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},n?(0,c.__)("Replace PDF","softicon-flipbook"):(0,c.__)("Choose PDF","softicon-flipbook"))})),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Taking each post's PDF from a custom field (Meta Box, ACF), and text readers can select and copy, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.field},(0,c.__)("Watch: each post's own PDF from Meta Box or ACF","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Links in the PDF","softicon-flipbook"),tip:(0,c.__)("Web, email and page links inside the PDF can be clicked. Web links open in a new tab, page links turn the book.","softicon-flipbook"),checked:F,onChange:q("showLinks")}),$("showLinks")):(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Pages","softicon-flipbook"),tip:(0,c.__)("Each image is one page. Drag them in the media window to change the order.","softicon-flipbook")}),!!r.length&&(0,h.createElement)("div",{className:"alfbImages"},r.slice(0,8).map(e=>(0,h.createElement)("img",{key:e.id||e.url,src:e.url,alt:""}))),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:r.map(e=>e.id),onSelect:i,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},r.length?(0,c.__)("Edit pages","softicon-flipbook"):(0,c.__)("Choose images","softicon-flipbook"))})))),(0,h.createElement)(w,{id:"pages",title:(0,c.__)("Pages","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Layout","softicon-flipbook"),tip:(0,c.__)("Auto shows two pages side by side on wide screens and one page on phones. Or keep one layout everywhere.","softicon-flipbook"),value:p,options:N,onChange:q("pageMode")}),$("pageMode"),(0,h.createElement)(C,{label:(0,c.__)("Cover page","softicon-flipbook"),tip:(0,c.__)("The first and last pages turn on their own, like a printed book.","softicon-flipbook"),checked:u,onChange:q("showCover")}),$("showCover"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Open at page","softicon-flipbook"),tip:(0,c.__)("The book opens at this page. A link ending in #page=5 opens it at page 5.","softicon-flipbook")}),(0,h.createElement)(O,{value:b,onChange:e=>t({startPage:e})})),(0,h.createElement)(f.SelectControl,{label:(0,c.__)("Start with","softicon-flipbook"),help:(0,c.__)("Readers can first pick a page from the thumbnails or the table of contents (from the PDF's bookmarks). On the published page.","softicon-flipbook"),value:m,onChange:q("startWith"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:(0,c.__)("The book","softicon-flipbook"),value:"book"},{label:(0,c.__)("The thumbnails","softicon-flipbook"),value:"thumbnails"},{label:(0,c.__)("The table of contents","softicon-flipbook"),value:"contents"}]}),(0,h.createElement)(C,{label:(0,c.__)("Right to left","softicon-flipbook"),tip:(0,c.__)("For books read from right to left, such as Arabic, Hebrew or Urdu: the next page is on the left, and the arrows and arrow keys follow.","softicon-flipbook"),checked:v,onChange:q("rtl")}),$("rtl"),(0,h.createElement)(C,{label:(0,c.__)("Autoplay","softicon-flipbook"),tip:(0,c.__)("Turns the pages by itself while the book is on screen, on the published page. It holds while the mouse is over the book, stops when a reader takes over, and the toolbar gets a pause button.","softicon-flipbook"),checked:g,onChange:q("autoplay")}),g&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Seconds per page","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:2,max:60,label:(0,c.__)("Seconds per page","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({autoplaySeconds:Math.min(60,Math.max(2,parseInt(e,10)||4))}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$("autoplaySeconds")),(0,h.createElement)(C,{label:(0,c.__)("Start again at the end","softicon-flipbook"),tip:(0,c.__)("After the last page the book goes back to the first one and keeps playing.","softicon-flipbook"),checked:k,onChange:q("autoplayLoop")}),$("autoplayLoop")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.autoplay},(0,c.__)("Watch autoplay in 45 seconds","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.rtl},(0,c.__)("Watch right to left and fullscreen on phones","softicon-flipbook")))),(0,h.createElement)(w,{id:"toolbar",title:(0,c.__)("Toolbar","softicon-flipbook")},(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("The preview here shows only the book; the buttons work on the published page.","softicon-flipbook")),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Download button","softicon-flipbook"),tip:(0,c.__)("Lets visitors save the PDF.","softicon-flipbook"),checked:x,onChange:q("showDownload")}),$("showDownload")),(0,h.createElement)(C,{label:(0,c.__)("Print button","softicon-flipbook"),tip:(0,c.__)("Readers print the whole book. The pages are prepared in the browser first, so a long book takes a moment.","softicon-flipbook"),checked:P,onChange:q("showPrint")}),$("showPrint"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen button","softicon-flipbook"),tip:(0,c.__)("Fits the book to the screen and redraws the pages sharper.","softicon-flipbook"),checked:L,onChange:q("showFullscreen")}),$("showFullscreen"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen on phones","softicon-flipbook"),tip:(0,c.__)('On a phone the book shows "Tap to read"; one tap opens it full screen, where the pages are easier to read.',"softicon-flipbook"),checked:y,onChange:q("phoneFullscreen")}),$("phoneFullscreen"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Table of contents","softicon-flipbook"),tip:(0,c.__)("A button with the PDF's chapters (its bookmarks), a click opens one. It shows only when the PDF has bookmarks.","softicon-flipbook"),checked:H,onChange:q("showContents")}),$("showContents")),(0,h.createElement)(C,{label:(0,c.__)("Thumbnails","softicon-flipbook"),tip:(0,c.__)("A button that shows all pages, a click opens one.","softicon-flipbook"),checked:z,onChange:q("showThumbnails")}),$("showThumbnails"),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Bookmarks, so readers can mark pages and come back to them, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.bookmarks},(0,c.__)("Watch: bookmarks and selectable text","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Zoom","softicon-flipbook"),tip:(0,c.__)("Zoom buttons, pinch on phones and Ctrl + scroll on computers.","softicon-flipbook"),checked:S,onChange:q("showZoom")}),$("showZoom"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Search","softicon-flipbook"),tip:(0,c.__)("A search box that lists the pages with the words, a click opens the page. PDFs only.","softicon-flipbook"),checked:I,onChange:q("showSearch")}),$("showSearch")),(0,h.createElement)(C,{label:(0,c.__)("Share","softicon-flipbook"),tip:(0,c.__)("A link to the page that is open: on Facebook, X, LinkedIn, Pinterest, by email or copied. Phones use their own share sheet.","softicon-flipbook"),checked:D,onChange:q("showShare")}),$("showShare"),(0,h.createElement)(C,{label:(0,c.__)("Page turn sound","softicon-flipbook"),tip:(0,c.__)("Visitors can mute it from the toolbar.","softicon-flipbook"),checked:R,onChange:q("flipSound")}),$("flipSound")),!U.pro&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"buttons",title:(0,c.__)("Page buttons","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("A button on a chosen page, such as a link or a WooCommerce product with its price, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.buttons},(0,c.__)("Watch page buttons in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"hotspots",title:(0,c.__)("Hotspots","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Clickable areas on your pages, with a link or a WooCommerce product and its price, are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.hotspots},(0,c.__)("Watch hotspots in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"leads",title:(0,c.__)("Lead capture","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Asking readers for their email after a few pages is available in Pro. The leads are saved on your site.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.leads},(0,c.__)("Watch lead capture in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"shelf",title:(0,c.__)("Shelf","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Showing many books on one shelf, each opening in a popup, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shelf},(0,c.__)("Watch the shelf in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"protect",title:(0,c.__)("Protection","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Protecting the PDF (a password, no download button, no right-click, the PDF address kept out of the page) is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.protect},(0,c.__)("Watch protection in 40 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"watermark",title:(0,c.__)("Watermark","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Your words or logo drawn into every page, with the reader's name or email if you like, is available in Pro.","softicon-flipbook")}))))},$=e=>({id:e.id,url:e.url||e.source_url,alt:e.alt||e.alt_text||"",width:e.width||e.media_details?.width||0,height:e.height||e.media_details?.height||0}),Z=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],G=e=>(e="string"==typeof e?e.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(e)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(e)&&[...e.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>Z.includes(e))?e:void 0),X=window.alfbEditor||{},Y=({attributes:e,setAttributes:t})=>{const{bookTitle:o,theme:i,maxHeight:s,maxHeightTablet:a,maxHeightPhone:n,bookStyle:r,sideArrows:p,displayMode:u,lightboxTrigger:b,lightboxText:m,lightboxImage:g,lightboxWidth:_,lightboxAlign:k}=e,v="hardcover"===r,y="lightbox"===u,T="cover"===b,L=e=>o=>t({[e]:o}),S=t=>({value:e[t],onChange:L(t)}),z=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),H=(e,t)=>(0,l.applyFilters)("alfb.block.reset",t,e),N=(e,t)=>(0,l.applyFilters)("alfb.block.atDefault",t,e);return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"display",title:(0,c.__)("Display","softicon-flipbook"),badge:(0,c.__)("New","softicon-flipbook")},(0,h.createElement)(C,{label:(0,c.__)("Open in a lightbox","softicon-flipbook"),tip:(0,c.__)("Off: the book shows on the page. On: only a cover, button or link shows on the page, and a click opens the book in a popup over the page; the book loads only then.","softicon-flipbook"),checked:y,onChange:e=>t({displayMode:e?"lightbox":"inline"})}),z("displayMode"),!y&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Title above the book","softicon-flipbook"),tip:(0,c.__)("Shown above the book, also in full screen. Leave it empty for no title.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:(0,c.__)("Title above the book","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:L("bookTitle"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),y&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(M,{label:(0,c.__)("Open with","softicon-flipbook"),value:b,options:D,onChange:L("lightboxTrigger")}),z("lightboxTrigger"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),tip:T?(0,c.__)("Shown under the cover. Leave it empty for no caption.","softicon-flipbook"):(0,c.__)('Leave it empty for "Read the flipbook".',"softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),hideLabelFromVision:!0,value:m,onChange:L("lightboxText"),placeholder:T?"":(0,c.__)("Read the flipbook","softicon-flipbook"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),T&&(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Cover image","softicon-flipbook"),tip:(0,c.__)("Without an image the first page is the cover.","softicon-flipbook")}),g?.url&&(0,h.createElement)("img",{className:"alfbCoverThumb",src:g.url,alt:""}),(0,h.createElement)("div",{className:"alfbButtons"},(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],value:g?.id,onSelect:e=>t({lightboxImage:$(e)}),render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},g?.url?(0,c.__)("Replace image","softicon-flipbook"):(0,c.__)("Choose image","softicon-flipbook"))})),g?.url&&(0,h.createElement)(f.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>t({lightboxImage:{}})},(0,c.__)("Remove","softicon-flipbook")))),T&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),tip:(0,c.__)("Narrow columns and phones make the cover smaller.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({lightboxWidth:H("lightboxWidth",260)}),disabled:N("lightboxWidth",260===_)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({lightboxWidth:e||260}),min:120,max:600,step:10,__nextHasNoMarginBottom:!0}),z("lightboxWidth")),(0,h.createElement)(M,{label:(0,c.__)("Alignment","softicon-flipbook"),value:k,options:R,onChange:L("lightboxAlign")}),z("lightboxAlign")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.lightbox},(0,c.__)("See the lightbox in action","softicon-flipbook")))),(0,h.createElement)(w,{id:"design",title:(0,c.__)("Design","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Design","softicon-flipbook"),tip:(0,c.__)("Hardcover puts the pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows beside the book.","softicon-flipbook"),value:r,options:I,onChange:e=>t({bookStyle:e,sideArrows:"hardcover"===e})}),z("bookStyle"),v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Side arrows","softicon-flipbook"),tip:(0,c.__)("Large arrows beside the book. On phones they sit over the page edges.","softicon-flipbook"),checked:p,onChange:L("sideArrows")}),z("sideArrows")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.design},(0,c.__)("See the Hardcover design in action","softicon-flipbook")))),!y&&(0,h.createElement)(w,{id:"size",title:(0,c.__)("Size","softicon-flipbook")},(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),tip:(0,c.__)("The book keeps the page shape and shrinks to fit smaller screens.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({maxHeight:H("maxHeight",700)}),disabled:N("maxHeight",700===s)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),hideLabelFromVision:!0,value:s,onChange:e=>t({maxHeight:e||700}),min:300,max:1400,step:10,__nextHasNoMarginBottom:!0}),z("maxHeight")),(0,h.createElement)("div",{className:"alfbDeviceHeights"},(0,h.createElement)(E,{label:(0,c.__)("On tablets and phones","softicon-flipbook"),tip:(0,c.__)("A different maximum height on tablets (under 1025 px wide) and phones (under 600 px). Leave a field empty to keep the height above. The editor's Tablet and Mobile previews show them.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Tablet (px)","softicon-flipbook"),value:a||"",placeholder:String(s),onChange:e=>t({maxHeightTablet:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Phone (px)","softicon-flipbook"),value:n||"",placeholder:String(s),onChange:e=>t({maxHeightPhone:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),z("maxHeightTablet"),z("maxHeightPhone"))),(0,h.createElement)(w,{id:"colors",title:(0,c.__)("Colors","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Theme","softicon-flipbook"),tip:(0,c.__)("Dark puts the book on a dark background with light controls. Auto follows the reader's device. A color you set below still wins.","softicon-flipbook"),value:i||"light",onChange:L("theme"),options:[{label:(0,c.__)("Light","softicon-flipbook"),value:"light"},{label:(0,c.__)("Dark","softicon-flipbook"),value:"dark"},{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto"}]}),z("theme"),(0,h.createElement)("div",{className:"siColors"},v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(P,{label:(0,c.__)("Cover","softicon-flipbook"),...S("coverColor")}),z("coverColor")),(0,h.createElement)(P,{label:(0,c.__)("Background","softicon-flipbook"),...S("bgColor")}),z("bgColor"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar background","softicon-flipbook"),...S("toolbarBg")}),z("toolbarBg"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar icons and text","softicon-flipbook"),...S("toolbarColor")}),z("toolbarColor")),!X.pro&&(0,h.createElement)(W,{href:X.defaults||X.pricing,text:(0,c.__)("Setting the colors, size and toolbar once for every flipbook on the site is available in Pro.","softicon-flipbook")})),!X.pro&&(0,h.createElement)(w,{id:"branding",title:(0,c.__)("Branding","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:X.pricing,text:(0,c.__)("Your logo in the toolbar, linked to your site, and your own picture behind the book are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.branding},(0,c.__)("Watch branding in 40 seconds","softicon-flipbook")))))},J=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>(0,h.createElement)(d.InspectorControls,null,(0,h.createElement)(f.TabPanel,{className:"siSettings",tabs:H},s=>(0,h.createElement)(v,{key:s.name,initial:"style"===s.name?"display":"source"},"general"===s.name&&(0,h.createElement)(q,{attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i}),"style"===s.name&&(0,h.createElement)(Y,{attributes:e,setAttributes:t}),(0,l.applyFilters)("alfb.block.inspector",null,{tab:s.name,attributes:e,setAttributes:t,Panel:w}))));let K=null,Q=null;const ee=[1,1.5,2,3,4],te=(e,t,o)=>Math.min(o,Math.max(t,e)),oe=e=>Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY);class ie{constructor(e){this.book=e,this.doc=e.doc,this.level=1,this.view=null,this.pinch=null,this.timer=0,this.token=0,this.attach()}get active(){return!!this.view}get atMax(){return this.level>=3.99}step(e){const t=e>0?ee.find(e=>e>this.level+.01):[...ee].reverse().find(e=>e<this.level-.01);this.set(t||(e>0?4:1))}set(e,t){if((e=te(e,1,4))<1.02)return void this.close();let o=null;this.view||(o=this.pagesFraction(t),this.open());const{view:i,inner:s}=this,a=i.getBoundingClientRect(),n=t?t.x-a.left:i.clientWidth/2,l=t?t.y-a.top:i.clientHeight/2;o=o||{x:(i.scrollLeft+n-s.offsetLeft)/s.offsetWidth,y:(i.scrollTop+l-s.offsetTop)/s.offsetHeight},this.level=e,this.layout(),i.scrollLeft=s.offsetLeft+o.x*s.offsetWidth-n,i.scrollTop=s.offsetTop+o.y*s.offsetHeight-l,this.schedule(),this.book.onZoom()}pagesFraction(e){if(!e)return{x:.5,y:.5};const t=this.book.visible().map(e=>this.book.pages[e].getBoundingClientRect()),o=Math.min(...t.map(e=>e.left)),i=Math.max(...t.map(e=>e.right)),s=Math.min(...t.map(e=>e.top)),a=Math.max(...t.map(e=>e.bottom));return{x:te((e.x-o)/(i-o||1),0,1),y:te((e.y-s)/(a-s||1),0,1)}}open(){this.view=this.doc.createElement("div"),this.view.className="alfb_zoom",this.inner=this.doc.createElement("div"),this.inner.className="alfb_zoom_inner",this.view.append(this.inner),this.book.stage.append(this.view),this.fill(),this.drag(),this.view.addEventListener("dblclick",()=>this.set(1))}fill(){this.shown=this.book.visible(),this.sharp=this.shown.map(()=>0),this.inner.replaceChildren(...this.shown.map(e=>{const t=this.doc.createElement("div");return t.className="alfb_zoom_page",t.setAttribute("role","img"),t.setAttribute("aria-label",this.book.pages[e].getAttribute("aria-label")),t.append(this.copy(e)),t}))}copy(e){if("images"===this.book.config.source){const t=this.book.config.images[e],o=this.doc.createElement("img");return o.src=t.url,o.alt=t.alt||"",o}const t=this.doc.createElement("canvas"),o=this.book.pages[e].querySelector("canvas");return o&&(t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0)),t}layout(){const e=this.book.flip.getBoundsRect(),t=Math.round(e.pageWidth*this.level),o=Math.round(e.height*this.level);this.inner.style.width=t*this.shown.length+"px",this.inner.style.height=o+"px",[...this.inner.children].forEach(e=>{e.style.width=t+"px",e.style.height=o+"px"})}schedule(){clearTimeout(this.timer),this.timer=setTimeout(()=>this.render(),150)}async render(){if(!this.view||"images"===this.book.config.source)return;const e=++this.token,t=this.book.flip.getBoundsRect(),o=Math.min(this.book.win.devicePixelRatio||1,2),i=Math.min(Math.ceil(t.pageWidth*this.level*o),Math.floor(Math.sqrt(16e6*this.book.ratio)));for(let t=0;t<this.shown.length;t++){if(this.sharp[t]>=i)continue;const o=await this.book.drawPage(this.shown[t],i).catch(()=>null);if(e!==this.token||!this.view)return;o&&(this.inner.children[t].replaceChildren(o),this.sharp[t]=i)}}update(){this.view&&(this.book.visible().join()!==this.shown.join()?(this.token++,this.fill(),this.layout(),this.view.scrollTop=0,this.view.scrollLeft=0,this.schedule()):this.set(this.level))}close(){clearTimeout(this.timer),this.token++,this.view?.remove(),this.view=null,this.level=1,this.book.onZoom()}drag(){const{view:e}=this;let t=null;e.addEventListener("pointerdown",o=>{"mouse"===o.pointerType&&0===o.button&&(t={x:o.clientX,y:o.clientY,left:e.scrollLeft,top:e.scrollTop},e.setPointerCapture(o.pointerId),e.classList.add("alfb_dragging"))}),e.addEventListener("pointermove",o=>{t&&(e.scrollLeft=t.left-(o.clientX-t.x),e.scrollTop=t.top-(o.clientY-t.y))});const o=()=>{t=null,e.classList.remove("alfb_dragging")};e.addEventListener("pointerup",o),e.addEventListener("pointercancel",o)}attach(){const{book:e}=this,{stage:t}=e,o={capture:!0,passive:!1};e.on(t,"touchstart",t=>{2!==t.touches.length||e.thumbs?.open||(t.preventDefault(),t.stopPropagation(),e.cancelTouch(),this.pinch={distance:oe(t.touches),level:this.level})},o),e.on(t,"touchmove",e=>{var t;this.pinch&&(e.preventDefault(),e.stopPropagation(),2===e.touches.length&&this.set(this.pinch.level*oe(e.touches)/this.pinch.distance,{x:((t=e.touches)[0].clientX+t[1].clientX)/2,y:(t[0].clientY+t[1].clientY)/2}))},o);const i=e=>{this.pinch&&!e.touches.length&&(this.pinch=null)};e.on(t,"touchend",i,o),e.on(t,"touchcancel",i,o),e.on(t,"wheel",t=>{t.ctrlKey&&!e.thumbs?.open&&(t.preventDefault(),this.set(this.level*Math.exp(-t.deltaY/100),{x:t.clientX,y:t.clientY}))},o);let s=1;e.on(t,"gesturestart",e=>{e.preventDefault(),s=this.level},o),e.on(t,"gesturechange",t=>{t.preventDefault(),this.pinch||e.thumbs?.open||this.set(s*t.scale,{x:t.clientX,y:t.clientY})},o)}}class se{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.items=[],this.urls=[],this.queue=Promise.resolve()}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.contents?.close(!1),t.search?.close(!1);const o=t.visible();this.panel=this.doc.createElement("div"),this.panel.className="alfb_thumbs",this.panel.setAttribute("role","region"),this.panel.setAttribute("aria-label",t.thumbsBtn.title),this.items=t.pages.map((e,i)=>{const s=this.doc.createElement("button");s.type="button",s.className="alfb_thumb",s.setAttribute("aria-label",e.getAttribute("aria-label")),o.includes(i)&&(s.classList.add("alfb_current"),s.setAttribute("aria-current","page"));const a=this.doc.createElement("span");a.className="alfb_thumb_img",a.style.aspectRatio=String(t.ratio);const n=this.doc.createElement("span");return n.className="alfb_thumb_num",n.setAttribute("aria-hidden","true"),n.textContent=i+1,s.append(a,n),s.addEventListener("click",()=>{this.close(!1),t.go(i),t.thumbsBtn.focus()}),s}),this.panel.append(...this.items),t.stage.append(this.panel),this.observer=new t.win.IntersectionObserver(e=>e.forEach(e=>{e.isIntersecting&&(this.observer.unobserve(e.target),this.draw(this.items.indexOf(e.target)))}),{root:this.panel,rootMargin:"200px 0px"}),this.items.forEach(e=>this.observer.observe(e));const i=this.items[o[0]]||this.items[0];this.panel.scrollTop=i.offsetTop-(this.panel.clientHeight-i.offsetHeight)/2,e&&i.focus({preventScroll:!0}),t.onThumbs()}draw(e){if(this.urls[e])this.place(e,this.urls[e]);else{if("images"===this.book.config.source){const t=this.book.config.images[e];return void this.place(e,t.thumb||t.url)}this.queue=this.queue.then(()=>this.render(e)).catch(()=>{})}}async render(e){if(!this.panel||this.urls[e])return;const t=Math.round(160*Math.min(this.book.win.devicePixelRatio||1,2)),o=this.book.pages[e].querySelector("canvas");let i;o&&o.width>=t?(i=this.doc.createElement("canvas"),i.width=t,i.height=Math.round(t*o.height/o.width),i.getContext("2d").drawImage(o,0,0,i.width,i.height)):i=await this.book.drawPage(e,t);const s=await new Promise(e=>i.toBlob(e,"image/jpeg",.8));s&&!this.book.destroyed&&(this.urls[e]=URL.createObjectURL(s),this.place(e,this.urls[e]))}place(e,t){const o=this.items[e]?.firstChild;if(!this.panel||!o||o.firstChild)return;const i=this.doc.createElement("img");i.src=t,i.alt="",i.decoding="async",o.append(i)}close(e){this.panel&&(this.observer.disconnect(),this.panel.remove(),this.panel=null,this.items=[],this.book.onThumbs(),e&&this.book.thumbsBtn.focus())}destroy(){this.close(!1),this.urls.forEach(e=>e&&URL.revokeObjectURL(e)),this.urls=[]}}class ae{constructor(e,t){this.book=e,this.doc=e.doc,this.outline=t,this.panel=null}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.thumbs?.close(!1),t.search?.close(!1),this.panel=this.doc.createElement("nav"),this.panel.className="alfb_contents",this.panel.setAttribute("aria-label",t.contentsBtn.title);const o=this.doc.createElement("ul");this.add(o,this.outline,0),this.panel.append(o),t.stage.append(this.panel),e&&o.querySelector("a, button")?.focus({preventScroll:!0}),t.onContents()}add(e,t,o){for(const i of t){const t=this.doc.createElement("li");t.append(this.entry(i,o)),e.append(t),i.items?.length&&this.add(e,i.items,o+1)}}entry(e,t){const{book:o}=this,i=(e.title||"").trim()||(0,c.__)("Untitled","softicon-flipbook"),s=e.url?o.safeUrl(e.url):null,a=this.doc.createElement(s?"a":"button");a.className="alfb_entry",a.style.paddingLeft=12+16*Math.min(t,3)+"px";const n=this.doc.createElement("span");n.className="alfb_entry_title",n.textContent=i;const l=this.doc.createElement("span");if(l.className="alfb_entry_num",a.append(n,l),s)return a.href=s,a.target="_blank",a.rel="noopener noreferrer",a;a.type="button";const r=o.destPage(e.dest);return r.then(e=>{null!==e?l.textContent=e+1:a.disabled=!0}),a.addEventListener("click",async()=>{const e=await r;null!==e&&(this.close(!1),o.go(e),o.contentsBtn.focus())}),a}close(e){this.panel&&(this.panel.remove(),this.panel=null,this.book.onContents(),e&&this.book.contentsBtn.focus())}destroy(){this.close(!1)}}class ne{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.texts=[],this.round=0}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}text(e){return this.texts[e]||(this.texts[e]=this.book.pdf.getPage(e+1).then(e=>e.getTextContent()).then(e=>(e=>{let t="",o=null;return e.forEach(e=>{if("string"==typeof e.str){if(o){const i=Math.max(e.height,o.height)||1,s=Math.abs(e.transform[5]-o.transform[5])<.5*i,a=e.transform[4]-(o.transform[4]+o.width);t+=o.hasEOL||!s||a>.3*i||a<-i?" ":""}t+=/^[\p{L}\p{N}]( [\p{L}\p{N}]){2,}$/u.test(e.str)?e.str.replace(/ /g,""):e.str,o=e}}),t.replace(/\s+/g," ").trim()})(e.items)).catch(()=>"")),this.texts[e]}show(){const{book:e,doc:t}=this;let o;e.zoom?.close(),e.thumbs?.close(!1),e.contents?.close(!1),this.panel=t.createElement("div"),this.panel.className="alfb_search",this.panel.setAttribute("role","search"),this.input=t.createElement("input"),this.input.type="search",this.input.className="alfb_search_input",this.input.placeholder=(0,c.__)("Search in this book","softicon-flipbook"),this.input.setAttribute("aria-label",this.input.placeholder),this.input.value=this.query||"",this.status=t.createElement("p"),this.status.className="alfb_search_status",this.status.setAttribute("aria-live","polite"),this.list=t.createElement("ul"),this.input.addEventListener("keydown",e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),this.close(!0))}),this.input.addEventListener("input",()=>{clearTimeout(o),o=setTimeout(()=>this.run(),250)}),this.panel.append(this.input,this.status,this.list),e.stage.append(this.panel),this.input.focus({preventScroll:!0}),e.onSearch(),this.input.value&&this.run()}async run(){const e=this.input.value.trim(),t=e.toLowerCase(),o=++this.round;if(this.query=e,this.list.replaceChildren(),t.length<2)return void(this.status.textContent="");this.status.textContent=(0,c.__)("Searching…","softicon-flipbook");let i=0;for(let e=0;e<this.book.count&&i<50;e++){const s=await this.text(e);if(o!==this.round||!this.panel)return;const a=s.toLowerCase().indexOf(t);a>=0&&(i++,this.list.append(this.entry(e,s,a,t.length)))}this.status.textContent=i
     1(()=>{var e={837(e,t,o){"use strict";o(387);const i=window.wp.blocks,s=window.wp.data,a=window.wp.domReady;var n=o.n(a);const l=window.wp.hooks,r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"softicon/flipbook","version":"1.5.0","title":"Flipbook","category":"media","description":"Turn a PDF or a set of images into a page-turning flipbook.","keywords":["flipbook","pdf","magazine","catalog","brochure"],"textdomain":"softicon-flipbook","attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}},"supports":{"html":false,"align":["wide","full"],"spacing":{"margin":true}},"example":{"attributes":{"source":"images"}},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php"}'),h=window.React,c=window.wp.i18n,p=window.wp.element,d=window.wp.blockEditor,f=window.wp.components,u=window.wp.compose,b=(e,t,o=document)=>{const i=[];if(!t?.head||t===o)return i;const s=(e,s=t.head)=>{const a=o.getElementById(e);if(!a||t.getElementById(e))return null;const n=((e,t)=>{if("SCRIPT"!==e.tagName)return t.importNode(e,!0);const o=t.createElement("script");return[...e.attributes].forEach(({name:e,value:t})=>o.setAttribute(e,t)),o.async=!1,o.text=e.text,o})(a,t);return s.appendChild(n),i.push(e),n};return e.filter(Boolean).forEach(e=>{const{before:t,main:o,after:i}=(e=>{if(e.endsWith("-js")){const t=e.slice(0,-3);return{before:[`${t}-js-translations`,`${t}-js-extra`,`${t}-js-before`],main:e,after:[`${t}-js-after`]}}return e.endsWith("-css")?{before:[],main:e,after:[`${e.slice(0,-4)}-inline-css`]}:{before:[],main:e,after:[]}})(e);t.forEach(e=>s(e));const a=s(o);a&&"SCRIPT"===a.tagName&&a.src?a.addEventListener("load",()=>i.forEach(e=>s(e)),{once:!0}):i.forEach(e=>s(e))}),i},m=window.wp.primitives,g=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),_={info:g("M12 2.75a9.25 9.25 0 1 1 0 18.5 9.25 9.25 0 0 1 0-18.5m0 1.5a7.75 7.75 0 1 0 0 15.5 7.75 7.75 0 0 0 0-15.5M11.2 10.6h1.6V17h-1.6zm0-3.4h1.6v1.7h-1.6z",!0),video:g("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m5.5 4v7l6-3.5z"),support:g("M4.5 4h15A1.5 1.5 0 0 1 21 5.5v10a1.5 1.5 0 0 1-1.5 1.5H10l-5 4v-4h-.5A1.5 1.5 0 0 1 3 15.5v-10A1.5 1.5 0 0 1 4.5 4M7 8.5V10h10V8.5zm0 3V13h7v-1.5z",!0),star:g("M12 2.75l2.85 5.95 6.55.75-4.85 4.5 1.3 6.5L12 17.2l-5.85 3.25 1.3-6.5L2.6 9.45l6.55-.75z"),plugins:g("M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z")},k=(0,p.createContext)({open:null,toggle:()=>{}}),v=({initial:e,children:t})=>{const[o,i]=(0,p.useState)(e);return(0,h.createElement)(k.Provider,{value:{open:o,toggle:e=>i(t=>t===e?null:e)}},t)},w=({id:e,title:t,badge:o,children:i})=>{const{open:s,toggle:a}=(0,p.useContext)(k);return(0,h.createElement)(f.PanelBody,{className:"siPanel",title:(0,h.createElement)(h.Fragment,null,t,o&&(0,h.createElement)("span",{className:"siBadge"},o)),opened:s===e,onToggle:()=>a(e)},(0,h.createElement)("div",{className:"siFields"},i))},y=({text:e})=>(0,h.createElement)(f.Tooltip,{text:e,placement:"top",className:"siTipBubble"},(0,h.createElement)("button",{type:"button",className:"siTip","aria-label":e},_.info)),E=({label:e,tip:t,action:o})=>(0,h.createElement)("div",{className:"siFieldHead"},(0,h.createElement)("span",{className:"siFieldLabel"},e),t&&(0,h.createElement)(y,{text:t}),(0,h.createElement)("span",{className:"siFieldLine","aria-hidden":"true"}),o),x=({onClick:e,disabled:t})=>(0,h.createElement)(f.Button,{className:"siReset",variant:"secondary",size:"small",onClick:e,disabled:t},(0,c.__)("Reset","softicon-flipbook")),C=({label:e,tip:t,checked:o,onChange:i})=>(0,h.createElement)("div",{className:"siToggleRow"},(0,h.createElement)(f.ToggleControl,{label:e,checked:o,onChange:i,__nextHasNoMarginBottom:!0}),t&&(0,h.createElement)(y,{text:t})),M=({label:e,tip:t,value:o,options:i,onChange:s})=>(0,h.createElement)("div",{className:"siTiles"},(0,h.createElement)(E,{label:e,tip:t}),(0,h.createElement)("div",{className:"siTilesGrid",role:"radiogroup","aria-label":e,style:{gridTemplateColumns:`repeat(${i.length}, 1fr)`}},i.map(e=>(0,h.createElement)("button",{key:e.value,type:"button",role:"radio","aria-checked":o===e.value,className:"siTile"+(o===e.value?" is-selected":""),onClick:()=>s(e.value)},e.icon,(0,h.createElement)("span",null,e.label))))),P=({label:e,value:t,onChange:o})=>(0,h.createElement)(f.Dropdown,{className:"siColorRow",popoverProps:{placement:"left-start",offset:36},renderToggle:({isOpen:o,onToggle:i})=>(0,h.createElement)(f.Button,{className:"siColorToggle",onClick:i,"aria-expanded":o
     2/* translators: %s: a color setting, like Background */,"aria-label":(0,c.sprintf)((0,c.__)("%s color","softicon-flipbook"),e)+(t?": "+t:"")},(0,h.createElement)("span",{className:"siColorName"},e),(0,h.createElement)(f.ColorIndicator,{colorValue:t||void 0,className:t?"":"is-empty"})),renderContent:()=>(0,h.createElement)("div",{className:"siColorPopover"},(0,h.createElement)(d.ColorPalette,{value:t,onChange:e=>o(e||""),clearable:!0}))}),T=({cards:e})=>(0,h.createElement)("div",{className:"siHelpCards"},e.map(e=>(0,h.createElement)("a",{key:e.href,className:"siHelpCard",href:e.href,target:"_blank",rel:"noopener noreferrer"},e.icon,(0,h.createElement)("span",null,e.label),(0,h.createElement)("span",{className:"screen-reader-text"},(0,c.__)("(opens in a new tab)","softicon-flipbook"))))),L=(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,h.createElement)(m.Path,{d:"M12 6.5C10.3 5.3 8 4.75 5 4.75H3v13h2c3 0 5.3.55 7 1.75 1.7-1.2 4-1.75 7-1.75h2v-13h-2c-3 0-5.3.55-7 1.75m-1.25 10.6c-1.5-.6-3.4-.9-5.75-.85V6.25c2.5 0 4.4.45 5.75 1.4zm8.25-.85c-2.35-.05-4.25.25-5.75.85V7.65c1.35-.95 3.25-1.4 5.75-1.4z"})),S=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),z={pdf:S("M6 2.5h7.6L19.5 8.4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M6 4v16h12V9.5h-5.5V4zm8 .6V8h3.4zM8 12.5h8V14H8zm0 3h8V17H8z",!0),images:S("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m0 1.5v10.4l4.2-4.2 2.8 2.8 4.3-4.7 3.7 4V6zM8.5 10.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5",!0),auto:S("M2 4.5h14v10H2zm1.5 1.5v7h11V6zM6 16.5h6V18H6zM17 8h5v12.5h-5zm1.5 1.5V19h2V9.5z",!0),twoPages:S("M2.5 5h8.5v14H2.5zM4 6.5v11h5.5v-11zM13 5h8.5v14H13zm1.5 1.5v11H20v-11z",!0),onePage:S("M6.5 3h11v18h-11zM8 4.5v15h8v-15zM10 8h4v1.5h-4zm0 3h4v1.5h-4z",!0),classic:S("M3 6.5h8.25v11H3zM4.5 8v8h5.25V8zM12.75 6.5H21v11h-8.25zm1.5 1.5v8h5.25V8z",!0),hardcover:S("M1.5 4.5h21v15h-21zM3 6v12h8.25V6zm9.75 0v12H21V6z",!0),cover:S("M6 2.5h12A1.5 1.5 0 0 1 19.5 4v16a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M8 4v16h10V4zm2.5 3H16v1.5h-5.5z",!0),button:S("M4 7h16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2m0 1.5a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5zM7 11.25h10v1.5H7z",!0),text:S("M3 7h18v1.5H3zm0 4.5h12V13H3zm0 4.5h7.5v1.5H3z"),alignLeft:S("M4 5h16v1.5H4zm0 4h10v1.5H4zm0 4h16v1.5H4zm0 4h10v1.5H4z"),alignCenter:S("M4 5h16v1.5H4zm3 4h10v1.5H7zm-3 4h16v1.5H4zm3 4h10v1.5H7z"),alignRight:S("M4 5h16v1.5H4zm6 4h10v1.5H10zm-6 4h16v1.5H4zm6 4h10v1.5H10z")},H=[{name:"general",title:(0,c.__)("General","softicon-flipbook"),className:"general"},{name:"style",title:(0,c.__)("Style","softicon-flipbook"),className:"style"}],N=[{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto",icon:z.auto},{label:(0,c.__)("Two pages","softicon-flipbook"),value:"double",icon:z.twoPages},{label:(0,c.__)("One page","softicon-flipbook"),value:"single",icon:z.onePage}],A=[{label:(0,c.__)("PDF file","softicon-flipbook"),value:"pdf",icon:z.pdf},{label:(0,c.__)("Images","softicon-flipbook"),value:"images",icon:z.images}],F="&list=PLJEAefIarF4g",B={overview:"https://www.youtube.com/watch?v=5geq69DXoN8"+F,add:"https://www.youtube.com/watch?v=KGP_xpi8NGo"+F,design:"https://www.youtube.com/watch?v=qqQeZQkX5ms"+F,reading:"https://www.youtube.com/watch?v=1J7wCaUvugc"+F,lightbox:"https://www.youtube.com/watch?v=XBJuUV9HpkA"+F,settings:"https://www.youtube.com/watch?v=H9IxgIocY68"+F,promo:"https://www.youtube.com/watch?v=Oj9sHOZbb3A"+F,shortcode:"https://www.youtube.com/watch?v=slQlR4GTghg"+F,autoplay:"https://www.youtube.com/watch?v=bkuMUupI92Y"+F,rtl:"https://www.youtube.com/watch?v=MzZs4jJInFA"+F,shelf:"https://www.youtube.com/watch?v=9UY2KNYzkGk"+F,buttons:"https://www.youtube.com/watch?v=fS5RMGkPQXk"+F,leads:"https://www.youtube.com/watch?v=GxbrW_pyAdA"+F,protect:"https://www.youtube.com/watch?v=5UNgRO22s_Q"+F,hotspots:"https://www.youtube.com/watch?v=D7WiNswbHi8"+F,branding:"https://www.youtube.com/watch?v=iOr2NJ0yaAA"+F,analytics:"https://www.youtube.com/watch?v=ET4JXhOO-2s"+F,field:"https://www.youtube.com/watch?v=BGlS_IKKagM"+F,bookmarks:"https://www.youtube.com/watch?v=4-D5HxqV1yg"+F,pro:"https://www.youtube.com/watch?v=LtCj7-J2qXI"+F},I=[{label:(0,c.__)("Classic","softicon-flipbook"),value:"flat",icon:z.classic},{label:(0,c.__)("Hardcover","softicon-flipbook"),value:"hardcover",icon:z.hardcover}],D=[{label:(0,c.__)("Cover","softicon-flipbook"),value:"cover",icon:z.cover},{label:(0,c.__)("Button","softicon-flipbook"),value:"button",icon:z.button},{label:(0,c.__)("Text link","softicon-flipbook"),value:"text",icon:z.text}],R=[{label:(0,c.__)("Left","softicon-flipbook"),value:"left",icon:z.alignLeft},{label:(0,c.__)("Center","softicon-flipbook"),value:"center",icon:z.alignCenter},{label:(0,c.__)("Right","softicon-flipbook"),value:"right",icon:z.alignRight}],V=[{href:"https://www.youtube.com/playlist?list=PLJEAefIarF4g",label:(0,c.__)("Video tutorials","softicon-flipbook"),icon:_.video},{href:"https://wordpress.org/support/plugin/softicon-flipbook/",label:(0,c.__)("Get support","softicon-flipbook"),icon:_.support},{href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",label:(0,c.__)("Rate Flipbook","softicon-flipbook"),icon:_.star},{href:"https://wordpress.org/plugins/author/softiconai/",label:(0,c.__)("More plugins","softicon-flipbook"),icon:_.plugins}],W=({text:e,href:t})=>(0,h.createElement)("div",{className:"alfbProNotice"},(0,h.createElement)("p",null,(0,h.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})," ",e),t&&(0,h.createElement)(f.ExternalLink,{href:t,className:"alfbProNoticeLink"},(0,c.__)("Unlock with Pro","softicon-flipbook"))),O=({value:e,onChange:t})=>{const[o,i]=(0,p.useState)(String(e));return(0,p.useEffect)(()=>i(String(e)),[e]),(0,h.createElement)(f.TextControl,{type:"number",min:1,label:(0,c.__)("Open at page","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:e=>{i(e),parseInt(e,10)>=1&&t(parseInt(e,10))},onBlur:()=>i(String(e)),__nextHasNoMarginBottom:!0})},U=window.alfbEditor||{},j=()=>{const[e,t]=(0,p.useState)(!1),{type:o,id:i,published:a}=(0,s.useSelect)(e=>{const t=e("core/editor");return{type:t?.getCurrentPostType(),id:t?.getCurrentPostId(),published:"publish"===t?.getEditedPostAttribute("status")}},[]);if("alfb_book"!==o||!i)return null;const n=`[softicon_flipbook id="${i}"]`;return(0,h.createElement)("div",{className:"alfbShortcode"},(0,h.createElement)(E,{label:(0,c.__)("Shortcode","softicon-flipbook"),tip:(0,c.__)("Paste it in the Classic Editor, Elementor or any page builder to show this flipbook there.","softicon-flipbook")}),(0,h.createElement)("div",{className:"alfbShortcodeRow"},(0,h.createElement)("input",{type:"text",readOnly:!0,value:n,onFocus:e=>e.target.select(),"aria-label":(0,c.__)("Shortcode","softicon-flipbook")}),(0,h.createElement)(f.Button,{variant:"secondary",onClick:e=>{const o=e.currentTarget.previousElementSibling,i=()=>{t(!0),setTimeout(()=>t(!1),1600)};window.navigator.clipboard&&window.isSecureContext?window.navigator.clipboard.writeText(n).then(i):(o.select(),o.ownerDocument.execCommand("copy")&&i())}},e?(0,c.__)("Copied","softicon-flipbook"):(0,c.__)("Copy","softicon-flipbook"))),!a&&(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("It shows the flipbook once it is published.","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shortcode},(0,c.__)("Where to paste it: the Classic Editor, Elementor and more","softicon-flipbook"))))},q=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>{const{source:s,pdfId:a,pdfUrl:n,images:r,pageMode:p,showCover:u,startPage:b,startWith:m,autoplay:g,autoplaySeconds:_,autoplayLoop:k,rtl:v,phoneFullscreen:y,showDownload:x,showPrint:P,showFullscreen:L,showZoom:S,showThumbnails:z,showContents:H,showLinks:F,showSearch:I,showShare:D,flipSound:R}=e,q=e=>o=>t({[e]:o}),$=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),G=(()=>{const e=n?n.split("/").pop().split("?")[0]:"";try{return decodeURIComponent(e)}catch(t){return e}})();return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"help",title:(0,c.__)("Help","softicon-flipbook")},(0,h.createElement)(T,{cards:V}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.settings},(0,c.__)("Every setting explained, in 2 minutes","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("Email:","softicon-flipbook")," ",(0,h.createElement)("a",{href:"mailto:support@softiconai.com"},"support@softiconai.com")),(0,h.createElement)(j,null)),(0,h.createElement)(w,{id:"source",title:(0,c.__)("Source","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Pages from","softicon-flipbook"),value:s,options:A,onChange:q("source")}),"pdf"===s?(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("PDF","softicon-flipbook"),tip:(0,c.__)("PDFs from your Media Library always work. A link to a PDF on another website works only if that site allows it.","softicon-flipbook")}),G&&(0,h.createElement)("p",{className:"alfbFile"},G),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["application/pdf"],value:a,onSelect:o,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},n?(0,c.__)("Replace PDF","softicon-flipbook"):(0,c.__)("Choose PDF","softicon-flipbook"))})),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Taking each post's PDF from a custom field (Meta Box, ACF), and text readers can select and copy, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.field},(0,c.__)("Watch: each post's own PDF from Meta Box or ACF","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Links in the PDF","softicon-flipbook"),tip:(0,c.__)("Web, email and page links inside the PDF can be clicked. Web links open in a new tab, page links turn the book.","softicon-flipbook"),checked:F,onChange:q("showLinks")}),$("showLinks")):(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Pages","softicon-flipbook"),tip:(0,c.__)("Each image is one page. Drag them in the media window to change the order.","softicon-flipbook")}),!!r.length&&(0,h.createElement)("div",{className:"alfbImages"},r.slice(0,8).map(e=>(0,h.createElement)("img",{key:e.id||e.url,src:e.url,alt:""}))),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:r.map(e=>e.id),onSelect:i,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},r.length?(0,c.__)("Edit pages","softicon-flipbook"):(0,c.__)("Choose images","softicon-flipbook"))})))),(0,h.createElement)(w,{id:"pages",title:(0,c.__)("Pages","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Layout","softicon-flipbook"),tip:(0,c.__)("Auto shows two pages side by side on wide screens and one page on phones. Or keep one layout everywhere.","softicon-flipbook"),value:p,options:N,onChange:q("pageMode")}),$("pageMode"),(0,h.createElement)(C,{label:(0,c.__)("Cover page","softicon-flipbook"),tip:(0,c.__)("The first and last pages turn on their own, like a printed book.","softicon-flipbook"),checked:u,onChange:q("showCover")}),$("showCover"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Open at page","softicon-flipbook"),tip:(0,c.__)("The book opens at this page. A link ending in #page=5 opens it at page 5.","softicon-flipbook")}),(0,h.createElement)(O,{value:b,onChange:e=>t({startPage:e})})),(0,h.createElement)(f.SelectControl,{label:(0,c.__)("Start with","softicon-flipbook"),help:(0,c.__)("Readers can first pick a page from the thumbnails or the table of contents (from the PDF's bookmarks). On the published page.","softicon-flipbook"),value:m,onChange:q("startWith"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:(0,c.__)("The book","softicon-flipbook"),value:"book"},{label:(0,c.__)("The thumbnails","softicon-flipbook"),value:"thumbnails"},{label:(0,c.__)("The table of contents","softicon-flipbook"),value:"contents"}]}),(0,h.createElement)(C,{label:(0,c.__)("Right to left","softicon-flipbook"),tip:(0,c.__)("For books read from right to left, such as Arabic, Hebrew or Urdu: the next page is on the left, and the arrows and arrow keys follow.","softicon-flipbook"),checked:v,onChange:q("rtl")}),$("rtl"),(0,h.createElement)(C,{label:(0,c.__)("Autoplay","softicon-flipbook"),tip:(0,c.__)("Turns the pages by itself while the book is on screen, on the published page. It holds while the mouse is over the book, stops when a reader takes over, and the toolbar gets a pause button.","softicon-flipbook"),checked:g,onChange:q("autoplay")}),g&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Seconds per page","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:2,max:60,label:(0,c.__)("Seconds per page","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({autoplaySeconds:Math.min(60,Math.max(2,parseInt(e,10)||4))}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$("autoplaySeconds")),(0,h.createElement)(C,{label:(0,c.__)("Start again at the end","softicon-flipbook"),tip:(0,c.__)("After the last page the book goes back to the first one and keeps playing.","softicon-flipbook"),checked:k,onChange:q("autoplayLoop")}),$("autoplayLoop")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.autoplay},(0,c.__)("Watch autoplay in 45 seconds","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.rtl},(0,c.__)("Watch right to left and fullscreen on phones","softicon-flipbook")))),(0,h.createElement)(w,{id:"toolbar",title:(0,c.__)("Toolbar","softicon-flipbook")},(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("The preview here shows only the book; the buttons work on the published page.","softicon-flipbook")),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Download button","softicon-flipbook"),tip:(0,c.__)("Lets visitors save the PDF.","softicon-flipbook"),checked:x,onChange:q("showDownload")}),$("showDownload")),(0,h.createElement)(C,{label:(0,c.__)("Print button","softicon-flipbook"),tip:(0,c.__)("Readers print the whole book. The pages are prepared in the browser first, so a long book takes a moment.","softicon-flipbook"),checked:P,onChange:q("showPrint")}),$("showPrint"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen button","softicon-flipbook"),tip:(0,c.__)("Fits the book to the screen and redraws the pages sharper.","softicon-flipbook"),checked:L,onChange:q("showFullscreen")}),$("showFullscreen"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen on phones","softicon-flipbook"),tip:(0,c.__)('On a phone the book shows "Tap to read"; one tap opens it full screen, where the pages are easier to read.',"softicon-flipbook"),checked:y,onChange:q("phoneFullscreen")}),$("phoneFullscreen"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Table of contents","softicon-flipbook"),tip:(0,c.__)("A button with the PDF's chapters (its bookmarks), a click opens one. It shows only when the PDF has bookmarks.","softicon-flipbook"),checked:H,onChange:q("showContents")}),$("showContents")),(0,h.createElement)(C,{label:(0,c.__)("Thumbnails","softicon-flipbook"),tip:(0,c.__)("A button that shows all pages, a click opens one.","softicon-flipbook"),checked:z,onChange:q("showThumbnails")}),$("showThumbnails"),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Bookmarks, so readers can mark pages and come back to them, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.bookmarks},(0,c.__)("Watch: bookmarks and selectable text","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Zoom","softicon-flipbook"),tip:(0,c.__)("Zoom buttons, pinch on phones and Ctrl + scroll on computers.","softicon-flipbook"),checked:S,onChange:q("showZoom")}),$("showZoom"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Search","softicon-flipbook"),tip:(0,c.__)("A search box that lists the pages with the words, a click opens the page. PDFs only.","softicon-flipbook"),checked:I,onChange:q("showSearch")}),$("showSearch")),(0,h.createElement)(C,{label:(0,c.__)("Share","softicon-flipbook"),tip:(0,c.__)("A link to the page that is open: on Facebook, X, LinkedIn, Pinterest, by email or copied. Phones use their own share sheet.","softicon-flipbook"),checked:D,onChange:q("showShare")}),$("showShare"),(0,h.createElement)(C,{label:(0,c.__)("Page turn sound","softicon-flipbook"),tip:(0,c.__)("Visitors can mute it from the toolbar.","softicon-flipbook"),checked:R,onChange:q("flipSound")}),$("flipSound")),!U.pro&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"buttons",title:(0,c.__)("Page buttons","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("A button on a chosen page, such as a link or a WooCommerce product with its price, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.buttons},(0,c.__)("Watch page buttons in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"hotspots",title:(0,c.__)("Hotspots","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Clickable areas on your pages, with a link or a WooCommerce product and its price, are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.hotspots},(0,c.__)("Watch hotspots in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"leads",title:(0,c.__)("Lead capture","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Asking readers for their email after a few pages is available in Pro. The leads are saved on your site.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.leads},(0,c.__)("Watch lead capture in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"shelf",title:(0,c.__)("Shelf","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Showing many books on one shelf, each opening in a popup, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shelf},(0,c.__)("Watch the shelf in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"protect",title:(0,c.__)("Protection","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Protecting the PDF (a password, no download button, no right-click, the PDF address kept out of the page) is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.protect},(0,c.__)("Watch protection in 40 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"watermark",title:(0,c.__)("Watermark","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Your words or logo drawn into every page, with the reader's name or email if you like, is available in Pro.","softicon-flipbook")}))))},$=e=>({id:e.id,url:e.url||e.source_url,alt:e.alt||e.alt_text||"",width:e.width||e.media_details?.width||0,height:e.height||e.media_details?.height||0}),G=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],Z=e=>(e="string"==typeof e?e.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(e)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(e)&&[...e.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>G.includes(e))?e:void 0),Y=window.alfbEditor||{},X=({attributes:e,setAttributes:t})=>{const{bookTitle:o,theme:i,maxHeight:s,maxHeightTablet:a,maxHeightPhone:n,bookStyle:r,sideArrows:p,displayMode:u,lightboxTrigger:b,lightboxText:m,lightboxImage:g,lightboxWidth:_,lightboxAlign:k}=e,v="hardcover"===r,y="lightbox"===u,T="cover"===b,L=e=>o=>t({[e]:o}),S=t=>({value:e[t],onChange:L(t)}),z=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),H=(e,t)=>(0,l.applyFilters)("alfb.block.reset",t,e),N=(e,t)=>(0,l.applyFilters)("alfb.block.atDefault",t,e);return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"display",title:(0,c.__)("Display","softicon-flipbook"),badge:(0,c.__)("New","softicon-flipbook")},(0,h.createElement)(C,{label:(0,c.__)("Open in a lightbox","softicon-flipbook"),tip:(0,c.__)("Off: the book shows on the page. On: only a cover, button or link shows on the page, and a click opens the book in a popup over the page; the book loads only then.","softicon-flipbook"),checked:y,onChange:e=>t({displayMode:e?"lightbox":"inline"})}),z("displayMode"),!y&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Title above the book","softicon-flipbook"),tip:(0,c.__)("Shown above the book, also in full screen. Leave it empty for no title.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:(0,c.__)("Title above the book","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:L("bookTitle"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),y&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(M,{label:(0,c.__)("Open with","softicon-flipbook"),value:b,options:D,onChange:L("lightboxTrigger")}),z("lightboxTrigger"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),tip:T?(0,c.__)("Shown under the cover. Leave it empty for no caption.","softicon-flipbook"):(0,c.__)('Leave it empty for "Read the flipbook".',"softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),hideLabelFromVision:!0,value:m,onChange:L("lightboxText"),placeholder:T?"":(0,c.__)("Read the flipbook","softicon-flipbook"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),T&&(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Cover image","softicon-flipbook"),tip:(0,c.__)("Without an image the first page is the cover.","softicon-flipbook")}),g?.url&&(0,h.createElement)("img",{className:"alfbCoverThumb",src:g.url,alt:""}),(0,h.createElement)("div",{className:"alfbButtons"},(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],value:g?.id,onSelect:e=>t({lightboxImage:$(e)}),render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},g?.url?(0,c.__)("Replace image","softicon-flipbook"):(0,c.__)("Choose image","softicon-flipbook"))})),g?.url&&(0,h.createElement)(f.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>t({lightboxImage:{}})},(0,c.__)("Remove","softicon-flipbook")))),T&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),tip:(0,c.__)("Narrow columns and phones make the cover smaller.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({lightboxWidth:H("lightboxWidth",260)}),disabled:N("lightboxWidth",260===_)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({lightboxWidth:e||260}),min:120,max:600,step:10,__nextHasNoMarginBottom:!0}),z("lightboxWidth")),(0,h.createElement)(M,{label:(0,c.__)("Alignment","softicon-flipbook"),value:k,options:R,onChange:L("lightboxAlign")}),z("lightboxAlign")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.lightbox},(0,c.__)("See the lightbox in action","softicon-flipbook")))),(0,h.createElement)(w,{id:"design",title:(0,c.__)("Design","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Design","softicon-flipbook"),tip:(0,c.__)("Hardcover puts the pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows beside the book.","softicon-flipbook"),value:r,options:I,onChange:e=>t({bookStyle:e,sideArrows:"hardcover"===e})}),z("bookStyle"),v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Side arrows","softicon-flipbook"),tip:(0,c.__)("Large arrows beside the book. On phones they sit over the page edges.","softicon-flipbook"),checked:p,onChange:L("sideArrows")}),z("sideArrows")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.design},(0,c.__)("See the Hardcover design in action","softicon-flipbook")))),!y&&(0,h.createElement)(w,{id:"size",title:(0,c.__)("Size","softicon-flipbook")},(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),tip:(0,c.__)("The book keeps the page shape and shrinks to fit smaller screens.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({maxHeight:H("maxHeight",700)}),disabled:N("maxHeight",700===s)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),hideLabelFromVision:!0,value:s,onChange:e=>t({maxHeight:e||700}),min:300,max:1400,step:10,__nextHasNoMarginBottom:!0}),z("maxHeight")),(0,h.createElement)("div",{className:"alfbDeviceHeights"},(0,h.createElement)(E,{label:(0,c.__)("On tablets and phones","softicon-flipbook"),tip:(0,c.__)("A different maximum height on tablets (under 1025 px wide) and phones (under 600 px). Leave a field empty to keep the height above. The editor's Tablet and Mobile previews show them.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Tablet (px)","softicon-flipbook"),value:a||"",placeholder:String(s),onChange:e=>t({maxHeightTablet:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Phone (px)","softicon-flipbook"),value:n||"",placeholder:String(s),onChange:e=>t({maxHeightPhone:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),z("maxHeightTablet"),z("maxHeightPhone"))),(0,h.createElement)(w,{id:"colors",title:(0,c.__)("Colors","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Theme","softicon-flipbook"),tip:(0,c.__)("Dark puts the book on a dark background with light controls. Auto follows the reader's device. A color you set below still wins.","softicon-flipbook"),value:i||"light",onChange:L("theme"),options:[{label:(0,c.__)("Light","softicon-flipbook"),value:"light"},{label:(0,c.__)("Dark","softicon-flipbook"),value:"dark"},{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto"}]}),z("theme"),(0,h.createElement)("div",{className:"siColors"},v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(P,{label:(0,c.__)("Cover","softicon-flipbook"),...S("coverColor")}),z("coverColor")),(0,h.createElement)(P,{label:(0,c.__)("Background","softicon-flipbook"),...S("bgColor")}),z("bgColor"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar background","softicon-flipbook"),...S("toolbarBg")}),z("toolbarBg"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar icons and text","softicon-flipbook"),...S("toolbarColor")}),z("toolbarColor")),!Y.pro&&(0,h.createElement)(W,{href:Y.defaults||Y.pricing,text:(0,c.__)("Setting the colors, size and toolbar once for every flipbook on the site is available in Pro.","softicon-flipbook")})),!Y.pro&&(0,h.createElement)(w,{id:"branding",title:(0,c.__)("Branding","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:Y.pricing,text:(0,c.__)("Your logo in the toolbar, linked to your site, and your own picture behind the book are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.branding},(0,c.__)("Watch branding in 40 seconds","softicon-flipbook")))))},J=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>(0,h.createElement)(d.InspectorControls,null,(0,h.createElement)(f.TabPanel,{className:"siSettings",tabs:H},s=>(0,h.createElement)(v,{key:s.name,initial:"style"===s.name?"display":"source"},"general"===s.name&&(0,h.createElement)(q,{attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i}),"style"===s.name&&(0,h.createElement)(X,{attributes:e,setAttributes:t}),(0,l.applyFilters)("alfb.block.inspector",null,{tab:s.name,attributes:e,setAttributes:t,Panel:w}))));let K=null,Q=null;const ee=[1,1.5,2,3,4],te=(e,t,o)=>Math.min(o,Math.max(t,e)),oe=e=>Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY);class ie{constructor(e){this.book=e,this.doc=e.doc,this.level=1,this.view=null,this.pinch=null,this.timer=0,this.token=0,this.attach()}get active(){return!!this.view}get atMax(){return this.level>=3.99}step(e){const t=e>0?ee.find(e=>e>this.level+.01):[...ee].reverse().find(e=>e<this.level-.01);this.set(t||(e>0?4:1))}set(e,t){if((e=te(e,1,4))<1.02)return void this.close();let o=null;this.view||(o=this.pagesFraction(t),this.open());const{view:i,inner:s}=this,a=i.getBoundingClientRect(),n=t?t.x-a.left:i.clientWidth/2,l=t?t.y-a.top:i.clientHeight/2;o=o||{x:(i.scrollLeft+n-s.offsetLeft)/s.offsetWidth,y:(i.scrollTop+l-s.offsetTop)/s.offsetHeight},this.level=e,this.layout(),i.scrollLeft=s.offsetLeft+o.x*s.offsetWidth-n,i.scrollTop=s.offsetTop+o.y*s.offsetHeight-l,this.schedule(),this.book.onZoom()}pagesFraction(e){if(!e)return{x:.5,y:.5};const t=this.book.visible().map(e=>this.book.pages[e].getBoundingClientRect()),o=Math.min(...t.map(e=>e.left)),i=Math.max(...t.map(e=>e.right)),s=Math.min(...t.map(e=>e.top)),a=Math.max(...t.map(e=>e.bottom));return{x:te((e.x-o)/(i-o||1),0,1),y:te((e.y-s)/(a-s||1),0,1)}}open(){this.view=this.doc.createElement("div"),this.view.className="alfb_zoom",this.inner=this.doc.createElement("div"),this.inner.className="alfb_zoom_inner",this.view.append(this.inner),this.book.stage.append(this.view),this.fill(),this.drag(),this.view.addEventListener("dblclick",()=>this.set(1))}fill(){this.shown=this.book.visible(),this.sharp=this.shown.map(()=>0),this.inner.replaceChildren(...this.shown.map(e=>{const t=this.doc.createElement("div");return t.className="alfb_zoom_page",t.setAttribute("role","img"),t.setAttribute("aria-label",this.book.pages[e].getAttribute("aria-label")),t.append(this.copy(e)),t}))}copy(e){if("images"===this.book.config.source){const t=this.book.config.images[e],o=this.doc.createElement("img");return o.src=t.url,o.alt=t.alt||"",o}const t=this.doc.createElement("canvas"),o=this.book.pages[e].querySelector("canvas");return o&&(t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0)),t}layout(){const e=this.book.flip.getBoundsRect(),t=Math.round(e.pageWidth*this.level),o=Math.round(e.height*this.level);this.inner.style.width=t*this.shown.length+"px",this.inner.style.height=o+"px",[...this.inner.children].forEach(e=>{e.style.width=t+"px",e.style.height=o+"px"})}schedule(){clearTimeout(this.timer),this.timer=setTimeout(()=>this.render(),150)}async render(){if(!this.view||"images"===this.book.config.source)return;const e=++this.token,t=this.book.flip.getBoundsRect(),o=Math.min(this.book.win.devicePixelRatio||1,2),i=Math.min(Math.ceil(t.pageWidth*this.level*o),Math.floor(Math.sqrt(16e6*this.book.ratio)));for(let t=0;t<this.shown.length;t++){if(this.sharp[t]>=i)continue;const o=await this.book.drawPage(this.shown[t],i).catch(()=>null);if(e!==this.token||!this.view)return;o&&(this.inner.children[t].replaceChildren(o),this.sharp[t]=i)}}update(){this.view&&(this.book.visible().join()!==this.shown.join()?(this.token++,this.fill(),this.layout(),this.view.scrollTop=0,this.view.scrollLeft=0,this.schedule()):this.set(this.level))}close(){clearTimeout(this.timer),this.token++,this.view?.remove(),this.view=null,this.level=1,this.book.onZoom()}drag(){const{view:e}=this;let t=null;e.addEventListener("pointerdown",o=>{"mouse"===o.pointerType&&0===o.button&&(t={x:o.clientX,y:o.clientY,left:e.scrollLeft,top:e.scrollTop},e.setPointerCapture(o.pointerId),e.classList.add("alfb_dragging"))}),e.addEventListener("pointermove",o=>{t&&(e.scrollLeft=t.left-(o.clientX-t.x),e.scrollTop=t.top-(o.clientY-t.y))});const o=()=>{t=null,e.classList.remove("alfb_dragging")};e.addEventListener("pointerup",o),e.addEventListener("pointercancel",o)}attach(){const{book:e}=this,{stage:t}=e,o={capture:!0,passive:!1};e.on(t,"touchstart",t=>{2!==t.touches.length||e.thumbs?.open||(t.preventDefault(),t.stopPropagation(),e.cancelTouch(),this.pinch={distance:oe(t.touches),level:this.level})},o),e.on(t,"touchmove",e=>{var t;this.pinch&&(e.preventDefault(),e.stopPropagation(),2===e.touches.length&&this.set(this.pinch.level*oe(e.touches)/this.pinch.distance,{x:((t=e.touches)[0].clientX+t[1].clientX)/2,y:(t[0].clientY+t[1].clientY)/2}))},o);const i=e=>{this.pinch&&!e.touches.length&&(this.pinch=null)};e.on(t,"touchend",i,o),e.on(t,"touchcancel",i,o),e.on(t,"wheel",t=>{t.ctrlKey&&!e.thumbs?.open&&(t.preventDefault(),this.set(this.level*Math.exp(-t.deltaY/100),{x:t.clientX,y:t.clientY}))},o);let s=1;e.on(t,"gesturestart",e=>{e.preventDefault(),s=this.level},o),e.on(t,"gesturechange",t=>{t.preventDefault(),this.pinch||e.thumbs?.open||this.set(s*t.scale,{x:t.clientX,y:t.clientY})},o)}}class se{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.items=[],this.urls=[],this.queue=Promise.resolve()}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.contents?.close(!1),t.search?.close(!1);const o=t.visible();this.panel=this.doc.createElement("div"),this.panel.className="alfb_thumbs",this.panel.setAttribute("role","region"),this.panel.setAttribute("aria-label",t.thumbsBtn.title),this.items=t.pages.map((e,i)=>{const s=this.doc.createElement("button");s.type="button",s.className="alfb_thumb",s.setAttribute("aria-label",e.getAttribute("aria-label")),o.includes(i)&&(s.classList.add("alfb_current"),s.setAttribute("aria-current","page"));const a=this.doc.createElement("span");a.className="alfb_thumb_img",a.style.aspectRatio=String(t.ratio);const n=this.doc.createElement("span");return n.className="alfb_thumb_num",n.setAttribute("aria-hidden","true"),n.textContent=i+1,s.append(a,n),s.addEventListener("click",()=>{this.close(!1),t.go(i),t.thumbsBtn.focus()}),s}),this.panel.append(...this.items),t.stage.append(this.panel),this.observer=new t.win.IntersectionObserver(e=>e.forEach(e=>{e.isIntersecting&&(this.observer.unobserve(e.target),this.draw(this.items.indexOf(e.target)))}),{root:this.panel,rootMargin:"200px 0px"}),this.items.forEach(e=>this.observer.observe(e));const i=this.items[o[0]]||this.items[0];this.panel.scrollTop=i.offsetTop-(this.panel.clientHeight-i.offsetHeight)/2,e&&i.focus({preventScroll:!0}),t.onThumbs()}draw(e){if(this.urls[e])this.place(e,this.urls[e]);else{if("images"===this.book.config.source){const t=this.book.config.images[e];return void this.place(e,t.thumb||t.url)}this.queue=this.queue.then(()=>this.render(e)).catch(()=>{})}}async render(e){if(!this.panel||this.urls[e])return;const t=Math.round(160*Math.min(this.book.win.devicePixelRatio||1,2)),o=this.book.pages[e].querySelector("canvas");let i;o&&o.width>=t?(i=this.doc.createElement("canvas"),i.width=t,i.height=Math.round(t*o.height/o.width),i.getContext("2d").drawImage(o,0,0,i.width,i.height)):i=await this.book.drawPage(e,t);const s=await new Promise(e=>i.toBlob(e,"image/jpeg",.8));s&&!this.book.destroyed&&(this.urls[e]=URL.createObjectURL(s),this.place(e,this.urls[e]))}place(e,t){const o=this.items[e]?.firstChild;if(!this.panel||!o||o.firstChild)return;const i=this.doc.createElement("img");i.src=t,i.alt="",i.decoding="async",o.append(i)}close(e){this.panel&&(this.observer.disconnect(),this.panel.remove(),this.panel=null,this.items=[],this.book.onThumbs(),e&&this.book.thumbsBtn.focus())}destroy(){this.close(!1),this.urls.forEach(e=>e&&URL.revokeObjectURL(e)),this.urls=[]}}class ae{constructor(e,t){this.book=e,this.doc=e.doc,this.outline=t,this.panel=null}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.thumbs?.close(!1),t.search?.close(!1),this.panel=this.doc.createElement("nav"),this.panel.className="alfb_contents",this.panel.setAttribute("aria-label",t.contentsBtn.title);const o=this.doc.createElement("ul");this.add(o,this.outline,0),this.panel.append(o),t.stage.append(this.panel),e&&o.querySelector("a, button")?.focus({preventScroll:!0}),t.onContents()}add(e,t,o){for(const i of t){const t=this.doc.createElement("li");t.append(this.entry(i,o)),e.append(t),i.items?.length&&this.add(e,i.items,o+1)}}entry(e,t){const{book:o}=this,i=(e.title||"").trim()||(0,c.__)("Untitled","softicon-flipbook"),s=e.url?o.safeUrl(e.url):null,a=this.doc.createElement(s?"a":"button");a.className="alfb_entry",a.style.paddingLeft=12+16*Math.min(t,3)+"px";const n=this.doc.createElement("span");n.className="alfb_entry_title",n.textContent=i;const l=this.doc.createElement("span");if(l.className="alfb_entry_num",a.append(n,l),s)return a.href=s,a.target="_blank",a.rel="noopener noreferrer",a;a.type="button";const r=o.destPage(e.dest);return r.then(e=>{null!==e?l.textContent=e+1:a.disabled=!0}),a.addEventListener("click",async()=>{const e=await r;null!==e&&(this.close(!1),o.go(e),o.contentsBtn.focus())}),a}close(e){this.panel&&(this.panel.remove(),this.panel=null,this.book.onContents(),e&&this.book.contentsBtn.focus())}destroy(){this.close(!1)}}class ne{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.texts=[],this.round=0}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}text(e){return this.texts[e]||(this.texts[e]=this.book.pdf.getPage(e+1).then(e=>e.getTextContent()).then(e=>(e=>{let t="",o=null;return e.forEach(e=>{if("string"==typeof e.str){if(o){const i=Math.max(e.height,o.height)||1,s=Math.abs(e.transform[5]-o.transform[5])<.5*i,a=e.transform[4]-(o.transform[4]+o.width);t+=o.hasEOL||!s||a>.3*i||a<-i?" ":""}t+=/^[\p{L}\p{N}]( [\p{L}\p{N}]){2,}$/u.test(e.str)?e.str.replace(/ /g,""):e.str,o=e}}),t.replace(/\s+/g," ").trim()})(e.items)).catch(()=>"")),this.texts[e]}show(){const{book:e,doc:t}=this;let o;e.zoom?.close(),e.thumbs?.close(!1),e.contents?.close(!1),this.panel=t.createElement("div"),this.panel.className="alfb_search",this.panel.setAttribute("role","search"),this.input=t.createElement("input"),this.input.type="search",this.input.className="alfb_search_input",this.input.placeholder=(0,c.__)("Search in this book","softicon-flipbook"),this.input.setAttribute("aria-label",this.input.placeholder),this.input.value=this.query||"",this.status=t.createElement("p"),this.status.className="alfb_search_status",this.status.setAttribute("aria-live","polite"),this.list=t.createElement("ul"),this.input.addEventListener("keydown",e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),this.close(!0))}),this.input.addEventListener("input",()=>{clearTimeout(o),o=setTimeout(()=>this.run(),250)}),this.panel.append(this.input,this.status,this.list),e.stage.append(this.panel),this.input.focus({preventScroll:!0}),e.onSearch(),this.input.value&&this.run()}async run(){const e=this.input.value.trim(),t=e.toLowerCase(),o=++this.round;if(this.query=e,this.list.replaceChildren(),t.length<2)return void(this.status.textContent="");this.status.textContent=(0,c.__)("Searching…","softicon-flipbook");let i=0;for(let e=0;e<this.book.count&&i<50;e++){const s=await this.text(e);if(o!==this.round||!this.panel)return;const a=s.toLowerCase().indexOf(t);a>=0&&(i++,this.list.append(this.entry(e,s,a,t.length)))}this.status.textContent=i
    33/* translators: %s: number of pages */?(0,c.sprintf)((0,c._n)("Found on %s page","Found on %s pages",i,"softicon-flipbook"),i):(0,c.__)("No pages found.","softicon-flipbook")}entry(e,t,o,i){const{book:s,doc:a}=this,n=a.createElement("li"),l=a.createElement("button");l.type="button",l.className="alfb_entry";const r=a.createElement("span");r.className="alfb_entry_title";const h=Math.max(0,o-40),c=Math.min(t.length,o+i+60),p=a.createElement("mark");p.textContent=t.slice(o,o+i),r.append((h>0?"…":"")+t.slice(h,o),p,t.slice(o+i,c)+(c<t.length?"…":""));const d=a.createElement("span");return d.className="alfb_entry_num",d.textContent=e+1,l.append(r,d),l.addEventListener("click",()=>{this.close(!1),s.go(e),s.searchBtn.focus()}),n.append(l),n}close(e){this.panel&&(this.round++,this.panel.remove(),this.panel=null,this.book.onSearch(),e&&this.book.searchBtn.focus())}destroy(){this.close(!1)}}class le{constructor(e){this.book=e;const t=t=>{const o=e.doc.createElement("div");return o.className=t,o.setAttribute("aria-hidden","true"),o};this.board=t("alfb_board"),this.leftEdge=t("alfb_edge alfb_edge_left"),this.rightEdge=t("alfb_edge alfb_edge_right"),this.gutter=t("alfb_gutter"),e.stage.prepend(this.board,this.leftEdge,this.rightEdge),e.stage.append(this.gutter),e.root.classList.add("alfb_hardcover")}update(){const{win:e}=this.book;e.cancelAnimationFrame(this.frame),this.frame=e.requestAnimationFrame(()=>{this.frame=e.requestAnimationFrame(()=>this.measure())})}measure(){const{book:e}=this,t=e.stage.getBoundingClientRect(),o=e.visible().map(t=>e.pages[t].getBoundingClientRect()).filter(e=>e.width);if(!o.length)return;const i=Math.min(...o.map(e=>e.left))-t.left,s=Math.max(...o.map(e=>e.right))-t.left,a=Math.min(...o.map(e=>e.top))-t.top,n=Math.max(...o.map(e=>e.bottom))-t.top,l=Math.min(...e.visible()),r=e.count>1?l/(e.count-1):0,h=Math.min(12,Math.max(4,Math.round(e.count/4))),c=Math.round(h*r),p=Math.round(h*(1-r)),d=1===o.length&&"landscape"===e.flip.getOrientation()?3:10;if(re(this.board,i-c-d,a-d,s-i+c+p+2*d,n-a+2*d),re(this.leftEdge,i-c,a+2,c,n-a-4),re(this.rightEdge,s,a+2,p,n-a-4),2===o.length){const e=Math.min(o[0].right,o[1].right)-t.left,l=Math.round(.06*(s-i));re(this.gutter,e-l,a,2*l,n-a)}else this.gutter.style.display="none"}flipping(e){this.gutter.classList.toggle("alfb_hidden",e)}destroy(){this.book.win.cancelAnimationFrame(this.frame),[this.board,this.leftEdge,this.rightEdge,this.gutter].forEach(e=>e.remove()),this.book.root.classList.remove("alfb_hardcover")}}function re(e,t,o,i,s){e.style.display=i>0&&s>0?"":"none",e.style.left=Math.round(t)+"px",e.style.top=Math.round(o)+"px",e.style.width=Math.round(i)+"px",e.style.height=Math.round(s)+"px"}class he{constructor(e){this.book=e,this.seconds=Math.min(60,Math.max(2,parseInt(e.config.autoplaySeconds,10)||4)),this.loop=!1!==e.config.autoplayLoop,this.stopped=!!e.win.matchMedia?.("(prefers-reduced-motion: reduce)").matches,this.visible=!1,this.hover=!1}start(){const{book:e}=this,t=()=>this.stop(),o=e=>!e.composedPath().includes(this.button)&&t();e.on(e.stage,"pointerdown",t),e.on(e.root,"keydown",o),e.on(e.bar,"click",o),e.on(e.stage,"mouseenter",()=>this.set("hover",!0)),e.on(e.stage,"mouseleave",()=>this.set("hover",!1)),"IntersectionObserver"in e.win?(this.observer=new e.win.IntersectionObserver(e=>this.set("visible",e[0].isIntersecting),{threshold:.5}),this.observer.observe(e.root)):this.visible=!0,this.update()}set(e,t){this[e]=t,this.update()}get playing(){return!this.stopped&&this.visible&&!this.hover}update(){clearTimeout(this.timer),this.playing&&(this.timer=setTimeout(()=>this.turn(),1e3*this.seconds));const e=this.button;if(e){e.innerHTML=this.book.icon(this.stopped?"play":"pause");const t=this.stopped?(0,c.__)("Play","softicon-flipbook"):(0,c.__)("Pause","softicon-flipbook");e.title=t,e.setAttribute("aria-label",t),e.setAttribute("aria-pressed",this.stopped?"false":"true")}}turn(){const{book:e}=this,t=Math.max(...e.visible())>=e.count-1;!t||this.loop?(t?e.turnTo(0):e.next(),this.update()):this.stop()}toggle(){this.stopped=!this.stopped,this.update()}stop(){this.stopped||(this.stopped=!0,this.update())}destroy(){clearTimeout(this.timer),this.observer?.disconnect()}}class ce{constructor(e){this.book=e,this.close=this.close.bind(this)}async toggle(e){const{win:t}=this.book,o=t.navigator;if(o.share&&t.matchMedia?.("(pointer: coarse)").matches)try{await o.share({title:this.book.doc.title,url:e})}catch(e){}else this.menu?this.close():this.open(e)}open(e){const{doc:t,root:o}=this.book,i=encodeURIComponent(e),s=encodeURIComponent(t.title),a=t.createElement("div");a.className="alfb_share_menu",a.setAttribute("role","dialog"),a.setAttribute("aria-label",(0,c.__)("Share this page","softicon-flipbook")),[["facebook","Facebook",(e,t)=>`https://www.facebook.com/sharer/sharer.php?u=${e}&quote=${t}`],["x","X",(e,t)=>`https://x.com/intent/post?url=${e}&text=${t}`],["linkedin","LinkedIn",e=>`https://www.linkedin.com/sharing/share-offsite/?url=${e}`],["pinterest","Pinterest",(e,t)=>`https://pinterest.com/pin/create/button/?url=${e}&description=${t}`],["email",(0,c.__)("Email","softicon-flipbook"),(e,t)=>`mailto:?subject=${t}&body=${e}`]].forEach(([e,o,n])=>{const l=t.createElement("a");l.className="alfb_share_"+e,l.href=n(i,s),"email"!==e&&(l.target="_blank",l.rel="noopener noreferrer"),l.textContent=o,l.addEventListener("click",()=>setTimeout(this.close)),a.append(l)});const n=t.createElement("button");n.type="button",n.className="alfb_share_copy",n.textContent=(0,c.__)("Copy link","softicon-flipbook"),n.addEventListener("click",async()=>{this.close();try{await this.book.win.navigator.clipboard.writeText(e),this.book.toast((0,c.__)("Link copied","softicon-flipbook"))}catch(t){this.book.win.prompt((0,c.__)("Copy this link","softicon-flipbook"),e)}}),a.append(n),a.addEventListener("keydown",e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),this.close(),this.book.shareBtn?.focus())}),o.append(a),this.menu=a,this.book.shareBtn?.setAttribute("aria-expanded","true"),a.querySelector("a").focus({preventScroll:!0}),setTimeout(()=>t.addEventListener("click",this.outside=e=>!a.contains(e.target)&&!this.book.shareBtn?.contains(e.target)&&this.close()))}close(){this.menu?.remove(),this.menu=null,this.book.shareBtn?.setAttribute("aria-expanded","false"),this.outside&&(this.book.doc.removeEventListener("click",this.outside),this.outside=null)}}const pe=e=>`<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path fill="currentColor" d="${e}"/></svg>`,de={prev:pe("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z"),next:pe("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z"),fullscreen:pe("M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z"),exitFullscreen:pe("M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"),print:pe("M19 8H5a3 3 0 0 0-3 3v6h4v4h12v-4h4v-6a3 3 0 0 0-3-3m-3 11H8v-5h8zm3-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2m-1-9H6v4h12z"),download:pe("M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"),contents:pe("M3 5h2v2H3zm4 0h14v2H7zm-4 6h2v2H3zm4 0h14v2H7zm-4 6h2v2H3zm4 0h14v2H7z"),thumbnails:pe("M3 3h8v8H3zm2 2v4h4V5zm8-2h8v8h-8zm2 2v4h4V5zM3 13h8v8H3zm2 2v4h4v-4zm8-2h8v8h-8zm2 2v4h4v-4z"),zoomIn:pe("M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z"),zoomOut:pe("M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9M7 9h5v1H7z"),soundOn:pe("M3 9v6h4l5 5V4L7 9zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4M14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6"),search:pe("M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9"),play:pe("M8 5v14l11-7z"),pause:pe("M6 19h4V5H6zm8-14v14h4V5z"),share:pe("M18 16.1c-.8 0-1.4.3-2 .8l-7.1-4.2c.1-.2.1-.5.1-.7s0-.5-.1-.7L16 7.2c.5.5 1.2.8 2 .8a3 3 0 1 0-3-3c0 .2 0 .5.1.7L8 9.8A3 3 0 1 0 8 14.2l7.1 4.2c-.1.2-.1.4-.1.6a2.9 2.9 0 1 0 3-2.9"),soundOff:pe("M16.5 12A4.5 4.5 0 0 0 14 8v2.2l2.5 2.5zm2.5 0a7 7 0 0 1-.6 2.8l1.5 1.5A9 9 0 0 0 14 3.2v2.1a7 7 0 0 1 5 6.7M4.3 3 3 4.3 7.7 9H3v6h4l5 5v-6.7l4.3 4.3a7 7 0 0 1-2.3 1.2v2.1a9 9 0 0 0 3.7-1.8l2 2 1.3-1.3-9-9zM12 4 9.9 6.1 12 8.2z")},fe=e=>[...e.ownerDocument.querySelectorAll(".alfb_wrapper[data-alfb][alfb-block], .alfb_lb[data-alfb][alfb-block]")].indexOf(e)+1;class ue{constructor(e){this.urls=e}async fetch({kind:e,filename:t}){const o=this.urls[e]+t+".json",i=await fetch(o);if(!i.ok)throw new Error("Unable to load "+o);const s=atob(await i.json()),a=new Uint8Array(s.length);for(let e=0;e<s.length;e++)a[e]=s.charCodeAt(e);return a}}const be=async(e,t)=>{const i=o.p+"pdfjs/",s=await o.e(854).then(()=>o(626));return s.GlobalWorkerOptions.workerSrc=i+"pdf.worker.min.js?ver="+s.version+"-p2",s.getDocument({url:e,cMapUrl:i+"cmaps/",cMapPacked:!0,standardFontDataUrl:i+"standard_fonts/",BinaryDataFactory:ue,useWasm:!1,wasmUrl:i+"decoders/",ownerDocument:t,disableAutoFetch:!0,isEvalSupported:!1,verbosity:s.VerbosityLevel.ERRORS})};class me{constructor(e,t,{editor:o=!1}={}){this.root=e,this.doc=e.ownerDocument,this.win=this.doc.defaultView||window,this.config=t,this.editor=o,this.sound=!!t.flipSound&&!o,this.pages=[],this.rendered=[],this.queue=Promise.resolve(),this.destroyed=!1,this.listeners=[]}async init(){if(this.stage=this.root.querySelector(".alfb_stage"),this.root.classList.add("alfb_js"),["dark","auto"].includes(this.config.theme)&&this.root.classList.add("alfb_theme_"+this.config.theme),this.config.title&&!this.root.querySelector(":scope > .alfb_title")){const e=this.doc.createElement("div");e.className="alfb_title",e.textContent=this.config.title,this.root.prepend(e)}try{const{PageFlip:e}=await o.e(966).then(()=>o(334)),t="images"===this.config.source?this.imageSize():await this.openPdf();if(this.destroyed)return;this.build(e,t)}catch(e){this.destroyed||this.fail(e)}}async openPdf(){if(this.task=await be(this.config.pdf,this.doc),this.pdf=await this.task.promise,this.count=this.pdf.numPages,this.config.showContents&&!this.editor){const e=await this.pdf.getOutline().catch(()=>null);this.outline=e?.length?e:null}const e=await this.pdf.getPage(1),{width:t,height:o}=e.getViewport({scale:1});return{width:t,height:o}}imageSize(){const e=this.config.images||[];this.count=e.length;const t=e.find(e=>e.width&&e.height);return t?{width:t.width,height:t.height}:{width:3,height:4}}build(e,t){const o=this.win.innerWidth,i=o<600?this.config.maxHeightPhone:o<1025?this.config.maxHeightTablet:0;i>0&&(this.config.maxHeight=i);const{pageMode:s,showCover:a,maxHeight:n}=this.config,l=!this.editor&&fe(this.root)===(e=>{const t=/(?:^#|&)book=(\d+)/.exec(e.location.hash);return t?parseInt(t[1],10):1})(this.win)&&(e=>{const t=/(?:^#|&)page=(\d+)/.exec(e.location.hash);return t?parseInt(t[1],10):0})(this.win)||this.config.startPage,r=t.width/t.height,h=Math.max(100,Math.floor(n*r));this.rtl=!!this.config.rtl,this.ratio=r,this.maxWidth=h;for(let e=0;e<this.count;e++){const t=this.doc.createElement("div");t.className="alfb_page",t.setAttribute("role","img"),
    44/* translators: %d: page number */
    … …  
    88t.title=(0,c.sprintf)((0,c.__)("Go to page %d","softicon-flipbook"),e.target+1),t.href="#page="+(e.target+1),t.addEventListener("click",t=>{t.preventDefault(),this.go(e.target)})),t.setAttribute("aria-label",t.title),i.append(t)}o.append(i)}async drawPage(e,t){const o=await this.pdf.getPage(e+1),i=o.getViewport({scale:t/o.getViewport({scale:1}).width}),s=this.doc.createElement("canvas");return s.width=Math.floor(i.width),s.height=Math.floor(i.height),await o.render({canvas:s,viewport:i}).promise,o.cleanup(),this.emit("paint",{index:e,canvas:s}),s}icon(e){return de[e]}button(e,t,o){const i=this.doc.createElement("button");return i.type="button",i.className=`alfb_btn alfb_btn_${e}`,i.setAttribute("aria-label",t),i.title=t,i.innerHTML=de[e],i.addEventListener("click",o),i}toolbar(){const e=this.doc.createElement("div");e.className="alfb_toolbar",this.prevBtn=this.button(this.rtl?"next":"prev",(0,c.__)("Previous page","softicon-flipbook"),()=>this.prev()),this.nextBtn=this.button(this.rtl?"prev":"next",(0,c.__)("Next page","softicon-flipbook"),()=>this.next()),this.counter=this.doc.createElement(this.editor?"span":"button"),this.counter.className="alfb_counter",this.counter.setAttribute("aria-live","polite"),this.editor||(this.counter.type="button",this.counter.title=(0,c.__)("Go to page","softicon-flipbook"),this.counter.addEventListener("click",()=>this.askPage()));const t=this.doc.createElement("div");t.className="alfb_nav",t.append(...this.rtl?[this.nextBtn,this.counter,this.prevBtn]:[this.prevBtn,this.counter,this.nextBtn]);const o=this.doc.createElement("div");if(o.className="alfb_tools",this.autoplay&&(this.autoplay.button=this.button("play",(0,c.__)("Play","softicon-flipbook"),()=>this.autoplay.toggle()),o.append(this.autoplay.button)),this.search&&(this.searchBtn=this.button("search",(0,c.__)("Search","softicon-flipbook"),()=>this.search.toggle()),this.searchBtn.setAttribute("aria-expanded","false"),o.append(this.searchBtn)),this.contents&&(this.contentsBtn=this.button("contents",(0,c.__)("Table of contents","softicon-flipbook"),()=>this.contents.toggle()),this.contentsBtn.setAttribute("aria-expanded","false"),o.append(this.contentsBtn)),this.thumbs&&(this.thumbsBtn=this.button("thumbnails",(0,c.__)("Thumbnails","softicon-flipbook"),()=>this.thumbs.toggle()),this.thumbsBtn.setAttribute("aria-expanded","false"),o.append(this.thumbsBtn)),this.zoom){const e=e=>{this.thumbs?.close(!1),this.contents?.close(!1),this.search?.close(!1),this.zoom.step(e)};this.zoomOutBtn=this.button("zoomOut",(0,c.__)("Zoom out","softicon-flipbook"),()=>e(-1)),this.zoomInBtn=this.button("zoomIn",(0,c.__)("Zoom in","softicon-flipbook"),()=>e(1)),o.append(this.zoomOutBtn,this.zoomInBtn)}if(this.config.flipSound&&!this.editor){const e=this.button(this.sound?"soundOn":"soundOff",(0,c.__)("Page turn sound","softicon-flipbook"),()=>{this.sound=!this.sound,e.innerHTML=de[this.sound?"soundOn":"soundOff"],e.setAttribute("aria-pressed",this.sound?"true":"false")});e.setAttribute("aria-pressed","true"),o.append(e)}if(this.config.showPrint&&!this.editor&&o.append(this.button("print",(0,c.__)("Print","softicon-flipbook"),()=>async function(e){if(e.printing)return;e.printing=!0;const{doc:t,win:o}=e;(e=>{if(e.getElementById("alfb-print-style"))return;const t=e.createElement("style");t.id="alfb-print-style",t.textContent=".alfb_print{display:none}@media print{body.alfb_printing>*:not(.alfb_print){display:none!important}body.alfb_printing .alfb_print{display:block}.alfb_print img{display:block;max-width:100%;max-height:100vh;width:auto;height:auto;margin:0 auto;break-after:page;page-break-after:always}.alfb_print img:last-child{break-after:auto;page-break-after:auto}@page{margin:0}}",e.head.append(t)})(t);const i=t.createElement("div");i.className="alfb_print";const s=t.createElement("span");s.className="alfb_toast",s.setAttribute("role","status"),e.root.append(s);try{for(let o=0;o<e.count;o++){
    99/* translators: 1: page being prepared, 2: number of pages */
    10 s.textContent=(0,c.sprintf)((0,c.__)("Preparing pages %1$d / %2$d","softicon-flipbook"),o+1,e.count);const a=t.createElement("img");if(a.alt="","images"===e.config.source)a.src=e.config.images[o].url,await a.decode().catch(()=>{});else{const t=await e.drawPage(o,1240);a.src=t.toDataURL("image/jpeg",.9)}i.append(a)}t.body.append(i),t.body.classList.add("alfb_printing"),s.remove();const a=()=>{t.body.classList.remove("alfb_printing"),i.remove(),e.printing=!1,o.removeEventListener("afterprint",a)};o.addEventListener("afterprint",a),o.print()}catch(t){s.textContent=(0,c.__)("The book could not be printed.","softicon-flipbook"),setTimeout(()=>s.remove(),2500),i.remove(),e.printing=!1}}(this))),this.config.showDownload&&"pdf"===this.config.source){const e=this.doc.createElement("a");e.className="alfb_btn alfb_btn_download",e.href=this.safeUrl(this.config.pdf)||"#",e.download="",e.target="_blank",e.rel="noopener",e.title=(0,c.__)("Download PDF","softicon-flipbook"),e.setAttribute("aria-label",e.title),e.innerHTML=de.download,o.append(e)}this.config.showShare&&!this.editor&&(this.shareBtn=this.button("share",(0,c.__)("Share this page","softicon-flipbook"),()=>this.share()),this.shareBtn.setAttribute("aria-haspopup","dialog"),o.append(this.shareBtn)),this.config.showFullscreen&&!this.editor&&(this.fsBtn=this.button("fullscreen",(0,c.__)("Fullscreen","softicon-flipbook"),()=>this.toggleFullscreen()),o.append(this.fsBtn)),e.append(t,o),this.root.appendChild(e),this.bar=e,this.zoom&&this.onZoom()}async share(){const e=new URL(this.win.location.href),t=fe(this.owner||this.root);e.hash="page="+(Math.min(...this.visible())+1)+(t>1?"&book="+t:""),this.sharing=this.sharing||new ce(this),await this.sharing.toggle(e.toString())}toast(e){const t=this.doc.createElement("span");t.className="alfb_toast",t.setAttribute("role","status"),t.textContent=e,this.root.append(t),setTimeout(()=>t.remove(),2e3)}askPage(){const e=this.doc.createElement("input");e.type="number",e.className="alfb_page_input",e.min=1,e.max=this.count,e.value=Math.min(...this.visible())+1,e.setAttribute("aria-label",(0,c.__)("Page number","softicon-flipbook"));let t=!0;const o=(o,i)=>{if(!t)return;t=!1;const s=parseInt(e.value,10);e.replaceWith(this.counter),o&&s&&this.go(s-1),i&&this.counter.focus()};e.addEventListener("keydown",e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),o(!0,!0)):"Escape"===e.key&&(e.preventDefault(),o(!1,!0))}),e.addEventListener("blur",()=>o(!0,!1)),this.counter.replaceWith(e),e.focus(),e.select()}sideArrows(){const e=(e,t,o)=>{const i=this.button(e,t,o);return i.className=`alfb_side alfb_side_${e}`,this.stage.append(i),i};this.sidePrev=e(this.rtl?"next":"prev",(0,c.__)("Previous page","softicon-flipbook"),()=>this.prev()),this.sideNext=e(this.rtl?"prev":"next",(0,c.__)("Next page","softicon-flipbook"),()=>this.next())}tapToRead(){const e=this.doc.createElement("button");e.type="button",e.className="alfb_tap",e.innerHTML=`<span>${de.fullscreen}</span>`,e.querySelector("span").append(this.doc.createTextNode((0,c.__)("Tap to read","softicon-flipbook"))),e.addEventListener("click",()=>this.toggleFullscreen()),this.stage.append(e),this.tap=e}toggleFullscreen(){this.doc.fullscreenElement===this.root||this.root.classList.contains("alfb_overlay")?this.doc.fullscreenElement?this.doc.exitFullscreen():this.setFullscreen(!1):this.root.requestFullscreen&&this.doc.fullscreenEnabled?this.root.requestFullscreen().catch(()=>this.setFullscreen(!0)):this.setFullscreen(!0)}setFullscreen(e){this.root.classList.toggle("alfb_overlay",e&&!this.doc.fullscreenElement),this.root.classList.toggle("alfb_is_fullscreen",e),this.fsBtn&&(this.fsBtn.innerHTML=de[e?"exitFullscreen":"fullscreen"]);const t=this.flip.getSettings();if(e){const e=this.root.querySelector(":scope > .alfb_title"),o=this.win.innerHeight-(this.bar?this.bar.offsetHeight:0)-(e?e.offsetHeight+10:0)-32;t.maxWidth=Math.max(100,Math.floor(o*this.ratio)),t.maxHeight=o}else t.maxWidth=this.maxWidth,t.maxHeight=this.config.maxHeight;"single"===this.config.pageMode&&(t.minWidth=t.maxWidth),this.refresh()}setHeight(e){this.config.maxHeight=e,this.maxWidth=Math.max(100,Math.floor(e*this.ratio)),this.flip&&!this.root.classList.contains("alfb_is_fullscreen")&&this.setFullscreen(!1)}refresh(){this.fit(),this.flip.update(),this.onChange()}on(e,t,o,i=!1){e.addEventListener(t,o,i),this.listeners.push(()=>e.removeEventListener(t,o,i))}watch(){this.on(this.doc,"fullscreenchange",()=>this.setFullscreen(this.doc.fullscreenElement===this.root)),this.editor||(this.on(this.stage,"pointerdown",()=>{this.root.contains(this.doc.activeElement)||this.root.focus({preventScroll:!0})},!0),this.on(this.root,"keydown",e=>{const t=this.thumbs?.open?this.thumbs:this.contents?.open?this.contents:this.search?.open&&this.search;if(t)return void("Escape"===e.key&&(e.preventDefault(),t.close(!0)));const o=this.zoom&&!e.ctrlKey&&!e.metaKey;"ArrowLeft"===e.key?this.back():"ArrowRight"===e.key?this.forward():!o||"+"!==e.key&&"="!==e.key?o&&"-"===e.key?this.zoom.step(-1):"Escape"===e.key&&this.zoom?.active?(e.preventDefault(),this.zoom.set(1)):"Escape"===e.key&&this.root.classList.contains("alfb_overlay")&&(e.preventDefault(),this.setFullscreen(!1)):this.zoom.step(1)}));const e=this.win.ResizeObserver;if(e){let t,o=this.stage.clientWidth;this.observer=new e(()=>{this.stage.clientWidth!==o&&(o=this.stage.clientWidth,clearTimeout(t),t=setTimeout(()=>this.refresh(),120))}),this.observer.observe(this.stage)}}fail(e){this.root.classList.add("alfb_error");const t=this.doc.createElement("p");t.className="alfb_message";const o=this.config.pdf?new URL(this.config.pdf,this.win.location.href):null,i=o&&o.origin!==this.win.location.origin;t.textContent=i?(0,c.__)("This PDF is on another website that does not allow it to be shown here. Upload the PDF to your Media Library instead.","softicon-flipbook"):(0,c.__)("This flipbook could not be loaded.","softicon-flipbook"),this.stage.replaceChildren(t),console.error("SoftIcon Flipbook:",e)}destroy(){this.destroyed=!0,this.zoom?.close(),this.thumbs?.destroy(),this.contents?.destroy(),this.autoplay?.destroy(),this.sharing?.close(),this.search?.destroy(),this.cover?.destroy(),this.sidePrev?.remove(),this.sideNext?.remove(),this.tap?.remove(),this.listeners.forEach(e=>e()),this.observer?.disconnect();try{this.flip?.destroy()}catch(e){}this.task?.destroy(),this.bar?.remove(),this.book?.remove(),this.root.querySelector(":scope > .alfb_title")?.remove(),this.root.classList.remove("alfb_theme_dark","alfb_theme_auto"),this.root.classList.remove("alfb_ready","alfb_error","alfb_overlay","alfb_is_fullscreen","alfb_zoomed","alfb_thumbs_open","alfb_contents_open","alfb_search_open","alfb_side_over","alfb_portrait")}}const ge=({attributes:e})=>{const{source:t,pdfUrl:o,images:i,lightboxImage:s}=e,a=["cover","button","text"].includes(e.lightboxTrigger)?e.lightboxTrigger:"cover",n=["left","center","right"].includes(e.lightboxAlign)?e.lightboxAlign:"center",l=Math.min(600,Math.max(120,parseInt(e.lightboxWidth,10)||260)),r=(e.lightboxText||"").trim(),d="cover"===a,f=s?.url||("images"===t?i[0]?.url:""),u=d&&!f&&"pdf"===t&&!!o,b=(0,p.useRef)(),[m,g]=(0,p.useState)(!1);(0,p.useEffect)(()=>{const e=b.current;if(!u||!e)return;let t=!1;return g(!1),(async(e,t,o)=>{const i=await be(e,t);try{const e=await i.promise,s=await e.getPage(1),a=Math.min((t.defaultView||window).devicePixelRatio||1,2),n=s.getViewport({scale:o*a/s.getViewport({scale:1}).width}),l=t.createElement("canvas");return l.width=Math.floor(n.width),l.height=Math.floor(n.height),await s.render({canvas:l,viewport:n}).promise,l}finally{i.destroy()}})(o,e.ownerDocument,600).then(o=>{t||(e.replaceChildren(o),g(!0))}).catch(()=>{}),()=>{t=!0,e.replaceChildren()}},[u,o]);const _=r||(0,c.__)("Read the flipbook","softicon-flipbook");return(0,h.createElement)("div",{className:`alfb_lb alfb_lb_${n}`+(u&&!m?" alfb_lb_draw":""),style:{"--alfb-lb-width":l+"px"}},d?(0,h.createElement)("span",{className:"alfb_lb_trigger alfb_lb_cover"},(0,h.createElement)("span",{className:"alfb_lb_img"},f?(0,h.createElement)("img",{src:f,alt:""}):(0,h.createElement)("span",{ref:b})),r&&(0,h.createElement)("span",{className:"alfb_lb_caption"},r)):(0,h.createElement)("span",{className:"alfb_lb_trigger "+("button"===a?"alfb_lb_button wp-element-button":"alfb_lb_link")},_))};(0,i.registerBlockType)(r,{icon:L,edit:e=>{const{attributes:t,setAttributes:o}=e,{source:i,pdfId:s,pdfUrl:a,images:n,displayMode:r}=t,m="lightbox"===r,g=(0,p.useRef)(),_=(0,p.useRef)(),k=function(){const e=["softicon-flipbook-style-css","softicon-flipbook-editor-style-css"].join(" ");return(0,p.useEffect)(()=>{const t=e.split(" "),o=[...document.querySelectorAll('iframe[name="editor-canvas"]')],i=()=>o.forEach(e=>b(t,e.contentDocument));return i(),o.forEach(e=>e.addEventListener("load",i)),()=>o.forEach(e=>e.removeEventListener("load",i))},[e]),(0,u.useRefEffect)(t=>{b(e.split(" "),t.ownerDocument)},[e])}(),v=e=>o({pdfId:e.id||0,pdfUrl:e.url||e.source_url||""}),w=e=>o({pdfId:0,pdfUrl:e}),y=e=>o({images:e.map($)}),E=(e=>"images"===e.source?!!e.images?.length:!!e.pdfUrl)(t),x=(e=>{const{source:t,pdfUrl:o,images:i,pageMode:s,bookStyle:a,sideArrows:n,showCover:l,startPage:r,startWith:h,bookTitle:c,theme:p,autoplay:d,autoplaySeconds:f,autoplayLoop:u,rtl:b,phoneFullscreen:m,maxHeight:g,maxHeightTablet:_,maxHeightPhone:k,showDownload:v,showPrint:w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:P,showShare:T,flipSound:L}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?i:[],pageMode:["auto","double","single"].includes(s)?s:"auto",bookStyle:"hardcover"===a?"hardcover":"flat",sideArrows:!!n,showCover:l,startPage:Math.max(1,parseInt(r,10)||1),title:(c||"").trim(),startWith:["thumbnails","contents"].includes(h)?h:"book",theme:["dark","auto"].includes(p)?p:"light",autoplay:!!d,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==u,rtl:!!b,phoneFullscreen:!!m,maxHeight:Math.min(2e3,Math.max(200,parseInt(g,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(k,10)>0?Math.min(2e3,Math.max(200,parseInt(k,10))):0,showDownload:v,showPrint:!!w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:!1!==P,showShare:!!T,flipSound:L}})(t);["showFullscreen","showZoom","showThumbnails","showContents","showLinks","showSearch","showShare","flipSound","showPrint","startWith","autoplay","autoplaySeconds","autoplayLoop","phoneFullscreen"].forEach(e=>delete x[e]);const C=(e=>{const[t,o]=(0,p.useState)(e);return(0,p.useEffect)(()=>{const t=setTimeout(()=>o(e),400);return()=>clearTimeout(t)},[e,400]),t})(JSON.stringify(x));(0,p.useEffect)(()=>{const e=g.current,t=JSON.parse(C);if(!E||m||!e||!("images"===t.source?t.images.length:t.pdf))return;const o=e.ownerDocument.createElement("div");o.className="alfb_wrapper",o.innerHTML='<div class="alfb_stage"><div class="alfb_loading"><span class="alfb_spinner"></span></div></div>',e.replaceChildren(o),_.current=o,M();const i=new me(o,t,{editor:!0});return i.init(),()=>{i.destroy(),e.replaceChildren(),_.current=null}},[C,E,m]);const M=()=>{_.current&&Object.entries((({bgColor:e,toolbarBg:t,toolbarColor:o,coverColor:i})=>({"--alfb-bg":G(e),"--alfb-bar-bg":G(t),"--alfb-bar-color":G(o),"--alfb-cover":G(i)}))(t)).forEach(([e,t])=>t?_.current.style.setProperty(e,t):_.current.style.removeProperty(e))};(0,p.useEffect)(M,[t.bgColor,t.toolbarBg,t.toolbarColor,t.coverColor]);const P=e=>(0,h.createElement)(h.Fragment,null,(0,h.createElement)(f.Button,{variant:"link",onClick:()=>o({source:e})},"images"===e?(0,c.__)("Use images instead","softicon-flipbook"):(0,c.__)("Use a PDF instead","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbPlaceholderHelp"},(0,h.createElement)(f.ExternalLink,{href:B.add},(0,c.__)("New here? Watch the 36-second tutorial","softicon-flipbook"))));return E?(0,h.createElement)(h.Fragment,null,(0,h.createElement)(J,{attributes:t,setAttributes:o,onSelectPdf:v,onSelectImages:y}),(0,h.createElement)(d.BlockControls,{group:"other"},"images"===i?(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:n.map(e=>e.id),onSelect:y,render:({open:e})=>(0,h.createElement)(f.ToolbarButton,{onClick:e},(0,c.__)("Edit pages","softicon-flipbook"))})):(0,h.createElement)(d.MediaReplaceFlow,{mediaId:s,mediaURL:a,allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:v,onSelectURL:w,name:(0,c.__)("Replace PDF","softicon-flipbook")})),(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:k})},(0,l.applyFilters)("alfb.block.preview",null,{attributes:t})||(m?(0,h.createElement)(ge,{attributes:t}):(0,h.createElement)("div",{ref:g})))):(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:k})},"images"===i?(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload or pick the page images, in reading order.","softicon-flipbook")},allowedTypes:["image"],multiple:!0,gallery:!0,onSelect:y},P("pdf")):(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload a PDF, pick one from the Media Library or paste a link.","softicon-flipbook")},allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:v,onSelectURL:w},P("images")))},save:()=>null}),(0,l.addFilter)("blockEditor.useSetting.before","softicon-flipbook/no-margin-panel",(e,t,o,i)=>(r.name!==i||"spacing.margin"!==t)&&e),n()(()=>{const e=new URL(window.location.href),t=window.alfbEditor?.demoPdf;if(!e.searchParams.has("alfb_start")||!t)return;e.searchParams.delete("alfb_start"),window.history.replaceState(window.history.state,"",e.toString());let o=!1;const a=()=>{const e=(0,s.select)("core/editor"),a=e?.__unstableIsEditorReady?e.__unstableIsEditorReady():!!e?.getCurrentPostId();if(o||!a)return;o=!0;let n=0;const l=()=>{const e=(0,s.select)("core/block-editor").getBlocks();e.some(e=>r.name===e.name)||++n>6||((0,s.dispatch)("core/block-editor").insertBlocks((0,i.createBlock)(r.name,{pdfUrl:t}),e.length),setTimeout(l,700))};setTimeout(l,400)},n=(0,s.subscribe)(()=>{a(),o&&n()});a(),o&&n()})},387(e,t,o){window.alfbBuildUrl&&(o.p=window.alfbBuildUrl)}};const t={};function o(i){const s=t[i];if(void 0!==s)return s.exports;const a=t[i]={exports:{}};return e[i](a,a.exports,o),a.exports}o.m=e,(()=>{const e=[];o.O=(t,i,s)=>{if(!i){for(var a=0;a<e.length;a++){let[i,s]=e[a],l=!0;for(var n=0;n<i.length;n++)Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):l=!1;if(l){e.splice(a--,1);const o=s();void 0!==o&&(t=o)}}return t}e.push([i,s])}})(),o.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var s=t[i++],a=t[i++],n=0===a?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:a};o.o(e,s)||Object.defineProperty(e,s,n)}else for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,i)=>(o.f[i](e,t),t),[])),o.u=e=>({854:"pdfjs",966:"page-flip"}[e]+".js?ver="+{854:"82bd6283",966:"dc895a04"}[e]),o.miniCssF=e=>{},o.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={},t="softicon-flipbook:";o.l=(i,s,a,n)=>{if(e[i])return void e[i].push(s);let l,r;if(void 0!==a){const e=document.getElementsByTagName("script");for(var h=0;h<e.length;h++){const o=e[h];if(o.getAttribute("src")==i||o.getAttribute("data-webpack")==t+a){l=o;break}}}l||(r=!0,l=document.createElement("script"),l.charset="utf-8",o.nc&&l.setAttribute("nonce",o.nc),l.setAttribute("data-webpack",t+a),l.src=i),e[i]=[s];const c=(t,o)=>{l.onerror=l.onload=null,clearTimeout(p);const s=e[i];if(delete e[i],l.parentNode?.removeChild(l),s?.forEach(e=>e(o)),t)return t(o)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),r&&document.head.appendChild(l)}})(),(()=>{let e;globalThis.importScripts&&(e=globalThis.location+"");const t=globalThis.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const o=t.getElementsByTagName("script");if(o.length){let t=o.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=o[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),o.p=e})(),(()=>{const e={57:0,350:0};o.f.j=(t,i)=>{let s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else if(350!=t){const a=new Promise((o,i)=>s=e[t]=[o,i]);i.push(s[2]=a);const n=new Error,l=i=>{if(o.o(e,t)&&(s=e[t],0!==s&&(e[t]=void 0),s)){const e=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;n.message="Loading chunk "+t+" failed.\n("+e+": "+o+")",n.name="ChunkLoadError",n.type=e,n.request=o,n.event=i,s[1](n)}};o.l(o.p+o.u(t),l,"chunk-"+t,t)}else e[t]=0},o.O.j=t=>0===e[t];const t=(t,i)=>{let[s,a,n]=i;var l,r,h=0;if(s.some(t=>0!==e[t])){for(l in a)o.o(a,l)&&(o.m[l]=a[l]);if(n)var c=n(o)}for(t&&t(i);h<s.length;h++)r=s[h],o.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return o.O(c)},i=globalThis.webpackChunksofticon_flipbook||=[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();let i=o.O(void 0,[350],()=>o(919));i=o.O(i)})();
     10s.textContent=(0,c.sprintf)((0,c.__)("Preparing pages %1$d / %2$d","softicon-flipbook"),o+1,e.count);const a=t.createElement("img");if(a.alt="","images"===e.config.source)a.src=e.config.images[o].url,await a.decode().catch(()=>{});else{const t=await e.drawPage(o,1240);a.src=t.toDataURL("image/jpeg",.9)}i.append(a)}t.body.append(i),t.body.classList.add("alfb_printing"),s.remove();const a=()=>{t.body.classList.remove("alfb_printing"),i.remove(),e.printing=!1,o.removeEventListener("afterprint",a)};o.addEventListener("afterprint",a),o.print()}catch(t){s.textContent=(0,c.__)("The book could not be printed.","softicon-flipbook"),setTimeout(()=>s.remove(),2500),i.remove(),e.printing=!1}}(this))),this.config.showDownload&&"pdf"===this.config.source){const e=this.doc.createElement("a");e.className="alfb_btn alfb_btn_download",e.href=this.safeUrl(this.config.pdf)||"#",e.download="",e.target="_blank",e.rel="noopener",e.title=(0,c.__)("Download PDF","softicon-flipbook"),e.setAttribute("aria-label",e.title),e.innerHTML=de.download,o.append(e)}this.config.showShare&&!this.editor&&(this.shareBtn=this.button("share",(0,c.__)("Share this page","softicon-flipbook"),()=>this.share()),this.shareBtn.setAttribute("aria-haspopup","dialog"),o.append(this.shareBtn)),this.config.showFullscreen&&!this.editor&&(this.fsBtn=this.button("fullscreen",(0,c.__)("Fullscreen","softicon-flipbook"),()=>this.toggleFullscreen()),o.append(this.fsBtn)),e.append(t,o),this.root.appendChild(e),this.bar=e,this.zoom&&this.onZoom()}async share(){const e=new URL(this.win.location.href),t=fe(this.owner||this.root);e.hash="page="+(Math.min(...this.visible())+1)+(t>1?"&book="+t:""),this.sharing=this.sharing||new ce(this),await this.sharing.toggle(e.toString())}toast(e){const t=this.doc.createElement("span");t.className="alfb_toast",t.setAttribute("role","status"),t.textContent=e,this.root.append(t),setTimeout(()=>t.remove(),2e3)}askPage(){const e=this.doc.createElement("input");e.type="number",e.className="alfb_page_input",e.min=1,e.max=this.count,e.value=Math.min(...this.visible())+1,e.setAttribute("aria-label",(0,c.__)("Page number","softicon-flipbook"));let t=!0;const o=(o,i)=>{if(!t)return;t=!1;const s=parseInt(e.value,10);e.replaceWith(this.counter),o&&s&&this.go(s-1),i&&this.counter.focus()};e.addEventListener("keydown",e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),o(!0,!0)):"Escape"===e.key&&(e.preventDefault(),o(!1,!0))}),e.addEventListener("blur",()=>o(!0,!1)),this.counter.replaceWith(e),e.focus(),e.select()}sideArrows(){const e=(e,t,o)=>{const i=this.button(e,t,o);return i.className=`alfb_side alfb_side_${e}`,this.stage.append(i),i};this.sidePrev=e(this.rtl?"next":"prev",(0,c.__)("Previous page","softicon-flipbook"),()=>this.prev()),this.sideNext=e(this.rtl?"prev":"next",(0,c.__)("Next page","softicon-flipbook"),()=>this.next())}tapToRead(){const e=this.doc.createElement("button");e.type="button",e.className="alfb_tap",e.innerHTML=`<span>${de.fullscreen}</span>`,e.querySelector("span").append(this.doc.createTextNode((0,c.__)("Tap to read","softicon-flipbook"))),e.addEventListener("click",()=>this.toggleFullscreen()),this.stage.append(e),this.tap=e}toggleFullscreen(){this.doc.fullscreenElement===this.root||this.root.classList.contains("alfb_overlay")?this.doc.fullscreenElement?this.doc.exitFullscreen():this.setFullscreen(!1):this.root.requestFullscreen&&this.doc.fullscreenEnabled?this.root.requestFullscreen().catch(()=>this.setFullscreen(!0)):this.setFullscreen(!0)}setFullscreen(e){this.root.classList.toggle("alfb_overlay",e&&!this.doc.fullscreenElement),this.root.classList.toggle("alfb_is_fullscreen",e),this.fsBtn&&(this.fsBtn.innerHTML=de[e?"exitFullscreen":"fullscreen"]);const t=this.flip.getSettings();if(e){const e=this.root.querySelector(":scope > .alfb_title"),o=this.win.innerHeight-(this.bar?this.bar.offsetHeight:0)-(e?e.offsetHeight+10:0)-32;t.maxWidth=Math.max(100,Math.floor(o*this.ratio)),t.maxHeight=o}else t.maxWidth=this.maxWidth,t.maxHeight=this.config.maxHeight;"single"===this.config.pageMode&&(t.minWidth=t.maxWidth),this.refresh()}setHeight(e){this.config.maxHeight=e,this.maxWidth=Math.max(100,Math.floor(e*this.ratio)),this.flip&&!this.root.classList.contains("alfb_is_fullscreen")&&this.setFullscreen(!1)}refresh(){this.fit(),this.flip.update(),this.onChange()}on(e,t,o,i=!1){e.addEventListener(t,o,i),this.listeners.push(()=>e.removeEventListener(t,o,i))}watch(){this.on(this.doc,"fullscreenchange",()=>this.setFullscreen(this.doc.fullscreenElement===this.root)),this.editor||(this.on(this.stage,"pointerdown",()=>{this.root.contains(this.doc.activeElement)||this.root.focus({preventScroll:!0})},!0),this.on(this.root,"keydown",e=>{const t=this.thumbs?.open?this.thumbs:this.contents?.open?this.contents:this.search?.open&&this.search;if(t)return void("Escape"===e.key&&(e.preventDefault(),t.close(!0)));const o=this.zoom&&!e.ctrlKey&&!e.metaKey;"ArrowLeft"===e.key?this.back():"ArrowRight"===e.key?this.forward():!o||"+"!==e.key&&"="!==e.key?o&&"-"===e.key?this.zoom.step(-1):"Escape"===e.key&&this.zoom?.active?(e.preventDefault(),this.zoom.set(1)):"Escape"===e.key&&this.root.classList.contains("alfb_overlay")&&(e.preventDefault(),this.setFullscreen(!1)):this.zoom.step(1)}));const e=this.win.ResizeObserver;if(e){let t,o=this.stage.clientWidth;this.observer=new e(()=>{this.stage.clientWidth!==o&&(o=this.stage.clientWidth,clearTimeout(t),t=setTimeout(()=>this.refresh(),120))}),this.observer.observe(this.stage)}}fail(e){this.root.classList.add("alfb_error");const t=this.doc.createElement("p");t.className="alfb_message";const o=this.config.pdf?new URL(this.config.pdf,this.win.location.href):null,i=o&&o.origin!==this.win.location.origin;t.textContent=i?(0,c.__)("This PDF is on another website that does not allow it to be shown here. Upload the PDF to your Media Library instead.","softicon-flipbook"):(0,c.__)("This flipbook could not be loaded.","softicon-flipbook"),this.stage.replaceChildren(t),console.error("SoftIcon Flipbook:",e)}destroy(){this.destroyed=!0,this.zoom?.close(),this.thumbs?.destroy(),this.contents?.destroy(),this.autoplay?.destroy(),this.sharing?.close(),this.search?.destroy(),this.cover?.destroy(),this.sidePrev?.remove(),this.sideNext?.remove(),this.tap?.remove(),this.listeners.forEach(e=>e()),this.observer?.disconnect();try{this.flip?.destroy()}catch(e){}this.task?.destroy(),this.bar?.remove(),this.book?.remove(),this.root.querySelector(":scope > .alfb_title")?.remove(),this.root.classList.remove("alfb_theme_dark","alfb_theme_auto"),this.root.classList.remove("alfb_ready","alfb_error","alfb_overlay","alfb_is_fullscreen","alfb_zoomed","alfb_thumbs_open","alfb_contents_open","alfb_search_open","alfb_side_over","alfb_portrait")}}const ge=({attributes:e})=>{const{source:t,pdfUrl:o,images:i,lightboxImage:s}=e,a=["cover","button","text"].includes(e.lightboxTrigger)?e.lightboxTrigger:"cover",n=["left","center","right"].includes(e.lightboxAlign)?e.lightboxAlign:"center",l=Math.min(600,Math.max(120,parseInt(e.lightboxWidth,10)||260)),r=(e.lightboxText||"").trim(),d="cover"===a,f=s?.url||("images"===t?i[0]?.url:""),u=d&&!f&&"pdf"===t&&!!o,b=(0,p.useRef)(),[m,g]=(0,p.useState)(!1);(0,p.useEffect)(()=>{const e=b.current;if(!u||!e)return;let t=!1;return g(!1),(async(e,t,o)=>{const i=await be(e,t);try{const e=await i.promise,s=await e.getPage(1),a=Math.min((t.defaultView||window).devicePixelRatio||1,2),n=s.getViewport({scale:o*a/s.getViewport({scale:1}).width}),l=t.createElement("canvas");return l.width=Math.floor(n.width),l.height=Math.floor(n.height),await s.render({canvas:l,viewport:n}).promise,l}finally{i.destroy()}})(o,e.ownerDocument,600).then(o=>{t||(e.replaceChildren(o),g(!0))}).catch(()=>{}),()=>{t=!0,e.replaceChildren()}},[u,o]);const _=r||(0,c.__)("Read the flipbook","softicon-flipbook");return(0,h.createElement)("div",{className:`alfb_lb alfb_lb_${n}`+(u&&!m?" alfb_lb_draw":""),style:{"--alfb-lb-width":l+"px"}},d?(0,h.createElement)("span",{className:"alfb_lb_trigger alfb_lb_cover"},(0,h.createElement)("span",{className:"alfb_lb_img"},f?(0,h.createElement)("img",{src:f,alt:""}):(0,h.createElement)("span",{ref:b})),r&&(0,h.createElement)("span",{className:"alfb_lb_caption"},r)):(0,h.createElement)("span",{className:"alfb_lb_trigger "+("button"===a?"alfb_lb_button wp-element-button":"alfb_lb_link")},_))},_e=new URLSearchParams(window.location.search).get("alfb_start"),ke=["block","shortcode"].includes(_e)?_e:null,ve=({images:e})=>(0,h.createElement)("ol",{className:"alfbGuide"},(0,h.createElement)("li",null,e?(0,c.__)("Pick the page images, in reading order.","softicon-flipbook"):(0,c.__)("Pick your PDF: upload it, choose it from the Media Library or paste its link.","softicon-flipbook")),"shortcode"===ke?(0,h.createElement)(h.Fragment,null,(0,h.createElement)("li",null,(0,c.__)("Give the flipbook a title, change its look in the sidebar if you like, then click Publish.","softicon-flipbook")),(0,h.createElement)("li",null,(0,c.__)("Copy its shortcode from the sidebar's Block tab and paste it in your page: the Classic Editor, an Elementor Shortcode widget or any page builder.","softicon-flipbook"))):(0,h.createElement)(h.Fragment,null,(0,h.createElement)("li",null,(0,c.__)("Change its look in the sidebar on the right: Classic or Hardcover, on the page or in a popup.","softicon-flipbook")),(0,h.createElement)("li",null,(0,c.__)("Click Publish: the flipbook shows on the page.","softicon-flipbook"))));let we=!1;(0,i.registerBlockType)(r,{icon:L,edit:e=>{const{attributes:t,setAttributes:o}=e,{source:i,pdfId:a,pdfUrl:n,images:r,displayMode:m}=t,g="lightbox"===m,_=(0,p.useRef)(),k=(0,p.useRef)(),v=function(){const e=["softicon-flipbook-style-css","softicon-flipbook-editor-style-css"].join(" ");return(0,p.useEffect)(()=>{const t=e.split(" "),o=[...document.querySelectorAll('iframe[name="editor-canvas"]')],i=()=>o.forEach(e=>b(t,e.contentDocument));return i(),o.forEach(e=>e.addEventListener("load",i)),()=>o.forEach(e=>e.removeEventListener("load",i))},[e]),(0,u.useRefEffect)(t=>{b(e.split(" "),t.ownerDocument)},[e])}(),w=e=>o({pdfId:e.id||0,pdfUrl:e.url||e.source_url||""}),y=e=>o({pdfId:0,pdfUrl:e}),E=e=>o({images:e.map($)}),x=(e=>"images"===e.source?!!e.images?.length:!!e.pdfUrl)(t);(0,p.useEffect)(()=>{ke&&x&&!we&&(we=!0,(0,s.dispatch)("core/notices").createInfoNotice("shortcode"===ke?(0,c.__)("Your flipbook is ready. Give it a title and click Publish, then copy its shortcode from the sidebar's Block tab.","softicon-flipbook"):(0,c.__)("Your flipbook is ready. Change its look in the sidebar on the right, then click Publish.","softicon-flipbook"),{id:"alfb-guide"}))},[x]);const C=(e=>{const{source:t,pdfUrl:o,images:i,pageMode:s,bookStyle:a,sideArrows:n,showCover:l,startPage:r,startWith:h,bookTitle:c,theme:p,autoplay:d,autoplaySeconds:f,autoplayLoop:u,rtl:b,phoneFullscreen:m,maxHeight:g,maxHeightTablet:_,maxHeightPhone:k,showDownload:v,showPrint:w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:P,showShare:T,flipSound:L}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?i:[],pageMode:["auto","double","single"].includes(s)?s:"auto",bookStyle:"hardcover"===a?"hardcover":"flat",sideArrows:!!n,showCover:l,startPage:Math.max(1,parseInt(r,10)||1),title:(c||"").trim(),startWith:["thumbnails","contents"].includes(h)?h:"book",theme:["dark","auto"].includes(p)?p:"light",autoplay:!!d,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==u,rtl:!!b,phoneFullscreen:!!m,maxHeight:Math.min(2e3,Math.max(200,parseInt(g,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(k,10)>0?Math.min(2e3,Math.max(200,parseInt(k,10))):0,showDownload:v,showPrint:!!w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:!1!==P,showShare:!!T,flipSound:L}})(t);["showFullscreen","showZoom","showThumbnails","showContents","showLinks","showSearch","showShare","flipSound","showPrint","startWith","autoplay","autoplaySeconds","autoplayLoop","phoneFullscreen"].forEach(e=>delete C[e]);const M=(e=>{const[t,o]=(0,p.useState)(e);return(0,p.useEffect)(()=>{const t=setTimeout(()=>o(e),400);return()=>clearTimeout(t)},[e,400]),t})(JSON.stringify(C));(0,p.useEffect)(()=>{const e=_.current,t=JSON.parse(M);if(!x||g||!e||!("images"===t.source?t.images.length:t.pdf))return;const o=e.ownerDocument.createElement("div");o.className="alfb_wrapper",o.innerHTML='<div class="alfb_stage"><div class="alfb_loading"><span class="alfb_spinner"></span></div></div>',e.replaceChildren(o),k.current=o,P();const i=new me(o,t,{editor:!0});return i.init(),()=>{i.destroy(),e.replaceChildren(),k.current=null}},[M,x,g]);const P=()=>{k.current&&Object.entries((({bgColor:e,toolbarBg:t,toolbarColor:o,coverColor:i})=>({"--alfb-bg":Z(e),"--alfb-bar-bg":Z(t),"--alfb-bar-color":Z(o),"--alfb-cover":Z(i)}))(t)).forEach(([e,t])=>t?k.current.style.setProperty(e,t):k.current.style.removeProperty(e))};(0,p.useEffect)(P,[t.bgColor,t.toolbarBg,t.toolbarColor,t.coverColor]);const T=e=>(0,h.createElement)(h.Fragment,null,ke&&(0,h.createElement)(ve,{images:"pdf"===e}),(0,h.createElement)(f.Button,{variant:"link",onClick:()=>o({source:e})},"images"===e?(0,c.__)("Use images instead","softicon-flipbook"):(0,c.__)("Use a PDF instead","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbPlaceholderHelp"},(0,h.createElement)(f.ExternalLink,{href:B.add},(0,c.__)("New here? Watch the 36-second tutorial","softicon-flipbook"))));return x?(0,h.createElement)(h.Fragment,null,(0,h.createElement)(J,{attributes:t,setAttributes:o,onSelectPdf:w,onSelectImages:E}),(0,h.createElement)(d.BlockControls,{group:"other"},"images"===i?(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:r.map(e=>e.id),onSelect:E,render:({open:e})=>(0,h.createElement)(f.ToolbarButton,{onClick:e},(0,c.__)("Edit pages","softicon-flipbook"))})):(0,h.createElement)(d.MediaReplaceFlow,{mediaId:a,mediaURL:n,allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:w,onSelectURL:y,name:(0,c.__)("Replace PDF","softicon-flipbook")})),(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:v})},(0,l.applyFilters)("alfb.block.preview",null,{attributes:t})||(g?(0,h.createElement)(ge,{attributes:t}):(0,h.createElement)("div",{ref:_})))):(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:v})},"images"===i?(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload or pick the page images, in reading order.","softicon-flipbook")},allowedTypes:["image"],multiple:!0,gallery:!0,onSelect:E},T("pdf")):(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload a PDF, pick one from the Media Library or paste a link.","softicon-flipbook")},allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:w,onSelectURL:y},T("images")))},save:()=>null}),(0,l.addFilter)("blockEditor.useSetting.before","softicon-flipbook/no-margin-panel",(e,t,o,i)=>(r.name!==i||"spacing.margin"!==t)&&e),n()(()=>{const e=new URL(window.location.href),t=e.searchParams.get("alfb_start"),o=window.alfbEditor?.demoPdf;if(null===t)return;if(e.searchParams.delete("alfb_start"),window.history.replaceState(window.history.state,"",e.toString()),"shortcode"===t||"block"!==t&&!o)return;let a=!1;const n=()=>{const e=(0,s.select)("core/editor"),n=e?.__unstableIsEditorReady?e.__unstableIsEditorReady():!!e?.getCurrentPostId();if(a||!n)return;a=!0;let l=0;const h=()=>{const e=(0,s.select)("core/block-editor").getBlocks();e.some(e=>r.name===e.name)||++l>6||((0,s.dispatch)("core/block-editor").insertBlocks((0,i.createBlock)(r.name,"block"===t?{}:{pdfUrl:o}),e.length),setTimeout(h,700))};setTimeout(h,400)},l=(0,s.subscribe)(()=>{n(),a&&l()});n(),a&&l()})},387(e,t,o){window.alfbBuildUrl&&(o.p=window.alfbBuildUrl)}};const t={};function o(i){const s=t[i];if(void 0!==s)return s.exports;const a=t[i]={exports:{}};return e[i](a,a.exports,o),a.exports}o.m=e,(()=>{const e=[];o.O=(t,i,s)=>{if(!i){for(var a=0;a<e.length;a++){let[i,s]=e[a],l=!0;for(var n=0;n<i.length;n++)Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):l=!1;if(l){e.splice(a--,1);const o=s();void 0!==o&&(t=o)}}return t}e.push([i,s])}})(),o.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var s=t[i++],a=t[i++],n=0===a?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:a};o.o(e,s)||Object.defineProperty(e,s,n)}else for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,i)=>(o.f[i](e,t),t),[])),o.u=e=>({854:"pdfjs",966:"page-flip"}[e]+".js?ver="+{854:"82bd6283",966:"dc895a04"}[e]),o.miniCssF=e=>{},o.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={},t="softicon-flipbook:";o.l=(i,s,a,n)=>{if(e[i])return void e[i].push(s);let l,r;if(void 0!==a){const e=document.getElementsByTagName("script");for(var h=0;h<e.length;h++){const o=e[h];if(o.getAttribute("src")==i||o.getAttribute("data-webpack")==t+a){l=o;break}}}l||(r=!0,l=document.createElement("script"),l.charset="utf-8",o.nc&&l.setAttribute("nonce",o.nc),l.setAttribute("data-webpack",t+a),l.src=i),e[i]=[s];const c=(t,o)=>{l.onerror=l.onload=null,clearTimeout(p);const s=e[i];if(delete e[i],l.parentNode?.removeChild(l),s?.forEach(e=>e(o)),t)return t(o)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),r&&document.head.appendChild(l)}})(),(()=>{let e;globalThis.importScripts&&(e=globalThis.location+"");const t=globalThis.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const o=t.getElementsByTagName("script");if(o.length){let t=o.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=o[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),o.p=e})(),(()=>{const e={57:0,350:0};o.f.j=(t,i)=>{let s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else if(350!=t){const a=new Promise((o,i)=>s=e[t]=[o,i]);i.push(s[2]=a);const n=new Error,l=i=>{if(o.o(e,t)&&(s=e[t],0!==s&&(e[t]=void 0),s)){const e=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;n.message="Loading chunk "+t+" failed.\n("+e+": "+o+")",n.name="ChunkLoadError",n.type=e,n.request=o,n.event=i,s[1](n)}};o.l(o.p+o.u(t),l,"chunk-"+t,t)}else e[t]=0},o.O.j=t=>0===e[t];const t=(t,i)=>{let[s,a,n]=i;var l,r,h=0;if(s.some(t=>0!==e[t])){for(l in a)o.o(a,l)&&(o.m[l]=a[l]);if(n)var c=n(o)}for(t&&t(i);h<s.length;h++)r=s[h],o.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return o.O(c)},i=globalThis.webpackChunksofticon_flipbook||=[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();let i=o.O(void 0,[350],()=>o(837));i=o.O(i)})();
  • softicon-flipbook/tags/1.7.0/languages/softicon-flipbook.pot

    r3800561 r3802072  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-11-13T13:59:23+00:00\n"
     12"POT-Creation-Date: 2026-11-14T13:37:43+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    254254#: includes/shortcode.php:86
    255255#: includes/shortcode.php:91
     256#: build/dashboard.js:3
    256257#: build/index.js:2
    257258msgid "Shortcode"
    … …  
    866867
    867868#: build/dashboard.js:3
     869msgid "Block"
     870msgstr ""
     871
     872#: build/dashboard.js:3
     873msgid "Add the flipbook right inside a page or post, in the block editor."
     874msgstr ""
     875
     876#: build/dashboard.js:3
     877msgid "Open a new page"
     878msgstr ""
     879
     880#: build/dashboard.js:3
     881msgid "Make the flipbook once, then paste its shortcode in the Classic Editor, Elementor or any page builder."
     882msgstr ""
     883
     884#: build/dashboard.js:3
     885msgid "Make a flipbook"
     886msgstr ""
     887
     888#: build/dashboard.js:3
     889msgid "How do you want to add your flipbook?"
     890msgstr ""
     891
     892#: build/dashboard.js:3
     893msgid "Fits this site"
     894msgstr ""
     895
     896#: build/dashboard.js:3
     897msgid "Or start from a sample book"
     898msgstr ""
     899
     900#: build/dashboard.js:3
     901msgid "See the demos"
     902msgstr ""
     903
     904#: build/dashboard.js:3
    868905msgid "Turn any PDF into a book people enjoy reading"
    869906msgstr ""
    … …  
    871908#: build/dashboard.js:3
    872909msgid "Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor."
    873 msgstr ""
    874 
    875 #: build/dashboard.js:3
    876 msgid "See the demos"
    877910msgstr ""
    878911
    … …  
    22982331
    22992332#: build/index.js:10
     2333msgid "Pick the page images, in reading order."
     2334msgstr ""
     2335
     2336#: build/index.js:10
     2337msgid "Pick your PDF: upload it, choose it from the Media Library or paste its link."
     2338msgstr ""
     2339
     2340#: build/index.js:10
     2341msgid "Give the flipbook a title, change its look in the sidebar if you like, then click Publish."
     2342msgstr ""
     2343
     2344#: build/index.js:10
     2345msgid "Copy its shortcode from the sidebar's Block tab and paste it in your page: the Classic Editor, an Elementor Shortcode widget or any page builder."
     2346msgstr ""
     2347
     2348#: build/index.js:10
     2349msgid "Change its look in the sidebar on the right: Classic or Hardcover, on the page or in a popup."
     2350msgstr ""
     2351
     2352#: build/index.js:10
     2353msgid "Click Publish: the flipbook shows on the page."
     2354msgstr ""
     2355
     2356#: build/index.js:10
     2357msgid "Your flipbook is ready. Give it a title and click Publish, then copy its shortcode from the sidebar's Block tab."
     2358msgstr ""
     2359
     2360#: build/index.js:10
     2361msgid "Your flipbook is ready. Change its look in the sidebar on the right, then click Publish."
     2362msgstr ""
     2363
     2364#: build/index.js:10
    23002365msgid "Use images instead"
    23012366msgstr ""
  • softicon-flipbook/tags/1.7.0/src/Components/Backend/Edit.js

    r3792467 r3802072  
    33import { BlockControls, MediaPlaceholder, MediaReplaceFlow, MediaUpload, MediaUploadCheck, useBlockProps } from '@wordpress/block-editor';
    44import { Button, ExternalLink, ToolbarButton } from '@wordpress/components';
     5import { dispatch } from '@wordpress/data';
    56import { applyFilters } from '@wordpress/hooks';
    67// copied from the shared softicon-tools folder by `npm run tools` (prebuild), edit it there
    … …  
    1213import { cssVars, hasContent, toConfig, toImage } from '../../utils/functions';
    1314import { videos } from '../../utils/options';
     15import guide from '../../utils/guide';
    1416
    1517// waits for the user to stop dragging a slider before the preview reloads the PDF
    … …  
    2224        return debounced;
    2325};
     26
     27// the steps for the way picked on the Welcome tab (utils/guide.js), under the PDF picker
     28const Steps = ({ images }) => <ol className='alfbGuide'>
     29        <li>{images ? __('Pick the page images, in reading order.', 'softicon-flipbook') : __('Pick your PDF: upload it, choose it from the Media Library or paste its link.', 'softicon-flipbook')}</li>
     30        {'shortcode' === guide ? <>
     31                <li>{__('Give the flipbook a title, change its look in the sidebar if you like, then click Publish.', 'softicon-flipbook')}</li>
     32                <li>{__('Copy its shortcode from the sidebar\'s Block tab and paste it in your page: the Classic Editor, an Elementor Shortcode widget or any page builder.', 'softicon-flipbook')}</li>
     33        </> : <>
     34                <li>{__('Change its look in the sidebar on the right: Classic or Hardcover, on the page or in a popup.', 'softicon-flipbook')}</li>
     35                <li>{__('Click Publish: the flipbook shows on the page.', 'softicon-flipbook')}</li>
     36        </>}
     37</ol>;
     38
     39// once the PDF is picked, the next step stays in view at the top of the editor
     40let guided = false;
    2441
    2542const Edit = (props) => {
    … …  
    3754
    3855        const ready = hasContent(attributes);
     56        useEffect(() => {
     57                if (!guide || !ready || guided) {
     58                        return;
     59                }
     60                guided = true;
     61                dispatch('core/notices').createInfoNotice('shortcode' === guide ?
     62                        __('Your flipbook is ready. Give it a title and click Publish, then copy its shortcode from the sidebar\'s Block tab.', 'softicon-flipbook') :
     63                        __('Your flipbook is ready. Change its look in the sidebar on the right, then click Publish.', 'softicon-flipbook'), { id: 'alfb-guide' });
     64        }, [ready]);
     65
    3966        // the toolbar buttons the preview leaves out (Flipbook.js, editor mode) do not reload it
    4067        const preview = toConfig(attributes);
    … …  
    77104
    78105        const switchSource = value => <>
     106                {guide && <Steps images={'pdf' === value} />}
    79107                <Button variant='link' onClick={() => setAttributes({ source: value })}>
    80108                        {'images' === value ? __('Use images instead', 'softicon-flipbook') : __('Use a PDF instead', 'softicon-flipbook')}
  • softicon-flipbook/tags/1.7.0/src/dashboard/Welcome.js

    r3798489 r3802072  
    22import VideoLink from './VideoLink';
    33import GettingStarted from './GettingStarted';
     4
     5// the editor opened for the way picked, with the steps written in the Flipbook block (src/utils/guide.js)
     6const withStart = (href, mode) => {
     7        const url = new URL(href, window.location.href);
     8        url.searchParams.set('alfb_start', mode);
     9        return url.toString();
     10};
     11
     12// the first question: a block inside a page, or a flipbook with a shortcode for the Classic Editor and page builders.
     13// The one that fits the editor this site uses is marked
     14const Choice = ({ config }) => {
     15        const { start, urls } = config;
     16        const shortcodeSite = start.classic || start.elementor;
     17        const options = [
     18                {
     19                        key: 'block',
     20                        icon: 'block-default',
     21                        title: __('Block', 'softicon-flipbook'),
     22                        text: __('Add the flipbook right inside a page or post, in the block editor.', 'softicon-flipbook'),
     23                        action: __('Open a new page', 'softicon-flipbook'),
     24                        href: withStart(urls.newPage, 'block'),
     25                        fits: !shortcodeSite
     26                },
     27                {
     28                        key: 'shortcode',
     29                        icon: 'shortcode',
     30                        title: __('Shortcode', 'softicon-flipbook'),
     31                        text: __('Make the flipbook once, then paste its shortcode in the Classic Editor, Elementor or any page builder.', 'softicon-flipbook'),
     32                        action: __('Make a flipbook', 'softicon-flipbook'),
     33                        href: withStart(start.newBook, 'shortcode'),
     34                        fits: shortcodeSite
     35                }
     36        ];
     37        return <div className='alfb-choice'>
     38                <h3>{__('How do you want to add your flipbook?', 'softicon-flipbook')}</h3>
     39                <div className='alfb-choice-cards'>
     40                        {options.map(option => <a key={option.key} className={'alfb-choice-card' + (option.fits ? ' is-fit' : '')} href={option.href}>
     41                                <span className={'alfb-choice-icon dashicons dashicons-' + option.icon} aria-hidden='true' />
     42                                <strong>{option.title}{option.fits && <span className='alfb-choice-fit'>{__('Fits this site', 'softicon-flipbook')}</span>}</strong>
     43                                <span className='alfb-choice-text'>{option.text}</span>
     44                                <span className='alfb-choice-go'>{option.action} &rarr;</span>
     45                        </a>)}
     46                </div>
     47                <p className='alfb-choice-more'>
     48                        <a href={urls.newPage}>{__('Or start from a sample book', 'softicon-flipbook')}</a>
     49                        <a href='#/demos'>{__('See the demos', 'softicon-flipbook')}</a>
     50                </p>
     51        </div>;
     52};
    453
    554const Welcome = ({ config, play }) => <>
    … …  
    857                        <h2>{__('Turn any PDF into a book people enjoy reading', 'softicon-flipbook')}</h2>
    958                        <p>{__('Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor.', 'softicon-flipbook')}</p>
    10                         <p className='alfb-actions'>
    11                                 <a className='alfb-btn alfb-btn-amber' href={config.urls.newPage}>{__('Create a flipbook', 'softicon-flipbook')}</a>
    12                                 <a className='alfb-btn alfb-btn-ghost' href='#/demos'>{__('See the demos', 'softicon-flipbook')}</a>
    13                         </p>
     59                        <Choice config={config} />
    1460                </div>
    1561                <VideoLink className='alfb-hero-video' url={config.urls.playlist} title={__('Video tutorials', 'softicon-flipbook')} play={play}>
  • softicon-flipbook/tags/1.7.0/src/editor.scss

    r3792467 r3802072  
    1212        margin: 12px 0 0;
    1313        font-size: 13px;
     14}
     15
     16// the steps for the way picked on the dashboard's Welcome tab (Edit.js)
     17.alfbGuide {
     18        flex-basis: 100%;
     19        margin: 4px 0 14px;
     20        padding: 12px 16px 12px 34px;
     21        border-left: 3px solid #0f766e;
     22        border-radius: 4px;
     23        background: #f0fdfa;
     24        color: #1e1e1e;
     25        font-size: 13px;
     26        line-height: 1.5;
     27
     28        li {
     29                margin: 0 0 4px;
     30        }
     31
     32        li:last-child {
     33                margin-bottom: 0;
     34        }
    1435}
    1536
  • softicon-flipbook/tags/1.7.0/src/index.js

    r3787276 r3802072  
    2222));
    2323
    24 // "Create a flipbook" on the dashboard opens a new page with ?alfb_start=1: once the editor is ready the page gets a
    25 // flipbook of the demo PDF, selected, so the first book is there at once and only needs the person's own PDF
     24// the dashboard opens a new page with ?alfb_start=…: once the editor is ready the page gets a flipbook, selected.
     25// 1 ("Start from a sample book"): one of the demo PDF, only needing the person's own; block (the Welcome tab's "Block"):
     26// an empty one, which asks for the PDF; shortcode: a flipbook under All Flipbooks, whose block is already there
    2627domReady(() => {
    2728        const url = new URL(window.location.href);
     29        const mode = url.searchParams.get('alfb_start');
    2830        const pdfUrl = window.alfbEditor?.demoPdf;
    29         if (!url.searchParams.has('alfb_start') || !pdfUrl) {
     31        if (null === mode) {
    3032                return;
    3133        }
    3234        url.searchParams.delete('alfb_start');
    3335        window.history.replaceState(window.history.state, '', url.toString());
     36        if ('shortcode' === mode || ('block' !== mode && !pdfUrl)) {
     37                return;
     38        }
    3439        // the editor is often ready before this runs, and then nothing in the stores changes: check now, else wait
    3540        let done = false;
    … …  
    4954                                return;
    5055                        }
    51                         dispatch('core/block-editor').insertBlocks(createBlock(metadata.name, { pdfUrl }), blocks.length);
     56                        dispatch('core/block-editor').insertBlocks(createBlock(metadata.name, 'block' === mode ? {} : { pdfUrl }), blocks.length);
    5257                        setTimeout(add, 700);
    5358                };
  • softicon-flipbook/tags/1.7.0/vendor/fs-lite/fs-lite.php

    r3793513 r3802072  
    407407        $data = $this->data();
    408408
    409         // once after activation on the Plugins screen, the dashboard where the opt-in is; only for the person who
    410         // activated it, within a minute, and not after a bulk, network, AJAX or WP-CLI activation
     409        // once after activation on the Plugins screen: the opt-in if it is not answered yet, else the dashboard's Welcome;
     410        // only for the person who activated it, within a minute, and not after a bulk, network, AJAX or WP-CLI activation
    411411        global $pagenow;
    412412        $redirect = 'alfb_fs_redirect_' . $this->slug;
    … …  
    414414        if ( 'plugins.php' === $pagenow && get_current_user_id() && (int) get_transient( $redirect ) === get_current_user_id() ) {
    415415            delete_transient( $redirect );
    416             if ( '' === $data['state'] && current_user_can( 'manage_options' ) && ! isset( $_GET['activate-multi'] ) && ! wp_doing_ajax() && ! is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- only reads where WordPress came from
    417                 wp_safe_redirect( $this->optin_url() );
     416            if ( current_user_can( 'manage_options' ) && ! isset( $_GET['activate-multi'] ) && ! wp_doing_ajax() && ! is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- only reads where WordPress came from
     417                wp_safe_redirect( '' === $data['state'] ? $this->optin_url() : $this->page_url() );
    418418                exit;
    419419            }
    … …  
    440440        // an old answer from an earlier deactivation is not sent later
    441441        $data = $this->save( array( 'reason' => null ) );
    442         if ( '' === $data['state'] && get_current_user_id() && ! wp_doing_ajax() && ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
     442        if ( get_current_user_id() && ! wp_doing_ajax() && ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
    443443            set_transient( 'alfb_fs_redirect_' . $this->slug, get_current_user_id(), MINUTE_IN_SECONDS );
    444444        }
  • softicon-flipbook/trunk/assets/css/dashboard.css

    r3800561 r3802072  
    176176}
    177177
    178 .alfb-hero .alfb-actions {
     178/* Welcome: "Block or Shortcode?" in the hero */
     179.alfb-choice {
     180        margin-top: 24px;
     181}
     182
     183.alfb-hero .alfb-choice h3 {
     184        margin: 0 0 12px;
     185        color: #fff;
     186        font-size: 16px;
     187}
     188
     189.alfb-choice-cards {
     190        display: grid;
     191        grid-template-columns: repeat(2, minmax(0, 1fr));
     192        gap: 12px;
     193}
     194
     195.alfb-choice-card {
     196        display: flex;
     197        flex-direction: column;
     198        gap: 6px;
     199        padding: 16px 18px;
     200        border: 2px solid transparent;
     201        border-radius: 12px;
     202        background: #fff;
     203        color: var(--alfb-ink);
     204        text-decoration: none;
     205        transition: transform 0.15s, box-shadow 0.15s;
     206}
     207
     208.alfb-choice-card:hover,
     209.alfb-choice-card:focus {
     210        color: var(--alfb-ink);
     211        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
     212        transform: translateY(-2px);
     213}
     214
     215.alfb-choice-card:focus-visible {
     216        outline: 2px solid var(--alfb-amber);
     217        outline-offset: 2px;
     218}
     219
     220.alfb-choice-card.is-fit {
     221        border-color: #fbbf24;
     222}
     223
     224.alfb-choice-icon {
     225        width: 32px;
     226        height: 32px;
     227        border-radius: 8px;
     228        background: #ccfbf1;
     229        color: var(--alfb-teal);
     230        font-size: 20px;
     231        line-height: 32px;
     232        text-align: center;
     233}
     234
     235.alfb-choice-card strong {
    179236        display: flex;
    180237        flex-wrap: wrap;
    181         gap: 10px;
    182         margin-top: 22px;
     238        align-items: center;
     239        gap: 8px;
     240        font-size: 16px;
     241}
     242
     243.alfb-choice-fit {
     244        padding: 2px 8px;
     245        border-radius: 999px;
     246        background: #fef3c7;
     247        color: #92400e;
     248        font-size: 11px;
     249        font-weight: 600;
     250}
     251
     252.alfb-hero .alfb-choice-text {
     253        color: #50575e;
     254        font-size: 13px;
     255        line-height: 1.5;
     256}
     257
     258.alfb-choice-go {
     259        margin-top: auto;
     260        padding-top: 4px;
     261        color: var(--alfb-teal);
     262        font-weight: 600;
     263}
     264
     265.alfb-hero .alfb-choice-more {
     266        display: flex;
     267        flex-wrap: wrap;
     268        gap: 18px;
     269        margin-top: 14px;
     270        font-size: 13px;
     271}
     272
     273.alfb-choice-more a {
     274        color: #fff;
     275}
     276
     277.alfb-choice-more a:hover,
     278.alfb-choice-more a:focus {
     279        color: #fde68a;
     280}
     281
     282@media (max-width: 600px) {
     283        .alfb-choice-cards {
     284                grid-template-columns: 1fr;
     285        }
    183286}
    184287
  • softicon-flipbook/trunk/build/dashboard.asset.php

    r3800561 r3802072  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'dd4ad171029094f39fe4');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'e9171b997dfcd5a87a66');
  • softicon-flipbook/trunk/build/dashboard.js

    r3800561 r3802072  
    11(()=>{"use strict";const e={n:t=>{const o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var a in o)e.o(o,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:o[a]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.React,o=window.wp.element,a=window.wp.hooks,l=window.wp.i18n,n=window.wp.apiFetch;var s=e.n(n);const i=(e,t)=>(e.groups||[]).find(e=>e.items.some(e=>e.key===t)),r=(e,t)=>{let o="";try{o=window.localStorage.getItem("alfb-group-"+t.key)||""}catch(e){}const a=t.items.map(e=>e.key),l=a.filter(t=>!e.lockedTabs.includes(t));return"#/"+(a.includes(o)&&l.includes(o)?o:l[0]||a[0])},c=({config:e,active:o,unlock:a})=>(0,t.createElement)("header",{className:"alfb-dash-head"},(0,t.createElement)("a",{className:"alfb-dash-brand",href:"#/welcome"},(0,t.createElement)("img",{src:e.icon,alt:"",width:"36",height:"36"}),(0,t.createElement)("strong",null,e.pro?(0,l.__)("Flipbook Pro","softicon-flipbook"):(0,l.__)("Flipbook","softicon-flipbook")),(0,t.createElement)("span",{className:"alfb-version"},"v",e.version)),(0,t.createElement)("nav",{className:"alfb-dash-tabs","aria-label":(0,l.__)("Flipbook dashboard","softicon-flipbook")},e.tabs.map((n,s)=>{const c=i(e,n.key);if(c){if(e.tabs.findIndex(t=>i(e,t.key)===c)!==s)return null;const n=!!c.items.find(e=>e.key===o),p=c.items.every(t=>e.lockedTabs.includes(t.key));return(0,t.createElement)("a",{key:c.key,href:r(e,c),className:(n?"is-active":"")+(p?" is-locked":"")||void 0,"aria-current":n?"page":void 0,onClick:p?e=>{e.preventDefault(),a()}:void 0},c.label,p&&(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-label":(0,l.__)("Locked","softicon-flipbook")}))}const p=e.lockedTabs.includes(n.key);return(0,t.createElement)("a",{key:n.key,href:"#/"+n.key,className:(n.key===o?"is-active":"")+(p?" is-locked":"")||void 0,"aria-current":n.key===o?"page":void 0,onClick:p?e=>{e.preventDefault(),a()}:void 0},n.label,p&&(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-label":(0,l.__)("Locked","softicon-flipbook")}))})),(0,t.createElement)("div",{className:"alfb-dash-end"},(0,t.createElement)("a",{className:"alfb-dash-more",href:"https://wordpress.org/plugins/author/softiconai/",target:"_blank",rel:"noopener noreferrer"},(0,l.__)("Our plugins","softicon-flipbook")),e.pro&&!e.locked?(0,t.createElement)("span",{className:"alfb-pro-on"},(0,t.createElement)("span",{className:"dashicons dashicons-yes-alt","aria-hidden":"true"}),(0,l.__)("Pro active","softicon-flipbook")):(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber alfb-upgrade",href:"#/pricing"},(0,t.createElement)("span",{className:"dashicons dashicons-unlock","aria-hidden":"true"}),(0,l.__)("Upgrade to Pro","softicon-flipbook")))),p=e=>{const t=new URL(e),o=t.searchParams.get("v")||("youtu.be"===t.hostname?t.pathname.slice(1):""),a=t.searchParams.get("list");return o?`https://www.youtube-nocookie.com/embed/${encodeURIComponent(o)}?autoplay=1&rel=0`:a?`https://www.youtube-nocookie.com/embed/videoseries?list=${encodeURIComponent(a)}&autoplay=1&rel=0`:""},d=({video:e,onClose:a})=>{const n=(0,o.useRef)();return(0,o.useEffect)(()=>{const t=n.current;e&&t&&!t.open&&t.showModal()},[e]),(0,t.createElement)("dialog",{ref:n,className:"alfb-video-popup","aria-label":e?.title||(0,l.__)("Video tutorial","softicon-flipbook"),onClose:a,onClick:e=>e.target===n.current&&n.current.close()},(0,t.createElement)("button",{type:"button",className:"alfb-video-close","aria-label":(0,l.__)("Close","softicon-flipbook"),onClick:()=>n.current.close()},(0,t.createElement)("span",{className:"dashicons dashicons-no-alt","aria-hidden":"true"})),(0,t.createElement)("div",{className:"alfb-video-frame"},e&&(0,t.createElement)("iframe",{src:p(e.url),title:e.title,allow:"autoplay; encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0})))},m=e=>{const t=window.location.hash.replace(/^#\/?/,"").split(/[/?]/)[0];if(t)return t;const o=new URLSearchParams(window.location.search).get("tab");return o&&e.includes(o)?o:e[0]},f=({notice:e,tab:a})=>{const[n,s]=(0,o.useState)(!0),[i]=(0,o.useState)(a),r="warning"!==e.type;return(0,o.useEffect)(()=>{r&&a!==i&&s(!1)},[r,a,i]),(0,o.useEffect)(()=>{const e=new URL(window.location.href);e.searchParams.has("alfb_fs")&&(e.searchParams.delete("alfb_fs"),window.history.replaceState(window.history.state,"",e.toString()))},[]),n?(0,t.createElement)("div",{className:"notice inline alfb-notice notice-"+e.type+(r?" is-dismissible":""),role:"status"},(0,t.createElement)("p",null,e.text),r&&(0,t.createElement)("button",{type:"button",className:"notice-dismiss",onClick:()=>s(!1)},(0,t.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Dismiss this notice.","softicon-flipbook")))):null},h=({review:e})=>{const[a,n]=(0,o.useState)(!0);if(!a)return null;const i=e=>{n(!1),s()({path:"/alfb/v1/dashboard/review",method:"POST",data:{answer:e}}).catch(()=>{})};return(0,t.createElement)("div",{className:"notice inline alfb-notice alfb-review notice-info",role:"status"},(0,t.createElement)("p",null,(0,t.createElement)("strong",null,(0,l.__)("Enjoying SoftIcon Flipbook?","softicon-flipbook"))," ",(0,l.__)("A quick review on WordPress.org helps other people find it, and it means a lot to our small team.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-review-actions"},(0,t.createElement)("a",{className:"button button-primary",href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>i("done")},(0,l.__)("Leave a review","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"button",onClick:()=>i("later")},(0,l.__)("Maybe later","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"button-link",onClick:()=>i("done")},(0,l.__)("I already did","softicon-flipbook"))))},b=({config:e,tabs:n})=>{const[s]=(0,o.useState)(()=>(e=>e.tabs.map(e=>e.key))(e)),r=(e=>{const[t,a]=(0,o.useState)(()=>m(e));return(0,o.useEffect)(()=>{const t=()=>{a(m(e)),window.scrollTo(0,0)};return window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)},[e]),t})(s),[p,b]=(0,o.useState)(null),[u,k]=(0,o.useState)(!1),_=()=>k(!0),E="videos"===r?"welcome":r,y=s.includes(E)&&n[E]?E:s[0],g=n[y],w=e.lockedTabs.includes(y);(0,o.useEffect)(()=>{w&&k(!0)},[w]);const v=i(e,y);(0,o.useEffect)(()=>{if(v)try{window.localStorage.setItem("alfb-group-"+v.key,y)}catch(e){}},[v,y]),(0,o.useEffect)(()=>{"videos"===r&&document.getElementById("alfb-videos")?.scrollIntoView({behavior:"smooth"})},[r]);const N=w?(0,t.createElement)("div",{className:"alfb-card alfb-status"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("This is a Pro feature.","softicon-flipbook")):(0,t.createElement)(g,{config:e,play:b,unlock:_});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(c,{config:e,active:y,unlock:_}),(0,t.createElement)("div",{className:"alfb-dash-body"},e.notice&&(0,t.createElement)(f,{notice:e.notice,tab:y}),e.review&&(0,t.createElement)(h,{review:e.review}),v?(0,t.createElement)("div",{className:"alfb-group"},(0,t.createElement)("nav",{className:"alfb-group-nav","aria-label":v.label},(0,t.createElement)("span",{className:"alfb-group-title"},v.label),v.items.map(o=>{const a=e.lockedTabs.includes(o.key);return(0,t.createElement)("a",{key:o.key,href:"#/"+o.key,className:o.key===y?"is-active":void 0,"aria-current":o.key===y?"page":void 0,onClick:a?e=>{e.preventDefault(),_()}:void 0},(0,t.createElement)("span",{className:"alfb-group-icon dashicons dashicons-"+(o.icon||"admin-generic"),"aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,o.label,a&&(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-label":(0,l.__)("Locked","softicon-flipbook")}),!e.pro&&(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),o.text&&(0,t.createElement)("small",null,o.text)))})),(0,t.createElement)("div",{className:"alfb-group-main"},N)):N),(0,t.createElement)(d,{video:p,onClose:()=>b(null)}),(0,a.applyFilters)("alfb.dashboard.popup",null,{open:u,onClose:()=>k(!1),config:e}))},u=({url:e,title:o,play:a,className:l,children:n})=>(0,t.createElement)("a",{className:l,href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button||(t.preventDefault(),a({url:e,title:o}))}},n),k=window.wp.primitives,_=((0,t.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)(k.Path,{d:"M12 6.5C10.3 5.3 8 4.75 5 4.75H3v13h2c3 0 5.3.55 7 1.75 1.7-1.2 4-1.75 7-1.75h2v-13h-2c-3 0-5.3.55-7 1.75m-1.25 10.6c-1.5-.6-3.4-.9-5.75-.85V6.25c2.5 0 4.4.45 5.75 1.4zm8.25-.85c-2.35-.05-4.25.25-5.75.85V7.65c1.35-.95 3.25-1.4 5.75-1.4z"})),(e,o=!1)=>(0,t.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,t.createElement)(k.Path,{d:e,fillRule:o?"evenodd":void 0}))),E=(_("M6 2.5h7.6L19.5 8.4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M6 4v16h12V9.5h-5.5V4zm8 .6V8h3.4zM8 12.5h8V14H8zm0 3h8V17H8z",!0),_("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m0 1.5v10.4l4.2-4.2 2.8 2.8 4.3-4.7 3.7 4V6zM8.5 10.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5",!0),_("M2 4.5h14v10H2zm1.5 1.5v7h11V6zM6 16.5h6V18H6zM17 8h5v12.5h-5zm1.5 1.5V19h2V9.5z",!0),_("M2.5 5h8.5v14H2.5zM4 6.5v11h5.5v-11zM13 5h8.5v14H13zm1.5 1.5v11H20v-11z",!0),_("M6.5 3h11v18h-11zM8 4.5v15h8v-15zM10 8h4v1.5h-4zm0 3h4v1.5h-4z",!0),_("M3 6.5h8.25v11H3zM4.5 8v8h5.25V8zM12.75 6.5H21v11h-8.25zm1.5 1.5v8h5.25V8z",!0),_("M1.5 4.5h21v15h-21zM3 6v12h8.25V6zm9.75 0v12H21V6z",!0),_("M6 2.5h12A1.5 1.5 0 0 1 19.5 4v16a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M8 4v16h10V4zm2.5 3H16v1.5h-5.5z",!0),_("M4 7h16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2m0 1.5a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5zM7 11.25h10v1.5H7z",!0),_("M3 7h18v1.5H3zm0 4.5h12V13H3zm0 4.5h7.5v1.5H3z"),_("M4 5h16v1.5H4zm0 4h10v1.5H4zm0 4h16v1.5H4zm0 4h10v1.5H4z"),_("M4 5h16v1.5H4zm3 4h10v1.5H7zm-3 4h16v1.5H4zm3 4h10v1.5H7z"),_("M4 5h16v1.5H4zm6 4h10v1.5H10zm-6 4h16v1.5H4zm6 4h10v1.5H10z"),(e,o=!1)=>(0,t.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,t.createElement)(k.Path,{d:e,fillRule:o?"evenodd":void 0}))),y=(E("M12 2.75a9.25 9.25 0 1 1 0 18.5 9.25 9.25 0 0 1 0-18.5m0 1.5a7.75 7.75 0 1 0 0 15.5 7.75 7.75 0 0 0 0-15.5M11.2 10.6h1.6V17h-1.6zm0-3.4h1.6v1.7h-1.6z",!0),E("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m5.5 4v7l6-3.5z"),E("M4.5 4h15A1.5 1.5 0 0 1 21 5.5v10a1.5 1.5 0 0 1-1.5 1.5H10l-5 4v-4h-.5A1.5 1.5 0 0 1 3 15.5v-10A1.5 1.5 0 0 1 4.5 4M7 8.5V10h10V8.5zm0 3V13h7v-1.5z",!0),E("M12 2.75l2.85 5.95 6.55.75-4.85 4.5 1.3 6.5L12 17.2l-5.85 3.25 1.3-6.5L2.6 9.45l6.55-.75z"),E("M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z"),(0,l.__)("General","softicon-flipbook"),(0,l.__)("Style","softicon-flipbook"),(0,l.__)("Auto","softicon-flipbook"),(0,l.__)("Two pages","softicon-flipbook"),(0,l.__)("One page","softicon-flipbook"),(0,l.__)("PDF file","softicon-flipbook"),(0,l.__)("Images","softicon-flipbook"),"&list=PLJEAefIarF4g"),g={overview:"https://www.youtube.com/watch?v=5geq69DXoN8"+y,add:"https://www.youtube.com/watch?v=KGP_xpi8NGo"+y,design:"https://www.youtube.com/watch?v=qqQeZQkX5ms"+y,reading:"https://www.youtube.com/watch?v=1J7wCaUvugc"+y,lightbox:"https://www.youtube.com/watch?v=XBJuUV9HpkA"+y,settings:"https://www.youtube.com/watch?v=H9IxgIocY68"+y,promo:"https://www.youtube.com/watch?v=Oj9sHOZbb3A"+y,shortcode:"https://www.youtube.com/watch?v=slQlR4GTghg"+y,autoplay:"https://www.youtube.com/watch?v=bkuMUupI92Y"+y,rtl:"https://www.youtube.com/watch?v=MzZs4jJInFA"+y,shelf:"https://www.youtube.com/watch?v=9UY2KNYzkGk"+y,buttons:"https://www.youtube.com/watch?v=fS5RMGkPQXk"+y,leads:"https://www.youtube.com/watch?v=GxbrW_pyAdA"+y,protect:"https://www.youtube.com/watch?v=5UNgRO22s_Q"+y,hotspots:"https://www.youtube.com/watch?v=D7WiNswbHi8"+y,branding:"https://www.youtube.com/watch?v=iOr2NJ0yaAA"+y,analytics:"https://www.youtube.com/watch?v=ET4JXhOO-2s"+y,field:"https://www.youtube.com/watch?v=BGlS_IKKagM"+y,bookmarks:"https://www.youtube.com/watch?v=4-D5HxqV1yg"+y,pro:"https://www.youtube.com/watch?v=LtCj7-J2qXI"+y},w=((0,l.__)("Classic","softicon-flipbook"),(0,l.__)("Hardcover","softicon-flipbook"),(0,l.__)("Cover","softicon-flipbook"),(0,l.__)("Button","softicon-flipbook"),(0,l.__)("Text link","softicon-flipbook"),(0,l.__)("Left","softicon-flipbook"),(0,l.__)("Center","softicon-flipbook"),(0,l.__)("Right","softicon-flipbook"),(0,l.__)("Video tutorials","softicon-flipbook"),(0,l.__)("Get support","softicon-flipbook"),(0,l.__)("Rate Flipbook","softicon-flipbook"),(0,l.__)("More plugins","softicon-flipbook"),"alfb_start_tab"),v=e=>`[softicon_flipbook id="${e}"]`,N=({text:e,label:a})=>{const[n,s]=(0,o.useState)(!1);return(0,t.createElement)("button",{type:"button",className:"alfb-copy"+(n?" is-copied":""),"aria-label":a,onClick:()=>(e=>{if(window.navigator.clipboard&&window.isSecureContext)return window.navigator.clipboard.writeText(e);const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.append(t),t.select();const o=document.execCommand("copy");return t.remove(),o?Promise.resolve():Promise.reject()})(e).then(()=>{s(!0),setTimeout(()=>s(!1),1600)}).catch(()=>{})},(0,t.createElement)("span",{className:"dashicons "+(n?"dashicons-yes":"dashicons-admin-page"),"aria-hidden":"true"}),n?(0,l.__)("Copied","softicon-flipbook"):(0,l.__)("Copy","softicon-flipbook"))},S=({text:e,label:o})=>(0,t.createElement)("div",{className:"alfb-code"},(0,t.createElement)("code",null,e),(0,t.createElement)(N,{text:e,label:o})),x=({start:e})=>(0,t.createElement)("div",{className:"alfb-start-books"},(0,t.createElement)("h4",null,(0,l.__)("Your flipbooks","softicon-flipbook")),e.books.length?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("ul",null,e.books.map(e=>(0,t.createElement)("li",{key:e.id},(0,t.createElement)("a",{className:"alfb-start-book",href:e.edit},e.title),(0,t.createElement)(S,{text:v(e.id),label:(0,l.sprintf)(/* translators: %s: flipbook title */ /* translators: %s: flipbook title */
    22(0,l.__)("Copy the shortcode of %s","softicon-flipbook"),e.title)})))),(0,t.createElement)("p",{className:"alfb-start-more"},e.total>e.books.length&&(0,t.createElement)("a",{href:e.allBooks},(0,l.sprintf)(/* translators: %d: number of flipbooks */ /* translators: %d: number of flipbooks */
    3 (0,l._n)("See all %d flipbook","See all %d flipbooks",e.total,"softicon-flipbook"),e.total)),(0,t.createElement)("a",{href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))):(0,t.createElement)("div",{className:"alfb-start-empty"},(0,t.createElement)("p",null,(0,l.__)("No flipbooks yet. Make one and its shortcode shows up here, ready to copy.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))),C=({url:e,title:o,play:a})=>(0,t.createElement)(u,{className:"alfb-start-video",url:e,title:o,play:a},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,t.createElement)("span",null,o)),F=({n:e,title:o,children:a,action:l})=>(0,t.createElement)("li",{className:"alfb-start-step"},(0,t.createElement)("span",{className:"alfb-step"},e),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,o),a,l)),P=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(F,{n:1,title:(0,l.__)("Make the flipbook","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Go to Flipbook → All Flipbooks → Add a flipbook. It opens with the Flipbook block: pick the PDF and the look, then publish.","softicon-flipbook"))),(0,t.createElement)(F,{n:2,title:(0,l.__)("Copy its shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every flipbook has a shortcode in the All Flipbooks list and in the block's Help panel. Your flipbooks are listed here too.","softicon-flipbook")))),I=({config:e,play:a})=>{const n={...e.start,newPage:e.urls.newPage,pro:e.pro},s=(e=>[{key:"block",icon:"block-default",label:(0,l.__)("Block editor","softicon-flipbook"),on:!e.classic,steps:(0,t.createElement)(t.Fragment,null,(0,t.createElement)(F,{n:1,title:(0,l.__)("Add the Flipbook block","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newPage},(0,l.__)("Create a flipbook page","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In any page or post, click <b>+</b> and search for <b>Flipbook</b>, or type <code>/flipbook</code> in an empty line.","softicon-flipbook"),{b:(0,t.createElement)("strong",null),code:(0,t.createElement)("code",null)}))),(0,t.createElement)(F,{n:2,title:(0,l.__)("Pick a PDF or images","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Upload a PDF, choose one from the Media Library, paste a link, or build the book from your own images.","softicon-flipbook"))),(0,t.createElement)(F,{n:3,title:(0,l.__)("Choose the look and publish","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Classic or Hardcover, on the page or in a popup: every setting is in the block's sidebar, and the editor shows the finished book.","softicon-flipbook")))),video:[g.add,(0,l.__)("Add a flipbook in 36 seconds","softicon-flipbook")]},{key:"classic",icon:"editor-paste-text",label:(0,l.__)("Classic editor","softicon-flipbook"),on:e.classic,books:!0,steps:(0,t.createElement)(t.Fragment,null,P(e),(0,t.createElement)(F,{n:3,title:(0,l.__)("Paste it in the Classic Editor","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Paste the shortcode where the book goes, in the Visual or the Text tab, then update the page. It works in text widgets too.","softicon-flipbook")),(0,t.createElement)(S,{text:v(e.books[0]?.id||123),label:(0,l.__)("Copy the shortcode","softicon-flipbook")}))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]},{key:"builders",icon:"layout",label:(0,l.__)("Elementor & builders","softicon-flipbook"),on:e.elementor,books:!0,steps:(0,t.createElement)(t.Fragment,null,P(e),(0,t.createElement)(F,{n:3,title:(0,l.__)("Add a Shortcode widget","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In <b>Elementor</b>, drag the <b>Shortcode</b> widget onto the page and paste the shortcode; the book shows in Elementor's preview too. Other builders work the same way:","softicon-flipbook"),{b:(0,t.createElement)("strong",null)})),(0,t.createElement)("ul",{className:"alfb-start-builders"},(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Divi")," – ",(0,l.__)("Code module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Beaver Builder")," – ",(0,l.__)("HTML or Text Editor module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"WPBakery")," – ",(0,l.__)("Text Block","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Bricks, Oxygen")," – ",(0,l.__)("Shortcode element","softicon-flipbook"))))),video:[g.shortcode,(0,l.__)("The shortcode in Elementor and more","softicon-flipbook")]},{key:"theme",icon:"editor-code",label:(0,l.__)("Theme / PHP","softicon-flipbook"),on:!1,books:!0,steps:(0,t.createElement)(t.Fragment,null,e.blockTheme&&(0,t.createElement)(F,{n:1,title:(0,l.__)("Block theme: add the block to a template","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.siteEditor},(0,l.__)("Open the Site Editor","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Your theme is a block theme. In Appearance → Editor → Templates, open a template and add the Flipbook block like on any page.","softicon-flipbook"))),(0,t.createElement)(F,{n:e.blockTheme?2:1,title:(0,l.__)("Any theme: print the shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("Make the flipbook under All Flipbooks, then show it from a template file, such as <code>single.php</code>, with:","softicon-flipbook"),{code:(0,t.createElement)("code",null)})),(0,t.createElement)(S,{text:`<?php echo do_shortcode( '${v(e.books[0]?.id||123)}' ); ?>`,label:(0,l.__)("Copy the PHP code","softicon-flipbook")})),(0,t.createElement)(F,{n:e.blockTheme?3:2,title:(0,l.__)("One book for every post","softicon-flipbook")},e.pro?(0,t.createElement)("p",null,(0,l.__)('Keep each post\'s PDF in a Meta Box or ACF field, put one flipbook in the template, and turn on "PDF from a custom field" in its Source panel: every post shows its own book.',"softicon-flipbook")):(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("With Pro, one flipbook in a template shows each post's own PDF from a Meta Box or ACF field. <a>See Pro</a>","softicon-flipbook"),{a:(0,t.createElement)("a",{href:"#/pricing"})})))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]}])(n),[i,r]=(0,o.useState)(()=>{const e=(()=>{try{return window.localStorage.getItem(w)}catch(e){return null}})();return s.some(t=>t.key===e)?e:n.classic?"classic":n.elementor?"builders":"block"}),c=e=>{r(e);try{window.localStorage.setItem(w,e)}catch(e){}},p=s.find(e=>e.key===i)||s[0];return(0,t.createElement)("section",{className:"alfb-start"},(0,t.createElement)("header",{className:"alfb-start-head"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Getting started","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Pick where you build your pages; the steps follow.","softicon-flipbook")))),(0,t.createElement)("div",{className:"alfb-start-tabs",role:"tablist","aria-label":(0,l.__)("Where you build your pages","softicon-flipbook"),onKeyDown:e=>{const t=s.findIndex(e=>e.key===i),o={ArrowRight:t+1,ArrowLeft:t-1,Home:0,End:s.length-1}[e.key];if(void 0===o)return;e.preventDefault();const a=s[(o+s.length)%s.length].key;c(a),e.currentTarget.querySelector(`[data-tab="${a}"]`)?.focus()}},s.map(e=>(0,t.createElement)("button",{key:e.key,type:"button",role:"tab",id:"alfb-start-tab-"+e.key,"data-tab":e.key,"aria-selected":e.key===i,"aria-controls":"alfb-start-panel",tabIndex:e.key===i?0:-1,className:e.key===i?"is-active":"",onClick:()=>c(e.key)},(0,t.createElement)("span",{className:"dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("span",null,e.label),e.on&&"block"!==e.key&&(0,t.createElement)("span",{className:"alfb-start-on"},(0,l.__)("On this site","softicon-flipbook"))))),(0,t.createElement)("div",{className:"alfb-start-body",role:"tabpanel",id:"alfb-start-panel","aria-labelledby":"alfb-start-tab-"+p.key},(0,t.createElement)("ol",{className:"alfb-start-steps"},p.steps),(0,t.createElement)("aside",{className:"alfb-start-side"},p.books?(0,t.createElement)(x,{start:n}):(0,t.createElement)("div",{className:"alfb-start-books"},(0,t.createElement)("h4",null,(0,l.__)("Fastest start","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("A new page opens with a sample book already in place; swap in your own PDF.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:n.newPage},(0,l.__)("Create a flipbook","softicon-flipbook"))),(0,t.createElement)(C,{url:p.video[0],title:p.video[1],play:a}))))},A=({config:e,play:o})=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("section",{className:"alfb-hero"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Turn any PDF into a book people enjoy reading","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-actions"},(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:e.urls.newPage},(0,l.__)("Create a flipbook","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-ghost",href:"#/demos"},(0,l.__)("See the demos","softicon-flipbook")))),(0,t.createElement)(u,{className:"alfb-hero-video",url:e.urls.playlist,title:(0,l.__)("Video tutorials","softicon-flipbook"),play:o},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch the video tutorials","softicon-flipbook"))),(0,t.createElement)(I,{config:e,play:o}),(0,t.createElement)("h2",{className:"alfb-title",id:"alfb-videos"},(0,l.__)("Video tutorials","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-grid alfb-videos"},e.videos.map(e=>(0,t.createElement)(u,{key:e.url,className:"alfb-card alfb-video",url:e.url,title:e.title,play:o},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"}),e.title)))),L={},M=e=>{const[t,a]=(0,o.useState)(()=>L[e]||{loading:!0});return(0,o.useEffect)(()=>{if(L[e])return;let t=!0;return s()({path:e}).then(e=>({data:e}),e=>({error:e.message||(0,l.__)("Something went wrong. Please try again.","softicon-flipbook")})).then(o=>{L[e]=o,t&&a(o)}),()=>{t=!1}},[e]),t},T=JSON.parse('{"attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}}}'),D=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],O=Object.fromEntries(Object.entries(T.attributes).map(([e,t])=>[e,t.default])),z=e=>(e=>{const{source:t,pdfUrl:o,images:a,pageMode:l,bookStyle:n,sideArrows:s,showCover:i,startPage:r,startWith:c,bookTitle:p,theme:d,autoplay:m,autoplaySeconds:f,autoplayLoop:h,rtl:b,phoneFullscreen:u,maxHeight:k,maxHeightTablet:_,maxHeightPhone:E,showDownload:y,showPrint:g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:C,showShare:F,flipSound:P}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?a:[],pageMode:["auto","double","single"].includes(l)?l:"auto",bookStyle:"hardcover"===n?"hardcover":"flat",sideArrows:!!s,showCover:i,startPage:Math.max(1,parseInt(r,10)||1),title:(p||"").trim(),startWith:["thumbnails","contents"].includes(c)?c:"book",theme:["dark","auto"].includes(d)?d:"light",autoplay:!!m,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==h,rtl:!!b,phoneFullscreen:!!u,maxHeight:Math.min(2e3,Math.max(200,parseInt(k,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(E,10)>0?Math.min(2e3,Math.max(200,parseInt(E,10))):0,showDownload:y,showPrint:!!g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:!1!==C,showShare:!!F,flipSound:P}})({...O,...e}),H=e=>{const t={};return[["bgColor","--alfb-bg"],["toolbarBg","--alfb-bar-bg"],["toolbarColor","--alfb-bar-color"],["coverColor","--alfb-cover"]].forEach(([o,a])=>{const l=(n="string"==typeof(n=e[o])?n.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(n)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(n)&&[...n.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>D.includes(e))?n:void 0);var n;l&&(t[a]=l)}),t},V={"alfb-block":""},$=(0,o.memo)(({attributes:e,config:o})=>(0,t.createElement)("div",{className:"alfb_wrapper wp-block-softicon-flipbook",...V,"data-alfb":JSON.stringify(o),style:H(e),tabIndex:"0",role:"region","aria-label":(0,l.__)("Flipbook","softicon-flipbook")},(0,t.createElement)("div",{className:"alfb_stage"},(0,t.createElement)("div",{className:"alfb_loading"},(0,t.createElement)("span",{className:"alfb_spinner"}))))),B=(0,o.memo)(({attributes:e,config:o})=>{const a={...O,...e},n=(a.lightboxText||"").trim(),s=n||(0,l.__)("Read the flipbook","softicon-flipbook"),i="cover"===a.lightboxTrigger,r={...H(a),...i?{"--alfb-lb-width":Math.min(600,Math.max(120,a.lightboxWidth))+"px"}:{}};return(0,t.createElement)("div",{className:"alfb_lb wp-block-softicon-flipbook alfb_lb_"+a.lightboxAlign+(i?" alfb_lb_draw":""),...V,"data-alfb":JSON.stringify(o),style:r},i?(0,t.createElement)("a",{className:"alfb_lb_trigger alfb_lb_cover",href:o.pdf,"aria-haspopup":"dialog","aria-label":n?void 0:s},(0,t.createElement)("span",{className:"alfb_lb_img"}),n&&(0,t.createElement)("span",{className:"alfb_lb_caption"},n)):(0,t.createElement)("a",{className:"alfb_lb_trigger "+("button"===a.lightboxTrigger?"alfb_lb_button wp-element-button":"alfb_lb_link"),href:o.pdf,"aria-haspopup":"dialog"},s))}),U=({book:e})=>{if(e.Component)return(0,t.createElement)(e.Component,{...e});const o=e.config||z(e.attributes);return"lightbox"===e.attributes?.displayMode?(0,t.createElement)(B,{attributes:e.attributes,config:o}):(0,t.createElement)($,{attributes:e.attributes||{},config:o})},W=({unlock:e})=>{const{data:o}=M("/alfb/v1/dashboard/plans");return(o?.pro_only||[]).filter(e=>e.featured).map(o=>(0,t.createElement)("article",{key:o.title,className:"alfb-card alfb-demo is-pro"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,o.title," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("p",null,o.text)),(0,t.createElement)("div",{className:"alfb-demo-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})),(0,t.createElement)("footer",null,(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/compare",onClick:e?t=>{t.preventDefault(),e()}:void 0},(0,l.__)("Available in Pro","softicon-flipbook")))))},q=({config:e,unlock:n})=>{const s=(0,o.useMemo)(()=>(0,a.applyFilters)("alfb.dashboard.demos",(e=>{const t={pdfUrl:e+"spring-catalog.pdf",maxHeight:420},o={pdfUrl:e+"room-guide.pdf",maxHeight:420};return[{key:"classic",title:(0,l.__)("Classic book","softicon-flipbook"),text:(0,l.__)("The default look: two pages side by side, one page on phones, and the full toolbar.","softicon-flipbook"),books:[{attributes:t}]},{key:"hardcover",title:(0,l.__)("Hardcover","softicon-flipbook"),text:(0,l.__)("Pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows.","softicon-flipbook"),books:[{attributes:{...t,bookStyle:"hardcover",sideArrows:!0,coverColor:"#0f766e"}}]},{key:"guide",title:(0,l.__)("Chapters and links","softicon-flipbook"),text:(0,l.__)("A PDF with bookmarks gets a table of contents, and the links inside it can be clicked.","softicon-flipbook"),books:[{attributes:o}]},{key:"covers",row:!0,title:(0,l.__)("Covers that open a popup","softicon-flipbook"),text:(0,l.__)("Only the covers show on the page. A click opens the book over the page, and it loads only then.","softicon-flipbook"),books:[{attributes:{...t,displayMode:"lightbox",lightboxText:(0,l.__)("Spring Living 2026","softicon-flipbook"),lightboxWidth:170}},{attributes:{...o,displayMode:"lightbox",lightboxText:(0,l.__)("Room Guide 2026","softicon-flipbook"),lightboxWidth:170,bookStyle:"hardcover",sideArrows:!0}}]},{key:"button",title:(0,l.__)("A button that opens a popup","softicon-flipbook"),text:(0,l.__)("A theme-styled button, or a plain text link, opens the book in a popup.","softicon-flipbook"),books:[{attributes:{...o,displayMode:"lightbox",lightboxTrigger:"button",lightboxText:(0,l.__)("Open the room guide","softicon-flipbook")}}]}]})(e.urls.demo),e),[e]);return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"))},[]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",{className:"alfb-lead"},(0,l.__)("These are real flipbooks, try them. Add one to any page with the Flipbook block.","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-demos"},s.map(e=>(0,t.createElement)("article",{key:e.key,className:"alfb-card alfb-demo"+(e.pro?" is-pro":"")},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,e.title,e.pro&&(0,t.createElement)(t.Fragment,null," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook")))),(0,t.createElement)("p",null,e.text)),(0,t.createElement)("div",{className:"alfb-demo-view"+(e.row?" is-row":"")},e.books.map((e,o)=>(0,t.createElement)(U,{key:o,book:e}))))),(!e.pro||e.locked)&&(0,t.createElement)(W,{unlock:e.locked?n:null})))};var R=Object.defineProperty,G=(e,t,o)=>((e,t,o)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o)(e,"symbol"!=typeof t?t+"":t,o);const j={Log(...e){console&&console.log&&console.log(...e)},Error(...e){console&&console.error&&console.error(...e)},Warn(...e){console&&console.warn&&console.warn(...e)},Debug(...e){console&&console.debug&&console.debug(...e)}},K=2147483647;function Y(e){return typeof e>"u"||"function"==typeof e||"object"==typeof e&&null!==e}function J(e){const t={};Object.entries(e).forEach(([e,o])=>{Y(o)||(t[e]=o)});const{sandbox:o}=e;return o&&o.ctx&&o.token&&(t.s_ctx_ts=o.ctx,t.sandbox=o.token),t}function Q(){return typeof window>"u"}function X(e,t){if(null==e)throw new Error(t)}class Z{constructor(e){G(this,"styleElement"),G(this,"bodyScrollDisableClassName"),G(this,"isFlashingBrowser"),G(this,"overflow",{x:0,y:0}),G(this,"metaColorSchemeValue",null),G(this,"metaColorSchemeElement",null),this.guid=e,this.bodyScrollDisableClassName=`is-fs-checkout-open-${this.guid}`,this.styleElement=document.createElement("style"),this.styleElement.textContent+=this.getBasicStyle(),this.isFlashingBrowser=function(){let e=!1;try{const t=navigator.userAgent.toLowerCase();/edge\/|trident\/|msie /.test(t)?e=!0:-1!==t.indexOf("safari")&&(t.indexOf("chrome")>-1||(e=!0))}catch{}return e}()||!Q()&&!!document.querySelector("#___gatsby"),this.metaColorSchemeElement=document.head.querySelector('meta[name="color-scheme"]')}addStyle(e){this.styleElement.textContent+=e}attach(){return document.head.appendChild(this.styleElement),this}remove(){return document.head.contains(this.styleElement)&&document.head.removeChild(this.styleElement),this}disableBodyScroll(){this.backupScrollPosition(),document.body.classList.add(this.bodyScrollDisableClassName)}enableBodyScroll(){document.body.classList.remove(this.bodyScrollDisableClassName),this.restoreScrollPosition()}disableMetaColorScheme(){this.metaColorSchemeElement&&(this.metaColorSchemeValue=this.metaColorSchemeElement.getAttribute("content"),this.metaColorSchemeElement.setAttribute("content","light"))}enableMetaColorScheme(){this.metaColorSchemeElement&&this.metaColorSchemeValue&&(this.metaColorSchemeElement.setAttribute("content",this.metaColorSchemeValue),this.metaColorSchemeValue=null)}getBasicStyle(){return`body.${this.bodyScrollDisableClassName} { overflow: hidden !important; }`}backupScrollPosition(){this.overflow={x:document.documentElement.scrollTop,y:document.documentElement.scrollLeft}}restoreScrollPosition(){document.documentElement.scrollTop=this.overflow.x,document.documentElement.scrollLeft=this.overflow.y}}const ee=class e{constructor(e,t,o="Loading Freemius Checkout"){G(this,"loaderElement"),G(this,"isOpen",!1),G(this,"loaderElementId"),this.style=e,this.loaderElementId=`fs-loader-${this.style.guid}`,this.loaderElement=document.createElement("div"),this.loaderElement.id=this.loaderElementId,this.loaderElement.innerHTML=`<img src="${t}" alt="${o}" />`,this.style.addStyle(this.getStyle())}show(){return this.isOpen||(this.loaderElement.classList.add("show"),document.body.appendChild(this.loaderElement),this.isOpen=!0),this}hide(){return this.isOpen?(this.loaderElement.classList.remove("show"),this.isOpen=!1,setTimeout(()=>{this.hideImmediate()},e.TRANSITION_TIME),this):this}hideImmediate(){return this.loaderElement.parentNode&&(this.loaderElement.classList.remove("show"),this.loaderElement.parentNode.removeChild(this.loaderElement),this.isOpen=!1),this}getStyle(){return`#${this.loaderElementId} { display: none; position: fixed; z-index: ${K-1}; width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; text-align: left; background: rgba(0, 0, 0, 0.6); transition: opacity ${e.TRANSITION_TIME}ms ease-out; will-change: opacity; opacity: 0; } #${this.loaderElementId}.show { opacity: 1; display: block; } #${this.loaderElementId} img { position: absolute; top: 40%; left: 50%; width: auto; height: auto; margin-left: -25px; background: #fff; padding: 10px; border-radius: 50%; box-shadow: 2px 2px 2px rgba(0,0,0,0.1); }`}};G(ee,"TRANSITION_TIME",200);let te=ee;const oe=class e{constructor(e,t,o,a,l){G(this,"postman",null),G(this,"iFrame"),G(this,"iFrameWrapper"),G(this,"loadedEventListeners",new Set),G(this,"closedEventListeners",new Set),this.baseUrl=e,this.visibleClass=a,this.checkoutOptions=l;const{iFrame:n,iFrameWrapper:s}=this.attachIFrame(e,t,o);this.iFrame=n,this.iFrameWrapper=s,this.addEventListeners()}static getWrapperID(e){return`${e}-wrapper`}close(){this.postman?.post("close",null)}onClosed(e){this.closedEventListeners.add(e)}onLoaded(e){this.loadedEventListeners.add(e)}addToExitIntent(e){e.addListener(()=>{this.postman?.post("exit_intent",null),this.checkoutOptions.onExitIntent?.()})}attachIFrame(t,o,a){const l=`${t}/?${function(e){const t=[];return Object.keys(e).forEach(o=>{const a=function(e){return Y(e)?null:null===e?"null":!0===e?"1":!1===e?"0":encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}(e[o]);null!==a&&t.push(`${o}=${a}`)}),t.join("&")}(o)}#${encodeURIComponent(document.location.href)}`,n=document.createElement("iframe");n.id=a,n.src=l,n.setAttribute("allowTransparency","true"),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("style","background: rgba(0,0,0,0.003); border: 0 none transparent;"),n.setAttribute("frameborder","0"),n.setAttribute("data-testid",n.id);const s=this.checkoutOptions.modal_title??e.DEFAULT_TITLE;n.setAttribute("title",s);const i=document.createElement("div");return i.setAttribute("role","dialog"),i.setAttribute("aria-label",s),i.setAttribute("aria-modal","true"),i.setAttribute("data-testid",`${n.id}-wrapper`),i.id=e.getWrapperID(a),i.appendChild(n),document.body.appendChild(i),{iFrame:n,iFrameWrapper:i}}addEventListeners(){const{success:e,purchaseCompleted:t,cancel:o,track:a,afterOpen:l,afterClose:n}=this.checkoutOptions;this.postman=function(e,t){const o=e.contentWindow,a=e.src,l={};if(!o||!a)return null;const n=function(e){if(!(e&&e.origin&&e.origin.indexOf("js.stripe.com")>0||e.origin.indexOf("www.paypal.com")>0)&&e.origin===t&&e&&e.data&&"string"==typeof e.data&&"{"===e.data.charAt(0))try{const t=JSON.parse(e.data);"object"==typeof t&&t.type&&l[t.type]&&l[t.type].forEach(e=>{e(t.data)})}catch(e){j.Error(e)}};return window.addEventListener("message",n),{on(e,t){l[e]||(l[e]=[]),l[e].push(t)},one(e,t,o=!1){o&&delete l[e],!l[e]&&this.on(e,t)},destroy(){window.removeEventListener("message",n)},post(e,t){o.postMessage(JSON.stringify({type:e,data:t}),a.replace(/([^:]+:\/\/[^/]+).*/,"$1"))}}}(this.iFrame,this.baseUrl),this.postman?.one("upgraded",t=>{try{e?.(t)}catch(e){j.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.one("purchaseCompleted",e=>{try{t?.(e)}catch(e){j.Error(e)}},!0),this.postman?.one("canceled",()=>{try{o?.()}catch(e){j.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.on("track",e=>{try{a?.(e.event,e)}catch(e){j.Error(e)}}),this.postman?.one("loaded",()=>{this.dispatchOnLoaded(),this.iFrame?.classList.add(this.visibleClass);try{l?.()}catch(e){j.Error(e)}},!0)}removeIFrameAndPostman(){this.postman?.destroy(),this.postman=null,this.iFrame.remove(),this.iFrameWrapper.remove(),this.closedEventListeners.clear(),this.loadedEventListeners.clear()}dispatchOnLoaded(){this.loadedEventListeners.forEach(e=>e())}dispatchOnClosed(){this.closedEventListeners.forEach(e=>e())}};G(oe,"DEFAULT_TITLE","Checkout");let ae=oe;const le=class e{constructor(e,t,o){G(this,"iFrameID"),this.style=e,this.options=t,this.baseUrl=o,this.iFrameID=`fs-checkout-page-${this.style.guid}`}create(t){const o={...this.options,...t};return new ae(this.baseUrl,this.getQueryParams(o),this.iFrameID,e.VISIBLE_CLASS,o)}addStyle(){this.style.addStyle(this.getStyle())}getQueryParams(e){return{mode:"dialog",guid:this.style.guid,_fs_checkout:!0,...J(e)}}getStyle(){return`#${this.iFrameID} { z-index: ${K-1}; background: rgba(0,0,0,0.003); border: 0 none transparent; visibility: ${this.style.isFlashingBrowser?"hidden":"visible"}; margin: 0; padding: 0; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; -webkit-tap-highlight-color: transparent; overflow: hidden; } #${this.iFrameID}.${e.VISIBLE_CLASS} { visibility: visible; } #${ae.getWrapperID(this.iFrameID)} { z-index: ${K-1}; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; overflow: hidden; }`}};G(le,"VISIBLE_CLASS","show");let ne=le;class se{constructor(e,t,o,a,l){G(this,"checkoutIFrameBuilder"),G(this,"checkoutIFrame",null),G(this,"lastFocusedElement",null),this.style=e,this.exitIntent=t,this.loader=o,this.checkoutIFrameBuilder=new ne(this.style,l,a),this.checkoutIFrameBuilder.addStyle()}isOpen(){return null!==this.checkoutIFrame}open(e){return this.isOpen()||(this.backupFocusedElement(),this.style.attach(),this.style.disableBodyScroll(),this.style.disableMetaColorScheme(),this.loader.show(),this.exitIntent.attach(),this.checkoutIFrame=this.checkoutIFrameBuilder.create(e),this.checkoutIFrame.onLoaded(this.onLoaded.bind(this)),this.checkoutIFrame.onClosed(this.onClosed.bind(this)),this.checkoutIFrame.addToExitIntent(this.exitIntent)),this}close(){return this.checkoutIFrame?.close(),this.loader.hideImmediate(),this}onLoaded(){this.loader.hide()}onClosed(){this.checkoutIFrame=null,this.loader.hide(),this.style.enableBodyScroll(),this.style.enableMetaColorScheme(),this.exitIntent.detach(),this.restoreFocusedElement(),this.style.remove()}backupFocusedElement(){this.lastFocusedElement=document.activeElement??null}restoreFocusedElement(){this.lastFocusedElement&&(this.lastFocusedElement.focus?.(),this.lastFocusedElement=null)}}class ie{constructor(e){G(this,"exitIntentId"),G(this,"exitIntentDiv",null),G(this,"clearExitIntentListener",null),G(this,"listeners",[]),this.style=e,this.exitIntentId=`fs-exit-intent-${this.style.guid}`,this.style.addStyle(this.getStyle())}isAttached(){return null!==this.exitIntentDiv}addListener(...e){this.listeners.push(...e)}attach(...e){if(e&&this.addListener(...e),this.isAttached())return this;this.exitIntentDiv=document.createElement("div"),this.exitIntentDiv.id=this.exitIntentId,document.body.appendChild(this.exitIntentDiv);const t=document.documentElement;let o=null;const a=e=>{e.pageY<=20&&(o=window.setTimeout(()=>{try{this.fireListeners()}catch(e){j.Error(e)}},300))},l=()=>{o&&(clearTimeout(o),o=null)};return t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",l),this.clearExitIntentListener=()=>{o&&(clearTimeout(o),o=null),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",l)},this}detach(){return this.isAttached()?(this.exitIntentDiv?.remove(),this.exitIntentDiv=null,this.clearExitIntentListener?.(),this):this}fireListeners(){this.listeners.forEach(e=>{e()})}getStyle(){return`#${this.exitIntentId} { z-index: ${K}; border: 0; background: transparent; position: fixed; padding: 0; margin: 0; height: 10px; left: 0; right: 0; width: 100%; top: 0; }`}}const re=class e{constructor(e){G(this,"queryParams",null),this.url=e,this.queryParams=this.parseQueryStringForCart()}hasCart(){return null!==this.queryParams}getPluginID(){return X(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_id}getPluginPublicKey(){return X(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_public_key}matchesPluginID(e){const t=Number.parseInt(this.getPluginID(),10),o=Number.parseInt(e.toString(),10);return Number.isFinite(t)&&Number.isFinite(o)&&t===o}getCheckoutOptions(){X(this.queryParams,e.NO_CART_FOUND_MESSAGE);const t={plugin_id:"",public_key:""};return Object.entries(this.queryParams).forEach(([e,o])=>{"__fs_plugin_id"===e?t.plugin_id=o:"__fs_plugin_public_key"===e?t.public_key=o:t[e]=o}),t}parseQueryStringForCart(){const e=new URLSearchParams(this.url.search);if(!e.has("__fs_authorization"))return null;const t={};return e.forEach((e,o)=>{o.startsWith("__fs_")&&(t[o]=e)}),t}};G(re,"NO_CART_FOUND_MESSAGE","No cart was found");let ce=re;const pe="https://checkout.freemius.com";class de{constructor(e,t=!0,o=null){G(this,"options",{plugin_id:0,public_key:""}),G(this,"guid"),G(this,"baseUrl"),G(this,"style"),G(this,"loader"),G(this,"checkoutPopup"),G(this,"exitIntent"),G(this,"cart"),this.baseUrl=o??pe;const{plugin_id:a,product_id:l,public_key:n,loadingImageAlt:s,loadingImageUrl:i,...r}=e;if(!a&&!l)throw new Error("Must provide a product_id to options.");this.options={...r,public_key:n,plugin_id:l??a},this.guid=function(){const e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}(),!Q()&&(this.baseUrl=o??(window.FS?.__FS__IS_TEST__?"http://checkout.freemius-local.com:8080":pe),this.style=new Z(this.guid),this.loader=new te(this.style,i??`${this.baseUrl}/assets/img/spinner.svg`,s),this.exitIntent=new ie(this.style),this.checkoutPopup=new se(this.style,this.exitIntent,this.loader,this.baseUrl,this.options),this.cart=new ce(new URL(window.location.href)),t&&this.recoverCart())}async open(e){if(!Q()){if(this.checkoutPopup?.isOpen())return void j.Warn("Checkout popup already open. Please close it first before opening it again.");if(!document.body)return new Promise(t=>{document.addEventListener("DOMContentLoaded",()=>{this.checkoutPopup?.open(e),t()},{once:!0})});this.checkoutPopup?.open(e)}}close(){Q()||this.checkoutPopup?.close()}destroy(){Q()||this.close()}getGuid(){return this.guid}recoverCart(){if(this.cart?.hasCart()&&this.cart?.matchesPluginID(this.options.plugin_id)){const e=this.cart.getCheckoutOptions();this.open(e)}}}const me=({error:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-status",role:e?"alert":"status"},e?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"dashicons dashicons-warning","aria-hidden":"true"}),e):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"spinner is-active"}),(0,l.__)("Loading…","softicon-flipbook"))),fe={usd:"$",eur:"€",gbp:"£",aud:"A$",cad:"C$"},he="support@softiconai.com",be=(0,t.createElement)("a",{href:"mailto:"+he}),ue=({days:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-guarantee"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.__)("Try Pro without risk","softicon-flipbook")),(0,t.createElement)("p",null,e>0
    4 /* translators: %d: number of days */?(0,l.sprintf)((0,l.__)("If Pro is not right for you, tell us within %d days and you get all your money back, no questions asked.","softicon-flipbook"),e):(0,l.__)("If Pro is not right for you, tell us and we will make it right.","softicon-flipbook")),(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Any problem or question? Email us at %s, a real person from our team will help you.","softicon-flipbook"),"<a>"+he+"</a>"),{a:be})),(0,t.createElement)("p",{className:"alfb-guarantee-why"},(0,l.__)("We build SoftIcon Flipbook for the people who use it, and your satisfaction comes first.","softicon-flipbook")))),ke=({days:e})=>(0,t.createElement)("p",{className:"alfb-note alfb-promise"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),e>0&&(0,l.sprintf)((0,l.__)("%d-day money-back guarantee","softicon-flipbook"),e)+" · ",(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Questions? %s","softicon-flipbook"),"<a>"+he+"</a>"),{a:be})),_e=({price:e})=>(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,fe[e.currency]||e.currency.toUpperCase()+" "),e.price.toLocaleString(void 0,{minimumFractionDigits:Number.isInteger(e.price)?0:2,maximumFractionDigits:2}),(0,t.createElement)("span",null,{lifetime:(0,l.__)("one-time","softicon-flipbook"),annual:(0,l.__)("per year","softicon-flipbook"),monthly:(0,l.__)("per month","softicon-flipbook")}[e.cycle])),Ee=e=>"unlimited"===e?(0,l.__)("Unlimited websites","softicon-flipbook")
    5 /* translators: %d: number of websites */:(0,l.sprintf)((0,l._n)("%d website","%d websites",e,"softicon-flipbook"),e),ye=({checkout:e,plan:o,price:a,className:n})=>{const s=`${e.base}?plan_id=${o.id}&licenses=${a.licenses}&billing_cycle=${a.cycle}`;return(0,t.createElement)("a",{className:"alfb-btn alfb-btn-block "+n,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new de({product_id:e.product,plan_id:o.id,public_key:e.key}).open({licenses:a.licenses,billing_cycle:a.cycle})}catch(e){window.open(s,"_blank","noopener")}}}},(0,l.__)("Get Pro","softicon-flipbook")," →")},ge=({checkout:e,plan:o,className:a,children:l})=>{const n=o.trial_card?"paid":"free",s=`${e.base}?plan_id=${o.id}&trial=${n}`;return(0,t.createElement)("a",{className:a,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new de({product_id:e.product,plan_id:o.id,public_key:e.key}).open({trial:n})}catch(e){window.open(s,"_blank","noopener")}}}},l)},we=e=>(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
    6 (0,l._n)("Start %d-day free trial","Start %d-day free trial",e.trial,"softicon-flipbook"),e.trial),ve=({checkout:e,plan:o})=>(0,t.createElement)("div",{className:"alfb-card alfb-trial"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
    7 (0,l._n)("Try Pro free for %d day","Try Pro free for %d days",o.trial,"softicon-flipbook"),o.trial)),(0,t.createElement)("p",null,o.trial_card?(0,l.__)("Every Pro feature on one website. Cancel before the trial ends and you pay nothing.","softicon-flipbook"):(0,l.__)("Every Pro feature on one website, no card needed. When the trial ends, pick a plan or keep using the free plugin.","softicon-flipbook"))),(0,t.createElement)(ge,{checkout:e,plan:o,className:"alfb-btn alfb-btn-amber"},we(o)," →")),Ne=({data:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-no-plans"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("p",null,e.error?(0,l.__)("The Pro plans could not be loaded right now. Please try again later.","softicon-flipbook"):(0,l.__)("SoftIcon Flipbook Pro is coming soon.","softicon-flipbook"))),Se=({eyebrow:e,title:o,children:a})=>(0,t.createElement)("div",{className:"alfb-intro"},(0,t.createElement)("span",{className:"alfb-eyebrow"},e),(0,t.createElement)("h2",null,o),a),xe=()=>M("/alfb/v1/dashboard/plans"),Ce=({play:e})=>(0,t.createElement)("p",null,(0,t.createElement)(u,{url:g.pro,title:(0,l.__)("Every Pro feature in one minute","softicon-flipbook"),play:e},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"})," ",(0,l.__)("Watch every Pro feature in one minute","softicon-flipbook"))),Fe=({play:e})=>{const{data:o,error:a,loading:n}=xe();if(n||a)return(0,t.createElement)(me,{error:a});const s=o.pro,i=s&&"lifetime"===s.prices[0].cycle;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se,{eyebrow:(0,l.__)("Pricing","softicon-flipbook"),title:i?(0,l.__)("Pay once, use it for life","softicon-flipbook"):(0,l.__)("Pick your plan","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every plan has all Pro features; pick how many websites you need.","softicon-flipbook")),(0,t.createElement)(Ce,{play:e})),s&&s.trial>0&&o.checkout&&(0,t.createElement)(ve,{checkout:o.checkout,plan:s}),s?(0,t.createElement)("div",{className:"alfb-plans alfb-plans-3"},s.prices.map(e=>(0,t.createElement)("div",{className:"alfb-plan",key:e.licenses},(0,t.createElement)("span",{className:"alfb-tag"},Ee(e.licenses)),(0,t.createElement)("h3",null,s.title),(0,t.createElement)(_e,{price:e}),(0,t.createElement)(ye,{checkout:o.checkout,plan:s,price:e,className:"alfb-btn-teal"}),(0,t.createElement)("ul",{className:"alfb-checks"},(0,t.createElement)("li",null,Ee(e.licenses)),(0,t.createElement)("li",null,(0,l.__)("Every free feature","softicon-flipbook")),o.pro_only.map(e=>(0,t.createElement)("li",{key:e.title},e.title)))))):(0,t.createElement)(Ne,{data:o}),s&&(0,t.createElement)(ue,{days:o.money_back}),(0,t.createElement)("p",{className:"alfb-note"},(0,l.__)("Secure checkout by Freemius. Pro replaces the free plugin and keeps every book you made.","softicon-flipbook")," ",(0,t.createElement)("a",{href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook"))))},Pe=({yes:e})=>(0,t.createElement)("span",{className:"alfb-mark "+(e?"is-yes":"is-no")},(0,t.createElement)("span",{className:"dashicons "+(e?"dashicons-yes":"dashicons-no-alt"),"aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},e?(0,l.__)("Included","softicon-flipbook"):(0,l.__)("Not included","softicon-flipbook"))),Ie=({play:e})=>{const{data:a,error:n,loading:s}=xe(),[i,r]=(0,o.useState)("");if(s||n)return(0,t.createElement)(me,{error:n});const c=a.pro,p=i.trim().toLowerCase(),d=[[(0,l.__)("In Free and Pro","softicon-flipbook"),a.free,!0],[(0,l.__)("Only in Pro","softicon-flipbook"),a.pro_only,!1]].map(([e,t,o])=>[e,t.filter(t=>!p||e.toLowerCase().includes(p)||(t.title+" "+t.text).toLowerCase().includes(p)),o]).filter(([,e])=>e.length),m=a.free.length>0||a.pro_only.length>0;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Se,{eyebrow:(0,l.__)("Compare","softicon-flipbook"),title:(0,l.__)("Free vs Pro at a glance","softicon-flipbook")},a.pro_only.length>0&&(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("See what you get when you upgrade. %s features are only in Pro.","softicon-flipbook"),"<strong>"+a.pro_only.length.toLocaleString()+"</strong>"),{strong:(0,t.createElement)("strong",null)})),(0,t.createElement)(Ce,{play:e})),(0,t.createElement)("div",{className:"alfb-plans"},(0,t.createElement)("div",{className:"alfb-plan"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("h3",null,(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free forever, everything you need to put books on your site.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,"$"),"0",(0,t.createElement)("span",null,(0,l.__)("forever","softicon-flipbook"))),(0,t.createElement)("span",{className:"alfb-have"},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),(0,l.__)("You already have it","softicon-flipbook"))),c&&(0,t.createElement)("div",{className:"alfb-plan is-pro"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Pro","softicon-flipbook")),(0,t.createElement)("h3",null,c.title),c.text&&(0,t.createElement)("p",null,c.text),(0,t.createElement)(_e,{price:c.prices[0]}),(0,t.createElement)(ye,{checkout:a.checkout,plan:c,price:c.prices[0],className:"alfb-btn-light"}),c.trial>0&&(0,t.createElement)(ge,{checkout:a.checkout,plan:c,className:"alfb-more-plans alfb-trial-link"},we(c)),c.prices.length>1&&(0,t.createElement)("a",{className:"alfb-more-plans",href:"#/pricing"},(0,l.__)("Plans for more websites","softicon-flipbook")))),c&&(0,t.createElement)(ke,{days:a.money_back}),!c&&(0,t.createElement)(Ne,{data:a}),m&&(0,t.createElement)("section",{className:"alfb-breakdown"},(0,t.createElement)("header",null,(0,t.createElement)("h3",{id:"alfb-breakdown-title"},(0,l.__)("Feature breakdown","softicon-flipbook")),(0,t.createElement)("label",{className:"alfb-filter"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Filter features","softicon-flipbook")),(0,t.createElement)("input",{type:"search",placeholder:(0,l.__)("Filter features…","softicon-flipbook"),value:i,onChange:e=>r(e.target.value)}))),(0,t.createElement)("table",{className:"alfb-compare","aria-labelledby":"alfb-breakdown-title"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,l.__)("Feature","softicon-flipbook")),(0,t.createElement)("th",{scope:"col"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("th",{scope:"col",className:"is-pro"},(0,l.__)("Pro","softicon-flipbook")))),d.map(([e,o,a])=>(0,t.createElement)("tbody",{key:e},(0,t.createElement)("tr",{className:"alfb-group"},(0,t.createElement)("th",{scope:"rowgroup",colSpan:"3"},e)),o.map(e=>(0,t.createElement)("tr",{key:e.title},(0,t.createElement)("th",{scope:"row"},e.title,e.text&&(0,t.createElement)("small",null,e.text)),(0,t.createElement)("td",null,(0,t.createElement)(Pe,{yes:a})),(0,t.createElement)("td",null,(0,t.createElement)(Pe,{yes:!0})))))),!d.length&&(0,t.createElement)("tbody",{className:"alfb-empty"},(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"3"},(0,l.__)("No features match.","softicon-flipbook")))))))},Ae={target:"_blank",rel:"noopener noreferrer"},Le="https://softiconai.com/",Me="support@softiconai.com",Te=({config:e,play:a})=>{const[n,s]=(0,o.useState)(""),[i,r]=(0,o.useState)(0),[c,p]=(0,o.useState)(!1),d=e.pro&&!e.locked,m=(e=>[[(0,l.__)("Plugin","softicon-flipbook"),(e.pro?"SoftIcon Flipbook Pro ":"SoftIcon Flipbook ")+e.version+(e.pro&&e.locked?" ("+(0,l.__)("no license","softicon-flipbook")+")":"")],["WordPress",e.site?.wp||""],["PHP",e.site?.php||""],[(0,l.__)("Theme","softicon-flipbook"),e.site?.theme||""],[(0,l.__)("Browser","softicon-flipbook"),window.navigator.userAgent.replace(/^Mozilla\/5\.0 /,"")]])(e),f=n.trim().toLowerCase(),h=[{q:(0,l.__)("How do I add a flipbook?","softicon-flipbook"),a:(0,l.__)("Edit a page, open the block inserter, search for Flipbook and add the block. Pick a PDF from your Media Library or upload one, and the book appears right away.","softicon-flipbook"),video:g.add},{q:(0,l.__)("Does it work with the Classic Editor, Elementor or other page builders?","softicon-flipbook"),a:(0,l.__)('Yes. Go to Flipbook → All Flipbooks, add a flipbook, set it up and publish it. The list shows its shortcode, such as [softicon_flipbook id="123"]; paste it where the flipbook should be.',"softicon-flipbook"),video:g.shortcode},{q:(0,l.__)("My PDF from another website does not load","softicon-flipbook"),a:(0,l.__)("Browsers only read a PDF from another website when that site allows it (CORS). Upload the PDF to your Media Library and it always works.","softicon-flipbook")},{q:(0,l.__)("Can the flipbook open in a popup?","softicon-flipbook"),a:(0,l.__)("Yes. Select the flipbook, open the Style tab and turn on Open in a lightbox under Display. A cover, a button or a text link shows on the page, and a click opens the book.","softicon-flipbook"),video:g.lightbox},{q:(0,l.__)("How do I link to a page of the book?","softicon-flipbook"),a:(0,l.__)('Add #page= and the number to the page address, for example example.com/catalog/#page=12. Links like <a href="#page=8"> on the same page turn the book there.',"softicon-flipbook"),video:g.reading},{q:(0,l.__)("How do I hide the download button?","softicon-flipbook"),a:(0,l.__)("Select the flipbook and turn off Download button in the Toolbar panel of the General tab.","softicon-flipbook")},{q:(0,l.__)("Does it work with caching and minify plugins?","softicon-flipbook"),a:(0,l.__)("Yes. The block tells its script where the plugin's files are, so combining or moving scripts does not break the flipbook. After an update, clear your cache once.","softicon-flipbook")},{q:(0,l.__)("Does it slow down my pages?","softicon-flipbook"),a:(0,l.__)("The page gets a 35 KB script (12 KB compressed). The PDF engine loads only when a flipbook comes near the screen, or when a lightbox is opened.","softicon-flipbook")}].filter(e=>!f||(e.q+" "+e.a).toLowerCase().includes(f)),b=[{icon:"tickets-alt",title:(0,l.__)("Open a support ticket","softicon-flipbook"),href:Le+"support/",main:!0,text:d?(0,l.__)("Use the email you bought Pro with, and the developers answer you.","softicon-flipbook"):(0,l.__)("Tell us what happened; the people who build the plugin answer.","softicon-flipbook"),cta:(0,l.__)("Write to us","softicon-flipbook")},{icon:"book",title:(0,l.__)("Documentation","softicon-flipbook"),href:Le+"docs/flipbook/",text:(0,l.__)("Guides for every setting, step by step.","softicon-flipbook"),cta:(0,l.__)("Read the docs","softicon-flipbook")},{icon:"video-alt3",title:(0,l.__)("Video tutorials","softicon-flipbook"),video:!0,text:(0,l.__)("Short videos, most under a minute.","softicon-flipbook"),cta:(0,l.__)("Watch here","softicon-flipbook")},{icon:"groups",title:(0,l.__)("Community forum","softicon-flipbook"),href:"https://wordpress.org/support/plugin/softicon-flipbook/",text:(0,l.__)("Ask in public on WordPress.org, and search past answers.","softicon-flipbook"),cta:(0,l.__)("Visit the forum","softicon-flipbook")}],k=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"alfb-hp-icon dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("strong",null,e.title,e.main&&(0,t.createElement)("em",null,(0,l.__)("Fastest","softicon-flipbook"))),(0,t.createElement)("small",null,e.text),(0,t.createElement)("b",null,e.cta," ",!e.video&&(0,t.createElement)("span",{"aria-hidden":"true"},"↗")));return(0,t.createElement)("div",{className:"alfb-hp"},(0,t.createElement)("header",{className:"alfb-hp-hero"},(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-hp-eyebrow"},(0,l.__)("Support","softicon-flipbook")),(0,t.createElement)("h2",null,(0,l.__)("How can we help?","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free or Pro, a real person reads every message: the developers who build SoftIcon Flipbook.","softicon-flipbook"))),(0,t.createElement)("label",{className:"alfb-hp-search"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("input",{type:"search",value:n,onChange:e=>{s(e.target.value),r(0)},placeholder:(0,l.__)("Search the answers","softicon-flipbook"),"aria-label":(0,l.__)("Search the answers","softicon-flipbook")}))),(0,t.createElement)("div",{className:"alfb-hp-ways"},b.map(o=>o.video?(0,t.createElement)(u,{key:o.title,className:"alfb-hp-way",url:e.urls.playlist,title:o.title,play:a},k(o)):(0,t.createElement)("a",{key:o.title,className:"alfb-hp-way"+(o.main?" is-main":""),href:o.href,...Ae},k(o)))),(0,t.createElement)("div",{className:"alfb-hp-body"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Quick answers","softicon-flipbook")),(0,t.createElement)("span",null,f?(0,l.sprintf)(/* translators: %d: the number of answers that match the search */ /* translators: %d: the number of answers that match the search */
    8 (0,l.__)("%d found","softicon-flipbook"),h.length):(0,l.__)("The questions people ask most","softicon-flipbook"))),h.map((e,o)=>(0,t.createElement)("div",{className:"alfb-hp-qa"+(i===o?" is-open":""),key:e.q},(0,t.createElement)("button",{type:"button","aria-expanded":i===o,onClick:()=>r(i===o?-1:o)},(0,t.createElement)("span",null,e.q),(0,t.createElement)("span",{className:"alfb-hp-chev dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})),i===o&&(0,t.createElement)("div",{className:"alfb-hp-answer"},(0,t.createElement)("p",null,e.a),e.video&&(0,t.createElement)(u,{url:e.video,title:e.q,play:a,className:"alfb-hp-watch"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch how","softicon-flipbook"))))),!h.length&&(0,t.createElement)("p",{className:"alfb-hp-none"},(0,l.__)("No quick answer for that.","softicon-flipbook")," ",(0,t.createElement)("a",{href:Le+"support/",...Ae},(0,l.__)("Ask us instead","softicon-flipbook")," ↗")),(0,t.createElement)("p",{className:"alfb-hp-more"},(0,t.createElement)("a",{href:"https://wordpress.org/plugins/softicon-flipbook/#faq",...Ae},(0,l.__)("All questions and answers","softicon-flipbook")," ↗"))),(0,t.createElement)("aside",{className:"alfb-hp-side"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Your site details","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"alfb-hp-copy"+(c?" is-done":""),onClick:()=>((e,t)=>{if(window.navigator.clipboard&&window.isSecureContext)return void window.navigator.clipboard.writeText(e).then(t);const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy")&&t(),o.remove()})(m.map(([e,t])=>e+": "+t).join("\n"),()=>{p(!0),setTimeout(()=>p(!1),1800)})},(0,t.createElement)("span",{className:"dashicons dashicons-"+(c?"yes":"clipboard"),"aria-hidden":"true"}),c?(0,l.__)("Copied","softicon-flipbook"):(0,l.__)("Copy","softicon-flipbook"))),(0,t.createElement)("dl",{className:"alfb-hp-details"},m.map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("dt",null,e),(0,t.createElement)("dd",{title:o},o)))),(0,t.createElement)("p",{className:"alfb-hp-note"},(0,l.__)("Paste these into your ticket with the address of the page and what you see. They are only copied, never sent.","softicon-flipbook"))),(0,t.createElement)("section",{className:"alfb-hp-panel alfb-hp-contact"},(0,t.createElement)("a",{href:"mailto:"+Me},(0,t.createElement)("span",{className:"dashicons dashicons-email-alt","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("small",null,Me))),d?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("a",{href:Le+"account/",...Ae},(0,t.createElement)("span",{className:"dashicons dashicons-admin-network","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Licenses and downloads","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("Your account","softicon-flipbook")))),(0,t.createElement)("a",{href:Le+"contact/",...Ae},(0,t.createElement)("span",{className:"dashicons dashicons-cart","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Sales and billing","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))):(0,t.createElement)("a",{href:"#/pricing"},(0,t.createElement)("span",{className:"dashicons dashicons-star-filled","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Pro plans","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))))),(0,t.createElement)("div",{className:"alfb-hp-love"},(0,t.createElement)("span",{className:"alfb-hp-stars","aria-hidden":"true"},"★★★★★"),(0,t.createElement)("div",null,(0,t.createElement)("strong",null,(0,l.__)("Enjoying SoftIcon Flipbook?","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("A review helps other people find it and keeps it free.","softicon-flipbook"))),(0,t.createElement)("a",{className:"alfb-hp-btn",href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",...Ae},(0,l.__)("Leave a review","softicon-flipbook")),(0,t.createElement)("a",{href:"https://wordpress.org/plugins/author/softiconai/",...Ae},(0,l.__)("More plugins","softicon-flipbook")),(0,t.createElement)("a",{href:"https://github.com/softiconai/softicon-flipbook",...Ae},(0,l.__)("Source on GitHub","softicon-flipbook"))))},De=({checked:e,onChange:o,label:a})=>(0,t.createElement)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":a,className:"alfb-try-switch"+(e?" is-on":""),onClick:()=>o(!e)},(0,t.createElement)("span",null)),Oe=({value:e,options:o,onChange:a,label:l})=>(0,t.createElement)("div",{className:"alfb-try-seg",role:"radiogroup","aria-label":l},o.map(([o,l])=>(0,t.createElement)("button",{type:"button",key:o,role:"radio","aria-checked":o===e,className:o===e?"is-on":"",onClick:()=>a(o)},l))),ze=["","#f6f7f7","#1f2937","#0f766e","#7a1f1f"],He={analytics:()=>{const[e,a]=(0,o.useState)(30),n=(0,o.useMemo)(()=>{const t=(o=e,()=>(o=(9301*o+49297)%233280)/233280);var o;const a=Array.from({length:e},(e,o)=>Math.round(18+40*t()+10*Math.sin(o/3))),l=a.reduce((e,t)=>e+t,0);return{bars:a,views:l,pages:Math.round(7.4*l),downloads:Math.round(.08*l),leads:Math.round(.03*l)}},[e]),s=Math.max(...n.bars),i=[[(0,l.__)("Spring catalog","softicon-flipbook"),.46],[(0,l.__)("Room guide","softicon-flipbook"),.31],[(0,l.__)("Price list","softicon-flipbook"),.23]];return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)(Oe,{label:(0,l.__)("Period","softicon-flipbook"),value:e,onChange:a,options:[[7,(0,l.__)("7 days","softicon-flipbook")],[30,(0,l.__)("30 days","softicon-flipbook")],[90,(0,l.__)("90 days","softicon-flipbook")]]})),(0,t.createElement)("div",{className:"alfb-try-stats"},[[(0,l.__)("Views","softicon-flipbook"),n.views],[(0,l.__)("Pages read","softicon-flipbook"),n.pages],[(0,l.__)("Pages per view","softicon-flipbook"),(n.pages/n.views).toFixed(1)],[(0,l.__)("Downloads","softicon-flipbook"),n.downloads],[(0,l.__)("Leads","softicon-flipbook"),n.leads]].map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("small",null,e),(0,t.createElement)("strong",null,Number(o).toLocaleString())))),(0,t.createElement)("div",{className:"alfb-try-chart","aria-label":(0,l.__)("Views per day","softicon-flipbook"),role:"img"},n.bars.map((e,o)=>(0,t.createElement)("i",{key:o,style:{height:e/s*100+"%"},title:String(e)}))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Views","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Pages read","softicon-flipbook")))),(0,t.createElement)("tbody",null,i.map(([e,o])=>(0,t.createElement)("tr",{key:e},(0,t.createElement)("td",null,e),(0,t.createElement)("td",null,Math.round(n.views*o).toLocaleString()),(0,t.createElement)("td",null,Math.round(n.pages*o).toLocaleString()))))))},leads:()=>{const[e,a]=(0,o.useState)(""),n=[["Amira Hassan","am***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("Today","softicon-flipbook")],["Jonas Weber","jo***@example.com",(0,l.__)("Room guide","softicon-flipbook"),5,(0,l.__)("Yesterday","softicon-flipbook")],["Priya Nair","pr***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("2 days ago","softicon-flipbook")],["Lucas Martin","lu***@example.com",(0,l.__)("Price list","softicon-flipbook"),2,(0,l.__)("3 days ago","softicon-flipbook")]].filter(t=>!e||t.join(" ").toLowerCase().includes(e.toLowerCase()));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)("input",{type:"search",className:"alfb-try-input",value:e,onChange:e=>a(e.target.value),placeholder:(0,l.__)("Search leads","softicon-flipbook"),"aria-label":(0,l.__)("Search leads","softicon-flipbook")}),(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Download CSV","softicon-flipbook"))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Name","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Asked at page","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("When","softicon-flipbook")))),(0,t.createElement)("tbody",null,n.map(e=>(0,t.createElement)("tr",{key:e[1]},e.map((e,o)=>(0,t.createElement)("td",{key:o},e)))))),!n.length&&(0,t.createElement)("p",{className:"alfb-try-empty"},(0,l.__)("No sample lead matches.","softicon-flipbook")))},defaults:({config:e})=>{const[a,n]=(0,o.useState)({showDownload:!0,showPrint:!1,showThumbnails:!0,showSearch:!0,showShare:!1,flipSound:!0,theme:"light",bgColor:"",bookStyle:"flat"}),s=(e,t)=>n(o=>({...o,[e]:t})),i={...a,sideArrows:"hardcover"===a.bookStyle,pdfUrl:e.urls.demo+"spring-catalog.pdf",maxHeight:380},r=JSON.stringify(a),c=(0,o.useRef)();return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"));const e=c.current?.querySelector("[data-alfb]");return()=>e?.alfb?.destroy?.()},[r]),(0,t.createElement)("div",{className:"alfb-try-split"},(0,t.createElement)("div",{className:"alfb-try-controls"},(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Toolbar on every book","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-chips"},[["showDownload","download",(0,l.__)("Download","softicon-flipbook")],["showPrint","printer",(0,l.__)("Print","softicon-flipbook")],["showThumbnails","grid-view",(0,l.__)("Thumbnails","softicon-flipbook")],["showSearch","search",(0,l.__)("Search","softicon-flipbook")],["showShare","share",(0,l.__)("Share","softicon-flipbook")],["flipSound","controls-volumeon",(0,l.__)("Sound","softicon-flipbook")]].map(([e,o,l])=>(0,t.createElement)("button",{type:"button",key:e,role:"switch","aria-checked":!!a[e],className:"alfb-try-chip"+(a[e]?" is-on":""),onClick:()=>s(e,!a[e])},(0,t.createElement)("span",{className:"dashicons dashicons-"+o,"aria-hidden":"true"}),l))),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Design","softicon-flipbook")),(0,t.createElement)(Oe,{label:(0,l.__)("Design","softicon-flipbook"),value:a.bookStyle,onChange:e=>s("bookStyle",e),options:[["flat",(0,l.__)("Classic","softicon-flipbook")],["hardcover",(0,l.__)("Hardcover","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Theme","softicon-flipbook")),(0,t.createElement)(Oe,{label:(0,l.__)("Theme","softicon-flipbook"),value:a.theme,onChange:e=>s("theme",e),options:[["light",(0,l.__)("Light","softicon-flipbook")],["dark",(0,l.__)("Dark","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Background","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-swatches"},ze.map(e=>(0,t.createElement)("button",{type:"button",key:e||"none",className:"alfb-try-swatch"+(e===a.bgColor?" is-on":"")+(e?"":" is-none"),style:e?{background:e}:void 0,onClick:()=>s("bgColor",e),"aria-label":e||(0,l.__)("Theme color","softicon-flipbook")})))),(0,t.createElement)("div",{className:"alfb-try-book",ref:c},(0,t.createElement)($,{key:r,attributes:i,config:z(i)})))},settings:()=>{const[e,a]=(0,o.useState)({analytics:!0,skipEditors:!0,leadEmail:!1}),n=[["analytics",(0,l.__)("Count opens and pages read","softicon-flipbook"),(0,l.__)("Reading analytics for every book. Nothing personal is stored and no cookies are set.","softicon-flipbook")],["skipEditors",(0,l.__)("Do not count logged-in editors","softicon-flipbook"),(0,l.__)("Your own visits while you work on the site are left out.","softicon-flipbook")],["leadEmail",(0,l.__)("Email me each new lead","softicon-flipbook"),(0,l.__)("Sent to the site admin email.","softicon-flipbook")]];return(0,t.createElement)(t.Fragment,null,n.map(([o,l,n])=>(0,t.createElement)("div",{className:"alfb-try-setting",key:o},(0,t.createElement)("div",null,(0,t.createElement)("strong",null,l),(0,t.createElement)("small",null,n)),(0,t.createElement)(De,{label:l,checked:e[o],onChange:t=>a({...e,[o]:t})}))),(0,t.createElement)("p",{className:"alfb-try-row"},(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Save settings","softicon-flipbook"))))}},Ve=({name:e,title:o,config:a})=>{const n=He[e];return(0,t.createElement)("section",{className:"alfb-try"},(0,t.createElement)("header",null,(0,t.createElement)("span",{className:"alfb-try-badge"},(0,t.createElement)("span",{className:"dashicons dashicons-visibility","aria-hidden":"true"}),(0,l.__)("Try it","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.sprintf)(/* translators: %s: the Pro feature, such as Reading analytics */ /* translators: %s: the Pro feature, such as Reading analytics */
    9 (0,l.__)("A working demo of %s with sample data. Click around; nothing is saved.","softicon-flipbook"),o))),(0,t.createElement)("div",{className:"alfb-try-body"},(0,t.createElement)(n,{config:a})))},$e=({name:e,config:o,play:a})=>{const n={analytics:{icon:"chart-bar",eyebrow:(0,l.__)("Insights","softicon-flipbook"),title:(0,l.__)("Reading analytics","softicon-flipbook"),text:(0,l.__)("See how many people open each book and how far they read.","softicon-flipbook"),video:g.analytics,points:[(0,l.__)("Views, pages read and downloads for every book","softicon-flipbook"),(0,l.__)("A chart per day, for 7, 30 or 90 days","softicon-flipbook"),(0,l.__)("No cookies and nothing personal stored","softicon-flipbook"),(0,l.__)("Download the numbers as a CSV file","softicon-flipbook")]},leads:{icon:"email-alt",eyebrow:(0,l.__)("Audience","softicon-flipbook"),title:(0,l.__)("Lead capture","softicon-flipbook"),text:(0,l.__)("Readers leave their email to keep reading after a few pages.","softicon-flipbook"),video:g.leads,points:[(0,l.__)("Choose after how many pages the form shows","softicon-flipbook"),(0,l.__)("Every lead saved on your own site","softicon-flipbook"),(0,l.__)("An email to you for each new lead","softicon-flipbook"),(0,l.__)("Download your leads as a CSV file","softicon-flipbook")]},defaults:{icon:"admin-appearance",eyebrow:(0,l.__)("Appearance","softicon-flipbook"),title:(0,l.__)("Site defaults","softicon-flipbook"),text:(0,l.__)("Set the toolbar, size, colors and more once, and every flipbook uses them. A book can still change any setting for itself.","softicon-flipbook"),video:g.settings,points:[(0,l.__)("Hide the download button on every book at once","softicon-flipbook"),(0,l.__)("Your brand colors and height on each new book","softicon-flipbook"),(0,l.__)("Right to left for every book on an Arabic, Hebrew or Urdu site","softicon-flipbook"),(0,l.__)("A live preview before you save","softicon-flipbook")]},settings:{icon:"admin-generic",eyebrow:(0,l.__)("Site","softicon-flipbook"),title:(0,l.__)("Settings","softicon-flipbook"),text:(0,l.__)("The site-wide switches for reading analytics and lead emails.","softicon-flipbook"),points:[(0,l.__)("Turn reading analytics on or off","softicon-flipbook"),(0,l.__)("Leave out your own visits while you work","softicon-flipbook"),(0,l.__)("Get an email for each new lead","softicon-flipbook")]}}[e];return(0,t.createElement)("div",{className:"alfb-pp-wrap"},(0,t.createElement)("div",{className:"alfb-pp"},(0,t.createElement)("header",{className:"alfb-pp-hero"},(0,t.createElement)("span",{className:"alfb-pp-icon dashicons dashicons-"+n.icon,"aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-pp-eyebrow"},n.eyebrow," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("h2",null,n.title),(0,t.createElement)("p",null,n.text))),(0,t.createElement)("div",{className:"alfb-pp-body"},(0,t.createElement)("ul",{className:"alfb-pp-points"},n.points.map(e=>(0,t.createElement)("li",{key:e},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),e))),(0,t.createElement)("div",{className:"alfb-pp-actions"},(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/pricing"},(0,l.__)("See Pro plans","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-pp-link",href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook")),n.video&&(0,t.createElement)(u,{url:n.video,title:n.title,play:a,className:"alfb-pp-link"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch it in action","softicon-flipbook"))))),(0,t.createElement)(Ve,{name:e,title:n.title,config:o}))},Be=()=>{const e=document.getElementById("alfb-dashboard"),l=window.alfbDashboard;if(!e||!l)return;const n=(0,a.applyFilters)("alfb.dashboard.tabs",{welcome:A,demos:q,...Object.fromEntries(["analytics","leads","defaults","settings"].map(e=>[e,o=>(0,t.createElement)($e,{name:e,...o})])),pricing:Fe,compare:Ie,help:Te},l);(0,o.createRoot)(e).render((0,t.createElement)(b,{config:l,tabs:n}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Be):Be()})();
     3(0,l._n)("See all %d flipbook","See all %d flipbooks",e.total,"softicon-flipbook"),e.total)),(0,t.createElement)("a",{href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))):(0,t.createElement)("div",{className:"alfb-start-empty"},(0,t.createElement)("p",null,(0,l.__)("No flipbooks yet. Make one and its shortcode shows up here, ready to copy.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")))),C=({url:e,title:o,play:a})=>(0,t.createElement)(u,{className:"alfb-start-video",url:e,title:o,play:a},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,t.createElement)("span",null,o)),P=({n:e,title:o,children:a,action:l})=>(0,t.createElement)("li",{className:"alfb-start-step"},(0,t.createElement)("span",{className:"alfb-step"},e),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,o),a,l)),F=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)(P,{n:1,title:(0,l.__)("Make the flipbook","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newBook},(0,l.__)("Add a flipbook","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Go to Flipbook → All Flipbooks → Add a flipbook. It opens with the Flipbook block: pick the PDF and the look, then publish.","softicon-flipbook"))),(0,t.createElement)(P,{n:2,title:(0,l.__)("Copy its shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every flipbook has a shortcode in the All Flipbooks list and in the block's Help panel. Your flipbooks are listed here too.","softicon-flipbook")))),I=({config:e,play:a})=>{const n={...e.start,newPage:e.urls.newPage,pro:e.pro},s=(e=>[{key:"block",icon:"block-default",label:(0,l.__)("Block editor","softicon-flipbook"),on:!e.classic,steps:(0,t.createElement)(t.Fragment,null,(0,t.createElement)(P,{n:1,title:(0,l.__)("Add the Flipbook block","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.newPage},(0,l.__)("Create a flipbook page","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In any page or post, click <b>+</b> and search for <b>Flipbook</b>, or type <code>/flipbook</code> in an empty line.","softicon-flipbook"),{b:(0,t.createElement)("strong",null),code:(0,t.createElement)("code",null)}))),(0,t.createElement)(P,{n:2,title:(0,l.__)("Pick a PDF or images","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Upload a PDF, choose one from the Media Library, paste a link, or build the book from your own images.","softicon-flipbook"))),(0,t.createElement)(P,{n:3,title:(0,l.__)("Choose the look and publish","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Classic or Hardcover, on the page or in a popup: every setting is in the block's sidebar, and the editor shows the finished book.","softicon-flipbook")))),video:[g.add,(0,l.__)("Add a flipbook in 36 seconds","softicon-flipbook")]},{key:"classic",icon:"editor-paste-text",label:(0,l.__)("Classic editor","softicon-flipbook"),on:e.classic,books:!0,steps:(0,t.createElement)(t.Fragment,null,F(e),(0,t.createElement)(P,{n:3,title:(0,l.__)("Paste it in the Classic Editor","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Paste the shortcode where the book goes, in the Visual or the Text tab, then update the page. It works in text widgets too.","softicon-flipbook")),(0,t.createElement)(S,{text:v(e.books[0]?.id||123),label:(0,l.__)("Copy the shortcode","softicon-flipbook")}))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]},{key:"builders",icon:"layout",label:(0,l.__)("Elementor & builders","softicon-flipbook"),on:e.elementor,books:!0,steps:(0,t.createElement)(t.Fragment,null,F(e),(0,t.createElement)(P,{n:3,title:(0,l.__)("Add a Shortcode widget","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("In <b>Elementor</b>, drag the <b>Shortcode</b> widget onto the page and paste the shortcode; the book shows in Elementor's preview too. Other builders work the same way:","softicon-flipbook"),{b:(0,t.createElement)("strong",null)})),(0,t.createElement)("ul",{className:"alfb-start-builders"},(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Divi")," – ",(0,l.__)("Code module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Beaver Builder")," – ",(0,l.__)("HTML or Text Editor module","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"WPBakery")," – ",(0,l.__)("Text Block","softicon-flipbook")),(0,t.createElement)("li",null,(0,t.createElement)("strong",null,"Bricks, Oxygen")," – ",(0,l.__)("Shortcode element","softicon-flipbook"))))),video:[g.shortcode,(0,l.__)("The shortcode in Elementor and more","softicon-flipbook")]},{key:"theme",icon:"editor-code",label:(0,l.__)("Theme / PHP","softicon-flipbook"),on:!1,books:!0,steps:(0,t.createElement)(t.Fragment,null,e.blockTheme&&(0,t.createElement)(P,{n:1,title:(0,l.__)("Block theme: add the block to a template","softicon-flipbook"),action:(0,t.createElement)("a",{className:"alfb-start-link",href:e.siteEditor},(0,l.__)("Open the Site Editor","softicon-flipbook")," →")},(0,t.createElement)("p",null,(0,l.__)("Your theme is a block theme. In Appearance → Editor → Templates, open a template and add the Flipbook block like on any page.","softicon-flipbook"))),(0,t.createElement)(P,{n:e.blockTheme?2:1,title:(0,l.__)("Any theme: print the shortcode","softicon-flipbook")},(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("Make the flipbook under All Flipbooks, then show it from a template file, such as <code>single.php</code>, with:","softicon-flipbook"),{code:(0,t.createElement)("code",null)})),(0,t.createElement)(S,{text:`<?php echo do_shortcode( '${v(e.books[0]?.id||123)}' ); ?>`,label:(0,l.__)("Copy the PHP code","softicon-flipbook")})),(0,t.createElement)(P,{n:e.blockTheme?3:2,title:(0,l.__)("One book for every post","softicon-flipbook")},e.pro?(0,t.createElement)("p",null,(0,l.__)('Keep each post\'s PDF in a Meta Box or ACF field, put one flipbook in the template, and turn on "PDF from a custom field" in its Source panel: every post shows its own book.',"softicon-flipbook")):(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.__)("With Pro, one flipbook in a template shows each post's own PDF from a Meta Box or ACF field. <a>See Pro</a>","softicon-flipbook"),{a:(0,t.createElement)("a",{href:"#/pricing"})})))),video:[g.shortcode,(0,l.__)("Where to paste the shortcode","softicon-flipbook")]}])(n),[i,r]=(0,o.useState)(()=>{const e=(()=>{try{return window.localStorage.getItem(w)}catch(e){return null}})();return s.some(t=>t.key===e)?e:n.classic?"classic":n.elementor?"builders":"block"}),c=e=>{r(e);try{window.localStorage.setItem(w,e)}catch(e){}},p=s.find(e=>e.key===i)||s[0];return(0,t.createElement)("section",{className:"alfb-start"},(0,t.createElement)("header",{className:"alfb-start-head"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Getting started","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Pick where you build your pages; the steps follow.","softicon-flipbook")))),(0,t.createElement)("div",{className:"alfb-start-tabs",role:"tablist","aria-label":(0,l.__)("Where you build your pages","softicon-flipbook"),onKeyDown:e=>{const t=s.findIndex(e=>e.key===i),o={ArrowRight:t+1,ArrowLeft:t-1,Home:0,End:s.length-1}[e.key];if(void 0===o)return;e.preventDefault();const a=s[(o+s.length)%s.length].key;c(a),e.currentTarget.querySelector(`[data-tab="${a}"]`)?.focus()}},s.map(e=>(0,t.createElement)("button",{key:e.key,type:"button",role:"tab",id:"alfb-start-tab-"+e.key,"data-tab":e.key,"aria-selected":e.key===i,"aria-controls":"alfb-start-panel",tabIndex:e.key===i?0:-1,className:e.key===i?"is-active":"",onClick:()=>c(e.key)},(0,t.createElement)("span",{className:"dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("span",null,e.label),e.on&&"block"!==e.key&&(0,t.createElement)("span",{className:"alfb-start-on"},(0,l.__)("On this site","softicon-flipbook"))))),(0,t.createElement)("div",{className:"alfb-start-body",role:"tabpanel",id:"alfb-start-panel","aria-labelledby":"alfb-start-tab-"+p.key},(0,t.createElement)("ol",{className:"alfb-start-steps"},p.steps),(0,t.createElement)("aside",{className:"alfb-start-side"},p.books?(0,t.createElement)(x,{start:n}):(0,t.createElement)("div",{className:"alfb-start-books"},(0,t.createElement)("h4",null,(0,l.__)("Fastest start","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("A new page opens with a sample book already in place; swap in your own PDF.","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-btn alfb-btn-teal",href:n.newPage},(0,l.__)("Create a flipbook","softicon-flipbook"))),(0,t.createElement)(C,{url:p.video[0],title:p.video[1],play:a}))))},A=(e,t)=>{const o=new URL(e,window.location.href);return o.searchParams.set("alfb_start",t),o.toString()},L=({config:e})=>{const{start:o,urls:a}=e,n=o.classic||o.elementor,s=[{key:"block",icon:"block-default",title:(0,l.__)("Block","softicon-flipbook"),text:(0,l.__)("Add the flipbook right inside a page or post, in the block editor.","softicon-flipbook"),action:(0,l.__)("Open a new page","softicon-flipbook"),href:A(a.newPage,"block"),fits:!n},{key:"shortcode",icon:"shortcode",title:(0,l.__)("Shortcode","softicon-flipbook"),text:(0,l.__)("Make the flipbook once, then paste its shortcode in the Classic Editor, Elementor or any page builder.","softicon-flipbook"),action:(0,l.__)("Make a flipbook","softicon-flipbook"),href:A(o.newBook,"shortcode"),fits:n}];return(0,t.createElement)("div",{className:"alfb-choice"},(0,t.createElement)("h3",null,(0,l.__)("How do you want to add your flipbook?","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-choice-cards"},s.map(e=>(0,t.createElement)("a",{key:e.key,className:"alfb-choice-card"+(e.fits?" is-fit":""),href:e.href},(0,t.createElement)("span",{className:"alfb-choice-icon dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("strong",null,e.title,e.fits&&(0,t.createElement)("span",{className:"alfb-choice-fit"},(0,l.__)("Fits this site","softicon-flipbook"))),(0,t.createElement)("span",{className:"alfb-choice-text"},e.text),(0,t.createElement)("span",{className:"alfb-choice-go"},e.action," →")))),(0,t.createElement)("p",{className:"alfb-choice-more"},(0,t.createElement)("a",{href:a.newPage},(0,l.__)("Or start from a sample book","softicon-flipbook")),(0,t.createElement)("a",{href:"#/demos"},(0,l.__)("See the demos","softicon-flipbook"))))},M=({config:e,play:o})=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("section",{className:"alfb-hero"},(0,t.createElement)("div",null,(0,t.createElement)("h2",null,(0,l.__)("Turn any PDF into a book people enjoy reading","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor.","softicon-flipbook")),(0,t.createElement)(L,{config:e})),(0,t.createElement)(u,{className:"alfb-hero-video",url:e.urls.playlist,title:(0,l.__)("Video tutorials","softicon-flipbook"),play:o},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch the video tutorials","softicon-flipbook"))),(0,t.createElement)(I,{config:e,play:o}),(0,t.createElement)("h2",{className:"alfb-title",id:"alfb-videos"},(0,l.__)("Video tutorials","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-grid alfb-videos"},e.videos.map(e=>(0,t.createElement)(u,{key:e.url,className:"alfb-card alfb-video",url:e.url,title:e.title,play:o},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"}),e.title)))),T={},D=e=>{const[t,a]=(0,o.useState)(()=>T[e]||{loading:!0});return(0,o.useEffect)(()=>{if(T[e])return;let t=!0;return s()({path:e}).then(e=>({data:e}),e=>({error:e.message||(0,l.__)("Something went wrong. Please try again.","softicon-flipbook")})).then(o=>{T[e]=o,t&&a(o)}),()=>{t=!1}},[e]),t},O=JSON.parse('{"attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}}}'),H=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],z=Object.fromEntries(Object.entries(O.attributes).map(([e,t])=>[e,t.default])),V=e=>(e=>{const{source:t,pdfUrl:o,images:a,pageMode:l,bookStyle:n,sideArrows:s,showCover:i,startPage:r,startWith:c,bookTitle:p,theme:d,autoplay:m,autoplaySeconds:f,autoplayLoop:h,rtl:b,phoneFullscreen:u,maxHeight:k,maxHeightTablet:_,maxHeightPhone:E,showDownload:y,showPrint:g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:C,showShare:P,flipSound:F}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?a:[],pageMode:["auto","double","single"].includes(l)?l:"auto",bookStyle:"hardcover"===n?"hardcover":"flat",sideArrows:!!s,showCover:i,startPage:Math.max(1,parseInt(r,10)||1),title:(p||"").trim(),startWith:["thumbnails","contents"].includes(c)?c:"book",theme:["dark","auto"].includes(d)?d:"light",autoplay:!!m,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==h,rtl:!!b,phoneFullscreen:!!u,maxHeight:Math.min(2e3,Math.max(200,parseInt(k,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(E,10)>0?Math.min(2e3,Math.max(200,parseInt(E,10))):0,showDownload:y,showPrint:!!g,showFullscreen:w,showZoom:v,showThumbnails:N,showContents:S,showLinks:x,showSearch:!1!==C,showShare:!!P,flipSound:F}})({...z,...e}),B=e=>{const t={};return[["bgColor","--alfb-bg"],["toolbarBg","--alfb-bar-bg"],["toolbarColor","--alfb-bar-color"],["coverColor","--alfb-cover"]].forEach(([o,a])=>{const l=(n="string"==typeof(n=e[o])?n.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(n)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(n)&&[...n.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>H.includes(e))?n:void 0);var n;l&&(t[a]=l)}),t},$={"alfb-block":""},U=(0,o.memo)(({attributes:e,config:o})=>(0,t.createElement)("div",{className:"alfb_wrapper wp-block-softicon-flipbook",...$,"data-alfb":JSON.stringify(o),style:B(e),tabIndex:"0",role:"region","aria-label":(0,l.__)("Flipbook","softicon-flipbook")},(0,t.createElement)("div",{className:"alfb_stage"},(0,t.createElement)("div",{className:"alfb_loading"},(0,t.createElement)("span",{className:"alfb_spinner"}))))),R=(0,o.memo)(({attributes:e,config:o})=>{const a={...z,...e},n=(a.lightboxText||"").trim(),s=n||(0,l.__)("Read the flipbook","softicon-flipbook"),i="cover"===a.lightboxTrigger,r={...B(a),...i?{"--alfb-lb-width":Math.min(600,Math.max(120,a.lightboxWidth))+"px"}:{}};return(0,t.createElement)("div",{className:"alfb_lb wp-block-softicon-flipbook alfb_lb_"+a.lightboxAlign+(i?" alfb_lb_draw":""),...$,"data-alfb":JSON.stringify(o),style:r},i?(0,t.createElement)("a",{className:"alfb_lb_trigger alfb_lb_cover",href:o.pdf,"aria-haspopup":"dialog","aria-label":n?void 0:s},(0,t.createElement)("span",{className:"alfb_lb_img"}),n&&(0,t.createElement)("span",{className:"alfb_lb_caption"},n)):(0,t.createElement)("a",{className:"alfb_lb_trigger "+("button"===a.lightboxTrigger?"alfb_lb_button wp-element-button":"alfb_lb_link"),href:o.pdf,"aria-haspopup":"dialog"},s))}),W=({book:e})=>{if(e.Component)return(0,t.createElement)(e.Component,{...e});const o=e.config||V(e.attributes);return"lightbox"===e.attributes?.displayMode?(0,t.createElement)(R,{attributes:e.attributes,config:o}):(0,t.createElement)(U,{attributes:e.attributes||{},config:o})},q=({unlock:e})=>{const{data:o}=D("/alfb/v1/dashboard/plans");return(o?.pro_only||[]).filter(e=>e.featured).map(o=>(0,t.createElement)("article",{key:o.title,className:"alfb-card alfb-demo is-pro"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,o.title," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("p",null,o.text)),(0,t.createElement)("div",{className:"alfb-demo-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})),(0,t.createElement)("footer",null,(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/compare",onClick:e?t=>{t.preventDefault(),e()}:void 0},(0,l.__)("Available in Pro","softicon-flipbook")))))},G=({config:e,unlock:n})=>{const s=(0,o.useMemo)(()=>(0,a.applyFilters)("alfb.dashboard.demos",(e=>{const t={pdfUrl:e+"spring-catalog.pdf",maxHeight:420},o={pdfUrl:e+"room-guide.pdf",maxHeight:420};return[{key:"classic",title:(0,l.__)("Classic book","softicon-flipbook"),text:(0,l.__)("The default look: two pages side by side, one page on phones, and the full toolbar.","softicon-flipbook"),books:[{attributes:t}]},{key:"hardcover",title:(0,l.__)("Hardcover","softicon-flipbook"),text:(0,l.__)("Pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows.","softicon-flipbook"),books:[{attributes:{...t,bookStyle:"hardcover",sideArrows:!0,coverColor:"#0f766e"}}]},{key:"guide",title:(0,l.__)("Chapters and links","softicon-flipbook"),text:(0,l.__)("A PDF with bookmarks gets a table of contents, and the links inside it can be clicked.","softicon-flipbook"),books:[{attributes:o}]},{key:"covers",row:!0,title:(0,l.__)("Covers that open a popup","softicon-flipbook"),text:(0,l.__)("Only the covers show on the page. A click opens the book over the page, and it loads only then.","softicon-flipbook"),books:[{attributes:{...t,displayMode:"lightbox",lightboxText:(0,l.__)("Spring Living 2026","softicon-flipbook"),lightboxWidth:170}},{attributes:{...o,displayMode:"lightbox",lightboxText:(0,l.__)("Room Guide 2026","softicon-flipbook"),lightboxWidth:170,bookStyle:"hardcover",sideArrows:!0}}]},{key:"button",title:(0,l.__)("A button that opens a popup","softicon-flipbook"),text:(0,l.__)("A theme-styled button, or a plain text link, opens the book in a popup.","softicon-flipbook"),books:[{attributes:{...o,displayMode:"lightbox",lightboxTrigger:"button",lightboxText:(0,l.__)("Open the room guide","softicon-flipbook")}}]}]})(e.urls.demo),e),[e]);return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"))},[]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)("p",{className:"alfb-lead"},(0,l.__)("These are real flipbooks, try them. Add one to any page with the Flipbook block.","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-demos"},s.map(e=>(0,t.createElement)("article",{key:e.key,className:"alfb-card alfb-demo"+(e.pro?" is-pro":"")},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,e.title,e.pro&&(0,t.createElement)(t.Fragment,null," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook")))),(0,t.createElement)("p",null,e.text)),(0,t.createElement)("div",{className:"alfb-demo-view"+(e.row?" is-row":"")},e.books.map((e,o)=>(0,t.createElement)(W,{key:o,book:e}))))),(!e.pro||e.locked)&&(0,t.createElement)(q,{unlock:e.locked?n:null})))};var j=Object.defineProperty,K=(e,t,o)=>((e,t,o)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o)(e,"symbol"!=typeof t?t+"":t,o);const Y={Log(...e){console&&console.log&&console.log(...e)},Error(...e){console&&console.error&&console.error(...e)},Warn(...e){console&&console.warn&&console.warn(...e)},Debug(...e){console&&console.debug&&console.debug(...e)}},J=2147483647;function Q(e){return typeof e>"u"||"function"==typeof e||"object"==typeof e&&null!==e}function X(e){const t={};Object.entries(e).forEach(([e,o])=>{Q(o)||(t[e]=o)});const{sandbox:o}=e;return o&&o.ctx&&o.token&&(t.s_ctx_ts=o.ctx,t.sandbox=o.token),t}function Z(){return typeof window>"u"}function ee(e,t){if(null==e)throw new Error(t)}class te{constructor(e){K(this,"styleElement"),K(this,"bodyScrollDisableClassName"),K(this,"isFlashingBrowser"),K(this,"overflow",{x:0,y:0}),K(this,"metaColorSchemeValue",null),K(this,"metaColorSchemeElement",null),this.guid=e,this.bodyScrollDisableClassName=`is-fs-checkout-open-${this.guid}`,this.styleElement=document.createElement("style"),this.styleElement.textContent+=this.getBasicStyle(),this.isFlashingBrowser=function(){let e=!1;try{const t=navigator.userAgent.toLowerCase();/edge\/|trident\/|msie /.test(t)?e=!0:-1!==t.indexOf("safari")&&(t.indexOf("chrome")>-1||(e=!0))}catch{}return e}()||!Z()&&!!document.querySelector("#___gatsby"),this.metaColorSchemeElement=document.head.querySelector('meta[name="color-scheme"]')}addStyle(e){this.styleElement.textContent+=e}attach(){return document.head.appendChild(this.styleElement),this}remove(){return document.head.contains(this.styleElement)&&document.head.removeChild(this.styleElement),this}disableBodyScroll(){this.backupScrollPosition(),document.body.classList.add(this.bodyScrollDisableClassName)}enableBodyScroll(){document.body.classList.remove(this.bodyScrollDisableClassName),this.restoreScrollPosition()}disableMetaColorScheme(){this.metaColorSchemeElement&&(this.metaColorSchemeValue=this.metaColorSchemeElement.getAttribute("content"),this.metaColorSchemeElement.setAttribute("content","light"))}enableMetaColorScheme(){this.metaColorSchemeElement&&this.metaColorSchemeValue&&(this.metaColorSchemeElement.setAttribute("content",this.metaColorSchemeValue),this.metaColorSchemeValue=null)}getBasicStyle(){return`body.${this.bodyScrollDisableClassName} { overflow: hidden !important; }`}backupScrollPosition(){this.overflow={x:document.documentElement.scrollTop,y:document.documentElement.scrollLeft}}restoreScrollPosition(){document.documentElement.scrollTop=this.overflow.x,document.documentElement.scrollLeft=this.overflow.y}}const oe=class e{constructor(e,t,o="Loading Freemius Checkout"){K(this,"loaderElement"),K(this,"isOpen",!1),K(this,"loaderElementId"),this.style=e,this.loaderElementId=`fs-loader-${this.style.guid}`,this.loaderElement=document.createElement("div"),this.loaderElement.id=this.loaderElementId,this.loaderElement.innerHTML=`<img src="${t}" alt="${o}" />`,this.style.addStyle(this.getStyle())}show(){return this.isOpen||(this.loaderElement.classList.add("show"),document.body.appendChild(this.loaderElement),this.isOpen=!0),this}hide(){return this.isOpen?(this.loaderElement.classList.remove("show"),this.isOpen=!1,setTimeout(()=>{this.hideImmediate()},e.TRANSITION_TIME),this):this}hideImmediate(){return this.loaderElement.parentNode&&(this.loaderElement.classList.remove("show"),this.loaderElement.parentNode.removeChild(this.loaderElement),this.isOpen=!1),this}getStyle(){return`#${this.loaderElementId} { display: none; position: fixed; z-index: ${J-1}; width: 100%; height: 100%; top: 0; left: 0; right: 0; bottom: 0; text-align: left; background: rgba(0, 0, 0, 0.6); transition: opacity ${e.TRANSITION_TIME}ms ease-out; will-change: opacity; opacity: 0; } #${this.loaderElementId}.show { opacity: 1; display: block; } #${this.loaderElementId} img { position: absolute; top: 40%; left: 50%; width: auto; height: auto; margin-left: -25px; background: #fff; padding: 10px; border-radius: 50%; box-shadow: 2px 2px 2px rgba(0,0,0,0.1); }`}};K(oe,"TRANSITION_TIME",200);let ae=oe;const le=class e{constructor(e,t,o,a,l){K(this,"postman",null),K(this,"iFrame"),K(this,"iFrameWrapper"),K(this,"loadedEventListeners",new Set),K(this,"closedEventListeners",new Set),this.baseUrl=e,this.visibleClass=a,this.checkoutOptions=l;const{iFrame:n,iFrameWrapper:s}=this.attachIFrame(e,t,o);this.iFrame=n,this.iFrameWrapper=s,this.addEventListeners()}static getWrapperID(e){return`${e}-wrapper`}close(){this.postman?.post("close",null)}onClosed(e){this.closedEventListeners.add(e)}onLoaded(e){this.loadedEventListeners.add(e)}addToExitIntent(e){e.addListener(()=>{this.postman?.post("exit_intent",null),this.checkoutOptions.onExitIntent?.()})}attachIFrame(t,o,a){const l=`${t}/?${function(e){const t=[];return Object.keys(e).forEach(o=>{const a=function(e){return Q(e)?null:null===e?"null":!0===e?"1":!1===e?"0":encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}(e[o]);null!==a&&t.push(`${o}=${a}`)}),t.join("&")}(o)}#${encodeURIComponent(document.location.href)}`,n=document.createElement("iframe");n.id=a,n.src=l,n.setAttribute("allowTransparency","true"),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("style","background: rgba(0,0,0,0.003); border: 0 none transparent;"),n.setAttribute("frameborder","0"),n.setAttribute("data-testid",n.id);const s=this.checkoutOptions.modal_title??e.DEFAULT_TITLE;n.setAttribute("title",s);const i=document.createElement("div");return i.setAttribute("role","dialog"),i.setAttribute("aria-label",s),i.setAttribute("aria-modal","true"),i.setAttribute("data-testid",`${n.id}-wrapper`),i.id=e.getWrapperID(a),i.appendChild(n),document.body.appendChild(i),{iFrame:n,iFrameWrapper:i}}addEventListeners(){const{success:e,purchaseCompleted:t,cancel:o,track:a,afterOpen:l,afterClose:n}=this.checkoutOptions;this.postman=function(e,t){const o=e.contentWindow,a=e.src,l={};if(!o||!a)return null;const n=function(e){if(!(e&&e.origin&&e.origin.indexOf("js.stripe.com")>0||e.origin.indexOf("www.paypal.com")>0)&&e.origin===t&&e&&e.data&&"string"==typeof e.data&&"{"===e.data.charAt(0))try{const t=JSON.parse(e.data);"object"==typeof t&&t.type&&l[t.type]&&l[t.type].forEach(e=>{e(t.data)})}catch(e){Y.Error(e)}};return window.addEventListener("message",n),{on(e,t){l[e]||(l[e]=[]),l[e].push(t)},one(e,t,o=!1){o&&delete l[e],!l[e]&&this.on(e,t)},destroy(){window.removeEventListener("message",n)},post(e,t){o.postMessage(JSON.stringify({type:e,data:t}),a.replace(/([^:]+:\/\/[^/]+).*/,"$1"))}}}(this.iFrame,this.baseUrl),this.postman?.one("upgraded",t=>{try{e?.(t)}catch(e){Y.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.one("purchaseCompleted",e=>{try{t?.(e)}catch(e){Y.Error(e)}},!0),this.postman?.one("canceled",()=>{try{o?.()}catch(e){Y.Error(e)}this.dispatchOnClosed(),this.removeIFrameAndPostman(),n?.()},!0),this.postman?.on("track",e=>{try{a?.(e.event,e)}catch(e){Y.Error(e)}}),this.postman?.one("loaded",()=>{this.dispatchOnLoaded(),this.iFrame?.classList.add(this.visibleClass);try{l?.()}catch(e){Y.Error(e)}},!0)}removeIFrameAndPostman(){this.postman?.destroy(),this.postman=null,this.iFrame.remove(),this.iFrameWrapper.remove(),this.closedEventListeners.clear(),this.loadedEventListeners.clear()}dispatchOnLoaded(){this.loadedEventListeners.forEach(e=>e())}dispatchOnClosed(){this.closedEventListeners.forEach(e=>e())}};K(le,"DEFAULT_TITLE","Checkout");let ne=le;const se=class e{constructor(e,t,o){K(this,"iFrameID"),this.style=e,this.options=t,this.baseUrl=o,this.iFrameID=`fs-checkout-page-${this.style.guid}`}create(t){const o={...this.options,...t};return new ne(this.baseUrl,this.getQueryParams(o),this.iFrameID,e.VISIBLE_CLASS,o)}addStyle(){this.style.addStyle(this.getStyle())}getQueryParams(e){return{mode:"dialog",guid:this.style.guid,_fs_checkout:!0,...X(e)}}getStyle(){return`#${this.iFrameID} { z-index: ${J-1}; background: rgba(0,0,0,0.003); border: 0 none transparent; visibility: ${this.style.isFlashingBrowser?"hidden":"visible"}; margin: 0; padding: 0; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; -webkit-tap-highlight-color: transparent; overflow: hidden; } #${this.iFrameID}.${e.VISIBLE_CLASS} { visibility: visible; } #${ne.getWrapperID(this.iFrameID)} { z-index: ${J-1}; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; overflow: hidden; }`}};K(se,"VISIBLE_CLASS","show");let ie=se;class re{constructor(e,t,o,a,l){K(this,"checkoutIFrameBuilder"),K(this,"checkoutIFrame",null),K(this,"lastFocusedElement",null),this.style=e,this.exitIntent=t,this.loader=o,this.checkoutIFrameBuilder=new ie(this.style,l,a),this.checkoutIFrameBuilder.addStyle()}isOpen(){return null!==this.checkoutIFrame}open(e){return this.isOpen()||(this.backupFocusedElement(),this.style.attach(),this.style.disableBodyScroll(),this.style.disableMetaColorScheme(),this.loader.show(),this.exitIntent.attach(),this.checkoutIFrame=this.checkoutIFrameBuilder.create(e),this.checkoutIFrame.onLoaded(this.onLoaded.bind(this)),this.checkoutIFrame.onClosed(this.onClosed.bind(this)),this.checkoutIFrame.addToExitIntent(this.exitIntent)),this}close(){return this.checkoutIFrame?.close(),this.loader.hideImmediate(),this}onLoaded(){this.loader.hide()}onClosed(){this.checkoutIFrame=null,this.loader.hide(),this.style.enableBodyScroll(),this.style.enableMetaColorScheme(),this.exitIntent.detach(),this.restoreFocusedElement(),this.style.remove()}backupFocusedElement(){this.lastFocusedElement=document.activeElement??null}restoreFocusedElement(){this.lastFocusedElement&&(this.lastFocusedElement.focus?.(),this.lastFocusedElement=null)}}class ce{constructor(e){K(this,"exitIntentId"),K(this,"exitIntentDiv",null),K(this,"clearExitIntentListener",null),K(this,"listeners",[]),this.style=e,this.exitIntentId=`fs-exit-intent-${this.style.guid}`,this.style.addStyle(this.getStyle())}isAttached(){return null!==this.exitIntentDiv}addListener(...e){this.listeners.push(...e)}attach(...e){if(e&&this.addListener(...e),this.isAttached())return this;this.exitIntentDiv=document.createElement("div"),this.exitIntentDiv.id=this.exitIntentId,document.body.appendChild(this.exitIntentDiv);const t=document.documentElement;let o=null;const a=e=>{e.pageY<=20&&(o=window.setTimeout(()=>{try{this.fireListeners()}catch(e){Y.Error(e)}},300))},l=()=>{o&&(clearTimeout(o),o=null)};return t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",l),this.clearExitIntentListener=()=>{o&&(clearTimeout(o),o=null),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",l)},this}detach(){return this.isAttached()?(this.exitIntentDiv?.remove(),this.exitIntentDiv=null,this.clearExitIntentListener?.(),this):this}fireListeners(){this.listeners.forEach(e=>{e()})}getStyle(){return`#${this.exitIntentId} { z-index: ${J}; border: 0; background: transparent; position: fixed; padding: 0; margin: 0; height: 10px; left: 0; right: 0; width: 100%; top: 0; }`}}const pe=class e{constructor(e){K(this,"queryParams",null),this.url=e,this.queryParams=this.parseQueryStringForCart()}hasCart(){return null!==this.queryParams}getPluginID(){return ee(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_id}getPluginPublicKey(){return ee(this.queryParams,e.NO_CART_FOUND_MESSAGE),this.queryParams.__fs_plugin_public_key}matchesPluginID(e){const t=Number.parseInt(this.getPluginID(),10),o=Number.parseInt(e.toString(),10);return Number.isFinite(t)&&Number.isFinite(o)&&t===o}getCheckoutOptions(){ee(this.queryParams,e.NO_CART_FOUND_MESSAGE);const t={plugin_id:"",public_key:""};return Object.entries(this.queryParams).forEach(([e,o])=>{"__fs_plugin_id"===e?t.plugin_id=o:"__fs_plugin_public_key"===e?t.public_key=o:t[e]=o}),t}parseQueryStringForCart(){const e=new URLSearchParams(this.url.search);if(!e.has("__fs_authorization"))return null;const t={};return e.forEach((e,o)=>{o.startsWith("__fs_")&&(t[o]=e)}),t}};K(pe,"NO_CART_FOUND_MESSAGE","No cart was found");let de=pe;const me="https://checkout.freemius.com";class fe{constructor(e,t=!0,o=null){K(this,"options",{plugin_id:0,public_key:""}),K(this,"guid"),K(this,"baseUrl"),K(this,"style"),K(this,"loader"),K(this,"checkoutPopup"),K(this,"exitIntent"),K(this,"cart"),this.baseUrl=o??me;const{plugin_id:a,product_id:l,public_key:n,loadingImageAlt:s,loadingImageUrl:i,...r}=e;if(!a&&!l)throw new Error("Must provide a product_id to options.");this.options={...r,public_key:n,plugin_id:l??a},this.guid=function(){const e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}(),!Z()&&(this.baseUrl=o??(window.FS?.__FS__IS_TEST__?"http://checkout.freemius-local.com:8080":me),this.style=new te(this.guid),this.loader=new ae(this.style,i??`${this.baseUrl}/assets/img/spinner.svg`,s),this.exitIntent=new ce(this.style),this.checkoutPopup=new re(this.style,this.exitIntent,this.loader,this.baseUrl,this.options),this.cart=new de(new URL(window.location.href)),t&&this.recoverCart())}async open(e){if(!Z()){if(this.checkoutPopup?.isOpen())return void Y.Warn("Checkout popup already open. Please close it first before opening it again.");if(!document.body)return new Promise(t=>{document.addEventListener("DOMContentLoaded",()=>{this.checkoutPopup?.open(e),t()},{once:!0})});this.checkoutPopup?.open(e)}}close(){Z()||this.checkoutPopup?.close()}destroy(){Z()||this.close()}getGuid(){return this.guid}recoverCart(){if(this.cart?.hasCart()&&this.cart?.matchesPluginID(this.options.plugin_id)){const e=this.cart.getCheckoutOptions();this.open(e)}}}const he=({error:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-status",role:e?"alert":"status"},e?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"dashicons dashicons-warning","aria-hidden":"true"}),e):(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"spinner is-active"}),(0,l.__)("Loading…","softicon-flipbook"))),be={usd:"$",eur:"€",gbp:"£",aud:"A$",cad:"C$"},ue="support@softiconai.com",ke=(0,t.createElement)("a",{href:"mailto:"+ue}),_e=({days:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-guarantee"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.__)("Try Pro without risk","softicon-flipbook")),(0,t.createElement)("p",null,e>0
     4/* translators: %d: number of days */?(0,l.sprintf)((0,l.__)("If Pro is not right for you, tell us within %d days and you get all your money back, no questions asked.","softicon-flipbook"),e):(0,l.__)("If Pro is not right for you, tell us and we will make it right.","softicon-flipbook")),(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Any problem or question? Email us at %s, a real person from our team will help you.","softicon-flipbook"),"<a>"+ue+"</a>"),{a:ke})),(0,t.createElement)("p",{className:"alfb-guarantee-why"},(0,l.__)("We build SoftIcon Flipbook for the people who use it, and your satisfaction comes first.","softicon-flipbook")))),Ee=({days:e})=>(0,t.createElement)("p",{className:"alfb-note alfb-promise"},(0,t.createElement)("span",{className:"dashicons dashicons-shield","aria-hidden":"true"}),e>0&&(0,l.sprintf)((0,l.__)("%d-day money-back guarantee","softicon-flipbook"),e)+" · ",(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("Questions? %s","softicon-flipbook"),"<a>"+ue+"</a>"),{a:ke})),ye=({price:e})=>(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,be[e.currency]||e.currency.toUpperCase()+" "),e.price.toLocaleString(void 0,{minimumFractionDigits:Number.isInteger(e.price)?0:2,maximumFractionDigits:2}),(0,t.createElement)("span",null,{lifetime:(0,l.__)("one-time","softicon-flipbook"),annual:(0,l.__)("per year","softicon-flipbook"),monthly:(0,l.__)("per month","softicon-flipbook")}[e.cycle])),ge=e=>"unlimited"===e?(0,l.__)("Unlimited websites","softicon-flipbook")
     5/* translators: %d: number of websites */:(0,l.sprintf)((0,l._n)("%d website","%d websites",e,"softicon-flipbook"),e),we=({checkout:e,plan:o,price:a,className:n})=>{const s=`${e.base}?plan_id=${o.id}&licenses=${a.licenses}&billing_cycle=${a.cycle}`;return(0,t.createElement)("a",{className:"alfb-btn alfb-btn-block "+n,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new fe({product_id:e.product,plan_id:o.id,public_key:e.key}).open({licenses:a.licenses,billing_cycle:a.cycle})}catch(e){window.open(s,"_blank","noopener")}}}},(0,l.__)("Get Pro","softicon-flipbook")," →")},ve=({checkout:e,plan:o,className:a,children:l})=>{const n=o.trial_card?"paid":"free",s=`${e.base}?plan_id=${o.id}&trial=${n}`;return(0,t.createElement)("a",{className:a,href:s,target:"_blank",rel:"noopener noreferrer",onClick:t=>{if(!(t.metaKey||t.ctrlKey||t.shiftKey||0!==t.button)){t.preventDefault();try{new fe({product_id:e.product,plan_id:o.id,public_key:e.key}).open({trial:n})}catch(e){window.open(s,"_blank","noopener")}}}},l)},Ne=e=>(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
     6(0,l._n)("Start %d-day free trial","Start %d-day free trial",e.trial,"softicon-flipbook"),e.trial),Se=({checkout:e,plan:o})=>(0,t.createElement)("div",{className:"alfb-card alfb-trial"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("h3",null,(0,l.sprintf)(/* translators: %d: number of days */ /* translators: %d: number of days */
     7(0,l._n)("Try Pro free for %d day","Try Pro free for %d days",o.trial,"softicon-flipbook"),o.trial)),(0,t.createElement)("p",null,o.trial_card?(0,l.__)("Every Pro feature on one website. Cancel before the trial ends and you pay nothing.","softicon-flipbook"):(0,l.__)("Every Pro feature on one website, no card needed. When the trial ends, pick a plan or keep using the free plugin.","softicon-flipbook"))),(0,t.createElement)(ve,{checkout:e,plan:o,className:"alfb-btn alfb-btn-amber"},Ne(o)," →")),xe=({data:e})=>(0,t.createElement)("div",{className:"alfb-card alfb-no-plans"},(0,t.createElement)("span",{className:"dashicons dashicons-clock","aria-hidden":"true"}),(0,t.createElement)("p",null,e.error?(0,l.__)("The Pro plans could not be loaded right now. Please try again later.","softicon-flipbook"):(0,l.__)("SoftIcon Flipbook Pro is coming soon.","softicon-flipbook"))),Ce=({eyebrow:e,title:o,children:a})=>(0,t.createElement)("div",{className:"alfb-intro"},(0,t.createElement)("span",{className:"alfb-eyebrow"},e),(0,t.createElement)("h2",null,o),a),Pe=()=>D("/alfb/v1/dashboard/plans"),Fe=({play:e})=>(0,t.createElement)("p",null,(0,t.createElement)(u,{url:g.pro,title:(0,l.__)("Every Pro feature in one minute","softicon-flipbook"),play:e},(0,t.createElement)("span",{className:"dashicons dashicons-video-alt3","aria-hidden":"true"})," ",(0,l.__)("Watch every Pro feature in one minute","softicon-flipbook"))),Ie=({play:e})=>{const{data:o,error:a,loading:n}=Pe();if(n||a)return(0,t.createElement)(he,{error:a});const s=o.pro,i=s&&"lifetime"===s.prices[0].cycle;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ce,{eyebrow:(0,l.__)("Pricing","softicon-flipbook"),title:i?(0,l.__)("Pay once, use it for life","softicon-flipbook"):(0,l.__)("Pick your plan","softicon-flipbook")},(0,t.createElement)("p",null,(0,l.__)("Every plan has all Pro features; pick how many websites you need.","softicon-flipbook")),(0,t.createElement)(Fe,{play:e})),s&&s.trial>0&&o.checkout&&(0,t.createElement)(Se,{checkout:o.checkout,plan:s}),s?(0,t.createElement)("div",{className:"alfb-plans alfb-plans-3"},s.prices.map(e=>(0,t.createElement)("div",{className:"alfb-plan",key:e.licenses},(0,t.createElement)("span",{className:"alfb-tag"},ge(e.licenses)),(0,t.createElement)("h3",null,s.title),(0,t.createElement)(ye,{price:e}),(0,t.createElement)(we,{checkout:o.checkout,plan:s,price:e,className:"alfb-btn-teal"}),(0,t.createElement)("ul",{className:"alfb-checks"},(0,t.createElement)("li",null,ge(e.licenses)),(0,t.createElement)("li",null,(0,l.__)("Every free feature","softicon-flipbook")),o.pro_only.map(e=>(0,t.createElement)("li",{key:e.title},e.title)))))):(0,t.createElement)(xe,{data:o}),s&&(0,t.createElement)(_e,{days:o.money_back}),(0,t.createElement)("p",{className:"alfb-note"},(0,l.__)("Secure checkout by Freemius. Pro replaces the free plugin and keeps every book you made.","softicon-flipbook")," ",(0,t.createElement)("a",{href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook"))))},Ae=({yes:e})=>(0,t.createElement)("span",{className:"alfb-mark "+(e?"is-yes":"is-no")},(0,t.createElement)("span",{className:"dashicons "+(e?"dashicons-yes":"dashicons-no-alt"),"aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},e?(0,l.__)("Included","softicon-flipbook"):(0,l.__)("Not included","softicon-flipbook"))),Le=({play:e})=>{const{data:a,error:n,loading:s}=Pe(),[i,r]=(0,o.useState)("");if(s||n)return(0,t.createElement)(he,{error:n});const c=a.pro,p=i.trim().toLowerCase(),d=[[(0,l.__)("In Free and Pro","softicon-flipbook"),a.free,!0],[(0,l.__)("Only in Pro","softicon-flipbook"),a.pro_only,!1]].map(([e,t,o])=>[e,t.filter(t=>!p||e.toLowerCase().includes(p)||(t.title+" "+t.text).toLowerCase().includes(p)),o]).filter(([,e])=>e.length),m=a.free.length>0||a.pro_only.length>0;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Ce,{eyebrow:(0,l.__)("Compare","softicon-flipbook"),title:(0,l.__)("Free vs Pro at a glance","softicon-flipbook")},a.pro_only.length>0&&(0,t.createElement)("p",null,(0,o.createInterpolateElement)((0,l.sprintf)((0,l.__)("See what you get when you upgrade. %s features are only in Pro.","softicon-flipbook"),"<strong>"+a.pro_only.length.toLocaleString()+"</strong>"),{strong:(0,t.createElement)("strong",null)})),(0,t.createElement)(Fe,{play:e})),(0,t.createElement)("div",{className:"alfb-plans"},(0,t.createElement)("div",{className:"alfb-plan"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("h3",null,(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free forever, everything you need to put books on your site.","softicon-flipbook")),(0,t.createElement)("p",{className:"alfb-price"},(0,t.createElement)("sup",null,"$"),"0",(0,t.createElement)("span",null,(0,l.__)("forever","softicon-flipbook"))),(0,t.createElement)("span",{className:"alfb-have"},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),(0,l.__)("You already have it","softicon-flipbook"))),c&&(0,t.createElement)("div",{className:"alfb-plan is-pro"},(0,t.createElement)("span",{className:"alfb-tag"},(0,l.__)("Pro","softicon-flipbook")),(0,t.createElement)("h3",null,c.title),c.text&&(0,t.createElement)("p",null,c.text),(0,t.createElement)(ye,{price:c.prices[0]}),(0,t.createElement)(we,{checkout:a.checkout,plan:c,price:c.prices[0],className:"alfb-btn-light"}),c.trial>0&&(0,t.createElement)(ve,{checkout:a.checkout,plan:c,className:"alfb-more-plans alfb-trial-link"},Ne(c)),c.prices.length>1&&(0,t.createElement)("a",{className:"alfb-more-plans",href:"#/pricing"},(0,l.__)("Plans for more websites","softicon-flipbook")))),c&&(0,t.createElement)(Ee,{days:a.money_back}),!c&&(0,t.createElement)(xe,{data:a}),m&&(0,t.createElement)("section",{className:"alfb-breakdown"},(0,t.createElement)("header",null,(0,t.createElement)("h3",{id:"alfb-breakdown-title"},(0,l.__)("Feature breakdown","softicon-flipbook")),(0,t.createElement)("label",{className:"alfb-filter"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("span",{className:"screen-reader-text"},(0,l.__)("Filter features","softicon-flipbook")),(0,t.createElement)("input",{type:"search",placeholder:(0,l.__)("Filter features…","softicon-flipbook"),value:i,onChange:e=>r(e.target.value)}))),(0,t.createElement)("table",{className:"alfb-compare","aria-labelledby":"alfb-breakdown-title"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",{scope:"col"},(0,l.__)("Feature","softicon-flipbook")),(0,t.createElement)("th",{scope:"col"},(0,l.__)("Free","softicon-flipbook")),(0,t.createElement)("th",{scope:"col",className:"is-pro"},(0,l.__)("Pro","softicon-flipbook")))),d.map(([e,o,a])=>(0,t.createElement)("tbody",{key:e},(0,t.createElement)("tr",{className:"alfb-group"},(0,t.createElement)("th",{scope:"rowgroup",colSpan:"3"},e)),o.map(e=>(0,t.createElement)("tr",{key:e.title},(0,t.createElement)("th",{scope:"row"},e.title,e.text&&(0,t.createElement)("small",null,e.text)),(0,t.createElement)("td",null,(0,t.createElement)(Ae,{yes:a})),(0,t.createElement)("td",null,(0,t.createElement)(Ae,{yes:!0})))))),!d.length&&(0,t.createElement)("tbody",{className:"alfb-empty"},(0,t.createElement)("tr",null,(0,t.createElement)("td",{colSpan:"3"},(0,l.__)("No features match.","softicon-flipbook")))))))},Me={target:"_blank",rel:"noopener noreferrer"},Te="https://softiconai.com/",De="support@softiconai.com",Oe=({config:e,play:a})=>{const[n,s]=(0,o.useState)(""),[i,r]=(0,o.useState)(0),[c,p]=(0,o.useState)(!1),d=e.pro&&!e.locked,m=(e=>[[(0,l.__)("Plugin","softicon-flipbook"),(e.pro?"SoftIcon Flipbook Pro ":"SoftIcon Flipbook ")+e.version+(e.pro&&e.locked?" ("+(0,l.__)("no license","softicon-flipbook")+")":"")],["WordPress",e.site?.wp||""],["PHP",e.site?.php||""],[(0,l.__)("Theme","softicon-flipbook"),e.site?.theme||""],[(0,l.__)("Browser","softicon-flipbook"),window.navigator.userAgent.replace(/^Mozilla\/5\.0 /,"")]])(e),f=n.trim().toLowerCase(),h=[{q:(0,l.__)("How do I add a flipbook?","softicon-flipbook"),a:(0,l.__)("Edit a page, open the block inserter, search for Flipbook and add the block. Pick a PDF from your Media Library or upload one, and the book appears right away.","softicon-flipbook"),video:g.add},{q:(0,l.__)("Does it work with the Classic Editor, Elementor or other page builders?","softicon-flipbook"),a:(0,l.__)('Yes. Go to Flipbook → All Flipbooks, add a flipbook, set it up and publish it. The list shows its shortcode, such as [softicon_flipbook id="123"]; paste it where the flipbook should be.',"softicon-flipbook"),video:g.shortcode},{q:(0,l.__)("My PDF from another website does not load","softicon-flipbook"),a:(0,l.__)("Browsers only read a PDF from another website when that site allows it (CORS). Upload the PDF to your Media Library and it always works.","softicon-flipbook")},{q:(0,l.__)("Can the flipbook open in a popup?","softicon-flipbook"),a:(0,l.__)("Yes. Select the flipbook, open the Style tab and turn on Open in a lightbox under Display. A cover, a button or a text link shows on the page, and a click opens the book.","softicon-flipbook"),video:g.lightbox},{q:(0,l.__)("How do I link to a page of the book?","softicon-flipbook"),a:(0,l.__)('Add #page= and the number to the page address, for example example.com/catalog/#page=12. Links like <a href="#page=8"> on the same page turn the book there.',"softicon-flipbook"),video:g.reading},{q:(0,l.__)("How do I hide the download button?","softicon-flipbook"),a:(0,l.__)("Select the flipbook and turn off Download button in the Toolbar panel of the General tab.","softicon-flipbook")},{q:(0,l.__)("Does it work with caching and minify plugins?","softicon-flipbook"),a:(0,l.__)("Yes. The block tells its script where the plugin's files are, so combining or moving scripts does not break the flipbook. After an update, clear your cache once.","softicon-flipbook")},{q:(0,l.__)("Does it slow down my pages?","softicon-flipbook"),a:(0,l.__)("The page gets a 35 KB script (12 KB compressed). The PDF engine loads only when a flipbook comes near the screen, or when a lightbox is opened.","softicon-flipbook")}].filter(e=>!f||(e.q+" "+e.a).toLowerCase().includes(f)),b=[{icon:"tickets-alt",title:(0,l.__)("Open a support ticket","softicon-flipbook"),href:Te+"support/",main:!0,text:d?(0,l.__)("Use the email you bought Pro with, and the developers answer you.","softicon-flipbook"):(0,l.__)("Tell us what happened; the people who build the plugin answer.","softicon-flipbook"),cta:(0,l.__)("Write to us","softicon-flipbook")},{icon:"book",title:(0,l.__)("Documentation","softicon-flipbook"),href:Te+"docs/flipbook/",text:(0,l.__)("Guides for every setting, step by step.","softicon-flipbook"),cta:(0,l.__)("Read the docs","softicon-flipbook")},{icon:"video-alt3",title:(0,l.__)("Video tutorials","softicon-flipbook"),video:!0,text:(0,l.__)("Short videos, most under a minute.","softicon-flipbook"),cta:(0,l.__)("Watch here","softicon-flipbook")},{icon:"groups",title:(0,l.__)("Community forum","softicon-flipbook"),href:"https://wordpress.org/support/plugin/softicon-flipbook/",text:(0,l.__)("Ask in public on WordPress.org, and search past answers.","softicon-flipbook"),cta:(0,l.__)("Visit the forum","softicon-flipbook")}],k=e=>(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:"alfb-hp-icon dashicons dashicons-"+e.icon,"aria-hidden":"true"}),(0,t.createElement)("strong",null,e.title,e.main&&(0,t.createElement)("em",null,(0,l.__)("Fastest","softicon-flipbook"))),(0,t.createElement)("small",null,e.text),(0,t.createElement)("b",null,e.cta," ",!e.video&&(0,t.createElement)("span",{"aria-hidden":"true"},"↗")));return(0,t.createElement)("div",{className:"alfb-hp"},(0,t.createElement)("header",{className:"alfb-hp-hero"},(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-hp-eyebrow"},(0,l.__)("Support","softicon-flipbook")),(0,t.createElement)("h2",null,(0,l.__)("How can we help?","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.__)("Free or Pro, a real person reads every message: the developers who build SoftIcon Flipbook.","softicon-flipbook"))),(0,t.createElement)("label",{className:"alfb-hp-search"},(0,t.createElement)("span",{className:"dashicons dashicons-search","aria-hidden":"true"}),(0,t.createElement)("input",{type:"search",value:n,onChange:e=>{s(e.target.value),r(0)},placeholder:(0,l.__)("Search the answers","softicon-flipbook"),"aria-label":(0,l.__)("Search the answers","softicon-flipbook")}))),(0,t.createElement)("div",{className:"alfb-hp-ways"},b.map(o=>o.video?(0,t.createElement)(u,{key:o.title,className:"alfb-hp-way",url:e.urls.playlist,title:o.title,play:a},k(o)):(0,t.createElement)("a",{key:o.title,className:"alfb-hp-way"+(o.main?" is-main":""),href:o.href,...Me},k(o)))),(0,t.createElement)("div",{className:"alfb-hp-body"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Quick answers","softicon-flipbook")),(0,t.createElement)("span",null,f?(0,l.sprintf)(/* translators: %d: the number of answers that match the search */ /* translators: %d: the number of answers that match the search */
     8(0,l.__)("%d found","softicon-flipbook"),h.length):(0,l.__)("The questions people ask most","softicon-flipbook"))),h.map((e,o)=>(0,t.createElement)("div",{className:"alfb-hp-qa"+(i===o?" is-open":""),key:e.q},(0,t.createElement)("button",{type:"button","aria-expanded":i===o,onClick:()=>r(i===o?-1:o)},(0,t.createElement)("span",null,e.q),(0,t.createElement)("span",{className:"alfb-hp-chev dashicons dashicons-arrow-down-alt2","aria-hidden":"true"})),i===o&&(0,t.createElement)("div",{className:"alfb-hp-answer"},(0,t.createElement)("p",null,e.a),e.video&&(0,t.createElement)(u,{url:e.video,title:e.q,play:a,className:"alfb-hp-watch"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch how","softicon-flipbook"))))),!h.length&&(0,t.createElement)("p",{className:"alfb-hp-none"},(0,l.__)("No quick answer for that.","softicon-flipbook")," ",(0,t.createElement)("a",{href:Te+"support/",...Me},(0,l.__)("Ask us instead","softicon-flipbook")," ↗")),(0,t.createElement)("p",{className:"alfb-hp-more"},(0,t.createElement)("a",{href:"https://wordpress.org/plugins/softicon-flipbook/#faq",...Me},(0,l.__)("All questions and answers","softicon-flipbook")," ↗"))),(0,t.createElement)("aside",{className:"alfb-hp-side"},(0,t.createElement)("section",{className:"alfb-hp-panel"},(0,t.createElement)("header",null,(0,t.createElement)("h3",null,(0,l.__)("Your site details","softicon-flipbook")),(0,t.createElement)("button",{type:"button",className:"alfb-hp-copy"+(c?" is-done":""),onClick:()=>((e,t)=>{if(window.navigator.clipboard&&window.isSecureContext)return void window.navigator.clipboard.writeText(e).then(t);const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy")&&t(),o.remove()})(m.map(([e,t])=>e+": "+t).join("\n"),()=>{p(!0),setTimeout(()=>p(!1),1800)})},(0,t.createElement)("span",{className:"dashicons dashicons-"+(c?"yes":"clipboard"),"aria-hidden":"true"}),c?(0,l.__)("Copied","softicon-flipbook"):(0,l.__)("Copy","softicon-flipbook"))),(0,t.createElement)("dl",{className:"alfb-hp-details"},m.map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("dt",null,e),(0,t.createElement)("dd",{title:o},o)))),(0,t.createElement)("p",{className:"alfb-hp-note"},(0,l.__)("Paste these into your ticket with the address of the page and what you see. They are only copied, never sent.","softicon-flipbook"))),(0,t.createElement)("section",{className:"alfb-hp-panel alfb-hp-contact"},(0,t.createElement)("a",{href:"mailto:"+De},(0,t.createElement)("span",{className:"dashicons dashicons-email-alt","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("small",null,De))),d?(0,t.createElement)(t.Fragment,null,(0,t.createElement)("a",{href:Te+"account/",...Me},(0,t.createElement)("span",{className:"dashicons dashicons-admin-network","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Licenses and downloads","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("Your account","softicon-flipbook")))),(0,t.createElement)("a",{href:Te+"contact/",...Me},(0,t.createElement)("span",{className:"dashicons dashicons-cart","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Sales and billing","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))):(0,t.createElement)("a",{href:"#/pricing"},(0,t.createElement)("span",{className:"dashicons dashicons-star-filled","aria-hidden":"true"}),(0,t.createElement)("span",null,(0,t.createElement)("strong",null,(0,l.__)("Pro plans","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("14-day money-back on Pro","softicon-flipbook"))))))),(0,t.createElement)("div",{className:"alfb-hp-love"},(0,t.createElement)("span",{className:"alfb-hp-stars","aria-hidden":"true"},"★★★★★"),(0,t.createElement)("div",null,(0,t.createElement)("strong",null,(0,l.__)("Enjoying SoftIcon Flipbook?","softicon-flipbook")),(0,t.createElement)("small",null,(0,l.__)("A review helps other people find it and keeps it free.","softicon-flipbook"))),(0,t.createElement)("a",{className:"alfb-hp-btn",href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",...Me},(0,l.__)("Leave a review","softicon-flipbook")),(0,t.createElement)("a",{href:"https://wordpress.org/plugins/author/softiconai/",...Me},(0,l.__)("More plugins","softicon-flipbook")),(0,t.createElement)("a",{href:"https://github.com/softiconai/softicon-flipbook",...Me},(0,l.__)("Source on GitHub","softicon-flipbook"))))},He=({checked:e,onChange:o,label:a})=>(0,t.createElement)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":a,className:"alfb-try-switch"+(e?" is-on":""),onClick:()=>o(!e)},(0,t.createElement)("span",null)),ze=({value:e,options:o,onChange:a,label:l})=>(0,t.createElement)("div",{className:"alfb-try-seg",role:"radiogroup","aria-label":l},o.map(([o,l])=>(0,t.createElement)("button",{type:"button",key:o,role:"radio","aria-checked":o===e,className:o===e?"is-on":"",onClick:()=>a(o)},l))),Ve=["","#f6f7f7","#1f2937","#0f766e","#7a1f1f"],Be={analytics:()=>{const[e,a]=(0,o.useState)(30),n=(0,o.useMemo)(()=>{const t=(o=e,()=>(o=(9301*o+49297)%233280)/233280);var o;const a=Array.from({length:e},(e,o)=>Math.round(18+40*t()+10*Math.sin(o/3))),l=a.reduce((e,t)=>e+t,0);return{bars:a,views:l,pages:Math.round(7.4*l),downloads:Math.round(.08*l),leads:Math.round(.03*l)}},[e]),s=Math.max(...n.bars),i=[[(0,l.__)("Spring catalog","softicon-flipbook"),.46],[(0,l.__)("Room guide","softicon-flipbook"),.31],[(0,l.__)("Price list","softicon-flipbook"),.23]];return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)(ze,{label:(0,l.__)("Period","softicon-flipbook"),value:e,onChange:a,options:[[7,(0,l.__)("7 days","softicon-flipbook")],[30,(0,l.__)("30 days","softicon-flipbook")],[90,(0,l.__)("90 days","softicon-flipbook")]]})),(0,t.createElement)("div",{className:"alfb-try-stats"},[[(0,l.__)("Views","softicon-flipbook"),n.views],[(0,l.__)("Pages read","softicon-flipbook"),n.pages],[(0,l.__)("Pages per view","softicon-flipbook"),(n.pages/n.views).toFixed(1)],[(0,l.__)("Downloads","softicon-flipbook"),n.downloads],[(0,l.__)("Leads","softicon-flipbook"),n.leads]].map(([e,o])=>(0,t.createElement)("div",{key:e},(0,t.createElement)("small",null,e),(0,t.createElement)("strong",null,Number(o).toLocaleString())))),(0,t.createElement)("div",{className:"alfb-try-chart","aria-label":(0,l.__)("Views per day","softicon-flipbook"),role:"img"},n.bars.map((e,o)=>(0,t.createElement)("i",{key:o,style:{height:e/s*100+"%"},title:String(e)}))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Views","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Pages read","softicon-flipbook")))),(0,t.createElement)("tbody",null,i.map(([e,o])=>(0,t.createElement)("tr",{key:e},(0,t.createElement)("td",null,e),(0,t.createElement)("td",null,Math.round(n.views*o).toLocaleString()),(0,t.createElement)("td",null,Math.round(n.pages*o).toLocaleString()))))))},leads:()=>{const[e,a]=(0,o.useState)(""),n=[["Amira Hassan","am***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("Today","softicon-flipbook")],["Jonas Weber","jo***@example.com",(0,l.__)("Room guide","softicon-flipbook"),5,(0,l.__)("Yesterday","softicon-flipbook")],["Priya Nair","pr***@example.com",(0,l.__)("Spring catalog","softicon-flipbook"),3,(0,l.__)("2 days ago","softicon-flipbook")],["Lucas Martin","lu***@example.com",(0,l.__)("Price list","softicon-flipbook"),2,(0,l.__)("3 days ago","softicon-flipbook")]].filter(t=>!e||t.join(" ").toLowerCase().includes(e.toLowerCase()));return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"alfb-try-row"},(0,t.createElement)("input",{type:"search",className:"alfb-try-input",value:e,onChange:e=>a(e.target.value),placeholder:(0,l.__)("Search leads","softicon-flipbook"),"aria-label":(0,l.__)("Search leads","softicon-flipbook")}),(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Download CSV","softicon-flipbook"))),(0,t.createElement)("table",{className:"alfb-try-table"},(0,t.createElement)("thead",null,(0,t.createElement)("tr",null,(0,t.createElement)("th",null,(0,l.__)("Name","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Email","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Book","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("Asked at page","softicon-flipbook")),(0,t.createElement)("th",null,(0,l.__)("When","softicon-flipbook")))),(0,t.createElement)("tbody",null,n.map(e=>(0,t.createElement)("tr",{key:e[1]},e.map((e,o)=>(0,t.createElement)("td",{key:o},e)))))),!n.length&&(0,t.createElement)("p",{className:"alfb-try-empty"},(0,l.__)("No sample lead matches.","softicon-flipbook")))},defaults:({config:e})=>{const[a,n]=(0,o.useState)({showDownload:!0,showPrint:!1,showThumbnails:!0,showSearch:!0,showShare:!1,flipSound:!0,theme:"light",bgColor:"",bookStyle:"flat"}),s=(e,t)=>n(o=>({...o,[e]:t})),i={...a,sideArrows:"hardcover"===a.bookStyle,pdfUrl:e.urls.demo+"spring-catalog.pdf",maxHeight:380},r=JSON.stringify(a),c=(0,o.useRef)();return(0,o.useEffect)(()=>{window.dispatchEvent(new window.Event("alfb:boot"));const e=c.current?.querySelector("[data-alfb]");return()=>e?.alfb?.destroy?.()},[r]),(0,t.createElement)("div",{className:"alfb-try-split"},(0,t.createElement)("div",{className:"alfb-try-controls"},(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Toolbar on every book","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-chips"},[["showDownload","download",(0,l.__)("Download","softicon-flipbook")],["showPrint","printer",(0,l.__)("Print","softicon-flipbook")],["showThumbnails","grid-view",(0,l.__)("Thumbnails","softicon-flipbook")],["showSearch","search",(0,l.__)("Search","softicon-flipbook")],["showShare","share",(0,l.__)("Share","softicon-flipbook")],["flipSound","controls-volumeon",(0,l.__)("Sound","softicon-flipbook")]].map(([e,o,l])=>(0,t.createElement)("button",{type:"button",key:e,role:"switch","aria-checked":!!a[e],className:"alfb-try-chip"+(a[e]?" is-on":""),onClick:()=>s(e,!a[e])},(0,t.createElement)("span",{className:"dashicons dashicons-"+o,"aria-hidden":"true"}),l))),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Design","softicon-flipbook")),(0,t.createElement)(ze,{label:(0,l.__)("Design","softicon-flipbook"),value:a.bookStyle,onChange:e=>s("bookStyle",e),options:[["flat",(0,l.__)("Classic","softicon-flipbook")],["hardcover",(0,l.__)("Hardcover","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Theme","softicon-flipbook")),(0,t.createElement)(ze,{label:(0,l.__)("Theme","softicon-flipbook"),value:a.theme,onChange:e=>s("theme",e),options:[["light",(0,l.__)("Light","softicon-flipbook")],["dark",(0,l.__)("Dark","softicon-flipbook")]]}),(0,t.createElement)("span",{className:"alfb-try-label"},(0,l.__)("Background","softicon-flipbook")),(0,t.createElement)("div",{className:"alfb-try-swatches"},Ve.map(e=>(0,t.createElement)("button",{type:"button",key:e||"none",className:"alfb-try-swatch"+(e===a.bgColor?" is-on":"")+(e?"":" is-none"),style:e?{background:e}:void 0,onClick:()=>s("bgColor",e),"aria-label":e||(0,l.__)("Theme color","softicon-flipbook")})))),(0,t.createElement)("div",{className:"alfb-try-book",ref:c},(0,t.createElement)(U,{key:r,attributes:i,config:V(i)})))},settings:()=>{const[e,a]=(0,o.useState)({analytics:!0,skipEditors:!0,leadEmail:!1}),n=[["analytics",(0,l.__)("Count opens and pages read","softicon-flipbook"),(0,l.__)("Reading analytics for every book. Nothing personal is stored and no cookies are set.","softicon-flipbook")],["skipEditors",(0,l.__)("Do not count logged-in editors","softicon-flipbook"),(0,l.__)("Your own visits while you work on the site are left out.","softicon-flipbook")],["leadEmail",(0,l.__)("Email me each new lead","softicon-flipbook"),(0,l.__)("Sent to the site admin email.","softicon-flipbook")]];return(0,t.createElement)(t.Fragment,null,n.map(([o,l,n])=>(0,t.createElement)("div",{className:"alfb-try-setting",key:o},(0,t.createElement)("div",null,(0,t.createElement)("strong",null,l),(0,t.createElement)("small",null,n)),(0,t.createElement)(He,{label:l,checked:e[o],onChange:t=>a({...e,[o]:t})}))),(0,t.createElement)("p",{className:"alfb-try-row"},(0,t.createElement)("span",{className:"alfb-try-locked"},(0,t.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"}),(0,l.__)("Save settings","softicon-flipbook"))))}},$e=({name:e,title:o,config:a})=>{const n=Be[e];return(0,t.createElement)("section",{className:"alfb-try"},(0,t.createElement)("header",null,(0,t.createElement)("span",{className:"alfb-try-badge"},(0,t.createElement)("span",{className:"dashicons dashicons-visibility","aria-hidden":"true"}),(0,l.__)("Try it","softicon-flipbook")),(0,t.createElement)("p",null,(0,l.sprintf)(/* translators: %s: the Pro feature, such as Reading analytics */ /* translators: %s: the Pro feature, such as Reading analytics */
     9(0,l.__)("A working demo of %s with sample data. Click around; nothing is saved.","softicon-flipbook"),o))),(0,t.createElement)("div",{className:"alfb-try-body"},(0,t.createElement)(n,{config:a})))},Ue=({name:e,config:o,play:a})=>{const n={analytics:{icon:"chart-bar",eyebrow:(0,l.__)("Insights","softicon-flipbook"),title:(0,l.__)("Reading analytics","softicon-flipbook"),text:(0,l.__)("See how many people open each book and how far they read.","softicon-flipbook"),video:g.analytics,points:[(0,l.__)("Views, pages read and downloads for every book","softicon-flipbook"),(0,l.__)("A chart per day, for 7, 30 or 90 days","softicon-flipbook"),(0,l.__)("No cookies and nothing personal stored","softicon-flipbook"),(0,l.__)("Download the numbers as a CSV file","softicon-flipbook")]},leads:{icon:"email-alt",eyebrow:(0,l.__)("Audience","softicon-flipbook"),title:(0,l.__)("Lead capture","softicon-flipbook"),text:(0,l.__)("Readers leave their email to keep reading after a few pages.","softicon-flipbook"),video:g.leads,points:[(0,l.__)("Choose after how many pages the form shows","softicon-flipbook"),(0,l.__)("Every lead saved on your own site","softicon-flipbook"),(0,l.__)("An email to you for each new lead","softicon-flipbook"),(0,l.__)("Download your leads as a CSV file","softicon-flipbook")]},defaults:{icon:"admin-appearance",eyebrow:(0,l.__)("Appearance","softicon-flipbook"),title:(0,l.__)("Site defaults","softicon-flipbook"),text:(0,l.__)("Set the toolbar, size, colors and more once, and every flipbook uses them. A book can still change any setting for itself.","softicon-flipbook"),video:g.settings,points:[(0,l.__)("Hide the download button on every book at once","softicon-flipbook"),(0,l.__)("Your brand colors and height on each new book","softicon-flipbook"),(0,l.__)("Right to left for every book on an Arabic, Hebrew or Urdu site","softicon-flipbook"),(0,l.__)("A live preview before you save","softicon-flipbook")]},settings:{icon:"admin-generic",eyebrow:(0,l.__)("Site","softicon-flipbook"),title:(0,l.__)("Settings","softicon-flipbook"),text:(0,l.__)("The site-wide switches for reading analytics and lead emails.","softicon-flipbook"),points:[(0,l.__)("Turn reading analytics on or off","softicon-flipbook"),(0,l.__)("Leave out your own visits while you work","softicon-flipbook"),(0,l.__)("Get an email for each new lead","softicon-flipbook")]}}[e];return(0,t.createElement)("div",{className:"alfb-pp-wrap"},(0,t.createElement)("div",{className:"alfb-pp"},(0,t.createElement)("header",{className:"alfb-pp-hero"},(0,t.createElement)("span",{className:"alfb-pp-icon dashicons dashicons-"+n.icon,"aria-hidden":"true"}),(0,t.createElement)("div",null,(0,t.createElement)("span",{className:"alfb-pp-eyebrow"},n.eyebrow," ",(0,t.createElement)("span",{className:"alfb-badge"},(0,l.__)("Pro","softicon-flipbook"))),(0,t.createElement)("h2",null,n.title),(0,t.createElement)("p",null,n.text))),(0,t.createElement)("div",{className:"alfb-pp-body"},(0,t.createElement)("ul",{className:"alfb-pp-points"},n.points.map(e=>(0,t.createElement)("li",{key:e},(0,t.createElement)("span",{className:"dashicons dashicons-yes","aria-hidden":"true"}),e))),(0,t.createElement)("div",{className:"alfb-pp-actions"},(0,t.createElement)("a",{className:"alfb-btn alfb-btn-amber",href:"#/pricing"},(0,l.__)("See Pro plans","softicon-flipbook")),(0,t.createElement)("a",{className:"alfb-pp-link",href:"#/compare"},(0,l.__)("Compare Free and Pro","softicon-flipbook")),n.video&&(0,t.createElement)(u,{url:n.video,title:n.title,play:a,className:"alfb-pp-link"},(0,t.createElement)("span",{className:"dashicons dashicons-controls-play","aria-hidden":"true"}),(0,l.__)("Watch it in action","softicon-flipbook"))))),(0,t.createElement)($e,{name:e,title:n.title,config:o}))},Re=()=>{const e=document.getElementById("alfb-dashboard"),l=window.alfbDashboard;if(!e||!l)return;const n=(0,a.applyFilters)("alfb.dashboard.tabs",{welcome:M,demos:G,...Object.fromEntries(["analytics","leads","defaults","settings"].map(e=>[e,o=>(0,t.createElement)(Ue,{name:e,...o})])),pricing:Ie,compare:Le,help:Oe},l);(0,o.createRoot)(e).render((0,t.createElement)(b,{config:l,tabs:n}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Re):Re()})();
  • softicon-flipbook/trunk/build/index.asset.php

    r3800561 r3802072  
    1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => '24ea7157b30d401f3552');
     1<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'e3f5adb137a1c8e136ee');
  • softicon-flipbook/trunk/build/index.css

    r3792467 r3802072  
    1 .block-editor-block-inspector:has(.siSettings),.siSettings{--wp-admin-theme-color:#059669;--wp-admin-theme-color--rgb:5,150,105;--wp-admin-theme-color-darker-10:#047857;--wp-admin-theme-color-darker-20:#065f46;--wp-components-color-accent:#059669;--wp-components-color-accent-darker-10:#047857;--wp-components-color-accent-darker-20:#065f46;--wpds-color-stroke-focus:#059669;--wpds-color-background-interactive-brand-strong:#059669;--wpds-color-background-interactive-brand-strong-active:#047857;--wpds-color-background-interactive-brand-weak-active:#dcf5ec;--wpds-color-background-surface-brand:#dcf5ec;--wpds-color-background-thumb-brand:#059669;--wpds-color-background-thumb-brand-active:#059669;--wpds-color-foreground-interactive-brand:#059669;--wpds-color-foreground-interactive-brand-active:#047857;--wpds-color-stroke-interactive-brand:#059669;--wpds-color-stroke-interactive-brand-active:#047857;--wpds-color-stroke-surface-brand:#b0e6d2;--wpds-color-stroke-surface-brand-strong:#059669}.siSettings .components-tab-panel__tabs{border-bottom:1px solid #e0e0e0;display:flex}.siSettings .components-tab-panel__tabs-item{color:#50575e;flex:1;font-weight:500;height:48px;justify-content:center}.siSettings .components-tab-panel__tabs-item:after{background:transparent;height:3px}.siSettings .components-tab-panel__tabs-item.is-active{background:#dcf5ec;color:#059669;font-weight:600}.siSettings .components-tab-panel__tabs-item.is-active:after{background:#059669}.siSettings .components-external-link,.siSettings .components-tab-panel__tabs-item:hover:not(.is-active),.siSettings a{color:#059669}.siSettings .components-toggle-control .components-form-toggle.is-checked .components-form-toggle__track{background:#059669;border-color:#059669}.siPanel{position:relative;transition:background-color .2s}.siPanel>.components-panel__body-title .components-panel__body-toggle{font-weight:600;transition:color .15s,background-color .15s}.siPanel:not(.is-opened)>.components-panel__body-title:hover{background:#f0faf6}.siPanel:not(.is-opened)>.components-panel__body-title:hover .components-panel__body-toggle{color:#059669}.siPanel.is-opened{background:#fff;border:1px solid #059669;margin-top:-1px;z-index:1}.siPanel.is-opened>.components-panel__body-title{background:#dcf5ec;margin:-16px -16px 16px}.siPanel.is-opened>.components-panel__body-title .components-panel__arrow,.siPanel.is-opened>.components-panel__body-title .components-panel__body-toggle{color:#059669}.siFields{display:flex;flex-direction:column;gap:20px;padding:4px 0 8px}.siFields .components-base-control,.siFields .components-base-control__field,.siFields>*{margin-bottom:0;margin-top:0}.siFields .components-base-control__help{margin-bottom:0;margin-top:6px}.siFields p{margin:0}.siColors{display:flex;flex-direction:column;gap:4px}.siColorRow{display:block}.siColorToggle.components-button{align-items:center;border-radius:6px;color:#1e1e1e;display:flex;font-size:13px;gap:12px;height:40px;padding:0 4px 0 0;width:100%}.siColorToggle.components-button:hover,.siColorToggle.components-button[aria-expanded=true]{background:transparent;color:#059669}.siColorToggle.components-button .component-color-indicator{border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);flex:none;height:26px;margin:0;width:26px}.siColorToggle.components-button .component-color-indicator.is-empty{background:repeating-conic-gradient(#e0e0e0 0 25%,#fff 0 50%) 50%/8px 8px}.siColorToggle.components-button .siColorName{flex:1;text-align:left}.siColorPopover{padding:16px;width:260px}.siFieldHead{align-items:center;display:flex;gap:6px;margin-bottom:8px}.siFieldLabel{color:#1e1e1e;font-size:13px;font-weight:500;line-height:1.4}.siFieldLine{background:#e0e0e0;flex:1;height:1px;margin-left:4px}.siReset.components-button{font-size:12px;height:26px;padding:0 10px}.siTip{align-items:center;background:none;border:0;border-radius:50%;color:#8c8f94;cursor:help;display:inline-flex;height:20px;justify-content:center;margin:0;padding:0;width:20px}.siTip svg{fill:currentColor;height:16px;width:16px}.siTip:focus-visible,.siTip:hover{background:#dcf5ec;color:#059669;outline:none}.siToggleRow{align-items:center;display:flex;gap:6px}.siToggleRow .components-toggle-control{margin:0}.siTilesGrid{display:grid;gap:8px}.siTile{align-items:center;background:#fff;border:1px solid #dcdcde;border-radius:10px;color:#3c434a;cursor:pointer;display:flex;flex-direction:column;font-size:12px;font-weight:600;gap:6px;justify-content:center;line-height:1.2;margin:0;min-height:68px;padding:10px 6px;text-align:center;transition:border-color .15s,background .15s,color .15s,box-shadow .15s}.siTile svg{fill:currentColor;height:24px;width:24px}.siTile:hover{background:#dcf5ec;border-color:#059669;color:#059669}.siTile:focus-visible{outline:2px solid #059669;outline-offset:2px}.siTile.is-selected{border-color:transparent;box-shadow:0 4px 10px rgba(5,150,105,.25)}.siBadge,.siTile.is-selected{background:#059669;color:#fff}.siBadge{border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.04em;line-height:1.2;margin-left:8px;padding:3px 8px;text-transform:uppercase;vertical-align:1px}.siHelpCards{display:grid;gap:8px;grid-template-columns:1fr 1fr}.siHelpCard{align-items:center;background:#059669;border-radius:10px;box-shadow:0 4px 10px rgba(5,150,105,.2);color:#fff!important;display:flex;flex-direction:column;font-size:12.5px;font-weight:600;gap:8px;justify-content:center;min-height:86px;padding:12px 8px;text-align:center;text-decoration:none;transition:transform .15s,box-shadow .15s}.siHelpCard svg{fill:currentColor;height:26px;width:26px}.siHelpCard:focus-visible,.siHelpCard:hover{background:#047857;box-shadow:0 8px 16px rgba(5,150,105,.3);color:#fff;transform:translateY(-2px)}.siHelpCard:focus-visible{outline:2px solid #047857;outline-offset:2px}.components-tooltip.siTipBubble{background:#1e1e1e;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.2);color:#fff;font-size:12px;line-height:1.45;max-width:240px;padding:8px 11px;text-align:left;white-space:normal}.alfbHelp{color:#757575;font-size:12px;margin:8px 0 0}.alfbPlaceholderHelp{flex-basis:100%;font-size:13px;margin:12px 0 0}.alfbImages{display:grid;gap:4px;grid-template-columns:repeat(4,1fr);margin:0 0 12px}.alfbImages img{aspect-ratio:3/4;border-radius:2px;display:block;-o-object-fit:cover;object-fit:cover;width:100%}.alfbStack{align-items:flex-start;display:flex;flex-direction:column;gap:10px}.alfbStack p{margin:0;word-break:break-all}.alfbStack .alfbHelp{margin:0}.alfbFile{color:#1e1e1e;font-weight:600}.alfbCoverThumb{border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.2);display:block;max-height:128px;max-width:96px}.alfbButtons{display:flex;flex-wrap:wrap;gap:8px}.wp-block-softicon-flipbook .alfb_lb_trigger{cursor:default}.alfbProNotice p{color:#50575e;margin:0 0 8px}.alfbProNotice .dashicons{color:#ea8a10}.alfbProNoticeLink{font-weight:600}.alfbShortcode{margin-top:16px}.alfbShortcodeRow{display:flex;gap:6px;margin-top:8px}.alfbShortcodeRow input{flex:1;font-family:Menlo,Consolas,monospace;font-size:12px;min-width:0}.alfbDeviceHeights{display:grid;gap:8px 12px;grid-template-columns:1fr 1fr}.alfbDeviceHeights>:first-child{grid-column:1/-1}
     1.block-editor-block-inspector:has(.siSettings),.siSettings{--wp-admin-theme-color:#059669;--wp-admin-theme-color--rgb:5,150,105;--wp-admin-theme-color-darker-10:#047857;--wp-admin-theme-color-darker-20:#065f46;--wp-components-color-accent:#059669;--wp-components-color-accent-darker-10:#047857;--wp-components-color-accent-darker-20:#065f46;--wpds-color-stroke-focus:#059669;--wpds-color-background-interactive-brand-strong:#059669;--wpds-color-background-interactive-brand-strong-active:#047857;--wpds-color-background-interactive-brand-weak-active:#dcf5ec;--wpds-color-background-surface-brand:#dcf5ec;--wpds-color-background-thumb-brand:#059669;--wpds-color-background-thumb-brand-active:#059669;--wpds-color-foreground-interactive-brand:#059669;--wpds-color-foreground-interactive-brand-active:#047857;--wpds-color-stroke-interactive-brand:#059669;--wpds-color-stroke-interactive-brand-active:#047857;--wpds-color-stroke-surface-brand:#b0e6d2;--wpds-color-stroke-surface-brand-strong:#059669}.siSettings .components-tab-panel__tabs{border-bottom:1px solid #e0e0e0;display:flex}.siSettings .components-tab-panel__tabs-item{color:#50575e;flex:1;font-weight:500;height:48px;justify-content:center}.siSettings .components-tab-panel__tabs-item:after{background:transparent;height:3px}.siSettings .components-tab-panel__tabs-item.is-active{background:#dcf5ec;color:#059669;font-weight:600}.siSettings .components-tab-panel__tabs-item.is-active:after{background:#059669}.siSettings .components-external-link,.siSettings .components-tab-panel__tabs-item:hover:not(.is-active),.siSettings a{color:#059669}.siSettings .components-toggle-control .components-form-toggle.is-checked .components-form-toggle__track{background:#059669;border-color:#059669}.siPanel{position:relative;transition:background-color .2s}.siPanel>.components-panel__body-title .components-panel__body-toggle{font-weight:600;transition:color .15s,background-color .15s}.siPanel:not(.is-opened)>.components-panel__body-title:hover{background:#f0faf6}.siPanel:not(.is-opened)>.components-panel__body-title:hover .components-panel__body-toggle{color:#059669}.siPanel.is-opened{background:#fff;border:1px solid #059669;margin-top:-1px;z-index:1}.siPanel.is-opened>.components-panel__body-title{background:#dcf5ec;margin:-16px -16px 16px}.siPanel.is-opened>.components-panel__body-title .components-panel__arrow,.siPanel.is-opened>.components-panel__body-title .components-panel__body-toggle{color:#059669}.siFields{display:flex;flex-direction:column;gap:20px;padding:4px 0 8px}.siFields .components-base-control,.siFields .components-base-control__field,.siFields>*{margin-bottom:0;margin-top:0}.siFields .components-base-control__help{margin-bottom:0;margin-top:6px}.siFields p{margin:0}.siColors{display:flex;flex-direction:column;gap:4px}.siColorRow{display:block}.siColorToggle.components-button{align-items:center;border-radius:6px;color:#1e1e1e;display:flex;font-size:13px;gap:12px;height:40px;padding:0 4px 0 0;width:100%}.siColorToggle.components-button:hover,.siColorToggle.components-button[aria-expanded=true]{background:transparent;color:#059669}.siColorToggle.components-button .component-color-indicator{border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);flex:none;height:26px;margin:0;width:26px}.siColorToggle.components-button .component-color-indicator.is-empty{background:repeating-conic-gradient(#e0e0e0 0 25%,#fff 0 50%) 50%/8px 8px}.siColorToggle.components-button .siColorName{flex:1;text-align:left}.siColorPopover{padding:16px;width:260px}.siFieldHead{align-items:center;display:flex;gap:6px;margin-bottom:8px}.siFieldLabel{color:#1e1e1e;font-size:13px;font-weight:500;line-height:1.4}.siFieldLine{background:#e0e0e0;flex:1;height:1px;margin-left:4px}.siReset.components-button{font-size:12px;height:26px;padding:0 10px}.siTip{align-items:center;background:none;border:0;border-radius:50%;color:#8c8f94;cursor:help;display:inline-flex;height:20px;justify-content:center;margin:0;padding:0;width:20px}.siTip svg{fill:currentColor;height:16px;width:16px}.siTip:focus-visible,.siTip:hover{background:#dcf5ec;color:#059669;outline:none}.siToggleRow{align-items:center;display:flex;gap:6px}.siToggleRow .components-toggle-control{margin:0}.siTilesGrid{display:grid;gap:8px}.siTile{align-items:center;background:#fff;border:1px solid #dcdcde;border-radius:10px;color:#3c434a;cursor:pointer;display:flex;flex-direction:column;font-size:12px;font-weight:600;gap:6px;justify-content:center;line-height:1.2;margin:0;min-height:68px;padding:10px 6px;text-align:center;transition:border-color .15s,background .15s,color .15s,box-shadow .15s}.siTile svg{fill:currentColor;height:24px;width:24px}.siTile:hover{background:#dcf5ec;border-color:#059669;color:#059669}.siTile:focus-visible{outline:2px solid #059669;outline-offset:2px}.siTile.is-selected{border-color:transparent;box-shadow:0 4px 10px rgba(5,150,105,.25)}.siBadge,.siTile.is-selected{background:#059669;color:#fff}.siBadge{border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.04em;line-height:1.2;margin-left:8px;padding:3px 8px;text-transform:uppercase;vertical-align:1px}.siHelpCards{display:grid;gap:8px;grid-template-columns:1fr 1fr}.siHelpCard{align-items:center;background:#059669;border-radius:10px;box-shadow:0 4px 10px rgba(5,150,105,.2);color:#fff!important;display:flex;flex-direction:column;font-size:12.5px;font-weight:600;gap:8px;justify-content:center;min-height:86px;padding:12px 8px;text-align:center;text-decoration:none;transition:transform .15s,box-shadow .15s}.siHelpCard svg{fill:currentColor;height:26px;width:26px}.siHelpCard:focus-visible,.siHelpCard:hover{background:#047857;box-shadow:0 8px 16px rgba(5,150,105,.3);color:#fff;transform:translateY(-2px)}.siHelpCard:focus-visible{outline:2px solid #047857;outline-offset:2px}.components-tooltip.siTipBubble{background:#1e1e1e;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.2);color:#fff;font-size:12px;line-height:1.45;max-width:240px;padding:8px 11px;text-align:left;white-space:normal}.alfbHelp{color:#757575;font-size:12px;margin:8px 0 0}.alfbPlaceholderHelp{flex-basis:100%;font-size:13px;margin:12px 0 0}.alfbGuide{background:#f0fdfa;border-left:3px solid #0f766e;border-radius:4px;color:#1e1e1e;flex-basis:100%;font-size:13px;line-height:1.5;margin:4px 0 14px;padding:12px 16px 12px 34px}.alfbGuide li{margin:0 0 4px}.alfbGuide li:last-child{margin-bottom:0}.alfbImages{display:grid;gap:4px;grid-template-columns:repeat(4,1fr);margin:0 0 12px}.alfbImages img{aspect-ratio:3/4;border-radius:2px;display:block;-o-object-fit:cover;object-fit:cover;width:100%}.alfbStack{align-items:flex-start;display:flex;flex-direction:column;gap:10px}.alfbStack p{margin:0;word-break:break-all}.alfbStack .alfbHelp{margin:0}.alfbFile{color:#1e1e1e;font-weight:600}.alfbCoverThumb{border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.2);display:block;max-height:128px;max-width:96px}.alfbButtons{display:flex;flex-wrap:wrap;gap:8px}.wp-block-softicon-flipbook .alfb_lb_trigger{cursor:default}.alfbProNotice p{color:#50575e;margin:0 0 8px}.alfbProNotice .dashicons{color:#ea8a10}.alfbProNoticeLink{font-weight:600}.alfbShortcode{margin-top:16px}.alfbShortcodeRow{display:flex;gap:6px;margin-top:8px}.alfbShortcodeRow input{flex:1;font-family:Menlo,Consolas,monospace;font-size:12px;min-width:0}.alfbDeviceHeights{display:grid;gap:8px 12px;grid-template-columns:1fr 1fr}.alfbDeviceHeights>:first-child{grid-column:1/-1}
  • softicon-flipbook/trunk/build/index.js

    r3800561 r3802072  
    1 (()=>{var e={919(e,t,o){"use strict";o(387);const i=window.wp.blocks,s=window.wp.data,a=window.wp.domReady;var n=o.n(a);const l=window.wp.hooks,r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"softicon/flipbook","version":"1.5.0","title":"Flipbook","category":"media","description":"Turn a PDF or a set of images into a page-turning flipbook.","keywords":["flipbook","pdf","magazine","catalog","brochure"],"textdomain":"softicon-flipbook","attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}},"supports":{"html":false,"align":["wide","full"],"spacing":{"margin":true}},"example":{"attributes":{"source":"images"}},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php"}'),h=window.React,c=window.wp.i18n,p=window.wp.element,d=window.wp.blockEditor,f=window.wp.components,u=window.wp.compose,b=(e,t,o=document)=>{const i=[];if(!t?.head||t===o)return i;const s=(e,s=t.head)=>{const a=o.getElementById(e);if(!a||t.getElementById(e))return null;const n=((e,t)=>{if("SCRIPT"!==e.tagName)return t.importNode(e,!0);const o=t.createElement("script");return[...e.attributes].forEach(({name:e,value:t})=>o.setAttribute(e,t)),o.async=!1,o.text=e.text,o})(a,t);return s.appendChild(n),i.push(e),n};return e.filter(Boolean).forEach(e=>{const{before:t,main:o,after:i}=(e=>{if(e.endsWith("-js")){const t=e.slice(0,-3);return{before:[`${t}-js-translations`,`${t}-js-extra`,`${t}-js-before`],main:e,after:[`${t}-js-after`]}}return e.endsWith("-css")?{before:[],main:e,after:[`${e.slice(0,-4)}-inline-css`]}:{before:[],main:e,after:[]}})(e);t.forEach(e=>s(e));const a=s(o);a&&"SCRIPT"===a.tagName&&a.src?a.addEventListener("load",()=>i.forEach(e=>s(e)),{once:!0}):i.forEach(e=>s(e))}),i},m=window.wp.primitives,g=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),_={info:g("M12 2.75a9.25 9.25 0 1 1 0 18.5 9.25 9.25 0 0 1 0-18.5m0 1.5a7.75 7.75 0 1 0 0 15.5 7.75 7.75 0 0 0 0-15.5M11.2 10.6h1.6V17h-1.6zm0-3.4h1.6v1.7h-1.6z",!0),video:g("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m5.5 4v7l6-3.5z"),support:g("M4.5 4h15A1.5 1.5 0 0 1 21 5.5v10a1.5 1.5 0 0 1-1.5 1.5H10l-5 4v-4h-.5A1.5 1.5 0 0 1 3 15.5v-10A1.5 1.5 0 0 1 4.5 4M7 8.5V10h10V8.5zm0 3V13h7v-1.5z",!0),star:g("M12 2.75l2.85 5.95 6.55.75-4.85 4.5 1.3 6.5L12 17.2l-5.85 3.25 1.3-6.5L2.6 9.45l6.55-.75z"),plugins:g("M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z")},k=(0,p.createContext)({open:null,toggle:()=>{}}),v=({initial:e,children:t})=>{const[o,i]=(0,p.useState)(e);return(0,h.createElement)(k.Provider,{value:{open:o,toggle:e=>i(t=>t===e?null:e)}},t)},w=({id:e,title:t,badge:o,children:i})=>{const{open:s,toggle:a}=(0,p.useContext)(k);return(0,h.createElement)(f.PanelBody,{className:"siPanel",title:(0,h.createElement)(h.Fragment,null,t,o&&(0,h.createElement)("span",{className:"siBadge"},o)),opened:s===e,onToggle:()=>a(e)},(0,h.createElement)("div",{className:"siFields"},i))},y=({text:e})=>(0,h.createElement)(f.Tooltip,{text:e,placement:"top",className:"siTipBubble"},(0,h.createElement)("button",{type:"button",className:"siTip","aria-label":e},_.info)),E=({label:e,tip:t,action:o})=>(0,h.createElement)("div",{className:"siFieldHead"},(0,h.createElement)("span",{className:"siFieldLabel"},e),t&&(0,h.createElement)(y,{text:t}),(0,h.createElement)("span",{className:"siFieldLine","aria-hidden":"true"}),o),x=({onClick:e,disabled:t})=>(0,h.createElement)(f.Button,{className:"siReset",variant:"secondary",size:"small",onClick:e,disabled:t},(0,c.__)("Reset","softicon-flipbook")),C=({label:e,tip:t,checked:o,onChange:i})=>(0,h.createElement)("div",{className:"siToggleRow"},(0,h.createElement)(f.ToggleControl,{label:e,checked:o,onChange:i,__nextHasNoMarginBottom:!0}),t&&(0,h.createElement)(y,{text:t})),M=({label:e,tip:t,value:o,options:i,onChange:s})=>(0,h.createElement)("div",{className:"siTiles"},(0,h.createElement)(E,{label:e,tip:t}),(0,h.createElement)("div",{className:"siTilesGrid",role:"radiogroup","aria-label":e,style:{gridTemplateColumns:`repeat(${i.length}, 1fr)`}},i.map(e=>(0,h.createElement)("button",{key:e.value,type:"button",role:"radio","aria-checked":o===e.value,className:"siTile"+(o===e.value?" is-selected":""),onClick:()=>s(e.value)},e.icon,(0,h.createElement)("span",null,e.label))))),P=({label:e,value:t,onChange:o})=>(0,h.createElement)(f.Dropdown,{className:"siColorRow",popoverProps:{placement:"left-start",offset:36},renderToggle:({isOpen:o,onToggle:i})=>(0,h.createElement)(f.Button,{className:"siColorToggle",onClick:i,"aria-expanded":o
    2 /* translators: %s: a color setting, like Background */,"aria-label":(0,c.sprintf)((0,c.__)("%s color","softicon-flipbook"),e)+(t?": "+t:"")},(0,h.createElement)("span",{className:"siColorName"},e),(0,h.createElement)(f.ColorIndicator,{colorValue:t||void 0,className:t?"":"is-empty"})),renderContent:()=>(0,h.createElement)("div",{className:"siColorPopover"},(0,h.createElement)(d.ColorPalette,{value:t,onChange:e=>o(e||""),clearable:!0}))}),T=({cards:e})=>(0,h.createElement)("div",{className:"siHelpCards"},e.map(e=>(0,h.createElement)("a",{key:e.href,className:"siHelpCard",href:e.href,target:"_blank",rel:"noopener noreferrer"},e.icon,(0,h.createElement)("span",null,e.label),(0,h.createElement)("span",{className:"screen-reader-text"},(0,c.__)("(opens in a new tab)","softicon-flipbook"))))),L=(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,h.createElement)(m.Path,{d:"M12 6.5C10.3 5.3 8 4.75 5 4.75H3v13h2c3 0 5.3.55 7 1.75 1.7-1.2 4-1.75 7-1.75h2v-13h-2c-3 0-5.3.55-7 1.75m-1.25 10.6c-1.5-.6-3.4-.9-5.75-.85V6.25c2.5 0 4.4.45 5.75 1.4zm8.25-.85c-2.35-.05-4.25.25-5.75.85V7.65c1.35-.95 3.25-1.4 5.75-1.4z"})),S=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),z={pdf:S("M6 2.5h7.6L19.5 8.4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M6 4v16h12V9.5h-5.5V4zm8 .6V8h3.4zM8 12.5h8V14H8zm0 3h8V17H8z",!0),images:S("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m0 1.5v10.4l4.2-4.2 2.8 2.8 4.3-4.7 3.7 4V6zM8.5 10.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5",!0),auto:S("M2 4.5h14v10H2zm1.5 1.5v7h11V6zM6 16.5h6V18H6zM17 8h5v12.5h-5zm1.5 1.5V19h2V9.5z",!0),twoPages:S("M2.5 5h8.5v14H2.5zM4 6.5v11h5.5v-11zM13 5h8.5v14H13zm1.5 1.5v11H20v-11z",!0),onePage:S("M6.5 3h11v18h-11zM8 4.5v15h8v-15zM10 8h4v1.5h-4zm0 3h4v1.5h-4z",!0),classic:S("M3 6.5h8.25v11H3zM4.5 8v8h5.25V8zM12.75 6.5H21v11h-8.25zm1.5 1.5v8h5.25V8z",!0),hardcover:S("M1.5 4.5h21v15h-21zM3 6v12h8.25V6zm9.75 0v12H21V6z",!0),cover:S("M6 2.5h12A1.5 1.5 0 0 1 19.5 4v16a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M8 4v16h10V4zm2.5 3H16v1.5h-5.5z",!0),button:S("M4 7h16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2m0 1.5a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5zM7 11.25h10v1.5H7z",!0),text:S("M3 7h18v1.5H3zm0 4.5h12V13H3zm0 4.5h7.5v1.5H3z"),alignLeft:S("M4 5h16v1.5H4zm0 4h10v1.5H4zm0 4h16v1.5H4zm0 4h10v1.5H4z"),alignCenter:S("M4 5h16v1.5H4zm3 4h10v1.5H7zm-3 4h16v1.5H4zm3 4h10v1.5H7z"),alignRight:S("M4 5h16v1.5H4zm6 4h10v1.5H10zm-6 4h16v1.5H4zm6 4h10v1.5H10z")},H=[{name:"general",title:(0,c.__)("General","softicon-flipbook"),className:"general"},{name:"style",title:(0,c.__)("Style","softicon-flipbook"),className:"style"}],N=[{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto",icon:z.auto},{label:(0,c.__)("Two pages","softicon-flipbook"),value:"double",icon:z.twoPages},{label:(0,c.__)("One page","softicon-flipbook"),value:"single",icon:z.onePage}],A=[{label:(0,c.__)("PDF file","softicon-flipbook"),value:"pdf",icon:z.pdf},{label:(0,c.__)("Images","softicon-flipbook"),value:"images",icon:z.images}],F="&list=PLJEAefIarF4g",B={overview:"https://www.youtube.com/watch?v=5geq69DXoN8"+F,add:"https://www.youtube.com/watch?v=KGP_xpi8NGo"+F,design:"https://www.youtube.com/watch?v=qqQeZQkX5ms"+F,reading:"https://www.youtube.com/watch?v=1J7wCaUvugc"+F,lightbox:"https://www.youtube.com/watch?v=XBJuUV9HpkA"+F,settings:"https://www.youtube.com/watch?v=H9IxgIocY68"+F,promo:"https://www.youtube.com/watch?v=Oj9sHOZbb3A"+F,shortcode:"https://www.youtube.com/watch?v=slQlR4GTghg"+F,autoplay:"https://www.youtube.com/watch?v=bkuMUupI92Y"+F,rtl:"https://www.youtube.com/watch?v=MzZs4jJInFA"+F,shelf:"https://www.youtube.com/watch?v=9UY2KNYzkGk"+F,buttons:"https://www.youtube.com/watch?v=fS5RMGkPQXk"+F,leads:"https://www.youtube.com/watch?v=GxbrW_pyAdA"+F,protect:"https://www.youtube.com/watch?v=5UNgRO22s_Q"+F,hotspots:"https://www.youtube.com/watch?v=D7WiNswbHi8"+F,branding:"https://www.youtube.com/watch?v=iOr2NJ0yaAA"+F,analytics:"https://www.youtube.com/watch?v=ET4JXhOO-2s"+F,field:"https://www.youtube.com/watch?v=BGlS_IKKagM"+F,bookmarks:"https://www.youtube.com/watch?v=4-D5HxqV1yg"+F,pro:"https://www.youtube.com/watch?v=LtCj7-J2qXI"+F},I=[{label:(0,c.__)("Classic","softicon-flipbook"),value:"flat",icon:z.classic},{label:(0,c.__)("Hardcover","softicon-flipbook"),value:"hardcover",icon:z.hardcover}],D=[{label:(0,c.__)("Cover","softicon-flipbook"),value:"cover",icon:z.cover},{label:(0,c.__)("Button","softicon-flipbook"),value:"button",icon:z.button},{label:(0,c.__)("Text link","softicon-flipbook"),value:"text",icon:z.text}],R=[{label:(0,c.__)("Left","softicon-flipbook"),value:"left",icon:z.alignLeft},{label:(0,c.__)("Center","softicon-flipbook"),value:"center",icon:z.alignCenter},{label:(0,c.__)("Right","softicon-flipbook"),value:"right",icon:z.alignRight}],V=[{href:"https://www.youtube.com/playlist?list=PLJEAefIarF4g",label:(0,c.__)("Video tutorials","softicon-flipbook"),icon:_.video},{href:"https://wordpress.org/support/plugin/softicon-flipbook/",label:(0,c.__)("Get support","softicon-flipbook"),icon:_.support},{href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",label:(0,c.__)("Rate Flipbook","softicon-flipbook"),icon:_.star},{href:"https://wordpress.org/plugins/author/softiconai/",label:(0,c.__)("More plugins","softicon-flipbook"),icon:_.plugins}],W=({text:e,href:t})=>(0,h.createElement)("div",{className:"alfbProNotice"},(0,h.createElement)("p",null,(0,h.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})," ",e),t&&(0,h.createElement)(f.ExternalLink,{href:t,className:"alfbProNoticeLink"},(0,c.__)("Unlock with Pro","softicon-flipbook"))),O=({value:e,onChange:t})=>{const[o,i]=(0,p.useState)(String(e));return(0,p.useEffect)(()=>i(String(e)),[e]),(0,h.createElement)(f.TextControl,{type:"number",min:1,label:(0,c.__)("Open at page","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:e=>{i(e),parseInt(e,10)>=1&&t(parseInt(e,10))},onBlur:()=>i(String(e)),__nextHasNoMarginBottom:!0})},U=window.alfbEditor||{},j=()=>{const[e,t]=(0,p.useState)(!1),{type:o,id:i,published:a}=(0,s.useSelect)(e=>{const t=e("core/editor");return{type:t?.getCurrentPostType(),id:t?.getCurrentPostId(),published:"publish"===t?.getEditedPostAttribute("status")}},[]);if("alfb_book"!==o||!i)return null;const n=`[softicon_flipbook id="${i}"]`;return(0,h.createElement)("div",{className:"alfbShortcode"},(0,h.createElement)(E,{label:(0,c.__)("Shortcode","softicon-flipbook"),tip:(0,c.__)("Paste it in the Classic Editor, Elementor or any page builder to show this flipbook there.","softicon-flipbook")}),(0,h.createElement)("div",{className:"alfbShortcodeRow"},(0,h.createElement)("input",{type:"text",readOnly:!0,value:n,onFocus:e=>e.target.select(),"aria-label":(0,c.__)("Shortcode","softicon-flipbook")}),(0,h.createElement)(f.Button,{variant:"secondary",onClick:e=>{const o=e.currentTarget.previousElementSibling,i=()=>{t(!0),setTimeout(()=>t(!1),1600)};window.navigator.clipboard&&window.isSecureContext?window.navigator.clipboard.writeText(n).then(i):(o.select(),o.ownerDocument.execCommand("copy")&&i())}},e?(0,c.__)("Copied","softicon-flipbook"):(0,c.__)("Copy","softicon-flipbook"))),!a&&(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("It shows the flipbook once it is published.","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shortcode},(0,c.__)("Where to paste it: the Classic Editor, Elementor and more","softicon-flipbook"))))},q=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>{const{source:s,pdfId:a,pdfUrl:n,images:r,pageMode:p,showCover:u,startPage:b,startWith:m,autoplay:g,autoplaySeconds:_,autoplayLoop:k,rtl:v,phoneFullscreen:y,showDownload:x,showPrint:P,showFullscreen:L,showZoom:S,showThumbnails:z,showContents:H,showLinks:F,showSearch:I,showShare:D,flipSound:R}=e,q=e=>o=>t({[e]:o}),$=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),Z=(()=>{const e=n?n.split("/").pop().split("?")[0]:"";try{return decodeURIComponent(e)}catch(t){return e}})();return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"help",title:(0,c.__)("Help","softicon-flipbook")},(0,h.createElement)(T,{cards:V}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.settings},(0,c.__)("Every setting explained, in 2 minutes","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("Email:","softicon-flipbook")," ",(0,h.createElement)("a",{href:"mailto:support@softiconai.com"},"support@softiconai.com")),(0,h.createElement)(j,null)),(0,h.createElement)(w,{id:"source",title:(0,c.__)("Source","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Pages from","softicon-flipbook"),value:s,options:A,onChange:q("source")}),"pdf"===s?(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("PDF","softicon-flipbook"),tip:(0,c.__)("PDFs from your Media Library always work. A link to a PDF on another website works only if that site allows it.","softicon-flipbook")}),Z&&(0,h.createElement)("p",{className:"alfbFile"},Z),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["application/pdf"],value:a,onSelect:o,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},n?(0,c.__)("Replace PDF","softicon-flipbook"):(0,c.__)("Choose PDF","softicon-flipbook"))})),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Taking each post's PDF from a custom field (Meta Box, ACF), and text readers can select and copy, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.field},(0,c.__)("Watch: each post's own PDF from Meta Box or ACF","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Links in the PDF","softicon-flipbook"),tip:(0,c.__)("Web, email and page links inside the PDF can be clicked. Web links open in a new tab, page links turn the book.","softicon-flipbook"),checked:F,onChange:q("showLinks")}),$("showLinks")):(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Pages","softicon-flipbook"),tip:(0,c.__)("Each image is one page. Drag them in the media window to change the order.","softicon-flipbook")}),!!r.length&&(0,h.createElement)("div",{className:"alfbImages"},r.slice(0,8).map(e=>(0,h.createElement)("img",{key:e.id||e.url,src:e.url,alt:""}))),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:r.map(e=>e.id),onSelect:i,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},r.length?(0,c.__)("Edit pages","softicon-flipbook"):(0,c.__)("Choose images","softicon-flipbook"))})))),(0,h.createElement)(w,{id:"pages",title:(0,c.__)("Pages","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Layout","softicon-flipbook"),tip:(0,c.__)("Auto shows two pages side by side on wide screens and one page on phones. Or keep one layout everywhere.","softicon-flipbook"),value:p,options:N,onChange:q("pageMode")}),$("pageMode"),(0,h.createElement)(C,{label:(0,c.__)("Cover page","softicon-flipbook"),tip:(0,c.__)("The first and last pages turn on their own, like a printed book.","softicon-flipbook"),checked:u,onChange:q("showCover")}),$("showCover"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Open at page","softicon-flipbook"),tip:(0,c.__)("The book opens at this page. A link ending in #page=5 opens it at page 5.","softicon-flipbook")}),(0,h.createElement)(O,{value:b,onChange:e=>t({startPage:e})})),(0,h.createElement)(f.SelectControl,{label:(0,c.__)("Start with","softicon-flipbook"),help:(0,c.__)("Readers can first pick a page from the thumbnails or the table of contents (from the PDF's bookmarks). On the published page.","softicon-flipbook"),value:m,onChange:q("startWith"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:(0,c.__)("The book","softicon-flipbook"),value:"book"},{label:(0,c.__)("The thumbnails","softicon-flipbook"),value:"thumbnails"},{label:(0,c.__)("The table of contents","softicon-flipbook"),value:"contents"}]}),(0,h.createElement)(C,{label:(0,c.__)("Right to left","softicon-flipbook"),tip:(0,c.__)("For books read from right to left, such as Arabic, Hebrew or Urdu: the next page is on the left, and the arrows and arrow keys follow.","softicon-flipbook"),checked:v,onChange:q("rtl")}),$("rtl"),(0,h.createElement)(C,{label:(0,c.__)("Autoplay","softicon-flipbook"),tip:(0,c.__)("Turns the pages by itself while the book is on screen, on the published page. It holds while the mouse is over the book, stops when a reader takes over, and the toolbar gets a pause button.","softicon-flipbook"),checked:g,onChange:q("autoplay")}),g&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Seconds per page","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:2,max:60,label:(0,c.__)("Seconds per page","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({autoplaySeconds:Math.min(60,Math.max(2,parseInt(e,10)||4))}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$("autoplaySeconds")),(0,h.createElement)(C,{label:(0,c.__)("Start again at the end","softicon-flipbook"),tip:(0,c.__)("After the last page the book goes back to the first one and keeps playing.","softicon-flipbook"),checked:k,onChange:q("autoplayLoop")}),$("autoplayLoop")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.autoplay},(0,c.__)("Watch autoplay in 45 seconds","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.rtl},(0,c.__)("Watch right to left and fullscreen on phones","softicon-flipbook")))),(0,h.createElement)(w,{id:"toolbar",title:(0,c.__)("Toolbar","softicon-flipbook")},(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("The preview here shows only the book; the buttons work on the published page.","softicon-flipbook")),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Download button","softicon-flipbook"),tip:(0,c.__)("Lets visitors save the PDF.","softicon-flipbook"),checked:x,onChange:q("showDownload")}),$("showDownload")),(0,h.createElement)(C,{label:(0,c.__)("Print button","softicon-flipbook"),tip:(0,c.__)("Readers print the whole book. The pages are prepared in the browser first, so a long book takes a moment.","softicon-flipbook"),checked:P,onChange:q("showPrint")}),$("showPrint"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen button","softicon-flipbook"),tip:(0,c.__)("Fits the book to the screen and redraws the pages sharper.","softicon-flipbook"),checked:L,onChange:q("showFullscreen")}),$("showFullscreen"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen on phones","softicon-flipbook"),tip:(0,c.__)('On a phone the book shows "Tap to read"; one tap opens it full screen, where the pages are easier to read.',"softicon-flipbook"),checked:y,onChange:q("phoneFullscreen")}),$("phoneFullscreen"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Table of contents","softicon-flipbook"),tip:(0,c.__)("A button with the PDF's chapters (its bookmarks), a click opens one. It shows only when the PDF has bookmarks.","softicon-flipbook"),checked:H,onChange:q("showContents")}),$("showContents")),(0,h.createElement)(C,{label:(0,c.__)("Thumbnails","softicon-flipbook"),tip:(0,c.__)("A button that shows all pages, a click opens one.","softicon-flipbook"),checked:z,onChange:q("showThumbnails")}),$("showThumbnails"),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Bookmarks, so readers can mark pages and come back to them, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.bookmarks},(0,c.__)("Watch: bookmarks and selectable text","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Zoom","softicon-flipbook"),tip:(0,c.__)("Zoom buttons, pinch on phones and Ctrl + scroll on computers.","softicon-flipbook"),checked:S,onChange:q("showZoom")}),$("showZoom"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Search","softicon-flipbook"),tip:(0,c.__)("A search box that lists the pages with the words, a click opens the page. PDFs only.","softicon-flipbook"),checked:I,onChange:q("showSearch")}),$("showSearch")),(0,h.createElement)(C,{label:(0,c.__)("Share","softicon-flipbook"),tip:(0,c.__)("A link to the page that is open: on Facebook, X, LinkedIn, Pinterest, by email or copied. Phones use their own share sheet.","softicon-flipbook"),checked:D,onChange:q("showShare")}),$("showShare"),(0,h.createElement)(C,{label:(0,c.__)("Page turn sound","softicon-flipbook"),tip:(0,c.__)("Visitors can mute it from the toolbar.","softicon-flipbook"),checked:R,onChange:q("flipSound")}),$("flipSound")),!U.pro&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"buttons",title:(0,c.__)("Page buttons","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("A button on a chosen page, such as a link or a WooCommerce product with its price, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.buttons},(0,c.__)("Watch page buttons in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"hotspots",title:(0,c.__)("Hotspots","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Clickable areas on your pages, with a link or a WooCommerce product and its price, are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.hotspots},(0,c.__)("Watch hotspots in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"leads",title:(0,c.__)("Lead capture","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Asking readers for their email after a few pages is available in Pro. The leads are saved on your site.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.leads},(0,c.__)("Watch lead capture in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"shelf",title:(0,c.__)("Shelf","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Showing many books on one shelf, each opening in a popup, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shelf},(0,c.__)("Watch the shelf in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"protect",title:(0,c.__)("Protection","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Protecting the PDF (a password, no download button, no right-click, the PDF address kept out of the page) is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.protect},(0,c.__)("Watch protection in 40 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"watermark",title:(0,c.__)("Watermark","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Your words or logo drawn into every page, with the reader's name or email if you like, is available in Pro.","softicon-flipbook")}))))},$=e=>({id:e.id,url:e.url||e.source_url,alt:e.alt||e.alt_text||"",width:e.width||e.media_details?.width||0,height:e.height||e.media_details?.height||0}),Z=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],G=e=>(e="string"==typeof e?e.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(e)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(e)&&[...e.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>Z.includes(e))?e:void 0),X=window.alfbEditor||{},Y=({attributes:e,setAttributes:t})=>{const{bookTitle:o,theme:i,maxHeight:s,maxHeightTablet:a,maxHeightPhone:n,bookStyle:r,sideArrows:p,displayMode:u,lightboxTrigger:b,lightboxText:m,lightboxImage:g,lightboxWidth:_,lightboxAlign:k}=e,v="hardcover"===r,y="lightbox"===u,T="cover"===b,L=e=>o=>t({[e]:o}),S=t=>({value:e[t],onChange:L(t)}),z=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),H=(e,t)=>(0,l.applyFilters)("alfb.block.reset",t,e),N=(e,t)=>(0,l.applyFilters)("alfb.block.atDefault",t,e);return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"display",title:(0,c.__)("Display","softicon-flipbook"),badge:(0,c.__)("New","softicon-flipbook")},(0,h.createElement)(C,{label:(0,c.__)("Open in a lightbox","softicon-flipbook"),tip:(0,c.__)("Off: the book shows on the page. On: only a cover, button or link shows on the page, and a click opens the book in a popup over the page; the book loads only then.","softicon-flipbook"),checked:y,onChange:e=>t({displayMode:e?"lightbox":"inline"})}),z("displayMode"),!y&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Title above the book","softicon-flipbook"),tip:(0,c.__)("Shown above the book, also in full screen. Leave it empty for no title.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:(0,c.__)("Title above the book","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:L("bookTitle"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),y&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(M,{label:(0,c.__)("Open with","softicon-flipbook"),value:b,options:D,onChange:L("lightboxTrigger")}),z("lightboxTrigger"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),tip:T?(0,c.__)("Shown under the cover. Leave it empty for no caption.","softicon-flipbook"):(0,c.__)('Leave it empty for "Read the flipbook".',"softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),hideLabelFromVision:!0,value:m,onChange:L("lightboxText"),placeholder:T?"":(0,c.__)("Read the flipbook","softicon-flipbook"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),T&&(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Cover image","softicon-flipbook"),tip:(0,c.__)("Without an image the first page is the cover.","softicon-flipbook")}),g?.url&&(0,h.createElement)("img",{className:"alfbCoverThumb",src:g.url,alt:""}),(0,h.createElement)("div",{className:"alfbButtons"},(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],value:g?.id,onSelect:e=>t({lightboxImage:$(e)}),render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},g?.url?(0,c.__)("Replace image","softicon-flipbook"):(0,c.__)("Choose image","softicon-flipbook"))})),g?.url&&(0,h.createElement)(f.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>t({lightboxImage:{}})},(0,c.__)("Remove","softicon-flipbook")))),T&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),tip:(0,c.__)("Narrow columns and phones make the cover smaller.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({lightboxWidth:H("lightboxWidth",260)}),disabled:N("lightboxWidth",260===_)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({lightboxWidth:e||260}),min:120,max:600,step:10,__nextHasNoMarginBottom:!0}),z("lightboxWidth")),(0,h.createElement)(M,{label:(0,c.__)("Alignment","softicon-flipbook"),value:k,options:R,onChange:L("lightboxAlign")}),z("lightboxAlign")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.lightbox},(0,c.__)("See the lightbox in action","softicon-flipbook")))),(0,h.createElement)(w,{id:"design",title:(0,c.__)("Design","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Design","softicon-flipbook"),tip:(0,c.__)("Hardcover puts the pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows beside the book.","softicon-flipbook"),value:r,options:I,onChange:e=>t({bookStyle:e,sideArrows:"hardcover"===e})}),z("bookStyle"),v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Side arrows","softicon-flipbook"),tip:(0,c.__)("Large arrows beside the book. On phones they sit over the page edges.","softicon-flipbook"),checked:p,onChange:L("sideArrows")}),z("sideArrows")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.design},(0,c.__)("See the Hardcover design in action","softicon-flipbook")))),!y&&(0,h.createElement)(w,{id:"size",title:(0,c.__)("Size","softicon-flipbook")},(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),tip:(0,c.__)("The book keeps the page shape and shrinks to fit smaller screens.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({maxHeight:H("maxHeight",700)}),disabled:N("maxHeight",700===s)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),hideLabelFromVision:!0,value:s,onChange:e=>t({maxHeight:e||700}),min:300,max:1400,step:10,__nextHasNoMarginBottom:!0}),z("maxHeight")),(0,h.createElement)("div",{className:"alfbDeviceHeights"},(0,h.createElement)(E,{label:(0,c.__)("On tablets and phones","softicon-flipbook"),tip:(0,c.__)("A different maximum height on tablets (under 1025 px wide) and phones (under 600 px). Leave a field empty to keep the height above. The editor's Tablet and Mobile previews show them.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Tablet (px)","softicon-flipbook"),value:a||"",placeholder:String(s),onChange:e=>t({maxHeightTablet:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Phone (px)","softicon-flipbook"),value:n||"",placeholder:String(s),onChange:e=>t({maxHeightPhone:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),z("maxHeightTablet"),z("maxHeightPhone"))),(0,h.createElement)(w,{id:"colors",title:(0,c.__)("Colors","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Theme","softicon-flipbook"),tip:(0,c.__)("Dark puts the book on a dark background with light controls. Auto follows the reader's device. A color you set below still wins.","softicon-flipbook"),value:i||"light",onChange:L("theme"),options:[{label:(0,c.__)("Light","softicon-flipbook"),value:"light"},{label:(0,c.__)("Dark","softicon-flipbook"),value:"dark"},{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto"}]}),z("theme"),(0,h.createElement)("div",{className:"siColors"},v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(P,{label:(0,c.__)("Cover","softicon-flipbook"),...S("coverColor")}),z("coverColor")),(0,h.createElement)(P,{label:(0,c.__)("Background","softicon-flipbook"),...S("bgColor")}),z("bgColor"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar background","softicon-flipbook"),...S("toolbarBg")}),z("toolbarBg"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar icons and text","softicon-flipbook"),...S("toolbarColor")}),z("toolbarColor")),!X.pro&&(0,h.createElement)(W,{href:X.defaults||X.pricing,text:(0,c.__)("Setting the colors, size and toolbar once for every flipbook on the site is available in Pro.","softicon-flipbook")})),!X.pro&&(0,h.createElement)(w,{id:"branding",title:(0,c.__)("Branding","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:X.pricing,text:(0,c.__)("Your logo in the toolbar, linked to your site, and your own picture behind the book are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.branding},(0,c.__)("Watch branding in 40 seconds","softicon-flipbook")))))},J=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>(0,h.createElement)(d.InspectorControls,null,(0,h.createElement)(f.TabPanel,{className:"siSettings",tabs:H},s=>(0,h.createElement)(v,{key:s.name,initial:"style"===s.name?"display":"source"},"general"===s.name&&(0,h.createElement)(q,{attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i}),"style"===s.name&&(0,h.createElement)(Y,{attributes:e,setAttributes:t}),(0,l.applyFilters)("alfb.block.inspector",null,{tab:s.name,attributes:e,setAttributes:t,Panel:w}))));let K=null,Q=null;const ee=[1,1.5,2,3,4],te=(e,t,o)=>Math.min(o,Math.max(t,e)),oe=e=>Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY);class ie{constructor(e){this.book=e,this.doc=e.doc,this.level=1,this.view=null,this.pinch=null,this.timer=0,this.token=0,this.attach()}get active(){return!!this.view}get atMax(){return this.level>=3.99}step(e){const t=e>0?ee.find(e=>e>this.level+.01):[...ee].reverse().find(e=>e<this.level-.01);this.set(t||(e>0?4:1))}set(e,t){if((e=te(e,1,4))<1.02)return void this.close();let o=null;this.view||(o=this.pagesFraction(t),this.open());const{view:i,inner:s}=this,a=i.getBoundingClientRect(),n=t?t.x-a.left:i.clientWidth/2,l=t?t.y-a.top:i.clientHeight/2;o=o||{x:(i.scrollLeft+n-s.offsetLeft)/s.offsetWidth,y:(i.scrollTop+l-s.offsetTop)/s.offsetHeight},this.level=e,this.layout(),i.scrollLeft=s.offsetLeft+o.x*s.offsetWidth-n,i.scrollTop=s.offsetTop+o.y*s.offsetHeight-l,this.schedule(),this.book.onZoom()}pagesFraction(e){if(!e)return{x:.5,y:.5};const t=this.book.visible().map(e=>this.book.pages[e].getBoundingClientRect()),o=Math.min(...t.map(e=>e.left)),i=Math.max(...t.map(e=>e.right)),s=Math.min(...t.map(e=>e.top)),a=Math.max(...t.map(e=>e.bottom));return{x:te((e.x-o)/(i-o||1),0,1),y:te((e.y-s)/(a-s||1),0,1)}}open(){this.view=this.doc.createElement("div"),this.view.className="alfb_zoom",this.inner=this.doc.createElement("div"),this.inner.className="alfb_zoom_inner",this.view.append(this.inner),this.book.stage.append(this.view),this.fill(),this.drag(),this.view.addEventListener("dblclick",()=>this.set(1))}fill(){this.shown=this.book.visible(),this.sharp=this.shown.map(()=>0),this.inner.replaceChildren(...this.shown.map(e=>{const t=this.doc.createElement("div");return t.className="alfb_zoom_page",t.setAttribute("role","img"),t.setAttribute("aria-label",this.book.pages[e].getAttribute("aria-label")),t.append(this.copy(e)),t}))}copy(e){if("images"===this.book.config.source){const t=this.book.config.images[e],o=this.doc.createElement("img");return o.src=t.url,o.alt=t.alt||"",o}const t=this.doc.createElement("canvas"),o=this.book.pages[e].querySelector("canvas");return o&&(t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0)),t}layout(){const e=this.book.flip.getBoundsRect(),t=Math.round(e.pageWidth*this.level),o=Math.round(e.height*this.level);this.inner.style.width=t*this.shown.length+"px",this.inner.style.height=o+"px",[...this.inner.children].forEach(e=>{e.style.width=t+"px",e.style.height=o+"px"})}schedule(){clearTimeout(this.timer),this.timer=setTimeout(()=>this.render(),150)}async render(){if(!this.view||"images"===this.book.config.source)return;const e=++this.token,t=this.book.flip.getBoundsRect(),o=Math.min(this.book.win.devicePixelRatio||1,2),i=Math.min(Math.ceil(t.pageWidth*this.level*o),Math.floor(Math.sqrt(16e6*this.book.ratio)));for(let t=0;t<this.shown.length;t++){if(this.sharp[t]>=i)continue;const o=await this.book.drawPage(this.shown[t],i).catch(()=>null);if(e!==this.token||!this.view)return;o&&(this.inner.children[t].replaceChildren(o),this.sharp[t]=i)}}update(){this.view&&(this.book.visible().join()!==this.shown.join()?(this.token++,this.fill(),this.layout(),this.view.scrollTop=0,this.view.scrollLeft=0,this.schedule()):this.set(this.level))}close(){clearTimeout(this.timer),this.token++,this.view?.remove(),this.view=null,this.level=1,this.book.onZoom()}drag(){const{view:e}=this;let t=null;e.addEventListener("pointerdown",o=>{"mouse"===o.pointerType&&0===o.button&&(t={x:o.clientX,y:o.clientY,left:e.scrollLeft,top:e.scrollTop},e.setPointerCapture(o.pointerId),e.classList.add("alfb_dragging"))}),e.addEventListener("pointermove",o=>{t&&(e.scrollLeft=t.left-(o.clientX-t.x),e.scrollTop=t.top-(o.clientY-t.y))});const o=()=>{t=null,e.classList.remove("alfb_dragging")};e.addEventListener("pointerup",o),e.addEventListener("pointercancel",o)}attach(){const{book:e}=this,{stage:t}=e,o={capture:!0,passive:!1};e.on(t,"touchstart",t=>{2!==t.touches.length||e.thumbs?.open||(t.preventDefault(),t.stopPropagation(),e.cancelTouch(),this.pinch={distance:oe(t.touches),level:this.level})},o),e.on(t,"touchmove",e=>{var t;this.pinch&&(e.preventDefault(),e.stopPropagation(),2===e.touches.length&&this.set(this.pinch.level*oe(e.touches)/this.pinch.distance,{x:((t=e.touches)[0].clientX+t[1].clientX)/2,y:(t[0].clientY+t[1].clientY)/2}))},o);const i=e=>{this.pinch&&!e.touches.length&&(this.pinch=null)};e.on(t,"touchend",i,o),e.on(t,"touchcancel",i,o),e.on(t,"wheel",t=>{t.ctrlKey&&!e.thumbs?.open&&(t.preventDefault(),this.set(this.level*Math.exp(-t.deltaY/100),{x:t.clientX,y:t.clientY}))},o);let s=1;e.on(t,"gesturestart",e=>{e.preventDefault(),s=this.level},o),e.on(t,"gesturechange",t=>{t.preventDefault(),this.pinch||e.thumbs?.open||this.set(s*t.scale,{x:t.clientX,y:t.clientY})},o)}}class se{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.items=[],this.urls=[],this.queue=Promise.resolve()}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.contents?.close(!1),t.search?.close(!1);const o=t.visible();this.panel=this.doc.createElement("div"),this.panel.className="alfb_thumbs",this.panel.setAttribute("role","region"),this.panel.setAttribute("aria-label",t.thumbsBtn.title),this.items=t.pages.map((e,i)=>{const s=this.doc.createElement("button");s.type="button",s.className="alfb_thumb",s.setAttribute("aria-label",e.getAttribute("aria-label")),o.includes(i)&&(s.classList.add("alfb_current"),s.setAttribute("aria-current","page"));const a=this.doc.createElement("span");a.className="alfb_thumb_img",a.style.aspectRatio=String(t.ratio);const n=this.doc.createElement("span");return n.className="alfb_thumb_num",n.setAttribute("aria-hidden","true"),n.textContent=i+1,s.append(a,n),s.addEventListener("click",()=>{this.close(!1),t.go(i),t.thumbsBtn.focus()}),s}),this.panel.append(...this.items),t.stage.append(this.panel),this.observer=new t.win.IntersectionObserver(e=>e.forEach(e=>{e.isIntersecting&&(this.observer.unobserve(e.target),this.draw(this.items.indexOf(e.target)))}),{root:this.panel,rootMargin:"200px 0px"}),this.items.forEach(e=>this.observer.observe(e));const i=this.items[o[0]]||this.items[0];this.panel.scrollTop=i.offsetTop-(this.panel.clientHeight-i.offsetHeight)/2,e&&i.focus({preventScroll:!0}),t.onThumbs()}draw(e){if(this.urls[e])this.place(e,this.urls[e]);else{if("images"===this.book.config.source){const t=this.book.config.images[e];return void this.place(e,t.thumb||t.url)}this.queue=this.queue.then(()=>this.render(e)).catch(()=>{})}}async render(e){if(!this.panel||this.urls[e])return;const t=Math.round(160*Math.min(this.book.win.devicePixelRatio||1,2)),o=this.book.pages[e].querySelector("canvas");let i;o&&o.width>=t?(i=this.doc.createElement("canvas"),i.width=t,i.height=Math.round(t*o.height/o.width),i.getContext("2d").drawImage(o,0,0,i.width,i.height)):i=await this.book.drawPage(e,t);const s=await new Promise(e=>i.toBlob(e,"image/jpeg",.8));s&&!this.book.destroyed&&(this.urls[e]=URL.createObjectURL(s),this.place(e,this.urls[e]))}place(e,t){const o=this.items[e]?.firstChild;if(!this.panel||!o||o.firstChild)return;const i=this.doc.createElement("img");i.src=t,i.alt="",i.decoding="async",o.append(i)}close(e){this.panel&&(this.observer.disconnect(),this.panel.remove(),this.panel=null,this.items=[],this.book.onThumbs(),e&&this.book.thumbsBtn.focus())}destroy(){this.close(!1),this.urls.forEach(e=>e&&URL.revokeObjectURL(e)),this.urls=[]}}class ae{constructor(e,t){this.book=e,this.doc=e.doc,this.outline=t,this.panel=null}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.thumbs?.close(!1),t.search?.close(!1),this.panel=this.doc.createElement("nav"),this.panel.className="alfb_contents",this.panel.setAttribute("aria-label",t.contentsBtn.title);const o=this.doc.createElement("ul");this.add(o,this.outline,0),this.panel.append(o),t.stage.append(this.panel),e&&o.querySelector("a, button")?.focus({preventScroll:!0}),t.onContents()}add(e,t,o){for(const i of t){const t=this.doc.createElement("li");t.append(this.entry(i,o)),e.append(t),i.items?.length&&this.add(e,i.items,o+1)}}entry(e,t){const{book:o}=this,i=(e.title||"").trim()||(0,c.__)("Untitled","softicon-flipbook"),s=e.url?o.safeUrl(e.url):null,a=this.doc.createElement(s?"a":"button");a.className="alfb_entry",a.style.paddingLeft=12+16*Math.min(t,3)+"px";const n=this.doc.createElement("span");n.className="alfb_entry_title",n.textContent=i;const l=this.doc.createElement("span");if(l.className="alfb_entry_num",a.append(n,l),s)return a.href=s,a.target="_blank",a.rel="noopener noreferrer",a;a.type="button";const r=o.destPage(e.dest);return r.then(e=>{null!==e?l.textContent=e+1:a.disabled=!0}),a.addEventListener("click",async()=>{const e=await r;null!==e&&(this.close(!1),o.go(e),o.contentsBtn.focus())}),a}close(e){this.panel&&(this.panel.remove(),this.panel=null,this.book.onContents(),e&&this.book.contentsBtn.focus())}destroy(){this.close(!1)}}class ne{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.texts=[],this.round=0}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}text(e){return this.texts[e]||(this.texts[e]=this.book.pdf.getPage(e+1).then(e=>e.getTextContent()).then(e=>(e=>{let t="",o=null;return e.forEach(e=>{if("string"==typeof e.str){if(o){const i=Math.max(e.height,o.height)||1,s=Math.abs(e.transform[5]-o.transform[5])<.5*i,a=e.transform[4]-(o.transform[4]+o.width);t+=o.hasEOL||!s||a>.3*i||a<-i?" ":""}t+=/^[\p{L}\p{N}]( [\p{L}\p{N}]){2,}$/u.test(e.str)?e.str.replace(/ /g,""):e.str,o=e}}),t.replace(/\s+/g," ").trim()})(e.items)).catch(()=>"")),this.texts[e]}show(){const{book:e,doc:t}=this;let o;e.zoom?.close(),e.thumbs?.close(!1),e.contents?.close(!1),this.panel=t.createElement("div"),this.panel.className="alfb_search",this.panel.setAttribute("role","search"),this.input=t.createElement("input"),this.input.type="search",this.input.className="alfb_search_input",this.input.placeholder=(0,c.__)("Search in this book","softicon-flipbook"),this.input.setAttribute("aria-label",this.input.placeholder),this.input.value=this.query||"",this.status=t.createElement("p"),this.status.className="alfb_search_status",this.status.setAttribute("aria-live","polite"),this.list=t.createElement("ul"),this.input.addEventListener("keydown",e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),this.close(!0))}),this.input.addEventListener("input",()=>{clearTimeout(o),o=setTimeout(()=>this.run(),250)}),this.panel.append(this.input,this.status,this.list),e.stage.append(this.panel),this.input.focus({preventScroll:!0}),e.onSearch(),this.input.value&&this.run()}async run(){const e=this.input.value.trim(),t=e.toLowerCase(),o=++this.round;if(this.query=e,this.list.replaceChildren(),t.length<2)return void(this.status.textContent="");this.status.textContent=(0,c.__)("Searching…","softicon-flipbook");let i=0;for(let e=0;e<this.book.count&&i<50;e++){const s=await this.text(e);if(o!==this.round||!this.panel)return;const a=s.toLowerCase().indexOf(t);a>=0&&(i++,this.list.append(this.entry(e,s,a,t.length)))}this.status.textContent=i
     1(()=>{var e={837(e,t,o){"use strict";o(387);const i=window.wp.blocks,s=window.wp.data,a=window.wp.domReady;var n=o.n(a);const l=window.wp.hooks,r=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"softicon/flipbook","version":"1.5.0","title":"Flipbook","category":"media","description":"Turn a PDF or a set of images into a page-turning flipbook.","keywords":["flipbook","pdf","magazine","catalog","brochure"],"textdomain":"softicon-flipbook","attributes":{"source":{"type":"string","default":"pdf"},"pdfId":{"type":"number","default":0},"pdfUrl":{"type":"string","default":""},"images":{"type":"array","default":[]},"pageMode":{"type":"string","default":"auto"},"showCover":{"type":"boolean","default":true},"startPage":{"type":"number","default":1},"startWith":{"type":"string","default":"book"},"bookTitle":{"type":"string","default":""},"autoplay":{"type":"boolean","default":false},"autoplaySeconds":{"type":"number","default":4},"autoplayLoop":{"type":"boolean","default":true},"rtl":{"type":"boolean","default":false},"maxHeight":{"type":"number","default":700},"maxHeightTablet":{"type":"number","default":0},"maxHeightPhone":{"type":"number","default":0},"showDownload":{"type":"boolean","default":true},"showPrint":{"type":"boolean","default":false},"showFullscreen":{"type":"boolean","default":true},"phoneFullscreen":{"type":"boolean","default":false},"showZoom":{"type":"boolean","default":true},"showThumbnails":{"type":"boolean","default":true},"showContents":{"type":"boolean","default":true},"showLinks":{"type":"boolean","default":true},"showSearch":{"type":"boolean","default":true},"showShare":{"type":"boolean","default":false},"bookStyle":{"type":"string","default":"flat"},"sideArrows":{"type":"boolean","default":false},"coverColor":{"type":"string","default":""},"flipSound":{"type":"boolean","default":true},"theme":{"type":"string","default":"light"},"bgColor":{"type":"string","default":""},"toolbarBg":{"type":"string","default":""},"toolbarColor":{"type":"string","default":""},"displayMode":{"type":"string","default":"inline"},"lightboxTrigger":{"type":"string","default":"cover"},"lightboxText":{"type":"string","default":""},"lightboxImage":{"type":"object","default":{}},"lightboxWidth":{"type":"number","default":260},"lightboxAlign":{"type":"string","default":"center"}},"supports":{"html":false,"align":["wide","full"],"spacing":{"margin":true}},"example":{"attributes":{"source":"images"}},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php"}'),h=window.React,c=window.wp.i18n,p=window.wp.element,d=window.wp.blockEditor,f=window.wp.components,u=window.wp.compose,b=(e,t,o=document)=>{const i=[];if(!t?.head||t===o)return i;const s=(e,s=t.head)=>{const a=o.getElementById(e);if(!a||t.getElementById(e))return null;const n=((e,t)=>{if("SCRIPT"!==e.tagName)return t.importNode(e,!0);const o=t.createElement("script");return[...e.attributes].forEach(({name:e,value:t})=>o.setAttribute(e,t)),o.async=!1,o.text=e.text,o})(a,t);return s.appendChild(n),i.push(e),n};return e.filter(Boolean).forEach(e=>{const{before:t,main:o,after:i}=(e=>{if(e.endsWith("-js")){const t=e.slice(0,-3);return{before:[`${t}-js-translations`,`${t}-js-extra`,`${t}-js-before`],main:e,after:[`${t}-js-after`]}}return e.endsWith("-css")?{before:[],main:e,after:[`${e.slice(0,-4)}-inline-css`]}:{before:[],main:e,after:[]}})(e);t.forEach(e=>s(e));const a=s(o);a&&"SCRIPT"===a.tagName&&a.src?a.addEventListener("load",()=>i.forEach(e=>s(e)),{once:!0}):i.forEach(e=>s(e))}),i},m=window.wp.primitives,g=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),_={info:g("M12 2.75a9.25 9.25 0 1 1 0 18.5 9.25 9.25 0 0 1 0-18.5m0 1.5a7.75 7.75 0 1 0 0 15.5 7.75 7.75 0 0 0 0-15.5M11.2 10.6h1.6V17h-1.6zm0-3.4h1.6v1.7h-1.6z",!0),video:g("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m5.5 4v7l6-3.5z"),support:g("M4.5 4h15A1.5 1.5 0 0 1 21 5.5v10a1.5 1.5 0 0 1-1.5 1.5H10l-5 4v-4h-.5A1.5 1.5 0 0 1 3 15.5v-10A1.5 1.5 0 0 1 4.5 4M7 8.5V10h10V8.5zm0 3V13h7v-1.5z",!0),star:g("M12 2.75l2.85 5.95 6.55.75-4.85 4.5 1.3 6.5L12 17.2l-5.85 3.25 1.3-6.5L2.6 9.45l6.55-.75z"),plugins:g("M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z")},k=(0,p.createContext)({open:null,toggle:()=>{}}),v=({initial:e,children:t})=>{const[o,i]=(0,p.useState)(e);return(0,h.createElement)(k.Provider,{value:{open:o,toggle:e=>i(t=>t===e?null:e)}},t)},w=({id:e,title:t,badge:o,children:i})=>{const{open:s,toggle:a}=(0,p.useContext)(k);return(0,h.createElement)(f.PanelBody,{className:"siPanel",title:(0,h.createElement)(h.Fragment,null,t,o&&(0,h.createElement)("span",{className:"siBadge"},o)),opened:s===e,onToggle:()=>a(e)},(0,h.createElement)("div",{className:"siFields"},i))},y=({text:e})=>(0,h.createElement)(f.Tooltip,{text:e,placement:"top",className:"siTipBubble"},(0,h.createElement)("button",{type:"button",className:"siTip","aria-label":e},_.info)),E=({label:e,tip:t,action:o})=>(0,h.createElement)("div",{className:"siFieldHead"},(0,h.createElement)("span",{className:"siFieldLabel"},e),t&&(0,h.createElement)(y,{text:t}),(0,h.createElement)("span",{className:"siFieldLine","aria-hidden":"true"}),o),x=({onClick:e,disabled:t})=>(0,h.createElement)(f.Button,{className:"siReset",variant:"secondary",size:"small",onClick:e,disabled:t},(0,c.__)("Reset","softicon-flipbook")),C=({label:e,tip:t,checked:o,onChange:i})=>(0,h.createElement)("div",{className:"siToggleRow"},(0,h.createElement)(f.ToggleControl,{label:e,checked:o,onChange:i,__nextHasNoMarginBottom:!0}),t&&(0,h.createElement)(y,{text:t})),M=({label:e,tip:t,value:o,options:i,onChange:s})=>(0,h.createElement)("div",{className:"siTiles"},(0,h.createElement)(E,{label:e,tip:t}),(0,h.createElement)("div",{className:"siTilesGrid",role:"radiogroup","aria-label":e,style:{gridTemplateColumns:`repeat(${i.length}, 1fr)`}},i.map(e=>(0,h.createElement)("button",{key:e.value,type:"button",role:"radio","aria-checked":o===e.value,className:"siTile"+(o===e.value?" is-selected":""),onClick:()=>s(e.value)},e.icon,(0,h.createElement)("span",null,e.label))))),P=({label:e,value:t,onChange:o})=>(0,h.createElement)(f.Dropdown,{className:"siColorRow",popoverProps:{placement:"left-start",offset:36},renderToggle:({isOpen:o,onToggle:i})=>(0,h.createElement)(f.Button,{className:"siColorToggle",onClick:i,"aria-expanded":o
     2/* translators: %s: a color setting, like Background */,"aria-label":(0,c.sprintf)((0,c.__)("%s color","softicon-flipbook"),e)+(t?": "+t:"")},(0,h.createElement)("span",{className:"siColorName"},e),(0,h.createElement)(f.ColorIndicator,{colorValue:t||void 0,className:t?"":"is-empty"})),renderContent:()=>(0,h.createElement)("div",{className:"siColorPopover"},(0,h.createElement)(d.ColorPalette,{value:t,onChange:e=>o(e||""),clearable:!0}))}),T=({cards:e})=>(0,h.createElement)("div",{className:"siHelpCards"},e.map(e=>(0,h.createElement)("a",{key:e.href,className:"siHelpCard",href:e.href,target:"_blank",rel:"noopener noreferrer"},e.icon,(0,h.createElement)("span",null,e.label),(0,h.createElement)("span",{className:"screen-reader-text"},(0,c.__)("(opens in a new tab)","softicon-flipbook"))))),L=(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,h.createElement)(m.Path,{d:"M12 6.5C10.3 5.3 8 4.75 5 4.75H3v13h2c3 0 5.3.55 7 1.75 1.7-1.2 4-1.75 7-1.75h2v-13h-2c-3 0-5.3.55-7 1.75m-1.25 10.6c-1.5-.6-3.4-.9-5.75-.85V6.25c2.5 0 4.4.45 5.75 1.4zm8.25-.85c-2.35-.05-4.25.25-5.75.85V7.65c1.35-.95 3.25-1.4 5.75-1.4z"})),S=(e,t=!1)=>(0,h.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false"},(0,h.createElement)(m.Path,{d:e,fillRule:t?"evenodd":void 0})),z={pdf:S("M6 2.5h7.6L19.5 8.4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M6 4v16h12V9.5h-5.5V4zm8 .6V8h3.4zM8 12.5h8V14H8zm0 3h8V17H8z",!0),images:S("M4.5 4.5h15A1.5 1.5 0 0 1 21 6v12a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18V6a1.5 1.5 0 0 1 1.5-1.5m0 1.5v10.4l4.2-4.2 2.8 2.8 4.3-4.7 3.7 4V6zM8.5 10.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5",!0),auto:S("M2 4.5h14v10H2zm1.5 1.5v7h11V6zM6 16.5h6V18H6zM17 8h5v12.5h-5zm1.5 1.5V19h2V9.5z",!0),twoPages:S("M2.5 5h8.5v14H2.5zM4 6.5v11h5.5v-11zM13 5h8.5v14H13zm1.5 1.5v11H20v-11z",!0),onePage:S("M6.5 3h11v18h-11zM8 4.5v15h8v-15zM10 8h4v1.5h-4zm0 3h4v1.5h-4z",!0),classic:S("M3 6.5h8.25v11H3zM4.5 8v8h5.25V8zM12.75 6.5H21v11h-8.25zm1.5 1.5v8h5.25V8z",!0),hardcover:S("M1.5 4.5h21v15h-21zM3 6v12h8.25V6zm9.75 0v12H21V6z",!0),cover:S("M6 2.5h12A1.5 1.5 0 0 1 19.5 4v16a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V4A1.5 1.5 0 0 1 6 2.5M8 4v16h10V4zm2.5 3H16v1.5h-5.5z",!0),button:S("M4 7h16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2m0 1.5a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5zM7 11.25h10v1.5H7z",!0),text:S("M3 7h18v1.5H3zm0 4.5h12V13H3zm0 4.5h7.5v1.5H3z"),alignLeft:S("M4 5h16v1.5H4zm0 4h10v1.5H4zm0 4h16v1.5H4zm0 4h10v1.5H4z"),alignCenter:S("M4 5h16v1.5H4zm3 4h10v1.5H7zm-3 4h16v1.5H4zm3 4h10v1.5H7z"),alignRight:S("M4 5h16v1.5H4zm6 4h10v1.5H10zm-6 4h16v1.5H4zm6 4h10v1.5H10z")},H=[{name:"general",title:(0,c.__)("General","softicon-flipbook"),className:"general"},{name:"style",title:(0,c.__)("Style","softicon-flipbook"),className:"style"}],N=[{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto",icon:z.auto},{label:(0,c.__)("Two pages","softicon-flipbook"),value:"double",icon:z.twoPages},{label:(0,c.__)("One page","softicon-flipbook"),value:"single",icon:z.onePage}],A=[{label:(0,c.__)("PDF file","softicon-flipbook"),value:"pdf",icon:z.pdf},{label:(0,c.__)("Images","softicon-flipbook"),value:"images",icon:z.images}],F="&list=PLJEAefIarF4g",B={overview:"https://www.youtube.com/watch?v=5geq69DXoN8"+F,add:"https://www.youtube.com/watch?v=KGP_xpi8NGo"+F,design:"https://www.youtube.com/watch?v=qqQeZQkX5ms"+F,reading:"https://www.youtube.com/watch?v=1J7wCaUvugc"+F,lightbox:"https://www.youtube.com/watch?v=XBJuUV9HpkA"+F,settings:"https://www.youtube.com/watch?v=H9IxgIocY68"+F,promo:"https://www.youtube.com/watch?v=Oj9sHOZbb3A"+F,shortcode:"https://www.youtube.com/watch?v=slQlR4GTghg"+F,autoplay:"https://www.youtube.com/watch?v=bkuMUupI92Y"+F,rtl:"https://www.youtube.com/watch?v=MzZs4jJInFA"+F,shelf:"https://www.youtube.com/watch?v=9UY2KNYzkGk"+F,buttons:"https://www.youtube.com/watch?v=fS5RMGkPQXk"+F,leads:"https://www.youtube.com/watch?v=GxbrW_pyAdA"+F,protect:"https://www.youtube.com/watch?v=5UNgRO22s_Q"+F,hotspots:"https://www.youtube.com/watch?v=D7WiNswbHi8"+F,branding:"https://www.youtube.com/watch?v=iOr2NJ0yaAA"+F,analytics:"https://www.youtube.com/watch?v=ET4JXhOO-2s"+F,field:"https://www.youtube.com/watch?v=BGlS_IKKagM"+F,bookmarks:"https://www.youtube.com/watch?v=4-D5HxqV1yg"+F,pro:"https://www.youtube.com/watch?v=LtCj7-J2qXI"+F},I=[{label:(0,c.__)("Classic","softicon-flipbook"),value:"flat",icon:z.classic},{label:(0,c.__)("Hardcover","softicon-flipbook"),value:"hardcover",icon:z.hardcover}],D=[{label:(0,c.__)("Cover","softicon-flipbook"),value:"cover",icon:z.cover},{label:(0,c.__)("Button","softicon-flipbook"),value:"button",icon:z.button},{label:(0,c.__)("Text link","softicon-flipbook"),value:"text",icon:z.text}],R=[{label:(0,c.__)("Left","softicon-flipbook"),value:"left",icon:z.alignLeft},{label:(0,c.__)("Center","softicon-flipbook"),value:"center",icon:z.alignCenter},{label:(0,c.__)("Right","softicon-flipbook"),value:"right",icon:z.alignRight}],V=[{href:"https://www.youtube.com/playlist?list=PLJEAefIarF4g",label:(0,c.__)("Video tutorials","softicon-flipbook"),icon:_.video},{href:"https://wordpress.org/support/plugin/softicon-flipbook/",label:(0,c.__)("Get support","softicon-flipbook"),icon:_.support},{href:"https://wordpress.org/support/plugin/softicon-flipbook/reviews/#new-post",label:(0,c.__)("Rate Flipbook","softicon-flipbook"),icon:_.star},{href:"https://wordpress.org/plugins/author/softiconai/",label:(0,c.__)("More plugins","softicon-flipbook"),icon:_.plugins}],W=({text:e,href:t})=>(0,h.createElement)("div",{className:"alfbProNotice"},(0,h.createElement)("p",null,(0,h.createElement)("span",{className:"dashicons dashicons-lock","aria-hidden":"true"})," ",e),t&&(0,h.createElement)(f.ExternalLink,{href:t,className:"alfbProNoticeLink"},(0,c.__)("Unlock with Pro","softicon-flipbook"))),O=({value:e,onChange:t})=>{const[o,i]=(0,p.useState)(String(e));return(0,p.useEffect)(()=>i(String(e)),[e]),(0,h.createElement)(f.TextControl,{type:"number",min:1,label:(0,c.__)("Open at page","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:e=>{i(e),parseInt(e,10)>=1&&t(parseInt(e,10))},onBlur:()=>i(String(e)),__nextHasNoMarginBottom:!0})},U=window.alfbEditor||{},j=()=>{const[e,t]=(0,p.useState)(!1),{type:o,id:i,published:a}=(0,s.useSelect)(e=>{const t=e("core/editor");return{type:t?.getCurrentPostType(),id:t?.getCurrentPostId(),published:"publish"===t?.getEditedPostAttribute("status")}},[]);if("alfb_book"!==o||!i)return null;const n=`[softicon_flipbook id="${i}"]`;return(0,h.createElement)("div",{className:"alfbShortcode"},(0,h.createElement)(E,{label:(0,c.__)("Shortcode","softicon-flipbook"),tip:(0,c.__)("Paste it in the Classic Editor, Elementor or any page builder to show this flipbook there.","softicon-flipbook")}),(0,h.createElement)("div",{className:"alfbShortcodeRow"},(0,h.createElement)("input",{type:"text",readOnly:!0,value:n,onFocus:e=>e.target.select(),"aria-label":(0,c.__)("Shortcode","softicon-flipbook")}),(0,h.createElement)(f.Button,{variant:"secondary",onClick:e=>{const o=e.currentTarget.previousElementSibling,i=()=>{t(!0),setTimeout(()=>t(!1),1600)};window.navigator.clipboard&&window.isSecureContext?window.navigator.clipboard.writeText(n).then(i):(o.select(),o.ownerDocument.execCommand("copy")&&i())}},e?(0,c.__)("Copied","softicon-flipbook"):(0,c.__)("Copy","softicon-flipbook"))),!a&&(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("It shows the flipbook once it is published.","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shortcode},(0,c.__)("Where to paste it: the Classic Editor, Elementor and more","softicon-flipbook"))))},q=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>{const{source:s,pdfId:a,pdfUrl:n,images:r,pageMode:p,showCover:u,startPage:b,startWith:m,autoplay:g,autoplaySeconds:_,autoplayLoop:k,rtl:v,phoneFullscreen:y,showDownload:x,showPrint:P,showFullscreen:L,showZoom:S,showThumbnails:z,showContents:H,showLinks:F,showSearch:I,showShare:D,flipSound:R}=e,q=e=>o=>t({[e]:o}),$=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),G=(()=>{const e=n?n.split("/").pop().split("?")[0]:"";try{return decodeURIComponent(e)}catch(t){return e}})();return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"help",title:(0,c.__)("Help","softicon-flipbook")},(0,h.createElement)(T,{cards:V}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.settings},(0,c.__)("Every setting explained, in 2 minutes","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("Email:","softicon-flipbook")," ",(0,h.createElement)("a",{href:"mailto:support@softiconai.com"},"support@softiconai.com")),(0,h.createElement)(j,null)),(0,h.createElement)(w,{id:"source",title:(0,c.__)("Source","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Pages from","softicon-flipbook"),value:s,options:A,onChange:q("source")}),"pdf"===s?(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("PDF","softicon-flipbook"),tip:(0,c.__)("PDFs from your Media Library always work. A link to a PDF on another website works only if that site allows it.","softicon-flipbook")}),G&&(0,h.createElement)("p",{className:"alfbFile"},G),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["application/pdf"],value:a,onSelect:o,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},n?(0,c.__)("Replace PDF","softicon-flipbook"):(0,c.__)("Choose PDF","softicon-flipbook"))})),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Taking each post's PDF from a custom field (Meta Box, ACF), and text readers can select and copy, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.field},(0,c.__)("Watch: each post's own PDF from Meta Box or ACF","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Links in the PDF","softicon-flipbook"),tip:(0,c.__)("Web, email and page links inside the PDF can be clicked. Web links open in a new tab, page links turn the book.","softicon-flipbook"),checked:F,onChange:q("showLinks")}),$("showLinks")):(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Pages","softicon-flipbook"),tip:(0,c.__)("Each image is one page. Drag them in the media window to change the order.","softicon-flipbook")}),!!r.length&&(0,h.createElement)("div",{className:"alfbImages"},r.slice(0,8).map(e=>(0,h.createElement)("img",{key:e.id||e.url,src:e.url,alt:""}))),(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:r.map(e=>e.id),onSelect:i,render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},r.length?(0,c.__)("Edit pages","softicon-flipbook"):(0,c.__)("Choose images","softicon-flipbook"))})))),(0,h.createElement)(w,{id:"pages",title:(0,c.__)("Pages","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Layout","softicon-flipbook"),tip:(0,c.__)("Auto shows two pages side by side on wide screens and one page on phones. Or keep one layout everywhere.","softicon-flipbook"),value:p,options:N,onChange:q("pageMode")}),$("pageMode"),(0,h.createElement)(C,{label:(0,c.__)("Cover page","softicon-flipbook"),tip:(0,c.__)("The first and last pages turn on their own, like a printed book.","softicon-flipbook"),checked:u,onChange:q("showCover")}),$("showCover"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Open at page","softicon-flipbook"),tip:(0,c.__)("The book opens at this page. A link ending in #page=5 opens it at page 5.","softicon-flipbook")}),(0,h.createElement)(O,{value:b,onChange:e=>t({startPage:e})})),(0,h.createElement)(f.SelectControl,{label:(0,c.__)("Start with","softicon-flipbook"),help:(0,c.__)("Readers can first pick a page from the thumbnails or the table of contents (from the PDF's bookmarks). On the published page.","softicon-flipbook"),value:m,onChange:q("startWith"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:(0,c.__)("The book","softicon-flipbook"),value:"book"},{label:(0,c.__)("The thumbnails","softicon-flipbook"),value:"thumbnails"},{label:(0,c.__)("The table of contents","softicon-flipbook"),value:"contents"}]}),(0,h.createElement)(C,{label:(0,c.__)("Right to left","softicon-flipbook"),tip:(0,c.__)("For books read from right to left, such as Arabic, Hebrew or Urdu: the next page is on the left, and the arrows and arrow keys follow.","softicon-flipbook"),checked:v,onChange:q("rtl")}),$("rtl"),(0,h.createElement)(C,{label:(0,c.__)("Autoplay","softicon-flipbook"),tip:(0,c.__)("Turns the pages by itself while the book is on screen, on the published page. It holds while the mouse is over the book, stops when a reader takes over, and the toolbar gets a pause button.","softicon-flipbook"),checked:g,onChange:q("autoplay")}),g&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Seconds per page","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:2,max:60,label:(0,c.__)("Seconds per page","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({autoplaySeconds:Math.min(60,Math.max(2,parseInt(e,10)||4))}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$("autoplaySeconds")),(0,h.createElement)(C,{label:(0,c.__)("Start again at the end","softicon-flipbook"),tip:(0,c.__)("After the last page the book goes back to the first one and keeps playing.","softicon-flipbook"),checked:k,onChange:q("autoplayLoop")}),$("autoplayLoop")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.autoplay},(0,c.__)("Watch autoplay in 45 seconds","softicon-flipbook"))),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.rtl},(0,c.__)("Watch right to left and fullscreen on phones","softicon-flipbook")))),(0,h.createElement)(w,{id:"toolbar",title:(0,c.__)("Toolbar","softicon-flipbook")},(0,h.createElement)("p",{className:"alfbHelp"},(0,c.__)("The preview here shows only the book; the buttons work on the published page.","softicon-flipbook")),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Download button","softicon-flipbook"),tip:(0,c.__)("Lets visitors save the PDF.","softicon-flipbook"),checked:x,onChange:q("showDownload")}),$("showDownload")),(0,h.createElement)(C,{label:(0,c.__)("Print button","softicon-flipbook"),tip:(0,c.__)("Readers print the whole book. The pages are prepared in the browser first, so a long book takes a moment.","softicon-flipbook"),checked:P,onChange:q("showPrint")}),$("showPrint"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen button","softicon-flipbook"),tip:(0,c.__)("Fits the book to the screen and redraws the pages sharper.","softicon-flipbook"),checked:L,onChange:q("showFullscreen")}),$("showFullscreen"),(0,h.createElement)(C,{label:(0,c.__)("Fullscreen on phones","softicon-flipbook"),tip:(0,c.__)('On a phone the book shows "Tap to read"; one tap opens it full screen, where the pages are easier to read.',"softicon-flipbook"),checked:y,onChange:q("phoneFullscreen")}),$("phoneFullscreen"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Table of contents","softicon-flipbook"),tip:(0,c.__)("A button with the PDF's chapters (its bookmarks), a click opens one. It shows only when the PDF has bookmarks.","softicon-flipbook"),checked:H,onChange:q("showContents")}),$("showContents")),(0,h.createElement)(C,{label:(0,c.__)("Thumbnails","softicon-flipbook"),tip:(0,c.__)("A button that shows all pages, a click opens one.","softicon-flipbook"),checked:z,onChange:q("showThumbnails")}),$("showThumbnails"),!U.pro&&(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Bookmarks, so readers can mark pages and come back to them, are available in Pro.","softicon-flipbook")}),!U.pro&&(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.bookmarks},(0,c.__)("Watch: bookmarks and selectable text","softicon-flipbook"))),(0,h.createElement)(C,{label:(0,c.__)("Zoom","softicon-flipbook"),tip:(0,c.__)("Zoom buttons, pinch on phones and Ctrl + scroll on computers.","softicon-flipbook"),checked:S,onChange:q("showZoom")}),$("showZoom"),"pdf"===s&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Search","softicon-flipbook"),tip:(0,c.__)("A search box that lists the pages with the words, a click opens the page. PDFs only.","softicon-flipbook"),checked:I,onChange:q("showSearch")}),$("showSearch")),(0,h.createElement)(C,{label:(0,c.__)("Share","softicon-flipbook"),tip:(0,c.__)("A link to the page that is open: on Facebook, X, LinkedIn, Pinterest, by email or copied. Phones use their own share sheet.","softicon-flipbook"),checked:D,onChange:q("showShare")}),$("showShare"),(0,h.createElement)(C,{label:(0,c.__)("Page turn sound","softicon-flipbook"),tip:(0,c.__)("Visitors can mute it from the toolbar.","softicon-flipbook"),checked:R,onChange:q("flipSound")}),$("flipSound")),!U.pro&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"buttons",title:(0,c.__)("Page buttons","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("A button on a chosen page, such as a link or a WooCommerce product with its price, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.buttons},(0,c.__)("Watch page buttons in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"hotspots",title:(0,c.__)("Hotspots","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Clickable areas on your pages, with a link or a WooCommerce product and its price, are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.hotspots},(0,c.__)("Watch hotspots in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"leads",title:(0,c.__)("Lead capture","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Asking readers for their email after a few pages is available in Pro. The leads are saved on your site.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.leads},(0,c.__)("Watch lead capture in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"shelf",title:(0,c.__)("Shelf","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Showing many books on one shelf, each opening in a popup, is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.shelf},(0,c.__)("Watch the shelf in 45 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"protect",title:(0,c.__)("Protection","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Protecting the PDF (a password, no download button, no right-click, the PDF address kept out of the page) is available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.protect},(0,c.__)("Watch protection in 40 seconds","softicon-flipbook")))),(0,h.createElement)(w,{id:"watermark",title:(0,c.__)("Watermark","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:U.pricing,text:(0,c.__)("Your words or logo drawn into every page, with the reader's name or email if you like, is available in Pro.","softicon-flipbook")}))))},$=e=>({id:e.id,url:e.url||e.source_url,alt:e.alt||e.alt_text||"",width:e.width||e.media_details?.width||0,height:e.height||e.media_details?.height||0}),G=["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color","color-mix","var"],Z=e=>(e="string"==typeof e?e.trim():"",/^(#[0-9a-f]{3,8}|[a-z]+)$/i.test(e)||/^[a-z-]+\([a-z0-9\s,.%#()/-]+\)$/i.test(e)&&[...e.matchAll(/([a-z-]*)\(/gi)].map(e=>e[1].toLowerCase()).every(e=>G.includes(e))?e:void 0),Y=window.alfbEditor||{},X=({attributes:e,setAttributes:t})=>{const{bookTitle:o,theme:i,maxHeight:s,maxHeightTablet:a,maxHeightPhone:n,bookStyle:r,sideArrows:p,displayMode:u,lightboxTrigger:b,lightboxText:m,lightboxImage:g,lightboxWidth:_,lightboxAlign:k}=e,v="hardcover"===r,y="lightbox"===u,T="cover"===b,L=e=>o=>t({[e]:o}),S=t=>({value:e[t],onChange:L(t)}),z=e=>(0,l.applyFilters)("alfb.block.hint",null,{name:e,setAttributes:t}),H=(e,t)=>(0,l.applyFilters)("alfb.block.reset",t,e),N=(e,t)=>(0,l.applyFilters)("alfb.block.atDefault",t,e);return(0,h.createElement)(h.Fragment,null,(0,h.createElement)(w,{id:"display",title:(0,c.__)("Display","softicon-flipbook"),badge:(0,c.__)("New","softicon-flipbook")},(0,h.createElement)(C,{label:(0,c.__)("Open in a lightbox","softicon-flipbook"),tip:(0,c.__)("Off: the book shows on the page. On: only a cover, button or link shows on the page, and a click opens the book in a popup over the page; the book loads only then.","softicon-flipbook"),checked:y,onChange:e=>t({displayMode:e?"lightbox":"inline"})}),z("displayMode"),!y&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Title above the book","softicon-flipbook"),tip:(0,c.__)("Shown above the book, also in full screen. Leave it empty for no title.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:(0,c.__)("Title above the book","softicon-flipbook"),hideLabelFromVision:!0,value:o,onChange:L("bookTitle"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),y&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(M,{label:(0,c.__)("Open with","softicon-flipbook"),value:b,options:D,onChange:L("lightboxTrigger")}),z("lightboxTrigger"),(0,h.createElement)("div",null,(0,h.createElement)(E,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),tip:T?(0,c.__)("Shown under the cover. Leave it empty for no caption.","softicon-flipbook"):(0,c.__)('Leave it empty for "Read the flipbook".',"softicon-flipbook")}),(0,h.createElement)(f.TextControl,{label:T?(0,c.__)("Caption","softicon-flipbook"):(0,c.__)("Text","softicon-flipbook"),hideLabelFromVision:!0,value:m,onChange:L("lightboxText"),placeholder:T?"":(0,c.__)("Read the flipbook","softicon-flipbook"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),T&&(0,h.createElement)("div",{className:"alfbStack"},(0,h.createElement)(E,{label:(0,c.__)("Cover image","softicon-flipbook"),tip:(0,c.__)("Without an image the first page is the cover.","softicon-flipbook")}),g?.url&&(0,h.createElement)("img",{className:"alfbCoverThumb",src:g.url,alt:""}),(0,h.createElement)("div",{className:"alfbButtons"},(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],value:g?.id,onSelect:e=>t({lightboxImage:$(e)}),render:({open:e})=>(0,h.createElement)(f.Button,{variant:"secondary",onClick:e},g?.url?(0,c.__)("Replace image","softicon-flipbook"):(0,c.__)("Choose image","softicon-flipbook"))})),g?.url&&(0,h.createElement)(f.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>t({lightboxImage:{}})},(0,c.__)("Remove","softicon-flipbook")))),T&&(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),tip:(0,c.__)("Narrow columns and phones make the cover smaller.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({lightboxWidth:H("lightboxWidth",260)}),disabled:N("lightboxWidth",260===_)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Cover width (px)","softicon-flipbook"),hideLabelFromVision:!0,value:_,onChange:e=>t({lightboxWidth:e||260}),min:120,max:600,step:10,__nextHasNoMarginBottom:!0}),z("lightboxWidth")),(0,h.createElement)(M,{label:(0,c.__)("Alignment","softicon-flipbook"),value:k,options:R,onChange:L("lightboxAlign")}),z("lightboxAlign")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.lightbox},(0,c.__)("See the lightbox in action","softicon-flipbook")))),(0,h.createElement)(w,{id:"design",title:(0,c.__)("Design","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Design","softicon-flipbook"),tip:(0,c.__)("Hardcover puts the pages inside a cover, with the stack of page edges, a shadow at the spine and large arrows beside the book.","softicon-flipbook"),value:r,options:I,onChange:e=>t({bookStyle:e,sideArrows:"hardcover"===e})}),z("bookStyle"),v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(C,{label:(0,c.__)("Side arrows","softicon-flipbook"),tip:(0,c.__)("Large arrows beside the book. On phones they sit over the page edges.","softicon-flipbook"),checked:p,onChange:L("sideArrows")}),z("sideArrows")),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.design},(0,c.__)("See the Hardcover design in action","softicon-flipbook")))),!y&&(0,h.createElement)(w,{id:"size",title:(0,c.__)("Size","softicon-flipbook")},(0,h.createElement)("div",null,(0,h.createElement)(E,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),tip:(0,c.__)("The book keeps the page shape and shrinks to fit smaller screens.","softicon-flipbook"),action:(0,h.createElement)(x,{onClick:()=>t({maxHeight:H("maxHeight",700)}),disabled:N("maxHeight",700===s)})}),(0,h.createElement)(f.RangeControl,{label:(0,c.__)("Maximum height (px)","softicon-flipbook"),hideLabelFromVision:!0,value:s,onChange:e=>t({maxHeight:e||700}),min:300,max:1400,step:10,__nextHasNoMarginBottom:!0}),z("maxHeight")),(0,h.createElement)("div",{className:"alfbDeviceHeights"},(0,h.createElement)(E,{label:(0,c.__)("On tablets and phones","softicon-flipbook"),tip:(0,c.__)("A different maximum height on tablets (under 1025 px wide) and phones (under 600 px). Leave a field empty to keep the height above. The editor's Tablet and Mobile previews show them.","softicon-flipbook")}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Tablet (px)","softicon-flipbook"),value:a||"",placeholder:String(s),onChange:e=>t({maxHeightTablet:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),(0,h.createElement)(f.TextControl,{type:"number",min:200,max:2e3,label:(0,c.__)("Phone (px)","softicon-flipbook"),value:n||"",placeholder:String(s),onChange:e=>t({maxHeightPhone:parseInt(e,10)>0?parseInt(e,10):0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),z("maxHeightTablet"),z("maxHeightPhone"))),(0,h.createElement)(w,{id:"colors",title:(0,c.__)("Colors","softicon-flipbook")},(0,h.createElement)(M,{label:(0,c.__)("Theme","softicon-flipbook"),tip:(0,c.__)("Dark puts the book on a dark background with light controls. Auto follows the reader's device. A color you set below still wins.","softicon-flipbook"),value:i||"light",onChange:L("theme"),options:[{label:(0,c.__)("Light","softicon-flipbook"),value:"light"},{label:(0,c.__)("Dark","softicon-flipbook"),value:"dark"},{label:(0,c.__)("Auto","softicon-flipbook"),value:"auto"}]}),z("theme"),(0,h.createElement)("div",{className:"siColors"},v&&(0,h.createElement)(h.Fragment,null,(0,h.createElement)(P,{label:(0,c.__)("Cover","softicon-flipbook"),...S("coverColor")}),z("coverColor")),(0,h.createElement)(P,{label:(0,c.__)("Background","softicon-flipbook"),...S("bgColor")}),z("bgColor"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar background","softicon-flipbook"),...S("toolbarBg")}),z("toolbarBg"),(0,h.createElement)(P,{label:(0,c.__)("Toolbar icons and text","softicon-flipbook"),...S("toolbarColor")}),z("toolbarColor")),!Y.pro&&(0,h.createElement)(W,{href:Y.defaults||Y.pricing,text:(0,c.__)("Setting the colors, size and toolbar once for every flipbook on the site is available in Pro.","softicon-flipbook")})),!Y.pro&&(0,h.createElement)(w,{id:"branding",title:(0,c.__)("Branding","softicon-flipbook"),badge:(0,c.__)("Pro","softicon-flipbook")},(0,h.createElement)(W,{href:Y.pricing,text:(0,c.__)("Your logo in the toolbar, linked to your site, and your own picture behind the book are available in Pro.","softicon-flipbook")}),(0,h.createElement)("p",{className:"alfbHelp"},(0,h.createElement)(f.ExternalLink,{href:B.branding},(0,c.__)("Watch branding in 40 seconds","softicon-flipbook")))))},J=({attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i})=>(0,h.createElement)(d.InspectorControls,null,(0,h.createElement)(f.TabPanel,{className:"siSettings",tabs:H},s=>(0,h.createElement)(v,{key:s.name,initial:"style"===s.name?"display":"source"},"general"===s.name&&(0,h.createElement)(q,{attributes:e,setAttributes:t,onSelectPdf:o,onSelectImages:i}),"style"===s.name&&(0,h.createElement)(X,{attributes:e,setAttributes:t}),(0,l.applyFilters)("alfb.block.inspector",null,{tab:s.name,attributes:e,setAttributes:t,Panel:w}))));let K=null,Q=null;const ee=[1,1.5,2,3,4],te=(e,t,o)=>Math.min(o,Math.max(t,e)),oe=e=>Math.hypot(e[0].clientX-e[1].clientX,e[0].clientY-e[1].clientY);class ie{constructor(e){this.book=e,this.doc=e.doc,this.level=1,this.view=null,this.pinch=null,this.timer=0,this.token=0,this.attach()}get active(){return!!this.view}get atMax(){return this.level>=3.99}step(e){const t=e>0?ee.find(e=>e>this.level+.01):[...ee].reverse().find(e=>e<this.level-.01);this.set(t||(e>0?4:1))}set(e,t){if((e=te(e,1,4))<1.02)return void this.close();let o=null;this.view||(o=this.pagesFraction(t),this.open());const{view:i,inner:s}=this,a=i.getBoundingClientRect(),n=t?t.x-a.left:i.clientWidth/2,l=t?t.y-a.top:i.clientHeight/2;o=o||{x:(i.scrollLeft+n-s.offsetLeft)/s.offsetWidth,y:(i.scrollTop+l-s.offsetTop)/s.offsetHeight},this.level=e,this.layout(),i.scrollLeft=s.offsetLeft+o.x*s.offsetWidth-n,i.scrollTop=s.offsetTop+o.y*s.offsetHeight-l,this.schedule(),this.book.onZoom()}pagesFraction(e){if(!e)return{x:.5,y:.5};const t=this.book.visible().map(e=>this.book.pages[e].getBoundingClientRect()),o=Math.min(...t.map(e=>e.left)),i=Math.max(...t.map(e=>e.right)),s=Math.min(...t.map(e=>e.top)),a=Math.max(...t.map(e=>e.bottom));return{x:te((e.x-o)/(i-o||1),0,1),y:te((e.y-s)/(a-s||1),0,1)}}open(){this.view=this.doc.createElement("div"),this.view.className="alfb_zoom",this.inner=this.doc.createElement("div"),this.inner.className="alfb_zoom_inner",this.view.append(this.inner),this.book.stage.append(this.view),this.fill(),this.drag(),this.view.addEventListener("dblclick",()=>this.set(1))}fill(){this.shown=this.book.visible(),this.sharp=this.shown.map(()=>0),this.inner.replaceChildren(...this.shown.map(e=>{const t=this.doc.createElement("div");return t.className="alfb_zoom_page",t.setAttribute("role","img"),t.setAttribute("aria-label",this.book.pages[e].getAttribute("aria-label")),t.append(this.copy(e)),t}))}copy(e){if("images"===this.book.config.source){const t=this.book.config.images[e],o=this.doc.createElement("img");return o.src=t.url,o.alt=t.alt||"",o}const t=this.doc.createElement("canvas"),o=this.book.pages[e].querySelector("canvas");return o&&(t.width=o.width,t.height=o.height,t.getContext("2d").drawImage(o,0,0)),t}layout(){const e=this.book.flip.getBoundsRect(),t=Math.round(e.pageWidth*this.level),o=Math.round(e.height*this.level);this.inner.style.width=t*this.shown.length+"px",this.inner.style.height=o+"px",[...this.inner.children].forEach(e=>{e.style.width=t+"px",e.style.height=o+"px"})}schedule(){clearTimeout(this.timer),this.timer=setTimeout(()=>this.render(),150)}async render(){if(!this.view||"images"===this.book.config.source)return;const e=++this.token,t=this.book.flip.getBoundsRect(),o=Math.min(this.book.win.devicePixelRatio||1,2),i=Math.min(Math.ceil(t.pageWidth*this.level*o),Math.floor(Math.sqrt(16e6*this.book.ratio)));for(let t=0;t<this.shown.length;t++){if(this.sharp[t]>=i)continue;const o=await this.book.drawPage(this.shown[t],i).catch(()=>null);if(e!==this.token||!this.view)return;o&&(this.inner.children[t].replaceChildren(o),this.sharp[t]=i)}}update(){this.view&&(this.book.visible().join()!==this.shown.join()?(this.token++,this.fill(),this.layout(),this.view.scrollTop=0,this.view.scrollLeft=0,this.schedule()):this.set(this.level))}close(){clearTimeout(this.timer),this.token++,this.view?.remove(),this.view=null,this.level=1,this.book.onZoom()}drag(){const{view:e}=this;let t=null;e.addEventListener("pointerdown",o=>{"mouse"===o.pointerType&&0===o.button&&(t={x:o.clientX,y:o.clientY,left:e.scrollLeft,top:e.scrollTop},e.setPointerCapture(o.pointerId),e.classList.add("alfb_dragging"))}),e.addEventListener("pointermove",o=>{t&&(e.scrollLeft=t.left-(o.clientX-t.x),e.scrollTop=t.top-(o.clientY-t.y))});const o=()=>{t=null,e.classList.remove("alfb_dragging")};e.addEventListener("pointerup",o),e.addEventListener("pointercancel",o)}attach(){const{book:e}=this,{stage:t}=e,o={capture:!0,passive:!1};e.on(t,"touchstart",t=>{2!==t.touches.length||e.thumbs?.open||(t.preventDefault(),t.stopPropagation(),e.cancelTouch(),this.pinch={distance:oe(t.touches),level:this.level})},o),e.on(t,"touchmove",e=>{var t;this.pinch&&(e.preventDefault(),e.stopPropagation(),2===e.touches.length&&this.set(this.pinch.level*oe(e.touches)/this.pinch.distance,{x:((t=e.touches)[0].clientX+t[1].clientX)/2,y:(t[0].clientY+t[1].clientY)/2}))},o);const i=e=>{this.pinch&&!e.touches.length&&(this.pinch=null)};e.on(t,"touchend",i,o),e.on(t,"touchcancel",i,o),e.on(t,"wheel",t=>{t.ctrlKey&&!e.thumbs?.open&&(t.preventDefault(),this.set(this.level*Math.exp(-t.deltaY/100),{x:t.clientX,y:t.clientY}))},o);let s=1;e.on(t,"gesturestart",e=>{e.preventDefault(),s=this.level},o),e.on(t,"gesturechange",t=>{t.preventDefault(),this.pinch||e.thumbs?.open||this.set(s*t.scale,{x:t.clientX,y:t.clientY})},o)}}class se{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.items=[],this.urls=[],this.queue=Promise.resolve()}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.contents?.close(!1),t.search?.close(!1);const o=t.visible();this.panel=this.doc.createElement("div"),this.panel.className="alfb_thumbs",this.panel.setAttribute("role","region"),this.panel.setAttribute("aria-label",t.thumbsBtn.title),this.items=t.pages.map((e,i)=>{const s=this.doc.createElement("button");s.type="button",s.className="alfb_thumb",s.setAttribute("aria-label",e.getAttribute("aria-label")),o.includes(i)&&(s.classList.add("alfb_current"),s.setAttribute("aria-current","page"));const a=this.doc.createElement("span");a.className="alfb_thumb_img",a.style.aspectRatio=String(t.ratio);const n=this.doc.createElement("span");return n.className="alfb_thumb_num",n.setAttribute("aria-hidden","true"),n.textContent=i+1,s.append(a,n),s.addEventListener("click",()=>{this.close(!1),t.go(i),t.thumbsBtn.focus()}),s}),this.panel.append(...this.items),t.stage.append(this.panel),this.observer=new t.win.IntersectionObserver(e=>e.forEach(e=>{e.isIntersecting&&(this.observer.unobserve(e.target),this.draw(this.items.indexOf(e.target)))}),{root:this.panel,rootMargin:"200px 0px"}),this.items.forEach(e=>this.observer.observe(e));const i=this.items[o[0]]||this.items[0];this.panel.scrollTop=i.offsetTop-(this.panel.clientHeight-i.offsetHeight)/2,e&&i.focus({preventScroll:!0}),t.onThumbs()}draw(e){if(this.urls[e])this.place(e,this.urls[e]);else{if("images"===this.book.config.source){const t=this.book.config.images[e];return void this.place(e,t.thumb||t.url)}this.queue=this.queue.then(()=>this.render(e)).catch(()=>{})}}async render(e){if(!this.panel||this.urls[e])return;const t=Math.round(160*Math.min(this.book.win.devicePixelRatio||1,2)),o=this.book.pages[e].querySelector("canvas");let i;o&&o.width>=t?(i=this.doc.createElement("canvas"),i.width=t,i.height=Math.round(t*o.height/o.width),i.getContext("2d").drawImage(o,0,0,i.width,i.height)):i=await this.book.drawPage(e,t);const s=await new Promise(e=>i.toBlob(e,"image/jpeg",.8));s&&!this.book.destroyed&&(this.urls[e]=URL.createObjectURL(s),this.place(e,this.urls[e]))}place(e,t){const o=this.items[e]?.firstChild;if(!this.panel||!o||o.firstChild)return;const i=this.doc.createElement("img");i.src=t,i.alt="",i.decoding="async",o.append(i)}close(e){this.panel&&(this.observer.disconnect(),this.panel.remove(),this.panel=null,this.items=[],this.book.onThumbs(),e&&this.book.thumbsBtn.focus())}destroy(){this.close(!1),this.urls.forEach(e=>e&&URL.revokeObjectURL(e)),this.urls=[]}}class ae{constructor(e,t){this.book=e,this.doc=e.doc,this.outline=t,this.panel=null}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}show(e=!0){const{book:t}=this;t.zoom?.close(),t.thumbs?.close(!1),t.search?.close(!1),this.panel=this.doc.createElement("nav"),this.panel.className="alfb_contents",this.panel.setAttribute("aria-label",t.contentsBtn.title);const o=this.doc.createElement("ul");this.add(o,this.outline,0),this.panel.append(o),t.stage.append(this.panel),e&&o.querySelector("a, button")?.focus({preventScroll:!0}),t.onContents()}add(e,t,o){for(const i of t){const t=this.doc.createElement("li");t.append(this.entry(i,o)),e.append(t),i.items?.length&&this.add(e,i.items,o+1)}}entry(e,t){const{book:o}=this,i=(e.title||"").trim()||(0,c.__)("Untitled","softicon-flipbook"),s=e.url?o.safeUrl(e.url):null,a=this.doc.createElement(s?"a":"button");a.className="alfb_entry",a.style.paddingLeft=12+16*Math.min(t,3)+"px";const n=this.doc.createElement("span");n.className="alfb_entry_title",n.textContent=i;const l=this.doc.createElement("span");if(l.className="alfb_entry_num",a.append(n,l),s)return a.href=s,a.target="_blank",a.rel="noopener noreferrer",a;a.type="button";const r=o.destPage(e.dest);return r.then(e=>{null!==e?l.textContent=e+1:a.disabled=!0}),a.addEventListener("click",async()=>{const e=await r;null!==e&&(this.close(!1),o.go(e),o.contentsBtn.focus())}),a}close(e){this.panel&&(this.panel.remove(),this.panel=null,this.book.onContents(),e&&this.book.contentsBtn.focus())}destroy(){this.close(!1)}}class ne{constructor(e){this.book=e,this.doc=e.doc,this.panel=null,this.texts=[],this.round=0}get open(){return!!this.panel}toggle(){this.panel?this.close(!0):this.show()}text(e){return this.texts[e]||(this.texts[e]=this.book.pdf.getPage(e+1).then(e=>e.getTextContent()).then(e=>(e=>{let t="",o=null;return e.forEach(e=>{if("string"==typeof e.str){if(o){const i=Math.max(e.height,o.height)||1,s=Math.abs(e.transform[5]-o.transform[5])<.5*i,a=e.transform[4]-(o.transform[4]+o.width);t+=o.hasEOL||!s||a>.3*i||a<-i?" ":""}t+=/^[\p{L}\p{N}]( [\p{L}\p{N}]){2,}$/u.test(e.str)?e.str.replace(/ /g,""):e.str,o=e}}),t.replace(/\s+/g," ").trim()})(e.items)).catch(()=>"")),this.texts[e]}show(){const{book:e,doc:t}=this;let o;e.zoom?.close(),e.thumbs?.close(!1),e.contents?.close(!1),this.panel=t.createElement("div"),this.panel.className="alfb_search",this.panel.setAttribute("role","search"),this.input=t.createElement("input"),this.input.type="search",this.input.className="alfb_search_input",this.input.placeholder=(0,c.__)("Search in this book","softicon-flipbook"),this.input.setAttribute("aria-label",this.input.placeholder),this.input.value=this.query||"",this.status=t.createElement("p"),this.status.className="alfb_search_status",this.status.setAttribute("aria-live","polite"),this.list=t.createElement("ul"),this.input.addEventListener("keydown",e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),this.close(!0))}),this.input.addEventListener("input",()=>{clearTimeout(o),o=setTimeout(()=>this.run(),250)}),this.panel.append(this.input,this.status,this.list),e.stage.append(this.panel),this.input.focus({preventScroll:!0}),e.onSearch(),this.input.value&&this.run()}async run(){const e=this.input.value.trim(),t=e.toLowerCase(),o=++this.round;if(this.query=e,this.list.replaceChildren(),t.length<2)return void(this.status.textContent="");this.status.textContent=(0,c.__)("Searching…","softicon-flipbook");let i=0;for(let e=0;e<this.book.count&&i<50;e++){const s=await this.text(e);if(o!==this.round||!this.panel)return;const a=s.toLowerCase().indexOf(t);a>=0&&(i++,this.list.append(this.entry(e,s,a,t.length)))}this.status.textContent=i
    33/* translators: %s: number of pages */?(0,c.sprintf)((0,c._n)("Found on %s page","Found on %s pages",i,"softicon-flipbook"),i):(0,c.__)("No pages found.","softicon-flipbook")}entry(e,t,o,i){const{book:s,doc:a}=this,n=a.createElement("li"),l=a.createElement("button");l.type="button",l.className="alfb_entry";const r=a.createElement("span");r.className="alfb_entry_title";const h=Math.max(0,o-40),c=Math.min(t.length,o+i+60),p=a.createElement("mark");p.textContent=t.slice(o,o+i),r.append((h>0?"…":"")+t.slice(h,o),p,t.slice(o+i,c)+(c<t.length?"…":""));const d=a.createElement("span");return d.className="alfb_entry_num",d.textContent=e+1,l.append(r,d),l.addEventListener("click",()=>{this.close(!1),s.go(e),s.searchBtn.focus()}),n.append(l),n}close(e){this.panel&&(this.round++,this.panel.remove(),this.panel=null,this.book.onSearch(),e&&this.book.searchBtn.focus())}destroy(){this.close(!1)}}class le{constructor(e){this.book=e;const t=t=>{const o=e.doc.createElement("div");return o.className=t,o.setAttribute("aria-hidden","true"),o};this.board=t("alfb_board"),this.leftEdge=t("alfb_edge alfb_edge_left"),this.rightEdge=t("alfb_edge alfb_edge_right"),this.gutter=t("alfb_gutter"),e.stage.prepend(this.board,this.leftEdge,this.rightEdge),e.stage.append(this.gutter),e.root.classList.add("alfb_hardcover")}update(){const{win:e}=this.book;e.cancelAnimationFrame(this.frame),this.frame=e.requestAnimationFrame(()=>{this.frame=e.requestAnimationFrame(()=>this.measure())})}measure(){const{book:e}=this,t=e.stage.getBoundingClientRect(),o=e.visible().map(t=>e.pages[t].getBoundingClientRect()).filter(e=>e.width);if(!o.length)return;const i=Math.min(...o.map(e=>e.left))-t.left,s=Math.max(...o.map(e=>e.right))-t.left,a=Math.min(...o.map(e=>e.top))-t.top,n=Math.max(...o.map(e=>e.bottom))-t.top,l=Math.min(...e.visible()),r=e.count>1?l/(e.count-1):0,h=Math.min(12,Math.max(4,Math.round(e.count/4))),c=Math.round(h*r),p=Math.round(h*(1-r)),d=1===o.length&&"landscape"===e.flip.getOrientation()?3:10;if(re(this.board,i-c-d,a-d,s-i+c+p+2*d,n-a+2*d),re(this.leftEdge,i-c,a+2,c,n-a-4),re(this.rightEdge,s,a+2,p,n-a-4),2===o.length){const e=Math.min(o[0].right,o[1].right)-t.left,l=Math.round(.06*(s-i));re(this.gutter,e-l,a,2*l,n-a)}else this.gutter.style.display="none"}flipping(e){this.gutter.classList.toggle("alfb_hidden",e)}destroy(){this.book.win.cancelAnimationFrame(this.frame),[this.board,this.leftEdge,this.rightEdge,this.gutter].forEach(e=>e.remove()),this.book.root.classList.remove("alfb_hardcover")}}function re(e,t,o,i,s){e.style.display=i>0&&s>0?"":"none",e.style.left=Math.round(t)+"px",e.style.top=Math.round(o)+"px",e.style.width=Math.round(i)+"px",e.style.height=Math.round(s)+"px"}class he{constructor(e){this.book=e,this.seconds=Math.min(60,Math.max(2,parseInt(e.config.autoplaySeconds,10)||4)),this.loop=!1!==e.config.autoplayLoop,this.stopped=!!e.win.matchMedia?.("(prefers-reduced-motion: reduce)").matches,this.visible=!1,this.hover=!1}start(){const{book:e}=this,t=()=>this.stop(),o=e=>!e.composedPath().includes(this.button)&&t();e.on(e.stage,"pointerdown",t),e.on(e.root,"keydown",o),e.on(e.bar,"click",o),e.on(e.stage,"mouseenter",()=>this.set("hover",!0)),e.on(e.stage,"mouseleave",()=>this.set("hover",!1)),"IntersectionObserver"in e.win?(this.observer=new e.win.IntersectionObserver(e=>this.set("visible",e[0].isIntersecting),{threshold:.5}),this.observer.observe(e.root)):this.visible=!0,this.update()}set(e,t){this[e]=t,this.update()}get playing(){return!this.stopped&&this.visible&&!this.hover}update(){clearTimeout(this.timer),this.playing&&(this.timer=setTimeout(()=>this.turn(),1e3*this.seconds));const e=this.button;if(e){e.innerHTML=this.book.icon(this.stopped?"play":"pause");const t=this.stopped?(0,c.__)("Play","softicon-flipbook"):(0,c.__)("Pause","softicon-flipbook");e.title=t,e.setAttribute("aria-label",t),e.setAttribute("aria-pressed",this.stopped?"false":"true")}}turn(){const{book:e}=this,t=Math.max(...e.visible())>=e.count-1;!t||this.loop?(t?e.turnTo(0):e.next(),this.update()):this.stop()}toggle(){this.stopped=!this.stopped,this.update()}stop(){this.stopped||(this.stopped=!0,this.update())}destroy(){clearTimeout(this.timer),this.observer?.disconnect()}}class ce{constructor(e){this.book=e,this.close=this.close.bind(this)}async toggle(e){const{win:t}=this.book,o=t.navigator;if(o.share&&t.matchMedia?.("(pointer: coarse)").matches)try{await o.share({title:this.book.doc.title,url:e})}catch(e){}else this.menu?this.close():this.open(e)}open(e){const{doc:t,root:o}=this.book,i=encodeURIComponent(e),s=encodeURIComponent(t.title),a=t.createElement("div");a.className="alfb_share_menu",a.setAttribute("role","dialog"),a.setAttribute("aria-label",(0,c.__)("Share this page","softicon-flipbook")),[["facebook","Facebook",(e,t)=>`https://www.facebook.com/sharer/sharer.php?u=${e}&quote=${t}`],["x","X",(e,t)=>`https://x.com/intent/post?url=${e}&text=${t}`],["linkedin","LinkedIn",e=>`https://www.linkedin.com/sharing/share-offsite/?url=${e}`],["pinterest","Pinterest",(e,t)=>`https://pinterest.com/pin/create/button/?url=${e}&description=${t}`],["email",(0,c.__)("Email","softicon-flipbook"),(e,t)=>`mailto:?subject=${t}&body=${e}`]].forEach(([e,o,n])=>{const l=t.createElement("a");l.className="alfb_share_"+e,l.href=n(i,s),"email"!==e&&(l.target="_blank",l.rel="noopener noreferrer"),l.textContent=o,l.addEventListener("click",()=>setTimeout(this.close)),a.append(l)});const n=t.createElement("button");n.type="button",n.className="alfb_share_copy",n.textContent=(0,c.__)("Copy link","softicon-flipbook"),n.addEventListener("click",async()=>{this.close();try{await this.book.win.navigator.clipboard.writeText(e),this.book.toast((0,c.__)("Link copied","softicon-flipbook"))}catch(t){this.book.win.prompt((0,c.__)("Copy this link","softicon-flipbook"),e)}}),a.append(n),a.addEventListener("keydown",e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),this.close(),this.book.shareBtn?.focus())}),o.append(a),this.menu=a,this.book.shareBtn?.setAttribute("aria-expanded","true"),a.querySelector("a").focus({preventScroll:!0}),setTimeout(()=>t.addEventListener("click",this.outside=e=>!a.contains(e.target)&&!this.book.shareBtn?.contains(e.target)&&this.close()))}close(){this.menu?.remove(),this.menu=null,this.book.shareBtn?.setAttribute("aria-expanded","false"),this.outside&&(this.book.doc.removeEventListener("click",this.outside),this.outside=null)}}const pe=e=>`<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path fill="currentColor" d="${e}"/></svg>`,de={prev:pe("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z"),next:pe("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z"),fullscreen:pe("M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z"),exitFullscreen:pe("M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"),print:pe("M19 8H5a3 3 0 0 0-3 3v6h4v4h12v-4h4v-6a3 3 0 0 0-3-3m-3 11H8v-5h8zm3-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2m-1-9H6v4h12z"),download:pe("M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"),contents:pe("M3 5h2v2H3zm4 0h14v2H7zm-4 6h2v2H3zm4 0h14v2H7zm-4 6h2v2H3zm4 0h14v2H7z"),thumbnails:pe("M3 3h8v8H3zm2 2v4h4V5zm8-2h8v8h-8zm2 2v4h4V5zM3 13h8v8H3zm2 2v4h4v-4zm8-2h8v8h-8zm2 2v4h4v-4z"),zoomIn:pe("M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z"),zoomOut:pe("M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9M7 9h5v1H7z"),soundOn:pe("M3 9v6h4l5 5V4L7 9zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4M14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6"),search:pe("M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9"),play:pe("M8 5v14l11-7z"),pause:pe("M6 19h4V5H6zm8-14v14h4V5z"),share:pe("M18 16.1c-.8 0-1.4.3-2 .8l-7.1-4.2c.1-.2.1-.5.1-.7s0-.5-.1-.7L16 7.2c.5.5 1.2.8 2 .8a3 3 0 1 0-3-3c0 .2 0 .5.1.7L8 9.8A3 3 0 1 0 8 14.2l7.1 4.2c-.1.2-.1.4-.1.6a2.9 2.9 0 1 0 3-2.9"),soundOff:pe("M16.5 12A4.5 4.5 0 0 0 14 8v2.2l2.5 2.5zm2.5 0a7 7 0 0 1-.6 2.8l1.5 1.5A9 9 0 0 0 14 3.2v2.1a7 7 0 0 1 5 6.7M4.3 3 3 4.3 7.7 9H3v6h4l5 5v-6.7l4.3 4.3a7 7 0 0 1-2.3 1.2v2.1a9 9 0 0 0 3.7-1.8l2 2 1.3-1.3-9-9zM12 4 9.9 6.1 12 8.2z")},fe=e=>[...e.ownerDocument.querySelectorAll(".alfb_wrapper[data-alfb][alfb-block], .alfb_lb[data-alfb][alfb-block]")].indexOf(e)+1;class ue{constructor(e){this.urls=e}async fetch({kind:e,filename:t}){const o=this.urls[e]+t+".json",i=await fetch(o);if(!i.ok)throw new Error("Unable to load "+o);const s=atob(await i.json()),a=new Uint8Array(s.length);for(let e=0;e<s.length;e++)a[e]=s.charCodeAt(e);return a}}const be=async(e,t)=>{const i=o.p+"pdfjs/",s=await o.e(854).then(()=>o(626));return s.GlobalWorkerOptions.workerSrc=i+"pdf.worker.min.js?ver="+s.version+"-p2",s.getDocument({url:e,cMapUrl:i+"cmaps/",cMapPacked:!0,standardFontDataUrl:i+"standard_fonts/",BinaryDataFactory:ue,useWasm:!1,wasmUrl:i+"decoders/",ownerDocument:t,disableAutoFetch:!0,isEvalSupported:!1,verbosity:s.VerbosityLevel.ERRORS})};class me{constructor(e,t,{editor:o=!1}={}){this.root=e,this.doc=e.ownerDocument,this.win=this.doc.defaultView||window,this.config=t,this.editor=o,this.sound=!!t.flipSound&&!o,this.pages=[],this.rendered=[],this.queue=Promise.resolve(),this.destroyed=!1,this.listeners=[]}async init(){if(this.stage=this.root.querySelector(".alfb_stage"),this.root.classList.add("alfb_js"),["dark","auto"].includes(this.config.theme)&&this.root.classList.add("alfb_theme_"+this.config.theme),this.config.title&&!this.root.querySelector(":scope > .alfb_title")){const e=this.doc.createElement("div");e.className="alfb_title",e.textContent=this.config.title,this.root.prepend(e)}try{const{PageFlip:e}=await o.e(966).then(()=>o(334)),t="images"===this.config.source?this.imageSize():await this.openPdf();if(this.destroyed)return;this.build(e,t)}catch(e){this.destroyed||this.fail(e)}}async openPdf(){if(this.task=await be(this.config.pdf,this.doc),this.pdf=await this.task.promise,this.count=this.pdf.numPages,this.config.showContents&&!this.editor){const e=await this.pdf.getOutline().catch(()=>null);this.outline=e?.length?e:null}const e=await this.pdf.getPage(1),{width:t,height:o}=e.getViewport({scale:1});return{width:t,height:o}}imageSize(){const e=this.config.images||[];this.count=e.length;const t=e.find(e=>e.width&&e.height);return t?{width:t.width,height:t.height}:{width:3,height:4}}build(e,t){const o=this.win.innerWidth,i=o<600?this.config.maxHeightPhone:o<1025?this.config.maxHeightTablet:0;i>0&&(this.config.maxHeight=i);const{pageMode:s,showCover:a,maxHeight:n}=this.config,l=!this.editor&&fe(this.root)===(e=>{const t=/(?:^#|&)book=(\d+)/.exec(e.location.hash);return t?parseInt(t[1],10):1})(this.win)&&(e=>{const t=/(?:^#|&)page=(\d+)/.exec(e.location.hash);return t?parseInt(t[1],10):0})(this.win)||this.config.startPage,r=t.width/t.height,h=Math.max(100,Math.floor(n*r));this.rtl=!!this.config.rtl,this.ratio=r,this.maxWidth=h;for(let e=0;e<this.count;e++){const t=this.doc.createElement("div");t.className="alfb_page",t.setAttribute("role","img"),
    44/* translators: %d: page number */
    … …  
    88t.title=(0,c.sprintf)((0,c.__)("Go to page %d","softicon-flipbook"),e.target+1),t.href="#page="+(e.target+1),t.addEventListener("click",t=>{t.preventDefault(),this.go(e.target)})),t.setAttribute("aria-label",t.title),i.append(t)}o.append(i)}async drawPage(e,t){const o=await this.pdf.getPage(e+1),i=o.getViewport({scale:t/o.getViewport({scale:1}).width}),s=this.doc.createElement("canvas");return s.width=Math.floor(i.width),s.height=Math.floor(i.height),await o.render({canvas:s,viewport:i}).promise,o.cleanup(),this.emit("paint",{index:e,canvas:s}),s}icon(e){return de[e]}button(e,t,o){const i=this.doc.createElement("button");return i.type="button",i.className=`alfb_btn alfb_btn_${e}`,i.setAttribute("aria-label",t),i.title=t,i.innerHTML=de[e],i.addEventListener("click",o),i}toolbar(){const e=this.doc.createElement("div");e.className="alfb_toolbar",this.prevBtn=this.button(this.rtl?"next":"prev",(0,c.__)("Previous page","softicon-flipbook"),()=>this.prev()),this.nextBtn=this.button(this.rtl?"prev":"next",(0,c.__)("Next page","softicon-flipbook"),()=>this.next()),this.counter=this.doc.createElement(this.editor?"span":"button"),this.counter.className="alfb_counter",this.counter.setAttribute("aria-live","polite"),this.editor||(this.counter.type="button",this.counter.title=(0,c.__)("Go to page","softicon-flipbook"),this.counter.addEventListener("click",()=>this.askPage()));const t=this.doc.createElement("div");t.className="alfb_nav",t.append(...this.rtl?[this.nextBtn,this.counter,this.prevBtn]:[this.prevBtn,this.counter,this.nextBtn]);const o=this.doc.createElement("div");if(o.className="alfb_tools",this.autoplay&&(this.autoplay.button=this.button("play",(0,c.__)("Play","softicon-flipbook"),()=>this.autoplay.toggle()),o.append(this.autoplay.button)),this.search&&(this.searchBtn=this.button("search",(0,c.__)("Search","softicon-flipbook"),()=>this.search.toggle()),this.searchBtn.setAttribute("aria-expanded","false"),o.append(this.searchBtn)),this.contents&&(this.contentsBtn=this.button("contents",(0,c.__)("Table of contents","softicon-flipbook"),()=>this.contents.toggle()),this.contentsBtn.setAttribute("aria-expanded","false"),o.append(this.contentsBtn)),this.thumbs&&(this.thumbsBtn=this.button("thumbnails",(0,c.__)("Thumbnails","softicon-flipbook"),()=>this.thumbs.toggle()),this.thumbsBtn.setAttribute("aria-expanded","false"),o.append(this.thumbsBtn)),this.zoom){const e=e=>{this.thumbs?.close(!1),this.contents?.close(!1),this.search?.close(!1),this.zoom.step(e)};this.zoomOutBtn=this.button("zoomOut",(0,c.__)("Zoom out","softicon-flipbook"),()=>e(-1)),this.zoomInBtn=this.button("zoomIn",(0,c.__)("Zoom in","softicon-flipbook"),()=>e(1)),o.append(this.zoomOutBtn,this.zoomInBtn)}if(this.config.flipSound&&!this.editor){const e=this.button(this.sound?"soundOn":"soundOff",(0,c.__)("Page turn sound","softicon-flipbook"),()=>{this.sound=!this.sound,e.innerHTML=de[this.sound?"soundOn":"soundOff"],e.setAttribute("aria-pressed",this.sound?"true":"false")});e.setAttribute("aria-pressed","true"),o.append(e)}if(this.config.showPrint&&!this.editor&&o.append(this.button("print",(0,c.__)("Print","softicon-flipbook"),()=>async function(e){if(e.printing)return;e.printing=!0;const{doc:t,win:o}=e;(e=>{if(e.getElementById("alfb-print-style"))return;const t=e.createElement("style");t.id="alfb-print-style",t.textContent=".alfb_print{display:none}@media print{body.alfb_printing>*:not(.alfb_print){display:none!important}body.alfb_printing .alfb_print{display:block}.alfb_print img{display:block;max-width:100%;max-height:100vh;width:auto;height:auto;margin:0 auto;break-after:page;page-break-after:always}.alfb_print img:last-child{break-after:auto;page-break-after:auto}@page{margin:0}}",e.head.append(t)})(t);const i=t.createElement("div");i.className="alfb_print";const s=t.createElement("span");s.className="alfb_toast",s.setAttribute("role","status"),e.root.append(s);try{for(let o=0;o<e.count;o++){
    99/* translators: 1: page being prepared, 2: number of pages */
    10 s.textContent=(0,c.sprintf)((0,c.__)("Preparing pages %1$d / %2$d","softicon-flipbook"),o+1,e.count);const a=t.createElement("img");if(a.alt="","images"===e.config.source)a.src=e.config.images[o].url,await a.decode().catch(()=>{});else{const t=await e.drawPage(o,1240);a.src=t.toDataURL("image/jpeg",.9)}i.append(a)}t.body.append(i),t.body.classList.add("alfb_printing"),s.remove();const a=()=>{t.body.classList.remove("alfb_printing"),i.remove(),e.printing=!1,o.removeEventListener("afterprint",a)};o.addEventListener("afterprint",a),o.print()}catch(t){s.textContent=(0,c.__)("The book could not be printed.","softicon-flipbook"),setTimeout(()=>s.remove(),2500),i.remove(),e.printing=!1}}(this))),this.config.showDownload&&"pdf"===this.config.source){const e=this.doc.createElement("a");e.className="alfb_btn alfb_btn_download",e.href=this.safeUrl(this.config.pdf)||"#",e.download="",e.target="_blank",e.rel="noopener",e.title=(0,c.__)("Download PDF","softicon-flipbook"),e.setAttribute("aria-label",e.title),e.innerHTML=de.download,o.append(e)}this.config.showShare&&!this.editor&&(this.shareBtn=this.button("share",(0,c.__)("Share this page","softicon-flipbook"),()=>this.share()),this.shareBtn.setAttribute("aria-haspopup","dialog"),o.append(this.shareBtn)),this.config.showFullscreen&&!this.editor&&(this.fsBtn=this.button("fullscreen",(0,c.__)("Fullscreen","softicon-flipbook"),()=>this.toggleFullscreen()),o.append(this.fsBtn)),e.append(t,o),this.root.appendChild(e),this.bar=e,this.zoom&&this.onZoom()}async share(){const e=new URL(this.win.location.href),t=fe(this.owner||this.root);e.hash="page="+(Math.min(...this.visible())+1)+(t>1?"&book="+t:""),this.sharing=this.sharing||new ce(this),await this.sharing.toggle(e.toString())}toast(e){const t=this.doc.createElement("span");t.className="alfb_toast",t.setAttribute("role","status"),t.textContent=e,this.root.append(t),setTimeout(()=>t.remove(),2e3)}askPage(){const e=this.doc.createElement("input");e.type="number",e.className="alfb_page_input",e.min=1,e.max=this.count,e.value=Math.min(...this.visible())+1,e.setAttribute("aria-label",(0,c.__)("Page number","softicon-flipbook"));let t=!0;const o=(o,i)=>{if(!t)return;t=!1;const s=parseInt(e.value,10);e.replaceWith(this.counter),o&&s&&this.go(s-1),i&&this.counter.focus()};e.addEventListener("keydown",e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),o(!0,!0)):"Escape"===e.key&&(e.preventDefault(),o(!1,!0))}),e.addEventListener("blur",()=>o(!0,!1)),this.counter.replaceWith(e),e.focus(),e.select()}sideArrows(){const e=(e,t,o)=>{const i=this.button(e,t,o);return i.className=`alfb_side alfb_side_${e}`,this.stage.append(i),i};this.sidePrev=e(this.rtl?"next":"prev",(0,c.__)("Previous page","softicon-flipbook"),()=>this.prev()),this.sideNext=e(this.rtl?"prev":"next",(0,c.__)("Next page","softicon-flipbook"),()=>this.next())}tapToRead(){const e=this.doc.createElement("button");e.type="button",e.className="alfb_tap",e.innerHTML=`<span>${de.fullscreen}</span>`,e.querySelector("span").append(this.doc.createTextNode((0,c.__)("Tap to read","softicon-flipbook"))),e.addEventListener("click",()=>this.toggleFullscreen()),this.stage.append(e),this.tap=e}toggleFullscreen(){this.doc.fullscreenElement===this.root||this.root.classList.contains("alfb_overlay")?this.doc.fullscreenElement?this.doc.exitFullscreen():this.setFullscreen(!1):this.root.requestFullscreen&&this.doc.fullscreenEnabled?this.root.requestFullscreen().catch(()=>this.setFullscreen(!0)):this.setFullscreen(!0)}setFullscreen(e){this.root.classList.toggle("alfb_overlay",e&&!this.doc.fullscreenElement),this.root.classList.toggle("alfb_is_fullscreen",e),this.fsBtn&&(this.fsBtn.innerHTML=de[e?"exitFullscreen":"fullscreen"]);const t=this.flip.getSettings();if(e){const e=this.root.querySelector(":scope > .alfb_title"),o=this.win.innerHeight-(this.bar?this.bar.offsetHeight:0)-(e?e.offsetHeight+10:0)-32;t.maxWidth=Math.max(100,Math.floor(o*this.ratio)),t.maxHeight=o}else t.maxWidth=this.maxWidth,t.maxHeight=this.config.maxHeight;"single"===this.config.pageMode&&(t.minWidth=t.maxWidth),this.refresh()}setHeight(e){this.config.maxHeight=e,this.maxWidth=Math.max(100,Math.floor(e*this.ratio)),this.flip&&!this.root.classList.contains("alfb_is_fullscreen")&&this.setFullscreen(!1)}refresh(){this.fit(),this.flip.update(),this.onChange()}on(e,t,o,i=!1){e.addEventListener(t,o,i),this.listeners.push(()=>e.removeEventListener(t,o,i))}watch(){this.on(this.doc,"fullscreenchange",()=>this.setFullscreen(this.doc.fullscreenElement===this.root)),this.editor||(this.on(this.stage,"pointerdown",()=>{this.root.contains(this.doc.activeElement)||this.root.focus({preventScroll:!0})},!0),this.on(this.root,"keydown",e=>{const t=this.thumbs?.open?this.thumbs:this.contents?.open?this.contents:this.search?.open&&this.search;if(t)return void("Escape"===e.key&&(e.preventDefault(),t.close(!0)));const o=this.zoom&&!e.ctrlKey&&!e.metaKey;"ArrowLeft"===e.key?this.back():"ArrowRight"===e.key?this.forward():!o||"+"!==e.key&&"="!==e.key?o&&"-"===e.key?this.zoom.step(-1):"Escape"===e.key&&this.zoom?.active?(e.preventDefault(),this.zoom.set(1)):"Escape"===e.key&&this.root.classList.contains("alfb_overlay")&&(e.preventDefault(),this.setFullscreen(!1)):this.zoom.step(1)}));const e=this.win.ResizeObserver;if(e){let t,o=this.stage.clientWidth;this.observer=new e(()=>{this.stage.clientWidth!==o&&(o=this.stage.clientWidth,clearTimeout(t),t=setTimeout(()=>this.refresh(),120))}),this.observer.observe(this.stage)}}fail(e){this.root.classList.add("alfb_error");const t=this.doc.createElement("p");t.className="alfb_message";const o=this.config.pdf?new URL(this.config.pdf,this.win.location.href):null,i=o&&o.origin!==this.win.location.origin;t.textContent=i?(0,c.__)("This PDF is on another website that does not allow it to be shown here. Upload the PDF to your Media Library instead.","softicon-flipbook"):(0,c.__)("This flipbook could not be loaded.","softicon-flipbook"),this.stage.replaceChildren(t),console.error("SoftIcon Flipbook:",e)}destroy(){this.destroyed=!0,this.zoom?.close(),this.thumbs?.destroy(),this.contents?.destroy(),this.autoplay?.destroy(),this.sharing?.close(),this.search?.destroy(),this.cover?.destroy(),this.sidePrev?.remove(),this.sideNext?.remove(),this.tap?.remove(),this.listeners.forEach(e=>e()),this.observer?.disconnect();try{this.flip?.destroy()}catch(e){}this.task?.destroy(),this.bar?.remove(),this.book?.remove(),this.root.querySelector(":scope > .alfb_title")?.remove(),this.root.classList.remove("alfb_theme_dark","alfb_theme_auto"),this.root.classList.remove("alfb_ready","alfb_error","alfb_overlay","alfb_is_fullscreen","alfb_zoomed","alfb_thumbs_open","alfb_contents_open","alfb_search_open","alfb_side_over","alfb_portrait")}}const ge=({attributes:e})=>{const{source:t,pdfUrl:o,images:i,lightboxImage:s}=e,a=["cover","button","text"].includes(e.lightboxTrigger)?e.lightboxTrigger:"cover",n=["left","center","right"].includes(e.lightboxAlign)?e.lightboxAlign:"center",l=Math.min(600,Math.max(120,parseInt(e.lightboxWidth,10)||260)),r=(e.lightboxText||"").trim(),d="cover"===a,f=s?.url||("images"===t?i[0]?.url:""),u=d&&!f&&"pdf"===t&&!!o,b=(0,p.useRef)(),[m,g]=(0,p.useState)(!1);(0,p.useEffect)(()=>{const e=b.current;if(!u||!e)return;let t=!1;return g(!1),(async(e,t,o)=>{const i=await be(e,t);try{const e=await i.promise,s=await e.getPage(1),a=Math.min((t.defaultView||window).devicePixelRatio||1,2),n=s.getViewport({scale:o*a/s.getViewport({scale:1}).width}),l=t.createElement("canvas");return l.width=Math.floor(n.width),l.height=Math.floor(n.height),await s.render({canvas:l,viewport:n}).promise,l}finally{i.destroy()}})(o,e.ownerDocument,600).then(o=>{t||(e.replaceChildren(o),g(!0))}).catch(()=>{}),()=>{t=!0,e.replaceChildren()}},[u,o]);const _=r||(0,c.__)("Read the flipbook","softicon-flipbook");return(0,h.createElement)("div",{className:`alfb_lb alfb_lb_${n}`+(u&&!m?" alfb_lb_draw":""),style:{"--alfb-lb-width":l+"px"}},d?(0,h.createElement)("span",{className:"alfb_lb_trigger alfb_lb_cover"},(0,h.createElement)("span",{className:"alfb_lb_img"},f?(0,h.createElement)("img",{src:f,alt:""}):(0,h.createElement)("span",{ref:b})),r&&(0,h.createElement)("span",{className:"alfb_lb_caption"},r)):(0,h.createElement)("span",{className:"alfb_lb_trigger "+("button"===a?"alfb_lb_button wp-element-button":"alfb_lb_link")},_))};(0,i.registerBlockType)(r,{icon:L,edit:e=>{const{attributes:t,setAttributes:o}=e,{source:i,pdfId:s,pdfUrl:a,images:n,displayMode:r}=t,m="lightbox"===r,g=(0,p.useRef)(),_=(0,p.useRef)(),k=function(){const e=["softicon-flipbook-style-css","softicon-flipbook-editor-style-css"].join(" ");return(0,p.useEffect)(()=>{const t=e.split(" "),o=[...document.querySelectorAll('iframe[name="editor-canvas"]')],i=()=>o.forEach(e=>b(t,e.contentDocument));return i(),o.forEach(e=>e.addEventListener("load",i)),()=>o.forEach(e=>e.removeEventListener("load",i))},[e]),(0,u.useRefEffect)(t=>{b(e.split(" "),t.ownerDocument)},[e])}(),v=e=>o({pdfId:e.id||0,pdfUrl:e.url||e.source_url||""}),w=e=>o({pdfId:0,pdfUrl:e}),y=e=>o({images:e.map($)}),E=(e=>"images"===e.source?!!e.images?.length:!!e.pdfUrl)(t),x=(e=>{const{source:t,pdfUrl:o,images:i,pageMode:s,bookStyle:a,sideArrows:n,showCover:l,startPage:r,startWith:h,bookTitle:c,theme:p,autoplay:d,autoplaySeconds:f,autoplayLoop:u,rtl:b,phoneFullscreen:m,maxHeight:g,maxHeightTablet:_,maxHeightPhone:k,showDownload:v,showPrint:w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:P,showShare:T,flipSound:L}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?i:[],pageMode:["auto","double","single"].includes(s)?s:"auto",bookStyle:"hardcover"===a?"hardcover":"flat",sideArrows:!!n,showCover:l,startPage:Math.max(1,parseInt(r,10)||1),title:(c||"").trim(),startWith:["thumbnails","contents"].includes(h)?h:"book",theme:["dark","auto"].includes(p)?p:"light",autoplay:!!d,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==u,rtl:!!b,phoneFullscreen:!!m,maxHeight:Math.min(2e3,Math.max(200,parseInt(g,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(k,10)>0?Math.min(2e3,Math.max(200,parseInt(k,10))):0,showDownload:v,showPrint:!!w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:!1!==P,showShare:!!T,flipSound:L}})(t);["showFullscreen","showZoom","showThumbnails","showContents","showLinks","showSearch","showShare","flipSound","showPrint","startWith","autoplay","autoplaySeconds","autoplayLoop","phoneFullscreen"].forEach(e=>delete x[e]);const C=(e=>{const[t,o]=(0,p.useState)(e);return(0,p.useEffect)(()=>{const t=setTimeout(()=>o(e),400);return()=>clearTimeout(t)},[e,400]),t})(JSON.stringify(x));(0,p.useEffect)(()=>{const e=g.current,t=JSON.parse(C);if(!E||m||!e||!("images"===t.source?t.images.length:t.pdf))return;const o=e.ownerDocument.createElement("div");o.className="alfb_wrapper",o.innerHTML='<div class="alfb_stage"><div class="alfb_loading"><span class="alfb_spinner"></span></div></div>',e.replaceChildren(o),_.current=o,M();const i=new me(o,t,{editor:!0});return i.init(),()=>{i.destroy(),e.replaceChildren(),_.current=null}},[C,E,m]);const M=()=>{_.current&&Object.entries((({bgColor:e,toolbarBg:t,toolbarColor:o,coverColor:i})=>({"--alfb-bg":G(e),"--alfb-bar-bg":G(t),"--alfb-bar-color":G(o),"--alfb-cover":G(i)}))(t)).forEach(([e,t])=>t?_.current.style.setProperty(e,t):_.current.style.removeProperty(e))};(0,p.useEffect)(M,[t.bgColor,t.toolbarBg,t.toolbarColor,t.coverColor]);const P=e=>(0,h.createElement)(h.Fragment,null,(0,h.createElement)(f.Button,{variant:"link",onClick:()=>o({source:e})},"images"===e?(0,c.__)("Use images instead","softicon-flipbook"):(0,c.__)("Use a PDF instead","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbPlaceholderHelp"},(0,h.createElement)(f.ExternalLink,{href:B.add},(0,c.__)("New here? Watch the 36-second tutorial","softicon-flipbook"))));return E?(0,h.createElement)(h.Fragment,null,(0,h.createElement)(J,{attributes:t,setAttributes:o,onSelectPdf:v,onSelectImages:y}),(0,h.createElement)(d.BlockControls,{group:"other"},"images"===i?(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:n.map(e=>e.id),onSelect:y,render:({open:e})=>(0,h.createElement)(f.ToolbarButton,{onClick:e},(0,c.__)("Edit pages","softicon-flipbook"))})):(0,h.createElement)(d.MediaReplaceFlow,{mediaId:s,mediaURL:a,allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:v,onSelectURL:w,name:(0,c.__)("Replace PDF","softicon-flipbook")})),(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:k})},(0,l.applyFilters)("alfb.block.preview",null,{attributes:t})||(m?(0,h.createElement)(ge,{attributes:t}):(0,h.createElement)("div",{ref:g})))):(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:k})},"images"===i?(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload or pick the page images, in reading order.","softicon-flipbook")},allowedTypes:["image"],multiple:!0,gallery:!0,onSelect:y},P("pdf")):(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload a PDF, pick one from the Media Library or paste a link.","softicon-flipbook")},allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:v,onSelectURL:w},P("images")))},save:()=>null}),(0,l.addFilter)("blockEditor.useSetting.before","softicon-flipbook/no-margin-panel",(e,t,o,i)=>(r.name!==i||"spacing.margin"!==t)&&e),n()(()=>{const e=new URL(window.location.href),t=window.alfbEditor?.demoPdf;if(!e.searchParams.has("alfb_start")||!t)return;e.searchParams.delete("alfb_start"),window.history.replaceState(window.history.state,"",e.toString());let o=!1;const a=()=>{const e=(0,s.select)("core/editor"),a=e?.__unstableIsEditorReady?e.__unstableIsEditorReady():!!e?.getCurrentPostId();if(o||!a)return;o=!0;let n=0;const l=()=>{const e=(0,s.select)("core/block-editor").getBlocks();e.some(e=>r.name===e.name)||++n>6||((0,s.dispatch)("core/block-editor").insertBlocks((0,i.createBlock)(r.name,{pdfUrl:t}),e.length),setTimeout(l,700))};setTimeout(l,400)},n=(0,s.subscribe)(()=>{a(),o&&n()});a(),o&&n()})},387(e,t,o){window.alfbBuildUrl&&(o.p=window.alfbBuildUrl)}};const t={};function o(i){const s=t[i];if(void 0!==s)return s.exports;const a=t[i]={exports:{}};return e[i](a,a.exports,o),a.exports}o.m=e,(()=>{const e=[];o.O=(t,i,s)=>{if(!i){for(var a=0;a<e.length;a++){let[i,s]=e[a],l=!0;for(var n=0;n<i.length;n++)Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):l=!1;if(l){e.splice(a--,1);const o=s();void 0!==o&&(t=o)}}return t}e.push([i,s])}})(),o.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var s=t[i++],a=t[i++],n=0===a?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:a};o.o(e,s)||Object.defineProperty(e,s,n)}else for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,i)=>(o.f[i](e,t),t),[])),o.u=e=>({854:"pdfjs",966:"page-flip"}[e]+".js?ver="+{854:"82bd6283",966:"dc895a04"}[e]),o.miniCssF=e=>{},o.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={},t="softicon-flipbook:";o.l=(i,s,a,n)=>{if(e[i])return void e[i].push(s);let l,r;if(void 0!==a){const e=document.getElementsByTagName("script");for(var h=0;h<e.length;h++){const o=e[h];if(o.getAttribute("src")==i||o.getAttribute("data-webpack")==t+a){l=o;break}}}l||(r=!0,l=document.createElement("script"),l.charset="utf-8",o.nc&&l.setAttribute("nonce",o.nc),l.setAttribute("data-webpack",t+a),l.src=i),e[i]=[s];const c=(t,o)=>{l.onerror=l.onload=null,clearTimeout(p);const s=e[i];if(delete e[i],l.parentNode?.removeChild(l),s?.forEach(e=>e(o)),t)return t(o)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),r&&document.head.appendChild(l)}})(),(()=>{let e;globalThis.importScripts&&(e=globalThis.location+"");const t=globalThis.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const o=t.getElementsByTagName("script");if(o.length){let t=o.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=o[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),o.p=e})(),(()=>{const e={57:0,350:0};o.f.j=(t,i)=>{let s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else if(350!=t){const a=new Promise((o,i)=>s=e[t]=[o,i]);i.push(s[2]=a);const n=new Error,l=i=>{if(o.o(e,t)&&(s=e[t],0!==s&&(e[t]=void 0),s)){const e=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;n.message="Loading chunk "+t+" failed.\n("+e+": "+o+")",n.name="ChunkLoadError",n.type=e,n.request=o,n.event=i,s[1](n)}};o.l(o.p+o.u(t),l,"chunk-"+t,t)}else e[t]=0},o.O.j=t=>0===e[t];const t=(t,i)=>{let[s,a,n]=i;var l,r,h=0;if(s.some(t=>0!==e[t])){for(l in a)o.o(a,l)&&(o.m[l]=a[l]);if(n)var c=n(o)}for(t&&t(i);h<s.length;h++)r=s[h],o.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return o.O(c)},i=globalThis.webpackChunksofticon_flipbook||=[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();let i=o.O(void 0,[350],()=>o(919));i=o.O(i)})();
     10s.textContent=(0,c.sprintf)((0,c.__)("Preparing pages %1$d / %2$d","softicon-flipbook"),o+1,e.count);const a=t.createElement("img");if(a.alt="","images"===e.config.source)a.src=e.config.images[o].url,await a.decode().catch(()=>{});else{const t=await e.drawPage(o,1240);a.src=t.toDataURL("image/jpeg",.9)}i.append(a)}t.body.append(i),t.body.classList.add("alfb_printing"),s.remove();const a=()=>{t.body.classList.remove("alfb_printing"),i.remove(),e.printing=!1,o.removeEventListener("afterprint",a)};o.addEventListener("afterprint",a),o.print()}catch(t){s.textContent=(0,c.__)("The book could not be printed.","softicon-flipbook"),setTimeout(()=>s.remove(),2500),i.remove(),e.printing=!1}}(this))),this.config.showDownload&&"pdf"===this.config.source){const e=this.doc.createElement("a");e.className="alfb_btn alfb_btn_download",e.href=this.safeUrl(this.config.pdf)||"#",e.download="",e.target="_blank",e.rel="noopener",e.title=(0,c.__)("Download PDF","softicon-flipbook"),e.setAttribute("aria-label",e.title),e.innerHTML=de.download,o.append(e)}this.config.showShare&&!this.editor&&(this.shareBtn=this.button("share",(0,c.__)("Share this page","softicon-flipbook"),()=>this.share()),this.shareBtn.setAttribute("aria-haspopup","dialog"),o.append(this.shareBtn)),this.config.showFullscreen&&!this.editor&&(this.fsBtn=this.button("fullscreen",(0,c.__)("Fullscreen","softicon-flipbook"),()=>this.toggleFullscreen()),o.append(this.fsBtn)),e.append(t,o),this.root.appendChild(e),this.bar=e,this.zoom&&this.onZoom()}async share(){const e=new URL(this.win.location.href),t=fe(this.owner||this.root);e.hash="page="+(Math.min(...this.visible())+1)+(t>1?"&book="+t:""),this.sharing=this.sharing||new ce(this),await this.sharing.toggle(e.toString())}toast(e){const t=this.doc.createElement("span");t.className="alfb_toast",t.setAttribute("role","status"),t.textContent=e,this.root.append(t),setTimeout(()=>t.remove(),2e3)}askPage(){const e=this.doc.createElement("input");e.type="number",e.className="alfb_page_input",e.min=1,e.max=this.count,e.value=Math.min(...this.visible())+1,e.setAttribute("aria-label",(0,c.__)("Page number","softicon-flipbook"));let t=!0;const o=(o,i)=>{if(!t)return;t=!1;const s=parseInt(e.value,10);e.replaceWith(this.counter),o&&s&&this.go(s-1),i&&this.counter.focus()};e.addEventListener("keydown",e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),o(!0,!0)):"Escape"===e.key&&(e.preventDefault(),o(!1,!0))}),e.addEventListener("blur",()=>o(!0,!1)),this.counter.replaceWith(e),e.focus(),e.select()}sideArrows(){const e=(e,t,o)=>{const i=this.button(e,t,o);return i.className=`alfb_side alfb_side_${e}`,this.stage.append(i),i};this.sidePrev=e(this.rtl?"next":"prev",(0,c.__)("Previous page","softicon-flipbook"),()=>this.prev()),this.sideNext=e(this.rtl?"prev":"next",(0,c.__)("Next page","softicon-flipbook"),()=>this.next())}tapToRead(){const e=this.doc.createElement("button");e.type="button",e.className="alfb_tap",e.innerHTML=`<span>${de.fullscreen}</span>`,e.querySelector("span").append(this.doc.createTextNode((0,c.__)("Tap to read","softicon-flipbook"))),e.addEventListener("click",()=>this.toggleFullscreen()),this.stage.append(e),this.tap=e}toggleFullscreen(){this.doc.fullscreenElement===this.root||this.root.classList.contains("alfb_overlay")?this.doc.fullscreenElement?this.doc.exitFullscreen():this.setFullscreen(!1):this.root.requestFullscreen&&this.doc.fullscreenEnabled?this.root.requestFullscreen().catch(()=>this.setFullscreen(!0)):this.setFullscreen(!0)}setFullscreen(e){this.root.classList.toggle("alfb_overlay",e&&!this.doc.fullscreenElement),this.root.classList.toggle("alfb_is_fullscreen",e),this.fsBtn&&(this.fsBtn.innerHTML=de[e?"exitFullscreen":"fullscreen"]);const t=this.flip.getSettings();if(e){const e=this.root.querySelector(":scope > .alfb_title"),o=this.win.innerHeight-(this.bar?this.bar.offsetHeight:0)-(e?e.offsetHeight+10:0)-32;t.maxWidth=Math.max(100,Math.floor(o*this.ratio)),t.maxHeight=o}else t.maxWidth=this.maxWidth,t.maxHeight=this.config.maxHeight;"single"===this.config.pageMode&&(t.minWidth=t.maxWidth),this.refresh()}setHeight(e){this.config.maxHeight=e,this.maxWidth=Math.max(100,Math.floor(e*this.ratio)),this.flip&&!this.root.classList.contains("alfb_is_fullscreen")&&this.setFullscreen(!1)}refresh(){this.fit(),this.flip.update(),this.onChange()}on(e,t,o,i=!1){e.addEventListener(t,o,i),this.listeners.push(()=>e.removeEventListener(t,o,i))}watch(){this.on(this.doc,"fullscreenchange",()=>this.setFullscreen(this.doc.fullscreenElement===this.root)),this.editor||(this.on(this.stage,"pointerdown",()=>{this.root.contains(this.doc.activeElement)||this.root.focus({preventScroll:!0})},!0),this.on(this.root,"keydown",e=>{const t=this.thumbs?.open?this.thumbs:this.contents?.open?this.contents:this.search?.open&&this.search;if(t)return void("Escape"===e.key&&(e.preventDefault(),t.close(!0)));const o=this.zoom&&!e.ctrlKey&&!e.metaKey;"ArrowLeft"===e.key?this.back():"ArrowRight"===e.key?this.forward():!o||"+"!==e.key&&"="!==e.key?o&&"-"===e.key?this.zoom.step(-1):"Escape"===e.key&&this.zoom?.active?(e.preventDefault(),this.zoom.set(1)):"Escape"===e.key&&this.root.classList.contains("alfb_overlay")&&(e.preventDefault(),this.setFullscreen(!1)):this.zoom.step(1)}));const e=this.win.ResizeObserver;if(e){let t,o=this.stage.clientWidth;this.observer=new e(()=>{this.stage.clientWidth!==o&&(o=this.stage.clientWidth,clearTimeout(t),t=setTimeout(()=>this.refresh(),120))}),this.observer.observe(this.stage)}}fail(e){this.root.classList.add("alfb_error");const t=this.doc.createElement("p");t.className="alfb_message";const o=this.config.pdf?new URL(this.config.pdf,this.win.location.href):null,i=o&&o.origin!==this.win.location.origin;t.textContent=i?(0,c.__)("This PDF is on another website that does not allow it to be shown here. Upload the PDF to your Media Library instead.","softicon-flipbook"):(0,c.__)("This flipbook could not be loaded.","softicon-flipbook"),this.stage.replaceChildren(t),console.error("SoftIcon Flipbook:",e)}destroy(){this.destroyed=!0,this.zoom?.close(),this.thumbs?.destroy(),this.contents?.destroy(),this.autoplay?.destroy(),this.sharing?.close(),this.search?.destroy(),this.cover?.destroy(),this.sidePrev?.remove(),this.sideNext?.remove(),this.tap?.remove(),this.listeners.forEach(e=>e()),this.observer?.disconnect();try{this.flip?.destroy()}catch(e){}this.task?.destroy(),this.bar?.remove(),this.book?.remove(),this.root.querySelector(":scope > .alfb_title")?.remove(),this.root.classList.remove("alfb_theme_dark","alfb_theme_auto"),this.root.classList.remove("alfb_ready","alfb_error","alfb_overlay","alfb_is_fullscreen","alfb_zoomed","alfb_thumbs_open","alfb_contents_open","alfb_search_open","alfb_side_over","alfb_portrait")}}const ge=({attributes:e})=>{const{source:t,pdfUrl:o,images:i,lightboxImage:s}=e,a=["cover","button","text"].includes(e.lightboxTrigger)?e.lightboxTrigger:"cover",n=["left","center","right"].includes(e.lightboxAlign)?e.lightboxAlign:"center",l=Math.min(600,Math.max(120,parseInt(e.lightboxWidth,10)||260)),r=(e.lightboxText||"").trim(),d="cover"===a,f=s?.url||("images"===t?i[0]?.url:""),u=d&&!f&&"pdf"===t&&!!o,b=(0,p.useRef)(),[m,g]=(0,p.useState)(!1);(0,p.useEffect)(()=>{const e=b.current;if(!u||!e)return;let t=!1;return g(!1),(async(e,t,o)=>{const i=await be(e,t);try{const e=await i.promise,s=await e.getPage(1),a=Math.min((t.defaultView||window).devicePixelRatio||1,2),n=s.getViewport({scale:o*a/s.getViewport({scale:1}).width}),l=t.createElement("canvas");return l.width=Math.floor(n.width),l.height=Math.floor(n.height),await s.render({canvas:l,viewport:n}).promise,l}finally{i.destroy()}})(o,e.ownerDocument,600).then(o=>{t||(e.replaceChildren(o),g(!0))}).catch(()=>{}),()=>{t=!0,e.replaceChildren()}},[u,o]);const _=r||(0,c.__)("Read the flipbook","softicon-flipbook");return(0,h.createElement)("div",{className:`alfb_lb alfb_lb_${n}`+(u&&!m?" alfb_lb_draw":""),style:{"--alfb-lb-width":l+"px"}},d?(0,h.createElement)("span",{className:"alfb_lb_trigger alfb_lb_cover"},(0,h.createElement)("span",{className:"alfb_lb_img"},f?(0,h.createElement)("img",{src:f,alt:""}):(0,h.createElement)("span",{ref:b})),r&&(0,h.createElement)("span",{className:"alfb_lb_caption"},r)):(0,h.createElement)("span",{className:"alfb_lb_trigger "+("button"===a?"alfb_lb_button wp-element-button":"alfb_lb_link")},_))},_e=new URLSearchParams(window.location.search).get("alfb_start"),ke=["block","shortcode"].includes(_e)?_e:null,ve=({images:e})=>(0,h.createElement)("ol",{className:"alfbGuide"},(0,h.createElement)("li",null,e?(0,c.__)("Pick the page images, in reading order.","softicon-flipbook"):(0,c.__)("Pick your PDF: upload it, choose it from the Media Library or paste its link.","softicon-flipbook")),"shortcode"===ke?(0,h.createElement)(h.Fragment,null,(0,h.createElement)("li",null,(0,c.__)("Give the flipbook a title, change its look in the sidebar if you like, then click Publish.","softicon-flipbook")),(0,h.createElement)("li",null,(0,c.__)("Copy its shortcode from the sidebar's Block tab and paste it in your page: the Classic Editor, an Elementor Shortcode widget or any page builder.","softicon-flipbook"))):(0,h.createElement)(h.Fragment,null,(0,h.createElement)("li",null,(0,c.__)("Change its look in the sidebar on the right: Classic or Hardcover, on the page or in a popup.","softicon-flipbook")),(0,h.createElement)("li",null,(0,c.__)("Click Publish: the flipbook shows on the page.","softicon-flipbook"))));let we=!1;(0,i.registerBlockType)(r,{icon:L,edit:e=>{const{attributes:t,setAttributes:o}=e,{source:i,pdfId:a,pdfUrl:n,images:r,displayMode:m}=t,g="lightbox"===m,_=(0,p.useRef)(),k=(0,p.useRef)(),v=function(){const e=["softicon-flipbook-style-css","softicon-flipbook-editor-style-css"].join(" ");return(0,p.useEffect)(()=>{const t=e.split(" "),o=[...document.querySelectorAll('iframe[name="editor-canvas"]')],i=()=>o.forEach(e=>b(t,e.contentDocument));return i(),o.forEach(e=>e.addEventListener("load",i)),()=>o.forEach(e=>e.removeEventListener("load",i))},[e]),(0,u.useRefEffect)(t=>{b(e.split(" "),t.ownerDocument)},[e])}(),w=e=>o({pdfId:e.id||0,pdfUrl:e.url||e.source_url||""}),y=e=>o({pdfId:0,pdfUrl:e}),E=e=>o({images:e.map($)}),x=(e=>"images"===e.source?!!e.images?.length:!!e.pdfUrl)(t);(0,p.useEffect)(()=>{ke&&x&&!we&&(we=!0,(0,s.dispatch)("core/notices").createInfoNotice("shortcode"===ke?(0,c.__)("Your flipbook is ready. Give it a title and click Publish, then copy its shortcode from the sidebar's Block tab.","softicon-flipbook"):(0,c.__)("Your flipbook is ready. Change its look in the sidebar on the right, then click Publish.","softicon-flipbook"),{id:"alfb-guide"}))},[x]);const C=(e=>{const{source:t,pdfUrl:o,images:i,pageMode:s,bookStyle:a,sideArrows:n,showCover:l,startPage:r,startWith:h,bookTitle:c,theme:p,autoplay:d,autoplaySeconds:f,autoplayLoop:u,rtl:b,phoneFullscreen:m,maxHeight:g,maxHeightTablet:_,maxHeightPhone:k,showDownload:v,showPrint:w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:P,showShare:T,flipSound:L}=e;return{source:"images"===t?"images":"pdf",pdf:"images"===t?"":o,images:"images"===t?i:[],pageMode:["auto","double","single"].includes(s)?s:"auto",bookStyle:"hardcover"===a?"hardcover":"flat",sideArrows:!!n,showCover:l,startPage:Math.max(1,parseInt(r,10)||1),title:(c||"").trim(),startWith:["thumbnails","contents"].includes(h)?h:"book",theme:["dark","auto"].includes(p)?p:"light",autoplay:!!d,autoplaySeconds:Math.min(60,Math.max(2,parseInt(f,10)||4)),autoplayLoop:!1!==u,rtl:!!b,phoneFullscreen:!!m,maxHeight:Math.min(2e3,Math.max(200,parseInt(g,10)||700)),maxHeightTablet:parseInt(_,10)>0?Math.min(2e3,Math.max(200,parseInt(_,10))):0,maxHeightPhone:parseInt(k,10)>0?Math.min(2e3,Math.max(200,parseInt(k,10))):0,showDownload:v,showPrint:!!w,showFullscreen:y,showZoom:E,showThumbnails:x,showContents:C,showLinks:M,showSearch:!1!==P,showShare:!!T,flipSound:L}})(t);["showFullscreen","showZoom","showThumbnails","showContents","showLinks","showSearch","showShare","flipSound","showPrint","startWith","autoplay","autoplaySeconds","autoplayLoop","phoneFullscreen"].forEach(e=>delete C[e]);const M=(e=>{const[t,o]=(0,p.useState)(e);return(0,p.useEffect)(()=>{const t=setTimeout(()=>o(e),400);return()=>clearTimeout(t)},[e,400]),t})(JSON.stringify(C));(0,p.useEffect)(()=>{const e=_.current,t=JSON.parse(M);if(!x||g||!e||!("images"===t.source?t.images.length:t.pdf))return;const o=e.ownerDocument.createElement("div");o.className="alfb_wrapper",o.innerHTML='<div class="alfb_stage"><div class="alfb_loading"><span class="alfb_spinner"></span></div></div>',e.replaceChildren(o),k.current=o,P();const i=new me(o,t,{editor:!0});return i.init(),()=>{i.destroy(),e.replaceChildren(),k.current=null}},[M,x,g]);const P=()=>{k.current&&Object.entries((({bgColor:e,toolbarBg:t,toolbarColor:o,coverColor:i})=>({"--alfb-bg":Z(e),"--alfb-bar-bg":Z(t),"--alfb-bar-color":Z(o),"--alfb-cover":Z(i)}))(t)).forEach(([e,t])=>t?k.current.style.setProperty(e,t):k.current.style.removeProperty(e))};(0,p.useEffect)(P,[t.bgColor,t.toolbarBg,t.toolbarColor,t.coverColor]);const T=e=>(0,h.createElement)(h.Fragment,null,ke&&(0,h.createElement)(ve,{images:"pdf"===e}),(0,h.createElement)(f.Button,{variant:"link",onClick:()=>o({source:e})},"images"===e?(0,c.__)("Use images instead","softicon-flipbook"):(0,c.__)("Use a PDF instead","softicon-flipbook")),(0,h.createElement)("p",{className:"alfbPlaceholderHelp"},(0,h.createElement)(f.ExternalLink,{href:B.add},(0,c.__)("New here? Watch the 36-second tutorial","softicon-flipbook"))));return x?(0,h.createElement)(h.Fragment,null,(0,h.createElement)(J,{attributes:t,setAttributes:o,onSelectPdf:w,onSelectImages:E}),(0,h.createElement)(d.BlockControls,{group:"other"},"images"===i?(0,h.createElement)(d.MediaUploadCheck,null,(0,h.createElement)(d.MediaUpload,{allowedTypes:["image"],multiple:!0,gallery:!0,value:r.map(e=>e.id),onSelect:E,render:({open:e})=>(0,h.createElement)(f.ToolbarButton,{onClick:e},(0,c.__)("Edit pages","softicon-flipbook"))})):(0,h.createElement)(d.MediaReplaceFlow,{mediaId:a,mediaURL:n,allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:w,onSelectURL:y,name:(0,c.__)("Replace PDF","softicon-flipbook")})),(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:v})},(0,l.applyFilters)("alfb.block.preview",null,{attributes:t})||(g?(0,h.createElement)(ge,{attributes:t}):(0,h.createElement)("div",{ref:_})))):(0,h.createElement)("div",{...(0,d.useBlockProps)({ref:v})},"images"===i?(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload or pick the page images, in reading order.","softicon-flipbook")},allowedTypes:["image"],multiple:!0,gallery:!0,onSelect:E},T("pdf")):(0,h.createElement)(d.MediaPlaceholder,{icon:L,labels:{title:(0,c.__)("Flipbook","softicon-flipbook"),instructions:(0,c.__)("Upload a PDF, pick one from the Media Library or paste a link.","softicon-flipbook")},allowedTypes:["application/pdf"],accept:"application/pdf",onSelect:w,onSelectURL:y},T("images")))},save:()=>null}),(0,l.addFilter)("blockEditor.useSetting.before","softicon-flipbook/no-margin-panel",(e,t,o,i)=>(r.name!==i||"spacing.margin"!==t)&&e),n()(()=>{const e=new URL(window.location.href),t=e.searchParams.get("alfb_start"),o=window.alfbEditor?.demoPdf;if(null===t)return;if(e.searchParams.delete("alfb_start"),window.history.replaceState(window.history.state,"",e.toString()),"shortcode"===t||"block"!==t&&!o)return;let a=!1;const n=()=>{const e=(0,s.select)("core/editor"),n=e?.__unstableIsEditorReady?e.__unstableIsEditorReady():!!e?.getCurrentPostId();if(a||!n)return;a=!0;let l=0;const h=()=>{const e=(0,s.select)("core/block-editor").getBlocks();e.some(e=>r.name===e.name)||++l>6||((0,s.dispatch)("core/block-editor").insertBlocks((0,i.createBlock)(r.name,"block"===t?{}:{pdfUrl:o}),e.length),setTimeout(h,700))};setTimeout(h,400)},l=(0,s.subscribe)(()=>{n(),a&&l()});n(),a&&l()})},387(e,t,o){window.alfbBuildUrl&&(o.p=window.alfbBuildUrl)}};const t={};function o(i){const s=t[i];if(void 0!==s)return s.exports;const a=t[i]={exports:{}};return e[i](a,a.exports,o),a.exports}o.m=e,(()=>{const e=[];o.O=(t,i,s)=>{if(!i){for(var a=0;a<e.length;a++){let[i,s]=e[a],l=!0;for(var n=0;n<i.length;n++)Object.keys(o.O).every(e=>o.O[e](i[n]))?i.splice(n--,1):l=!1;if(l){e.splice(a--,1);const o=s();void 0!==o&&(t=o)}}return t}e.push([i,s])}})(),o.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var s=t[i++],a=t[i++],n=0===a?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:a};o.o(e,s)||Object.defineProperty(e,s,n)}else for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,i)=>(o.f[i](e,t),t),[])),o.u=e=>({854:"pdfjs",966:"page-flip"}[e]+".js?ver="+{854:"82bd6283",966:"dc895a04"}[e]),o.miniCssF=e=>{},o.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={},t="softicon-flipbook:";o.l=(i,s,a,n)=>{if(e[i])return void e[i].push(s);let l,r;if(void 0!==a){const e=document.getElementsByTagName("script");for(var h=0;h<e.length;h++){const o=e[h];if(o.getAttribute("src")==i||o.getAttribute("data-webpack")==t+a){l=o;break}}}l||(r=!0,l=document.createElement("script"),l.charset="utf-8",o.nc&&l.setAttribute("nonce",o.nc),l.setAttribute("data-webpack",t+a),l.src=i),e[i]=[s];const c=(t,o)=>{l.onerror=l.onload=null,clearTimeout(p);const s=e[i];if(delete e[i],l.parentNode?.removeChild(l),s?.forEach(e=>e(o)),t)return t(o)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),r&&document.head.appendChild(l)}})(),(()=>{let e;globalThis.importScripts&&(e=globalThis.location+"");const t=globalThis.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const o=t.getElementsByTagName("script");if(o.length){let t=o.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=o[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),o.p=e})(),(()=>{const e={57:0,350:0};o.f.j=(t,i)=>{let s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else if(350!=t){const a=new Promise((o,i)=>s=e[t]=[o,i]);i.push(s[2]=a);const n=new Error,l=i=>{if(o.o(e,t)&&(s=e[t],0!==s&&(e[t]=void 0),s)){const e=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;n.message="Loading chunk "+t+" failed.\n("+e+": "+o+")",n.name="ChunkLoadError",n.type=e,n.request=o,n.event=i,s[1](n)}};o.l(o.p+o.u(t),l,"chunk-"+t,t)}else e[t]=0},o.O.j=t=>0===e[t];const t=(t,i)=>{let[s,a,n]=i;var l,r,h=0;if(s.some(t=>0!==e[t])){for(l in a)o.o(a,l)&&(o.m[l]=a[l]);if(n)var c=n(o)}for(t&&t(i);h<s.length;h++)r=s[h],o.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return o.O(c)},i=globalThis.webpackChunksofticon_flipbook||=[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();let i=o.O(void 0,[350],()=>o(837));i=o.O(i)})();
  • softicon-flipbook/trunk/languages/softicon-flipbook.pot

    r3800561 r3802072  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-11-13T13:59:23+00:00\n"
     12"POT-Creation-Date: 2026-11-14T13:37:43+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    254254#: includes/shortcode.php:86
    255255#: includes/shortcode.php:91
     256#: build/dashboard.js:3
    256257#: build/index.js:2
    257258msgid "Shortcode"
    … …  
    866867
    867868#: build/dashboard.js:3
     869msgid "Block"
     870msgstr ""
     871
     872#: build/dashboard.js:3
     873msgid "Add the flipbook right inside a page or post, in the block editor."
     874msgstr ""
     875
     876#: build/dashboard.js:3
     877msgid "Open a new page"
     878msgstr ""
     879
     880#: build/dashboard.js:3
     881msgid "Make the flipbook once, then paste its shortcode in the Classic Editor, Elementor or any page builder."
     882msgstr ""
     883
     884#: build/dashboard.js:3
     885msgid "Make a flipbook"
     886msgstr ""
     887
     888#: build/dashboard.js:3
     889msgid "How do you want to add your flipbook?"
     890msgstr ""
     891
     892#: build/dashboard.js:3
     893msgid "Fits this site"
     894msgstr ""
     895
     896#: build/dashboard.js:3
     897msgid "Or start from a sample book"
     898msgstr ""
     899
     900#: build/dashboard.js:3
     901msgid "See the demos"
     902msgstr ""
     903
     904#: build/dashboard.js:3
    868905msgid "Turn any PDF into a book people enjoy reading"
    869906msgstr ""
    … …  
    871908#: build/dashboard.js:3
    872909msgid "Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor."
    873 msgstr ""
    874 
    875 #: build/dashboard.js:3
    876 msgid "See the demos"
    877910msgstr ""
    878911
    … …  
    22982331
    22992332#: build/index.js:10
     2333msgid "Pick the page images, in reading order."
     2334msgstr ""
     2335
     2336#: build/index.js:10
     2337msgid "Pick your PDF: upload it, choose it from the Media Library or paste its link."
     2338msgstr ""
     2339
     2340#: build/index.js:10
     2341msgid "Give the flipbook a title, change its look in the sidebar if you like, then click Publish."
     2342msgstr ""
     2343
     2344#: build/index.js:10
     2345msgid "Copy its shortcode from the sidebar's Block tab and paste it in your page: the Classic Editor, an Elementor Shortcode widget or any page builder."
     2346msgstr ""
     2347
     2348#: build/index.js:10
     2349msgid "Change its look in the sidebar on the right: Classic or Hardcover, on the page or in a popup."
     2350msgstr ""
     2351
     2352#: build/index.js:10
     2353msgid "Click Publish: the flipbook shows on the page."
     2354msgstr ""
     2355
     2356#: build/index.js:10
     2357msgid "Your flipbook is ready. Give it a title and click Publish, then copy its shortcode from the sidebar's Block tab."
     2358msgstr ""
     2359
     2360#: build/index.js:10
     2361msgid "Your flipbook is ready. Change its look in the sidebar on the right, then click Publish."
     2362msgstr ""
     2363
     2364#: build/index.js:10
    23002365msgid "Use images instead"
    23012366msgstr ""
  • softicon-flipbook/trunk/src/Components/Backend/Edit.js

    r3792467 r3802072  
    33import { BlockControls, MediaPlaceholder, MediaReplaceFlow, MediaUpload, MediaUploadCheck, useBlockProps } from '@wordpress/block-editor';
    44import { Button, ExternalLink, ToolbarButton } from '@wordpress/components';
     5import { dispatch } from '@wordpress/data';
    56import { applyFilters } from '@wordpress/hooks';
    67// copied from the shared softicon-tools folder by `npm run tools` (prebuild), edit it there
    … …  
    1213import { cssVars, hasContent, toConfig, toImage } from '../../utils/functions';
    1314import { videos } from '../../utils/options';
     15import guide from '../../utils/guide';
    1416
    1517// waits for the user to stop dragging a slider before the preview reloads the PDF
    … …  
    2224        return debounced;
    2325};
     26
     27// the steps for the way picked on the Welcome tab (utils/guide.js), under the PDF picker
     28const Steps = ({ images }) => <ol className='alfbGuide'>
     29        <li>{images ? __('Pick the page images, in reading order.', 'softicon-flipbook') : __('Pick your PDF: upload it, choose it from the Media Library or paste its link.', 'softicon-flipbook')}</li>
     30        {'shortcode' === guide ? <>
     31                <li>{__('Give the flipbook a title, change its look in the sidebar if you like, then click Publish.', 'softicon-flipbook')}</li>
     32                <li>{__('Copy its shortcode from the sidebar\'s Block tab and paste it in your page: the Classic Editor, an Elementor Shortcode widget or any page builder.', 'softicon-flipbook')}</li>
     33        </> : <>
     34                <li>{__('Change its look in the sidebar on the right: Classic or Hardcover, on the page or in a popup.', 'softicon-flipbook')}</li>
     35                <li>{__('Click Publish: the flipbook shows on the page.', 'softicon-flipbook')}</li>
     36        </>}
     37</ol>;
     38
     39// once the PDF is picked, the next step stays in view at the top of the editor
     40let guided = false;
    2441
    2542const Edit = (props) => {
    … …  
    3754
    3855        const ready = hasContent(attributes);
     56        useEffect(() => {
     57                if (!guide || !ready || guided) {
     58                        return;
     59                }
     60                guided = true;
     61                dispatch('core/notices').createInfoNotice('shortcode' === guide ?
     62                        __('Your flipbook is ready. Give it a title and click Publish, then copy its shortcode from the sidebar\'s Block tab.', 'softicon-flipbook') :
     63                        __('Your flipbook is ready. Change its look in the sidebar on the right, then click Publish.', 'softicon-flipbook'), { id: 'alfb-guide' });
     64        }, [ready]);
     65
    3966        // the toolbar buttons the preview leaves out (Flipbook.js, editor mode) do not reload it
    4067        const preview = toConfig(attributes);
    … …  
    77104
    78105        const switchSource = value => <>
     106                {guide && <Steps images={'pdf' === value} />}
    79107                <Button variant='link' onClick={() => setAttributes({ source: value })}>
    80108                        {'images' === value ? __('Use images instead', 'softicon-flipbook') : __('Use a PDF instead', 'softicon-flipbook')}
  • softicon-flipbook/trunk/src/dashboard/Welcome.js

    r3798489 r3802072  
    22import VideoLink from './VideoLink';
    33import GettingStarted from './GettingStarted';
     4
     5// the editor opened for the way picked, with the steps written in the Flipbook block (src/utils/guide.js)
     6const withStart = (href, mode) => {
     7        const url = new URL(href, window.location.href);
     8        url.searchParams.set('alfb_start', mode);
     9        return url.toString();
     10};
     11
     12// the first question: a block inside a page, or a flipbook with a shortcode for the Classic Editor and page builders.
     13// The one that fits the editor this site uses is marked
     14const Choice = ({ config }) => {
     15        const { start, urls } = config;
     16        const shortcodeSite = start.classic || start.elementor;
     17        const options = [
     18                {
     19                        key: 'block',
     20                        icon: 'block-default',
     21                        title: __('Block', 'softicon-flipbook'),
     22                        text: __('Add the flipbook right inside a page or post, in the block editor.', 'softicon-flipbook'),
     23                        action: __('Open a new page', 'softicon-flipbook'),
     24                        href: withStart(urls.newPage, 'block'),
     25                        fits: !shortcodeSite
     26                },
     27                {
     28                        key: 'shortcode',
     29                        icon: 'shortcode',
     30                        title: __('Shortcode', 'softicon-flipbook'),
     31                        text: __('Make the flipbook once, then paste its shortcode in the Classic Editor, Elementor or any page builder.', 'softicon-flipbook'),
     32                        action: __('Make a flipbook', 'softicon-flipbook'),
     33                        href: withStart(start.newBook, 'shortcode'),
     34                        fits: shortcodeSite
     35                }
     36        ];
     37        return <div className='alfb-choice'>
     38                <h3>{__('How do you want to add your flipbook?', 'softicon-flipbook')}</h3>
     39                <div className='alfb-choice-cards'>
     40                        {options.map(option => <a key={option.key} className={'alfb-choice-card' + (option.fits ? ' is-fit' : '')} href={option.href}>
     41                                <span className={'alfb-choice-icon dashicons dashicons-' + option.icon} aria-hidden='true' />
     42                                <strong>{option.title}{option.fits && <span className='alfb-choice-fit'>{__('Fits this site', 'softicon-flipbook')}</span>}</strong>
     43                                <span className='alfb-choice-text'>{option.text}</span>
     44                                <span className='alfb-choice-go'>{option.action} &rarr;</span>
     45                        </a>)}
     46                </div>
     47                <p className='alfb-choice-more'>
     48                        <a href={urls.newPage}>{__('Or start from a sample book', 'softicon-flipbook')}</a>
     49                        <a href='#/demos'>{__('See the demos', 'softicon-flipbook')}</a>
     50                </p>
     51        </div>;
     52};
    453
    554const Welcome = ({ config, play }) => <>
    … …  
    857                        <h2>{__('Turn any PDF into a book people enjoy reading', 'softicon-flipbook')}</h2>
    958                        <p>{__('Catalogs, magazines, menus and brochures that turn like real pages, on phones and big screens, right inside the block editor.', 'softicon-flipbook')}</p>
    10                         <p className='alfb-actions'>
    11                                 <a className='alfb-btn alfb-btn-amber' href={config.urls.newPage}>{__('Create a flipbook', 'softicon-flipbook')}</a>
    12                                 <a className='alfb-btn alfb-btn-ghost' href='#/demos'>{__('See the demos', 'softicon-flipbook')}</a>
    13                         </p>
     59                        <Choice config={config} />
    1460                </div>
    1561                <VideoLink className='alfb-hero-video' url={config.urls.playlist} title={__('Video tutorials', 'softicon-flipbook')} play={play}>
  • softicon-flipbook/trunk/src/editor.scss

    r3792467 r3802072  
    1212        margin: 12px 0 0;
    1313        font-size: 13px;
     14}
     15
     16// the steps for the way picked on the dashboard's Welcome tab (Edit.js)
     17.alfbGuide {
     18        flex-basis: 100%;
     19        margin: 4px 0 14px;
     20        padding: 12px 16px 12px 34px;
     21        border-left: 3px solid #0f766e;
     22        border-radius: 4px;
     23        background: #f0fdfa;
     24        color: #1e1e1e;
     25        font-size: 13px;
     26        line-height: 1.5;
     27
     28        li {
     29                margin: 0 0 4px;
     30        }
     31
     32        li:last-child {
     33                margin-bottom: 0;
     34        }
    1435}
    1536
  • softicon-flipbook/trunk/src/index.js

    r3787276 r3802072  
    2222));
    2323
    24 // "Create a flipbook" on the dashboard opens a new page with ?alfb_start=1: once the editor is ready the page gets a
    25 // flipbook of the demo PDF, selected, so the first book is there at once and only needs the person's own PDF
     24// the dashboard opens a new page with ?alfb_start=…: once the editor is ready the page gets a flipbook, selected.
     25// 1 ("Start from a sample book"): one of the demo PDF, only needing the person's own; block (the Welcome tab's "Block"):
     26// an empty one, which asks for the PDF; shortcode: a flipbook under All Flipbooks, whose block is already there
    2627domReady(() => {
    2728        const url = new URL(window.location.href);
     29        const mode = url.searchParams.get('alfb_start');
    2830        const pdfUrl = window.alfbEditor?.demoPdf;
    29         if (!url.searchParams.has('alfb_start') || !pdfUrl) {
     31        if (null === mode) {
    3032                return;
    3133        }
    3234        url.searchParams.delete('alfb_start');
    3335        window.history.replaceState(window.history.state, '', url.toString());
     36        if ('shortcode' === mode || ('block' !== mode && !pdfUrl)) {
     37                return;
     38        }
    3439        // the editor is often ready before this runs, and then nothing in the stores changes: check now, else wait
    3540        let done = false;
    … …  
    4954                                return;
    5055                        }
    51                         dispatch('core/block-editor').insertBlocks(createBlock(metadata.name, { pdfUrl }), blocks.length);
     56                        dispatch('core/block-editor').insertBlocks(createBlock(metadata.name, 'block' === mode ? {} : { pdfUrl }), blocks.length);
    5257                        setTimeout(add, 700);
    5358                };
  • softicon-flipbook/trunk/vendor/fs-lite/fs-lite.php

    r3793513 r3802072  
    407407        $data = $this->data();
    408408
    409         // once after activation on the Plugins screen, the dashboard where the opt-in is; only for the person who
    410         // activated it, within a minute, and not after a bulk, network, AJAX or WP-CLI activation
     409        // once after activation on the Plugins screen: the opt-in if it is not answered yet, else the dashboard's Welcome;
     410        // only for the person who activated it, within a minute, and not after a bulk, network, AJAX or WP-CLI activation
    411411        global $pagenow;
    412412        $redirect = 'alfb_fs_redirect_' . $this->slug;
    … …  
    414414        if ( 'plugins.php' === $pagenow && get_current_user_id() && (int) get_transient( $redirect ) === get_current_user_id() ) {
    415415            delete_transient( $redirect );
    416             if ( '' === $data['state'] && current_user_can( 'manage_options' ) && ! isset( $_GET['activate-multi'] ) && ! wp_doing_ajax() && ! is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- only reads where WordPress came from
    417                 wp_safe_redirect( $this->optin_url() );
     416            if ( current_user_can( 'manage_options' ) && ! isset( $_GET['activate-multi'] ) && ! wp_doing_ajax() && ! is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- only reads where WordPress came from
     417                wp_safe_redirect( '' === $data['state'] ? $this->optin_url() : $this->page_url() );
    418418                exit;
    419419            }
    … …  
    440440        // an old answer from an earlier deactivation is not sent later
    441441        $data = $this->save( array( 'reason' => null ) );
    442         if ( '' === $data['state'] && get_current_user_id() && ! wp_doing_ajax() && ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
     442        if ( get_current_user_id() && ! wp_doing_ajax() && ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
    443443            set_transient( 'alfb_fs_redirect_' . $this->slug, get_current_user_id(), MINUTE_IN_SECONDS );
    444444        }
Note: See TracChangeset for help on using the changeset viewer.