@tryghost/admin-toolbar 0.1.269 → 0.1.271
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/umd/admin-toolbar.min.js +1 -1
package/package.json
CHANGED
package/umd/admin-toolbar.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return x(t,s,i,a,null)}function x(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t}function w(e,t){if(t==null)return e.__?w(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?w(e):null}function T(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=v({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),P(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??w(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,ne(i,o,a),n.__e=n.__=null,o.__e!=r&&E(o)}}function E(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),E(e)}function D(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!O.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(O)}function O(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,T(e)}finally{r.length=O.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,g,_,v,y,b=r&&r.__k||h,x=t.length;for(c=k(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||m,p.__i=d,v=P(e,p,f,i,a,o,s,c,l,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&I(f.ref,null,p),u.push(p.ref,p.__c||g,p)),_==null&&g!=null&&(_=g),(y=!!(4&p.__u))||f.__k===p.__k?(c=A(p,c,e,y),y&&f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),p.__u&=-7);return n.__e=_,c}function k(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=x(null,o,null,null,null):_(o)?o=e.__k[a]=x(S,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=j(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=w(s)),ae(s,s));return r}function A(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=A(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=w(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function j(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function M(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||g.test(t)?n:n+`px`}function N(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||M(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||M(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function te(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function P(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,x,w,T,E,D,O,k,A,j,M=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof M==`function`)try{if(w=n.props,T=M.prototype&&M.prototype.render,E=(d=M.contextType)&&i[d.__c],D=d?E?E.props.value:d.__:i,r.__c?x=(f=n.__c=r.__c).__=f.__E:(T?n.__c=f=new M(w,D):(n.__c=f=new C(w,D),f.constructor=M,f.render=oe),E&&E.sub(f),f.state||={},f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),T&&f.__s==null&&(f.__s=f.state),T&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=v({},f.__s)),v(f.__s,M.getDerivedStateFromProps(w,f.__s))),m=f.props,g=f.state,f.__v=n,p)T&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),T&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(T&&M.getDerivedStateFromProps==null&&w!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(w,D),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(w,f.__s,D)){n.__v!=r.__v&&(f.props=w,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),h.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(w,f.__s,D),T&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,g,b)})}if(f.context=D,f.props=w,f.__P=e,f.__e=!1,O=t.__r,k=0,T)f.state=f.__s,f.__d=!1,O&&O(n),d=f.render(f.props,f.state,f.context),h.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,O&&O(n),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++k<25);f.state=f.__s,f.getChildContext!=null&&(i=v(v({},i),f.getChildContext())),T&&!p&&f.getSnapshotBeforeUpdate!=null&&(b=f.getSnapshotBeforeUpdate(m,g)),A=d!=null&&d.type===S&&d.key==null?re(d.props.children):d,c=ee(e,_(A)?A:[A],n,r,i,a,o,s,c,l,u),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),x&&(f.__E=f.__=null)}catch(e){if(n.__v=null,l||o!=null)if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,n.__e=c}else{for(j=o.length;j--;)y(o[j]);F(n)}else n.__e=r.__e,n.__k=r.__k,e.then||F(n);t.__e(e,n,r)}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=ie(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function F(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(F))}function ne(e,n,r){for(var i=0;i<r.length;i++)I(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function re(e){return typeof e!=`object`||!e||e.__b>0?e:_(e)?e.map(re):e.constructor===void 0?v({},e):null}function ie(n,r,i,a,o,s,c,l,u){var d,f,p,h,g,v,b,x=i.props||m,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||N(n,d,null,g,o);for(d in S)g=S[d],d==`children`?h=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?v=g:d==`checked`?b=g:l&&typeof g!=`function`||x[d]===g||N(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),ee(r.type==`template`?n.content:n,_(h)?h:[h],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&w(i,0),l,u),s!=null)for(d=s.length;d--;)y(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&v==null?n.removeAttribute(`value`):v!=null&&(v!==n[d]||C==`progress`&&!v||C==`option`&&v!=x[d])&&N(n,d,v,x[d],o),d=`checked`,b!=null&&b!=n[d]&&N(n,d,b,x[d],o))}return n}function I(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function ae(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||I(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ae(i[a],n,r||typeof e.type!=`function`);r||y(e.__e),e.__c=e.__=e.__e=void 0}function oe(e,t,n){return this.constructor(e,n)}function se(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],P(r,n=(!a&&i||r).__k=b(S,null,[n]),o||m,m,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),ne(s,n,c)}e=h.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,C.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=v({},this.state);typeof e==`function`&&(e=e(v({},n),this.props)),e&&v(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),D(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),D(this))},C.prototype.render=S,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=te(!1),p=te(!0);var ce=`ghost-admin-toolbar-root`,le=2e3,ue=`ghost-admin-toolbar-display`,L=`minimized`,R=`expanded`;function de(e){let t=document.createElement(`iframe`);return t.dataset.frame=`admin-auth`,t.src=`${e}auth-frame/`,t.title=`Ghost admin authentication`,t.tabIndex=-1,t.style.cssText=`display:none;width:0;height:0;border:0;`,document.body.appendChild(t),t}function fe(e,t){let n=0,r={},i=new URL(e).origin;window.addEventListener(`message`,function(e){if(e.origin!==i)return;let t;try{t=JSON.parse(e.data)}catch{return}let n=r[t.uid];n&&(delete r[t.uid],n(t.error,t.result))});function a(e,a){return new Promise((o,s)=>{n+=1;let c=n,l=window.setTimeout(()=>{delete r[c],s(Error(`Admin authentication timed out`))},le);r[c]=(e,t)=>{window.clearTimeout(l),e?s(Error(e)):o(t)},t.contentWindow?.postMessage(JSON.stringify({uid:c,action:e,...a}),i)})}return{getUser:async()=>(await a(`getUser`))?.users?.[0]||null}}function pe(e){let t=new Set([`owner`,`administrator`,`editor`]);return(e?.roles||[]).some(e=>t.has((e?.name||``).toLowerCase()))}function me(){return document.currentScript||document.querySelector(`script[data-ghost-admin-toolbar]`)}function he(e){return e?e.endsWith(`/`)?e:`${e}/`:null}function ge(e){let t=e?.dataset||{},n=he(t.ghostAdminToolbar);return n?{adminUrl:n,siteTitle:t.siteTitle||`Ghost`,pageContext:t.pageContext||``,resourceType:t.resourceType||``,resourceId:t.resourceId||``,resourceSlug:t.resourceSlug||``,siteAnalyticsEnabled:t.siteAnalyticsEnabled===`true`,activityPubEnabled:t.activitypubEnabled===`true`,membersEnabled:t.membersEnabled===`true`,commentsEnabled:t.commentsEnabled!==`false`}:null}var z,B,V,H,U=0,_e=[],W=t,ve=W.__b,ye=W.__r,be=W.diffed,xe=W.__c,Se=W.unmount,Ce=W.__;function G(e,t){W.__h&&W.__h(B,e,U||t),U=0;var n=B.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return U=1,we(Me,e)}function we(e,t,n){var r=G(z++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Me(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=B,!B.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};B.__f=!0;var a=B.shouldComponentUpdate,o=B.componentWillUpdate;B.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},B.shouldComponentUpdate=i}return r.__N||r.__}function Te(e,t){var n=G(z++,3);!W.__s&&Y(n.__H,t)&&(n.__=e,n.u=t,B.__H.__h.push(n))}function Ee(e,t){var n=G(z++,4);!W.__s&&Y(n.__H,t)&&(n.__=e,n.u=t,B.__h.push(n))}function De(e){return U=5,Oe(function(){return{current:e}},[])}function Oe(e,t){var n=G(z++,7);return Y(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ke(){for(var e;e=_e.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(q),t.__h.some(J),t.__h=[]}catch(n){t.__h=[],W.__e(n,e.__v)}}}W.__b=function(e){B=null,ve&&ve(e)},W.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ce&&Ce(e,t)},W.__r=function(e){ye&&ye(e),z=0;var t=(B=e.__c).__H;t&&(V===B?(t.__h=[],B.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(q),t.__h.some(J),t.__h=[],z=0)),V=B},W.diffed=function(e){be&&be(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(_e.push(t)!==1&&H===W.requestAnimationFrame||((H=W.requestAnimationFrame)||je)(ke)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),V=B=null},W.__c=function(e,t){t.some(function(e){try{e.__h.some(q),e.__h=e.__h.filter(function(e){return!e.__||J(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],W.__e(n,e.__v)}}),xe&&xe(e,t)},W.unmount=function(e){Se&&Se(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{q(e)}catch(e){t=e}}),n.__H=void 0,t&&W.__e(t,n.__v))};var Ae=typeof requestAnimationFrame==`function`;function je(e){var t,n=function(){clearTimeout(r),Ae&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ae&&(t=requestAnimationFrame(n))}function q(e){var t=B,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),B=t}function J(e){var t=B;e.__c=e.__(),B=t}function Y(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Me(e,t){return typeof t==`function`?t(e):t}function X(e,t){return`${e}#/${t.replace(/^\/+/,``)}`}function Ne(e,t){return X(e,`comments?filter=${encodeURIComponent(`post_id:${t}`)}`)}function Pe(){let e=new URL(window.location.href);return e.searchParams.set(`admin`,`0`),`${e.pathname}${e.search}${e.hash}`}function Fe(e){return e.pageContext===`home`?Ie(e):e.resourceType===`post`&&e.resourceId?Le(e):e.resourceType===`tag`&&e.resourceSlug?[{href:X(e.adminUrl,`tags/${encodeURIComponent(e.resourceSlug)}`),icon:`edit`,label:`Edit`}]:e.resourceType&&e.resourceId?[{href:X(e.adminUrl,`editor/${e.resourceType}/${e.resourceId}`),icon:`edit`,label:`Edit`}]:[]}function Ie(e){let t=[];return e.siteAnalyticsEnabled&&t.push({href:X(e.adminUrl,`analytics`),icon:`siteAnalytics`,label:`Analytics`}),e.activityPubEnabled&&t.push({href:X(e.adminUrl,`activitypub`),icon:`network`,label:`Network`}),t.push({href:X(e.adminUrl,`posts/`),icon:`posts`,label:`Posts`}),e.membersEnabled&&t.push({href:X(e.adminUrl,`members`),icon:`members`,label:`Members`}),t.push({href:X(e.adminUrl,`settings`),icon:`settings`,label:`Settings`}),t}function Le(e){let t=[{href:X(e.adminUrl,`posts/analytics/${e.resourceId}`),icon:`analytics`,label:`Analytics`},{href:X(e.adminUrl,`editor/${e.resourceType}/${e.resourceId}`),icon:`edit`,label:`Edit`}];return e.commentsEnabled&&t.push({href:Ne(e.adminUrl,e.resourceId),icon:`comments`,label:`Comments`}),t}var Re={analytics:[b(`path`,{d:`M4 19V5`}),b(`path`,{d:`M4 19h16`}),b(`path`,{d:`M8 16v-5`}),b(`path`,{d:`M12 16V8`}),b(`path`,{d:`M16 16v-3`})],comments:[b(`path`,{d:`M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4Z`})],edit:[b(`path`,{d:`M12 20h9`}),b(`path`,{d:`M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z`})],members:[b(`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`}),b(`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`}),b(`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`}),b(`circle`,{cx:`9`,cy:`7`,r:`4`})],network:[b(`circle`,{cx:`5`,cy:`19`,r:`2`}),b(`circle`,{cx:`19`,cy:`5`,r:`2`}),b(`circle`,{cx:`12`,cy:`12`,r:`4`}),b(`path`,{d:`M8.8 21.5a10 10 0 0 0 12.7-12.7`}),b(`path`,{d:`M2.5 15.2A10 10 0 0 1 15.2 2.5`})],posts:[b(`path`,{d:`M13 21h8`}),b(`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`})],siteAnalytics:[b(`path`,{d:`M16 7h6v6`}),b(`path`,{d:`m22 7-8.5 8.5-5-5L2 17`})],settings:[b(`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}),b(`circle`,{cx:`12`,cy:`12`,r:`3`})],more:[b(`circle`,{cx:`12`,cy:`5`,r:`1`}),b(`circle`,{cx:`12`,cy:`12`,r:`1`}),b(`circle`,{cx:`12`,cy:`19`,r:`1`})],moreHorizontal:[b(`circle`,{cx:`5`,cy:`12`,r:`1`}),b(`circle`,{cx:`12`,cy:`12`,r:`1`}),b(`circle`,{cx:`19`,cy:`12`,r:`1`})]};function Z({name:e}){return b(`svg`,{"aria-hidden":`true`,className:`gh-admin-toolbar-icon gh-admin-toolbar-icon-${e}`,fill:`none`,height:`20`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,viewBox:`0 0 24 24`,width:`20`},Re[e])}function ze(){try{return window.localStorage?.getItem(`ghost-admin-toolbar-display`)===`minimized`?L:R}catch{return R}}function Be(e){try{window.localStorage?.setItem(ue,e)}catch{}}function Ve(e){return e?.name||e?.email||`Staff`}function He(e){return e?.profile_image||``}function Q({children:e}){return b(`span`,{className:`gh-admin-toolbar-sr-only`},e)}function $({children:e,label:t}){return b(`span`,{className:`gh-admin-toolbar-tooltip-wrap`},[e,b(`span`,{className:`gh-admin-toolbar-tooltip`,role:`tooltip`},t)])}function Ue({href:e,icon:t,label:n}){let r=b(`a`,{className:`gh-admin-toolbar-link`,href:e,"aria-label":n},[b(Z,{name:t}),b(Q,null,n)]);return b($,{label:n},r)}function We({isMinimized:e,isOpen:t,onMaximize:n,onMinimize:r,setIsOpen:i}){let a=`More`,o=b(`button`,{type:`button`,className:`gh-admin-toolbar-button`,"aria-expanded":t?`true`:`false`,"aria-haspopup":`menu`,"aria-label":a,onClick:()=>{i(!t)},onKeyDown:e=>{e.key===`Escape`&&i(!1)}},[b(Z,{name:`more`}),b(Q,null,a)]);return b(`div`,{className:`gh-admin-toolbar-menu-wrap`,onFocusOut:e=>{e.currentTarget.contains(e.relatedTarget)||i(!1)}},[b($,{label:a},o),t?b(`div`,{className:`gh-admin-toolbar-menu`},[b(`button`,{type:`button`,className:`gh-admin-toolbar-menu-item`,onClick:e?n:r},e?`Maximize`:`Minimize`),b(`a`,{className:`gh-admin-toolbar-menu-item`,href:Pe()},`Hide toolbar`)]):null])}function Ge({adminUrl:e,siteTitle:t,user:n}){let r=Ve(n),i=He(n);return b($,{label:`Admin`},b(`a`,{className:`gh-admin-toolbar-user`,href:X(e,``),"aria-label":`Open Ghost Admin for ${r} on ${t}`},[b(`span`,{className:`gh-admin-toolbar-avatar`,"aria-hidden":`true`},[b(`span`,{className:`gh-admin-toolbar-avatar-fallback`},r.slice(0,1).toUpperCase()),i?b(`img`,{alt:``,className:`gh-admin-toolbar-avatar-image`,loading:`lazy`,onError:e=>{e.currentTarget.remove()},referrerPolicy:`no-referrer`,src:i}):null]),b(Q,null,`Admin`)]))}function Ke({config:e,user:t}){let[n,r]=K(!1),[i,a]=K(()=>ze()===L),[o,s]=K(!1),[c,l]=K(null),u=De(null),d=De(null),f=Fe(e);function p(){s(!0)}function m(){n||(r(!1),s(!1))}return Ee(()=>{if(!u.current||!d.current)return;if(i){l({height:Math.max(d.current.scrollHeight+12,44),width:d.current.scrollWidth+8});return}let e=u.current.getBoundingClientRect();l({height:e.height,width:e.width})},[i,f.length]),Te(()=>{let e=document.getElementById(ce);if(e)return e.classList.toggle(`gh-admin-toolbar-menu-open`,n),e.classList.toggle(`gh-admin-toolbar-is-minimized`,i&&!o),()=>{e.classList.remove(`gh-admin-toolbar-menu-open`),e.classList.remove(`gh-admin-toolbar-is-minimized`)}},[n,i,o]),b(`nav`,{className:`gh-admin-toolbar${i?` gh-admin-toolbar-minimized-mode`:``}${o?` gh-admin-toolbar-minimized-expanded`:``}`,onFocusOut:e=>{i&&!e.currentTarget.contains(e.relatedTarget)&&m()},onMouseLeave:()=>{m()},onMouseEnter:()=>{i&&p()},onMouseOver:()=>{i&&p()},onPointerEnter:()=>{i&&p()},ref:u,role:`navigation`,style:i?{"--gh-admin-toolbar-expanded-height":`${c?.height||44}px`,"--gh-admin-toolbar-expanded-width":`${c?.width||178}px`}:null,"aria-label":`Ghost admin toolbar`},[b(`button`,{type:`button`,className:`gh-admin-toolbar-minimized-pill`,"aria-label":`Show admin toolbar`,onClick:p},[b(Z,{name:`moreHorizontal`}),b(Q,null,`Show admin toolbar`)]),b(`div`,{className:`gh-admin-toolbar-section`,ref:d},[b(Ge,{adminUrl:e.adminUrl,siteTitle:e.siteTitle,user:t}),...f.map(e=>b(Ue,e)),b(We,{isMinimized:i,isOpen:n,onMaximize:()=>{Be(R),r(!1),a(!1),s(!1)},onMinimize:()=>{Be(L),r(!1),a(!0),s(!1)},setIsOpen:r})])])}function qe(){return`
|
|
1
|
+
(function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return x(t,s,i,a,null)}function x(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t}function w(e,t){if(t==null)return e.__?w(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?w(e):null}function T(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=v({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),F(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??w(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,ne(i,o,a),n.__e=n.__=null,o.__e!=r&&E(o)}}function E(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),E(e)}function D(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!O.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(O)}function O(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,T(e)}finally{r.length=O.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,g,_,v,y=r&&r.__k||h,b=t.length;for(c=k(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&y[p.__i]||m,p.__i=d,v=F(e,p,f,i,a,o,s,c,l,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&I(f.ref,null,p),u.push(p.ref,p.__c||g,p)),_==null&&g!=null&&(_=g),4&p.__u?(c=A(p,c,e),f.__e&&=null):typeof p.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),p.__u&=-7);return n.__e=_,c}function k(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=x(null,o,null,null,null):_(o)?o=e.__k[a]=x(S,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=j(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=w(s)),ae(s,s));return r}function A(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=A(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=w(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function j(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function M(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||g.test(t)?n:n+`px`}function N(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||M(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||M(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function P(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function F(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,x,T,E,D,O,k,A,j,M,N,P=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof P==`function`){f=s.length;try{if(E=n.props,D=P.prototype&&P.prototype.render,O=(d=P.contextType)&&i[d.__c],k=d?O?O.props.value:d.__:i,r.__c?T=(p=n.__c=r.__c).__=p.__E:(D?n.__c=p=new P(E,k):(n.__c=p=new C(E,k),p.constructor=P,p.render=oe),O&&O.sub(p),p.state||={},p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),D&&p.__s==null&&(p.__s=p.state),D&&P.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,P.getDerivedStateFromProps(E,p.__s))),g=p.props,b=p.state,p.__v=n,m)D&&P.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),D&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(D&&P.getDerivedStateFromProps==null&&E!==g&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(E,k),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(E,p.__s,k)){n.__v!=r.__v&&(p.props=E,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),h.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=w(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(E,p.__s,k),D&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(g,b,x)})}if(p.context=k,p.props=E,p.__P=e,p.__e=!1,A=t.__r,j=0,D)p.state=p.__s,p.__d=!1,A&&A(n),d=p.render(p.props,p.state,p.context),h.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,A&&A(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++j<25);p.state=p.__s,p.getChildContext!=null&&(i=v(v({},i),p.getChildContext())),D&&!m&&p.getSnapshotBeforeUpdate!=null&&(x=p.getSnapshotBeforeUpdate(g,b)),M=d!=null&&d.type===S&&d.key==null?re(d.props.children):d,c=ee(e,_(M)?M:[M],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),T&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(N=o.length;N--;)y(o[N])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||te(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=ie(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function te(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(te))}function ne(e,n,r){for(var i=0;i<r.length;i++)I(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function re(e){return typeof e!=`object`||!e||e.__b>0?e:_(e)?e.map(re):e.constructor===void 0?v({},e):null}function ie(n,r,i,a,o,s,c,l,u){var d,f,p,h,g,v,b,x=i.props||m,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||N(n,d,null,g,o);for(d in S)g=S[d],d==`children`?h=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?v=g:d==`checked`?b=g:l&&typeof g!=`function`||x[d]===g||N(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),ee(r.type==`template`?n.content:n,_(h)?h:[h],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&w(i,0),l,u),s!=null)for(d=s.length;d--;)y(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&v==null?n.removeAttribute(`value`):v!=null&&(v!==n[d]||C==`progress`&&!v||C==`option`&&v!=x[d])&&N(n,d,v,x[d],o),d=`checked`,b!=null&&b!=n[d]&&N(n,d,b,x[d],o))}return n}function I(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function ae(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||I(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ae(i[a],n,r||typeof e.type!=`function`);r||y(e.__e),e.__c=e.__=e.__e=void 0}function oe(e,t,n){return this.constructor(e,n)}function se(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],F(r,n=(!a&&i||r).__k=b(S,null,[n]),o||m,m,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),ne(s,n,c),n.props.children=null}e=h.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,C.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=v({},this.state);typeof e==`function`&&(e=e(v({},n),this.props)),e&&v(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),D(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),D(this))},C.prototype.render=S,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=P(!1),p=P(!0);var ce=`ghost-admin-toolbar-root`,le=2e3,ue=`ghost-admin-toolbar-display`,L=`minimized`,R=`expanded`;function de(e){let t=document.createElement(`iframe`);return t.dataset.frame=`admin-auth`,t.src=`${e}auth-frame/`,t.title=`Ghost admin authentication`,t.tabIndex=-1,t.style.cssText=`display:none;width:0;height:0;border:0;`,document.body.appendChild(t),t}function fe(e,t){let n=0,r={},i=new URL(e).origin;window.addEventListener(`message`,function(e){if(e.origin!==i)return;let t;try{t=JSON.parse(e.data)}catch{return}let n=r[t.uid];n&&(delete r[t.uid],n(t.error,t.result))});function a(e,a){return new Promise((o,s)=>{n+=1;let c=n,l=window.setTimeout(()=>{delete r[c],s(Error(`Admin authentication timed out`))},le);r[c]=(e,t)=>{window.clearTimeout(l),e?s(Error(e)):o(t)},t.contentWindow?.postMessage(JSON.stringify({uid:c,action:e,...a}),i)})}return{getUser:async()=>(await a(`getUser`))?.users?.[0]||null}}function pe(e){let t=new Set([`owner`,`administrator`,`editor`]);return(e?.roles||[]).some(e=>t.has((e?.name||``).toLowerCase()))}function me(){return document.currentScript||document.querySelector(`script[data-ghost-admin-toolbar]`)}function he(e){return e?e.endsWith(`/`)?e:`${e}/`:null}function ge(e){let t=e?.dataset||{},n=he(t.ghostAdminToolbar);return n?{adminUrl:n,siteTitle:t.siteTitle||`Ghost`,pageContext:t.pageContext||``,resourceType:t.resourceType||``,resourceId:t.resourceId||``,resourceSlug:t.resourceSlug||``,siteAnalyticsEnabled:t.siteAnalyticsEnabled===`true`,activityPubEnabled:t.activitypubEnabled===`true`,membersEnabled:t.membersEnabled===`true`,commentsEnabled:t.commentsEnabled!==`false`}:null}var z,B,V,H,U=0,_e=[],W=t,ve=W.__b,ye=W.__r,be=W.diffed,xe=W.__c,Se=W.unmount,Ce=W.__;function G(e,t){W.__h&&W.__h(B,e,U||t),U=0;var n=B.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return U=1,we(Me,e)}function we(e,t,n){var r=G(z++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Me(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=B,!B.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};B.__f=!0;var a=B.shouldComponentUpdate,o=B.componentWillUpdate;B.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},B.shouldComponentUpdate=i}return r.__N||r.__}function Te(e,t){var n=G(z++,3);!W.__s&&Y(n.__H,t)&&(n.__=e,n.u=t,B.__H.__h.push(n))}function Ee(e,t){var n=G(z++,4);!W.__s&&Y(n.__H,t)&&(n.__=e,n.u=t,B.__h.push(n))}function De(e){return U=5,Oe(function(){return{current:e}},[])}function Oe(e,t){var n=G(z++,7);return Y(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ke(){for(var e;e=_e.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(q),t.__h.some(J),t.__h=[]}catch(n){t.__h=[],W.__e(n,e.__v)}}}W.__b=function(e){B=null,ve&&ve(e)},W.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ce&&Ce(e,t)},W.__r=function(e){ye&&ye(e),z=0;var t=(B=e.__c).__H;t&&(V===B?(t.__h=[],B.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(q),t.__h.some(J),t.__h=[],z=0)),V=B},W.diffed=function(e){be&&be(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(_e.push(t)!==1&&H===W.requestAnimationFrame||((H=W.requestAnimationFrame)||je)(ke)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),V=B=null},W.__c=function(e,t){t.some(function(e){try{e.__h.some(q),e.__h=e.__h.filter(function(e){return!e.__||J(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],W.__e(n,e.__v)}}),xe&&xe(e,t)},W.unmount=function(e){Se&&Se(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{q(e)}catch(e){t=e}}),n.__H=void 0,t&&W.__e(t,n.__v))};var Ae=typeof requestAnimationFrame==`function`;function je(e){var t,n=function(){clearTimeout(r),Ae&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ae&&(t=requestAnimationFrame(n))}function q(e){var t=B,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),B=t}function J(e){var t=B;e.__c=e.__(),B=t}function Y(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Me(e,t){return typeof t==`function`?t(e):t}function X(e,t){return`${e}#/${t.replace(/^\/+/,``)}`}function Ne(e,t){return X(e,`comments?filter=${encodeURIComponent(`post_id:${t}`)}`)}function Pe(){let e=new URL(window.location.href);return e.searchParams.set(`admin`,`0`),`${e.pathname}${e.search}${e.hash}`}function Fe(e){return e.pageContext===`home`?Ie(e):e.resourceType===`post`&&e.resourceId?Le(e):e.resourceType===`tag`&&e.resourceSlug?[{href:X(e.adminUrl,`tags/${encodeURIComponent(e.resourceSlug)}`),icon:`edit`,label:`Edit`}]:e.resourceType&&e.resourceId?[{href:X(e.adminUrl,`editor/${e.resourceType}/${e.resourceId}`),icon:`edit`,label:`Edit`}]:[]}function Ie(e){let t=[];return e.siteAnalyticsEnabled&&t.push({href:X(e.adminUrl,`analytics`),icon:`siteAnalytics`,label:`Analytics`}),e.activityPubEnabled&&t.push({href:X(e.adminUrl,`activitypub`),icon:`network`,label:`Network`}),t.push({href:X(e.adminUrl,`posts/`),icon:`posts`,label:`Posts`}),e.membersEnabled&&t.push({href:X(e.adminUrl,`members`),icon:`members`,label:`Members`}),t.push({href:X(e.adminUrl,`settings`),icon:`settings`,label:`Settings`}),t}function Le(e){let t=[{href:X(e.adminUrl,`posts/analytics/${e.resourceId}`),icon:`analytics`,label:`Analytics`},{href:X(e.adminUrl,`editor/${e.resourceType}/${e.resourceId}`),icon:`edit`,label:`Edit`}];return e.commentsEnabled&&t.push({href:Ne(e.adminUrl,e.resourceId),icon:`comments`,label:`Comments`}),t}var Re={analytics:[b(`path`,{d:`M4 19V5`}),b(`path`,{d:`M4 19h16`}),b(`path`,{d:`M8 16v-5`}),b(`path`,{d:`M12 16V8`}),b(`path`,{d:`M16 16v-3`})],comments:[b(`path`,{d:`M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4Z`})],edit:[b(`path`,{d:`M12 20h9`}),b(`path`,{d:`M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z`})],members:[b(`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`}),b(`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`}),b(`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`}),b(`circle`,{cx:`9`,cy:`7`,r:`4`})],network:[b(`circle`,{cx:`5`,cy:`19`,r:`2`}),b(`circle`,{cx:`19`,cy:`5`,r:`2`}),b(`circle`,{cx:`12`,cy:`12`,r:`4`}),b(`path`,{d:`M8.8 21.5a10 10 0 0 0 12.7-12.7`}),b(`path`,{d:`M2.5 15.2A10 10 0 0 1 15.2 2.5`})],posts:[b(`path`,{d:`M13 21h8`}),b(`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`})],siteAnalytics:[b(`path`,{d:`M16 7h6v6`}),b(`path`,{d:`m22 7-8.5 8.5-5-5L2 17`})],settings:[b(`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}),b(`circle`,{cx:`12`,cy:`12`,r:`3`})],more:[b(`circle`,{cx:`12`,cy:`5`,r:`1`}),b(`circle`,{cx:`12`,cy:`12`,r:`1`}),b(`circle`,{cx:`12`,cy:`19`,r:`1`})],moreHorizontal:[b(`circle`,{cx:`5`,cy:`12`,r:`1`}),b(`circle`,{cx:`12`,cy:`12`,r:`1`}),b(`circle`,{cx:`19`,cy:`12`,r:`1`})]};function Z({name:e}){return b(`svg`,{"aria-hidden":`true`,className:`gh-admin-toolbar-icon gh-admin-toolbar-icon-${e}`,fill:`none`,height:`20`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,viewBox:`0 0 24 24`,width:`20`},Re[e])}function ze(){try{return window.localStorage?.getItem(`ghost-admin-toolbar-display`)===`minimized`?L:R}catch{return R}}function Be(e){try{window.localStorage?.setItem(ue,e)}catch{}}function Ve(e){return e?.name||e?.email||`Staff`}function He(e){return e?.profile_image||``}function Q({children:e}){return b(`span`,{className:`gh-admin-toolbar-sr-only`},e)}function $({children:e,label:t}){return b(`span`,{className:`gh-admin-toolbar-tooltip-wrap`},[e,b(`span`,{className:`gh-admin-toolbar-tooltip`,role:`tooltip`},t)])}function Ue({href:e,icon:t,label:n}){let r=b(`a`,{className:`gh-admin-toolbar-link`,href:e,"aria-label":n},[b(Z,{name:t}),b(Q,null,n)]);return b($,{label:n},r)}function We({isMinimized:e,isOpen:t,onMaximize:n,onMinimize:r,setIsOpen:i}){let a=`More`,o=b(`button`,{type:`button`,className:`gh-admin-toolbar-button`,"aria-expanded":t?`true`:`false`,"aria-haspopup":`menu`,"aria-label":a,onClick:()=>{i(!t)},onKeyDown:e=>{e.key===`Escape`&&i(!1)}},[b(Z,{name:`more`}),b(Q,null,a)]);return b(`div`,{className:`gh-admin-toolbar-menu-wrap`,onFocusOut:e=>{e.currentTarget.contains(e.relatedTarget)||i(!1)}},[b($,{label:a},o),t?b(`div`,{className:`gh-admin-toolbar-menu`},[b(`button`,{type:`button`,className:`gh-admin-toolbar-menu-item`,onClick:e?n:r},e?`Maximize`:`Minimize`),b(`a`,{className:`gh-admin-toolbar-menu-item`,href:Pe()},`Hide toolbar`)]):null])}function Ge({adminUrl:e,siteTitle:t,user:n}){let r=Ve(n),i=He(n);return b($,{label:`Admin`},b(`a`,{className:`gh-admin-toolbar-user`,href:X(e,``),"aria-label":`Open Ghost Admin for ${r} on ${t}`},[b(`span`,{className:`gh-admin-toolbar-avatar`,"aria-hidden":`true`},[b(`span`,{className:`gh-admin-toolbar-avatar-fallback`},r.slice(0,1).toUpperCase()),i?b(`img`,{alt:``,className:`gh-admin-toolbar-avatar-image`,loading:`lazy`,onError:e=>{e.currentTarget.remove()},referrerPolicy:`no-referrer`,src:i}):null]),b(Q,null,`Admin`)]))}function Ke({config:e,user:t}){let[n,r]=K(!1),[i,a]=K(()=>ze()===L),[o,s]=K(!1),[c,l]=K(null),u=De(null),d=De(null),f=Fe(e);function p(){s(!0)}function m(){n||(r(!1),s(!1))}return Ee(()=>{if(!u.current||!d.current)return;if(i){l({height:Math.max(d.current.scrollHeight+12,44),width:d.current.scrollWidth+8});return}let e=u.current.getBoundingClientRect();l({height:e.height,width:e.width})},[i,f.length]),Te(()=>{let e=document.getElementById(ce);if(e)return e.classList.toggle(`gh-admin-toolbar-menu-open`,n),e.classList.toggle(`gh-admin-toolbar-is-minimized`,i&&!o),()=>{e.classList.remove(`gh-admin-toolbar-menu-open`),e.classList.remove(`gh-admin-toolbar-is-minimized`)}},[n,i,o]),b(`nav`,{className:`gh-admin-toolbar${i?` gh-admin-toolbar-minimized-mode`:``}${o?` gh-admin-toolbar-minimized-expanded`:``}`,onFocusOut:e=>{i&&!e.currentTarget.contains(e.relatedTarget)&&m()},onMouseLeave:()=>{m()},onMouseEnter:()=>{i&&p()},onMouseOver:()=>{i&&p()},onPointerEnter:()=>{i&&p()},ref:u,role:`navigation`,style:i?{"--gh-admin-toolbar-expanded-height":`${c?.height||44}px`,"--gh-admin-toolbar-expanded-width":`${c?.width||178}px`}:null,"aria-label":`Ghost admin toolbar`},[b(`button`,{type:`button`,className:`gh-admin-toolbar-minimized-pill`,"aria-label":`Show admin toolbar`,onClick:p},[b(Z,{name:`moreHorizontal`}),b(Q,null,`Show admin toolbar`)]),b(`div`,{className:`gh-admin-toolbar-section`,ref:d},[b(Ge,{adminUrl:e.adminUrl,siteTitle:e.siteTitle,user:t}),...f.map(e=>b(Ue,e)),b(We,{isMinimized:i,isOpen:n,onMaximize:()=>{Be(R),r(!1),a(!1),s(!1)},onMinimize:()=>{Be(L),r(!1),a(!0),s(!1)},setIsOpen:r})])])}function qe(){return`
|
|
2
2
|
:host {
|
|
3
3
|
all: initial;
|
|
4
4
|
color-scheme: light;
|