@descope/user-profile-widget 0.0.32 → 0.0.34

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/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * @descope/user-profile-widget v0.0.32
3
+ * @descope/user-profile-widget v0.0.34
4
4
  */
5
- import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createSingletonMixin as s,compose as o,createTemplate as r,kebabCase as n,withMemCache as d}from"@descope/sdk-helpers";import a from"@descope/web-component";import{projectIdMixin as l,observeAttributesMixin as h,loggerMixin as c,createStateManagementMixin as u,initLifecycleMixin as f,staticResourcesMixin as g,createValidateAttributesMixin as v,descopeUiMixin as p,initElementMixin as w,modalMixin as m,debuggerMixin as b,themeMixin as y}from"@descope/sdk-mixins";import{FlowDriver as R,AvatarDriver as W,UserAttributeDriver as k,UserAuthMethodDriver as M,ButtonDriver as U}from"@descope/sdk-component-drivers";import{createSelector as S}from"reselect";import{createAsyncThunk as j}from"@reduxjs/toolkit";import I from"@descope/web-js-sdk";import"@descope/core-js-sdk";const C=t=>t.me.data,A=S(C,(t=>t.picture)),x=S(C,(t=>t.email)),O=S(C,(t=>t.verifiedEmail)),q=S(C,(t=>t.name)),E=S(C,(t=>t.phone)),P=S(C,(t=>t.verifiedPhone)),F=S(C,(t=>t.webauthn));S(C,(t=>t.password));const T=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},L=j("users/me",((t,{extra:{api:e}})=>e.user.me())),N=T(L)({onFulfilled:(t,e)=>{t.me.data=e.payload}},($=t=>t.me,{onFulfilled:t=>{$(t).loading=!1},onPending:t=>{$(t).loading=!0,$(t).error=null},onRejected:(t,e)=>{$(t).loading=!1,$(t).error=e.error}}));var $;const D={action:L,reducer:N},H=j("users/logout",((t,{extra:{api:e}})=>e.user.logout())),B={action:H,reducer:T(H)({})},J={me:{loading:!1,error:null,data:{}}},V={me:"/v1/auth/me"},z=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),G=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return z();const s=yield e.get(V.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),K=s((s=>{var r,n,d,a;const u=o(l,h,c)(s);return a=class extends u{constructor(){super(...arguments),r.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,n,"f")||e(this,r,"m",d).call(this),e(this,n,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.init)||void 0===s?void 0:s.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,n,"f")&&e(this,r,"m",d).call(this)}))}))}},n=new WeakMap,r=new WeakSet,d=function(){this.logger.debug("creating an sdk instance"),i(this,n,((e,i,s)=>{const o=I(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.0.32"}}));return{user:Object.assign(Object.assign({},G({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl},"true"===this.mock,this.widgetId),"f")},a})),Q=s((t=>{const e=o(u({name:"widget",initialState:J,reducers:{},extraReducers:t=>{D.reducer(t),B.reducer(t)},asyncActions:{getMe:D.action,logout:B.action}}),f,c,K)(t);return class extends e{constructor(...t){super(...t),this.state=J,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),X=s((e=>{const i=o(g,v({"widget-id":v.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),Y=s((i=>{var s,n,d;return d=class extends(o(c,f,p,w,X,Q)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this),yield Promise.all([this.actions.getMe(),e(this,s,"m",n).call(this)]),this.onWidgetRootReady()}))}},s=new WeakSet,n=function(){return t(this,void 0,void 0,(function*(){const t=r(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},d})),Z=(t={})=>{const e=r("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(n(t),i)})),e};function _(t){return new URLSearchParams(window.location.search).get(t)}const tt=s((s=>{var r,n,a,l,h,u,f,g,v;return v=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.avatar.image=t}))),g.set(this,d((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,A(this.state)),e(this,g,"f").call(this,q(this.state)),this.subscribe(e(this,f,"f").bind(this),A),this.subscribe(e(this,g,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,g=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"update-pic"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.avatar=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{e(this,n,"f").open()}))},v})),et=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.emailUserAttr.value=t}))),b.set(this,d((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,x(this.state)),e(this,b,"f").call(this,O(this.state)),this.subscribe(e(this,w,"f").bind(this),x),this.subscribe(e(this,b,"f").bind(this),O)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-email"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-email"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.emailUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),it=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b;return b=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,q(this.state)),this.subscribe(e(this,w,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-name"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-name"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.nameUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},b})),st=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.phoneUserAttr.value=t}))),b.set(this,d((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,E(this.state)),e(this,b,"f").call(this,P(this.state)),this.subscribe(e(this,w,"f").bind(this),E),this.subscribe(e(this,b,"f").bind(this),P)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-phone"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-phone"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.phoneUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),ot=s((s=>{var r,n,a,l,h,u,f,g;return g=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,F(this.state)),this.subscribe(e(this,f,"f").bind(this),F)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"passkey"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.passkeyUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},g})),rt=s((s=>{var r,n,d,a,l,h,u;return u=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",h).call(this),e(this,r,"m",a).call(this)}))}},n=new WeakMap,d=new WeakMap,r=new WeakSet,a=function(){i(this,n,this.createModal({"data-id":"password"}),"f"),i(this,d,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",l).bind(this),e(this,r,"m",l).call(this)},l=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close()}))},h=function(){this.passwordUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},u})),nt=s((i=>{var s,r,n;return n=class extends(o(Q,c,Y,m)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.onWidgetRootReady)||void 0===o?void 0:o.call(this),e(this,s,"m",r).call(this)}))}},s=new WeakSet,r=function(){this.logout=new U((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},n})),dt="widget-flow",at=s((i=>{var s,r,n;return n=class extends(o(f,m,Q,c)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this);const t=_(dt);t&&(!function(t){if(window.history.replaceState&&_(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(dt),e(this,s,"m",r).call(this,t))}))}},s=new WeakSet,r=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(Z({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl}));const i=new R((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger});i.onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},n})),lt=s((e=>class extends(o(b,y,at,et,tt,it,st,ot,rt,nt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this)}))}})),ht=o((e=>class extends(lt(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this),a.sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.0.32"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",ht);export{ht as default};
5
+ import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createSingletonMixin as s,compose as o,createTemplate as r,kebabCase as n,withMemCache as d}from"@descope/sdk-helpers";import a from"@descope/web-component";import{projectIdMixin as l,observeAttributesMixin as h,loggerMixin as c,createStateManagementMixin as u,initLifecycleMixin as f,staticResourcesMixin as g,createValidateAttributesMixin as v,descopeUiMixin as p,initElementMixin as w,modalMixin as m,debuggerMixin as b,themeMixin as y}from"@descope/sdk-mixins";import{FlowDriver as R,AvatarDriver as W,UserAttributeDriver as k,UserAuthMethodDriver as M,ButtonDriver as U}from"@descope/sdk-component-drivers";import{createSelector as S}from"reselect";import{createAsyncThunk as j}from"@reduxjs/toolkit";import I from"@descope/web-js-sdk";import"@descope/core-js-sdk";const C=t=>t.me.data,A=S(C,(t=>t.picture)),x=S(C,(t=>t.email)),O=S(C,(t=>t.verifiedEmail)),q=S(C,(t=>t.name)),E=S(C,(t=>t.phone)),P=S(C,(t=>t.verifiedPhone)),F=S(C,(t=>t.webauthn));S(C,(t=>t.password));const T=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},L=j("users/me",((t,{extra:{api:e}})=>e.user.me())),N=T(L)({onFulfilled:(t,e)=>{t.me.data=e.payload}},($=t=>t.me,{onFulfilled:t=>{$(t).loading=!1},onPending:t=>{$(t).loading=!0,$(t).error=null},onRejected:(t,e)=>{$(t).loading=!1,$(t).error=e.error}}));var $;const D={action:L,reducer:N},H=j("users/logout",((t,{extra:{api:e}})=>e.user.logout())),B={action:H,reducer:T(H)({})},J={me:{loading:!1,error:null,data:{}}},V={me:"/v1/auth/me"},z=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),G=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return z();const s=yield e.get(V.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),K=s((s=>{var r,n,d,a;const u=o(l,h,c)(s);return a=class extends u{constructor(){super(...arguments),r.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,n,"f")||e(this,r,"m",d).call(this),e(this,n,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.init)||void 0===s?void 0:s.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,n,"f")&&e(this,r,"m",d).call(this)}))}))}},n=new WeakMap,r=new WeakSet,d=function(){this.logger.debug("creating an sdk instance"),i(this,n,((e,i,s)=>{const o=I(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.0.34"}}));return{user:Object.assign(Object.assign({},G({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl},"true"===this.mock,this.widgetId),"f")},a})),Q=s((t=>{const e=o(u({name:"widget",initialState:J,reducers:{},extraReducers:t=>{D.reducer(t),B.reducer(t)},asyncActions:{getMe:D.action,logout:B.action}}),f,c,K)(t);return class extends e{constructor(...t){super(...t),this.state=J,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),X=s((e=>{const i=o(g,v({"widget-id":v.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),Y=s((i=>{var s,n,d;return d=class extends(o(c,f,p,w,X,Q)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this),yield Promise.all([this.actions.getMe(),e(this,s,"m",n).call(this)]),this.onWidgetRootReady()}))}},s=new WeakSet,n=function(){return t(this,void 0,void 0,(function*(){const t=r(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},d})),Z=(t={})=>{const e=r("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(n(t),i)})),e};function _(t){return new URLSearchParams(window.location.search).get(t)}const tt=s((s=>{var r,n,a,l,h,u,f,g,v;return v=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.avatar.image=t}))),g.set(this,d((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,A(this.state)),e(this,g,"f").call(this,q(this.state)),this.subscribe(e(this,f,"f").bind(this),A),this.subscribe(e(this,g,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,g=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"update-pic"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.avatar=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{e(this,n,"f").open()}))},v})),et=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.emailUserAttr.value=t}))),b.set(this,d((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,x(this.state)),e(this,b,"f").call(this,O(this.state)),this.subscribe(e(this,w,"f").bind(this),x),this.subscribe(e(this,b,"f").bind(this),O)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-email"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-email"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.emailUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),it=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b;return b=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,q(this.state)),this.subscribe(e(this,w,"f").bind(this),q)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-name"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-name"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.nameUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},b})),st=s((s=>{var r,n,a,l,h,u,f,g,v,p,w,b,y;return y=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),l.set(this,void 0),h.set(this,void 0),w.set(this,d((t=>{this.phoneUserAttr.value=t}))),b.set(this,d((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",p).call(this),e(this,r,"m",u).call(this),e(this,r,"m",g).call(this),e(this,w,"f").call(this,E(this.state)),e(this,b,"f").call(this,P(this.state)),this.subscribe(e(this,w,"f").bind(this),E),this.subscribe(e(this,b,"f").bind(this),P)}))}},n=new WeakMap,a=new WeakMap,l=new WeakMap,h=new WeakMap,w=new WeakMap,b=new WeakMap,r=new WeakSet,u=function(){i(this,n,this.createModal({"data-id":"edit-phone"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",f).bind(this),e(this,r,"m",f).call(this)},f=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},g=function(){i(this,l,this.createModal({"data-id":"delete-phone"}),"f"),i(this,h,new R((()=>{var t;return null===(t=e(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,l,"f").afterClose=e(this,r,"m",v).bind(this),e(this,r,"m",v).call(this)},v=function(){e(this,l,"f").setContent(Z({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl})),e(this,h,"f").onSuccess((()=>{e(this,l,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr=new k((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{e(this,n,"f").open()})),this.phoneUserAttr.onDeleteClick((()=>{e(this,l,"f").open()}))},y})),ot=s((s=>{var r,n,a,l,h,u,f,g;return g=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),a.set(this,void 0),f.set(this,d((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",u).call(this),e(this,r,"m",l).call(this),e(this,f,"f").call(this,F(this.state)),this.subscribe(e(this,f,"f").bind(this),F)}))}},n=new WeakMap,a=new WeakMap,f=new WeakMap,r=new WeakSet,l=function(){i(this,n,this.createModal({"data-id":"passkey"}),"f"),i(this,a,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",h).bind(this),e(this,r,"m",h).call(this)},h=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,a,"f").onSuccess((()=>{e(this,n,"f").close(),this.actions.getMe()}))},u=function(){this.passkeyUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},g})),rt=s((s=>{var r,n,d,a,l,h,u;return u=class extends(o(Q,c,Y,m)(s)){constructor(){super(...arguments),r.add(this),n.set(this,void 0),d.set(this,void 0)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var s;return t(this,void 0,void 0,(function*(){yield null===(s=i.onWidgetRootReady)||void 0===s?void 0:s.call(this),e(this,r,"m",h).call(this),e(this,r,"m",a).call(this)}))}},n=new WeakMap,d=new WeakMap,r=new WeakSet,a=function(){i(this,n,this.createModal({"data-id":"password"}),"f"),i(this,d,new R((()=>{var t;return null===(t=e(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,n,"f").afterClose=e(this,r,"m",l).bind(this),e(this,r,"m",l).call(this)},l=function(){e(this,n,"f").setContent(Z({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl})),e(this,d,"f").onSuccess((()=>{e(this,n,"f").close()}))},h=function(){this.passwordUserAuthMethod=new M((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{e(this,n,"f").open()}))},u})),nt=s((i=>{var s,r,n;return n=class extends(o(Q,c,Y,m)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.onWidgetRootReady)||void 0===o?void 0:o.call(this),e(this,s,"m",r).call(this)}))}},s=new WeakSet,r=function(){this.logout=new U((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},n})),dt="widget-flow",at=s((i=>{var s,r,n;return n=class extends(o(f,m,Q,c)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});var o;return t(this,void 0,void 0,(function*(){yield null===(o=i.init)||void 0===o?void 0:o.call(this);const t=_(dt);t&&(!function(t){if(window.history.replaceState&&_(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(dt),e(this,s,"m",r).call(this,t))}))}},s=new WeakSet,r=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(Z({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl}));const i=new R((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger});i.onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},n})),lt=s((e=>class extends(o(b,y,at,et,tt,it,st,ot,rt,nt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this)}))}})),ht=o((e=>class extends(lt(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var i;return t(this,void 0,void 0,(function*(){yield null===(i=e.init)||void 0===i?void 0:i.call(this),a.sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.0.34"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",ht);export{ht as default};
6
6
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -13,12 +13,12 @@ type State = {
13
13
  };
14
14
 
15
15
  declare const UserProfileWidget: {
16
- new (...args: any): {
16
+ new (...params: any[]): {
17
17
  init(): Promise<void>;
18
18
  logout: _descope_sdk_component_drivers.ButtonDriver;
19
19
  "__#16@#initLogout"(): void;
20
20
  onWidgetRootReady: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
21
- "__#12031@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
21
+ "__#12121@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
22
22
  logger: {
23
23
  error(...data: any[]): void;
24
24
  warn(...data: any[]): void;
@@ -27,7 +27,7 @@ declare const UserProfileWidget: {
27
27
  };
28
28
  }) => {
29
29
  setContent(template: HTMLTemplateElement): void;
30
- "__#12030@#private": any;
30
+ "__#12120@#private": any;
31
31
  beforeOpen: () => void | Promise<void>;
32
32
  afterClose: () => void;
33
33
  nodeName: string;
@@ -35,7 +35,7 @@ declare const UserProfileWidget: {
35
35
  open(): Promise<void>;
36
36
  reset(): void;
37
37
  remove(): void;
38
- "__#12028@#private": any;
38
+ "__#12118@#private": any;
39
39
  logger: {
40
40
  error(...data: any[]): void;
41
41
  warn(...data: any[]): void;
@@ -46,21 +46,21 @@ declare const UserProfileWidget: {
46
46
  readonly ele: Element;
47
47
  };
48
48
  createModal(config?: Record<string, string>): _descope_sdk_component_drivers.ModalDriver;
49
- "__#12027@#errorCbsSym": symbol;
50
- "__#12027@#loadCbsSym": symbol;
51
- "__#12027@#getComponentsVersion": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
52
- "__#12027@#exposeAlternateEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
53
- "__#12027@#handleFallbackScript": ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>);
54
- "__#12027@#registerEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
55
- "__#12027@#getDescopeUiLoadingScript": (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>);
56
- "__#12027@#descopeUi": Promise<any>;
49
+ "__#12117@#errorCbsSym": symbol;
50
+ "__#12117@#loadCbsSym": symbol;
51
+ "__#12117@#getComponentsVersion": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
52
+ "__#12117@#exposeAlternateEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
53
+ "__#12117@#handleFallbackScript": ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[]) => Promise<void>);
54
+ "__#12117@#registerEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
55
+ "__#12117@#getDescopeUiLoadingScript": (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>);
56
+ "__#12117@#descopeUi": Promise<any>;
57
57
  readonly descopeUi: Promise<any>;
58
- "__#12027@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
58
+ "__#12117@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
59
59
  loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
60
- "__#12027@#getDescopeUi": (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>);
60
+ "__#12117@#getDescopeUi": (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>);
61
61
  readonly config: any;
62
- "__#12024@#_configResource": any;
63
- "__#12024@#fetchConfig": (() => Promise<{
62
+ "__#12114@#_configResource": any;
63
+ "__#12114@#fetchConfig": (() => Promise<{
64
64
  projectConfig: _descope_sdk_mixins.ProjectConfiguration;
65
65
  executionContext: {
66
66
  geo: string;
@@ -100,16 +100,7 @@ declare const UserProfileWidget: {
100
100
  body: F_2 extends "json" ? Record<string, any> : string;
101
101
  headers: Record<string, string>;
102
102
  }>);
103
- readonly projectId: string;
104
- "__#12023@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
105
- "__#12022@#observeMappings": {};
106
- observeAttribute: ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any);
107
- observeAttributes: ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void);
108
- "__#12021@#isInit": boolean;
109
- connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & {
110
- (): void;
111
- (): void;
112
- } & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
103
+ readonly baseUrl: string;
113
104
  accessKey: string;
114
105
  readonly accessKeyLabel: string;
115
106
  autocapitalize: string;
@@ -214,6 +205,10 @@ declare const UserProfileWidget: {
214
205
  (attrName: string, oldValue: string, newValue: string): void;
215
206
  (attrName: string, oldValue: string, newValue: string): void;
216
207
  } & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void);
208
+ connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & {
209
+ (): void;
210
+ (): void;
211
+ } & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
217
212
  readonly attributes: NamedNodeMap;
218
213
  readonly classList: DOMTokenList;
219
214
  className: string;
@@ -862,13 +857,19 @@ declare const UserProfileWidget: {
862
857
  tabIndex: number;
863
858
  blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
864
859
  focus: ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void);
865
- "__#12020@#logger": {
860
+ readonly projectId: string;
861
+ "__#12113@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
862
+ "__#12112@#observeMappings": {};
863
+ observeAttribute: ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any);
864
+ observeAttributes: ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void);
865
+ "__#12111@#isInit": boolean;
866
+ "__#12110@#logger": {
866
867
  error(...data: any[]): void;
867
868
  warn(...data: any[]): void;
868
869
  info(...data: any[]): void;
869
870
  debug(...data: any[]): void;
870
871
  };
871
- "__#12020@#wrapLogger": ((logger: Partial<{
872
+ "__#12110@#wrapLogger": ((logger: Partial<{
872
873
  error(...data: any[]): void;
873
874
  warn(...data: any[]): void;
874
875
  info(...data: any[]): void;
@@ -1207,7 +1208,6 @@ declare const UserProfileWidget: {
1207
1208
  };
1208
1209
  };
1209
1210
  "__#8@#createSdk": (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
1210
- readonly baseUrl: string;
1211
1211
  readonly widgetId: string;
1212
1212
  readonly mock: string;
1213
1213
  readonly api: {
@@ -1802,14 +1802,14 @@ declare const UserProfileWidget: {
1802
1802
  "__#11@#onValueBadgeLabelUpdate": (isEmailVerified: any) => void;
1803
1803
  "__#17@#createFlowRedirectModal"(widgetFlow: string): void;
1804
1804
  readonly theme: _descope_sdk_mixins.ThemeOptions;
1805
- "__#12033@#_themeResource": Promise<void | Record<string, any>>;
1806
- "__#12033@#fetchTheme"(): Promise<Record<string, any>>;
1807
- readonly "__#12033@#themeResource": Promise<void | Record<string, any>>;
1808
- "__#12033@#loadGlobalStyle"(): Promise<void>;
1809
- "__#12033@#loadComponentsStyle"(): Promise<void>;
1810
- "__#12033@#loadFonts"(): Promise<void>;
1811
- "__#12033@#applyTheme"(): Promise<void>;
1812
- "__#12026@#debuggerEle": HTMLElement & {
1805
+ "__#12123@#_themeResource": Promise<void | Record<string, any>>;
1806
+ "__#12123@#fetchTheme"(): Promise<Record<string, any>>;
1807
+ readonly "__#12123@#themeResource": Promise<void | Record<string, any>>;
1808
+ "__#12123@#loadGlobalStyle"(): Promise<void>;
1809
+ "__#12123@#loadComponentsStyle"(): Promise<void>;
1810
+ "__#12123@#loadFonts"(): Promise<void>;
1811
+ "__#12123@#applyTheme"(): Promise<void>;
1812
+ "__#12116@#debuggerEle": HTMLElement & {
1813
1813
  updateData: (data: {
1814
1814
  title: string;
1815
1815
  description?: string;
@@ -1818,11 +1818,11 @@ declare const UserProfileWidget: {
1818
1818
  description?: string;
1819
1819
  }[]) => void;
1820
1820
  };
1821
- "__#12026@#disableDebugger"(): void;
1822
- "__#12026@#enableDebugger"(): Promise<void>;
1821
+ "__#12116@#disableDebugger"(): void;
1822
+ "__#12116@#enableDebugger"(): Promise<void>;
1823
1823
  readonly debug: boolean;
1824
- "__#12026@#handleDebugMode"(): void;
1825
- "__#12026@#updateDebuggerMessages"(title: string, description: string): void;
1824
+ "__#12116@#handleDebugMode"(): void;
1825
+ "__#12116@#updateDebuggerMessages"(title: string, description: string): void;
1826
1826
  };
1827
1827
  };
1828
1828