1import{a as ie,b as ce}from"./chunk-AA7M5EQV.js";import{a as Q}from"./chunk-YV56GAFK.js";import{d as re,f as le}from"./chunk-Q5SLRC24.js";import"./chunk-WH2NDIVD.js";import{d as de,e as se,f as me,g as pe,h as _e,i as ue,j as fe,k as he,l as ge}from"./chunk-3JE73HUI.js";import"./chunk-X4KHB44B.js";import"./chunk-W26EEZAT.js";import{a as O}from"./chunk-2NTX4N7N.js";import"./chunk-C7TKO2LS.js";import"./chunk-ME7PWBSM.js";import"./chunk-TUEEN7FA.js";import{a as ae,b as oe}from"./chunk-5P6FBDGC.js";import{Aa as X,Ac as ne,Da as Y,Ec as w,Ga as M,ja as D,wc as Z,xc as ee,zc as te}from"./chunk-DCUU6NHZ.js";import{$d as J,Ad as W,Bd as U,Db as C,Jd as H,Nc as A,Qd as R,Ub as l,Vb as a,Wb as o,Xb as z,be as q,cc as k,eb as L,fc as b,g as B,ib as i,ic as d,jc as P,kc as I,ke as G,sa as x,sb as E,ta as v,we as K,xb as F,xc as r,yc as m,zc as T,ze as _}from"./chunk-RA4DXI5M.js";var Ce=["*","*","*","*"];function xe(n,t){if(n&1){let e=k();a(0,"button",15),b("click",function(){x(e);let s=d(2);return v(s.handleSubmit())}),r(1),o()}if(n&2){let e=d(2);l("nzLoading",e.submitting),i(),T(" ",e.$t("_save")," ")}}function ve(n,t){n&1&&(a(0,"div",16),r(1," \u5904\u7406\u5B8C\u6210\u6240\u6709\u6570\u636E\u540E\u9700\u8981\u70B9\u51FB\u4E00\u6B21\u4FDD\u5B58\u65B9\u53EF\u751F\u6548 "),o())}function be(n,t){if(n&1&&(z(0,"app-logo",21),a(1,"div"),r(2,"\u2193"),o()),n&2){let e=d(2).$implicit;l("src",e.oldData.icon)("name",e.oldData.name)}}function ye(n,t){n&1&&I(0,0,["*ngIf","data.oldData"],be,3,2)}function Se(n,t){if(n&1){let e=k();a(0,"a",18),b("click",function(s){x(e);let p=d(2).$implicit,u=d(2);return v(u.jumpService.goUrl(s,p.oldData.url))}),r(1),o(),a(2,"div"),r(3,"\u2193"),o()}if(n&2){let e=d(2).$implicit;i(),m(e.oldData.name)}}function ze(n,t){n&1&&I(0,1,["*ngIf","data.oldData"],Se,4,1)}function ke(n,t){if(n&1&&z(0,"tag-list",25),n&2){let e=d(3).$implicit;l("data",e.oldData.tags)}}function Ie(n,t){if(n&1&&(C(0,ke,1,1,"tag-list",23),a(1,"div"),r(2,"\u2193"),o()),n&2){let e=d(2).$implicit;l("ngIf",e.oldData.tags)}}function Te(n,t){n&1&&I(0,2,["*ngIf","data.oldData"],Ie,3,1)}function De(n,t){if(n&1&&z(0,"tag-list",25),n&2){let e=d().$implicit;l("data",e.tags)}}function Ee(n,t){if(n&1&&(a(0,"pre",26),r(1),o(),a(2,"div"),r(3,"\u2193"),o()),n&2){let e=d(2).$implicit;i(),m(e.oldData.desc)}}function we(n,t){n&1&&I(0,3,["*ngIf","data.oldData"],Ee,4,1)}function Oe(n,t){if(n&1){let e=k();a(0,"tr")(1,"td",17),b("nzCheckedChange",function(s){let p=x(e).$implicit,u=d(2);return v(u.onItemChecked(p.extra.uuid,s))}),o(),a(2,"td")(3,"a",18),b("click",function(){let s=x(e),p=s.$implicit,u=s.index,h=d(2);return v(h.handleClick(p,u))}),r(4),o()(),a(5,"td"),r(6),o(),a(7,"td"),r(8),o(),a(9,"td",19),C(10,ye,2,0,"ng-content",20),z(11,"app-logo",21),o(),a(12,"td"),C(13,ze,2,0,"ng-content",20),a(14,"a",22),b("click",function(s){let p=x(e).$implicit,u=d(2);return v(u.jumpService.goUrl(s,p.url))}),o()(),a(15,"td"),C(16,Te,2,0,"ng-content",20)(17,De,1,1,"tag-list",23),o(),a(18,"td"),C(19,we,2,0,"ng-content",20),z(20,"pre",24),o(),a(21,"td"),r(22),o(),a(23,"td"),r(24),o()()}if(n&2){let e=t.$implicit,c=d(2);i(),l("nzChecked",c.setOfCheckedId.has(e.extra.uuid)),i(3),m(c.$t("_handle")),i(2),m(c.typeMap[e.extra.type]),i(2),m(e.id),i(2),l("ngIf",e.oldData),i(),l("src",e.icon)("name",e.name),i(2),l("ngIf",e.oldData),i(),l("innerHTML",e.name,L),i(2),l("ngIf",e.oldData),i(),l("ngIf",e.tags),i(2),l("ngIf",e.oldData),i(),l("innerHTML",e.desc,L),i(2),T(" ",e.breadcrumb," "),i(2),m(e.createdAt)}}function Ne(n,t){if(n&1){let e=k();a(0,"div",3),C(1,xe,2,2,"button",4),a(2,"button",5),b("click",function(){x(e);let s=d();return v(s.getUserCollect())}),r(3),o(),a(4,"button",6),b("click",function(){x(e);let s=d();return v(s.batchDelete())}),r(5),o(),C(6,ve,2,0,"div",7),a(7,"nz-table",8,0)(9,"thead")(10,"tr")(11,"th",9),b("nzCheckedChange",function(s){x(e);let p=d();return v(p.onAllChecked(s))}),o(),a(12,"th",10),r(13),o(),a(14,"th",10),r(15),o(),a(16,"th",10),r(17,"ID"),o(),a(18,"th",10),r(19),o(),a(20,"th",11),r(21),o(),a(22,"th",11),r(23),o(),a(24,"th",12),r(25),o(),a(26,"th",12),r(27),o(),a(28,"th",13),r(29),o()()(),a(30,"tbody"),C(31,Oe,25,15,"tr",14),o()()()}if(n&2){let e=d();i(),l("ngIf",!e.isSelfDevelop),i(),l("nzLoading",e.submitting),i(),T(" ",e.$t("_refresh")," "),i(),l("nzLoading",e.submitting),i(),T(" ",e.$t("_del")," "),i(),l("ngIf",!e.isSelfDevelop),i(),l("nzData",e.dataList)("nzShowPagination",!1),i(4),l("nzChecked",e.checked),i(2),m(e.$t("_action")),i(2),m(e.$t("_type")),i(4),m(e.$t("_icon")),i(2),m(e.$t("_webName")),i(2),m(e.$t("_associatedLabels")),i(2),m(e.$t("_webDesc")),i(2),m(e.$t("_webTag")),i(2),m(e.$t("_createAt")),i(2),l("ngForOf",e.dataList)("ngForTrackBy",e.trackByItem)}}var V=class n{constructor(t,e,c){this.message=t;this.modal=e;this.jumpService=c}$t=_;isSelfDevelop=G;isPermission=!!J();submitting=!1;dataList=[];authCode="";typeMap={1:_("_add"),2:_("_edit"),3:_("_del")};setOfCheckedId=new Set;checked=!1;ngOnInit(){this.getUserCollect()}
1onAllChecked(t){this.checked=t,this.dataList.forEach(e=>{t?this.setOfCheckedId.add(e.extra.uuid):this.setOfCheckedId.delete(e.extra.uuid)})}onItemChecked(t,e){e?this.setOfCheckedId.add(t):this.setOfCheckedId.delete(t)}batchDelete(){this.submitting||!this.setOfCheckedId.size||this.modal.confirm({nzTitle:_("_confirmDel"),nzOkDanger:!0,nzWidth:350,nzOkText:_("_del"),nzOnOk:()=>{this.submitting=!0,M({data:this.dataList.filter(t=>this.setOfCheckedId.has(t.extra.uuid))}).then(t=>{this.checked=!1,this.setOfCheckedId.clear(),this.dataList=t.data?.data||[]}).finally(()=>{this.submitting=!1})}})}handleDelete(t){this.submitting=!0,M({data:[this.dataList[t]]}).then(e=>{this.dataList=e.data?.data||[]}).finally(()=>{this.submitting=!1})}highlightDifferences(t,e){function c(S,j){let N=S.length,$=j.length,y=Array.from({length:N+1},()=>Array($+1).fill(""));for(let f=1;f<=N;f++)for(let g=1;g<=$;g++)S[f-1]===j[g-1]?y[f][g]=y[f-1][g-1]+S[f-1]:y[f][g]=y[f-1][g].length>y[f][g-1].length?y[f-1][g]:y[f][g-1];return y[N][$]}let s=c(t,e),p="",u=0,h=0;for(let S of s){for(;u<t.length&&t[u]!==S;)u++;for(;h<e.length&&e[h]!==S;)p+=`<b>${e[h]}</b>`,h++;p+=S,u++,h++}for(;h<e.length;)p+=`<b>${e[h]}</b>`,h++;return p}getUserCollect(){this.submitting=!0,Y().then(t=>{this.isPermission=!0,this.dataList=(t.data?.data||[]).map(e=>(e.extra.type===2&&(e.oldData=le(e.id),e.oldData&&(e.name=this.highlightDifferences(e.oldData.name,e.name),e.desc=this.highlightDifferences(e.oldData.desc,e.desc))),e))}).finally(()=>{this.submitting=!1})}handleSubmitAuthCode(){this.submitting||!this.authCode||(q(this.authCode),this.getUserCollect())}handleCreate(t,e){let c=this;D.emit("CREATE_WEB",{parentId:t.parentId,detail:t,isMove:!0}),D.emit("SET_CREATE_WEB",{parentId:t.parentId,breadcrumb:t.breadcrumb,detail:null,callback(){c.handleDelete(e)}})}handleDeleteWeb(t,e){this.modal.info({nzTitle:_("_confirmDel"),nzOnOk:()=>B(this,null,function*(){(yield re([t.id]))?this.message.success(_("_delSuccess")):this.message.error("Delete failed"),this.handleDelete(e)})})}handleUpdateWeb(t,e){let c=this;D.emit("CREATE_WEB",{detail:t}),D.emit("SET_CREATE_WEB",{callback(){c.handleDelete(e)}})}handleClick(t,e){t.extra.type===1?this.handleCreate(t,e):t.extra.type===3?this.handleDeleteWeb(t,e):t.extra.type===2&&this.handleUpdateWeb(t,e)}handleSubmit(){this.submitting||this.modal.info({nzTitle:_("_syncDataOut"),nzOkText:_("_confirmSync"),nzContent:_("_confirmSyncTip"),nzOnOk:()=>{this.submitting=!0,X({message:"update db",content:JSON.stringify(K()),path:R}).then(()=>{this.message.success(_("_syncSuccessTip"))}).finally(()=>{this.submitting=!1})}})}trackByItem(t,e){return e.id}static \u0275fac=function(e){return new(e||n)(E(w),E(O),E(Q))};static \u0275cmp=F({type:n,selectors:[["user-collect"]],features:[A([w,O])],ngContentSelectors:Ce,decls:2,vars:2,consts:[["basicTable",""],["nzTip","Loading...",3,"nzSpinning"],["class","mt-4",4,"ngIf"],[1,"mt-4"],["nz-button","","nzType","primary","style","margin-right: 20px",3,"nzLoading","click",4,"ngIf"],["nz-button","",3,"click","nzLoading"],["nz-button","","nzType","primary","nzDanger","",2,"margin-left","20px",3,"click","nzLoading"],["class","mt-2.5 !text-red-500 font-bold",4,"ngIf"],[1,"mt-2.5",3,"nzData","nzShowPagination"],[1,"min-w-[100px]",3,"nzCheckedChange","nzChecked"],[1,"min-w-[80px]"],[1,"min-w-[100px]"],[1,"min-w-[300px]"],[1,"min-w-[200px]"],[4,"ngFor","ngForOf","ngForTrackBy"],["nz-button","","nzType","primary",2,"margin-right","20px",3,"click","nzLoading"],[1,"mt-2.5","!text-red-500","font-bold"],[3,"nzCheckedChange","nzChecked"],[3,"click"],[1,"text-center"],[4,"ngIf"],[3,"src","name"],[3,"click","innerHTML"],[3,"data",4,"ngIf"],[1,"desc",3,"innerHTML"],[3,"data"],[1,"desc"]],template:function(e,c){e&1&&(P(Ce),a(0,"nz-spin",1),C(1,Ne,32,19,"div",2),o()),e&2&&(l("nzSpinning",c.submitting),i(),l("ngIf",c.isPermission))},dependencies:[H,W,U,oe,ae,ne,te,Z,ee,ge,ue,de,me,se,he,_e,fe,pe,ie,ce],styles:[".add-btn[_ngcontent-%COMP%]{margin-bottom:20px;margin-right:20px}.desc[_ngcontent-%COMP%]{width:300px;white-space:pre-wrap}.ant-table-wrapper[_ngcontent-%COMP%]{overflow:auto}"]})};export{V as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.