PageSourceSearch

https://app.fylehq.com/app/chunk-YB57HOYO.js

js fylehq.com collected 2026-10-01 11:24:51 UTC 44,143 bytes, 3 lines download raw bytes

1import{a as We}from"./chunk-4N3KW6HO.js";import{a as H}from"./chunk-GXUTAGSR.js";import{a as $e}from"./chunk-2LERPDEX.js";import{a as ze}from"./chunk-DLTZYW7P.js";import{a as bt,b as St}from"./chunk-FNOGGWQN.js";import{a as Ft}from"./chunk-UOCTFLXN.js";import{a as xt}from"./chunk-AK24VNC3.js";import{a as oe}from"./chunk-JXXGEORH.js";import{a as Mt}from"./chunk-OCPNAQPG.js";import{d as Dt}from"./chunk-QD3LZZR2.js";import{b as yt}from"./chunk-Z2NYEZ6M.js";import"./chunk-CG3JJIIC.js";import"./chunk-RPTTJAYU.js";import"./chunk-UZ7BOQAX.js";import"./chunk-6L7ZHOIB.js";import{a as Tt}from"./chunk-EQKEXRGX.js";import{a as wt}from"./chunk-2TT2W2QJ.js";import"./chunk-537TI2QE.js";import"./chunk-VXC4ISOG.js";import"./chunk-7OVXKJB2.js";import"./chunk-4FZHKMBF.js";import"./chunk-AET5CL3L.js";import"./chunk-JTNNO5MY.js";import"./chunk-NKVMWHQP.js";import"./chunk-RE4URFUG.js";import"./chunk-TNBJEWPN.js";import"./chunk-LCTT3CXO.js";import"./chunk-ZPINFUDZ.js";import{a as Et}from"./chunk-HWCDHIY3.js";import"./chunk-KXJNYWN6.js";import"./chunk-FUYHSYQC.js";import{a as xe}from"./chunk-LWE5BGYD.js";import"./chunk-EQI477TR.js";import"./chunk-KNXSWGR2.js";import{a as _t}from"./chunk-DG34TDLE.js";import{b as te}from"./chunk-XPZL7SVL.js";import{b as Le,c as Pe,e as Ue}from"./chunk-TAKYG57S.js";import{a as vt}from"./chunk-VHEKEBKZ.js";import{a as ft}from"./chunk-PAS73AAT.js";import{a as ht}from"./chunk-EGRKITF5.js";import{a as Oe}from"./chunk-J367VTCS.js";import"./chunk-RQJM5YXQ.js";import{a as q}from"./chunk-K7LU5EP5.js";import"./chunk-4W6XEUQP.js";import"./chunk-RUQLWP4W.js";import{a as Ve}from"./chunk-TFMPY3ZK.js";import"./chunk-U46GHHQU.js";import"./chunk-5KFZRJE5.js";import"./chunk-W27Y7QUQ.js";import"./chunk-O3GGC5YS.js";import"./chunk-TIBQBFJA.js";import"./chunk-VAS2JVRV.js";import{a as At}from"./chunk-OZAHY3JR.js";import"./chunk-WXWEVNII.js";import{a as Be,b as ke}from"./chunk-RSBEUDL3.js";import"./chunk-RNQMMWEC.js";import"./chunk-ECZL26C5.js";import"./chunk-OTZ2GYQO.js";import"./chunk-CAVH7CEE.js";import"./chunk-5TJOF536.js";import{a as K}from"./chunk-VMGPCW3Q.js";import"./chunk-6SUYU4G2.js";import"./chunk-JQZ6SCKC.js";import{a as ie}from"./chunk-K5JPTH2W.js";import"./chunk-ULGA26WS.js";import"./chunk-2MPHJFTA.js";import"./chunk-G7KR66MF.js";import"./chunk-S26T5ZIH.js";import{a as He,e as Te}from"./chunk-UO2KZQPH.js";import{b as De,c as Fe,d as Ne,e as Ie,h as Re}from"./chunk-7TAGCGBE.js";import{a as X}from"./chunk-Y5RRPE3B.js";import{j as Q,l as fe}from"./chunk-7UBXSZOY.js";import{a as Se}from"./chunk-P52AOK2G.js";import"./chunk-RNJSETGD.js";import"./chunk-J2737D6V.js";import{a as Me,b as ee}from"./chunk-LZT2V666.js";import"./chunk-4A7R5BB7.js";import{Bd as ct,Cc as O,Ec as ye,Ed as dt,Fd as mt,Fe as J,Id as ut,Ld as gt,Md as $,Nd as Ct,Ne as Ee,P as at,Tc as Z,V as D,W as st,ae as x,be as F,ce as N,ld as be,ma as ve,nd as M,qd as P,rd as pt,xd as z,yc as Ae,yd as lt,zc as we}from"./chunk-YXROKL4T.js";import"./chunk-MT6FXMKE.js";import{$b as _,Aa as f,Ba as v,Hb as T,Lc as E,Ma as d,Mc as U,Nc as W,O as L,Oc as nt,Sc as j,Tc as G,Uc as Y,Y as pe,Yc as ce,Zc as _e,bc as h,cc as it,cd as he,dc as ot,dd as rt,ec as ge,f as k,fa as le,fc as Ce,ga as y,gc as r,hc as a,ia as Ke,ic as p,j as R,jc as m,kb as ue,kd as l,ld as c,md as de,pa as et,qc as S,rb as n,s as Je,ta as tt,ua as s,uc as w,ud as V,wc as u,z as me}from"./chunk-5VQKZTJF.js";import{a as ae,b as se}from"./chunk-OKNOHCUX.js";var Nt=(()=>{class i{customApp=d(null);enabled=d(!1);routerOAuthService=s(H);toastMessageService=s(q);translocoService=s(x);routingService=s(X);componentDestroyed$=new k;changeState(){this.customApp.update(e=>se(ae({},e),{enabled:this.enabled()})),this.routerOAuthService.upsertThirdPartyApp(this.customApp()).pipe(y(this.componentDestroyed$),L(e=>(this.customApp.update(t=>se(ae({},t),{enabled:!this.enabled()})),this.toastMessageService.showErrorToast(this.translocoService.translate("customAppActionCell.toastErrorSomethingWentWrong")),R))).subscribe(e=>{let t=this.enabled()?this.translocoService.translate("customAppActionCell.statusEnabled"):this.translocoService.translate("customAppActionCell.statusDisabled");this.toastMessageService.showSuccessToast(this.translocoService.translate("customAppActionCell.toastSuccessApplicationStatus",{status:t}))})}editCustomApp(){this.routingService.navigate(`developers/integrations/custom_apps/add_edit_application/${this.customApp()?.id}`)}gridCellInit(e){this.customApp.set(e.rowData),this.enabled.set(this.customApp()?.enabled)}ngOnDestroy(){this.componentDestroyed$.next(),this.componentDestroyed$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["feature-custom-app-action-cell"]],decls:6,vars:13,consts:[[1,"tw:w-full","tw:h-full","tw:flex","tw:items-center","tw:gap-spacing-6","tw:relative"],[1,"tw:flex","tw:items-center","tw:justify-center","tw:max-h-32-px","tw:w-32-px","tw:rounded-border-radius-2xs","tw:outline-badge-light-border-color","tw:mr-spacing-4"],[3,"click","fdlTooltip","tooltipDirection","icon","containerClasses","classes"],[3,"ngModelChange","click","fdlTooltip","tooltipDirection","showState","ngModel"]],template:function(t,o){t&1&&(a(0,"div",0)(1,"div",1)(2,"ui-svg-sprite",2),l(3,"transloco"),w("click",function(){return o.editCustomApp()}),p()(),a(4,"ui-switch",3),l(5,"transloco"),Y("ngModelChange",function(A){return G(o.enabled,A)||(o.enabled=A),A}),w("ngModelChange",function(){return o.changeState()}
1)("click",function(A){return A.stopPropagation()}),p()()),t&2&&(n(2),r("fdlTooltip",c(3,9,"customAppActionCell.tooltipEdit"))("tooltipDirection","top")("icon","edit")("containerClasses","tw:flex")("classes","tw:h-16-px tw:w-16-px tw:fill-icon-brand-primary"),n(2),r("fdlTooltip",c(5,11,"customAppActionCell.tooltipToggle"))("tooltipDirection","top")("showState",!0),j("ngModel",o.enabled))},dependencies:[xt,$,P,z,Ee,Me,N,F],encapsulation:2})}return i})();var It=(()=>{class i{translocoService;constructor(e){this.translocoService=e}getSortValueForUndefinedValues(e,t,o){return e==null&&t==null?0:e==null?o.order==="asc"?1:-1:o.order==="asc"?-1:1}getSortValueForDefinedValues(e,t,o){return e<t?o.order==="asc"?-1:1:e>t?o.order==="asc"?1:-1:0}sortItems(e,t){return e.sort((o,g)=>{let A=o[t.field],b=g[t.field];return A!=null&&b!=null?this.getSortValueForDefinedValues(A,b,t):this.getSortValueForUndefinedValues(A,b,t)})}getColumns(){return[{name:this.translocoService.translate("services.customApps.columnAppName"),id:"name",field:"name",styleClass:"tw:min-w-[80px]",visible:!0},{name:this.translocoService.translate("services.customApps.columnClientId"),id:"client_id",field:"client_id",styleClass:"tw:min-w-[160px]",visible:!0},{name:this.translocoService.translate("services.customApps.columnDescription"),id:"description",field:"description",styleClass:"tw:min-w-[250px]",visible:!0},{name:this.translocoService.translate("services.customApps.columnEnabled"),id:"enabled",field:"enabled",component:Nt,styleClass:"tw:min-w-[160px]",visible:!0}]}getConfig(){return{defaultQueryParams:{},defaultAppliedFilters:[],defaultSortConfig:{field:"name",order:"asc"},filters:[],columnDefs:this.getColumns()}}static \u0275fac=function(t){return new(t||i)(tt(x))};static \u0275prov=et({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Vt(i,C){if(i&1){let e=S();a(0,"ui-accounts-header",5),w("signOut",function(){f(e);let o=u();return v(o.logout())})("backButtonClick",function(){f(e);let o=u();return v(o.goBackToApp())}),p()}if(i&2){let e,t=u();r("header",t.eou().us.full_name)("orgName",t.eou().ou.org_name)("styleClass","tw:bg-bg-black")("iconUrl",(e=t.targetConfig())==null?null:e.FULL_LOGO_URL_WHITE)}}function zt(i,C){i&1&&(a(0,"div",3)(1,"ui-spinner-loader",6),E(2),l(3,"transloco"),p()()),i&2&&(n(),r("styleClass","spinner-50"),n(),U(c(3,2,"customApps.loadingText")))}function $t(i,C){i&1&&(a(0,"div",16)(1,"div",17),m(2,"ui-shimmers",18),p()()),i&2&&(n(2),r("height",24))}function qt(i,C){if(i&1&&ge(0,$t,3,1,"div",16,it),i&2){let e=u(3);Ce(e.gridShimmers())}}function Ht(i,C){if(i&1){let e=S();a(0,"ui-grid",19),w("columnSort",function(o){f(e);let g=u(3);return v(g.onColumnSort(o))})("rowClicked",function(o){f(e);let g=u(3);return v(g.onRowClicked(o))})("pageNumberChange",function(o){f(e);let g=u(3);return v(g.onPageNumberChange(o))})("pageSizeChange",function(o){f(e);let g=u(3);return v(g.onPageSizeChange(o))}),p()}if(i&2){let e=u(3);r("columnConfig",e.config().columnDefs)("data",e.customApps())("enableRowSelection",!1)("showManageColumns",!1)("pageSize",e.pageSize())("currentPageNumber",e.pageNumber())("totalItemsCount",e.allCustomApps().length)("sortConfig",e.sortConfig())("showOpenInNewTab",!1)}}function Wt(i,C){if(i&1){let e=S();a(0,"div",9)(1,"div",11)(2,"ui-search-input",12),w("ngModelChange",function(o){f(e);let g=u(2);return v(g.onSearch(o))}),p(),m(3,"ui-grid-actions",13),p(),a(4,"div",14)(5,"div",14),_(6,qt,2,0)(7,Ht,1,9,"ui-grid",15),p()()()}if(i&2){let e=u(2);n(2),r("expandedView",!0)("ngModel",e.searchQuery())("debounce",400),n(),r("actions",e.actions()),n(3),h(e.isLoading()?6:7)}}function jt(i,C){if(i&1){let e=S();a(0,"ui-zero-state",10),l(1,"transloco"),a(2,"ui-button",20),l(3,"transloco"),w("buttonClick",function(){f(e);let o=u(2);return v(o.addNewCustomApp())}),p()()}if(i&2){let e=u(2);r("imageUrl","assets/images/developer.png")("imageClass","tw:w-1/5")("noDataText",c(1,9,"customApps.zeroStateNoDataText")),n(2),r("buttonType",e.buttonType.PRIMARY)("buttonSize",e.buttonSize.SMALL)("iconName","plus")("iconContainerClasses","tw:h-14-px")("iconClasses","tw:w-14-px tw:h-14-px tw:fill-icon-white tw:mr-spacing-8")("label",c(3,11,"customApps.buttonAddNewApplicationLabel"))}}function Gt(i,C){if(i&1&&(a(0,"div",4)(1,"div",7)(2,"h3",8),E(3),l(4,"transloco"),p()(),_(5,Wt,8,5,"div",9)(6,jt,4,13,"ui-zero-state",10),p()),i&2){let e=u();n(3),W(" ",c(4,2,"customApps.sectionTitle")," "),n(2),h(e.allCustomApps().length>0?5:6)}}var Rt=(()=>{class i{routerOauthService=s(H);targetAppConfigService=s(ie);targetConfig=d(this.targetAppConfigService.getTargetConfig());customAppsService=s(It);gridService=s(yt);config=d(this.customAppsService.getConfig());allCustomApps=d([]);customApps=V(()=>{let e=[...this.allCustomApps()];this.searchQuery()&&(e=e.filter(g=>g.name.toLowerCase().includes(this.searchQuery().toLowerCase()))),e=this.customAppsService.sortItems(e,this.sortConfig());let t=(this.pageNumber()-1)*this.pageSize(),o=t+this.pageSize();return e.slice(t,o)});eou=d(null);isLoading=d(!1);searchQuery=d("");sortConfig=d(null);pageNumber=d(1);pageSize=d(this.gridService.getPageSizeFromStorage());translocoService=s(x);gridShimmers=d(Array.from({length:10}));actions=d([{label:this.translocoService.translate("customApps.actionCreateNewApp"),t
1ype:D.PRIMARY,visible:!0,callbackMethod:()=>{this.routingService.navigate("developers/integrations/custom_apps/add_edit_application")},nested:!1}]);activatedRoute=s(Q);router=s(fe);componentDestroyed$=new k;trackingService=s(Te);routingService=s(X);authService=s(J);redirectionService=s(K);userEventService=s(xe);get buttonType(){return D}get buttonSize(){return st}onColumnSort(e){this.sortConfig.set(e),this.pageNumber.set(1)}onRowClicked(e){this.routingService.navigate(`developers/integrations/custom_apps/add_edit_application/${e.id}`)}onPageNumberChange(e){this.pageNumber.set(e)}onPageSizeChange(e){this.pageSize.set(e),this.pageNumber.set(1)}onSearch(e){this.trackingService.eventTrack("ListView Beta Simple Search",{SearchQuery:e}),this.searchQuery.set(e),this.pageNumber.set(1)}initializeSearchQuery(){if(this.activatedRoute.snapshot.queryParams.search_query){let e=atob(this.activatedRoute.snapshot.queryParams.search_query);this.searchQuery.set(e)}}initializePagination(){this.activatedRoute.snapshot.queryParams.page_number&&this.pageNumber.set(Number(this.activatedRoute.snapshot.queryParams.page_number)),this.activatedRoute.snapshot.queryParams.page_size&&this.pageSize.set(Number(this.activatedRoute.snapshot.queryParams.page_size))}initializeSortConfig(){this.activatedRoute.snapshot.queryParams.sort_column&&this.activatedRoute.snapshot.queryParams.sort_dir?this.sortConfig.set({field:this.activatedRoute.snapshot.queryParams.sort_column,order:this.activatedRoute.snapshot.queryParams.sort_dir}):this.sortConfig.set(this.config().defaultSortConfig)}fetchAllCustomApps(){this.isLoading.set(!0),this.routerOauthService.getAllThirdPartyApps().pipe(y(this.componentDestroyed$),pe(()=>this.isLoading.set(!1))).subscribe(e=>{this.allCustomApps.set(e)})}addNewCustomApp(){this.routingService.navigate("developers/integrations/custom_apps/add_edit_application")}logout(){this.userEventService.logout()}goBackToApp(){this.redirectionService.goToAccountsApp()}ngOnInit(){this.eou.set(this.authService.getEou()),this.trackingService.eventTrack("Custom apps page visited"),this.initializeSearchQuery(),this.initializeSortConfig(),this.initializePagination(),this.fetchAllCustomApps()}ngOnDestroy(){this.componentDestroyed$.next(),this.componentDestroyed$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["feature-custom-apps"]],decls:7,vars:12,consts:[[3,"header","orgName","styleClass","iconUrl"],[1,"tw:w-full","tw:min-h-full","tw:overflow-y-scroll","tw:flex","tw:flex-col","tw:items-center","tw:bg-bg-tertiary-dark"],[1,"tw:w-full","tw:border-0","tw:border-b","tw:border-solid","tw:border-border-medium-light-gray","tw:bg-bg-white",3,"title","description","url"],[1,"tw:my-[200px]"],[1,"tw:w-full","tw:m-spacing-16","tw:mt-spacing-24","tw:border","tw:border-solid","tw:border-border-medium-light-gray","tw:rounded-border-radius-xs","tw:md:max-w-[85%]","tw:bg-bg-white"],[3,"signOut","backButtonClick","header","orgName","styleClass","iconUrl"],[3,"styleClass"],[1,"tw:p-spacing-16","tw:border-0","tw:border-b","tw:border-solid","tw:border-border-medium-light-gray"],[1,"tw:uppercase","tw:text-size-16!","tw:mb-spacing-8"],[1,"tw:p-spacing-24","tw:pb-spacing-0"],[3,"imageUrl","imageClass","noDataText"],[1,"tw:flex","tw:items-center","tw:justify-between","tw:mb-spacing-24"],[3,"ngModelChange","expandedView","ngModel","debounce"],[3,"actions"],[1,"tw:flex-grow","tw:flex","tw:flex-col"],[3,"columnConfig","data","enableRowSelection","showManageColumns","pageSize","currentPageNumber","totalItemsCount","sortConfig","showOpenInNewTab"],[1,"tw:border-0","tw:border-b","tw:border-solid","tw:border-lv-table-border-color","tw:flex","tw:items-center","tw:h-[70px]","tw:bg-lv-table-list-item-bg"],[1,"tw:px-spacing-24","tw:w-full"],[3,"height"],[3,"columnSort","rowClicked","pageNumberChange","pageSizeChange","columnConfig","data","enableRowSelection","showManageColumns","pageSize","currentPageNumber","totalItemsCount","sortConfig","showOpenInNewTab"],[3,"buttonClick","buttonType","buttonSize","iconName","iconContainerClasses","iconClasses","label"]],template:function(t,o){t&1&&(_(0,Vt,1,4,"ui-accounts-header",0),a(1,"div",1),m(2,"ui-page-header",2),l(3,"transloco"),l(4,"transloco"),_(5,zt,4,4,"div",3)(6,Gt,7,4,"div",4),p()),t&2&&(h(o.eou()?0:-1),n(2),r("title",ce(c(3,8,"customApps.pageHeaderTitle")))("description",ce(c(4,10,"customApps.pageHeaderDescription")))("url",_e("",o.targetConfig().HELP_ARTICLES_DOMAIN,"/en/articles/3045578-integrating-with-fyle")),n(3),h(o.isLoading()?5:6))},dependencies:[$,P,z,$e,ee,Tt,Et,At,Dt,Ft,Oe,N,ze,F],styles:[`.page-margins[_ngcontent-%COMP%]{margin-inline:var(--tw-margin-spacing-26, 1.625rem)}@media (width >= 960px){.page-margins[_ngcontent-%COMP%]{margin-inline:var(--tw-margin-spacing-65, 4.0625rem)}}@media (width >= 1440px){.page-margins[_ngcontent-%COMP%]{margin-inline:var(--tw-margin-spacing-120, 7.5rem)}}
2`]})}return i})();function Qt(i,C){if(i&1&&(a(0,"div",2),m(1,"ui-input-label",3),l(2,"transloco"),a(3,"div",4),m(4,"input",5)(5,"ui-copy-text",6),p()()),i&2){let e,t,o=u();n(),r("label",c(2,5,"copyCustomAppCredentialsDialog.refreshTokenLabel")),n(3),r("value",(e=o.customApp())==null?null:e.refresh_token),n(),r("text",(t=o.customApp())==null?null:t.refresh_token)("iconSize",o.CopyIconSize.LARGE)("containerClasses","tw:flex tw:cursor-pointer tw:ml-spacing-2")}}var Ot=(()=>{class i{customApp=d(null);command=d("");CopyIconSize=Le;CopyIconFill=Pe;translocoService=s(x);primaryAction=V(()=>({label:this.translocoService.translate("copyCustomAppCredentialsDialog.proceedButtonLabel"),disabled:this.command()!=="copied",type:D.PRIMARY,callbackMethod:()=>{this.closeDialog(O.SUCCESS)}}));dialogRef=s(we);dialogConfig=s(Ae);get ModalHeaderTypes(){return ye}get AlertTypes(){return ve}closeDialog(e=O.CANCEL){this.dialogRef.close(e)}ngOnInit(){let{customApp:e}=this.dialogConfig.data;this.customApp.set(e)}static \u0275fac=function(t){return new(t||i)};
2static \u0275cmp=T({type:i,selectors:[["ui-copy-custom-app-credentials-dialog"]],decls:25,vars:29,consts:[[3,"title","type","showCloseButton"],[1,"tw:mb-spacing-12","tw:block",3,"type","message"],[1,"tw:mb-spacing-24"],[3,"label"],[1,"tw:flex","tw:flex-row","tw:items-center","tw:justify-between"],["pInputText","","type","text","disabled","",3,"value"],[3,"text","iconSize","containerClasses"],[1,"tw:text-text-label","tw:leading-1.4",3,"innerHTML"],["pInputText","","type","text",3,"ngModelChange","ngModel"],[3,"primaryAction"]],template:function(t,o){if(t&1&&(a(0,"ui-modal"),m(1,"ui-modal-header",0),l(2,"transloco"),a(3,"ui-modal-content")(4,"div"),m(5,"ui-alert",1),l(6,"transloco"),a(7,"div",2),m(8,"ui-input-label",3),l(9,"transloco"),a(10,"div",4),m(11,"input",5)(12,"ui-copy-text",6),p()(),a(13,"div",2),m(14,"ui-input-label",3),l(15,"transloco"),a(16,"div",4),m(17,"input",5)(18,"ui-copy-text",6),p()(),_(19,Qt,6,7,"div",2),a(20,"div",2),m(21,"p",7),l(22,"transloco"),a(23,"input",8),Y("ngModelChange",function(A){return G(o.command,A)||(o.command=A),A}),p()()()(),m(24,"ui-modal-actions",9),p()),t&2){let g,A,b,B,I;n(),r("title",c(2,19,"copyCustomAppCredentialsDialog.title"))("type",o.ModalHeaderTypes.WARNING)("showCloseButton",!1),n(4),r("type",o.AlertTypes.WARNING)("message",c(6,21,"copyCustomAppCredentialsDialog.clientSecretWarning")),n(3),r("label",c(9,23,"copyCustomAppCredentialsDialog.clientIdLabel")),n(3),r("value",(g=o.customApp())==null?null:g.client_id),n(),r("text",(A=o.customApp())==null?null:A.client_id)("iconSize",o.CopyIconSize.LARGE)("containerClasses","tw:flex tw:cursor-pointer tw:ml-spacing-2"),n(2),r("label",c(15,25,"copyCustomAppCredentialsDialog.clientSecretLabel")),n(3),r("value",(b=o.customApp())==null?null:b.secret),n(),r("text",(B=o.customApp())==null?null:B.secret)("iconSize",o.CopyIconSize.LARGE)("containerClasses","tw:flex tw:cursor-pointer tw:ml-spacing-2"),n(),h((I=o.customApp())!=null&&I.refresh_token?19:-1),n(2),r("innerHTML",c(22,27,"copyCustomAppCredentialsDialog.typeCopiedToProceed"),ue),n(2),j("ngModel",o.command),n(),r("primaryAction",o.primaryAction())}},dependencies:[N,De,Ie,Ne,Fe,oe,ke,Be,$,be,P,z,ft,Ue,F],encapsulation:2})}return i})();function Xt(i,C){if(i&1){let e=S();a(0,"ui-accounts-header",2),w("signOut",function(){f(e);let o=u();return v(o.logout())})("backButtonClick",function(){f(e);let o=u();return v(o.goBackToApp())}),p()}if(i&2){let e,t=u();r("header",t.eou().us.full_name)("orgName",t.eou().ou.org_name)("styleClass","tw:bg-bg-black")("iconUrl",(e=t.targetConfig())==null?null:e.FULL_LOGO_URL_WHITE)}}function Zt(i,C){i&1&&(m(0,"ui-input-error",10),l(1,"transloco")),i&2&&r("message",c(1,1,"addEditCustomApp.errorEnterAppName"))}function Jt(i,C){i&1&&(a(0,"div",13),E(1),l(2,"transloco"),p()),i&2&&(n(),U(c(2,1,"addEditCustomApp.errorDescriptionMaxLength")))}function Kt(i,C){i&1&&(m(0,"ui-input-error",10),l(1,"transloco")),i&2&&r("message",c(1,1,"addEditCustomApp.errorSelectAppType"))}function ei(i,C){if(i&1&&(a(0,"div",7),m(1,"ui-input-label",8),l(2,"transloco"),a(3,"div",12),m(4,"input",19)(5,"ui-copy-text",20),p()()),i&2){let e,t=u(2);n(),r("label",c(2,7,"addEditCustomApp.labelClientId"))("isMandatory",!0),n(3),r("formControlName","client_id")("required",!0),n(),r("text",(e=t.customApp())==null?null:e.client_id)("iconSize",t.CopyIconSize.LARGE)("containerClasses","tw:flex tw:cursor-pointer tw:ml-spacing-2")}}function ti(i,C){if(i&1&&(a(0,"div",7),m(1,"ui-input-label",8),l(2,"transloco"),a(3,"div",12),m(4,"input",19)(5,"ui-copy-text",20),p()()),i&2){let e,t=u(2);n(),r("label",c(2,7,"addEditCustomApp.labelRefreshToken"))("isMandatory",!0),n(3),r("formControlName","refresh_token")("required",!0),n(),r("text",(e=t.customApp())==null?null:e.refresh_token)("iconSize",t.CopyIconSize.LARGE)("containerClasses","tw:flex tw:cursor-pointer tw:ml-spacing-2")}}function ii(i,C){i&1&&(m(0,"ui-input-error",10),l(1,"transloco")),i&2&&r("message",c(1,1,"addEditCustomApp.errorSelectOrganization"))}function oi(i,C){if(i&1&&(a(0,"div",7),m(1,"ui-input-label",8),l(2,"transloco"),m(3,"ui-select",21),l(4,"transloco"),_(5,ii,2,3,"ui-input-error",10),p()),i&2){let e=u(2);n(),r("label",c(2,8,"addEditCustomApp.labelOrganization"))("isMandatory",!0),n(2),r("options",e.orgs())("optionLabel","name")("optionValue","id")("size","small")("placeholder",c(4,10,"addEditCustomApp.placeholderSelectOrganization")),n(2),h(e.customAppForm.controls.orgId.touched&&(e.customAppForm.controls.orgId.errors!=null&&e.customAppForm.controls.orgId.errors.required)?5:-1)}}function ni(i,C){i&1&&(m(0,"ui-input-error",10),l(1,"transloco")),i&2&&r("message",c(1,1,"addEditCustomApp.errorRedirectUriRequired"))}function ri(i,C){if(i&1&&_(0,ni,2,3,"ui-input-error",10),i&2){let e=u().$implicit;h(e.errors!=null&&e.errors.required?0:-1)}}function ai(i,C){if(i&1){let e=S();a(0,"div",7)(1,"div",12),m(2,"input",23),l(3,"transloco"),a(4,"div",24),l(5,"transloco"),w("click",function(){let o=f(e).$index,g=u(3);return v(g.removeRedirectUri(o))}),m(6,"ui-svg-sprite",25),p()(),_(7,ri,1,1),p()}if(i&2){let e=C.$implicit,t=C.$index,o=u(3);n(2),r("placeholder",c(3,8,"addEditCustomApp.placeholderEnterRedirectUri"))("formControl",o.getRedirectUriControl(t))("required",!0),n(2),r("fdlTooltip",c(5,10,"addEditCustomApp.tooltipRemoveUri"))("tooltipDirection","right"),n(2),r("icon","bin")("classes","tw:w-18-px tw:h-18-px tw:flex tw:fill-icon-danger"),n(),h(e.invalid&&e.touched?7:-1)}}function si(i,C){if(i&1){let e=S();a(0,"ui-button",26),l(1,"transloco"),w("buttonClick",function(){f(e);let o=u(3);return v(o.addRedirectUri())}),p()}if(i&2){let e=u(3);r("buttonType",e.ButtonType.OUTLINE_PRIMARY_TEXT)("label",c(1,6,"addEditCustomApp.buttonAddRedirectUri"))("iconName","plus-square")("iconPos","left")("iconClasses","tw:w-18-px tw:h-18-px tw:flex tw:fill-icon-brand-primary")("iconContainerClasses","tw:mr-spacing-4")}}function pi(i,C){if(i&1&&(a(0,"div",7),m(1,"ui-input-label",8),l(2,"transloco"),ge(3,ai,8,12,"div",7,ot),p(),_(5,si,2,8,"ui-button",22)),i&2){let e=u(2);n(),r("label",c(2,3,"addEditCustomApp.labelAllowedRedirectUris"))("isMandatory",!0),n(2),Ce(e.redirectUris.controls),n(2),h(e.redirectUris.length<3?5:-1)}}function li(i,C){if(i&1){let e=S();a(0,"div",1),m(1,"ui-page-header",3),l(2,"transloco"),a(3,"form",4)(4,"h3",5),E(5),l(6,"transloco"),p(),a(7,"p",6),E(8),l(9,"transloco"),p(),a(10,"div",7),m(11,"ui-input-label",8),l(12,"transloco"),m(13,"input",9),l(14,"transloco"),_(15,Zt,2,3,"ui-input-error",10),p(),a(16,"div",7),m(17,"ui-input-label",8),l(18,"transloco"),m(19,"textarea",11),l(20,"transloco"),a(21,"div",12)(22,"div"),_(23,Jt,3,3,"div",13),p(),a(24,"div",14),E(25),l(26,"transloco"),p()()(),a(27,"div",7),m(28,"ui-input-label",8),l(29,"transloco"),m(30,"ui-select",15),l(31,"transloco"),_(32,Kt,2,3,"ui-input-error",10),p(),_(33,ei,6,9,"div",7),_(34,ti,6,9,"div",7),_(35,oi,6,12,"div",7),_(36,pi,6,5),a(37,"div",16)(38,"ui-button",17),l(39,"transloco"),w("buttonClick",function(){f(e);let o=u();return v(o.cancel())}),p(),a(40,"ui-button",18),l(41,"transloco"),l(42,"transloco"),w("buttonClick",function(){f(e);let o=u();return v(o.mode()==="add"?o.save():o.update())}),p()()()()}if(i&2){let e,t=u();n(),r("url",_e("",t.targetConfig().HELP_ARTICLES_DOMAIN,"/en/articles/3045578-integrating-with-fyle"))("title",t.pageTitle())("description",c(2,40,"addEditCustomApp.headerDescription")),n(2),r("formGroup",t.customAppForm),n(2),W(" ",c(6,42,"addEditCustomApp.sectionTitle")," "),n(3),U(c(9,44,"addEditCustomApp.sectionDescription")),n(3),r("label",c(12,46,"addEditCustomApp.labelApplicationName"))("isMandatory",!0),n(2),r("placeholder",c(14,48,"addEditCustomApp.placeholderEnterAppName"))("formControlName","name")("required",!0),n(2),h(t.customAppForm.controls.name.touched&&(t.customAppForm.controls.name.errors!=null&&t.customAppForm.controls.name.errors.required)?15:-1),n(2),r("label",c(18,50,"addEditCustomApp.labelDescription"))("isMandatory",!1),n(2),r("formControlName","description")("placeholder",c(20,52,"addEditCustomApp.placeholderEnterDescription")),n(4),h(t.customAppForm.controls.description.touched&&(t.customAppForm.controls.description.errors!=null&&t.customAppForm.controls.description.errors.maxlength)?23:-1),n(2),nt("",t.customAppForm.controls.description.value.length,"",c(26,54,"addEditCustomApp.descriptionCharCountSuffix")),n(3),r("label",c(29,56,"addEditCustomApp.labelApplicationType"))("isMandatory",!0),n(2),r("options",t.typeOptions())("formControlName","type")("required",!0)("size","small")("placeholder",c(31,58,"addEditCustomApp.placeholderSelectAp
2pType")),n(2),h(t.customAppForm.controls.type.touched&&(t.customAppForm.controls.type.errors!=null&&t.customAppForm.controls.type.errors.required)?32:-1),n(),h(t.mode()==="edit"&&t.customApp().client_id?33:-1),n(),h(t.mode()==="edit"&&t.customApp().refresh_token&&((e=t.customApp())==null?null:e.type)===t.CustomAppType.INTERNAL?34:-1),n(),h(t.customAppForm.controls.type.value===t.CustomAppType.INTERNAL?35:-1),n(),h(t.customAppForm.controls.type.value===t.CustomAppType.OAUTH2?36:-1),n(2),r("buttonType",t.ButtonType.OUTLINE_SECONDARY)("label",c(39,60,"addEditCustomApp.buttonCancel")),n(2),r("isDisabled",t.customAppForm.invalid)("defaultType","submit")("buttonType",t.ButtonType.PRIMARY)("label",c(41,62,t.mode()==="add"?"addEditCustomApp.buttonSave":"addEditCustomApp.buttonUpdate"))("loadingText",c(42,64,"addEditCustomApp.loadingTextSaving"))("isLoading",t.isLoading())}}var je=(()=>{class i{targetAppConfigService=s(ie);targetConfig=d(this.targetAppConfigService.getTargetConfig());customAppForm;mode=d("add");pageTitle=V(()=>this.mode()==="add"?this.translocoService.translate("addEditCustomApp.pageTitleAdd"):this.translocoService.translate("addEditCustomApp.pageTitleEdit"));typeOptions=d([Z.INTERNAL,Z.OAUTH2]);orgs=d([]);isLoading=d(!1);customApp=d(null);CopyIconSize=Le;CopyIconFill=Pe;eou=d(null);componentDestroyed$=new k;formBuilder=s(gt);routerAuthService=s(te);routerOauthService=s(H);toastMessageService=s(q);dialogService=s(Re);activatedRoute=s(Q);translocoService=s(x);routingService=s(X);authService=s(J);redirectionService=s(K);userEventService=s(xe);orgService=s(Se);get ButtonType(){return D}get CustomAppType(){return Z}get redirectUris(){return this.customAppForm.get("redirect_uris")}initializeForm(){this.customAppForm=this.formBuilder.group({name:["",M.required],description:["",M.maxLength(250)],type:["",M.required],orgId:[""],redirect_uris:this.formBuilder.array([])}),this.customAppForm.get("type")?.valueChanges.pipe(y(this.componentDestroyed$)).subscribe(e=>{this.updateFormControls(e)})}updateFormControls(e){e===Z.INTERNAL?(this.redirectUris.clear(),this.customAppForm.get("orgId")?.setValidators([M.required])):(this.customAppForm.get("orgId")?.setValue(""),this.customAppForm.get("orgId")?.clearValidators(),this.addRedirectUri()),this.customAppForm.get("redirect_uris")?.updateValueAndValidity(),this.customAppForm.get("orgId")?.updateValueAndValidity()}getRedirectUriControl(e){return this.redirectUris.at(e)}createRedirectUriControl(e=""){return this.formBuilder.control(e,[M.required])}addRedirectUri(){this.redirectUris.push(this.createRedirectUriControl())}removeRedirectUri(e){this.redirectUris.removeAt(e)}initializeFormWithCustomApp(e){this.routerOauthService.getThirdPartyAppById(e).pipe(y(this.componentDestroyed$),L(()=>(this.toastMessageService.showErrorToast(this.translocoService.translate("addEditCustomApp.toastErrorSomethingWentWrong")),R))).subscribe(t=>{this.customApp.set(t),this.customAppForm=this.formBuilder.group({name:[{value:t.name,disabled:!0},M.required],description:[t.description||"",M.maxLength(250)],type:[{value:t.type,disabled:!0},M.required],client_id:[{value:t.client_id,disabled:!0},M.required],refresh_token:[{value:t.refresh_token,disabled:!0},M.required],orgId:[{value:t.org_id,disabled:!0},M.required],redirect_uris:this.formBuilder.array(t.redirect_uris.map(o=>this.createRedirectUriControl(o)))})})}logout(){this.userEventService.logout()}goBackToApp(){this.redirectionService.goToAccountsApp()}ngOnInit(){this.eou.set(this.authService.getEou()),this.orgService.getOrgs().pipe(y(this.componentDestroyed$)).subscribe(e=>{this.orgs.set(e),this.activatedRoute.snapshot.params.id?(this.mode.set("edit"),this.initializeFormWithCustomApp(this.activatedRoute.snapshot.params.id)):(this.mode.set("add"),this.initializeForm())})}ngOnDestroy(){this.componentDestroyed$.next(),this.componentDestroyed$.complete()}cancel(){this.routingService.navigate("developers/integrations/custom_apps/applications")}openDialog(e){this.dialogService.open(Ot,{data:{customApp:e}}).onClose.pipe(y(this.componentDestroyed$)).subscribe(o=>{o===O.SUCCESS&&this.routingService.navigate("developers/integrations/custom_apps/applications")})}save(){this.isLoading.set(!0);let{name:e,description:t,type:o,orgId:g,redirect_uris:A}
2=this.customAppForm.value,b={name:e,description:t,type:o,org_id:g,redirect_uris:A},B=Je(b);o===Z.INTERNAL&&(B=this.routerAuthService.getAccessTokenForAnOrg(g).pipe(me(I=>(b.access_token=I.access_token,b)))),B.pipe(y(this.componentDestroyed$),L(()=>(this.toastMessageService.showErrorToast(this.translocoService.translate("addEditCustomApp.toastErrorSomethingWentWrong")),R)),pe(()=>{this.isLoading.set(!1),this.toastMessageService.showSuccessToast(this.translocoService.translate("addEditCustomApp.toastSuccessAppCreated"))}),le(I=>this.routerOauthService.upsertThirdPartyApp(I))).subscribe(I=>{this.openDialog(I)})}update(){this.isLoading.set(!0);let{description:e,redirect_uris:t}=this.customAppForm.value,o=se(ae({},this.customApp()),{description:e,redirect_uris:t});this.routerOauthService.upsertThirdPartyApp(o).pipe(y(this.componentDestroyed$),L(()=>(this.toastMessageService.showErrorToast(this.translocoService.translate("addEditCustomApp.toastErrorSomethingWentWrong")),R)),pe(()=>{this.isLoading.set(!1),this.toastMessageService.showSuccessToast(this.translocoService.translate("addEditCustomApp.toastSuccessAppUpdated"))})).subscribe(()=>{this.routingService.navigate("developers/integrations/custom_apps/applications")})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["feature-add-edit-custom-app"]],decls:2,vars:2,consts:[[3,"header","orgName","styleClass","iconUrl"],[1,"tw:w-full","tw:min-h-full","tw:overflow-y-scroll","tw:pb-spacing-32","tw:flex","tw:flex-col","tw:items-center","tw:bg-bg-tertiary-dark"],[3,"signOut","backButtonClick","header","orgName","styleClass","iconUrl"],[1,"tw:w-full","tw:border-0","tw:border-b","tw:border-solid","tw:border-border-medium-light-gray","tw:bg-bg-white",3,"title","description","url"],[1,"tw:w-full","tw:m-spacing-16","tw:mt-spacing-24","tw:border","tw:border-solid","tw:border-border-medium-light-gray","tw:rounded-border-radius-xs","tw:md:max-w-[85%]","tw:p-spacing-24","tw:pt-spacing-8","tw:bg-bg-white",3,"formGroup"],[1,"tw:uppercase","tw:text-size-16","tw:mb-spacing-16","tw:pb-spacing-8"],[1,"tw:mt-spacing-0","tw:text-label-text","tw:text-size-14"],[1,"tw:mb-spacing-24"],[3,"label","isMandatory"],["pInputText","","type","text",3,"placeholder","formControlName","required"],[3,"message"],["pTextarea","",1,"custom-textarea","tw:py-2","tw:resize-y","tw:px-4","tw:w-full","tw:rounded-md","tw:border","tw:border-gray-300","tw:focus:border-border-brand",3,"formControlName","placeholder"],[1,"tw:flex","tw:flex-row","tw:items-center","tw:justify-between"],[1,"tw:text-text-danger","tw:text-size-12"],[1,"input-length-indicator"],[3,"options","formControlName","required","size","placeholder"],[1,"tw:flex","tw:flex-row","tw:gap-spacing-24","tw:justify-end","tw:mt-spacing-40"],[3,"buttonClick","buttonType","label"],[3,"buttonClick","isDisabled","defaultType","buttonType","label","loadingText","isLoading"],["pInputText","","type","text",3,"formControlName","required"],[3,"text","iconSize","containerClasses"],["formControlName","orgId",3,"options","optionLabel","optionValue","size","placeholder"],[3,"buttonType","label","iconName","iconPos","iconClasses","iconContainerClasses"],["pInputText","","type","text",3,"placeholder","formControl","required"],[1,"tw:ml-spacing-10","tw:p-spacing-6","tw:bg-bg-danger-light","tw:rounded-border-radius-2xs","tw:cursor-pointer",3,"click","fdlTooltip","tooltipDirection"],[3,"icon","classes"],[3,"buttonClick","buttonType","label","iconName","iconPos","iconClasses","iconContainerClasses"]],template:function(t,o){t&1&&(_(0,Xt,1,4,"ui-accounts-header",0),_(1,li,43,66,"div",1)),t&2&&(h(o.eou()?0:-1),n(),h(o.customAppForm?1:-1))},dependencies:[Ct,lt,be,P,pt,ut,ct,mt,dt,$e,oe,ke,Be,vt,St,bt,Ve,Ee,Me,ee,N,Ue,ze,F],styles:[`.page-margins[_ngcontent-%COMP%]{margin-inline:var(--tw-margin-spacing-26, 1.625rem)}@media (width >= 960px){.page-margins[_ngcontent-%COMP%]{margin-inline:var(--tw-margin-spacing-65, 4.0625rem)}}@media (width >= 1440px){.page-margins[_ngcontent-%COMP%]{margin-inline:var(--tw-margin-spacing-120, 7.5rem)}}
3`]})}return i})();var ci=i=>({orgName:i}),Bt=(()=>{class i{org=d(null);eou=d(null);primaryAction=d(null);secondaryAction=d(null);dialogRef=s(we);dialogConfig=s(Ae);toastMessageService=s(q);routerAuthService=s(te);translocoService=s(x);componentDestroyed$=new k;get ModalHeaderTypes(){return ye}get AlertTypes(){return ve}setupActions(){this.primaryAction.set({label:this.translocoService.translate("emailPendingVerification.okButtonLabel"),type:D.PRIMARY,callbackMethod:()=>this.resendEmailVerification()}),this.secondaryAction.set({label:this.translocoService.translate("emailPendingVerification.cancelButtonLabel"),type:D.OUTLINE_SECONDARY,callbackMethod:()=>{this.closeDialog()}})}resendEmailVerification(){return this.routerAuthService.resendVerification(this.eou()?.us.email,this.org()?.id).pipe(me(()=>{this.toastMessageService.showSuccessToast(this.translocoService.translate("emailPendingVerification.verificationEmailSentSuccess")),this.closeDialog(O.SUCCESS)}),L(()=>(this.toastMessageService.showErrorToast(this.translocoService.translate("emailPendingVerification.verificationEmailError")),this.closeDialog(O.ERROR),R)),y(this.componentDestroyed$))}closeDialog(e=O.CANCEL){this.dialogRef.close(e)}ngOnInit(){let{org:e,eou:t}=this.dialogConfig.data;this.org.set(e),this.eou.set(t),this.setupActions()}ngOnDestroy(){this.componentDestroyed$.next(),this.componentDestroyed$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["feature-email-pending-verification"]],decls:7,vars:12,consts:[[3,"closeModal","title","type"],[3,"innerHTML"],[3,"primaryAction","secondaryAction"]],template:function(t,o){if(t&1&&(a(0,"ui-modal")(1,"ui-modal-header",0),l(2,"transloco"),w("closeModal",function(){return o.closeDialog()}),p(),a(3,"ui-modal-content"),m(4,"div",1),l(5,"transloco"),p(),m(6,"ui-modal-actions",2),p()),t&2){let g;n(),r("title",c(2,5,"emailPendingVerification.inviteNotAcceptedTitle"))("type",o.ModalHeaderTypes.WARNING),n(3),r("innerHTML",de(5,7,"emailPendingVerification.invitationMessage",he(10,ci,(g=o.org())==null?null:g.name)),ue),n(2),r("primaryAction",o.primaryAction())("secondaryAction",o.secondaryAction())}},dependencies:[De,Ne,Ie,Fe,N,F],encapsulation:2})}return i})();var di=(i,C)=>({appName:i,brandName:C}),mi=i=>({brandName:i});function ui(i,C){i&1&&(a(0,"div",2),m(1,"ui-spinner-loader",3),p()),i&2&&(n(),r("styleClass","spinner-50"))}function gi(i,C){if(i&1){let e=S();a(0,"div",6),m(1,"ui-input-label",10),l(2,"transloco"),a(3,"ui-select",11),Y("ngModelChange",function(o){f(e);let g=u(4);return G(g.orgId,o)||(g.orgId=o),v(o)}),w("ngModelChange",function(){f(e);let o=u(4);return v(o.changeOrg())}),p()()}if(i&2){let e=u(4);n(),r("label",c(2,7,"developersOauth.authorizeForOrganization"))("isMandatory",!0),n(2),r("styleClass","tw:w-[200px]")("options",e.orgs())("optionLabel","name")("optionValue","id"),j("ngModel",e.orgId)}}function Ci(i,C){if(i&1){let e=S();a(0,"div"),_(1,gi,4,9,"div",6),a(2,"div",7)(3,"ui-button",8),l(4,"transloco"),w("buttonClick",function(){f(e);let o=u(3);return v(o.cancel())}),p(),a(5,"ui-button",9),l(6,"transloco"),l(7,"transloco"),w("buttonClick",function(){f(e);let o=u(3);return v(o.allowAccess())}),p()()()}if(i&2){let e=u(3);n(),h(e.isInvokedFromPartnerDashboard()?-1:1),n(2),r("buttonType",e.ButtonType.OUTLINE_SECONDARY)("label",c(4,6,"developersOauth.decline")),n(2),r("buttonType",e.ButtonType.PRIMARY)("label",c(6,8,"developersOauth.allow"))("loadingText",c(7,10,"developersOauth.allowing"))}}function _i(i,C){if(i&1){let e=S();a(0,"div",6)(1,"ui-button",8),w("buttonClick",function(){f(e);let o=u(3);return v(o.signIn())}),p(),a(2,"div",12)(3,"div"),E(4),l(5,"transloco"),p(),m(6,"ui-open-new-tab",13),l(7,"transloco"),p()()}if(i&2){let e=u(3);n(),r("buttonType",e.ButtonType.PRIMARY)("label",e.signInLabel()),n(3),U(de(5,5,"developersOauth.newToBrand",he(10,mi,e.targetConfig().BRAND_NAME))),n(2),r("label",c(7,8,"developersOauth.scheduleDemo"))("url","https://www.fylehq.com/schedule-demo")}}function hi(i,C){if(i&1&&(a(0,"div")(1,"div",6),E(2),l(3,"transloco"),p(),_(4,Ci,8,12,"div")(5,_i,8,12,"div",6),p()),i&2){let e=u(2);n(2),W(" ",de(3,2,"developersOauth.appAccessRequest",rt(5,di,e.customApp().name,e.targetConfig().BRAND_NAME))," "),n(2),h(e.isLoggedIn()?4:5)}}function fi(i,C){i&1&&(a(0,"div"),E(1),l(2,"transloco"),p()),i&2&&(n(),U(c(2,1,"developersOauth.appNotFound")))}function vi(i,C){if(i&1&&(a(0,"div",4),m(1,"img",5),l(2,"transloco"),p(),a(3,"div"),_(4,hi,6,8,"div")(5,fi,3,3,"div"),p()),i&2){let e=u();n(),r("alt",ce(c(2,3,"developersOauth.logoIntegrationAlt"))),n(3),h(e.customApp()?4:5)}}var kt=(()=>{class i{targetConfig=d(null);isLoggedIn=d(!1);translocoService=s(x);signInLabel=V(()=>this.translocoService.translate("developersOauth.signInToBrand",{brandName:this.targetConfig()?.BRAND_NAME}));customAppClientId=d("");customApp=d(null);redirectUri=d("");state=d("");responseType=d("code");isInvokedFromPartnerDashboard=d(!1);orgId=d("");orgs=d([]);isCustomAppLoading=d(!1);isOrgLoading=d(!1);componentDestroyed$=new k;activatedRoute=s(Q);targetAppConfigService=s(ie);routerAuthService=s(te);routerOAuthService=s(H);redirectionService=s(K);orgService=s(Se);httpUtilsService=s(wt);authService=s(J);dialogService=s(Re);toastMessageService=s(q);get ButtonType(){return D}initializeData(){let e=this.activatedRoute.snapshot.queryParams;this.customAppClientId.set(e.client_id),this.redirectUri.set(e.redirect_uri),this.state.set(e.state),this.responseType.set(e.response_type||"code"),this.isInvokedFromPartnerDashboard.set(e.is_partner==="true"),this.isLoggedIn.set(this.routerAuthService.isLoggedIn()),this.targetConfig.set(this.targetAppConfigService.getTargetConfig())}signIn(){let e={client_id:this.customAppClientId(),redirect_uri:this.redirectUri(),state:this.state(),response_type:this.responseType()}
3,t={redirect_uri:`${He.APP_ROUTER_URL}/developers/oauth/authorize?${this.httpUtilsService.getSerializedParams(e)}`,fyle_redirect_url:btoa(`${He.APP_ROUTER_URL}/developers/oauth/authorize?${this.httpUtilsService.getSerializedParams(e)}`)},o=`signin?${this.httpUtilsService.getSerializedParams(t)}`;this.redirectionService.goToAccountsApp(o)}fetchCustomApp(){this.isCustomAppLoading.set(!0),this.routerOAuthService.getThirdPartyAppByClientId(this.customAppClientId()).pipe(y(this.componentDestroyed$)).subscribe(e=>{this.customApp.set(e),this.isCustomAppLoading.set(!1)})}openEmailPendingVerificationDialog(){let e=this.authService.getEou();this.dialogService.open(Bt,{data:{org:this.orgs().find(o=>o.id===this.orgId()),eou:e}}).onClose.pipe(y(this.componentDestroyed$),le(o=>o===O.SUCCESS?R:this.orgService.switchOrg(e?.ou?.org_id).pipe(Ke(()=>{this.orgId.set(e?.ou?.org_id)})))).subscribe()}changeOrg(){let e=this.authService.getEou();this.orgService.switchOrg(this.orgId()).pipe(y(this.componentDestroyed$)).subscribe(()=>{e?.ou?.status===at.PENDING_DETAILS&&this.openEmailPendingVerificationDialog()})}initializeOrgSelection(){this.isOrgLoading.set(!0),this.isLoggedIn()&&(this.isInvokedFromPartnerDashboard()?this.orgService.getPrimaryOrg().pipe(y(this.componentDestroyed$)).subscribe(e=>{this.orgId.set(e.id),this.isOrgLoading.set(!1)}):this.orgService.getOrgs().pipe(y(this.componentDestroyed$)).subscribe(e=>{this.orgs.set(e),e.length>0&&e[0]&&(this.orgId.set(e[0].id),this.orgService.switchOrg(e[0].id),this.isOrgLoading.set(!1))}))}allowAccess(){this.routerAuthService.getAccessTokenForAnOrg(this.orgId()).pipe(y(this.componentDestroyed$),le(e=>this.routerOAuthService.authorize({client_id:this.customAppClientId(),redirect_uri:this.redirectUri(),response_type:this.responseType(),state:this.state(),access_token:e.access_token})),L(e=>(this.toastMessageService.showErrorToast(this.translocoService.translate("developersOauth.errorGeneric")),this.redirectionService.goToAccountsApp(),R))).subscribe(e=>{this.redirectionService.handleRedirection(e)})}cancel(){let e=`${this.redirectUri()}?state=${this.state()}&error=access_denied`;this.redirectionService.handleRedirection(e)}ngOnInit(){this.initializeData(),this.fetchCustomApp(),this.initializeOrgSelection()}ngOnDestroy(){this.componentDestroyed$.next(),this.componentDestroyed$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["feature-developers-oauth"]],decls:5,vars:1,consts:[[1,"tw:h-[90vh]","tw:w-full","tw:flex","tw:items-center","tw:justify-center","tw:bg-bg-tertiary-dark"],[1,"tw:max-w-md","tw:w-full","tw:bg-bg-white","tw:rounded-lg","tw:shadow-md","tw:p-spacing-32","tw:flex","tw:flex-col","tw:gap-spacing-24"],[1,"tw:m-auto"],[3,"styleClass"],[1,"tw:w-full","tw:flex","tw:justify-center"],["src","assets/images/partner-dashboard-access.png",3,"alt"],[1,"tw:pb-spacing-12"],[1,"tw:flex","tw:flex-row","tw:w-full","tw:justify-between","tw:pt-spacing-8"],[3,"buttonClick","buttonType","label"],[3,"buttonClick","buttonType","label","loadingText"],[3,"label","isMandatory"],[3,"ngModelChange","styleClass","options","optionLabel","optionValue","ngModel"],[1,"tw:flex"],[3,"label","url"]],template:function(t,o){t&1&&(a(0,"ui-grid-background")(1,"div",0)(2,"div",1),_(3,ui,2,1,"div",2)(4,vi,6,5),p()()()),t&2&&(n(3),h(o.isCustomAppLoading()||o.isOrgLoading()?3:4))},dependencies:[ee,oe,Ve,$,P,z,ht,Mt,Oe,N,F],encapsulation:2})}return i})();var dr=[{path:"",pathMatch:"full",redirectTo:()=>{let i=s(Window),C=s(fe),e=s(Te),{hash:t,pathname:o,search:g}=i.location,A=/^(#!?\/)(.*)$/.exec(t);if(!A)return"integrations/custom_apps/applications";let b=(A[2]||"").replace(/^\/+/,""),B=b.indexOf("?"),I=B>=0?b.slice(0,B):b,Ge=B>=0?b.slice(B):"",Ye=new URLSearchParams(g);if(Ge){let Lt=new URLSearchParams(Ge);for(let[Pt,Ut]of Lt.entries())Ye.set(Pt,Ut)}let Qe=Ye.toString(),Xe=`/developers/${(I?I.split("/").filter(Boolean):[]).join("/")}`.replace(/\/{2,}/g,"/"),Ze=Qe?`${Xe}?${Qe}`:Xe;return e.legacyHashRedirect(`${o}${g}${t}`,Ze),C.parseUrl(Ze)}},{path:"",redirectTo:"integrations/custom_apps/applications",pathMatch:"full"},{path:"enterprise/integrations/custom_apps/applications",redirectTo:"integrations/custom_apps/applications",pathMatch:"full"},{path:"integrations/custom_apps",children:[{path:"applications",component:Rt},{path:"add_edit_application",component:je},{path:"add_edit_application/:id",component:je}],canActivate:[_t]},{path:"oauth/authorize",component:kt},{path:"errors",component:We,data:{app:"developers"}},{path:"errors/:type",component:We,data:{app:"developers"}}];export{dr as developersRoutes};

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.