@yinuo-ngm/server 1.0.16 → 1.0.18
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/lib/app.js +3 -15
- package/lib/common/editor.js +2 -2
- package/lib/env.d.ts +1 -0
- package/lib/env.js +1 -0
- package/lib/plugins/error-handler.plugin.d.ts +2 -2
- package/lib/plugins/error-handler.plugin.js +97 -93
- package/lib/plugins/ws/topics/nginx.ws.js +2 -1
- package/lib/plugins/ws/topics/svn.ws.d.ts +2 -1
- package/lib/plugins/ws/topics/svn.ws.js +3 -2
- package/lib/plugins/ws/topics/syslog.ws.d.ts +1 -1
- package/lib/plugins/ws/topics/task.ws.d.ts +2 -1
- package/lib/plugins/ws/topics/task.ws.js +2 -1
- package/lib/plugins/ws/ws.context.d.ts +1 -1
- package/lib/plugins/ws/ws.plugin.js +4 -3
- package/lib/plugins/ws/ws.router.d.ts +2 -2
- package/lib/plugins/ws/ws.router.js +8 -7
- package/lib/routes/api-client/collection.routes.js +8 -6
- package/lib/routes/api-client/env.routes.js +4 -3
- package/lib/routes/api-client/history.routes.js +3 -2
- package/lib/routes/api-client/hub-token.routes.js +11 -11
- package/lib/routes/api-client/request.routes.js +7 -6
- package/lib/routes/api-client/send.routes.js +3 -2
- package/lib/routes/config.routes.js +5 -5
- package/lib/routes/hub.routes.js +10 -10
- package/lib/routes/nginx/nginx-lifecycle.routes.js +4 -0
- package/lib/routes/nginx/nginx-route.context.js +23 -7
- package/lib/routes/nginx/nginx-server.routes.js +158 -6
- package/lib/routes/node-version.routes.js +7 -7
- package/lib/routes/project.routes.js +9 -9
- package/lib/routes/rss.routes.js +3 -3
- package/lib/routes/sprite-browse.routes.js +2 -1
- package/lib/routes/sprite.routes.js +3 -3
- package/lib/routes/static-files.routes.js +7 -7
- package/lib/routes/svn.routes.js +5 -3
- package/lib/routes/system.routes.js +20 -1
- package/lib/routes/task.routes.js +4 -4
- package/package.json +13 -6
- package/www/3rdpartylicenses.txt +52 -52
- package/www/browser/chunk-2L7NUOMX.js +2 -0
- package/www/browser/chunk-2NZJ7CN2.js +20 -0
- package/www/browser/{chunk-SPRWNZHF.js → chunk-3CM4SKDO.js} +2 -2
- package/www/browser/{chunk-EEVPZGEY.js → chunk-3I7BQCXS.js} +1 -1
- package/www/browser/{chunk-DXF7BVK5.js → chunk-3M56F2S2.js} +1 -1
- package/www/browser/chunk-3OHBKMAA.js +1 -0
- package/www/browser/{chunk-4KETC6EB.js → chunk-3XNNQFWR.js} +1 -1
- package/www/browser/chunk-4BRW6LCZ.js +4 -0
- package/www/browser/{chunk-HGONFYP6.js → chunk-4LBSLURA.js} +1 -1
- package/www/browser/{chunk-BYEU6KGP.js → chunk-4X42HB6N.js} +1 -1
- package/www/browser/chunk-5DYX4DUX.js +11 -0
- package/www/browser/chunk-6SYVDN5L.js +1 -0
- package/www/browser/{chunk-XJ5KZQNN.js → chunk-6YYNHZ2A.js} +1 -1
- package/www/browser/{chunk-G2W3B7TJ.js → chunk-75W3GVSO.js} +1 -1
- package/www/browser/{chunk-76TVIB33.js → chunk-7U44RF5F.js} +1 -1
- package/www/browser/{chunk-WD4IAQR3.js → chunk-AELTP6YN.js} +1 -1
- package/www/browser/chunk-AMXRL4GR.js +1 -0
- package/www/browser/chunk-AV2ZODEH.js +1 -0
- package/www/browser/chunk-AZ6SIMYH.js +1 -0
- package/www/browser/chunk-B3C35ET3.js +2 -0
- package/www/browser/chunk-BTQIUVTQ.js +1 -0
- package/www/browser/chunk-CN5J4WNO.js +1 -0
- package/www/browser/{chunk-N4LRZJBP.js → chunk-D2ODDESN.js} +1 -1
- package/www/browser/{chunk-O2EYEF7J.js → chunk-DE6E23ET.js} +1 -1
- package/www/browser/{chunk-SVQWPHF5.js → chunk-DIJPUYIA.js} +1 -1
- package/www/browser/{chunk-SYCNSLAW.js → chunk-DLGJD6YU.js} +4 -4
- package/www/browser/{chunk-JHMEKUZ5.js → chunk-EEDA5U4V.js} +1 -1
- package/www/browser/chunk-FK6Z4HLL.js +1 -0
- package/www/browser/chunk-FL6GDGHW.js +1 -0
- package/www/browser/{chunk-HRXCR3IN.js → chunk-FXCG34QS.js} +1 -1
- package/www/browser/{chunk-UJOHBN2Y.js → chunk-H2USFIYR.js} +1 -1
- package/www/browser/chunk-H5HGMOE6.js +1 -0
- package/www/browser/chunk-HB3HECPD.js +1 -0
- package/www/browser/{chunk-INL2PELS.js → chunk-HDNG236Q.js} +1 -1
- package/www/browser/{chunk-WF2QTF5L.js → chunk-HJTXXSMC.js} +1 -1
- package/www/browser/{chunk-LQ5OXSW7.js → chunk-HUMCWAKJ.js} +1 -1
- package/www/browser/chunk-IKB3EQCP.js +2 -0
- package/www/browser/{chunk-TMX5TTV3.js → chunk-K7PESFPY.js} +1 -1
- package/www/browser/{chunk-T3KK7ZXB.js → chunk-KRYMOHYF.js} +1 -1
- package/www/browser/{chunk-SQQNR223.js → chunk-M4QRBV3K.js} +1 -1
- package/www/browser/chunk-N2PELLMM.js +30 -0
- package/www/browser/{chunk-ACAZUX6C.js → chunk-ONXBYGIG.js} +1 -1
- package/www/browser/{chunk-JZULA5JV.js → chunk-OSBDR36P.js} +1 -1
- package/www/browser/chunk-OZCK4XVV.js +1 -0
- package/www/browser/{chunk-GDWS2L66.js → chunk-QJP5F735.js} +1 -1
- package/www/browser/{chunk-2X3MRS27.js → chunk-RGOYDY7H.js} +1 -1
- package/www/browser/{chunk-B6MBYCXI.js → chunk-UJKK4A7Y.js} +1 -1
- package/www/browser/{chunk-ZNTJRLVH.js → chunk-WD2EKZQC.js} +1 -1
- package/www/browser/{chunk-L5D75AMV.js → chunk-WUA5JFDD.js} +1 -1
- package/www/browser/chunk-XLFHB7RS.js +3 -0
- package/www/browser/{chunk-JU3TEDBV.js → chunk-YNW4HEJO.js} +1 -1
- package/www/browser/{chunk-RW2JPJV7.js → chunk-ZTDLWBW5.js} +1 -1
- package/www/browser/index.html +1 -1
- package/www/browser/main-N64WJCHX.js +34 -0
- package/www/browser/chunk-2BZRE4G7.js +0 -1
- package/www/browser/chunk-5T5KA5PG.js +0 -1
- package/www/browser/chunk-6CGHNKJI.js +0 -1
- package/www/browser/chunk-7J24TP36.js +0 -1
- package/www/browser/chunk-CZ5AZ3VW.js +0 -1
- package/www/browser/chunk-DW7F5PEA.js +0 -1
- package/www/browser/chunk-HHBPULJW.js +0 -2
- package/www/browser/chunk-KVFR7GFV.js +0 -20
- package/www/browser/chunk-L7TMCSHV.js +0 -1
- package/www/browser/chunk-MVQTKINJ.js +0 -1
- package/www/browser/chunk-OMDHJIUB.js +0 -1
- package/www/browser/chunk-OWUAAOHW.js +0 -2
- package/www/browser/chunk-PIK5YPIB.js +0 -1
- package/www/browser/chunk-RHLQRQDK.js +0 -9
- package/www/browser/chunk-S3SJ4VVM.js +0 -11
- package/www/browser/chunk-SIVPP74B.js +0 -0
- package/www/browser/chunk-UFY3FLDK.js +0 -1
- package/www/browser/chunk-UQGCUFNM.js +0 -1
- package/www/browser/chunk-UXXWRMM6.js +0 -1
- package/www/browser/chunk-UZRJGJTD.js +0 -2
- package/www/browser/chunk-WI67LAOV.js +0 -4
- package/www/browser/chunk-WNCM6QKB.js +0 -1
- package/www/browser/chunk-YETDFSQE.js +0 -1
- package/www/browser/chunk-YMTC5GZK.js +0 -1
- package/www/browser/chunk-YVZHJ76K.js +0 -1
- package/www/browser/main-6LN5C22E.js +0 -34
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Oe,b as Fe}from"./chunk-3M56F2S2.js";import{e as wn,f as Mn}from"./chunk-ZTDLWBW5.js";import{a as st,b as Ne}from"./chunk-HDNG236Q.js";import{b as gt,c as _t,d as Ve}from"./chunk-4LBSLURA.js";import{a as mn,b as gn,c as it}from"./chunk-WD2EKZQC.js";import{a as An,b as qn}from"./chunk-UJKK4A7Y.js";import{a as dt,b as ut}from"./chunk-OZCK4XVV.js";import{a as mt,b as Pe}from"./chunk-AELTP6YN.js";import{a as Te,b as we}from"./chunk-HJTXXSMC.js";import{a as ye,c as xe,e as lt,f as De,g as zn,h as En,i as ct,j as pt,k as kn}from"./chunk-FXCG34QS.js";import{a as xn,c as Tn,d as ve,e as be,f as re}from"./chunk-3XNNQFWR.js";import{e as fn,f as rt,g as at}from"./chunk-YNW4HEJO.js";import{a as sn,b as ln,c as cn,d as pn,e as dn,f as nt,g as Ie,l as un}from"./chunk-4X42HB6N.js";import"./chunk-AV2ZODEH.js";import{d as Se,i as hn,j as vn,k as bn,m as yn,o as Je}from"./chunk-2NZJ7CN2.js";import{Fb as L,Ga as W,Ha as $,Hb as F,Lb as B,Na as rn,Nb as _n,Oa as an,Pa as D,Qa as Q,Rb as Cn,Sa as P,Ta as q,Vb as R,_b as ot,ac as U,cc as Ce,dc as K,gc as fe,ic as he}from"./chunk-3CM4SKDO.js";import"./chunk-HFZLJHYR.js";import{h as Ft}from"./chunk-WUA5JFDD.js";import{i as tt,n as k,u as de}from"./chunk-KRYMOHYF.js";import{$b as S,Ac as Ue,Ec as G,Fb as E,Fc as Xt,Gb as Ze,Gc as Z,Ha as M,Ic as en,Jc as g,Kc as I,Lb as Y,Lc as X,Mc as tn,Oa as ge,Oc as le,Pc as ce,Qc as pe,Wb as x,Yb as T,Yc as et,Zc as He,_b as _e,_c as nn,a as v,ac as N,b as w,bc as _,c as Ot,cc as a,dc as s,dd as ee,e as je,ec as f,ic as Ye,id as h,jc as Xe,jd as We,kc as Re,lc as y,mb as Qt,na as me,nb as l,oa as Qe,od as ke,rc as m,sa as A,sb as b,sd as on,uc as p,vc as Zt,wc as Yt,ya as d,yc as Le,z as j,za as u,zc as $e}from"./chunk-4BRW6LCZ.js";var Qn=(o,t)=>t.id;function Zn(o,t){o&1&&f(0,"nz-spin")}function Yn(o,t){if(o&1&&(a(0,"nz-tag"),g(1),s()),o&2){let e=p().$implicit;l(),X("HTTP ",e.response.status)}}function Xn(o,t){o&1&&(a(0,"nz-tag",8),g(1,"ERR"),s())}function ei(o,t){if(o&1){let e=y();a(0,"button",10),m("click",function(){d(e);let i=p().$implicit,r=p(3);return u(r.copy(i.resolved.curl.bash))}),g(1,"curl"),s()}}function ti(o,t){if(o&1){let e=y();a(0,"div",3)(1,"div",5)(2,"nz-tag"),g(3),s(),a(4,"span",6),g(5),s()(),a(6,"div",7)(7,"span"),g(8),s(),x(9,Yn,2,1,"nz-tag"),x(10,Xn,2,0,"nz-tag",8),s(),a(11,"div",9)(12,"button",10),m("click",function(){let i=d(e).$implicit,r=p(3);return u(r.replay.emit(i))}),g(13,"\u91CD\u653E"),s(),x(14,ei,2,0,"button",11),s()()}if(o&2){let e=t.$implicit;l(3),I(e.requestSnapshot.method),l(2),I(e.requestSnapshot.url),l(3),X("",e.metrics.durationMs," ms"),l(),T(e.response?9:-1),l(),T(e.error?10:-1),l(4),T(e.resolved.curl?14:-1)}}function ni(o,t){o&1&&(a(0,"div",4),g(1,"\u6682\u65E0\u5386\u53F2\u8BB0\u5F55"),s())}function ii(o,t){if(o&1&&(a(0,"div",2),S(1,ti,15,6,"div",3,Qn),x(3,ni,2,0,"div",4),s()),o&2){let e=p(2);l(),N(e.histories),l(2),T(e.histories.length?-1:3)}}function oi(o,t){if(o&1&&(Ye(0),x(1,Zn,1,0,"nz-spin")(2,ii,4,1,"div",2),Xe()),o&2){let e=p();l(),T(e.loading?1:2)}}var Ct=class o{loading=!1;histories=[];close=new b;replay=new b;copy(t){navigator.clipboard.writeText(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-api-history-drawer"]],inputs:{loading:"loading",histories:"histories"},outputs:{close:"close",replay:"replay"},decls:2,vars:2,consts:[["nzTitle","\u8BF7\u6C42\u5386\u53F2","nzPlacement","right",3,"nzOnClose","nzVisible","nzWidth"],[4,"nzDrawerContent"],[1,"list"],[1,"item"],[1,"empty"],[1,"row"],[1,"url"],[1,"meta"],["nzColor","red"],[1,"actions"],["nz-button","","nzSize","small",3,"click"],["nz-button","","nzSize","small"]],template:function(e,n){e&1&&(a(0,"nz-drawer",0),m("nzOnClose",function(){return n.close.emit()}),Y(1,oi,3,1,"ng-container",1),s()),e&2&&_("nzVisible",!0)("nzWidth",520)},dependencies:[k,it,gn,mn,q,P,D,Q,Pe,mt,we,Te],styles:[".list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.item[_ngcontent-%COMP%]{border:1px solid #f0f0f0;border-radius:8px;padding:10px}.row[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center;font-weight:500}.url[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.meta[_ngcontent-%COMP%]{margin-top:6px;display:flex;gap:8px;font-size:12px;opacity:.7}.actions[_ngcontent-%COMP%]{margin-top:8px;display:flex;gap:8px}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}"]})};var si=["*"];function li(o,t){if(o&1){let e=y();a(0,"button",12),m("click",function(i){d(e);let r=p();return r.toggle.emit(r.node.key),u(i.stopPropagation())}),f(1,"nz-icon",13),s()}if(o&2){let e=p();l(),Z("expanded",e.expanded),_("nzType","right")}}function ci(o,t){if(o&1&&f(0,"nz-icon",4),o&2){let e=p();_("nzType",e.iconType)}}function pi(o,t){if(o&1&&(a(0,"nz-tag",5),g(1),s()),o&2){let e=p();_("nzColor",e.getMethodColor(e.node.method)),l(),I(e.node.method||"")}}function di(o,t){if(o&1&&(a(0,"div",8),g(1),s()),o&2){let e=p();l(),I(e.node.subtitle)}}function ui(o,t){if(o&1){let e=y();a(0,"li",16),m("click",function(){d(e);let i=p(3);return i.createFolder.emit(i.node.id),u(i.visible=!1)}),f(1,"nz-icon",22),a(2,"span"),g(3,"\u65B0\u5EFA\u76EE\u5F55"),s()()}}function mi(o,t){if(o&1){let e=y();a(0,"li",16),m("click",function(){d(e);let i=p(3);return i.move.emit(i.node.id),u(i.visible=!1)}),f(1,"nz-icon",22),a(2,"span"),g(3,"\u79FB\u52A8\u5230"),s()()}}function gi(o,t){if(o&1){let e=y();x(0,ui,4,0,"li",15),a(1,"li",16),m("click",function(){d(e);let i=p(2);return i.createRequest.emit(i.node.id),u(i.visible=!1)}),f(2,"nz-icon",17),a(3,"span"),g(4,"\u65B0\u5EFA\u8BF7\u6C42"),s()(),x(5,mi,4,0,"li",15),a(6,"li",16),m("click",function(){d(e);let i=p(2);return i.rename.emit(i.node.id),u(i.visible=!1)}),f(7,"nz-icon",18),a(8,"span"),g(9,"\u91CD\u547D\u540D"),s()(),f(10,"li",19),a(11,"li",20),m("nzOnConfirm",function(){d(e);let i=p(2);return u(i.delete.emit(i.node.id))}),f(12,"nz-icon",21),a(13,"span"),g(14,"\u5220\u9664"),s()()}if(o&2){let e=p(2);T(e.node.kind==="collection"?0:-1),l(5),T(e.node.kind==="folder"?5:-1)}}function _i(o,t){if(o&1){let e=y();a(0,"li",16),m("click",function(){d(e);let i=p(2);return i.move.emit(i.node.id),u(i.visible=!1)}),f(1,"nz-icon",22),a(2,"span"),g(3,"\u79FB\u52A8\u5230"),s()(),a(4,"li",16),m("click",function(){d(e);let i=p(2);return i.rename.emit(i.node.id),u(i.visible=!1)}),f(5,"nz-icon",18),a(6,"span"),g(7,"\u91CD\u547D\u540D"),s()(),f(8,"li",19),a(9,"li",20),m("nzOnConfirm",function(){d(e);let i=p(2);return u(i.delete.emit(i.node.id))}),f(10,"nz-icon",21),a(11,"span"),g(12,"\u5220\u9664"),s()()}}function Ci(o,t){if(o&1&&(a(0,"ul",14),x(1,gi,15,2)(2,_i,13,0),s()),o&2){let e=p();l(),T(e.node.kind!=="request"?1:2)}}function fi(o,t){o&1&&(a(0,"div",11),Yt(1),s())}var ft=class o{node;expanded=!1;activeKey=null;toggle=new b;selectRequest=new b;selectCollection=new b;createRequest=new b;createFolder=new b;rename=new b;move=new b;copyCurl=new b;delete=new b;visible=!1;get hasChildren(){return(this.node.children?.length??0)>0}get iconType(){return this.node.kind==="request"?"":this.node.kind==="folder"?"folder":"database"}onClick(){this.node.kind==="request"?this.selectRequest.emit(this.node.id):this.selectCollection.emit(this.node.id)}getMethodColor(t){return{GET:"#61affe",POST:"#49cc90",PUT:"#fca130",PATCH:"#50e3c2",DELETE:"#f93e3e",HEAD:"#909090",OPTIONS:"#909090"}[t?.toUpperCase()||""]||"#909090"}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-collection-tree-item"]],hostVars:2,hostBindings:function(e,n){e&2&&Z("ctree-item",!0)},inputs:{node:"node",expanded:"expanded",activeKey:"activeKey"},outputs:{toggle:"toggle",selectRequest:"selectRequest",selectCollection:"selectCollection",createRequest:"createRequest",createFolder:"createFolder",rename:"rename",move:"move",copyCurl:"copyCurl",delete:"delete"},ngContentSelectors:si,decls:14,vars:11,consts:[["menuTpl",""],[1,"row"],["nz-button","","nzType","text","nzSize","small",1,"chev"],[1,"main",3,"click"],[1,"icon",3,"nzType"],[1,"method",3,"nzColor"],[1,"texts"],[1,"title"],[1,"sub"],["nz-button","","nzType","text","nzSize","small","nz-popover","","nzPopoverTrigger","click","nzPopover","","nzPopoverPlacement","right",1,"more",3,"click","nzPopoverVisibleChange","nzPopoverVisible","nzPopoverContent","nzPopoverOverlayClassName"],["nzType","more","nzTheme","outline"],[1,"children"],["nz-button","","nzType","text","nzSize","small",1,"chev",3,"click"],[1,"chev-icon",3,"nzType"],["nz-menu",""],["nz-menu-item",""],["nz-menu-item","",3,"click"],["nzType","plus"],["nzType","edit"],["nz-menu-divider",""],["nz-menu-item","","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u8BA4\u5220\u9664\u5417\uFF1F",3,"nzOnConfirm"],["nzType","delete"],["nzType","folder"]],template:function(e,n){if(e&1){let i=y();Zt(),a(0,"div",1),x(1,li,2,3,"button",2),a(2,"div",3),m("click",function(){return d(i),u(n.onClick())}),x(3,ci,1,1,"nz-icon",4),x(4,pi,2,2,"nz-tag",5),a(5,"div",6)(6,"div",7),g(7),s(),x(8,di,2,1,"div",8),s()(),a(9,"button",9),m("click",function(c){return d(i),u(c.stopPropagation())}),pe("nzPopoverVisibleChange",function(c){return d(i),ce(n.visible,c)||(n.visible=c),u(c)}),f(10,"nz-icon",10),s(),Y(11,Ci,3,1,"ng-template",null,0,ee),s(),x(13,fi,2,0,"div",11)}if(e&2){let i=G(12);Z("active",n.activeKey===n.node.key),l(),T(n.hasChildren?1:-1),l(2),T(n.iconType?3:-1),l(),T(n.node.kind==="request"?4:-1),l(3),I(n.node.title),l(),T(n.node.subtitle?8:-1),l(),le("nzPopoverVisible",n.visible),_("nzPopoverContent",i)("nzPopoverOverlayClassName","project-item-popover"),l(4),T(n.hasChildren&&n.expanded?13:-1)}},dependencies:[k,q,P,D,R,$,W,at,rt,De,xe,ye,lt,we,Te,Ne,st],styles:[".ctree-item[_nghost-%COMP%]{display:block}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;padding:6px 8px;border-radius:6px;cursor:pointer;transition:background-color .2s ease}.row[_ngcontent-%COMP%]:hover{background-color:#0000000a}.row.active[_ngcontent-%COMP%]{background-color:#e6f7ff}.row.active[_ngcontent-%COMP%]:hover{background-color:#bae7ff}.chev[_ngcontent-%COMP%]{flex:0 0 auto;width:20px;height:20px;padding:0!important}.chev-icon[_ngcontent-%COMP%]{font-size:12px;transition:transform .2s ease;color:#00000073}.chev-icon.expanded[_ngcontent-%COMP%]{transform:rotate(90deg)}.main[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.icon[_ngcontent-%COMP%]{opacity:.65;font-size:14px}.method[_ngcontent-%COMP%]{flex:0 0 auto;font-size:10px;font-weight:600;line-height:1.4;padding:0 4px;margin:0}.texts[_ngcontent-%COMP%]{flex:1;min-width:0}.title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#000000d9}.sub[_ngcontent-%COMP%]{font-size:12px;opacity:.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}.more[_ngcontent-%COMP%]{flex:0 0 auto;width:20px;height:20px;padding:0!important;visibility:hidden;opacity:.5}.more[_ngcontent-%COMP%]:hover{opacity:1}.row[_ngcontent-%COMP%]:hover .more[_ngcontent-%COMP%]{visibility:visible}.children[_ngcontent-%COMP%]{margin-left:20px;padding-left:4px;border-left:1px dashed rgba(0,0,0,.08);margin-top:4px;display:flex;flex-direction:column;gap:2px}"]})};var Rn=o=>({$implicit:o}),In=(o,t)=>t.key;function vi(o,t){if(o&1&&Re(0,1),o&2){let e=t.$implicit;p();let n=G(4);_("ngTemplateOutlet",n)("ngTemplateOutletContext",He(2,Rn,e))}}function bi(o,t){o&1&&(a(0,"div",2),g(1,"\u6682\u65E0\u8BF7\u6C42"),s())}function yi(o,t){if(o&1&&Re(0,1),o&2){let e=t.$implicit;p(2);let n=G(4);_("ngTemplateOutlet",n)("ngTemplateOutletContext",He(2,Rn,e))}}function xi(o,t){if(o&1){let e=y();a(0,"app-collection-tree-item",3),m("toggle",function(i){d(e);let r=p();return u(r.toggle(i))})("selectRequest",function(i){d(e);let r=p();return u(r.onSelectRequest(i))})("selectCollection",function(i){d(e);let r=p();return u(r.onSelectCollection(i))})("createRequest",function(i){d(e);let r=p();return u(r.createRequest.emit({collectionId:i}))})("createFolder",function(i){d(e);let r=p();return u(r.createFolder.emit({collectionId:i}))})("rename",function(i){let r=d(e).$implicit,c=p();return u(c.rename.emit({id:i,kind:r.kind}))})("move",function(i){let r=d(e).$implicit,c=p();return u(c.move.emit({id:i,kind:r.kind}))})("copyCurl",function(i){d(e);let r=p();return u(r.copyCurl.emit(i))})("delete",function(i){let r=d(e).$implicit,c=p();return u(c.delete.emit({id:i,kind:r.kind}))}),S(1,yi,1,4,"ng-container",1,In),s()}if(o&2){let e=t.$implicit,n=p();_("node",e)("expanded",n.expanded(e.key))("activeKey",n.activeKey()),l(),N(e.children)}}var ht=class o{nodes=[];activeRequestId=ke(null);selectRequest=new b;selectCollection=new b;createRequest=new b;createFolder=new b;rename=new b;move=new b;copyCurl=new b;delete=new b;activeKey=h(()=>this.activeRequestId()?`r:${this.activeRequestId()}`:null);_activeCollectionId=M(null);activeCollectionId=h(()=>this._activeCollectionId());expandedMap=M({});expanded(t){return!!this.expandedMap()[t]}toggle(t){let e=v({},this.expandedMap());e[t]=!e[t],this.expandedMap.set(e)}onSelectRequest(t){this.selectRequest.emit(t)}onSelectCollection(t){this._activeCollectionId.set(t),this.selectCollection.emit(t);let e=`c:${t}`,n=v({},this.expandedMap());n[e]=!0,this.expandedMap.set(n)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-collection-tree"]],hostVars:2,hostBindings:function(e,n){e&2&&Z("tree-body",!0)},inputs:{nodes:"nodes",activeRequestId:[1,"activeRequestId"]},outputs:{selectRequest:"selectRequest",selectCollection:"selectCollection",createRequest:"createRequest",createFolder:"createFolder",rename:"rename",move:"move",copyCurl:"copyCurl",delete:"delete"},decls:5,vars:1,consts:[["nodeTpl",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"empty"],[3,"toggle","selectRequest","selectCollection","createRequest","createFolder","rename","move","copyCurl","delete","node","expanded","activeKey"]],template:function(e,n){e&1&&(S(0,vi,1,4,"ng-container",1,In),x(2,bi,2,0,"div",2),Y(3,xi,3,3,"ng-template",null,0,ee)),e&2&&(N(n.nodes),l(2),T(n.nodes.length?-1:2))},dependencies:[k,tt,R,K,$,q,ft],styles:[".tree-body[_nghost-%COMP%]{flex:1 1 auto;height:0;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:4px}.tree-body[_nghost-%COMP%] .empty[_ngcontent-%COMP%]{padding:24px 16px;opacity:.5;text-align:center;font-size:13px}"]})};function Ti(o,t){if(o&1){let e=y();a(0,"ul",11)(1,"li",12),m("click",function(){d(e);let i=p();return i.createRequest.emit({collectionId:null}),u(i.visible=!1)}),f(2,"nz-icon",13),a(3,"span"),g(4,"\u65B0\u5EFA\u8BF7\u6C42"),s()(),a(5,"li",12),m("click",function(){d(e);let i=p();return u(i.createCollection.emit())}),f(6,"nz-icon",14),a(7,"span"),g(8,"\u65B0\u5EFA\u96C6\u5408"),s()()()}}var vt=class o{nodes=ke([]);q=on("");activeId=ke(null);loading=!1;select=new b;createRequest=new b;createCollection=new b;createFolder=new b;reload=new b;delete=new b;rename=new b;move=new b;visible=!1;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-request-collections"]],inputs:{nodes:[1,"nodes"],q:[1,"q"],activeId:[1,"activeId"],loading:"loading"},outputs:{q:"qChange",select:"select",createRequest:"createRequest",createCollection:"createCollection",createFolder:"createFolder",reload:"reload",delete:"delete",rename:"rename",move:"move"},decls:13,vars:7,consts:[["menuTpl",""],[1,"wrap"],[1,"header"],["nzInputPrefix","","nzType","search",1,"search-icon"],["nz-input","","placeholder","\u641C\u7D22",3,"ngModelChange","ngModel"],["nz-button","","nzType","text",3,"click"],["nzTheme","outline",3,"nzType"],["nz-button","","nz-popover","","nzPopoverTrigger","click","nzPopoverPlacement","bottomCenter","nzType","text",3,"nzPopoverVisibleChange","nzPopoverVisible","nzPopoverContent","nzPopoverOverlayClassName"],["nzType","plus","nzTheme","outline"],[1,"body"],[3,"selectRequest","createRequest","createFolder","rename","move","delete","nodes","activeRequestId"],["nz-menu",""],["nz-menu-item","",1,"item",3,"click"],["nzType","api"],["nzType","folder-add"]],template:function(e,n){if(e&1){let i=y();a(0,"div",1)(1,"div",2)(2,"nz-input-wrapper"),f(3,"nz-icon",3),a(4,"input",4),pe("ngModelChange",function(c){return d(i),ce(n.q,c)||(n.q=c),u(c)}),s()(),a(5,"button",5),m("click",function(){return d(i),u(n.reload.emit())}),f(6,"nz-icon",6),s(),a(7,"button",7),pe("nzPopoverVisibleChange",function(c){return d(i),ce(n.visible,c)||(n.visible=c),u(c)}),f(8,"nz-icon",8),s()(),a(9,"div",9)(10,"app-collection-tree",10),m("selectRequest",function(c){return d(i),u(n.select.emit(c))})("createRequest",function(c){return d(i),u(n.createRequest.emit({collectionId:c.collectionId}))})("createFolder",function(c){return d(i),u(n.createFolder.emit({collectionId:c.collectionId??null}))})("rename",function(c){return d(i),u(n.rename.emit(c))})("move",function(c){return d(i),u(n.move.emit(c))})("delete",function(c){return d(i),u(n.delete.emit({id:c.id,kind:c.kind}))}),s()()(),Y(11,Ti,9,0,"ng-template",null,0,ee)}if(e&2){let i=G(12);l(4),le("ngModel",n.q),l(2),_("nzType",n.loading?"loading":"reload"),l(),le("nzPopoverVisible",n.visible),_("nzPopoverContent",i)("nzPopoverOverlayClassName","project-item-popover"),l(3),_("nodes",n.nodes())("activeRequestId",n.activeId())}},dependencies:[k,R,L,F,B,q,P,D,K,U,Ce,ot,$,W,De,xe,ye,at,rt,ht],styles:["[_nghost-%COMP%]{height:100%;display:flex;flex-direction:column;width:300px;flex:0 0 300px}.wrap[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.08);border-radius:8px;overflow:hidden;background:#fff}.header[_ngcontent-%COMP%]{width:100%;padding:8px 10px;display:flex;gap:6px;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,.06);flex:0 0 auto;background:#fafafa}.header[_ngcontent-%COMP%] nz-input-wrapper[_ngcontent-%COMP%]{flex:1;min-width:0}.header[_ngcontent-%COMP%] input[nz-input][_ngcontent-%COMP%]{font-size:13px}.header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:32px;height:32px;padding:0!important}.search-icon[_ngcontent-%COMP%]{color:#00000059}.body[_ngcontent-%COMP%]{flex:1 1 auto;height:0;display:flex;flex-direction:column}"]})};function wi(o,t){if(o&1&&f(0,"nz-option",3),o&2){let e=t.$implicit;_("nzValue",e)("nzLabel",e)}}function Mi(o,t){if(o&1){let e=y();a(0,"nz-select",8),m("ngModelChange",function(i){d(e);let r=p();return u(r.setApiKeyIn(i))}),f(1,"nz-option",9)(2,"nz-option",10),s()}if(o&2){let e=p();_("ngModel",e.apiKeyIn())}}function zi(o,t){o&1&&(a(0,"div",6),g(1,"\u65E0\u9274\u6743"),s())}function Ei(o,t){if(o&1){let e=y();a(0,"div",7)(1,"div",11)(2,"div",12),g(3,"Username"),s(),a(4,"input",13),m("ngModelChange",function(i){d(e);let r=p();return u(r.setBasicUsername(i))}),s()(),a(5,"div",11)(6,"div",12),g(7,"Password"),s(),a(8,"input",14),m("ngModelChange",function(i){d(e);let r=p();return u(r.setBasicPassword(i))}),s()()()}if(o&2){let e=p();l(4),_("ngModel",e.basicUsername()),l(4),_("ngModel",e.basicPassword())}}function ki(o,t){if(o&1){let e=y();a(0,"div",7)(1,"div",11)(2,"div",12),g(3,"Token"),s(),a(4,"input",15),m("ngModelChange",function(i){d(e);let r=p();return u(r.setBearerToken(i))}),s()()()}if(o&2){let e=p();l(4),_("ngModel",e.bearerToken())}}function Ai(o,t){if(o&1){let e=y();a(0,"div",7)(1,"div",16)(2,"div",12),g(3,"Cookie"),s(),a(4,"textarea",17),m("ngModelChange",function(i){d(e);let r=p();return u(r.setCookieValue(i))}),s()(),f(5,"nz-alert",18),s()}if(o&2){let e=p();l(4),_("ngModel",e.cookieValue())}}function qi(o,t){o&1&&f(0,"nz-alert",21)}function Ri(o,t){o&1&&f(0,"nz-alert",22)}function Ii(o,t){if(o&1){let e=y();a(0,"div",7)(1,"div",11)(2,"div",12),g(3,"Key"),s(),a(4,"input",19),m("ngModelChange",function(i){d(e);let r=p();return u(r.setApiKeyKey(i))}),s()(),a(5,"div",11)(6,"div",12),g(7,"Value"),s(),a(8,"input",20),m("ngModelChange",function(i){d(e);let r=p();return u(r.setApiKeyValue(i))}),s()(),x(9,qi,1,0,"nz-alert",21),x(10,Ri,1,0,"nz-alert",22),s()}if(o&2){let e=p();l(4),_("ngModel",e.apiKeyKey()),l(4),_("ngModel",e.apiKeyValue()),l(),T(e.apiKeyIn()==="query"?9:-1),l(),T(e.apiKeyIn()==="header"?10:-1)}}var bt=class o{auth=ke(void 0);authChange=new b;types=["none","basic","bearer","cookie","apikey"];type=h(()=>this.auth()?.type??"none");basicUsername=h(()=>this.auth()?.type==="basic"?this.auth()?.basic?.username??"":"");basicPassword=h(()=>this.auth()?.type==="basic"?this.auth()?.basic?.password??"":"");bearerToken=h(()=>this.auth()?.type==="bearer"?this.auth()?.bearer?.token??"":"");cookieValue=h(()=>this.auth()?.type==="cookie"?this.auth()?.cookie?.value??"":"");apiKeyIn=h(()=>this.auth()?.type!=="apikey"?"header":this.auth()?.apikey?.in??"header");apiKeyKey=h(()=>this.auth()?.type==="apikey"?this.auth()?.apikey?.key??"":"");apiKeyValue=h(()=>this.auth()?.type==="apikey"?this.auth()?.apikey?.value??"":"");setType(t){if(t==="none"){this.authChange.emit({type:"none"});return}if(t==="basic"){this.authChange.emit({type:"basic",basic:{username:"",password:""}});return}if(t==="bearer"){this.authChange.emit({type:"bearer",bearer:{token:""}});return}if(t==="cookie"){this.authChange.emit({type:"cookie",cookie:{value:""}});return}this.authChange.emit({type:"apikey",apikey:{in:"header",key:"",value:""}})}setBasicUsername(t){let e=this.auth(),n=w(v({},e??{type:"basic"}),{type:"basic",basic:w(v({},e?.basic),{username:t})});this.authChange.emit(n)}setBasicPassword(t){let e=this.auth(),n=w(v({},e??{type:"basic"}),{type:"basic",basic:w(v({},e?.basic),{password:t})});this.authChange.emit(n)}setBearerToken(t){let e=this.auth(),n=w(v({},e??{type:"bearer"}),{type:"bearer",bearer:w(v({},e?.bearer),{token:t})});this.authChange.emit(n)}setCookieValue(t){let e=this.auth(),n=w(v({},e??{type:"cookie"}),{type:"cookie",cookie:w(v({},e?.cookie),{value:t})});this.authChange.emit(n)}setApiKeyIn(t){let e=this.auth(),n=w(v({},e??{type:"apikey"}),{type:"apikey",apikey:w(v({},e?.apikey),{in:t,key:this.apiKeyKey(),value:this.apiKeyValue()})});this.authChange.emit(n)}setApiKeyKey(t){let e=this.auth(),n=w(v({},e??{type:"apikey"}),{type:"apikey",apikey:w(v({},e?.apikey),{in:this.apiKeyIn(),key:t,value:this.apiKeyValue()})});this.authChange.emit(n)}setApiKeyValue(t){let e=this.auth(),n=w(v({},e??{type:"apikey"}),{type:"apikey",apikey:w(v({},e?.apikey),{in:this.apiKeyIn(),key:this.apiKeyKey(),value:t})});this.authChange.emit(n)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-auth-editor"]],inputs:{auth:[1,"auth"]},outputs:{authChange:"authChange"},decls:12,vars:3,consts:[[1,"wrap"],[1,"bar"],[1,"type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"in",3,"ngModel"],[1,"main"],[1,"empty"],[1,"grid"],[1,"in",3,"ngModelChange","ngModel"],["nzValue","header","nzLabel","in: header"],["nzValue","query","nzLabel","in: query"],[1,"row"],[1,"label"],["nz-input","","placeholder","username",3,"ngModelChange","ngModel"],["nz-input","","placeholder","password","type","password",3,"ngModelChange","ngModel"],["nz-input","","placeholder","Bearer token",3,"ngModelChange","ngModel"],[1,"row","row-top"],["nz-input","","rows","4","placeholder","ngm_hub_token=...; other=value",3,"ngModelChange","ngModel"],["nzType","info","nzShowIcon","","nzMessage","\u586B\u5199\u5B8C\u6574 Cookie \u5934\u503C\u3002\u9002\u5408\u5148\u8C03\u7528\u767B\u5F55\u63A5\u53E3\u62FF\u5230 Set-Cookie\uFF0C\u518D\u7C98\u8D34\u5230\u8FD9\u91CC\u590D\u7528\u4F1A\u8BDD\u3002"],["nz-input","","placeholder","x-api-key / api_key",3,"ngModelChange","ngModel"],["nz-input","","placeholder","value",3,"ngModelChange","ngModel"],["nzType","info","nzShowIcon","","nzMessage","\u63D0\u793A\uFF1Aquery \u578B API Key \u4E0D\u4F1A\u5199\u5165\u8BF7\u6C42\u5934\uFF0C\u4F1A\u5728\u53D1\u9001\u65F6\u62FC\u63A5\u5230 URL \u67E5\u8BE2\u53C2\u6570\u4E2D\u3002"],["nzType","info","nzShowIcon","","nzMessage","\u63D0\u793A\uFF1Aheader \u578B API Key \u4F1A\u5728\u53D1\u9001\u65F6\u5199\u5165\u8BF7\u6C42\u5934\u3002"]],template:function(e,n){if(e&1&&(a(0,"div",0)(1,"div",1)(2,"nz-select",2),m("ngModelChange",function(r){return n.setType(r)}),S(3,wi,1,2,"nz-option",3,_e),s(),x(5,Mi,3,1,"nz-select",4),s(),a(6,"div",5),x(7,zi,2,0,"div",6)(8,Ei,9,2,"div",7)(9,ki,5,1,"div",7)(10,Ai,6,1,"div",7)(11,Ii,11,4,"div",7),s()()),e&2){let i;l(2),_("ngModel",n.type()),l(),N(n.types),l(2),T(n.type()==="apikey"?5:-1),l(2),T((i=n.type())==="none"?7:i==="basic"?8:i==="bearer"?9:i==="cookie"?10:i==="apikey"?11:-1)}},dependencies:[k,R,L,F,B,re,ve,be,K,U,Fe,Oe],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:220px}.bar[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #f0f0f0}.type[_ngcontent-%COMP%]{width:160px}.in[_ngcontent-%COMP%]{width:140px}.main[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding-top:10px}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:100px 1fr;align-items:center;gap:10px}.row-top[_ngcontent-%COMP%]{align-items:start}.label[_ngcontent-%COMP%]{font-size:12px;opacity:.8}"]})};var Ni=(o,t)=>t.id;function Di(o,t){if(o&1){let e=y();a(0,"label",10),m("ngModelChange",function(i){d(e);let r=p();return u(r.toggleEnabled(i))}),s()}if(o&2){let e=p();_("ngModel",e.isAllEnabled())}}function Pi(o,t){if(o&1){let e=y();a(0,"div",9)(1,"div",2)(2,"label",11),m("ngModelChange",function(i){let r=d(e).$index,c=p();return u(c.setEnabled(r,i))}),s()(),a(3,"div",12)(4,"input",13),m("ngModelChange",function(i){let r=d(e).$index,c=p();return u(c.setKey(r,i))}),s()(),a(5,"div",5)(6,"input",14),m("ngModelChange",function(i){let r=d(e).$index,c=p();return u(c.setValue(r,i))}),s()(),a(7,"div",6)(8,"input",14),m("ngModelChange",function(i){let r=d(e).$index,c=p();return u(c.setDescription(r,i))}),s()(),a(9,"div",7)(10,"button",15),m("click",function(){let i=d(e).$index,r=p();return u(r.removeRow(i))}),f(11,"nz-icon",16),s()()()}if(o&2){let e=t.$implicit,n=p();l(2),_("ngModel",e.enabled)("nzDisabled",!n.keepTrailingBlank),l(),_("nz-tooltip",n.keepTrailingBlank?"":"\u81EA\u52A8\u63D0\u53D6Url \u4E2D\u7684 Path \u53C2\u6570\uFF0C\u652F\u6301{param} \u4E0E :param"),l(),_("readonly",!n.keepTrailingBlank)("placeholder",n.keyPlaceholder)("ngModel",e.key),l(2),_("placeholder",n.valuePlaceholder)("ngModel",e.value),l(2),_("placeholder",n.descriptionLabel)("ngModel",e.description)}}function Nn(){return`kv_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}var ze=class o{ngOnChanges(t){t.rows&&(this.rows=this.withTrailingBlank(this.ensureRowIds(this.rows)))}rows=[];rowsChange=new b;keyLabel="Key";valueLabel="Value";keyPlaceholder="key";valuePlaceholder="value";descriptionLabel="Description";keepTrailingBlank=!0;enabledCount=h(()=>this.rows.filter(t=>t.enabled).length);isAllEnabled(){return this.rows.length>0&&this.rows.every(t=>t.enabled)}toggleEnabled(t){let e=this.rows.map(n=>w(v({},n),{enabled:t}));this.emit(e)}emit(t){this.rowsChange.emit(t)}ensureRowIds(t){return t.map(e=>!e.id||e.id.trim()===""?w(v({},e),{id:Nn()}):e)}withTrailingBlank(t){return this.keepTrailingBlank?this.ensureTrailingBlank(t):t}createBlankRow(){return{id:Nn(),key:"",value:"",description:"",enabled:!0}}isBlankRow(t){if(!t)return!0;let e=(t.key??"").trim(),n=(t.value??"").trim(),i=(t.description??"").trim();return!e&&!n&&!i}ensureTrailingBlank(t){let e=Array.isArray(t)?t:[];if(e.length===0)return[this.createBlankRow()];let n=e[e.length-1];return this.isBlankRow(n)?e:[...e,this.createBlankRow()]}sameRowsRefOrContent(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;let n=this.isBlankRow(t[t.length-1]),i=this.isBlankRow(e[e.length-1]);return n===i}removeRow(t){let e=this.rows.filter((n,i)=>i!==t);this.emit(this.withTrailingBlank(e))}setEnabled(t,e){let n=this.rows.map((i,r)=>r===t?w(v({},i),{enabled:e}):i);this.emit(n)}setValue(t,e){this.patchRow(t,{value:e})}setKey(t,e){this.patchRow(t,{key:e})}setDescription(t,e){this.patchRow(t,{description:e})}patchRow(t,e){let n=this.rows.map((i,r)=>r===t?v(v({},i),e):i);this.emit(this.withTrailingBlank(n))}addRow(){let t=[...this.rows,this.createBlankRow()];this.emit(this.withTrailingBlank(t))}clearDisabled(){let t=this.rows.filter(e=>e.enabled);this.emit(this.withTrailingBlank(t))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-kv-table"]],inputs:{rows:"rows",keyLabel:"keyLabel",valueLabel:"valueLabel",keyPlaceholder:"keyPlaceholder",valuePlaceholder:"valuePlaceholder",descriptionLabel:"descriptionLabel",keepTrailingBlank:"keepTrailingBlank"},outputs:{rowsChange:"rowsChange"},features:[ge],decls:14,vars:4,consts:[[1,"kv-wrap"],[1,"kv-head"],[1,"c-check"],["nz-checkbox","",3,"ngModel"],[1,"c-key"],[1,"c-val"],[1,"c-des"],[1,"c-op"],[1,"kv-body"],[1,"kv-row"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-checkbox","",3,"ngModelChange","ngModel","nzDisabled"],[1,"c-key",3,"nz-tooltip"],["nz-input","",3,"ngModelChange","readonly","placeholder","ngModel"],["nz-input","",3,"ngModelChange","placeholder","ngModel"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u5220\u9664",3,"click"],["nzType","minus-circle","nzTheme","outline"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),x(3,Di,1,1,"label",3),s(),a(4,"div",4),g(5),s(),a(6,"div",5),g(7),s(),a(8,"div",6),g(9),s(),f(10,"div",7),s(),a(11,"div",8),S(12,Pi,12,10,"div",9,Ni),s()()),e&2&&(l(3),T(n.keepTrailingBlank?3:-1),l(2),I(n.keyLabel),l(2),I(n.valueLabel),l(2),I(n.descriptionLabel),l(3),N(n.rows))},dependencies:[k,R,L,F,B,q,P,D,ut,dt,K,U,$,W,he,fe],styles:[".kv-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.kv-toolbar[_ngcontent-%COMP%]{padding:8px 0;display:flex;justify-content:space-between;align-items:center;gap:10px}.kv-toolbar[_ngcontent-%COMP%] .left[_ngcontent-%COMP%], .kv-toolbar[_ngcontent-%COMP%] .right[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.hint[_ngcontent-%COMP%]{font-size:12px;opacity:.7}.kv-head[_ngcontent-%COMP%]{display:grid;grid-template-columns:40px 1fr 1fr 2fr 44px;gap:8px;padding:6px 0;font-size:14px;border-bottom:1px solid #f0f0f0;align-items:center}.kv-head[_ngcontent-%COMP%] .c-key[_ngcontent-%COMP%], .kv-head[_ngcontent-%COMP%] .c-val[_ngcontent-%COMP%], .kv-head[_ngcontent-%COMP%] .c-des[_ngcontent-%COMP%]{opacity:.75}.kv-body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding:8px 0}.kv-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:40px 1fr 1fr 2fr 44px;gap:8px;align-items:center;padding:6px 0;border-bottom:1px dashed #f0f0f0}.c-check[_ngcontent-%COMP%], .c-op[_ngcontent-%COMP%]{display:flex;justify-content:center}.kv-empty[_ngcontent-%COMP%]{padding:16px;opacity:.75;display:flex;align-items:center;justify-content:space-between;border:1px dashed #e8e8e8;border-radius:8px;margin-top:8px}"]})};var Dn=je(Je());function Vi(o,t){if(o&1&&f(0,"nz-option",3),o&2){let e=t.$implicit;_("nzValue",e)("nzLabel",e)}}function Oi(o,t){if(o&1){let e=y();a(0,"button",10),m("click",function(){d(e);let i=p();return u(i.formatJson())}),g(1,"\u683C\u5F0F\u5316 JSON"),s()}}function Fi(o,t){o&1&&(a(0,"div",7),g(1,"\u65E0 Body"),s())}function Bi(o,t){if(o&1){let e=y();a(0,"textarea",11),m("ngModelChange",function(i){d(e);let r=p();return u(r.setTextBody(i))}),s()}if(o&2){let e=p();_("ngModel",e.textBody())}}function Ki(o,t){if(o&1&&(a(0,"div",13),g(1),s()),o&2){let e=p(2);l(),I(e.jsonError())}}function ji(o,t){if(o&1){let e=y();a(0,"textarea",12),m("ngModelChange",function(i){d(e);let r=p();return u(r.setJsonText(i))}),s(),x(1,Ki,2,1,"div",13)}if(o&2){let e=p();_("ngModel",e.jsonText()),l(),T(e.jsonError()?1:-1)}}function Li(o,t){if(o&1){let e=y();a(0,"app-kv-table",14),m("rowsChange",function(i){d(e);let r=p();return u(r.setUrlRows(i))}),s()}if(o&2){let e=p();_("rows",e.urlRows())}}function $i(o,t){o&1&&(a(0,"div",7),g(1,"MVP \u4EC5\u652F\u6301 none/json/text/urlencoded"),s())}var yt=class o{msg=A(Se);body;bodyChange=new b;bodySig=M(void 0);modes=["none","json","text","urlencoded","form","binary"];_jsonText=M("");mode=h(()=>this.bodySig()?.mode??"none");contentType=h(()=>this.bodySig()?.contentType??"");jsonText=h(()=>{if(this.mode()!=="json")return"";let t=this.body?.content;if(typeof t=="string")return t;if(t==null)return this._jsonText()||"";try{return JSON.stringify(t,null,2)}catch{return this._jsonText()||""}});jsonError=M("");textBody=h(()=>this.body?.mode==="text"?String(this.body?.content??""):"");urlRows=h(()=>{if(this.body?.mode!=="urlencoded")return[];let t=this.body?.content;return!t||typeof t!="object"||Array.isArray(t)?[]:Object.entries(t).map(([e,n])=>({key:e,value:String(n??""),enabled:!0,id:(0,Dn.uniqueId)()}))});setMode(t){let e=this.body,n=w(v({},e??{}),{mode:t});if(n.contentType||(t==="json"&&(n.contentType="application/json; charset=utf-8"),t==="text"&&(n.contentType="text/plain; charset=utf-8"),t==="urlencoded"&&(n.contentType="application/x-www-form-urlencoded; charset=utf-8"),t==="none"&&(n.contentType=void 0)),t==="none"){this.bodyChange.emit({mode:"none"});return}t==="json"&&e?.mode!=="json"&&(n.content={}),t==="text"&&e?.mode!=="text"&&(n.content=""),t==="urlencoded"&&e?.mode!=="urlencoded"&&(n.content={}),this.bodyChange.emit(n)}ngOnChanges(t){if(t.body){let e=t.body.currentValue;this.bodySig.set(e),e?.mode==="json"&&(typeof e.content=="string"?this._jsonText.set(e.content):this._jsonText.set(e.content?JSON.stringify(e.content,null,2):""),this.jsonError.set(""))}}setContentType(t){let e=this.mode(),n=w(v({},this.body??{mode:e}),{contentType:t});this.bodyChange.emit(n)}setTextBody(t){let e=w(v({},this.body??{mode:"text"}),{mode:"text",content:t});this.bodyChange.emit(e)}setJsonText(t){this._jsonText.set(t),this.jsonError.set("");try{let e=t.trim()?JSON.parse(t):{},n=w(v({},this.body??{mode:"json"}),{mode:"json",content:e});this.bodyChange.emit(n)}catch{this.jsonError.set("JSON \u4E0D\u5408\u6CD5\uFF08\u7EE7\u7EED\u8F93\u5165\u5373\u53EF\uFF09")}}formatJson(){if(this.mode()!=="json")return;let e=this.body?.content;try{let n=JSON.stringify(e??{},null,2);this._jsonText.set(n),this.jsonError.set("");let i=w(v({},this.body??{mode:"json"}),{mode:"json",content:e??{}});this.bodyChange.emit(i),this.msg.success("\u5DF2\u683C\u5F0F\u5316")}catch{this.msg.error("\u683C\u5F0F\u5316\u5931\u8D25")}}setUrlRows(t){let e={};for(let i of t){if(!i.enabled)continue;let r=(i.key??"").trim();r&&(e[r]=String(i.value??""))}let n=w(v({},this.body??{mode:"urlencoded"}),{mode:"urlencoded",content:e});this.bodyChange.emit(n)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-body-editor"]],inputs:{body:"body"},outputs:{bodyChange:"bodyChange"},features:[ge],decls:13,vars:4,consts:[[1,"wrap"],[1,"bar"],[1,"mode",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-input","","placeholder","content-type\uFF08\u53EF\u9009\uFF09",1,"ctype",3,"ngModelChange","ngModel"],["nz-button","","nzType","default"],[1,"main"],[1,"empty"],["nz-input","","placeholder","\u6587\u672C\u5185\u5BB9",1,"ta",3,"ngModel"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","a","valuePlaceholder","1",3,"rows"],["nz-button","","nzType","default",3,"click"],["nz-input","","placeholder","\u6587\u672C\u5185\u5BB9",1,"ta",3,"ngModelChange","ngModel"],["nz-input","","placeholder","{ }",1,"ta",3,"ngModelChange","ngModel"],[1,"err"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","a","valuePlaceholder","1",3,"rowsChange","rows"]],template:function(e,n){if(e&1&&(a(0,"div",0)(1,"div",1)(2,"nz-select",2),m("ngModelChange",function(r){return n.setMode(r)}),S(3,Vi,1,2,"nz-option",3,_e),s(),a(5,"input",4),m("ngModelChange",function(r){return n.setContentType(r)}),s(),x(6,Oi,2,0,"button",5),s(),a(7,"div",6),x(8,Fi,2,0,"div",7)(9,Bi,1,1,"textarea",8)(10,ji,2,2)(11,Li,1,1,"app-kv-table",9)(12,$i,2,0,"div",7),s()()),e&2){let i;l(2),_("ngModel",n.mode()),l(),N(n.modes),l(2),_("ngModel",n.contentType()),l(),T(n.mode()==="json"?6:-1),l(2),T((i=n.mode())==="none"?8:i==="text"?9:i==="json"?10:i==="urlencoded"?11:12)}},dependencies:[k,R,L,F,B,q,P,D,Q,K,U,re,ve,be,ze],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:260px}.bar[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #f0f0f0}.mode[_ngcontent-%COMP%]{width:140px}.ctype[_ngcontent-%COMP%]{flex:1 1 auto}.main[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding-top:10px}.ta[_ngcontent-%COMP%]{width:100%;height:100%;min-height:240px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.err[_ngcontent-%COMP%]{margin-top:8px;color:#a8071a;font-size:12px}"]})};var Ln=je(Je());var Pn=je(Je());var $t="hub-v2:api-client:tabs",Ui=10080*60*1e3;function ie(){return Date.now()}function Ut(){return`tab_${ie().toString(16)}_${Math.random().toString(16).slice(2,8)}`}var xt=class o{maxTabs=20;tabs=M([]);activeTabId=M(null);sending=M(!1);activeTab=h(()=>{let t=this.activeTabId(),e=this.tabs();return t?e.find(n=>n.id===t)??null:null});activeRequest=h(()=>this.activeTab()?.request??null);activeResponse=h(()=>this.activeTab()?.lastResponse??null);canOpenMore=h(()=>this.tabs().length<this.maxTabs);tabCount=h(()=>this.tabs().length);constructor(){this.restoreFromStorage(),We(()=>{let t=this.tabs(),e=this.activeTabId();this.saveToStorage(t,e)})}createEmptyTab(t){let e=ie(),n={id:`req_${e.toString(16)}_${Math.random().toString(16).slice(2,6)}`,name:"",method:"GET",url:"",collectionId:t??null,query:[],pathParams:[],headers:[],body:{mode:"none"},auth:{type:"none"},options:{followRedirects:!0,timeoutMs:3e4},tags:[],createdAt:e,updatedAt:e};return{id:Ut(),requestId:null,request:n,title:"New Request",isDirty:!1,lastResponse:null,createdAt:e,updatedAt:e}}openNewTab(t){if(!this.canOpenMore())throw new Error("\u5DF2\u8FBE\u5230\u6700\u5927 Tab \u6570\u91CF\u9650\u5236");let e=this.createEmptyTab(t);return this.tabs.update(n=>[...n,e]),this.activeTabId.set(e.id),e.id}openRequestInTab(t,e){let n=this.tabs().find(C=>C.requestId===t.id);if(n)return this.activeTabId.set(n.id),n.id;if(!this.canOpenMore())throw new Error("\u5DF2\u8FBE\u5230\u6700\u5927 Tab \u6570\u91CF\u9650\u5236");let i=ie(),r=v({},t),c={id:Ut(),requestId:t.id,request:r,savedSnapshot:r,title:this.generateTabTitle(t),isDirty:!1,lastResponse:null,createdAt:i,updatedAt:i};return this.tabs.update(C=>[...C,c]),this.activeTabId.set(c.id),c.id}closeTab(t){let n=this.tabs().findIndex(r=>r.id===t);if(n<0)return;let i=this.activeTabId()===t;if(this.tabs.update(r=>r.filter(c=>c.id!==t)),this.tabs().length===0){let r=this.createEmptyTab();this.tabs.set([r]),this.activeTabId.set(r.id);return}if(i){let r=this.tabs(),c=Math.min(n,r.length-1);this.activeTabId.set(r[c]?.id??null)}}closeOtherTabs(t){let e=this.tabs().find(n=>n.id===t);e&&(this.tabs.set([e]),this.activeTabId.set(t))}closeRightTabs(t){let e=this.tabs().findIndex(n=>n.id===t);e<0||(this.tabs.update(n=>n.slice(0,e+1)),this.tabs().find(n=>n.id===this.activeTabId())||this.activeTabId.set(t))}closeSavedTabs(){let t=this.activeTabId(),e=this.tabs().find(n=>n.id===t);if(this.tabs.update(n=>n.filter(i=>i.isDirty||!i.requestId)),!this.tabs().find(n=>n.id===t)){let n=this.tabs()[0];if(n)this.activeTabId.set(n.id);else{let i=this.createEmptyTab();this.tabs.set([i]),this.activeTabId.set(i.id)}}}closeAllTabs(){let t=this.createEmptyTab();this.tabs.set([t]),this.activeTabId.set(t.id)}duplicateTab(t){let e=this.tabs().find(C=>C.id===t);if(!e)throw new Error("Tab not found");if(!this.canOpenMore())throw new Error("\u5DF2\u8FBE\u5230\u6700\u5927 Tab \u6570\u91CF\u9650\u5236");let n=ie(),i=w(v({},e.request),{id:`req_${n.toString(16)}_${Math.random().toString(16).slice(2,6)}`,name:`${e.request.name||"\u672A\u547D\u540D"} (\u526F\u672C)`,createdAt:n,updatedAt:n}),r={id:Ut(),requestId:null,request:i,savedSnapshot:null,title:this.generateTabTitle(i),isDirty:!0,lastResponse:null,createdAt:n,updatedAt:n},c=this.tabs().findIndex(C=>C.id===t);return this.tabs.update(C=>{let z=[...C];return z.splice(c+1,0,r),z}),this.activeTabId.set(r.id),r.id}getTabUrl(t){return this.tabs().find(n=>n.id===t)?.request.url??null}switchTab(t){this.tabs().find(n=>n.id===t)&&this.activeTabId.set(t)}renameTab(t,e){this.tabs.update(n=>n.map(i=>{if(i.id!==t)return i;let r=w(v({},i.request),{name:e,updatedAt:ie()});return w(v({},i),{title:e,request:r,isDirty:i.requestId?!0:i.isDirty,updatedAt:ie()})}))}reorderTabs(t,e){t!==e&&this.tabs.update(n=>{let i=[...n],[r]=i.splice(t,1);return i.splice(e,0,r),i})}updateActiveRequest(t){let e=this.activeTabId();e&&this.tabs.update(n=>n.map(i=>{if(i.id!==e)return i;let r=w(v(v({},i.request),t),{updatedAt:ie()}),c=i.savedSnapshot,C=c?this.hasChanges(c,r):!0;return w(v({},i),{request:r,title:this.generateTabTitle(r),isDirty:C,updatedAt:ie()})}))}updateActiveResponse(t){let e=this.activeTabId();e&&this.tabs.update(n=>n.map(i=>i.id===e?w(v({},i),{lastResponse:t,updatedAt:ie()}):i))}markActiveSaved(t){let e=this.activeTabId();e&&this.tabs.update(n=>n.map(i=>i.id!==e?i:w(v({},i),{requestId:t,savedSnapshot:v({},i.request),isDirty:!1,updatedAt:ie()})))}markActiveDirty(){let t=this.activeTabId();t&&this.tabs.update(e=>e.map(n=>n.id===t?w(v({},n),{isDirty:!0,updatedAt:ie()}):n))}setSending(t){this.sending.set(t)}getTab(t){return this.tabs().find(e=>e.id===t)??null}isTabDirty(t){return this.getTab(t)?.isDirty??!1}generateTabTitle(t){if(t.name)return t.name;if(!t.url)return"New Request";let n=t.url.replace(/^\{\{[^}]+\}\}/,"").replace(/^https?:\/\/[^/]+/,"").split("?")[0]||"/";return`${t.method} ${n}`}hasChanges(t,e){let C=t,{updatedAt:n}=C,i=Ot(C,["updatedAt"]),z=e,{updatedAt:r}=z,c=Ot(z,["updatedAt"]);return!(0,Pn.isEqual)(i,c)}restoreFromStorage(){try{let t=localStorage.getItem($t);if(!t){this.createInitialTab();return}let e=JSON.parse(t);if(Date.now()-e.savedAt>Ui||!Array.isArray(e.tabs)||e.tabs.length===0){this.createInitialTab();return}let i=e.tabs.filter(r=>r.id&&r.request);if(i.length===0){this.createInitialTab();return}this.tabs.set(i),this.activeTabId.set(e.activeTabId??i[0].id)}catch{this.createInitialTab()}}saveToStorage(t,e){try{let n=t.map(i=>({id:i.id,requestId:i.requestId,request:i.request,title:i.title,isDirty:i.isDirty,createdAt:i.createdAt,updatedAt:i.updatedAt}));localStorage.setItem($t,JSON.stringify({tabs:n,activeTabId:e,savedAt:Date.now()}))}catch{localStorage.removeItem($t)}}createInitialTab(){let t=this.createEmptyTab();this.tabs.set([t]),this.activeTabId.set(t.id)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=me({token:o,factory:o.\u0275fac,providedIn:"root"})};var Hi=/\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g;function Vn(o=[]){let t={};for(let e of o)e.enabled&&(t[e.key]=String(e.value??""));return t}function Wi(o,t){let e=new Set;return{out:o.replace(Hi,(i,r)=>r in t?String(t[r]??""):(e.add(r),`{{${r}}}`)),missing:[...e]}}function On(o,t){let e=new Set;for(let n of o){if(!n)continue;let{missing:i}=Wi(n,t);i.forEach(r=>e.add(r))}return[...e]}var Fn=je(Je());function Ke(o){if(!o)return[];let t=o;try{t=new URL(o).pathname||""}catch{t=o.split("?")[0].split("#")[0]||"";let C=t.indexOf("/");C>=0&&(t=t.slice(C))}let e=Ji(t),n=[],i=/(?:^|\/):([A-Za-z_][A-Za-z0-9_]*)/g,r;for(;r=i.exec(e);)n.push(r[1]);let c=/\{([A-Za-z_][A-Za-z0-9_]*)\}/g;for(;r=c.exec(e);)n.push(r[1]);return n}function Ji(o){try{return decodeURIComponent(o)}catch{return o}}function Ht(o,t){let e=Ke(o),n=Array.isArray(t)?t:[],i=new Map;for(let c of n){let C=(c.key??"").trim();C&&(i.has(C)||i.set(C,c))}return e.map(c=>{let C=i.get(c);return C?w(v({},C),{key:c,enabled:!0}):{key:c,value:"",description:"",enabled:!0,id:(0,Fn.uniqueId)()}})}var Bn=je(Je());function Wt(o){return(o??[]).map(t=>({key:t.key,value:t.value,enabled:t.enabled,id:(0,Bn.uniqueId)(),description:t.description}))}function Kn(o,t){let e=new Map(t?.map(n=>[n.key,n]));return o.filter(n=>n.key?.trim()).map(n=>({key:n.key.trim(),value:String(n.value??""),enabled:n.enabled!==!1,secret:e.get(n.key)?.secret}))}function Gi(o,t){if(!t)return!0;let e=(o.name??"").toLowerCase(),n=(o.url??"").toLowerCase();return e.includes(t)||n.includes(t)}function Ge(o){if(o==null)return null;let t=String(o).trim();if(!t)return null;let e=t.toLowerCase();return e==="null"||e==="undefined"?null:t}function Qi(o,t){return(o.parentId??"").localeCompare(t.parentId??"")||(o.order??0)-(t.order??0)||(o.name??"").localeCompare(t.name??"")}function Zi(o,t){return(Ge(o.collectionId)??"").localeCompare(Ge(t.collectionId)??"")||(o.order??0)-(t.order??0)||(o.name??"").localeCompare(t.name??"")||(o.url??"").localeCompare(t.url??"")}function Jt(o,t,e){let n=e?.trim().toLowerCase()||"",i=[...o??[]].sort(Qi),r=[...t??[]].sort(Zi),c=new Map;for(let O of i){let se=Ge(O.parentId),oe=c.get(se)??[];oe.push(O),c.set(se,oe)}let C=new Map;for(let O of r){if(!Gi(O,n))continue;let se=Ge(O.collectionId),oe=C.get(se)??[];oe.push(O),C.set(se,oe)}let z=(O,se)=>({key:`r:${String(O.id)}`,kind:"request",id:String(O.id),title:O.name??"\u672A\u547D\u540D",name:O.name,subtitle:O.url??"",method:O.method??"",parentKey:se,children:[]}),J=(O,se)=>{let oe=Ge(O.id),Pt=`c:${oe}`,Wn=c.get(oe)??[],Jn=C.get(oe)??[];return{key:Pt,kind:O.kind??"collection",id:oe,title:O.name??"\u672A\u547D\u540D",name:O.name,parentKey:se,children:[...Wn.map(Vt=>J(Vt,Pt)),...Jn.map(Vt=>z(Vt,Pt))]}},ue=c.get(null)??[],Hn=C.get(null)??[];return[...ue.map(O=>J(O,null)),...Hn.map(O=>z(O,null))]}var Tt=class o{http=A(bn);ls=A(vn);base="/api/client";async listRequests(t,e){let n=new de().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/requests`,n))}async saveRequest(t,e,n){return await j(this.http.post(`${this.base}/requests`,{scope:t,projectId:e,request:n}))}async updateRequest(t,e,n){return await j(this.http.post(`${this.base}/requests/update`,{scope:t,projectId:e,request:n}))}async deleteRequest(t,e,n){let i=new de().set("scope",e);return n&&(i=i.set("projectId",n)),await j(this.http.delete(`${this.base}/requests/${t}`,i))}async send(t){return await j(this.http.post(`${this.base}/send`,t))}async hubTokenRequest(t){let e=t.tokenType??"project",n=t.personalToken;return e==="personal"&&!n&&(n=this.ls.get(hn.token.hubV2PersonalToken,"").trim()||void 0),await j(this.http.post(`${this.base}/hub-token/request`,{projectId:t.projectId,tokenType:e,path:t.path,method:t.method??"GET",query:t.query,body:t.payload,headers:t.headers,personalToken:n}))}async listHistory(t,e){let n=new de().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/history`,n))}async listEnvs(t,e){let n=new de().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/envs`,n))}async saveEnv(t,e,n){return await j(this.http.post(`${this.base}/envs`,{scope:t,projectId:e,env:n}))}async deleteEnv(t,e,n){let i=new de().set("scope",e);return n&&(i=i.set("projectId",n)),await j(this.http.delete(`${this.base}/envs/${t}`,i))}async listCollections(t,e){let n=new de().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/collections`,n))}async createCollection(t){return await j(this.http.post(`${this.base}/collections`,t))}async updateCollection(t,e,n,i){let r=new de().set("scope",n).set("projectId",i??"");return await j(this.http.post(`${this.base}/collections/${t}`,e,r))}async deleteCollection(t,e,n){let i=new de().set("scope",e).set("projectId",n??"");return await j(this.http.delete(`${this.base}/collections/${t}`,i))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=me({token:o,factory:o.\u0275fac,providedIn:"root"})};var Yi=o=>({$implicit:o,level:0}),Xi=(o,t)=>({$implicit:o,level:t}),jn=(o,t)=>t.key;function eo(o,t){if(o&1&&(a(0,"div",8),g(1),s()),o&2){let e=p(2);l(),I(e.nameErr())}}function to(o,t){if(o&1){let e=y();a(0,"label",5),g(1,"\u540D\u79F0"),s(),a(2,"nz-input-wrapper")(3,"input",6),m("ngModelChange",function(i){d(e);let r=p();return u(r.name.set(i))}),s(),f(4,"nz-icon",7),s(),x(5,eo,2,1,"div",8)}if(o&2){let e=p();l(3),_("ngModel",e.name()),l(),_("nzType",e.iconForKind()),l(),T(e.nameErr()?5:-1)}}function no(o,t){if(o&1&&Re(0,12),o&2){let e=t.$implicit;p(2);let n=G(9);_("ngTemplateOutlet",n)("ngTemplateOutletContext",He(2,Yi,e))}}function io(o,t){o&1&&(a(0,"div",13),g(1,"\u6682\u65E0\u76EE\u5F55"),s())}function oo(o,t){if(o&1&&(a(0,"div",8),g(1),s()),o&2){let e=p(2);l(),I(e.moveErr())}}function ro(o,t){if(o&1){let e=y();a(0,"div",9)(1,"div",10),m("click",function(){d(e);let i=p();return u(i.select(null))}),f(2,"nz-icon",11),a(3,"span"),g(4,"\u6839\u76EE\u5F55"),s()(),S(5,no,1,4,"ng-container",12,jn),x(7,io,2,0,"div",13),s(),x(8,oo,2,1,"div",8)}if(o&2){let e=p();l(),Z("selected",e.selectedKey()===null),l(4),N(e.filteredNodes()),l(2),T(e.filteredNodes().length?-1:7),l(),T(e.moveErr()?8:-1)}}function ao(o,t){if(o&1&&Re(0,12),o&2){let e=t.$implicit,n=p(2).level;p();let i=G(9);_("ngTemplateOutlet",i)("ngTemplateOutletContext",nn(2,Xi,e,n+1))}}function so(o,t){if(o&1&&S(0,ao,1,5,"ng-container",12,jn),o&2){let e=p().$implicit;N(e.children)}}function lo(o,t){if(o&1){let e=y();a(0,"div",14),m("click",function(){let i=d(e).$implicit,r=p();return u(r.select(i.key))}),a(1,"button",15),m("click",function(i){let r=d(e).$implicit;return p().toggle(r.key),u(i.stopPropagation())}),f(2,"nz-icon",16),s(),f(3,"nz-icon",17),a(4,"span",18),g(5),s()(),x(6,so,2,0)}if(o&2){let e=t.$implicit,n=t.level,i=p();Xt("padding-left",8+n*16,"px"),Z("selected",i.selectedKey()===e.key),l(),_("disabled",!(e.children!=null&&e.children.length)),l(),_("nzType",e.children!=null&&e.children.length?i.expanded(e.key)?"down":"right":"minus"),l(),_("nzType",e.kind==="folder"?"folder":"database"),l(2),I(e.title),l(),T(((e.children==null?null:e.children.length)??0)&&i.expanded(e.key)?6:-1)}}function co(o){return o?`c:${o}`:null}function po(o){return o&&o.startsWith("c:")?o.slice(2):null}var qe=class o{data=A(dn);modalRef=A(nt);q=M("");name=M("");selectedKey=M(null);expandedMap=M({});mode=h(()=>this.data.mode??this.data.handleType);showParentPicker=h(()=>this.mode()==="move"||this.mode()==="pick");showName=h(()=>this.mode()==="create"||this.mode()==="rename");iconForKind=h(()=>{let t=this.data.kind??this.data.createBody?.kind??"collection";return t==="folder"?"folder":t==="request"?"api":"database"});ngOnInit(){let t=this.mode();if(t==="create"){let r=this.data.createBody;this.name.set(r?.name??""),this.selectedKey.set(null);return}if(t==="rename"||t==="update"){let r=this.data;this.name.set(r?.initialName??""),this.selectedKey.set(null);return}let e=this.data.initialParentId;this.selectedKey.set(e?e.startsWith("c:")?e:co(e):null);let n=this.data.nodes??[],i={};for(let r of n)i[r.key]=!0;this.expandedMap.set(i)}expanded(t){return!!this.expandedMap()[t]}toggle(t){let e=v({},this.expandedMap());e[t]=!e[t],this.expandedMap.set(e)}select(t){this.selectedKey.set(t)}forbiddenKeys=h(()=>{if(this.mode()!=="move"||this.mode()!=="pick")return new Set;let t=this.data.target;if(!t||t.kind==="request")return new Set;let e=`c:${t.id}`,n=new Set([e]),i=this.data.nodes??[],r=C=>{for(let z of C.children??[])z.kind!=="request"&&(n.add(z.key),r(z))},c=C=>{for(let z of C)z.key===e?r(z):z.children?.length&&c(z.children)};return c(i),n});nodesForPicker=h(()=>{let t=(this.data.nodes??[]).filter(i=>i.kind!=="request"),e=this.forbiddenKeys(),n=i=>{let r=[];for(let c of i){if(c.kind==="request"||e.has(c.key))continue;let C=n(c.children??[]);r.push(w(v({},c),{children:C}))}return r};return n(t)});filteredNodes=h(()=>{if(!this.showParentPicker())return[];let t=this.q().trim().toLowerCase();if(!t)return this.nodesForPicker();let e=C=>(C.title??"").toLowerCase().includes(t),n=C=>{let z=[];for(let J of C){let ue=n(J.children??[]);(e(J)||ue.length)&&z.push(w(v({},J),{children:ue}))}return z},i=n(this.nodesForPicker()),r=v({},this.expandedMap()),c=C=>{for(let z of C)z.children?.length&&(r[z.key]=!0),z.children?.length&&c(z.children)};return c(i),this.expandedMap.set(r),i});nameErr=h(()=>{if(!this.showName())return"";let t=(this.name()??"").trim();return t?t.length>50?"\u540D\u79F0\u8FC7\u957F\uFF08<= 50\uFF09":"":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"});moveErr=h(()=>(this.showParentPicker(),""));canSubmit=h(()=>this.showName()&&this.nameErr()?!1:(this.showParentPicker(),!0));ok(){let t=this.mode();if(t==="rename"||t==="update"){let n={name:(this.name()??"").trim()};this.modalRef.close(n);return}if(t==="create"){let n=this.data.createBody,i=w(v({},n),{name:(this.name()??"").trim(),parentId:n.parentId??null});this.modalRef.close(i);return}let e=po(this.selectedKey());this.modalRef.close({parentId:e})}cancel(){this.modalRef.close(null)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-collection-modal"]],decls:10,vars:3,consts:[["nodeTpl",""],[1,"modal-body"],[1,"footer"],["nz-button","",3,"click"],["nz-button","","nzType","primary",3,"click","disabled"],[1,"label"],["nz-input","","placeholder","\u8BF7\u8F93\u5165\u540D\u79F0","autofocus","",3,"ngModelChange","ngModel"],["nzInputPrefix","","nzTheme","outline",3,"nzType"],[1,"hint","err"],[1,"picker"],[1,"row","root",3,"click"],["nzType","home"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"empty"],[1,"row",3,"click"],["nz-button","","nzType","text","nzSize","small",1,"chev",3,"click","disabled"],[3,"nzType"],[1,"icon",3,"nzType"],[1,"title"]],template:function(e,n){if(e&1){let i=y();a(0,"div",1),x(1,to,6,3),x(2,ro,9,4),s(),a(3,"div",2)(4,"button",3),m("click",function(){return d(i),u(n.cancel())}),g(5,"\u53D6\u6D88"),s(),a(6,"button",4),m("click",function(){return d(i),u(n.ok())}),g(7," \u786E\u5B9A "),s()(),Y(8,lo,7,9,"ng-template",null,0,ee)}e&2&&(l(),T(n.showName()?1:-1),l(),T(n.showParentPicker()?2:-1),l(4),_("disabled",!n.canSubmit()))},dependencies:[k,tt,R,L,F,B,K,U,Ce,ot,q,P,D,Q,$,W],styles:[".modal-body[_ngcontent-%COMP%]{display:grid;gap:12px}.label[_ngcontent-%COMP%]{font-weight:600}.hint[_ngcontent-%COMP%]{font-size:12px;opacity:.75}.hint.err[_ngcontent-%COMP%]{color:#cf1322;opacity:1}.picker[_ngcontent-%COMP%]{max-height:52vh;overflow:auto;border:1px solid rgba(0,0,0,.08);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:6px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px;border-radius:10px;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s;border:1px solid transparent}.row[_ngcontent-%COMP%]:hover{background:#0000000a}.row.selected[_ngcontent-%COMP%]{background:#00000014;border-color:#00000014}.row.root[_ngcontent-%COMP%]{font-weight:600}.chev[_ngcontent-%COMP%]{flex:0 0 auto}.chev[_ngcontent-%COMP%] nz-icon[_ngcontent-%COMP%]{font-size:12px;transition:transform .15s}.icon[_ngcontent-%COMP%]{opacity:.75}.title[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}.footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}"]})};var wt=class o{modal=A(Ie);async createCollection(t){let e=this.modal.create({nzTitle:t.kind==="folder"?"\u65B0\u5EFA\u76EE\u5F55":"\u65B0\u5EFA\u96C6\u5408",nzContent:qe,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"create",createBody:t.createBody,nodes:t.nodes}});return await j(e.afterClose)}async renameCollection(t){let e=this.modal.create({nzTitle:"\u91CD\u547D\u540D",nzContent:qe,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"rename",kind:t.kind,nodes:t.nodes,targetId:t.targetId,initialName:t.initialName}});return await j(e.afterClose)}async moveTarget(t){let e=this.modal.create({nzTitle:"\u79FB\u52A8\u5230",nzContent:qe,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"move",nodes:t.nodes,target:t.target,initialParentId:t.initialParentId??null}});return await j(e.afterClose)}async pickCollection(t){let e=this.modal.create({nzTitle:"\u9009\u62E9\u96C6\u5408/\u76EE\u5F55",nzContent:qe,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"pick",nodes:t.nodes}});return await j(e.afterClose)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=me({token:o,factory:o.\u0275fac,providedIn:"root"})};var Ee=class o{api=A(Tt);msg=A(Se);projectContext=A(yn);collectionModal=A(wt);tabStore=A(xt);scope=M("project");loading=M(!1);q=M("");sending=this.tabStore.sending;requests=M([]);activeRequestId=h(()=>this.tabStore.activeTab()?.requestId??null);collections=M([]);activeCollectionId=M(null);nodes=h(()=>Jt(this.collections(),this.requests(),"").filter(t=>t.kind!=="request"));filteredNodes=h(()=>{let t=this.q().toLowerCase();return Jt(this.collections(),this.requests(),t??"")});historyOpen=M(!1);historyLoading=M(!1);histories=M([]);envs=M([]);envLoading=M(!1);activeEnvId=M(null);lastResult=this.tabStore.activeResponse;projectId=h(()=>this.projectContext.currentProject()?.id??"");activeRequest=this.tabStore.activeRequest;tabs=this.tabStore.tabs;activeTabId=this.tabStore.activeTabId;activeTab=this.tabStore.activeTab;canOpenMore=this.tabStore.canOpenMore;activeEnv=h(()=>{let t=this.activeEnvId();return t?this.envs().find(e=>e.id===t)??null:null});envVarRecord=h(()=>{let t=this.activeEnv();return t?Vn(t.variables):{}});collectionPath=h(()=>{let t=this.activeCollectionId();if(!t)return null;let e=this.collections().find(r=>r.id===t);if(!e)return null;let n=[],i=`${e.id}`;for(;i;){let r=this.collections().find(c=>c.id===i);r?(n.unshift(r.name||"\u672A\u547D\u540D"),i=r.parentId?`${r.parentId}`:null):i=null}return n.join(" / ")});projectCtx=h(()=>{let t=this.projectContext.currentProject();return t?{scope:"project",projectId:t.id}:null});constructor(){We(()=>{this.scope()!=="project"||!this.projectId()||this.loadAll()}),We(()=>{if(this.scope()!=="project"){this.loadEnvs();return}this.projectId()&&this.loadEnvs()})}async loadAll(){let t=this.projectCtx();if(t){this.loading.set(!0);try{let[e,n]=await Promise.all([this.api.listCollections(t.scope,t.projectId),this.api.listRequests(t.scope,t.projectId)]);this.collections.set(e??[]),this.requests.set(n??[])}finally{this.loading.set(!1)}}}async reloadCollections(){let t=this.projectCtx();if(!t)return;let e=await this.api.listCollections(t.scope,t.projectId);this.collections.set(e??[])}async reloadRequests(){let t=this.projectCtx();if(!t)return;let e=await this.api.listRequests(t.scope,t.projectId);this.requests.set(e??[])}async loadRequests(){let t=this.projectCtx();if(t){this.loading.set(!0);try{let e=await this.api.listRequests(t.scope,t.projectId);this.requests.set(e);let n=this.activeRequestId();if(n&&e.some(i=>i.id===n))return;e.length?this.selectRequest(e[0].id):this.newTab()}catch(e){this.msg.error(e?.message??"\u52A0\u8F7D\u8BF7\u6C42\u5931\u8D25")}finally{this.loading.set(!1)}}}selectRequest(t){let e=this.requests().find(n=>n.id===t)||null;e&&(this.tabStore.openRequestInTab(e,t),this.activeCollectionId.set(e.collectionId??null))}switchTab(t){this.tabStore.switchTab(t);let e=this.tabStore.getTab(t);e?.request.collectionId&&this.activeCollectionId.set(e.request.collectionId)}closeTab(t){this.tabStore.closeTab(t)}newTab(t){try{this.tabStore.openNewTab(t),this.activeCollectionId.set(t??null)}catch(e){this.msg.warning(e.message)}}renameTab(t,e){this.tabStore.renameTab(t,e)}reorderTabs(t,e){this.tabStore.reorderTabs(t,e)}handleTabContextMenu(t){switch(t.action){case"close":this.closeTab(t.tabId);break;case"closeOthers":this.tabStore.closeOtherTabs(t.tabId);break;case"closeRight":this.tabStore.closeRightTabs(t.tabId);break;case"closeSaved":this.tabStore.closeSavedTabs();break;case"closeAll":this.tabStore.closeAllTabs();break;case"rename":break;case"duplicate":try{this.tabStore.duplicateTab(t.tabId),this.msg.success("\u5DF2\u590D\u5236\u8BF7\u6C42")}catch(i){this.msg.warning(i.message)}break;case"copyUrl":let e=this.tabStore.getTabUrl(t.tabId);e&&navigator.clipboard.writeText(e).then(()=>{this.msg.success("URL \u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F")}).catch(()=>{this.msg.error("\u590D\u5236\u5931\u8D25")});break;case"moveTo":let n=this.tabStore.getTab(t.tabId);n?.requestId&&this.moveCollection(n.requestId,"request");break}}selectCollection(t){this.activeCollectionId.set(t)}async newCollection(t){let e=this.projectCtx();if(!e)return;let n={scope:e.scope,projectId:e.projectId,name:t.name??"",kind:t.kind??"collection",parentId:t.parentId??null},i=this.nodes(),r=await this.collectionModal.createCollection({createBody:n,nodes:i,kind:n.kind,initialParentId:n.parentId??null});if(r){let c=await this.api.createCollection(r);this.msg.success("\u521B\u5EFA\u6210\u529F"),this.collections.update(C=>[...C,c]),this.activeCollectionId.set(c.id)}}async deleteCollection(t,e){if(e==="request"){this.removeRequest(t);return}if(await this.api.deleteCollection(t,this.scope(),this.projectId()),this.msg.success("\u5DF2\u5220\u9664"),this.collections.update(n=>n.filter(i=>i.id!==t)),this.activeCollectionId()===t){let n=this.collections()[0];this.activeCollectionId.set(n?.id??null)}}async moveCollection(t,e){let n="";if(e=="request"){let c=this.requests().find(C=>C.id===t);if(!c){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}n=c.collectionId??""}else{let c=this.collections().find(C=>C.id===t);if(!c){this.msg.error("\u96C6\u5408\u4E0D\u5B58\u5728");return}n=c.parentId??""}let i=this.nodes(),{parentId:r}=await this.collectionModal.moveTarget({nodes:i,target:{kind:e,id:t},initialParentId:n})||{};if(r!==void 0)if(e==="request"){let c=this.requests().find(J=>J.id===t);if(!c){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}let C={collectionId:r??null,id:c.id};c.collectionId=r??null,await this.api.updateRequest(this.scope(),this.projectId(),C),this.requests.update(J=>J.map(ue=>ue.id===t?w(v({},ue),{collectionId:r??null}):ue)),this.tabs().find(J=>J.requestId===t)&&this.tabStore.updateActiveRequest({collectionId:r??null}),this.msg.success("\u4FEE\u6539\u6210\u529F")}else{let c={parentId:r??null},C=await this.api.updateCollection(t,c,this.scope(),this.projectId());this.collections.update(z=>z.map(J=>J.id===t?C:J)),this.activeCollectionId.set(C.id),this.msg.success("\u4FEE\u6539\u6210\u529F")}}async renameCollection(t,e){let n="";if(e=="request"){let c=this.requests().find(C=>C.id===t);if(!c){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}n=c.name??""}else{let c=this.collections().find(C=>C.id===t);if(!c){this.msg.error("\u96C6\u5408\u4E0D\u5B58\u5728");return}n=c.name??""}let i=this.nodes(),r=await this.collectionModal.renameCollection({nodes:i,kind:e,targetId:t,initialName:n});if(r)if(e==="request")await this.api.updateRequest(this.scope(),this.projectId(),{id:t,name:r.name}),this.requests.update(c=>c.map(C=>C.id===t?w(v({},C),{name:r.name??C.name}):C)),this.msg.success("\u4FEE\u6539\u6210\u529F"),this.reloadRequests();else{let c=await this.api.updateCollection(t,r,this.scope(),this.projectId());this.collections.update(C=>C.map(z=>z.id===t?c:z)),this.msg.success("\u4FEE\u6539\u6210\u529F"),this.reloadCollections()}}newRequest(t={}){let e=this.projectId();if(this.scope()==="project"&&!e){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u9879\u76EE");return}this.newTab(t.collectionId)}patchActive(t){this.tabStore.updateActiveRequest(t)}async saveActive(){let t=this.activeRequest();if(!t)return;let e=this.scope(),n=e==="project"?this.projectId():void 0;if(e==="project"&&!n)throw new Error("projectId missing");if(!t.name?.trim()){this.msg.warning("\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return}if(!t.url?.trim()){this.msg.warning("URL \u4E0D\u80FD\u4E3A\u7A7A");return}if(!t.collectionId){let i=this.nodes(),{parentId:r}=await this.collectionModal.pickCollection({nodes:i})||{};t.collectionId=r??null,this.tabStore.updateActiveRequest({collectionId:t.collectionId})}this.loading.set(!0);try{let i=await this.api.saveRequest(e,n,t);this.msg.success("\u5DF2\u4FDD\u5B58"),this.tabStore.markActiveSaved(i.id),await this.loadRequests()}catch(i){this.msg.error(i?.message??"\u4FDD\u5B58\u5931\u8D25")}finally{this.loading.set(!1)}}async sendActive(){let t=this.activeRequest();t&&await this.sendResolvedRequest(t)}async sendHubV2Issues(){let t=this.projectContext.currentProject();if(!t?.id){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u9879\u76EE");return}let e=Date.now();this.tabStore.setSending(!0),this.tabStore.updateActiveResponse(null);try{let n=await this.api.hubTokenRequest({projectId:t.id,path:"/issues",method:"GET",query:{page:1,pageSize:20}}),i=JSON.stringify(n,null,2),r=Date.now();this.tabStore.updateActiveResponse({historyId:`hub_token_${r}`,response:{status:200,statusText:"OK",headers:{"content-type":"application/json; charset=utf-8"},bodyText:i,bodySize:i.length},metrics:{startedAt:e,endedAt:r,durationMs:r-e}}),this.msg.success(`Hub Issues \u8BF7\u6C42\u6210\u529F (${Date.now()-e}ms)`)}catch(n){let i=Date.now();this.tabStore.updateActiveResponse({historyId:`hub_token_${i}`,error:{code:"HUB_TOKEN_REQUEST_ERROR",message:n?.message??"Hub Issues \u8BF7\u6C42\u5931\u8D25"},metrics:{startedAt:e,endedAt:i,durationMs:i-e}}),this.msg.error(n?.message??"Hub Issues \u8BF7\u6C42\u5931\u8D25")}finally{this.tabStore.setSending(!1)}}async removeRequest(t){await this.api.deleteRequest(t,this.scope(),this.projectId()),this.msg.success("\u5DF2\u5220\u9664");let e=this.requests().filter(i=>i.id!==t);this.requests.set(e);let n=this.tabs().find(i=>i.requestId===t);n&&this.tabStore.closeTab(n.id)}ensureKvId(t){return t.map(e=>(e.id||(e.id=(0,Ln.uniqueId)()),e))}openHistory(){this.historyOpen.set(!0),this.loadHistory()}closeHistory(){this.historyOpen.set(!1)}async loadHistory(){this.historyLoading.set(!0);try{let t=await this.api.listHistory(this.scope(),this.projectId());this.histories.set(t)}finally{this.historyLoading.set(!1)}}async replayHistory(t){this.tabStore.openRequestInTab(t.requestSnapshot),await this.sendResolvedRequest(t.requestSnapshot)}async sendResolvedRequest(t){let e=this.scope(),n=e==="project"?this.projectId():void 0;if(e==="project"&&!n){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u9879\u76EE");return}this.tabStore.setSending(!0),this.tabStore.updateActiveResponse(null);try{let i=await this.api.send({scope:e,projectId:n||void 0,request:t,envId:this.activeEnvId()??void 0,projectRoot:this.projectContext.currentProject()?.root});this.tabStore.updateActiveResponse(i),i.error?this.msg.error(`${i.error.code}: ${i.error.message}`):this.msg.success(`HTTP ${i.response?.status??""} (${i.metrics.durationMs}ms)`)}catch(i){this.msg.error(i?.message??"\u53D1\u9001\u5931\u8D25")}finally{this.tabStore.setSending(!1)}}async loadEnvs(){let t=this.scope(),e=t==="project"?this.projectId():void 0;if(!(t==="project"&&!e)){this.envLoading.set(!0);try{let n=await this.api.listEnvs(t,e);this.envs.set(n);let i=this.activeEnvId();if(i&&n.some(r=>r.id===i))return;this.activeEnvId.set(n[0]?.id??null)}finally{this.envLoading.set(!1)}}}setActiveEnv(t){this.activeEnvId.set(t)}async saveEnv(t){let e=this.scope(),n=e==="project"?this.projectId():void 0;await this.api.saveEnv(e,n||void 0,t),await this.loadEnvs()}async deleteEnv(t){await this.api.deleteEnv(t,this.scope(),this.projectId()),this.activeEnvId()===t&&this.activeEnvId.set(null),await this.loadEnvs()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=me({token:o,factory:o.\u0275fac,providedIn:"root"})};var uo=["class","component"],mo=(o,t)=>t.id;function go(o,t){if(o&1){let e=y();a(0,"div",9),m("click",function(){let i=d(e).$implicit,r=p();return u(r.selectEditEnv(i.id))}),a(1,"div",10),g(2),s(),a(3,"div",11),g(4),s()()}if(o&2){let e,n=t.$implicit,i=p();Z("active",n.id===((e=i.draft())==null?null:e.id)),l(2),I(n.name),l(2),X("",n.variables.length," vars")}}function _o(o,t){o&1&&(a(0,"div",6),g(1,"\u6682\u65E0\u73AF\u5883"),s())}function Co(o,t){o&1&&(a(0,"div",6),g(1,"\u9009\u62E9\u4E00\u4E2A\u73AF\u5883\u8FDB\u884C\u7F16\u8F91"),s())}function fo(o,t){if(o&1){let e=y();a(0,"div",8)(1,"div",12)(2,"div",13),g(3,"\u540D\u79F0"),s(),a(4,"input",14),m("ngModelChange",function(i){d(e);let r=p();return u(r.setName(i))}),s()(),a(5,"div",12)(6,"div",13),g(7,"\u524D\u7F6EURL"),s(),a(8,"input",14),m("ngModelChange",function(i){d(e);let r=p();return u(r.setBaseUrl(i))}),s()(),a(9,"div",15)(10,"app-kv-table",16),m("rowsChange",function(i){d(e);let r=p();return u(r.varsRows.set(i))}),s()(),a(11,"div",17)(12,"button",3),m("click",function(){d(e);let i=p();return u(i.save())}),g(13,"\u4FDD\u5B58"),s(),a(14,"button",18),m("nzOnConfirm",function(){d(e);let i=p();return u(i.remove())}),g(15," \u5220\u9664 "),s(),a(16,"button",19),m("click",function(){d(e);let i=p();return u(i.useThisEnv())}),g(17,"\u8BBE\u4E3A\u5F53\u524D"),s()()()}if(o&2){let e=p();l(4),_("ngModel",e.draft().name),l(4),_("ngModel",e.draft().baseUrl),l(2),_("rows",e.varsRows())}}function $n(){return Date.now()}function ho(o){let t=Math.random().toString(16).slice(2,10);return`${o}_${t}_${Date.now().toString(16)}`}var Mt=class o{envChange=new b;store=A(Ee);modalRef=A(nt);msg=A(Se);draft=M(null);varsRows=M([]);selectEditEnv(t){this.store.activeEnvId.set(t);let e=this.store.envs().find(n=>n.id===t);e&&(this.draft.set(w(v({},e),{variables:e.variables})),this.varsRows.set(Wt(e.variables)))}createEnv(){let t=$n(),e={id:ho("env"),scope:"project",name:"\u672A\u547D\u540D\u73AF\u5883",variables:[],createdAt:t,updatedAt:t};this.draft.set(e),this.varsRows.set(Wt(e.variables))}setName(t){let e=this.draft();e&&this.draft.set(w(v({},e),{name:t}))}setBaseUrl(t){let e=this.draft();e&&this.draft.set(w(v({},e),{baseUrl:t}))}async save(){let t=this.draft();if(!t)return;let e=w(v({},t),{variables:Kn(this.varsRows(),t.variables),updatedAt:$n()});await this.store.saveEnv(e),this.store.activeEnvId.set(e.id),this.msg.success("\u73AF\u5883\u53D8\u91CF\u4FDD\u5B58\u6210\u529F"),this.draft.set(e)}async remove(){let t=this.store.activeEnvId();t&&(await this.store.deleteEnv(t),this.store.activeEnvId.set(null),this.draft.set(null),this.varsRows.set([]),this.msg.success("\u73AF\u5883\u53D8\u91CF\u5220\u9664\u6210\u529F"))}useThisEnv(){let t=this.store.activeEnvId();t&&this.store.setActiveEnv(t)}close(){this.modalRef.close()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-env-modal",8,"component"]],outputs:{envChange:"envChange"},attrs:uo,decls:12,vars:2,consts:[[1,"drawer"],[1,"left"],[1,"toolbar"],["nz-button","","nzType","primary",3,"click"],[1,"env-list"],[1,"env-item",3,"active"],[1,"empty"],[1,"right"],[1,"form"],[1,"env-item",3,"click"],[1,"name"],[1,"meta"],[1,"row"],[1,"label"],["nz-input","",3,"ngModelChange","ngModel"],[1,"vars"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","TOKEN","valuePlaceholder","xxx",3,"rowsChange","rows"],[1,"actions"],["nz-button","","nzType","default","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u8BA4\u5220\u9664\u8BE5\u73AF\u5883\uFF1F",3,"nzOnConfirm"],["nz-button","","nzType","default",3,"click"]],template:function(e,n){if(e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),m("click",function(){return n.createEnv()}),g(4,"\u65B0\u5EFA"),s()(),a(5,"div",4),S(6,go,5,4,"div",5,mo),x(8,_o,2,0,"div",6),s()(),a(9,"div",7),x(10,Co,2,0,"div",6)(11,fo,18,3,"div",8),s()()),e&2){let i;l(6),N(n.store.envs()),l(2),T(n.store.envs().length?-1:8),l(2),T((i=n.draft())!=null&&i.id?11:10)}},dependencies:[k,R,L,F,B,ze,q,P,D,Q,K,U,Ne,st],styles:[".drawer[_ngcontent-%COMP%]{display:grid;grid-template-columns:180px 1fr;gap:12px;height:100%}.left[_ngcontent-%COMP%]{border-right:1px solid #f0f0f0;padding-right:12px}.toolbar[_ngcontent-%COMP%]{padding-bottom:10px}.env-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.env-item[_ngcontent-%COMP%]{padding:8px;border:1px solid #f0f0f0;border-radius:8px;cursor:pointer}.env-item.active[_ngcontent-%COMP%]{background:#f5f5f5}.name[_ngcontent-%COMP%]{font-weight:600}.meta[_ngcontent-%COMP%]{font-size:12px;opacity:.7}.right[_ngcontent-%COMP%]{min-width:0}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:70px 1fr;gap:10px;align-items:center;margin-bottom:10px}.label[_ngcontent-%COMP%]{font-size:14px;opacity:.8}.vars[_ngcontent-%COMP%]{height:420px}.actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-top:12px}"]})};var vo=(o,t)=>t.id;function bo(o,t){if(o&1&&f(0,"nz-option",2),o&2){let e=t.$implicit;_("nzValue",e.id)("nzLabel",e.name)}}var zt=class o{store=A(Ee);modalService=A(Ie);openEnvModal(){let t=this.modalService.create({nzTitle:"\u73AF\u5883\u53D8\u91CF",nzFooter:null,nzMaskClosable:!1,nzContent:Mt,nzWidth:"1020px",nzCentered:!0});t.afterOpen.subscribe(()=>{let e=t.getContentComponent();e&&this.store.activeEnvId()?e.selectEditEnv(this.store.activeEnvId()??""):e.createEnv()})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-env-picker"]],decls:6,vars:3,consts:[[1,"picker"],[1,"sel",3,"ngModelChange","nzPlaceHolder","ngModel","nzAllowClear"],[3,"nzValue","nzLabel"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u7BA1\u7406\u73AF\u5883\u53D8\u91CF",3,"click"],["nzType","setting","nzTheme","outline"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"nz-select",1),m("ngModelChange",function(r){return n.store.setActiveEnv(r)}),S(2,bo,1,2,"nz-option",2,vo),s(),a(4,"button",3),m("click",function(){return n.openEnvModal()}),f(5,"nz-icon",4),s()()),e&2&&(l(),_("nzPlaceHolder","Env")("ngModel",n.store.activeEnvId())("nzAllowClear",!0),l(),N(n.store.envs()))},dependencies:[k,R,F,B,re,ve,be,q,P,D,it,K,he,fe,$,W,Ne],styles:[".picker[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.sel[_ngcontent-%COMP%]{width:160px}"]})};var Et=class o{options;optionsChange=new b;timeoutMs=h(()=>this.options?.timeoutMs??3e4);followRedirects=h(()=>this.options?.followRedirects??!0);insecureTLS=h(()=>this.options?.insecureTLS??!1);proxy=h(()=>this.options?.proxy??"");emit(t){this.optionsChange.emit(t)}setTimeout(t){let e=Number(t);this.emit(w(v({},this.options??{}),{timeoutMs:isNaN(e)?void 0:e}))}setFollowRedirects(t){this.emit(w(v({},this.options??{}),{followRedirects:t}))}setInsecureTLS(t){this.emit(w(v({},this.options??{}),{insecureTLS:t}))}setProxy(t){this.emit(w(v({},this.options??{}),{proxy:t||void 0}))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-advanced-editor"]],inputs:{options:"options"},outputs:{optionsChange:"optionsChange"},decls:25,vars:4,consts:[[1,"wrap"],[1,"grid"],[1,"row"],[1,"label"],["nz-input","","type","number","min","0","placeholder","30000",3,"ngModelChange","ngModel"],[1,"desc"],[1,"row","checkbox"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-input","","placeholder","http://127.0.0.1:7890",3,"ngModelChange","ngModel"],[1,"desc","muted"],["nzType","info","nzShowIcon","","nzMessage","\u8BF4\u660E\uFF1AProxy \u914D\u7F6E\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5F53\u524D NodeHttpClient \u5C1A\u672A\u5B9E\u73B0\u4EE3\u7406\u652F\u6301\uFF0C\u8BF7\u52FF\u4F9D\u8D56\u8BE5\u9009\u9879\u8FDB\u884C\u8C03\u8BD5\u3002"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),g(4,"Timeout (ms)"),s(),a(5,"input",4),m("ngModelChange",function(r){return n.setTimeout(r)}),s(),a(6,"div",5),g(7,"\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF080 \u8868\u793A\u4E0D\u8D85\u65F6\uFF09"),s()(),a(8,"div",6)(9,"label",7),m("ngModelChange",function(r){return n.setFollowRedirects(r)}),g(10," Follow Redirects "),s(),a(11,"div",5),g(12,"\u662F\u5426\u81EA\u52A8\u8DDF\u968F HTTP \u91CD\u5B9A\u5411\uFF08302 / 301\uFF09"),s()(),a(13,"div",6)(14,"label",7),m("ngModelChange",function(r){return n.setInsecureTLS(r)}),g(15," Insecure TLS "),s(),a(16,"div",5),g(17,"\u8DF3\u8FC7 TLS \u8BC1\u4E66\u6821\u9A8C\uFF08\u4EC5\u5728 Node \u73AF\u5883\u4E0B\u5C3D\u529B\u652F\u6301\uFF09"),s()(),a(18,"div",2)(19,"div",3),g(20,"Proxy"),s(),a(21,"input",8),m("ngModelChange",function(r){return n.setProxy(r)}),s(),a(22,"div",9),g(23,"\u4EE3\u7406\u5730\u5740\uFF08\u5F53\u524D\u7248\u672C\u4EC5\u4FDD\u5B58\uFF0C\u4E0D\u53C2\u4E0E\u5B9E\u9645\u8BF7\u6C42\uFF09"),s()(),f(24,"nz-alert",10),s()()),e&2&&(l(5),_("ngModel",n.timeoutMs()),l(4),_("ngModel",n.followRedirects()),l(5),_("ngModel",n.insecureTLS()),l(7),_("ngModel",n.proxy()))},dependencies:[k,R,L,_n,F,Cn,B,ut,dt,K,U,Fe,Oe],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:240px}.grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:center;gap:10px}.row.checkbox[_ngcontent-%COMP%]{grid-template-columns:1fr}.label[_ngcontent-%COMP%]{font-size:12px;opacity:.8}.desc[_ngcontent-%COMP%]{grid-column:2 / span 1;font-size:12px;opacity:.65}.row.checkbox[_ngcontent-%COMP%] .desc[_ngcontent-%COMP%]{grid-column:1 / span 1;margin-left:24px}.muted[_ngcontent-%COMP%]{color:#999}"]})};var Gt=()=>[];function xo(o,t){if(o&1){let e=y();a(0,"div",3)(1,"div",4),g(2,"Path \u53C2\u6570"),s(),a(3,"app-kv-table",14),m("rowsChange",function(i){d(e);let r=p();return u(r.patch.emit({pathParams:i}))}),s()()}if(o&2){let e=p();l(3),_("keepTrailingBlank",!1)("rows",(e.req==null?null:e.req.pathParams)||et(2,Gt))}}var kt=class o{req=null;patch=new b;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-request-tabs"]],inputs:{req:"req"},outputs:{patch:"patch"},decls:20,vars:8,consts:[[1,"tabs"],["nzTitle","Params"],[1,"tab"],[1,"item"],[1,"title"],["keyLabel","\u53C2\u6570\u540D","valueLabel","\u53C2\u6570\u503C","descriptionLabel","\u8BF4\u660E","keyPlaceholder","param","valuePlaceholder","value",3,"rowsChange","rows"],["nzTitle","Headers"],["keyLabel","Header","valueLabel","Value","keyPlaceholder","x-header","valuePlaceholder","value",3,"rowsChange","rows"],["nzTitle","Body"],[3,"bodyChange","body"],["nzTitle","Auth"],[3,"authChange","auth"],["nzTitle","Advanced"],[3,"optionsChange","options"],["keyLabel","\u53C2\u6570\u540D","valueLabel","\u53C2\u6570\u503C","descriptionLabel","\u8BF4\u660E","keyPlaceholder","param","valuePlaceholder","value",3,"rowsChange","keepTrailingBlank","rows"]],template:function(e,n){e&1&&(a(0,"nz-tabs",0)(1,"nz-tab",1)(2,"div",2)(3,"div",3)(4,"div",4),g(5,"Query \u53C2\u6570"),s(),a(6,"app-kv-table",5),m("rowsChange",function(r){return n.patch.emit({query:r})}),s()(),x(7,xo,4,3,"div",3),s()(),a(8,"nz-tab",6)(9,"div",2)(10,"app-kv-table",7),m("rowsChange",function(r){return n.patch.emit({headers:r})}),s()()(),a(11,"nz-tab",8)(12,"div",2)(13,"app-body-editor",9),m("bodyChange",function(r){return n.patch.emit({body:r})}),s()()(),a(14,"nz-tab",10)(15,"div",2)(16,"app-auth-editor",11),m("authChange",function(r){return n.patch.emit({auth:r})}),s()()(),a(17,"nz-tab",12)(18,"div",2)(19,"app-advanced-editor",13),m("optionsChange",function(r){return n.patch.emit({options:r})}),s()()()()),e&2&&(l(6),_("rows",(n.req==null?null:n.req.query)||et(6,Gt)),l(),T(!(n.req==null||n.req.pathParams==null)&&n.req.pathParams.length?7:-1),l(3),_("rows",(n.req==null?null:n.req.headers)||et(7,Gt)),l(3),_("body",n.req==null?null:n.req.body),l(3),_("auth",n.req==null?null:n.req.auth),l(3),_("options",n.req==null?null:n.req.options))},dependencies:[Ve,_t,gt,ze,yt,bt,Et],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0}app-kv-table[_ngcontent-%COMP%]{display:block;height:100%}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;height:100%}.tab[_ngcontent-%COMP%]{height:100%;overflow:hidden auto} nz-tabs.tabs .ant-tabs-content{height:100%} nz-tabs.tabs .ant-tabs-content .ant-tabs-tabpane{height:100%}"]})};function To(o,t){if(o&1&&f(0,"nz-option",2),o&2){let e=t.$implicit;_("nzValue",e)("nzLabel",e)}}function wo(o,t){if(o&1){let e=y();a(0,"div",7)(1,"nz-tag",8),g(2),s(),a(3,"a",9),m("click",function(){d(e);let i=p();return u(i.openEnv())}),g(4,"\u53BB\u914D\u7F6E"),s()()}if(o&2){let e=p();l(2),X(" \u672A\u89E3\u6790\u53D8\u91CF\uFF1A",e.missingVars().join(", ")," ")}}var At=class o{envVars={};openEnv;method="GET";url="";sending=!1;envName=null;baseUrl=null;methodChange=new b;urlChange=new b;urlCommit=new b;send=new b;save=new b;methods=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"];missingVars=h(()=>On([this.draftUrl],this.envVars));draftUrl="";t;ngOnChanges(t){t.url&&(this.draftUrl=this.url??"")}onDraftChange(t){this.draftUrl=t??"",this.t&&window.clearTimeout(this.t),this.t=window.setTimeout(()=>{this.urlChange.emit(this.draftUrl)},250)}commit(){this.t&&(window.clearTimeout(this.t),this.t=void 0),this.urlChange.emit(this.draftUrl),this.urlCommit.emit(this.draftUrl)}placeholder=h(()=>this.baseUrl?'"/"\u5F00\u5934':"http://...");previewUrl=h(()=>{let t=(this.url??"").trim();if(!t||Mo(t))return"";let e=(this.baseUrl??"").trim();if(!e)return"";try{return new URL(t,e).toString()}catch{return""}});static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-request-urlbar"]],inputs:{envVars:"envVars",openEnv:"openEnv",method:"method",url:"url",sending:"sending",envName:"envName",baseUrl:"baseUrl"},outputs:{methodChange:"methodChange",urlChange:"urlChange",urlCommit:"urlCommit",send:"send",save:"save"},features:[ge],decls:11,vars:6,consts:[[1,"bar"],[1,"method",3,"ngModelChange","ngModel"],[1,"m",3,"nzValue","nzLabel"],[1,"url",3,"nzAddonBefore"],["nz-input","",3,"ngModelChange","blur","keydown.enter","placeholder","ngModel"],["nz-button","","nzType","primary",3,"click","nzLoading"],["nz-button","","nzType","default",3,"click"],[1,"var-hint"],["nzColor","warning"],[3,"click"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"nz-select",1),m("ngModelChange",function(r){return n.methodChange.emit(r)}),S(2,To,1,2,"nz-option",2,_e),s(),a(4,"nz-input-wrapper",3)(5,"input",4),m("ngModelChange",function(r){return n.onDraftChange(r)})("blur",function(){return n.commit()})("keydown.enter",function(){return n.commit()}),s()(),a(6,"button",5),m("click",function(){return n.send.emit()}),g(7,"\u53D1\u9001"),s(),a(8,"button",6),m("click",function(){return n.save.emit()}),g(9,"\u4FDD\u5B58"),s()(),x(10,wo,5,1,"div",7)),e&2&&(l(),_("ngModel",n.method),l(),N(n.methods),l(2),_("nzAddonBefore",n.baseUrl?n.baseUrl+" ":void 0),l(),_("placeholder",n.placeholder())("ngModel",n.draftUrl),l(),_("nzLoading",n.sending),l(4),T(n.missingVars().length?10:-1))},dependencies:[k,R,L,F,B,q,P,D,Q,K,U,Ce,re,ve,be,we,Te],styles:[".bar[_ngcontent-%COMP%]{display:flex;gap:10px;padding:10px;border-bottom:1px solid #f0f0f0;align-items:center}.method[_ngcontent-%COMP%]{width:120px}.url[_ngcontent-%COMP%]{flex:1 1 auto}.var-hint[_ngcontent-%COMP%]{padding:4px 10px 8px;font-size:12px;display:flex;gap:8px;align-items:center}"]})};function Mo(o){return/^https?:\/\//i.test(o)}function zo(o,t){if(o&1){let e=y();a(0,"app-request-urlbar",0),m("methodChange",function(i){d(e);let r=p();return u(r.patch.emit({method:i}))})("urlChange",function(i){d(e);let r=p();return u(r.onUrlChange(i))})("urlCommit",function(i){d(e);let r=p();return u(r.onUrlCommit(i))})("send",function(){d(e);let i=p();return u(i.send.emit())})("save",function(){d(e);let i=p();return u(i.save.emit())}),s(),a(1,"div",1)(2,"nz-input-wrapper",2)(3,"input",3),m("ngModelChange",function(i){d(e);let r=p();return u(r.patch.emit({name:i}))}),s()()(),a(4,"app-request-tabs",4),m("patch",function(i){d(e);let r=p();return u(r.patch.emit(i))}),s()}if(o&2){let e=p();_("method",e.request.method)("baseUrl",e.baseUrl)("envVars",e.envVars)("openEnv",e.openEnv)("url",e.request.url)("sending",e.sending),l(2),_("nzAddonBefore",e.collectionPath||"\u672A\u5206\u7C7B"),l(),_("ngModel",e.request.name),l(),_("req",e.request)}}var qt=class o{request=null;sending=!1;envVars={};openEnv;baseUrl=null;patch=new b;send=new b;save=new b;collectionPath=null;methods=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"];onUrlCommit(t){let e=this.request;if(!e)return;let n=Ht(t,e.pathParams),i=Ke(e.url??""),r=Ke(t??"");(i.length!==r.length||i.some((C,z)=>C!==r[z]))&&this.patch.emit({pathParams:n})}onUrlChange(t){let e=this.request;if(!e){this.patch.emit({url:t});return}let n=Ht(t,e.pathParams),i=Ke(e.url??""),r=Ke(t??"");i.length!==r.length||i.some((C,z)=>C!==r[z])?this.patch.emit({url:t,pathParams:n}):this.patch.emit({url:t})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-request-editor"]],inputs:{request:"request",sending:"sending",envVars:"envVars",openEnv:"openEnv",baseUrl:"baseUrl",collectionPath:"collectionPath"},outputs:{patch:"patch",send:"send",save:"save"},decls:1,vars:1,consts:[[3,"methodChange","urlChange","urlCommit","send","save","method","baseUrl","envVars","openEnv","url","sending"],[1,"name"],[3,"nzAddonBefore"],["nz-input","","placeholder","\u672A\u547D\u540D\u63A5\u53E3\u540D\u79F0",3,"ngModelChange","ngModel"],[1,"tabs",3,"patch","req"]],template:function(e,n){e&1&&x(0,zo,5,9),e&2&&T(n.request?0:-1)},dependencies:[k,R,L,F,B,q,K,U,Ce,re,Pe,kt,At],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}.name[_ngcontent-%COMP%]{padding:10px;border-bottom:1px solid #f0f0f0}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;padding:0 10px}app-request-tabs[_ngcontent-%COMP%]{flex:1 1 auto;height:0}"]})};var Rt=class o{clipboard=A(An);curl=null;copy(t){this.clipboard.copy(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-curl-actions"]],inputs:{curl:"curl"},decls:17,vars:5,consts:[["menu","nzDropdownMenu"],[1,"wrap"],["nz-button","","nz-dropdown","","nzType","default","nzTrigger","hover","nzPlacement","bottomCenter",3,"disabled","nzDropdownMenu"],["nzType","copy","nzTheme","outline"],["nz-menu",""],["nz-menu-item",""],["nz-button","","nzType","text",3,"click","disabled"]],template:function(e,n){if(e&1){let i=y();a(0,"div",1)(1,"nz-space")(2,"button",2),f(3,"nz-icon",3),g(4," cURL "),s()(),a(5,"nz-dropdown-menu",null,0)(7,"ul",4)(8,"li",5)(9,"button",6),m("click",function(){return d(i),u(n.copy(n.curl.bash))}),g(10," cURL (Bash) "),s()(),a(11,"li",5)(12,"button",6),m("click",function(){return d(i),u(n.copy(n.curl.powershell))}),g(13," cURL (PS) "),s()(),a(14,"li",5)(15,"button",6),m("click",function(){return d(i),u(n.copy(n.curl.cmd))}),g(16," cURL (CMD) "),s()()()()()}if(e&2){let i=G(6);l(2),_("disabled",!n.curl)("nzDropdownMenu",i),l(7),_("disabled",!(n.curl!=null&&n.curl.bash)),l(3),_("disabled",!(n.curl!=null&&n.curl.powershell)),l(3),_("disabled",!(n.curl!=null&&n.curl.cmd))}},dependencies:[k,qn,an,rn,q,P,D,Q,$,W,pt,xe,ye,zn,ct,En],encapsulation:2})};function ko(o,t){if(o&1&&(a(0,"nz-tag",11),g(1),s(),a(2,"span",4),g(3),s()),o&2){let e,n,i=p();_("nzColor",i.statusColor()),l(),tn(" ",(e=i.response())==null?null:e.status," ",((e=i.response())==null?null:e.statusText)||""," "),l(2),X("",(n=i.response())==null?null:n.bodySize," bytes")}}function Ao(o,t){o&1&&(a(0,"span",4),g(1,"-"),s())}function qo(o,t){o&1&&(a(0,"div",7),f(1,"nz-spin"),s())}function Ro(o,t){if(o&1&&f(0,"nz-alert",8),o&2){let e=p();_("nzMessage",e.error())}}function Io(o,t){o&1&&(a(0,"div",9),g(1,"\u53D1\u9001\u8BF7\u6C42\u540E\u5728\u6B64\u67E5\u770B\u54CD\u5E94"),s())}function So(o,t){if(o&1&&(a(0,"pre",15),g(1),s()),o&2){let e=p(2);l(),I(e.prettyJson())}}function No(o,t){if(o&1&&(a(0,"pre",15),g(1),s()),o&2){let e,n=p(2);l(),I((e=n.response())==null?null:e.bodyText)}}function Do(o,t){if(o&1&&(a(0,"div",18)(1,"div",20),g(2),s(),a(3,"div",21),g(4),s()()),o&2){let e,n=t.$implicit,i=p(2);l(2),I(n),l(2),I((e=i.response())==null||e.headers==null?null:e.headers[n])}}function Po(o,t){if(o&1){let e=y();a(0,"nz-tabs",12),pe("nzSelectedIndexChange",function(i){d(e);let r=p();return ce(r.tabIndex,i)||(r.tabIndex=i),u(i)}),a(1,"nz-tab",13)(2,"div",14),x(3,So,2,1,"pre",15)(4,No,2,1,"pre",15),s()(),a(5,"nz-tab",16)(6,"div",14)(7,"div",17),S(8,Do,5,2,"div",18,_e),s()()(),a(10,"nz-tab",19)(11,"div",14)(12,"pre",15),g(13),s()()()()}if(o&2){let e=p();le("nzSelectedIndex",e.tabIndex),l(3),T(e.isJson()?3:4),l(5),N(e.headerKeys()),l(5),I(e.rawDump())}}var It=class o{sending=!1;result=null;resultSig=M(null);tabIndex=0;ngOnChanges(t){if(t.result){let e=t.result.currentValue;this.resultSig.set(e)}}error=h(()=>{let t=this.resultSig();return t&&t.error?t.error.message:null});curl=h(()=>{let t=this.resultSig();return t&&t.curl?t.curl:null});response=h(()=>{let t=this.resultSig();return t?t.response:null});headerKeys=h(()=>{let t=this.response()?.headers??{};return Object.keys(t).sort((e,n)=>e.localeCompare(n))});statusColor=h(()=>{let t=this.response()?.status??0;return t?t>=200&&t<300?"green":t>=300&&t<400?"blue":t>=400&&t<500?"orange":"red":"default"});isJson=h(()=>{let t=this.response();if(!t)return!1;if((t.headers?.["content-type"]??t.headers?.["Content-Type"]??"").toLowerCase().includes("application/json"))return!0;let n=(t.bodyText??"").trim();return n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]")});prettyJson=h(()=>{let t=(this.response()?.bodyText??"").trim();try{let e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return this.response()?.bodyText??""}});rawDump=h(()=>this.response()?JSON.stringify(this.response(),null,2):"");static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-response-viewer"]],inputs:{sending:"sending",result:"result"},features:[ge],decls:13,vars:3,consts:[[1,"wrap"],[1,"top"],[1,"left"],[1,"title"],[1,"meta"],[1,"right"],[3,"curl"],[1,"loading"],["nzType","error","nzShowIcon","",3,"nzMessage"],[1,"empty"],[1,"tabs",3,"nzSelectedIndex"],[3,"nzColor"],[1,"tabs",3,"nzSelectedIndexChange","nzSelectedIndex"],["nzTitle","Body"],[1,"pane"],[1,"code"],["nzTitle","Headers"],[1,"hlist"],[1,"hrow"],["nzTitle","Raw"],[1,"hk"],[1,"hv"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),g(4,"Response"),s(),x(5,ko,4,4)(6,Ao,2,0,"span",4),s(),a(7,"div",5),f(8,"app-curl-actions",6),s()(),x(9,qo,2,0,"div",7)(10,Ro,1,1,"nz-alert",8)(11,Io,2,0,"div",9)(12,Po,14,3,"nz-tabs",10),s()),e&2&&(l(5),T(n.response()?5:6),l(3),_("curl",n.curl()),l(),T(n.sending?9:n.error()?10:n.response()?12:11))},dependencies:[k,Ve,_t,gt,we,Te,Pe,mt,Fe,Oe,Rt],styles:["[_nghost-%COMP%]{display:flex;height:100%;min-height:0}.wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;width:100%}.top[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid #f0f0f0}.left[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center}.title[_ngcontent-%COMP%]{font-weight:700}.meta[_ngcontent-%COMP%]{font-size:12px;opacity:.65}.loading[_ngcontent-%COMP%]{padding:16px}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.pane[_ngcontent-%COMP%]{height:100%;min-height:0;overflow:auto;padding:10px 12px}.code[_ngcontent-%COMP%]{margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.5;white-space:pre-wrap;word-break:break-word}.hlist[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.hrow[_ngcontent-%COMP%]{display:grid;grid-template-columns:200px 1fr;gap:10px;padding:8px;border:1px solid #f0f0f0;border-radius:8px}.hk[_ngcontent-%COMP%]{font-weight:600;font-size:12px}.hv[_ngcontent-%COMP%]{font-size:12px;opacity:.85;word-break:break-word}"]})};var Vo=["editInput"],Oo=["contextMenu"],Fo=(o,t)=>t.id;function Bo(o,t){if(o&1){let e=y();a(0,"input",24,1),m("ngModelChange",function(i){d(e);let r=p(2);return u(r.editingTitle.set(i))})("blur",function(){d(e);let i=p(2);return u(i.finishEdit())})("keydown.enter",function(){d(e);let i=p(2);return u(i.finishEdit())})("keydown.escape",function(){d(e);let i=p(2);return u(i.cancelEdit())}),s()}if(o&2){let e=p(2);_("ngModel",e.editingTitle())}}function Ko(o,t){o&1&&(a(0,"span",27),g(1,"\u25CF"),s())}function jo(o,t){if(o&1){let e=y();a(0,"span",25),g(1),s(),a(2,"span",26),m("dblclick",function(){d(e);let i=p().$implicit,r=p();return u(r.startEdit(i))}),g(3),s(),x(4,Ko,2,0,"span",27)}if(o&2){let e=p().$implicit,n=p();en(n.getMethodClass(e.request.method)),l(),X(" ",e.request.method," "),l(),_("nzTooltipTitle",n.getFullTitle(e)),l(),X(" ",n.getDisplayTitle(e)," "),l(),T(e.isDirty?4:-1)}}function Lo(o,t){if(o&1){let e=y();a(0,"div",18),m("click",function(){let i=d(e).$implicit,r=p();return u(r.onTabClick(i.id))})("contextmenu",function(i){let r=d(e),c=r.$implicit,C=r.$index,z=p();return u(z.onContextMenu(i,c,C))}),a(1,"span",19),f(2,"nz-icon",20),s(),x(3,Bo,2,1,"input",21)(4,jo,5,6),a(5,"button",22),m("click",function(i){let r=d(e).$implicit,c=p();return u(c.onCloseClick(r.id,i))}),f(6,"nz-icon",23),s()()}if(o&2){let e=t.$implicit,n=p();Z("active",e.id===n.activeTabId())("dirty",e.isDirty),_("cdkDragData",e),l(3),T(n.editingTabId()===e.id?3:4)}}function $o(o,t){if(o&1){let e=y();a(0,"button",28),m("click",function(){d(e);let i=p();return u(i.onAddClick())}),f(1,"nz-icon",29),s()}}function Uo(o,t){if(o&1){let e=y();a(0,"li",7),m("click",function(){d(e);let i=p();return u(i.onMenuAction("copyUrl"))}),f(1,"nz-icon",30),a(2,"span"),g(3,"\u590D\u5236 URL"),s()()}}function Ho(o,t){if(o&1){let e=y();a(0,"li",7),m("click",function(){d(e);let i=p();return u(i.onMenuAction("moveTo"))}),f(1,"nz-icon",31),a(2,"span"),g(3,"\u79FB\u52A8\u5230"),s()()}}var St=class o{contextMenuService=A(kn);tabs=M([]);activeTabId=M(null);canOpenMore=!0;tabChange=new b;tabClose=new b;tabAdd=new b;tabRename=new b;tabReorder=new b;tabContextMenu=new b;startRenameEdit=new b;editInput;contextMenu;editingTabId=M(null);editingTitle=M("");contextTab=M(null);contextIndex=M(-1);activeIndex=h(()=>{let t=this.activeTabId(),e=this.tabs();return t?e.findIndex(n=>n.id===t):-1});hasRightTabs(){let t=this.contextIndex();return t>=0&&t<this.tabs().length-1}hasSavedTabs(){return this.tabs().some(t=>!t.isDirty&&t.requestId)}onKeyDown(t){if(t.ctrlKey&&t.key==="t"){t.preventDefault(),this.onAddClick();return}if(t.ctrlKey&&t.key==="w"){t.preventDefault();let e=this.activeTabId();e&&this.tabClose.emit(e);return}if(t.key==="F2"){t.preventDefault();let e=this.activeTabId();if(e){let n=this.tabs().find(i=>i.id===e);n&&this.startEdit(n)}return}}getMethodClass(t){return t.toLowerCase()}getDisplayTitle(t){if(t.title&&t.title!=="New Request")return this.truncate(t.title,20);let e=t.request;if(!e.url)return"New Request";let n=this.extractPath(e.url);return this.truncate(n,20)}getFullTitle(t){if(t.title&&t.title!=="New Request")return t.title;let e=t.request;return e.url?`${e.method} ${e.url}`:"New Request"}extractPath(t){return t.replace(/^\{\{[^}]+\}\}/,"").replace(/^https?:\/\/[^/]+/,"").split("?")[0]||"/"}truncate(t,e){return t.length<=e?t:t.slice(0,e-2)+"\u2026"}onTabClick(t){t!==this.activeTabId()&&this.tabChange.emit(t)}onCloseClick(t,e){e.stopPropagation(),this.tabClose.emit(t)}onAddClick(){this.tabAdd.emit()}onContextMenu(t,e,n){t.preventDefault(),this.contextTab.set(e),this.contextIndex.set(n),this.contextMenuService.create(t,this.contextMenu)}onMenuAction(t){let e=this.contextTab();if(e){if(t==="rename"){this.switchToTab(e.id),this.startEdit(e),this.clearContext();return}this.tabContextMenu.emit({tabId:e.id,action:t}),this.clearContext()}}switchToTab(t){t!==this.activeTabId()&&this.tabChange.emit(t)}startEdit(t){this.editingTabId.set(t.id),this.editingTitle.set(t.title||t.request.name||"New Request"),setTimeout(()=>{this.editInput?.nativeElement?.focus(),this.editInput?.nativeElement?.select()},0)}finishEdit(){let t=this.editingTabId(),e=this.editingTitle().trim();t&&e&&this.tabRename.emit({id:t,title:e}),this.cancelEdit()}cancelEdit(){this.editingTabId.set(null),this.editingTitle.set("")}onDrop(t){t.previousIndex!==t.currentIndex&&this.tabReorder.emit({from:t.previousIndex,to:t.currentIndex})}clearContext(){this.contextTab.set(null),this.contextIndex.set(-1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-request-tabs-bar"]],viewQuery:function(e,n){if(e&1&&(Le(Vo,5),Le(Oo,5)),e&2){let i;$e(i=Ue())&&(n.editInput=i.first),$e(i=Ue())&&(n.contextMenu=i.first)}},hostBindings:function(e,n){e&1&&m("keydown",function(r){return n.onKeyDown(r)},Qt)},inputs:{tabs:"tabs",activeTabId:"activeTabId",canOpenMore:"canOpenMore"},outputs:{tabChange:"tabChange",tabClose:"tabClose",tabAdd:"tabAdd",tabRename:"tabRename",tabReorder:"tabReorder",tabContextMenu:"tabContextMenu",startRenameEdit:"startRenameEdit"},decls:39,vars:7,consts:[["contextMenu","nzDropdownMenu"],["editInput",""],["cdkDropList","",1,"tabs-container",3,"cdkDropListDropped"],["cdkDrag","",1,"tab-item",3,"active","dirty","cdkDragData"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u65B0\u5EFA\u8BF7\u6C42 (Ctrl+T)",1,"add-btn"],["nzOverlayClassName","tab-context-menu"],["nz-menu","",1,"context-menu"],["nz-menu-item","",3,"click"],["nzType","close"],["nz-menu-item","",3,"click","nzDisabled"],["nzType","close-circle"],["nzType","right-circle"],["nzType","check-circle"],["nzType","delete"],["nz-menu-divider",""],["nzType","edit"],["nzType","copy"],["nz-menu-item",""],["cdkDrag","",1,"tab-item",3,"click","contextmenu","cdkDragData"],["cdkDragHandle","",1,"drag-handle"],["nzType","holder","nzTheme","outline"],[1,"title-input",3,"ngModel"],["nz-button","","nzType","text","nzSize","small",1,"close-btn",3,"click"],["nzType","close","nzTheme","outline"],[1,"title-input",3,"ngModelChange","blur","keydown.enter","keydown.escape","ngModel"],[1,"method"],["nz-tooltip","",1,"title",3,"dblclick","nzTooltipTitle"],["title","\u672A\u4FDD\u5B58",1,"dirty-dot"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u65B0\u5EFA\u8BF7\u6C42 (Ctrl+T)",1,"add-btn",3,"click"],["nzType","plus","nzTheme","outline"],["nzType","link"],["nzType","folder"]],template:function(e,n){if(e&1){let i=y();a(0,"div",2),m("cdkDropListDropped",function(c){return d(i),u(n.onDrop(c))}),S(1,Lo,7,6,"div",3,Fo),x(3,$o,2,0,"button",4),s(),a(4,"nz-dropdown-menu",5,0)(6,"ul",6)(7,"li",7),m("click",function(){return d(i),u(n.onMenuAction("close"))}),f(8,"nz-icon",8),a(9,"span"),g(10,"\u5173\u95ED"),s()(),a(11,"li",9),m("click",function(){return d(i),u(n.onMenuAction("closeOthers"))}),f(12,"nz-icon",10),a(13,"span"),g(14,"\u5173\u95ED\u5176\u4ED6"),s()(),a(15,"li",9),m("click",function(){return d(i),u(n.onMenuAction("closeRight"))}),f(16,"nz-icon",11),a(17,"span"),g(18,"\u5173\u95ED\u53F3\u4FA7"),s()(),a(19,"li",9),m("click",function(){return d(i),u(n.onMenuAction("closeSaved"))}),f(20,"nz-icon",12),a(21,"span"),g(22,"\u5173\u95ED\u5DF2\u4FDD\u5B58"),s()(),a(23,"li",9),m("click",function(){return d(i),u(n.onMenuAction("closeAll"))}),f(24,"nz-icon",13),a(25,"span"),g(26,"\u5173\u95ED\u6240\u6709"),s()(),f(27,"li",14),a(28,"li",7),m("click",function(){return d(i),u(n.onMenuAction("rename"))}),f(29,"nz-icon",15),a(30,"span"),g(31,"\u91CD\u547D\u540D"),s()(),a(32,"li",7),m("click",function(){return d(i),u(n.onMenuAction("duplicate"))}),f(33,"nz-icon",16),a(34,"span"),g(35,"\u590D\u5236\u8BF7\u6C42"),s()(),f(36,"li",14),x(37,Uo,4,0,"li",17),x(38,Ho,4,0,"li",17),s()()}if(e&2){let i,r;l(),N(n.tabs()),l(2),T(n.canOpenMore?3:-1),l(8),_("nzDisabled",n.tabs().length<=1),l(4),_("nzDisabled",!n.hasRightTabs()),l(4),_("nzDisabled",!n.hasSavedTabs()),l(4),_("nzDisabled",n.tabs().length<=1),l(14),T(!((i=n.contextTab())==null||i.request==null)&&i.request.url?37:-1),l(),T((r=n.contextTab())!=null&&r.requestId?38:-1)}},dependencies:[k,R,L,F,B,pn,cn,ln,sn,Ve,q,P,D,$,W,he,fe,pt,xe,ye,lt,ct,De],styles:["[_nghost-%COMP%]{display:block;width:100%}.tabs-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;padding:4px 8px;background:#fafafa;border-bottom:1px solid #f0f0f0;overflow-x:auto;flex-wrap:nowrap}.tabs-container[_ngcontent-%COMP%]::-webkit-scrollbar{height:4px}.tabs-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#d9d9d9;border-radius:2px}.tab-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:4px 8px;min-width:100px;max-width:200px;height:28px;border-radius:4px 4px 0 0;background:#fff;border:1px solid transparent;border-bottom:none;cursor:pointer;-webkit-user-select:none;user-select:none;transition:all .15s}.tab-item[_ngcontent-%COMP%]:hover{background:#f5f5f5}.tab-item.active[_ngcontent-%COMP%]{background:#fff;border-color:#1890ff;border-bottom:1px solid #fff;margin-bottom:-1px;z-index:1}.tab-item.dirty[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{color:#1890ff}.drag-handle[_ngcontent-%COMP%]{display:flex;align-items:center;opacity:.3;cursor:grab;font-size:10px}.drag-handle[_ngcontent-%COMP%]:hover{opacity:.6}.method[_ngcontent-%COMP%]{font-size:10px;font-weight:600;text-transform:uppercase;flex-shrink:0}.method.get[_ngcontent-%COMP%]{color:#61affe}.method.post[_ngcontent-%COMP%]{color:#49cc90}.method.put[_ngcontent-%COMP%]{color:#fca130}.method.patch[_ngcontent-%COMP%]{color:#50e3c2}.method.delete[_ngcontent-%COMP%]{color:#f93e3e}.method.head[_ngcontent-%COMP%], .method.options[_ngcontent-%COMP%]{color:#909090}.title[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:#333}.dirty-dot[_ngcontent-%COMP%]{color:#1890ff;font-size:8px;flex-shrink:0}.title-input[_ngcontent-%COMP%]{flex:1;border:none;background:transparent;outline:none;font-size:12px;min-width:60px;padding:0 2px}.close-btn[_ngcontent-%COMP%]{padding:0 2px!important;height:16px!important;width:16px!important;font-size:10px;opacity:.3;flex-shrink:0}.close-btn[_ngcontent-%COMP%]:hover{opacity:1}.add-btn[_ngcontent-%COMP%]{padding:0 8px!important;height:28px!important;opacity:.6}.add-btn[_ngcontent-%COMP%]:hover{opacity:1}[_nghost-%COMP%] .tab-context-menu .shortcut{margin-left:auto;opacity:.5;font-size:12px;font-family:monospace}.context-menu[_ngcontent-%COMP%] .ant-menu-title-content{display:flex;align-items:center;gap:8px}"]})};var Wo=["envPicker"],Jo=["class","component"];function Go(o,t){if(o&1){let e=y();a(0,"div",10)(1,"app-request-editor",13),m("patch",function(i){d(e);let r=p();return u(r.store.patchActive(i))})("save",function(){d(e);let i=p();return u(i.store.saveActive())})("send",function(){d(e);let i=p();return u(i.store.sendActive())}),s(),f(2,"app-response-viewer",14),s()}if(o&2){let e,n=p();l(),_("collectionPath",n.store.collectionPath())("baseUrl",((e=n.store.activeEnv())==null?null:e.baseUrl)??null)("request",n.store.activeRequest())("sending",n.store.sending())("envVars",n.store.envVarRecord())("openEnv",n.openEnv),l(),_("sending",n.store.sending())("result",n.store.lastResult())}}function Qo(o,t){if(o&1&&f(0,"nz-empty",11),o&2){p();let e=G(12),n=G(14);_("nzNotFoundContent",e)("nzNotFoundFooter",n)}}function Zo(o,t){o&1&&(a(0,"span"),g(1,'\u6682\u65E0\u8BF7\u6C42\uFF0C\u70B9\u51FB\u5DE6\u4FA7\u9762\u677F\u53F3\u4E0A\u89D2"+" \u521B\u5EFA\u8BF7\u6C42'),s())}function Yo(o,t){if(o&1){let e=y();a(0,"button",15),m("click",function(){d(e);let i=p();return u(i.store.newTab())}),g(1,"\u7ACB\u5373\u65B0\u589E"),s()}}function Xo(o,t){if(o&1){let e=y();a(0,"app-api-history-drawer",16),m("close",function(){d(e);let i=p();return u(i.store.closeHistory())})("replay",function(i){d(e);let r=p();return u(r.store.replayHistory(i))}),s()}if(o&2){let e=p();_("loading",e.store.historyLoading())("histories",e.store.histories())}}var Nt=class o{store=A(Ee);modal=A(Ie);envPicker;openEnv=()=>{this.envPicker.openEnvModal()};handleTabClose(t){this.store.tabs().find(n=>n.id===t)?.isDirty?this.modal.confirm({nzTitle:"\u5173\u95ED\u786E\u8BA4",nzContent:"\u5F53\u524D\u8BF7\u6C42\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u5173\u95ED\u5417\uFF1F",nzOkText:"\u5173\u95ED",nzCancelText:"\u53D6\u6D88",nzOnOk:()=>{this.store.closeTab(t)}}):this.store.closeTab(t)}handleTabContextMenu(t){let{tabId:e,action:n}=t;switch(n){case"close":this.handleTabClose(e);break;case"closeOthers":{let i=this.store.tabs().filter(r=>r.id!==e&&r.isDirty);i.length>0?this.modal.confirm({nzTitle:"\u5173\u95ED\u5176\u4ED6\u6807\u7B7E\u9875",nzContent:`\u6709 ${i.length} \u4E2A\u6807\u7B7E\u9875\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u5168\u90E8\u5173\u95ED\u5417\uFF1F`,nzOkText:"\u5168\u90E8\u5173\u95ED",nzCancelText:"\u53D6\u6D88",nzOnOk:()=>{this.store.tabStore.closeOtherTabs(e)}}):this.store.tabStore.closeOtherTabs(e);break}case"closeRight":{let i=this.store.tabs().findIndex(C=>C.id===e),c=this.store.tabs().slice(i+1).filter(C=>C.isDirty);c.length>0?this.modal.confirm({nzTitle:"\u5173\u95ED\u53F3\u4FA7\u6807\u7B7E\u9875",nzContent:`\u53F3\u4FA7\u6709 ${c.length} \u4E2A\u6807\u7B7E\u9875\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF0C\u786E\u5B9A\u8981\u5168\u90E8\u5173\u95ED\u5417\uFF1F`,nzOkText:"\u5168\u90E8\u5173\u95ED",nzCancelText:"\u53D6\u6D88",nzOnOk:()=>{this.store.tabStore.closeRightTabs(e)}}):this.store.tabStore.closeRightTabs(e);break}case"closeSaved":{let i=this.store.tabs().filter(r=>!r.isDirty&&r.requestId);i.length>0&&this.modal.confirm({nzTitle:"\u5173\u95ED\u5DF2\u4FDD\u5B58\u7684\u6807\u7B7E\u9875",nzContent:`\u786E\u5B9A\u8981\u5173\u95ED ${i.length} \u4E2A\u5DF2\u4FDD\u5B58\u7684\u6807\u7B7E\u9875\u5417\uFF1F`,nzOkText:"\u5173\u95ED",nzCancelText:"\u53D6\u6D88",nzOnOk:()=>{this.store.tabStore.closeSavedTabs()}});break}case"duplicate":try{this.store.tabStore.duplicateTab(e)}catch(i){console.error(i)}break;case"copyUrl":{let i=this.store.tabStore.getTabUrl(e);i&&navigator.clipboard.writeText(i);break}case"moveTo":{let i=this.store.tabStore.getTab(e);i?.requestId&&this.store.moveCollection(i.requestId,"request");break}}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=E({type:o,selectors:[["app-api-client",8,"component"]],viewQuery:function(e,n){if(e&1&&Le(Wo,5),e&2){let i;$e(i=Ue())&&(n.envPicker=i.first)}},attrs:Jo,decls:16,vars:13,consts:[["contentTpl",""],["footerTpl",""],[3,"title","loading","isFullscreen","isOverflowYAuto"],["ngProjectAs","actions",5,["actions"]],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u5386\u53F2\u8BB0\u5F55",3,"click"],["nzType","history","nzTheme","outline"],[1,"page"],[3,"qChange","select","createRequest","createCollection","createFolder","reload","delete","rename","move","nodes","q","activeId","loading"],[1,"content"],[3,"tabChange","tabClose","tabAdd","tabRename","tabReorder","tabContextMenu","tabs","activeTabId","canOpenMore"],[1,"editor-area"],[3,"nzNotFoundContent","nzNotFoundFooter"],[3,"loading","histories"],[3,"patch","save","send","collectionPath","baseUrl","request","sending","envVars","openEnv"],[3,"sending","result"],["nz-button","","nzType","primary",3,"click"],[3,"close","replay","loading","histories"]],template:function(e,n){if(e&1){let i=y();a(0,"app-page-layout",2),Ye(1,3),f(2,"app-env-picker"),a(3,"button",4),m("click",function(){return d(i),u(n.store.openHistory())}),f(4,"nz-icon",5),s(),Xe(),a(5,"nz-layout",6)(6,"app-request-collections",7),pe("qChange",function(c){return d(i),ce(n.store.q,c)||(n.store.q=c),u(c)}),m("select",function(c){return d(i),u(n.store.selectRequest(c))})("createRequest",function(c){return d(i),u(n.store.newRequest({collectionId:c.collectionId}))})("createCollection",function(){return d(i),u(n.store.newCollection({kind:"collection"}))})("createFolder",function(c){return d(i),u(n.store.newCollection({kind:"folder",parentId:c.collectionId}))})("reload",function(){return d(i),u(n.store.loadAll())})("delete",function(c){return d(i),u(n.store.deleteCollection(c.id,c.kind))})("rename",function(c){return d(i),u(n.store.renameCollection(c.id,c.kind))})("move",function(c){return d(i),u(n.store.moveCollection(c.id,c.kind))}),s(),a(7,"div",8)(8,"app-request-tabs-bar",9),m("tabChange",function(c){return d(i),u(n.store.switchTab(c))})("tabClose",function(c){return d(i),u(n.handleTabClose(c))})("tabAdd",function(){return d(i),u(n.store.newTab())})("tabRename",function(c){return d(i),u(n.store.renameTab(c.id,c.title))})("tabReorder",function(c){return d(i),u(n.store.reorderTabs(c.from,c.to))})("tabContextMenu",function(c){return d(i),u(n.handleTabContextMenu(c))}),s(),x(9,Go,3,8,"div",10)(10,Qo,1,2,"nz-empty",11),Y(11,Zo,2,0,"ng-template",null,0,ee)(13,Yo,2,0,"ng-template",null,1,ee),s()()(),x(15,Xo,1,2,"app-api-history-drawer",12)}e&2&&(_("title","API \u8BF7\u6C42")("loading",n.store.loading())("isFullscreen",!0)("isOverflowYAuto",!1),l(6),_("nodes",n.store.filteredNodes()),le("q",n.store.q),_("activeId",n.store.activeRequestId())("loading",n.store.loading()),l(2),_("tabs",n.store.tabs)("activeTabId",n.store.activeTabId)("canOpenMore",n.store.canOpenMore()),l(),T(n.store.activeRequest()?9:10),l(6),T(n.store.historyOpen()?15:-1))},dependencies:[k,fn,q,P,D,Q,$,W,Mn,wn,he,fe,un,vt,qt,It,St,Ct,zt,Tn,xn],styles:[".page[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:row;overflow:hidden;gap:16px;padding:0 16px}.content[_ngcontent-%COMP%]{flex:1 1 auto;width:0;display:flex;flex-direction:column;height:100%;overflow:hidden}.editor-area[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;min-height:0}app-request-editor[_ngcontent-%COMP%]{flex:0 0 auto;height:50%}app-response-viewer[_ngcontent-%COMP%]{flex:0 0 auto;height:50%;overflow:auto}"]})};var er=[{path:"",component:Nt}],Dt=class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=Ze({type:o});static \u0275inj=Qe({imports:[Ft.forChild(er),Ft]})};var Un=class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=Ze({type:o});static \u0275inj=Qe({imports:[k,Dt]})};export{Un as ApiClientModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ca as ue,Da as ze,Ga as de,Ha as fe,Ia as Ce,J as se,Ja as ve,K as pe,L as Z,Pa as ge,Qa as Pe,Sa as ye,Ta as _e,Xa as ke,Ya as he,db as Oe,eb as Be,ec as De,hc as xe,pa as me,qb as Te,sb as be,va as $}from"./chunk-3CM4SKDO.js";import{Ac as Q,Ca as te,Fb as oe,Gb as ie,Gc as W,Ha as y,Hb as re,Hc as ae,Ic as le,Jb as A,Jc as T,Lb as O,Lc as b,M as K,Ra as w,Rc as H,Ub as M,W as X,Wb as S,X as Y,Yb as I,a as k,ad as U,b as J,bc as s,bd as q,cc as u,dc as _,dd as ce,ec as F,f as D,ic as E,id as G,jc as V,l as x,lc as L,nb as l,oa as ee,od as p,r as N,rc as B,s as P,sa as ne,sb as h,uc as C,ya as d,yc as R,yd as v,za as f,zc as j}from"./chunk-4BRW6LCZ.js";var we=["okBtn"],Ae=["cancelBtn"];function Me(n,c){n&1&&F(0,"div",5)}function Se(n,c){if(n&1&&(E(0),F(1,"nz-icon",17),V()),n&2){let t=c.$implicit;l(),s("nzType",t||"exclamation-circle")}}function Ie(n,c){if(n&1&&(u(0,"span",10),O(1,Se,2,1,"ng-container",16),_()),n&2){let t=C(2);l(),s("nzStringTemplateOutlet",t.nzIcon)}}function Fe(n,c){if(n&1&&(E(0),T(1),V()),n&2){let t=C(2);l(),b(" ",t.nzTitle," ")}}function Ee(n,c){if(n&1){let t=L();u(0,"div",4),S(1,Me,1,0,"div",5),u(2,"div",6)(3,"div",7)(4,"div")(5,"div",8)(6,"div",9),S(7,Ie,2,1,"span",10),u(8,"div",11),O(9,Fe,2,1,"ng-container",12),_()(),u(10,"div",13)(11,"button",14,1),B("click",function(){d(t);let e=C();return f(e.onCancel())}),H(13),U(14,"nzI18n"),T(15),_(),u(16,"button",15,2),B("click",function(){d(t);let e=C();return f(e.onConfirm())}),H(18),U(19,"nzI18n"),T(20),_()()()()()()()}if(n&2){let t,o,e=C();ae(e.nzOverlayStyle),le(e._classMap),W("ant-popover-rtl",e.dir==="rtl"),s("cdkTrapFocusAutoCapture",e.nzAutoFocus!==null)("@.disabled",!!(e.noAnimation!=null&&e.noAnimation.nzNoAnimation))("nzNoAnimation",e.noAnimation==null?null:e.noAnimation.nzNoAnimation)("@zoomBigMotion","active"),l(),I(e.nzPopconfirmShowArrow?1:-1),l(6),I(e.nzIcon!==null?7:-1),l(2),s("nzStringTemplateOutlet",e.nzTitle)("nzStringTemplateOutletContext",e.nzTitleContext),l(2),s("nzSize","small")("nzDanger",(t=e.nzCancelButtonProps())==null?null:t.nzDanger)("disabled",(o=e.nzCancelButtonProps())==null?null:o.nzDisabled),M("cdkFocusInitial",e.nzAutoFocus==="cancel"||null);let a=e.nzCancelText()||q(14,26,"Modal.cancelText");l(4),b(" ",a," "),l(),s("nzSize","small")("nzType",e.nzOkButtonProps().nzType)("nzDanger",e.nzOkButtonProps().nzDanger)("nzLoading",e.confirmLoading)("disabled",e.nzOkButtonProps().nzDisabled),M("cdkFocusInitial",e.nzAutoFocus==="ok"||null);let m=e.nzOkText()||q(19,28,"Modal.okText");l(4),b(" ",m," ")}}var Ve="popconfirm",_n=(()=>{var r;let n=De,c,t=[],o=[],e,a=[],m=[];return r=class extends n{_nzModuleName=Ve;arrowPointAtCenter;title;titleContext=null;directiveTitle;trigger="click";placement="top";origin;mouseEnterDelay;mouseLeaveDelay;overlayClassName;overlayStyle;visible;nzBeforeConfirm;nzIcon;nzCondition=!1;nzPopconfirmShowArrow=!0;nzPopconfirmBackdrop=P(this,t,!1);nzAutofocus=(P(this,o),P(this,a,null));nzOkText=(P(this,m),p(null));nzOkType=p("primary");nzCancelText=p(null);nzOkButtonProps=p(null);nzCancelButtonProps=p(null);nzOkDisabled=p(!1,{transform:v});nzOkDanger=p(!1,{transform:v});okButtonProps=G(()=>J(k({},this.nzOkButtonProps()),{nzType:this.nzOkButtonProps()?.nzType||this.nzOkType()==="danger"?"primary":this.nzOkType(),nzDanger:this.nzOkDanger()||this.nzOkButtonProps()?.nzDanger||this.nzOkType()==="danger",nzDisabled:this.nzOkDisabled()||this.nzOkButtonProps()?.nzDisabled}));cancelButtonProps=G(()=>k({},this.nzCancelButtonProps()));directiveContent=null;content=null;overlayClickable;visibleChange=new h;nzOnCancel=new h;nzOnConfirm=new h;getProxyPropertyMap(){return k({nzOkText:["nzOkText",()=>this.nzOkText],nzCancelText:["nzCancelText",()=>this.nzCancelText],nzOkButtonProps:["nzOkButtonProps",()=>this.okButtonProps],nzCancelButtonProps:["nzCancelButtonProps",()=>this.cancelButtonProps],nzBeforeConfirm:["nzBeforeConfirm",()=>this.nzBeforeConfirm],nzCondition:["nzCondition",()=>this.nzCondition],nzIcon:["nzIcon",()=>this.nzIcon],nzPopconfirmShowArrow:["nzPopconfirmShowArrow",()=>this.nzPopconfirmShowArrow],nzPopconfirmBackdrop:["nzBackdrop",()=>this.nzPopconfirmBackdrop],nzPopconfirmContext:["nzTitleContext",()=>this.titleContext],nzAutoFocus:["nzAutoFocus",()=>this.nzAutofocus]},super.getProxyPropertyMap())}constructor(){super(Ne)}createComponent(){super.createComponent(),this.component.nzOnCancel.pipe(Z(this.destroyRef)).subscribe(()=>{this.nzOnCancel.emit()}),this.component.nzOnConfirm.pipe(Z(this.destroyRef)).subscribe(()=>{this.nzOnConfirm.emit()})}},(()=>{let z=typeof Symbol=="function"&&Symbol.metadata?Object.create(n[Symbol.metadata]??null):void 0;c=[$()],e=[$()],N(null,null,c,{kind:"field",name:"nzPopconfirmBackdrop",static:!1,private:!1,access:{has:i=>"nzPopconfirmBackdrop"in i,get:i=>i.nzPopconfirmBackdrop,set:(i,g)=>{i.nzPopconfirmBackdrop=g}},metadata:z},t,o),N(null,null,e,{kind:"field",name:"nzAutofocus",static:!1,private:!1,access:{has:i=>"nzAutofocus"in i,get:i=>i.nzAutofocus,set:(i,g)=>{i.nzAutofocus=g}},metadata:z},a,m),z&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:z})})(),D(r,"\u0275fac",function(i){return new(i||r)}),D(r,"\u0275dir",re({type:r,selectors:[["","nz-popconfirm",""]],hostVars:2,hostBindings:function(i,g){i&2&&W("ant-popover-open",g.visible)},inputs:{arrowPointAtCenter:[2,"nzPopconfirmArrowPointAtCenter","arrowPointAtCenter",v],title:[0,"nzPopconfirmTitle","title"],titleContext:[0,"nzPopconfirmTitleContext","titleContext"],directiveTitle:[0,"nz-popconfirm","directiveTitle"],trigger:[0,"nzPopconfirmTrigger","trigger"],placement:[0,"nzPopconfirmPlacement","placement"],origin:[0,"nzPopconfirmOrigin","origin"],mouseEnterDelay:[0,"nzPopconfirmMouseEnterDelay","mouseEnterDelay"],mouseLeaveDelay:[0,"nzPopconfirmMouseLeaveDelay","mouseLeaveDelay"],overlayClassName:[0,"nzPopconfirmOverlayClassName","overlayClassName"],overlayStyle:[0,"nzPopconfirmOverlayStyle","overlayStyle"],visible:[0,"nzPopconfirmVisible","visible"],nzBeforeConfirm:"nzBeforeConfirm",nzIcon:"nzIcon",nzCondition:[2,"nzCondition","nzCondition",v],nzPopconfirmShowArrow:[2,"nzPopconfirmShowArrow","nzPopconfirmShowArrow",v],nzPopconfirmBackdrop:"nzPopconfirmBackdrop",nzAutofocus:"nzAutofocus",nzOkText:[1,"nzOkText"],nzOkType:[1,"nzOkType"],nzCancelText:[1,"nzCancelText"],nzOkButtonProps:[1,"nzOkButtonProps"],nzCancelButtonProps:[1,"nzCancelButtonProps"],nzOkDisabled:[1,"nzOkDisabled"],nzOkDanger:[1,"nzOkDanger"]},outputs:{visibleChange:"nzPopconfirmVisibleChange",nzOnCancel:"nzOnCancel",nzOnConfirm:"nzOnConfirm"},exportAs:["nzPopconfirm"],features:[A]})),r})(),Ne=(()=>{class n extends xe{okBtn;cancelBtn;nzCondition=!1;nzPopconfirmShowArrow=!0;nzIcon;nzAutoFocus=null;nzBeforeConfirm=null;nzOkText=y(null);nzCancelText=y(null);nzOkButtonProps=y({nzType:"primary"});nzCancelButtonProps=y(null);nzOnCancel=new x;nzOnConfirm=new x;_trigger="click";elementFocusedBeforeModalWasOpened=null;document=ne(te);_prefix="ant-popover";confirmLoading=!1;constructor(){super(),this.destroyRef.onDestroy(()=>{this.nzVisibleChange.complete()})}show(){this.nzCondition?this.onConfirm():(this.capturePreviouslyFocusedElement(),super.show())}hide(){super.hide(),this.restoreFocus()}handleConfirm(){this.nzOnConfirm.next(),super.hide()}onCancel(){this.nzOnCancel.next(),super.hide()}onConfirm(){this.nzBeforeConfirm?(this.confirmLoading=!0,this.cdr.markForCheck(),me(this.nzBeforeConfirm()).pipe(Y(),K(Boolean),X(()=>{this.confirmLoading=!1,this.cdr.markForCheck()})).subscribe(()=>this.handleConfirm())):this.handleConfirm()}capturePreviouslyFocusedElement(){this.document&&(this.elementFocusedBeforeModalWasOpened=this.document.activeElement)}restoreFocus(){let t=this.elementFocusedBeforeModalWasOpened;if(t&&typeof t.focus=="function"){let o=this.document.activeElement,e=this.elementRef.nativeElement;(!o||o===this.document.body||o===e||e.contains(o))&&t.focus()}}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=oe({type:n,selectors:[["nz-popconfirm"]],viewQuery:function(o,e){if(o&1&&(R(we,5,w),R(Ae,5,w)),o&2){let a;j(a=Q())&&(e.okBtn=a),j(a=Q())&&(e.cancelBtn=a)}},exportAs:["nzPopconfirmComponent"],features:[A],decls:2,vars:6,consts:[["overlay","cdkConnectedOverlay"],["cancelBtn",""],["okBtn",""],["cdkConnectedOverlay","","nzConnectedOverlay","",3,"overlayOutsideClick","detach","positionChange","cdkConnectedOverlayHasBackdrop","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayOpen","cdkConnectedOverlayPush","nzArrowPointAtCenter"],["cdkTrapFocus","",1,"ant-popover",3,"cdkTrapFocusAutoCapture","nzNoAnimation"],[1,"ant-popover-arrow"],[1,"ant-popover-content"],[1,"ant-popover-inner"],[1,"ant-popover-inner-content"],[1,"ant-popover-message"],[1,"ant-popover-message-icon"],[1,"ant-popover-message-title"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[1,"ant-popover-buttons"],["nz-button","",3,"click","nzSize","nzDanger","disabled"],["nz-button","",3,"click","nzSize","nzType","nzDanger","nzLoading","disabled"],[4,"nzStringTemplateOutlet"],["nzTheme","fill",3,"nzType"]],template:function(o,e){if(o&1){let a=L();O(0,Ee,21,30,"ng-template",3,0,ce),B("overlayOutsideClick",function(r){return d(a),f(e.onClickOutside(r))})("detach",function(){return d(a),f(e.hide())})("positionChange",function(r){return d(a),f(e.onPositionChange(r))})}o&2&&s("cdkConnectedOverlayHasBackdrop",e.nzBackdrop)("cdkConnectedOverlayOrigin",e.origin)("cdkConnectedOverlayPositions",e._positions)("cdkConnectedOverlayOpen",e._visible)("cdkConnectedOverlayPush",e.cdkConnectedOverlayPush)("nzArrowPointAtCenter",e.nzArrowPointAtCenter)},dependencies:[pe,se,ze,ue,Be,Oe,be,ve,Ce,fe,de,_e,ye,ge,Pe,he,ke],encapsulation:2,data:{animation:[Te]},changeDetection:0})}return n})(),kn=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=ie({type:n});static \u0275inj=ee({imports:[Ne]})}return n})();export{_n as a,kn as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ga as I,Ha as V,L as O,N as E,O as R,P as S,Q as j,a as B}from"./chunk-3CM4SKDO.js";import{Da as C,Fb as f,Fc as N,Gb as m,Gc as D,Oa as z,Ra as g,Wb as k,Yb as y,cc as _,dc as v,lc as T,nb as p,oa as c,rc as a,sa as r,sb as s,uc as M,ud as w,vc as P,wc as b,ya as d,yb as u,yd as l,za as h}from"./chunk-4BRW6LCZ.js";var x=["*"];function A(o,H){if(o&1){let t=T();_(0,"nz-icon",1),a("click",function(e){d(t);let i=M();return h(i.closeTag(e))}),v()}}var F=(()=>{class o{cdr=r(w);renderer=r(u);el=r(g).nativeElement;directionality=r(B);destroyRef=r(C);nzMode="default";nzColor;nzChecked=!1;nzBordered=!0;nzOnClose=new s;nzCheckedChange=new s;dir="ltr";isPresetColor=!1;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked))}closeTag(t){this.nzOnClose.emit(t),t.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el)}clearPresetColor(){let t=new RegExp(`(ant-tag-(?:${[...R,...E].join("|")}))`,"g"),n=this.el.classList.toString(),e=[],i=t.exec(n);for(;i!==null;)e.push(i[1]),i=t.exec(n);this.el.classList.remove(...e)}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=S(this.nzColor)||j(this.nzColor):this.isPresetColor=!1,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`)}ngOnInit(){this.directionality.change?.pipe(O(this.destroyRef)).subscribe(t=>{this.dir=t,this.cdr.detectChanges()}),this.dir=this.directionality.value}ngOnChanges(t){let{nzColor:n}=t;n&&this.setPresetColor()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=f({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(n,e){n&1&&a("click",function(){return e.updateCheckedStatus()}),n&2&&(N("background-color",e.isPresetColor?"":e.nzColor),D("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir==="rtl")("ant-tag-borderless",!e.nzBordered))},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",l],nzBordered:[2,"nzBordered","nzBordered",l]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[z],ngContentSelectors:x,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(n,e){n&1&&(P(),b(0),k(1,A,1,0,"nz-icon",0)),n&2&&(p(),y(e.nzMode==="closeable"?1:-1))},dependencies:[V,I],encapsulation:2,changeDetection:0})}return o})(),te=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275mod=m({type:o});static \u0275inj=c({imports:[F]})}return o})();export{F as a,te as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ga as rt,Ha as at,Ia as lt,Ja as ct,L as G,U as ft,X as Vt,Y as st,a as ot,ra as Zt,ua as Ht,va as T}from"./chunk-3CM4SKDO.js";import{i as it}from"./chunk-KRYMOHYF.js";import{$b as q,$c as Qt,Aa as F,Ac as X,Da as A,Ec as M,Fb as L,Fc as K,Gb as Z,Gc as W,Hc as J,Ic as Rt,Jc as w,Kc as tt,L as Ot,Lb as S,Lc as et,M as $t,Oa as V,Ub as E,Wb as z,Yb as m,Zb as H,Zc as jt,ac as U,bc as u,c as Nt,cc as p,da as Et,dc as d,dd as nt,ec as f,f as zt,g as wt,ic as I,jc as N,l as Gt,nb as r,oa as B,r as v,s as h,sa as C,sb as Mt,tb as Wt,uc as c,ud as R,vc as Ft,wb as mt,wc as At,xc as Lt,yc as ut,yd as Bt,zc as Y,zd as ht}from"./chunk-4BRW6LCZ.js";var ee=e=>({$implicit:e});function ne(e,s){if(e&1&&f(0,"nz-icon",3),e&2){let t=c(3);u("nzType",t.icon)}}function ie(e,s){if(e&1&&(I(0),w(1),N()),e&2){let t=s.$implicit,i=c(4);r(),et(" ",t(i.nzPercent)," ")}}function oe(e,s){if(e&1&&S(0,ie,2,1,"ng-container",4),e&2){let t=c(3);u("nzStringTemplateOutlet",t.formatter)("nzStringTemplateOutletContext",jt(2,ee,t.nzPercent))}}function se(e,s){if(e&1&&(p(0,"span",2),z(1,ne,1,1,"nz-icon",3)(2,oe,1,4,"ng-container"),d()),e&2){let t=c(2);r(),m((t.status==="exception"||t.status==="success")&&!t.nzFormat?1:2)}}function re(e,s){if(e&1&&z(0,se,3,1,"span",2),e&2){let t=c();m(t.nzShowInfo?0:-1)}}function ae(e,s){if(e&1&&f(0,"div",8),e&2){let t=s.$implicit;J(t)}}function le(e,s){}function ce(e,s){if(e&1&&(p(0,"div",5),q(1,ae,1,2,"div",6,H),S(3,le,0,0,"ng-template",7),d()),e&2){let t=c(2),i=M(1);r(),U(t.steps),r(2),u("ngTemplateOutlet",i)}}function pe(e,s){if(e&1&&f(0,"div",13),e&2){let t=c(3);K("width",t.nzSuccessPercent,"%")("border-radius",t.nzStrokeLinecap==="round"?"100px":"0")("height",t.strokeWidth,"px")}}function de(e,s){}function ze(e,s){if(e&1&&(p(0,"div",9)(1,"div",10),f(2,"div",11),z(3,pe,1,6,"div",12),d()(),S(4,de,0,0,"ng-template",7)),e&2){let t=c(2),i=M(1);r(2),K("width",t.nzPercent,"%")("border-radius",t.nzStrokeLinecap==="round"?"100px":"0")("background",t.isGradient?null:t.nzStrokeColor)("background-image",t.isGradient?t.lineGradient:null)("height",t.strokeWidth,"px"),r(),m(t.nzSuccessPercent||t.nzSuccessPercent===0?3:-1),r(),u("ngTemplateOutlet",i)}}function me(e,s){if(e&1&&(p(0,"div"),z(1,ce,4,1,"div",5)(2,ze,5,12),d()),e&2){let t=c();r(),m(t.isSteps?1:2)}}function ue(e,s){if(e&1&&(F(),f(0,"stop")),e&2){let t=s.$implicit;E("offset",t.offset)("stop-color",t.color)}}function he(e,s){if(e&1&&(F(),p(0,"defs")(1,"linearGradient",17),q(2,ue,1,2,":svg:stop",null,H),d()()),e&2){let t=c(2);r(),u("id","gradient-"+t.gradientId),r(),U(t.circleGradient)}}function fe(e,s){if(e&1&&(F(),f(0,"path",18)),e&2){let t=s.$implicit,i=c(2);J(t.strokePathStyle),E("d",i.pathString)("stroke-linecap",i.nzStrokeLinecap)("stroke",t.stroke)("stroke-width",i.nzPercent?i.strokeWidth:0)}}function ge(e,s){}function _e(e,s){if(e&1&&(p(0,"div",10),F(),p(1,"svg",14),z(2,he,4,1,":svg:defs"),f(3,"path",15),q(4,fe,1,6,":svg:path",16,H),d(),S(6,ge,0,0,"ng-template",7),d()),e&2){let t=c(),i=M(1);K("width",t.nzWidth,"px")("height",t.nzWidth,"px")("font-size",t.nzWidth*.15+6,"px"),W("ant-progress-circle-gradient",t.isGradient),r(2),m(t.isGradient?2:-1),r(),J(t.trailPathStyle),E("stroke-width",t.strokeWidth)("d",t.pathString),r(),U(t.progressCirclePath),r(2),u("ngTemplateOutlet",i)}}function Se(e){return+e.replace("%","")}var Ut=e=>{let s=[];return Object.keys(e).forEach(t=>{let i=e[t],o=Se(t);isNaN(o)||s.push({key:o,value:i})}),s=s.sort((t,i)=>t.key-i.key),s},Ce=e=>Ut(e).map(({key:s,value:t})=>({offset:`${s}%`,color:t})),xe=e=>{let g=e,{from:s="#1890ff",to:t="#1890ff",direction:i="to right"}=g,o=Nt(g,["from","to","direction"]);if(Object.keys(o).length!==0){let k=Ut(o).map(({key:O,value:j})=>`${j} ${O}%`).join(", ");return`linear-gradient(${i}, ${k})`}return`linear-gradient(${i}, ${s}, ${t})`},Pe=0,qt="progress",ye=new Map([["success","check"],["exception","close"]]),ke=new Map([["normal","#108ee9"],["exception","#ff5500"],["success","#87d068"]]),ve=e=>`${e}%`,gt=(()=>{var x;let e,s=[],t=[],i,o=[],g=[],k,O=[],j=[],_t,St=[],Ct=[],xt,Pt=[],yt=[],kt,vt=[],Tt=[],Dt,bt=[],It=[];return x=class{_nzModuleName=qt;cdr=C(R);directionality=C(ot);destroyRef=C(A);nzShowInfo=h(this,s,!0);nzWidth=(h(this,t),132);nzStrokeColor=h(this,o,void 0);nzSize=(h(this,g),h(this,O,"default"));nzFormat=h(this,j);nzSuccessPercent;nzPercent=0;nzStrokeWidth=h(this,St,void 0);nzGapDegree=(h(this,Ct),h(this,Pt,void 0));nzStatus=h(this,yt);nzType="line";nzGapPosition=h(this,vt,"top");nzStrokeLinecap=(h(this,Tt),h(this,bt,"round"));nzSteps=(h(this,It),0);steps=[];lineGradient=null;isGradient=!1;isSteps=!1;gradientId=Pe++;progressCirclePath=[];circleGradient;trailPathStyle=null;pathString;icon;dir="ltr";get formatter(){return this.nzFormat||ve}get status(){return this.nzStatus||this.inferredStatus}get strokeWidth(){return this.nzStrokeWidth||(this.nzType==="line"&&this.nzSize!=="small"?8:6)}get isCircleStyle(){return this.nzType==="circle"||this.nzType==="dashboard"}cachedStatus="normal";inferredStatus="normal";constructor(){Ht(qt,()=>{this.updateIcon(),this.setStrokeColor(),this.getCirclePaths()})}ngOnChanges(l){let{nzSteps:n,nzGapPosition:a,nzStrokeLinecap:P,nzStrokeColor:_,nzGapDegree:D,nzType:$,nzStatus:b,nzPercent:y,nzSuccessPercent:Q,nzStrokeWidth:pt}=l;b&&(this.cachedStatus=this.nzStatus||this.cachedStatus),(y||Q)&&(parseInt(this.nzPercent.toString(),10)>=100?(ft(this.nzSuccessPercent)&&this.nzSuccessPercent>=100||this.nzSuccessPercent===void 0)&&(this.inferredStatus="success"):this.inferredStatus=this.cachedStatus),(b||y||Q||_)&&this.updateIcon(),_&&this.setStrokeColor(),(a||P||D||$||y||_||_)&&this.getCirclePaths(),(y||n||pt)&&(this.isSteps=this.nzSteps>0,this.isSteps&&this.getSteps())}ngOnInit(){this.directionality.change?.pipe(G(this.destroyRef)).subscribe(l=>{this.dir=l,this.cdr.detectChanges()}),this.dir=this.directionality.value}updateIcon(){let l=ye.get(this.status);this.icon=l?l+(this.isCircleStyle?"-o":"-circle-fill"):""}getSteps(){let l=Math.floor(this.nzSteps*(this.nzPercent/100)),n=this.nzSize==="small"?2:14,a=[];for(let P=0;P<this.nzSteps;P++){let _;P<=l-1&&(_=this.nzStrokeColor);let D={backgroundColor:`${_}`,width:`${n}px`,height:`${this.strokeWidth}px`};a.push(D)}this.steps=a}getCirclePaths(){if(!this.isCircleStyle)return;let l=ft(this.nzSuccessPercent)?[this.nzSuccessPercent,this.nzPercent]:[this.nzPercent],n=50-this.strokeWidth/2,a=this.nzGapPosition||(this.nzType==="circle"?"top":"bottom"),P=Math.PI*2*n,_=this.nzGapDegree||(this.nzType==="circle"?0:75),D=0,$=-n,b=0,y=n*-2;switch(a){case"left":D=-n,$=0,b=n*2,y=0;break;case"right":D=n,$=0,b=n*-2,y=0;break;case"bottom":$=n,y=n*2;break;default:}this.pathString=`M 50,50 m ${D},${$}
|
|
2
2
|
a ${n},${n} 0 1 1 ${b},${-y}
|
|
3
3
|
a ${n},${n} 0 1 1 ${-b},${y}`,this.trailPathStyle={strokeDasharray:`${P-_}px ${P}px`,strokeDashoffset:`-${_/2}px`,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"},this.progressCirclePath=l.map((Q,pt)=>{let dt=l.length===2&&pt===0;return{stroke:this.isGradient&&!dt?`url(#gradient-${this.gradientId})`:null,strokePathStyle:{stroke:this.isGradient?null:dt?ke.get("success"):this.nzStrokeColor,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s",strokeDasharray:`${(Q||0)/100*(P-_)}px ${P}px`,strokeDashoffset:`-${_/2}px`}}}).reverse()}setStrokeColor(){let l=this.nzStrokeColor,n=this.isGradient=!!l&&typeof l!="string";n&&!this.isCircleStyle?this.lineGradient=xe(l):n&&this.isCircleStyle?this.circleGradient=Ce(this.nzStrokeColor):(this.lineGradient=null,this.circleGradient=[])}},(()=>{let l=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[T()],i=[T()],k=[T()],_t=[T()],xt=[T()],kt=[T()],Dt=[T()],v(null,null,e,{kind:"field",name:"nzShowInfo",static:!1,private:!1,access:{has:n=>"nzShowInfo"in n,get:n=>n.nzShowInfo,set:(n,a)=>{n.nzShowInfo=a}},metadata:l},s,t),v(null,null,i,{kind:"field",name:"nzStrokeColor",static:!1,private:!1,access:{has:n=>"nzStrokeColor"in n,get:n=>n.nzStrokeColor,set:(n,a)=>{n.nzStrokeColor=a}},metadata:l},o,g),v(null,null,k,{kind:"field",name:"nzSize",static:!1,private:!1,access:{has:n=>"nzSize"in n,get:n=>n.nzSize,set:(n,a)=>{n.nzSize=a}},metadata:l},O,j),v(null,null,_t,{kind:"field",name:"nzStrokeWidth",static:!1,private:!1,access:{has:n=>"nzStrokeWidth"in n,get:n=>n.nzStrokeWidth,set:(n,a)=>{n.nzStrokeWidth=a}},metadata:l},St,Ct),v(null,null,xt,{kind:"field",name:"nzGapDegree",static:!1,private:!1,access:{has:n=>"nzGapDegree"in n,get:n=>n.nzGapDegree,set:(n,a)=>{n.nzGapDegree=a}},metadata:l},Pt,yt),v(null,null,kt,{kind:"field",name:"nzGapPosition",static:!1,private:!1,access:{has:n=>"nzGapPosition"in n,get:n=>n.nzGapPosition,set:(n,a)=>{n.nzGapPosition=a}},metadata:l},vt,Tt),v(null,null,Dt,{kind:"field",name:"nzStrokeLinecap",static:!1,private:!1,access:{has:n=>"nzStrokeLinecap"in n,get:n=>n.nzStrokeLinecap,set:(n,a)=>{n.nzStrokeLinecap=a}},metadata:l},bt,It),l&&Object.defineProperty(x,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:l})})(),zt(x,"\u0275fac",function(n){return new(n||x)}),zt(x,"\u0275cmp",L({type:x,selectors:[["nz-progress"]],inputs:{nzShowInfo:"nzShowInfo",nzWidth:"nzWidth",nzStrokeColor:"nzStrokeColor",nzSize:"nzSize",nzFormat:"nzFormat",nzSuccessPercent:[2,"nzSuccessPercent","nzSuccessPercent",st],nzPercent:[2,"nzPercent","nzPercent",ht],nzStrokeWidth:[2,"nzStrokeWidth","nzStrokeWidth",st],nzGapDegree:[2,"nzGapDegree","nzGapDegree",st],nzStatus:"nzStatus",nzType:"nzType",nzGapPosition:"nzGapPosition",nzStrokeLinecap:"nzStrokeLinecap",nzSteps:[2,"nzSteps","nzSteps",ht]},exportAs:["nzProgress"],features:[V],decls:5,vars:18,consts:[["progressInfoTemplate",""],[1,"ant-progress-inner",3,"width","height","fontSize","ant-progress-circle-gradient"],[1,"ant-progress-text"],[3,"nzType"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[1,"ant-progress-steps-outer"],[1,"ant-progress-steps-item",3,"style"],[3,"ngTemplateOutlet"],[1,"ant-progress-steps-item"],[1,"ant-progress-outer"],[1,"ant-progress-inner"],[1,"ant-progress-bg"],[1,"ant-progress-success-bg",3,"width","border-radius","height"],[1,"ant-progress-success-bg"],["viewBox","0 0 100 100",1,"ant-progress-circle"],["stroke","#f3f3f3","fill-opacity","0",1,"ant-progress-circle-trail"],["fill-opacity","0",1,"ant-progress-circle-path",3,"style"],["x1","100%","y1","0%","x2","0%","y2","0%",3,"id"],["fill-opacity","0",1,"ant-progress-circle-path"]],template:function(n,a){n&1&&(S(0,re,1,1,"ng-template",null,0,nt),p(2,"div"),z(3,me,3,1,"div"),z(4,_e,7,14,"div",1),d()),n&2&&(r(2),Rt("ant-progress ant-progress-status-"+a.status),W("ant-progress-line",a.nzType==="line")("ant-progress-small",a.nzSize==="small")("ant-progress-default",a.nzSize==="default")("ant-progress-show-info",a.nzShowInfo)("ant-progress-circle",a.isCircleStyle)("ant-progress-steps",a.isSteps)("ant-progress-rtl",a.dir==="rtl"),r(),m(a.nzType==="line"?3:-1),r(),m(a.isCircleStyle?4:-1))},dependencies:[at,rt,ct,lt,it],encapsulation:2,changeDetection:0})),x})(),Yt=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=Z({type:e});static \u0275inj=B({imports:[gt]})}return e})();var De=["processDotTemplate"],be=["itemContainer"],Ie=(e,s,t)=>({$implicit:e,status:s,index:t});function Ne(e,s){e&1&&f(0,"div",3)}function we(e,s){if(e&1&&(p(0,"div",11),f(1,"nz-progress",12),d()),e&2){let t=c(2);r(),u("nzPercent",t.nzPercentage)("nzWidth",t.nzSize==="small"?32:40)("nzFormat",t.nullProcessFormat)("nzStrokeWidth",4)}}function Ge(e,s){e&1&&(p(0,"span",5),f(1,"nz-icon",13),d())}function Oe(e,s){e&1&&(p(0,"span",5),f(1,"nz-icon",14),d())}function $e(e,s){if(e&1&&(p(0,"span",5),w(1),d()),e&2){let t=c(2);r(),et(" ",t.index+1," ")}}function Ee(e,s){if(e&1&&(I(0),f(1,"nz-icon",15),N()),e&2){let t=s.$implicit;r(),u("nzType",t)}}function Me(e,s){if(e&1&&(p(0,"span",5),S(1,Ee,2,1,"ng-container",8),d()),e&2){let t=c(2);r(),u("nzStringTemplateOutlet",t.nzIcon)}}function We(e,s){if(e&1&&(z(0,we,2,4,"div",11),z(1,Ge,2,0,"span",5),z(2,Oe,2,0,"span",5),z(3,$e,2,1,"span",5),z(4,Me,2,1,"span",5)),e&2){let t=c();m(t.showProgress?0:-1),r(),m(t.nzStatus==="finish"&&!t.nzIcon?1:-1),r(),m(t.nzStatus==="error"?2:-1),r(),m((t.nzStatus==="process"||t.nzStatus==="wait")&&!t.nzIcon?3:-1),r(),m(t.nzIcon?4:-1)}}function Fe(e,s){e&1&&f(0,"span",17)}function Ae(e,s){}function Le(e,s){if(e&1&&(p(0,"span",5),S(1,Fe,1,0,"ng-template",null,1,nt)(3,Ae,0,0,"ng-template",16),d()),e&2){let t=M(2),i=c();r(3),u("ngTemplateOutlet",i.customProcessTemplate||t)("ngTemplateOutletContext",Qt(2,Ie,t,i.nzStatus,i.index))}}function Re(e,s){if(e&1&&(I(0),w(1),N()),e&2){let t=c();r(),tt(t.nzTitle)}}function je(e,s){if(e&1&&(I(0),w(1),N()),e&2){let t=c(2);r(),tt(t.nzSubtitle)}}function Qe(e,s){if(e&1&&(p(0,"div",9),S(1,je,2,1,"ng-container",8),d()),e&2){let t=c();r(),u("nzStringTemplateOutlet",t.nzSubtitle)}}function Be(e,s){if(e&1&&(I(0),w(1),N()),e&2){let t=c();r(),tt(t.nzDescription)}}var Ve=["*"],Xt=(()=>{class e{cdr=C(R);destroyRef=C(A);processDotTemplate;itemContainer;nzTitle;nzSubtitle;nzDescription;nzDisabled=!1;nzPercentage=null;nzSize="default";get nzStatus(){return this._status}set nzStatus(t){this._status=t,this.isCustomStatus=!0}isCustomStatus=!1;_status="wait";get nzIcon(){return this._icon}set nzIcon(t){t instanceof mt||(this.oldAPIIcon=typeof t=="string"&&t.indexOf("anticon")>-1),this._icon=t}oldAPIIcon=!0;_icon;customProcessTemplate;direction="horizontal";index=0;last=!1;outStatus="process";showProcessDot=!1;clickable=!1;clickOutsideAngular$=new Gt;nullProcessFormat=()=>null;get showProgress(){return this.nzPercentage!==null&&!this.nzIcon&&this.nzStatus==="process"&&this.nzPercentage>=0&&this.nzPercentage<=100}get currentIndex(){return this._currentIndex}set currentIndex(t){this._currentIndex=t,this.isCustomStatus||(this._status=t>this.index?"finish":t===this.index?this.outStatus||"":"wait")}_currentIndex=0;ngOnInit(){Zt(this.itemContainer.nativeElement,"click").pipe($t(()=>this.clickable&&this.currentIndex!==this.index&&!this.nzDisabled),G(this.destroyRef)).subscribe(()=>{this.clickOutsideAngular$.next(this.index)})}enable(){this.nzDisabled=!1,this.cdr.markForCheck()}disable(){this.nzDisabled=!0,this.cdr.markForCheck()}markForCheck(){this.cdr.markForCheck()}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=L({type:e,selectors:[["nz-step"]],viewQuery:function(i,o){if(i&1&&(ut(De,5),ut(be,7)),i&2){let g;Y(g=X())&&(o.processDotTemplate=g.first),Y(g=X())&&(o.itemContainer=g.first)}},hostAttrs:[1,"ant-steps-item"],hostVars:16,hostBindings:function(i,o){i&2&&W("ant-steps-item-wait",o.nzStatus==="wait")("ant-steps-item-process",o.nzStatus==="process")("ant-steps-item-finish",o.nzStatus==="finish")("ant-steps-item-error",o.nzStatus==="error")("ant-steps-item-active",o.currentIndex===o.index)("ant-steps-item-disabled",o.nzDisabled)("ant-steps-item-custom",!!o.nzIcon)("ant-steps-next-error",o.outStatus==="error"&&o.currentIndex===o.index+1)},inputs:{nzTitle:"nzTitle",nzSubtitle:"nzSubtitle",nzDescription:"nzDescription",nzDisabled:[2,"nzDisabled","nzDisabled",Bt],nzPercentage:"nzPercentage",nzSize:"nzSize",nzStatus:"nzStatus",nzIcon:"nzIcon"},exportAs:["nzStep"],decls:12,vars:8,consts:[["itemContainer",""],["processDotTemplate",""],[1,"ant-steps-item-container",3,"tabindex"],[1,"ant-steps-item-tail"],[1,"ant-steps-item-icon"],[1,"ant-steps-icon"],[1,"ant-steps-item-content"],[1,"ant-steps-item-title"],[4,"nzStringTemplateOutlet"],[1,"ant-steps-item-subtitle"],[1,"ant-steps-item-description"],[1,"ant-steps-progress-icon"],["nzType","circle",3,"nzPercent","nzWidth","nzFormat","nzStrokeWidth"],["nzType","check"],["nzType","close"],[3,"nzType"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ant-steps-icon-dot"]],template:function(i,o){i&1&&(p(0,"div",2,0),z(2,Ne,1,0,"div",3),p(3,"div",4),z(4,We,5,5),z(5,Le,4,6,"span",5),d(),p(6,"div",6)(7,"div",7),S(8,Re,2,1,"ng-container",8),z(9,Qe,2,1,"div",9),d(),p(10,"div",10),S(11,Be,2,1,"ng-container",8),d()()()),i&2&&(u("tabindex",o.clickable&&!o.nzDisabled?0:null),E("role",o.clickable&&!o.nzDisabled?"button":null),r(2),m(o.last?-1:2),r(2),m(o.showProcessDot?-1:4),r(),m(o.showProcessDot?5:-1),r(3),u("nzStringTemplateOutlet",o.nzTitle),r(),m(o.nzSubtitle?9:-1),r(2),u("nzStringTemplateOutlet",o.nzDescription))},dependencies:[Yt,gt,at,rt,ct,lt,it],encapsulation:2,changeDetection:0})}return e})(),Tn=(()=>{class e{static ngAcceptInputType_nzProgressDot;cdr=C(R);ngZone=C(Wt);directionality=C(ot);destroyRef=C(A);steps;nzCurrent=0;nzDirection="horizontal";nzLabelPlacement="horizontal";nzType="default";nzSize="default";nzStartIndex=0;nzStatus="process";set nzProgressDot(t){t instanceof mt?(this.showProcessDot=!0,this.customProcessDotTemplate=t):this.showProcessDot=Vt(t),this.updateChildrenSteps()}nzIndexChange=new Mt;indexChangeSubscription=wt.EMPTY;showProcessDot=!1;showProgress=!1;customProcessDotTemplate;dir="ltr";ngOnChanges(t){let{nzStartIndex:i,nzDirection:o,nzStatus:g,nzCurrent:k,nzSize:O}=t;(i||o||g||k||O)&&this.updateChildrenSteps()}ngOnInit(){this.directionality.change?.pipe(G(this.destroyRef)).subscribe(t=>{this.dir=t,this.cdr.detectChanges()}),this.dir=this.directionality.value,this.updateChildrenSteps()}ngAfterContentInit(){this.steps&&this.steps.changes.pipe(Et(null),G(this.destroyRef)).subscribe(()=>{this.updateHostProgressClass(),this.updateChildrenSteps()})}updateHostProgressClass(){this.steps&&!this.showProcessDot&&(this.showProgress=!!this.steps.toArray().find(t=>t.nzPercentage!==null))}updateChildrenSteps(){if(this.steps){let t=this.steps.length;this.steps.toArray().forEach((i,o)=>{Promise.resolve().then(()=>{i.nzSize=this.nzSize,i.outStatus=this.nzStatus,i.showProcessDot=this.showProcessDot,this.customProcessDotTemplate&&(i.customProcessTemplate=this.customProcessDotTemplate),i.clickable=this.nzIndexChange.observers.length>0,i.direction=this.nzDirection,i.index=o+this.nzStartIndex,i.currentIndex=this.nzCurrent,i.last=t===o+1,i.markForCheck()})}),this.indexChangeSubscription.unsubscribe(),this.indexChangeSubscription=Ot(...this.steps.map(i=>i.clickOutsideAngular$)).pipe(G(this.destroyRef)).subscribe(i=>{this.nzIndexChange.observers.length&&this.ngZone.run(()=>this.nzIndexChange.emit(i))})}}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=L({type:e,selectors:[["nz-steps"]],contentQueries:function(i,o,g){if(i&1&&Lt(g,Xt,4),i&2){let k;Y(k=X())&&(o.steps=k)}},hostAttrs:[1,"ant-steps"],hostVars:18,hostBindings:function(i,o){i&2&&W("ant-steps-horizontal",o.nzDirection==="horizontal")("ant-steps-vertical",o.nzDirection==="vertical")("ant-steps-label-horizontal",o.nzDirection==="horizontal")("ant-steps-label-vertical",(o.showProcessDot||o.nzLabelPlacement==="vertical")&&o.nzDirection==="horizontal")("ant-steps-dot",o.showProcessDot)("ant-steps-small",o.nzSize==="small")("ant-steps-navigation",o.nzType==="navigation")("ant-steps-rtl",o.dir==="rtl")("ant-steps-with-progress",o.showProgress)},inputs:{nzCurrent:"nzCurrent",nzDirection:"nzDirection",nzLabelPlacement:"nzLabelPlacement",nzType:"nzType",nzSize:"nzSize",nzStartIndex:"nzStartIndex",nzStatus:"nzStatus",nzProgressDot:"nzProgressDot"},outputs:{nzIndexChange:"nzIndexChange"},exportAs:["nzSteps"],features:[V],ngContentSelectors:Ve,decls:1,vars:0,template:function(i,o){i&1&&(Ft(),At(0))},encapsulation:2,changeDetection:0})}return e})(),Dn=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=Z({type:e});static \u0275inj=B({imports:[Xt]})}return e})();export{gt as a,Yt as b,Xt as c,Tn as d,Dn as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as b,b as y}from"./chunk-OSBDR36P.js";import{a as N}from"./chunk-AV2ZODEH.js";import{e as V,k as C,l as v,m as w}from"./chunk-2NZJ7CN2.js";import{Ha as u,a as d,b as c,id as g,jd as R,l as I,na as f,ra as P,sa as m,y as h,z as x}from"./chunk-4BRW6LCZ.js";var k=class p{constructor(e,t){this.ws=e;this.runtimeStore=t;this.ws.messages().subscribe(r=>this.onMessage(r)),this.ws.stateChanges().subscribe(r=>{r==="open"&&this.lastWsState!=="open"&&this.replaySubs(),this.lastWsState=r})}outputByTaskId=new Map;event$=new I;subs=new Map;lastWsState="idle";ensureConnected(){this.ws.connect()}subscribeTask(e,t=200,r){let i=e.trim();if(!i)return;let n=Math.max(0,Math.min(5e3,t|0)),o=this.subs.get(i),s=!!r?.replay;if(!o){this.subs.set(i,{tail:n,refs:1}),this.ws.isOpen()&&this.ws.send({op:"sub",topic:"task",taskId:i,tail:n});return}let l=Math.max(o.tail,n);this.subs.set(i,{tail:l,refs:o.refs+1}),this.ws.isOpen()&&(l!==o.tail||s)&&this.ws.send({op:"sub",topic:"task",taskId:i,tail:l})}unsubscribeTask(e){let t=e.trim(),r=this.subs.get(t);if(!r)return;let i=r.refs-1;if(i>0){this.subs.set(t,c(d({},r),{refs:i}));return}this.subs.delete(t),this.ws.isOpen()&&this.ws.send({op:"unsub",topic:"task",taskId:t})}resize(e,t,r){let i=String(e??"").trim();i&&this.ws.isOpen()&&this.ws.send({op:"resize",topic:"task",taskId:i,cols:t,rows:r})}output$(e){return this.ensureOutput(e).asObservable()}events$(){return this.event$.asObservable()}status$(e){return this.runtimeStore.status$(e)}replaySubs(){for(let[e,t]of this.subs.entries())this.ws.send({op:"sub",topic:"task",taskId:e,tail:t.tail})}onMessage(e){let t=e?.op;if(t==="task.output"){let r=e.payload,i=String(r.taskId??"").trim();if(!i)return;this.ensureOutput(i).next(e);return}if(t==="task.event"){let r=e.payload,i=e.type,n=String(r.taskId??"").trim();if(!n)return;this.event$.next(e);let o=this.applyEventToRuntime(i,r,e.ts);if(o&&this.runtimeStore.setRuntime(o),(i==="exited"||i==="failed")&&setTimeout(()=>this.outputByTaskId.delete(n),300*1e3),i==="failed"){let s=r,l=`[failed] ${s?.error??""}`.trim(),a={runId:s.runId,taskId:n,stream:"stderr",text:l+`
|
|
2
|
+
`};this.ensureOutput(n).next({op:"task.output",payload:a,ts:e.ts})}}}ensureOutput(e){let t=String(e??"").trim();return this.outputByTaskId.has(t)||this.outputByTaskId.set(t,new I),this.outputByTaskId.get(t)}applyEventToRuntime(e,t,r){let i=String(t?.taskId??"").trim(),n=String(t?.runId??"").trim();if(!i||!n)return null;let o=this.runtimeStore.runtimeSignal(i)(),s=o&&o.runId===n?d({},o):{taskId:i,runId:n,projectId:String(t?.projectId??o?.projectId??"").trim(),status:"idle"};switch(e){case"snapshot":let l=t;return s.projectId=String(l?.projectId??s.projectId??"").trim(),s.status=l.status,s.startedAt=l.startedAt,s.stoppedAt=l.stoppedAt,s.pid=l.pid,s.exitCode=l.exitCode,s.signal=l.signal,s;case"started":if(o&&o.runId===n){let T=o.status;if(T==="success"||T==="failed"||T==="stopped")return o}return s.projectId=String(t?.projectId??s.projectId??"").trim(),s.status="running",s.pid=t?.pid??s.pid,s.startedAt=t?.startedAt??s.startedAt??r??Date.now(),s.stoppedAt=void 0,s.exitCode=void 0,s.signal=void 0,s;case"stopRequested":return s.status="stopping",s;case"exited":if(s.status==="success"||s.status==="stopped"||s.status==="failed")return s.exitCode=t?.exitCode??s.exitCode??null,s.signal=t?.signal??s.signal??null,s.stoppedAt=t?.stoppedAt??s.stoppedAt??r??Date.now(),s;let a=s.status==="stopping";return s.exitCode=t?.exitCode??null,s.signal=t?.signal??null,a||s.signal?s.status="stopped":s.exitCode===0?s.status="success":s.exitCode==null?s.status="stopped":s.status="failed",s.stoppedAt=t?.stoppedAt??r??Date.now(),s;case"failed":return s.status="failed",s.stoppedAt=s.stoppedAt??Date.now(),s.exitCode=s.exitCode??null,s.signal=s.signal??null,s;default:return null}}static \u0275fac=function(t){return new(t||p)(P(N),P(y))};static \u0275prov=f({token:p,factory:p.\u0275fac,providedIn:"root"})};var S=class p{api=m(b);runtimeStore=m(y);state=u({rowsByProject:{},loadingByProject:{},loadedAtByProject:{}});rowsOf(e){let t=(e??"").trim();return g(()=>this.state().rowsByProject[t]??[])}isLoading(e){let t=(e??"").trim();return g(()=>!!this.state().loadingByProject[t])}isLoaded(e){let t=(e??"").trim();return g(()=>this.state().loadedAtByProject[t]!=null)}async ensureLoaded(e,t){let r=(e??"").trim();if(!r)return;let i=this.state(),n=i.loadedAtByProject[r]!=null,o=!!i.loadingByProject[r];if(!(!t?.force&&(n||o))){this.state.update(s=>c(d({},s),{loadingByProject:c(d({},s.loadingByProject),{[r]:!0})}));try{let l=(await x(this.api.getViews(r))??[]).map(a=>({spec:a.spec,runtime:a.runtime?{taskId:a.runtime.taskId,projectId:a.runtime.projectId,runId:a.runtime.runId,status:a.runtime.status,pid:a.runtime.pid,startedAt:a.runtime.startedAt,stoppedAt:a.runtime.stoppedAt,exitCode:a.runtime.exitCode,signal:a.runtime.signal}:void 0}));for(let a of l)a.runtime&&this.runtimeStore.setRuntime(a.runtime);this.state.update(a=>c(d({},a),{rowsByProject:c(d({},a.rowsByProject),{[r]:l}),loadedAtByProject:c(d({},a.loadedAtByProject),{[r]:Date.now()})}))}finally{this.state.update(s=>c(d({},s),{loadingByProject:c(d({},s.loadingByProject),{[r]:!1})}))}}}setRows(e,t){let r=(e??"").trim();if(r){for(let i of t??[]){if(!i.runtime)continue;this.runtimeStore.runtimeSignal(i.runtime.taskId)()||this.runtimeStore.setRuntime(i.runtime)}this.state.update(i=>c(d({},i),{rowsByProject:c(d({},i.rowsByProject),{[r]:t??[]}),loadedAtByProject:c(d({},i.loadedAtByProject),{[r]:Date.now()})}))}}clear(e){let t=(e??"").trim();t&&this.state.update(r=>{let i=d({},r.rowsByProject),n=d({},r.loadingByProject),o=d({},r.loadedAtByProject);return delete i[t],delete n[t],delete o[t],{rowsByProject:i,loadingByProject:n,loadedAtByProject:o}})}static \u0275fac=function(t){return new(t||p)};static \u0275prov=f({token:p,factory:p.\u0275fac,providedIn:"root"})};var j=class p{api=m(C);projectContext=m(w);currentVersion=u(null);availableVersions=u([]);manager=u("none");loading=u(!1);error=u(null);switching=u(!1);switchError=u(null);projectRequirement=u(null);hasVersionManager=u(!1);recommendedVersions=u([]);alreadyInstalled=u(!1);canSwitch=u(!1);getNoManagerMessage(){return"\u8BF7\u5148\u5B89\u88C5 NVM \u6216 Volta \u624D\u80FD\u4F7F\u7528\u81EA\u52A8\u5207\u6362 Node \u7248\u672C\u529F\u80FD"}async getCurrentVersion(){this.loading.set(!0),this.error.set(null);try{let e=await h(this.api.get("/api/node-version/current"));e&&(this.currentVersion.set(e.current),this.availableVersions.set(e.available),this.manager.set(e.manager),this.hasVersionManager.set(e.manager!=="none"),this.canSwitch.set(e.manager!=="none"))}catch(e){this.error.set(e?.message||"\u83B7\u53D6 Node \u7248\u672C\u4FE1\u606F\u5931\u8D25")}finally{this.loading.set(!1)}}async loadProjectRequirement(){let e=this.projectContext.currentProject()?.root;if(!e){this.projectRequirement.set(null);return}try{let t=await h(this.api.post("/api/node-version/project-requirement",{projectPath:e}));this.projectRequirement.set(t)}catch(t){console.error("\u52A0\u8F7D\u9879\u76EE Node \u7248\u672C\u8981\u6C42\u5931\u8D25:",t),this.projectRequirement.set(null)}}async switchVersion(e){if(this.manager()==="none")return this.switchError.set(this.getNoManagerMessage()),!1;this.switching.set(!0),this.switchError.set(null);try{let t=await h(this.api.post("/api/node-version/switch",{version:e}));return t?(this.currentVersion.set(t.current),this.availableVersions.set(t.available),this.manager.set(t.manager),!0):!1}catch(t){let r=v(t,"\u5207\u6362 Node \u7248\u672C\u5931\u8D25");return this.switchError.set(r),!1}finally{this.switching.set(!1)}}clearSwitchError(){this.switchError.set(null)}clearError(){this.error.set(null)}generateRecommendedVersions(e){if(!e)return this.getCommonLTSVersions();let t=n=>{let s=n.replace(/^[\^~>=<]+/,"").match(/^(\d+)\.(\d+)\.(\d+)/);return s?`v${s[1]}.${s[2]}.${s[3]}`:null},r=e.split("||").map(n=>n.trim()),i=new Set;for(let n of r){let o=t(n);o&&i.add(o)}return i.size===0?this.getCommonLTSVersions():Array.from(i)}getCommonLTSVersions(){return["v18.20.0","v20.11.0","v22.11.0"]}async installVersion(e){if(this.manager()==="none")return this.switchError.set(this.getNoManagerMessage()),!1;this.error.set(null);try{let t=await h(this.api.post("/api/node-version/install",{version:e}));return t.success?(this.alreadyInstalled.set(!!t.alreadyInstalled),!0):(this.error.set(t.error||"\u5B89\u88C5\u5931\u8D25"),!1)}catch(t){let r=v(t,"\u5B89\u88C5 Node \u7248\u672C\u5931\u8D25");return this.error.set(r),!1}}async loadRecommendedVersions(){try{let e=await h(this.api.get("/api/node-version/recommended"));this.recommendedVersions.set(e)}catch(e){console.error("\u83B7\u53D6\u63A8\u8350\u7248\u672C\u5931\u8D25:",e),this.recommendedVersions.set(this.getFallbackVersions())}}getFallbackVersions(){return["v18.20.0","v20.11.0","v22.11.0"]}refresh(){this.getCurrentVersion(),this.loadProjectRequirement()}async deleteVersion(e){if(this.manager()==="none")return this.error.set("\u6CA1\u6709\u5B89\u88C5 Node \u7248\u672C\u7BA1\u7406\u5668"),!1;try{return await h(this.api.post("/api/node-version/uninstall",{version:e}))}catch(t){return this.error.set(v(t,"\u5220\u9664\u7248\u672C\u5931\u8D25")),!1}}async writeEngineConfig(e){let t=this.projectContext.currentProject()?.root;if(!t)return this.error.set("\u672A\u627E\u5230\u5F53\u524D\u9879\u76EE"),!1;try{return await h(this.api.post("/api/node-version/write-engine-config",{projectPath:t,version:e}))}catch(r){return this.error.set(v(r,"\u5199\u5165\u914D\u7F6E\u5931\u8D25")),!1}}static \u0275fac=function(t){return new(t||p)};static \u0275prov=f({token:p,factory:p.\u0275fac,providedIn:"root"})};var B=class p{api=m(b);stream=m(k);runtimeStore=m(y);catalog=m(S);nodeVersion=m(j);projectContext=m(w);notify=m(V);subscribedTaskIds=new Set;projectId=u("");keyword=u("");loading=u(!1);selectedTaskId=u("");rows=g(()=>{let e=this.projectId();return e?this.catalog.rowsOf(e)():[]});rowsView=g(()=>this.rows().map(t=>{let r=t.spec.id,i=this.getRuntimeSignal(r);return c(d({},t),{runtime:i??t.runtime})}));rowsViewFiltered=g(()=>{let e=this.keyword().trim().toLowerCase(),t=this.rowsView();return e?t.filter(r=>r.spec.name?.toLowerCase().includes(e)):t});selectedRow=g(()=>{let e=this.selectedTaskId();return this.rowsView().find(t=>t.spec.id===e)??null});selectedRuntimeStatus=g(()=>{let e=this.selectedTaskId();return e?this.getRuntime(e):{status:"idle"}});isRunning=g(()=>this.selectedRuntimeStatus().status==="running");isStopping=g(()=>this.selectedRuntimeStatus().status==="stopping");isStartable=g(()=>{let e=this.selectedRuntimeStatus().status;return e==="idle"||e==="stopped"||e==="failed"||e==="success"});constructor(){R(()=>{let e=this.projectId(),t=new Set;if(e)for(let r of this.rows()){let i=r?.spec?.id?.trim();i&&t.add(i)}this.syncTaskSubs(t),t.size>0&&this.stream.ensureConnected()}),R(e=>{let t=this.selectedTaskId();t&&(this.stream.subscribeTask(t,200),e(()=>{this.stream.unsubscribeTask(t)}))})}syncTaskSubs(e){for(let t of this.subscribedTaskIds)e.has(t)||this.stream.unsubscribeTask(t);for(let t of e)this.subscribedTaskIds.has(t)||this.stream.subscribeTask(t,0);this.subscribedTaskIds=e}getRuntime(e){return this.runtimeStore.statusSignal(e)()}getRuntimeSignal(e){return this.runtimeStore.runtimeSignal(e)()}async setProject(e){let t=e?.trim();if(!t||this.projectId()===t)return;this.projectId.set(t),this.selectedTaskId.set(""),this.keyword.set(""),await this.catalog.ensureLoaded(t);let r=this.rows()[0];r&&this.select(r.spec.id)}refresh(){let e=this.projectId();e&&(this.loading.set(!0),this.api.refresh(e).subscribe({next:t=>{this.catalog.setRows(e,t??[]);let r=this.selectedTaskId();if(r){if(!(t??[]).some(n=>n?.spec?.id===r)){let n=(t??[])[0];this.selectedTaskId.set(n?.spec?.id??"")}}else{let i=(t??[])[0];i&&this.selectedTaskId.set(i.spec.id)}this.loading.set(!1)},error:t=>{this.loading.set(!1)}}),this.api.refreshProjectScripts(e).subscribe({next:t=>{this.projectContext.patchProject(t)},error:()=>{}}))}select(e){this.selectedTaskId.set(e)}toggleTask(){this.isRunning()?this.stopSelected():this.isStartable()&&this.startSelected()}startSelected(e){e=e?.trim()||this.selectedRow()?.spec?.id,e&&this.api.start(e).subscribe({next:()=>{this.nodeVersion.refresh()},error:t=>{this.notify.error(t?.message||"\u4EFB\u52A1\u542F\u52A8\u5931\u8D25")}})}stopSelected(e){if(e=e?.trim()||this.selectedTaskId(),!e)return;let t=this.getRuntimeSignal(e);t?.status==="running"&&this.runtimeStore.setRuntime(c(d({},t),{status:"stopping"})),this.api.stop(e).subscribe({next:()=>{},error:()=>{let r=this.getRuntimeSignal(e);t&&t.status==="running"&&(!r||r.runId===t.runId&&r.status==="stopping")&&this.runtimeStore.setRuntime(t)}})}restartSelected(e){e=e?.trim()||this.selectedTaskId(),e&&this.api.restart(e).subscribe({error:t=>{this.notify.error(t?.message||"\u4EFB\u52A1\u91CD\u542F\u5931\u8D25")}})}rowsViewOf(e){return g(()=>{let t=e?.trim();return t?this.catalog.rowsOf(t)().map(i=>{let n=i.spec.id,o=this.getRuntime(n);return c(d({},i),{runtime:c(d({},i.runtime??{}),{status:o.status})})}):[]})}ensureProjectLoaded(e){return this.catalog.ensureLoaded(e)}static \u0275fac=function(t){return new(t||p)};static \u0275prov=f({token:p,factory:p.\u0275fac,providedIn:"root"})};export{k as a,j as b,B as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ia as V,Ja as R,a as K,rb as H,sb as G,ta as Q,va as $}from"./chunk-3CM4SKDO.js";import{$b as P,Fb as O,Fc as S,Gb as W,Gc as _,Hc as j,Ic as T,Jc as b,Kc as k,Lb as w,Lc as Z,Oa as v,Ub as Y,Wb as f,Yb as g,_b as M,a as L,ac as I,bc as p,cc as d,dc as c,ec as x,f as D,ic as A,jc as N,nb as s,nc as q,oa as U,r as B,s as C,sa as y,uc as l,vc as F,wc as E,yd as m,zd as J}from"./chunk-4BRW6LCZ.js";function an(t,r){if(t&1&&(d(0,"p",3),b(1),c()),t&2){let n=r.$implicit,o=l(2).$index,e=l(2);_("current",n===e.countArray[o]),s(),Z(" ",n," ")}}function rn(t,r){if(t&1&&P(0,an,2,3,"p",2,M),t&2){let n=l(3);I(n.countSingleArray)}}function ln(t,r){if(t&1&&(d(0,"span",1),f(1,rn,2,0),c()),t&2){let n=r.$index,o=l(2);S("transform","translateY("+-o.countArray[n]*100+"%)"),p("nzNoAnimation",o.noAnimation),s(),g(!o.nzDot&&o.countArray[n]!==void 0?1:-1)}}function sn(t,r){if(t&1&&P(0,ln,2,4,"span",0,M),t&2){let n=l();I(n.maxNumberArray)}}function zn(t,r){if(t&1&&b(0),t&2){let n=l();Z(" ",n.nzOverflowCount,"+ ")}}var X=["*"];function un(t,r){if(t&1&&(A(0),b(1),N()),t&2){let n=l(2);s(),k(n.nzText)}}function pn(t,r){if(t&1&&(x(0,"span",1),d(1,"span",2),w(2,un,2,1,"ng-container",0),c()),t&2){let n=l();j(n.mergedStyle),T((n.nzStatus||n.presetColor)&&"ant-badge-status-"+(n.nzStatus||n.presetColor)),s(2),p("nzStringTemplateOutlet",n.nzText)}}function dn(t,r){if(t&1&&x(0,"nz-badge-sup",3),t&2){let n=l(2);p("isPresetColor",n.nzStatus||n.presetColor)("nzColor",n.nzStatus||n.presetColor||n.nzColor)("nzOffset",n.nzOffset)("nzSize",n.nzSize)("nzTitle",n.nzTitle)("nzStyle",n.mergedStyle)("nzDot",n.nzDot)("nzCount",n.nzCount)("nzOverflowCount",n.nzOverflowCount)("disableAnimation",!!(n.nzStandalone||n.nzStatus||n.presetColor||n.noAnimation!=null&&n.noAnimation.nzNoAnimation))("noAnimation",!!(n.noAnimation!=null&&n.noAnimation.nzNoAnimation))}}function cn(t,r){if(t&1&&(A(0),f(1,dn,1,11,"nz-badge-sup",3),N()),t&2){let n=l();s(),g(n.showSup?1:-1)}}function mn(t,r){if(t&1&&(A(0),d(1,"span",3),b(2),c(),N()),t&2){let n=l();s(2),k(n.nzText)}}var Cn=(()=>{class t{nzOffset;nzTitle;nzStyle=null;nzDot=!1;nzOverflowCount=99;disableAnimation=!1;nzCount;noAnimation=!1;nzSize="default";isPresetColor=!1;nzColor;maxNumberArray=[];countArray=[];count=0;countSingleArray=[0,1,2,3,4,5,6,7,8,9];generateMaxNumberArray(){this.maxNumberArray=this.nzOverflowCount.toString().split("").map((n,o)=>`${n}-${o}`)}ngOnInit(){this.generateMaxNumberArray()}ngOnChanges(n){let{nzOverflowCount:o,nzCount:e}=n;e&&typeof e.currentValue=="number"&&(this.count=Math.max(0,e.currentValue),this.countArray=this.count.toString().split("").map(h=>+h)),o&&this.generateMaxNumberArray()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=O({type:t,selectors:[["nz-badge-sup"]],hostAttrs:[1,"ant-scroll-number"],hostVars:19,hostBindings:function(o,e){o&2&&(q("@.disabled",e.disableAnimation)("@zoomBadgeMotion",void 0),Y("title",e.nzTitle===null?"":e.nzTitle||e.nzCount),j(e.nzStyle),T(e.isPresetColor?"ant-badge-status-"+e.nzColor:""),S("right",e.nzOffset&&e.nzOffset[0]?-e.nzOffset[0]:null,"px")("margin-top",e.nzOffset&&e.nzOffset[1]?e.nzOffset[1]:null,"px"),_("ant-badge-count",!e.nzDot)("ant-badge-count-sm",e.nzSize==="small")("ant-badge-dot",e.nzDot)("ant-badge-multiple-words",e.countArray.length>=2))},inputs:{nzOffset:"nzOffset",nzTitle:"nzTitle",nzStyle:"nzStyle",nzDot:"nzDot",nzOverflowCount:[2,"nzOverflowCount","nzOverflowCount",J],disableAnimation:"disableAnimation",nzCount:"nzCount",noAnimation:"noAnimation",nzSize:"nzSize",isPresetColor:[2,"isPresetColor","isPresetColor",m],nzColor:"nzColor"},exportAs:["nzBadgeSup"],features:[v],decls:2,vars:1,consts:[[1,"ant-scroll-number-only",3,"nzNoAnimation","transform"],[1,"ant-scroll-number-only",3,"nzNoAnimation"],[1,"ant-scroll-number-only-unit",3,"current"],[1,"ant-scroll-number-only-unit"]],template:function(o,e){o&1&&f(0,sn,2,0)(1,zn,1,1),o&2&&g(e.count<=e.nzOverflowCount?0:1)},dependencies:[G],encapsulation:2,data:{animation:[H]},changeDetection:0})}return t})(),nn=["pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"],fn="badge",gn=(()=>{var z;let t,r=[],n=[],o,e=[],h=[];return z=class{nzConfigService=y(Q);dir=y(K).valueSignal;noAnimation=y(G,{host:!0,optional:!0});_nzModuleName=fn;showSup=!1;presetColor=null;nzShowZero=!1;nzShowDot=!0;nzStandalone=!1;nzDot=!1;nzOverflowCount=C(this,r,99);nzColor=(C(this,n),C(this,e,void 0));nzStyle=(C(this,h),null);nzText=null;nzTitle;nzStatus;nzCount;nzOffset;nzSize="default";get mergedStyle(){return L({backgroundColor:!this.presetColor&&this.nzColor},this.nzStyle??{})}ngOnChanges(u){let{nzColor:i,nzShowDot:a,nzDot:tn,nzCount:en,nzShowZero:on}=u;i&&(this.presetColor=this.nzColor&&nn.indexOf(this.nzColor)!==-1?this.nzColor:null),(a||tn||en||on)&&(this.showSup=this.nzShowDot&&this.nzDot||typeof this.nzCount=="number"&&(this.nzCount>0||this.nzShowZero))}},(()=>{let u=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[$()],o=[$()],B(null,null,t,{kind:"field",name:"nzOverflowCount",static:!1,private:!1,access:{has:i=>"nzOverflowCount"in i,get:i=>i.nzOverflowCount,set:(i,a)=>{i.nzOverflowCount=a}},metadata:u},r,n),B(null,null,o,{kind:"field",name:"nzColor",static:!1,private:!1,access:{has:i=>"nzColor"in i,get:i=>i.nzColor,set:(i,a)=>{i.nzColor=a}},metadata:u},e,h),u&&Object.defineProperty(z,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u})})(),D(z,"\u0275fac",function(i){return new(i||z)}),D(z,"\u0275cmp",O({type:z,selectors:[["nz-badge"]],hostAttrs:[1,"ant-badge"],hostVars:6,hostBindings:function(i,a){i&2&&_("ant-badge-status",a.nzStatus)("ant-badge-not-a-wrapper",!!(a.nzStandalone||(a.nzStatus||a.nzColor)&&!a.showSup&&!a.nzCount))("ant-badge-rtl",a.dir()==="rtl")},inputs:{nzShowZero:[2,"nzShowZero","nzShowZero",m],nzShowDot:[2,"nzShowDot","nzShowDot",m],nzStandalone:[2,"nzStandalone","nzStandalone",m],nzDot:[2,"nzDot","nzDot",m],nzOverflowCount:"nzOverflowCount",nzColor:"nzColor",nzStyle:"nzStyle",nzText:"nzText",nzTitle:"nzTitle",nzStatus:"nzStatus",nzCount:"nzCount",nzOffset:"nzOffset",nzSize:"nzSize"},exportAs:["nzBadge"],features:[v],ngContentSelectors:X,decls:3,vars:2,consts:[[4,"nzStringTemplateOutlet"],[1,"ant-badge-status-dot"],[1,"ant-badge-status-text"],[3,"isPresetColor","nzColor","nzOffset","nzSize","nzTitle","nzStyle","nzDot","nzCount","nzOverflowCount","disableAnimation","noAnimation"]],template:function(i,a){i&1&&(F(),f(0,pn,3,5),E(1),w(2,cn,2,1,"ng-container",0)),i&2&&(g((a.nzStatus||a.nzColor)&&!a.showSup&&!a.nzCount?0:-1),s(2),p("nzStringTemplateOutlet",a.nzCount))},dependencies:[Cn,R,V],encapsulation:2,data:{animation:[H]},changeDetection:0})),z})(),Sn=(()=>{class t{nzColor;nzPlacement="end";nzText=null;presetColor=null;ngOnChanges(n){let{nzColor:o}=n;o&&(this.presetColor=this.nzColor&&nn.indexOf(this.nzColor)!==-1?this.nzColor:null)}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=O({type:t,selectors:[["nz-ribbon"]],hostAttrs:[1,"ant-ribbon-wrapper"],inputs:{nzColor:"nzColor",nzPlacement:"nzPlacement",nzText:"nzText"},exportAs:["nzRibbon"],features:[v],ngContentSelectors:X,decls:4,vars:11,consts:[[1,"ant-ribbon"],[4,"nzStringTemplateOutlet"],[1,"ant-ribbon-corner"],[1,"ant-ribbon-text"]],template:function(o,e){o&1&&(F(),E(0),d(1,"div",0),w(2,mn,3,1,"ng-container",1),x(3,"div",2),c()),o&2&&(s(),T(e.presetColor&&"ant-ribbon-color-"+e.presetColor),S("background-color",!e.presetColor&&e.nzColor),_("ant-ribbon-placement-end",e.nzPlacement==="end")("ant-ribbon-placement-start",e.nzPlacement==="start"),s(),p("nzStringTemplateOutlet",e.nzText),s(),S("color",!e.presetColor&&e.nzColor))},dependencies:[R,V],encapsulation:2,changeDetection:0})}return t})(),Pn=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=W({type:t});static \u0275inj=U({imports:[gn,Sn]})}return t})();export{gn as a,Pn as b};
|