1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9483],{12154:function(e,t,n){"use strict";var r,i,a=n(52846);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}t.Z=function(e){return a.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:16,height:16,fill:"none"},e),r||(r=a.createElement("defs",null,a.createElement("path",{id:"edit_svg__a",d:"M0 0h16v16H0z"}))),a.createElement("g",null,i||(i=a.createElement("mask",{id:"edit_svg__b",fill:"#fff"},a.createElement("use",{xlinkHref:"#edit_svg__a"}))),a.createElement("g",{mask:"url(#edit_svg__b)"},a.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M2.83 0v3c0 .37-.3.67-.66.67H0",transform:"translate(10.5 11)"}),a.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M10.67 4V.67c0-.37-.3-.67-.67-.67H.67C.3 0 0 .3 0 .67v12c0 .36.3.66.67.66h2",transform:"translate(2.667 1.333)"}),a.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M0 0h4.67",transform:"translate(5.333 5.333)"}),a.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"m0 7 5.67-7",transform:"translate(7.667 7.667)"}),a.createElement("path",{style:{stroke:"#333",strokeWidth:1.3333333333333333,strokeOpacity:1,strokeDasharray:"0 0"},d:"M0 0h2.67",transform:"translate(5.333 8)"}))))}},89483:function(e,t,n){"use strict";n.r(t),n.d(t,{PluginPage:function(){return N}});var r=n(57437),i=n(38648),a=n(35609),s=n.n(a),l=n(15582),u=n(75591),c=n(35499),o=n(68454),d=n(6031),h=n.n(d),m=n(15947),g=n.n(m),x=n(12154),f=n(58870),k=n(38669),p=n(15592),v=n(56073),P=n(12402),j=n(98829),_=n(59566),y=n(11466),b=n(65878),Z=n(13894),w=n(59208),C=n(2265),E=n(94880);function N(){var e;let t=(0,w.s0)(),n=(0,y.RQ)(),a=n.getAll(),[d,m]=(0,C.useState)([]),[N,T]=(0,C.useState)(""),A=N.length>0?d:a,H=e=>{T(e),e.length>0?m(a.filter(t=>null==t?void 0:t.title.toLowerCase().includes(e.toLowerCase()))):m(a)},[R,M]=(0,C.useState)(),O=n.get(R),D=y.aN.get(null==O?void 0:O.id),I=(0,i.y1)((e,t)=>{let r=t.target.innerText;try{new(s())({definition:l.ZP.load(r)}).init().then(()=>{r!=e.content&&n.updatePlugin(e.id,e=>{e.content=r;let t=y.aN.add(e,!0);e.title=t.api.definition.info.title,e.version=t.api.definition.info.version})}).catch(e=>{console.error(e),(0,b.CF)(Z.ZP.Plugin.EditModal.Error)})}catch(e){console.error(e),(0,b.CF)(Z.ZP.Plugin.EditModal.Error)}},100).bind(null,O),[L,S]=(0,C.useState)(""),W=e=>fetch(e).catch(t=>{let n=new URL(e);return fetch("/api/proxy/".concat(n.pathname,"?").concat(n.search),{headers:{"X-Base-URL":n.origin}})}).then(e=>e.text()).then(e=>{try{return JSON.stringify(JSON.parse(e),null," ")}catch(t){return e}}).then(e=>{n.updatePlugin(O.id,t=>{t.content=e;let n=y.aN.add(t,!0);t.title=n.api.definition.info.title,t.version=n.api.definition.info.version})}).catch(e=>{(0,b.CF)(Z.ZP.Plugin.EditModal.Error)});return(0,r.jsxs)(o.S,{children:[(0,r.jsxs)("div",{className:h()["mask-page"],children:[(0,r.jsxs)("div",{className:"window-header",children:[(0,r.jsxs)("div",{className:"window-header-title",children:[(0,r.jsx)("div",{className:"window-header-main-title",children:Z.ZP.Plugin.Page.Title}),(0,r.jsx)("div",{className:"window-header-submai-title",children:Z.ZP.Plugin.Page.SubTitle(A.length)})]}),(0,r.jsxs)("div",{className:"window-actions",children:[(0,r.jsx)("div",{className:"window-action-button",children:(0,r.jsx)("a",{href:u.m9,target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)(c.h,{icon:(0,r.jsx)(_.Z,{}),bordered:!0})})}),(0,r.jsx)("div",{className:"window-action-button",children:(0,r.jsx)(c.h,{icon:(0,r.jsx)(k.Z,{}),bordered:!0,onClick:()=>t(-1)})})]})]}),(0,r.jsxs)("div",{className:h()["mask-page-body"],children:[(0,r.jsxs)("div",{className:h()["mask-filter"],children:[(0,r.jsx)("input",{type:"text",className:h()["search-bar"],placeholder:Z.ZP.Plugin.Page.Search,autoFocus:!0,onInput:e=>H(e.currentTarget.value)}),(0,r.jsx)(c.h,{className:h()["mask-create"],icon:(0,r.jsx)(f.Z,{}),text:Z.ZP.Plugin.Page.Create,bordered:!0,onClick:()=>{M(n.create().id)}})]}),(0,r.jsxs)("div",{children:[0==A.length&&(0,r.jsxs)("div",{style:{display:"flex",margin:"60px auto",alignItems:"center",justifyContent:"center"},children:[Z.ZP.Plugin.Page.Find,(0,r.jsx)("a",{href:u.m9,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:16},children:(0,r.jsx)(c.h,{icon:(0,r.jsx)(_.Z,{}),bordered:!0}
1)})]}),A.map(e=>(0,r.jsxs)("div",{className:h()["mask-item"],children:[(0,r.jsxs)("div",{className:h()["mask-header"],children:[(0,r.jsx)("div",{className:h()["mask-icon"]}),(0,r.jsxs)("div",{className:h()["mask-title"],children:[(0,r.jsxs)("div",{className:h()["mask-name"],children:[e.title,"@",(0,r.jsx)("small",{children:e.version})]}),(0,r.jsx)("div",{className:h()["mask-info"]+" one-line",children:Z.ZP.Plugin.Item.Info(y.aN.add(e).length)})]})]}),(0,r.jsxs)("div",{className:h()["mask-actions"],children:[e.builtin?(0,r.jsx)(c.h,{icon:(0,r.jsx)(v.Z,{}),text:Z.ZP.Plugin.Item.View,onClick:()=>M(e.id)}):(0,r.jsx)(c.h,{icon:(0,r.jsx)(x.Z,{}),text:Z.ZP.Plugin.Item.Edit,onClick:()=>M(e.id)}),!e.builtin&&(0,r.jsx)(c.h,{icon:(0,r.jsx)(p.Z,{}),text:Z.ZP.Plugin.Item.Delete,onClick:async()=>{await (0,b.i0)(Z.ZP.Plugin.Item.DeleteConfirm)&&n.delete(e.id)}})]})]},e.id))]})]})]}),O&&(0,r.jsx)("div",{className:"modal-mask",children:(0,r.jsxs)(b.u_,{title:Z.ZP.Plugin.EditModal.Title(null==O?void 0:O.builtin),onClose:()=>M(void 0),actions:[(0,r.jsx)(c.h,{icon:(0,r.jsx)(P.Z,{}),text:Z.ZP.UI.Confirm,bordered:!0,onClick:()=>M("")},"export")],children:[(0,r.jsxs)(b.aV,{children:[(0,r.jsx)(b.HC,{title:Z.ZP.Plugin.EditModal.Auth,children:(0,r.jsxs)("select",{value:null==O?void 0:O.authType,onChange:e=>{n.updatePlugin(O.id,t=>{t.authType=e.target.value})},children:[(0,r.jsx)("option",{value:"",children:Z.ZP.Plugin.Auth.None}),(0,r.jsx)("option",{value:"bearer",children:Z.ZP.Plugin.Auth.Bearer}),(0,r.jsx)("option",{value:"basic",children:Z.ZP.Plugin.Auth.Basic}),(0,r.jsx)("option",{value:"custom",children:Z.ZP.Plugin.Auth.Custom})]})}),["bearer","basic","custom"].includes(O.authType)&&(0,r.jsx)(b.HC,{title:Z.ZP.Plugin.Auth.Location,children:(0,r.jsxs)("select",{value:null==O?void 0:O.authLocation,onChange:e=>{n.updatePlugin(O.id,t=>{t.authLocation=e.target.value})},children:[(0,r.jsx)("option",{value:"header",children:Z.ZP.Plugin.Auth.LocationHeader}),(0,r.jsx)("option",{value:"query",children:Z.ZP.Plugin.Auth.LocationQuery}),(0,r.jsx)("option",{value:"body",children:Z.ZP.Plugin.Auth.LocationBody})]})}),"custom"==O.authType&&(0,r.jsx)(b.HC,{title:Z.ZP.Plugin.Auth.CustomHeader,children:(0,r.jsx)("input",{type:"text",value:null==O?void 0:O.authHeader,onCh
1ange:e=>{n.updatePlugin(O.id,t=>{t.authHeader=e.target.value})}})}),["bearer","basic","custom"].includes(O.authType)&&(0,r.jsx)(b.HC,{title:Z.ZP.Plugin.Auth.Token,children:(0,r.jsx)(b.WU,{type:"text",value:null==O?void 0:O.authToken,onChange:e=>{n.updatePlugin(O.id,t=>{t.authToken=e.currentTarget.value})}})}),!(null===(e=(0,E.Z)())||void 0===e?void 0:e.isApp)&&(0,r.jsx)(b.HC,{title:Z.ZP.Plugin.Auth.Proxy,subTitle:Z.ZP.Plugin.Auth.ProxyDescription,children:(0,r.jsx)("input",{type:"checkbox",checked:null==O?void 0:O.usingProxy,style:{minWidth:16},onChange:e=>{n.updatePlugin(O.id,t=>{t.usingProxy=e.currentTarget.checked})}})})]}),(0,r.jsxs)(b.aV,{children:[(0,r.jsx)(b.HC,{title:Z.ZP.Plugin.EditModal.Content,children:(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end"},children:[(0,r.jsx)("input",{type:"text",style:{minWidth:200,marginRight:20},onInput:e=>S(e.currentTarget.value)}),(0,r.jsx)(c.h,{icon:(0,r.jsx)(j.Z,{}),text:Z.ZP.Plugin.EditModal.Load,bordered:!0,onClick:()=>W(L)})]})}),(0,r.jsx)(b.HC,{subTitle:(0,r.jsx)("div",{className:"markdown-body ".concat(g()["plugin-content"]),dir:"auto",children:(0,r.jsx)("pre",{children:(0,r.jsx)("code",{contentEditable:!0,dangerouslySetInnerHTML:{__html:O.content},onBlur:I})})})}),null==D?void 0:D.tools.map((e,t)=>{var n,i;return(0,r.jsx)(b.HC,{title:null==e?void 0:null===(n=e.function)||void 0===n?void 0:n.name,subTitle:null==e?void 0:null===(i=e.function)||void 0===i?void 0:i.description},t)})]})]})})]})}},38648:function(e,t,n){"use strict";n.d(t,{y1:function(){return i}});var r=n(2265);function i(e,t,n){var i=this,a=(0,r.useRef)(null),s=(0,r.useRef)(0),l=(0,r.useRef)(null),u=(0,r.useRef)([]),c=(0,r.useRef)(),o=(0,r.useRef)(),d=(0,r.useRef)(e),h=(0,r.useRef)(!0);(0,r.useEffect)(function(){d.current=e},[e]);var m=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,x=!("trailing"in n)||!!n.trailing,f="maxWait"in n,k=f?Math.max(+n.maxWait||0,t):null;return(0,r.useEffect)(function(){return h.current=!0,function(){h.current=!1}},[]),(0,r.useMemo)(function(){var e=function(e){var t=u.current,n=c.current;return u.current=c.current=null,s.current=e,o.current=d.current.apply(n,t)},n=function(e,t){m&&cancelAnimationFrame(l.current),l.current=m?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!h.current)return!1;var n=e-a.current;return!a.current||n>=t||n<0||f&&e-s.current>=k},p=function(t){return l.current=null,x&&u.current?e(t):(u.current=c.current=null,o.current)},v=function e(){var i=Date.now();if(r(i))return p(i);if(h.current){var l=t-(i-a.current);n(e,f?Math.min(l,k-(i-s.current)):l)}},P=function(){var d=Date.now(),m=r(d);if(u.current=[].slice.call(arguments),c.current=i,a.current=d,m){if(!l.current&&h.current)return s.current=a.current,n(v,t),g?e(a.current):o.current;if(f)return n(v,t),e(a.current)}return l.current||n(v,t),o.current};return P.cancel=function(){l.current&&(m?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,u.current=a.current=c.current=l.current=null},P.isPending=function(){return!!l.current},P.flush=function(){return l.current?p(Date.now()):o.current},P},[g,f,t,k,x,m])}},6031:function(e){e.exports={"mask-page":"mask_mask-page__ou14k","mask-page-body":"mask_mask-page-body__kBXsJ","mask-filter":"mask_mask-filter__OdpU3","slide-in":"mask_slide-in__unpXH","search-bar":"mask_search-bar__7_Msn","mask-filter-lang":"mask_mask-filter-lang__mRxyv","mask-create":"mask_mask-create__BjAzk","mask-item":"mask_mask-item__dinia","mask-header":"mask_mask-header__RXJXI","mask-icon":"mask_mask-icon__wO1ER","mask-title":"mask_mask-title__IDEbR","mask-name":"mask_mask-name__77Rjh","mask-info":"mask_mask-info__2gtiu","mask-actions":"mask_mask-actions__rsWn_","slide-in-from-top":"mask_slide-in-from-top__DOEYB"}},15947:function(e){e.exports={"plugin-title":"plugin_plugin-title__Yr4S3","plugin-content":"plugin_plugin-content__xCgR_"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.