"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["9623"],{504060:function(e,r,n){n.d(r,{U:()=>i,z:()=>u}),n(652983);var t,l,u=((t={}).Loading="loading",t.Success="success",t.Failed="failed",t),i=((l={}).wiki="wiki",l.normal="normal",l.coco="coco",l)},972382:function(e,r,n){n.r(r),n.d(r,{Link:()=>m,default:()=>L});var t=n(698127),l=n(706790),u=n(181267),i=n(397458),o=n(652983),a=n(203820),s=n(746593),c=n(87608),p=n.n(c),f=n(542982),k=n(436704),d=n(504060),v=e=>{try{return e?JSON.parse(e):{}}catch(e){return{}}},h=e=>{var r=(0,f.A)(e);return!!r&&("http:"===r.protocol||"https:"===r.protocol)},w=e=>{var r=(0,f.A)(e);return!!r&&"coco:"===r.protocol},m=e=>{var{className:r,style:n,href:c,children:m,customLink:L=!0,onSendMessage:g,onLinkClick:y,onLinkRender:_,onOpenLink:x,type:U,raw:b,parents:D}=e,j=(0,u._)(e,["className","style","href","children","customLink","onSendMessage","onLinkClick","onLinkRender","onOpenLink","type","raw","parents"]),A=c?(0,f.A)(c):null,C=null==c?void 0:c.startsWith("#"),N=(0,k.eD)(()=>!!c&&(!!h(c)||!!C||((0,a.Z)(L)?L(c):L))),R=e=>{if(x){null==x||x(e);return}window.open(e)};return((0,o.useEffect)(()=>{c&&A&&(null==_||_({url:c,parsedUrl:A}))},[c]),N)?(0,i.jsx)("a",(0,l._)((0,t._)({},(0,s.Z)(j,"href")),{className:p()("link-ljvovW",r),style:n,onClick:e=>{if(!c||!A){N||e.preventDefault(),null==y||y(e,{url:null!=c?c:"",parsedUrl:null,exts:{type:d.U.normal},openLink:R});return}if(w(c)){e.preventDefault();var r=A.searchParams.get("msg"),n=A.searchParams.get("ext"),t=n?v(n):void 0,l=null==t?void 0:t.s$wiki_link;if(l){h(l)&&(null==y||y(e,{url:c,parsedUrl:A,exts:{wiki_link:l,type:d.U.wiki},openLink:R}));return}if(r){null==g||g(r);return}null==y||y(e,{url:c,parsedUrl:A,exts:{type:d.U.coco},openLink:R})}h(c)&&(y?y(e,{url:c,parsedUrl:A,exts:{type:d.U.normal},openLink:R}):(e.preventDefault(),e.stopPropagation(),R(c)))},href:N?c:void 0,target:C?void 0:"_blank",children:m})):(0,i.jsx)(i.Fragment,{children:m})},L=m},436704:function(e,r,n){n.d(r,{NY:()=>o,eD:()=>a,g1:()=>i});var t=n(652983),l=n(637903),u=n(683053),i=(e,r)=>{var n=(0,t.useRef)(e);return r(e,n.current)||(n.current=e),n.current},o=(e,r)=>{var n=(0,t.useRef)();return((0,l.Z)(n.current)||!(0,u.Z)(n.current,r))&&(n.current=r),(0,t.useMemo)(e,n.current)},a=e=>e()},542982:function(e,r,n){n.d(r,{A:()=>t,j:()=>l});var t=e=>{try{return new URL(e)}catch(e){return null}},l=e=>!!t(e)||!!e&&e.startsWith("/")&&!e.startsWith("//")}}]);
//# sourceMappingURL=md-box-link.js.map