← Back
Editing: layout.js
(()=>{"use strict";const e={d:(r,o)=>{if(Array.isArray(o))for(var a=0;a<o.length;){var t=o[a++],n=o[a++];e.o(r,t)?0===n&&a++:0===n?Object.defineProperty(r,t,{enumerable:!0,value:o[a++]}):Object.defineProperty(r,t,{enumerable:!0,get:n})}else for(var t in o)e.o(o,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:o[t]})},o:(e,r)=>Object.hasOwn(e,r),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let r={};function o(e){var r,a,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(a=o(e[r]))&&(t&&(t+=" "),t+=a)}else for(a in e)e[a]&&(t&&(t+=" "),t+=a);return t}e.r(r),e.d(r,{AppContent:()=>U,AppHeader:()=>E,AppLayout:()=>l,HeaderActionsFill:()=>j,HeaderActionsSlot:()=>y,HeaderEndFill:()=>b,HeaderEndSlot:()=>x,HeaderStartFill:()=>f,HeaderStartSlot:()=>C,LAYOUT_VARS_FILTER:()=>T,LAYOUT_VARS_PHP_FILTER:()=>H,SupportMenuFill:()=>A,SupportMenuSlot:()=>V,getLocalizedLayoutVars:()=>z,getNavTabs:()=>I,getShowSupportMenu:()=>G,getSupportMenuItems:()=>B,mapLayoutSupportMenuItems:()=>Z,mapNavTabsForHeader:()=>R,navigateNavTab:()=>O,resolveLayoutVars:()=>N,resolveSupportMenuIcon:()=>L,useAppNavHeader:()=>Y,useLayoutVars:()=>D});const a=function(){for(var e,r,a=0,t="",n=arguments.length;a<n;a++)(e=arguments[a])&&(r=o(e))&&(t&&(t+=" "),t+=r);return t},t=window.wp.components,n=window.ReactJSXRuntime,l=({className:e,children:r})=>(0,n.jsx)(t.SlotFillProvider,{children:(0,n.jsx)("div",{className:a("popup-maker-app-layout",e),children:r})}),s=window.wp.element,p=window.popupMaker.i18n;(0,s.forwardRef)(({icon:e,size:r=24,...o},a)=>(0,s.cloneElement)(e,{width:r,height:r,...o,ref:a}));const i=window.wp.primitives;var u=(0,n.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)(i.Path,{d:"M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z"})}),c=(0,n.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)(i.Path,{clipRule:"evenodd",fillRule:"evenodd",d:"M17.375 15.656A6.47 6.47 0 0018.5 12a6.47 6.47 0 00-.943-3.374l-1.262.813c.448.749.705 1.625.705 2.561a4.977 4.977 0 01-.887 2.844l1.262.813zm-1.951 1.87l-.813-1.261A4.976 4.976 0 0112 17c-.958 0-1.852-.27-2.613-.736l-.812 1.261A6.47 6.47 0 0012 18.5a6.47 6.47 0 003.424-.974zm-8.8-1.87A6.47 6.47 0 015.5 12c0-1.235.344-2.39.943-3.373l1.261.812A4.977 4.977 0 007 12c0 1.056.328 2.036.887 2.843l-1.262.813zm2.581-7.803A4.977 4.977 0 0112 7c1.035 0 1.996.314 2.794.853l.812-1.262A6.47 6.47 0 0012 5.5a6.47 6.47 0 00-3.607 1.092l.812 1.261zM12 20a8 8 0 100-16 8 8 0 000 16zm0-4.5a3.5 3.5 0 100-7 3.5 3.5 0 000 7z"})}),d=(0,n.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)(i.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"})}),h=(0,n.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,n.jsx)(i.Path,{d:"M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"}),(0,n.jsx)(i.Path,{d:"M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"}),(0,n.jsx)(i.Path,{d:"M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"})]}),m=(0,n.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)(i.Path,{fillRule:"evenodd",d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"})}),w=(0,n.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)(i.Path,{d:"M 22 12 C 22 6.49 17.51 2 12 2 C 6.48 2 2 6.49 2 12 C 2 17.52 6.48 22 12 22 C 17.51 22 22 17.52 22 12 M 9.78 17.37 L 6.37 8.22 C 6.92 8.2 7.54 8.14 7.54 8.14 C 8.04 8.08 7.98 7.01 7.48 7.03 C 7.48 7.03 6.03 7.14 5.11 7.14 C 4.93 7.14 4.74 7.14 4.53 7.13 C 6.12 4.69 8.87 3.11 12 3.11 C 14.33 3.11 16.45 3.98 18.05 5.45 C 17.37 5.34 16.4 5.84 16.4 7.03 C 16.4 7.77 16.85 8.39 17.3 9.13 C 17.65 9.74 17.85 10.49 17.85 11.59 C 17.85 13.08 16.45 16.59 16.45 16.59 L 13.42 8.22 C 13.96 8.2 14.24 8.05 14.24 8.05 C 14.74 8 14.68 6.8 14.18 6.83 C 14.18 6.83 12.74 6.95 11.8 6.95 C 10.93 6.95 9.47 6.83 9.47 6.83 C 8.97 6.8 8.91 8.03 9.41 8.05 L 10.33 8.13 L 11.59 11.54 L 9.78 17.37 M 19.41 12 C 19.65 11.36 20.15 10.13 19.84 7.75 C 20.54 9.04 20.89 10.46 20.89 12 C 20.89 15.29 19.16 18.24 16.49 19.78 C 17.46 17.19 18.43 14.58 19.41 12 M 8.1 20.09 C 5.12 18.65 3.11 15.53 3.11 12 C 3.11 10.7 3.34 9.52 3.83 8.41 C 5.25 12.3 6.67 16.2 8.1 20.09 M 12.13 13.46 L 14.71 20.44 C 13.85 20.73 12.95 20.89 12 20.89 C 11.21 20.89 10.43 20.78 9.71 20.56 C 10.52 18.18 11.33 15.82 12.13 13.46 L 12.13 13.46"})});const v=window.popupMaker.components,g=(0,t.createSlotFill)("PopupMakerLayoutHeaderStart"),f=g.Fill,C=g.Slot,M=(0,t.createSlotFill)("PopupMakerLayoutHeaderEnd"),b=M.Fill,x=M.Slot,S=(0,t.createSlotFill)("PopupMakerLayoutHeaderActions"),j=S.Fill,y=S.Slot,k=(0,t.createSlotFill)("PopupMakerLayoutSupportMenu"),A=k.Fill,V=k.Slot,P=window.wp.hooks,_={pages:h,people:m,login:d,lifesaver:c,help:u,wordpress:w},L=e=>{if(e)return _[e]},T="popupMaker.layout.vars",H="popup_maker/layout_vars",F={navTabs:[],supportMenuItems:[],showSupport:!0},z=()=>{if("undefined"==typeof window)return{...F};const e=window.popupMaker?.globalVars?.layoutVars;return e&&"object"==typeof e?{navTabs:Array.isArray(e.navTabs)?e.navTabs:Array.isArray(e.shellTabs)?e.shellTabs:[],supportMenuItems:Array.isArray(e.supportMenuItems)?e.supportMenuItems:[],showSupport:e.showSupport??!0}:{...F}},N=()=>{const e=z();return(0,P.applyFilters)(T,e)},I=()=>N().navTabs??[],R=()=>I().map(e=>({name:e.id,title:e.title,className:e.id,pageTitle:e.title,heading:e.title,href:e.href})),O=e=>{const r=I().find(r=>r.id===e);r?.href&&window.location.assign(r.href)},Z=(e=[])=>e.filter(e=>e?.label).map(e=>({label:e.label,href:e.href,target:e.target,group:e.group||"primary",icon:L(e.icon)})),B=()=>Z(N().supportMenuItems??[]),G=()=>N().showSupport??!0,E=({title:e=(0,p.__)("Popup Maker","popup-maker"),brandingUrl:r="https://wppopupmaker.com?utm_campaign=plugin-info&utm_source=plugin-admin-header&utm_medium=plugin-ui&utm_content=header-logo",tabs:o=[],currentTab:a,onTabChange:l,navTabId:i,supportMenuItems:u=[],showSupport:d=!0})=>{const h=(0,s.useRef)(null),{assetsUrl:m}=window.popupMaker.globalVars,w=I().length>0,g=w?R():o,f=w&&i?i:a,M=(0,s.useMemo)(()=>B(),[]),b=d&&G(),S=[...M,...u].reduce((e,r)=>{const o=r.group||"primary";return e[o]||(e[o]=[]),e[o].push(r),e},{});return(0,n.jsxs)("div",{className:"popup-maker-app-header",children:[(0,n.jsx)(C,{}),(0,n.jsx)("h1",{className:"branding wp-heading-inline",children:(0,n.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:[(0,n.jsx)("img",{src:`${m}images/mark.svg`,alt:""}),e]})}),g.length>0&&(0,n.jsx)(v.ControlledTabPanel,{className:"tabs",orientation:"horizontal",selected:f||null,onSelect:e=>{const r=g.find(r=>r.name===e);r?.onClick&&!1===r.onClick()||(r?.href?window.location.assign(r.href):l?.(e))},tabs:g}),(0,n.jsxs)("div",{className:"popup-maker-app-header__actions",children:[(0,n.jsx)(y,{}),b&&(0,n.jsx)(t.DropdownMenu,{label:(0,p.__)("Support","popup-maker"),icon:c,toggleProps:{as:({onClick:e})=>(0,n.jsx)(t.Button,{icon:c,variant:"link",onClick:e,className:"components-tab-panel__tabs-item support-link",children:(0,n.jsx)("span",{ref:h,children:(0,p.__)("Support","popup-maker")})})},popoverProps:{noArrow:!1,position:"bottom left",className:"popup-maker-support-menu",anchor:{getBoundingClientRect:()=>h?.current?.getBoundingClientRect()}},children:({onClose:e})=>(0,n.jsxs)(n.Fragment,{children:[Object.entries(S).map(([r,o])=>(0,n.jsx)(t.MenuGroup,{children:o.map(r=>(0,n.jsx)(t.MenuItem,{icon:r.icon,href:r.href,target:r.target,onClick:()=>{r.onClick&&r.onClick(),r.href||e()},children:r.label},r.label))},r)),(0,n.jsx)(V,{fillProps:{onClose:e}})]})})]}),(0,n.jsx)(x,{})]})},U=({className:e,children:r})=>(0,n.jsx)("div",{className:a("popup-maker-app-content",e),children:r}),Y=e=>{const r=(0,s.useMemo)(()=>I(),[]).length>0;return{tabs:(0,s.useMemo)(()=>R(),[]),currentTab:e,onTabChange:(0,s.useCallback)(e=>{O(e)},[]),usesLayoutNav:r}},D=()=>(0,s.useMemo)(()=>N(),[]);(window.popupMaker=window.popupMaker||{}).layout=r})();
Save File
Cancel