(()=>{"use strict";vare,t={667:(e,t,n)=>{consto=window.wp.element,r=window.wp.domReady;vara=n.n(r);consti=window.wp.components,c=window.wp.i18n,l=window.wp.apiFetch;varu=n.n(l);consts=window.wp.primitives,p=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"})),m=(0,o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(s.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),d=function({icon:e,size:t=24,...n}){return(0,o.cloneElement)(e,{width:t,height:t,...n})},v=window.wp.compose;functiony(e){try{returnnewURL(e),!0}catch(e){return!1}}function_({actionText:e,copyDescription:t,handle:n,resourceUrl:r}){consta=(0,c.__)("Loading...","activitypub"),l=(0,c.__)("Opening...","activitypub"),s=(0,c.__)("Error","activitypub"),_=(0,c.__)("Invalid","activitypub"),[w,b]=(0,o.useState)(e),[h,f]=(0,o.useState)(p),E=(0,v.useCopyToClipboard)(n,(()=>{f(m),setTimeout((()=>f(p)),1e3)})),[g,C]=(0,o.useState)(""),O=(0,o.useCallback)((()=>{lett;if(!y(g)&&!function(e){constt=e.replace(/^@/,"").split("@");return2===t.length&&y(`https://${t[1]}`)}(g))returnb(_),t=setTimeout((()=>b(e)),2e3),()=>clearTimeout(t);constn=r+g;b(a),u()({path:n}).then((({url:t})=>{b(l),setTimeout((()=>{window.open(t,"_blank"),b(e)}),200)})).catch((()=>{b(s),setTimeout((()=>b(e)),2e3)}))}),[g]);return(0,o.createElement)("div",{className:"activitypub__dialog"},(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",null,(0,c.__)("My Profile","activitypub")),(0,o.createElement)("div",{className:"activitypub-dialog-description"},t),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("input",{type:"text",value:n,readOnly:!0}),(0,o.createElement)(i.Button,{ref:E},(0,o.createElement)(d,{icon:h}),(0,c.__)("Copy","activitypub")))),(0,o.createElement)("div",{className:"activitypub-dialog__section"},(0,o.createElement)("h4",null,(0,c.__)("Your Profile","activitypub")),(0,o.createElement)("div",{className:"activitypub-dialog__description"},(0,o.createInterpolateElement)((0,c.__)("Or, if you know your own profile, we can start things that way! (eg <code>https://example.com/yourusername</code> or <code>yourusername@example.com</code>)","activitypub"),{code:(0,o.createElement)("code",null)})),(0,o.createElement)("div",{className:"activitypub-dialog__button-group"},(0,o.createElement)("input",{type:"text",value:g,onKeyDown:e=>{"Enter"===e?.code&&O()},onChange:e=>C(e.target.value)}),(0,o.createElement)(i.Button,{onClick:O},w))))}const{namespace:w}=window._activityPubOptions;functionb({selectedComment:e,commentId:t}){constn=(0,c.__)("Reply","activitypub"),r=`/${w}/comments/${t}/remote-reply?resource=`,a=(0,c.__)("Copy and paste the Comment URL into the search field of your favorite fediverse app or server.","activitypub");return(0,o.createElement)(_,{actionText:n,copyDescription:a,handle:e,resourceUrl:r})}functionh({selectedComment:e,commentId:t}){const[n,r]=(0,o.useState)(!1),a=(0,c.__)("Remote Reply","activitypub");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(i.Button,{isLink:!0,className:"comment-reply-link activitypub-remote-reply__button",onClick:()=>r(!0)},(0,c.__)("Reply on the Fediverse","activitypub")),n&&(0,o.createElement)(i.Modal,{className:"activitypub-remote-reply__modal activitypub__modal",onRequestClose:()=>r(!1),title:a},(0,o.createElement)(b,{selectedComment:e,commentId:t})))}letf=1;a()((()=>{[].forEach.call(document.querySelectorAll(".activitypub-remote-reply"),(e=>{constt=JSON.parse(e.dataset.attrs);(0,o.createRoot)(e).render((0,o.createElement)(h,{...t,id:"activitypub-remote-reply-link-"+f++,useId:!0}))}))}))}},n={};functiono(e){varr=n[e];if(void0!==r)returnr.exports;vara=n[e]={exports:{}};r