@social-mail/social-mail-client 1.2.320 → 1.2.321

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.
@@ -2539,7 +2539,7 @@ html, body {
2539
2539
  }
2540
2540
  }
2541
2541
  }
2542
- `.installLocal();_export("default",SignupPage=class SignupPage extends ContentPage{constructor(){super(...arguments);this.termsAgreed=false;this.model={name:"",username:"",password:"",passwordAgain:"",phoneNumber:"",country:"US",phoneNumberText:"",captcha:{code:""},phone:{code:""}}}init(){return __awaiter(this,void 0,void 0,(function*(){this.hideToolbar=true;this.element.className=css;this.title="Social Mail Signup";const{id}=yield FetchBuilder.put("/api/users/captcha").responseAsJson();this.model.captcha.id=id;this.renderer=XNode.create("div",null,XNode.create("div",null,XNode.create("div",{"data-max-width":"size-large"},XNode.create(Form,null,XNode.create(FormField,{label:"Your Name"},XNode.create("input",{autofocus:true,placeholder:"Display Name",value:Bind.twoWaysImmediate((()=>this.model.name))})),XNode.create(FormField,{label:"Email Address"},XNode.create("div",{"data-layout":"row","data-padding":"auto"},XNode.create("input",{"data-border":"none",placeholder:"first-last-name",style:"outline: none",type:"text",value:Bind.twoWaysImmediate((()=>this.model.username))}),XNode.create("span",{text:"@socialmail.me"}))),XNode.create("details",null,XNode.create("summary",null,"Username Policy"),"Please choose username that resembles your real legal name. Any other name will be banned and blocked permanently. And you will not be able to create new username with same phone number as well."),XNode.create(FormField,{label:"Password"},XNode.create("input",{type:"password",value:Bind.twoWaysImmediate((()=>this.model.password))})),XNode.create(FormField,{label:"Password Again"},XNode.create("input",{type:"password",value:Bind.twoWaysImmediate((()=>this.model.passwordAgain))})),XNode.create(FormField,{label:"Phone Number"},XNode.create("div",{"data-layout":"row"},XNode.create(CountrySelect,{value:Bind.twoWaysImmediate((()=>this.model.country))}),XNode.create(MaskedInput,{"data-mask":Bind.oneWayAsync((()=>formatForCountry(this.model.country))),value:Bind.twoWaysImmediate((()=>this.model.phoneNumberText))}))),XNode.create("div",null,"We require phone number verification to prevent misuse and fraud over the email. And it will also help you in setting up two factor authentication to prevent hackers from accessing your private emails."),XNode.create("br",null),XNode.create("br",null),XNode.create(FormField,{label:"Captcha"},XNode.create("img",{src:`/api/users/captcha/${id}`})),XNode.create(FormField,{label:"Enter 5 Digit Code"},XNode.create("input",{type:"tel",value:Bind.twoWaysImmediate((()=>this.model.captcha.code))})),XNode.create("div",{"data-layout":"row"},XNode.create("input",{type:"checkbox",checked:Bind.twoWaysImmediate((()=>this.termsAgreed))}),XNode.create("span",{text:"I agree the "}),XNode.create("a",{href:"https://socialmail.in/terms.html",target:"_blank"},"Terms & Conditions")),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"signup"},"Signup"))))))}))}signup(){return __awaiter(this,void 0,void 0,(function*(){const{model}=this;if(!this.termsAgreed){throw new Error("You must agree to Terms & Conditions.")}if(!model.password){throw new Error("Password is required")}if(model.password.length<7){throw new Error("Password is cannot be less than 7 characters")}if(/\s/i.test(model.password)){throw new Error("Password must not any whitespace characters")}const isdCode=yield isdForCountry(model.country);const phoneNumber=model.phoneNumberText.replace(/[^0-9]/g,"");model.phoneNumber=isdCode.startsWith("+")?isdCode+phoneNumber:`+${isdCode}${phoneNumber}`;const{userID,phone={},captcha={}}=yield FetchBuilder.post("/api/users/signup").jsonBody(model).responseAsJson();if(userID){location.href="/";return}if(captcha){model.captcha.verified=captcha.verified}if(phone===null||phone===void 0?void 0:phone.verified){model.phone.verified=phone.verified}if(phone===null||phone===void 0?void 0:phone.id){model.phone.id=phone.id;model.phone.smsConfig=phone.smsConfig;yield this.askPhoneCode()}}))}askPhoneCode(){return __awaiter(this,void 0,void 0,(function*(){this.renderer=XNode.create("div",null,XNode.create("div",null,XNode.create("div",{"data-max-width":"size-large"},XNode.create(Form,null,XNode.create("h4",null,"Verify your Phone Number"),XNode.create(QRCodeControl,{smsConfig:this.model.phone.smsConfig})))));do{yield sleep(5e3);yield this.signup()}while(true)}))}});__decorate([Action({onEvent:"signup"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],SignupPage.prototype,"signup",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/users/SignupPage");System.register([],(function(_export,_context){"use strict";var FileTypes;_export("default",void 0);return{setters:[],execute:function(){_export("default",FileTypes=class FileTypes{static canPreview(file){if(/(image|video|audio)\//.test(file.contentType)){return true}return/\.(pdf|docx|docm|pptx|pptm|xlsx|xlsm|doc|xls|pdf|ppt|dot|xlst|sxw|sxc|sxd|sxi|sxm|sxg|txt)$/i.test(file.name)}static isMedia(file){return/^(audio|video)\//i.test(file.contentType)}static isImage(file){return/^image\//i.test(file.contentType)||/\.(jpg|png|bmp|gif|tif|tiff|jiff|jpg)$/i.test(file.name)}static isDocument(file){return/\.(pdf|docx|docm|pptx|pptm|xlsx|xlsm|doc|xls|pdf|ppt|dot|xlst|sxw|sxc|sxd|sxi|sxm|sxg|txt|md)$/i.test(file.name)}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/FileTypes");System.register(["@web-atoms/core/dist/core/Command","../../common/commands/CommonCommands","../../services/FileTypes"],(function(_export,_context){"use strict";var Command,CommonCommands,FileTypes,AppCommands;_export("default",void 0);return{setters:[function(_webAtomsCoreDistCoreCommand){Command=_webAtomsCoreDistCoreCommand.default},function(_commonCommandsCommonCommands){CommonCommands=_commonCommandsCommonCommands.default},function(_servicesFileTypes){FileTypes=_servicesFileTypes.default}],execute:function(){_export("default",AppCommands=class AppCommands extends CommonCommands{static getPreviewCommand(p){if(FileTypes.isDocument(p)){return this.previewPdf}if(FileTypes.isImage(p)){return this.previewImage}if(FileTypes.isMedia(p)){return this.previewMedia}}});AppCommands.openHome=Command.create({route:"/",routeOrder:200,openPage:()=>_context.import("../page/home/HomePage")});AppCommands.openMailboxList=Command.create({route:"/mailboxes",routeOrder:100,openPage:()=>_context.import("../../common/pages/mailboxes/MailboxListPage")});AppCommands.openMails=Command.create({route:"/mails",routeOrder:100,openPage:()=>_context.import("../page/mails/MailboxContacts")});AppCommands.openFiles=Command.create({route:"/files/{id}",routeOrder:100,openPage:()=>_context.import("../page/files/FolderPage")});AppCommands.openTemplates=Command.create({route:"/templates",routeOrder:100,routeDefaults:{templates:true},openPage:()=>_context.import("../page/files/FolderPage")});AppCommands.previewImage=Command.create({route:"/social-mail/file-preview/image/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/image/PreviewImage")});AppCommands.previewHtml=Command.create({route:"/social-mail/file-preview/html/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/document/PreviewDocument")});AppCommands.previewPdf=Command.create({route:"/social-mail/file-preview/pdf/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/document/PreviewPDF")});AppCommands.previewMedia=Command.create({route:"/social-mail/file-preview/media/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/media/PreviewMedia")});AppCommands.signup=Command.create({route:"/social-mail/users/signup",openPage:()=>_context.import("../page/users/SignupPage")})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/commands/AppCommands");System.register(["@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/style/styled","../../NumberFormats","../../../web/commands/AppCommands","@social-mail/social-mail-client/content/icons/audio.svg","../../apiPath"],(function(_export,_context){"use strict";var XNode,styled,toFileSize,AppCommands,audioIcon,apiPath;function FilePreview(a){const size=a.fileSize&&toFileSize(a.fileSize);const{appFileID,name,fileContentID}=a;let src=apiPath(`/api/files/webp(300)/${appFileID}/${fileContentID}/${name}/${name}.300.webp`);const p={appFileID,name,fileContentID};if(/^audio\//i.test(a.contentType)){src=audioIcon}const command=AppCommands.getPreviewCommand(a);if(command){return XNode.create("a",{href:command.displayRoute(p),"data-click-event":"route",title:size?`${name} (${size})`:name,"data-file-preview":"file-preview"},XNode.create("img",{"data-element":"preview",src}),XNode.create("label",{"data-element":"file-name"},name))}return XNode.create("a",{href:a.downloadUrl,title:size?`${name} (${size})`:name,target:"_blank","data-file-preview":"attachment"},XNode.create("i",{class:"fas fa-paperclip"}),XNode.create("label",{"data-element":"file-name"},name))}_export("default",FilePreview);return{setters:[function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default},function(_NumberFormats){toFileSize=_NumberFormats.toFileSize},function(_webCommandsAppCommands){AppCommands=_webCommandsAppCommands.default},function(_socialMailSocialMailClientContentIconsAudioSvg){audioIcon=_socialMailSocialMailClientContentIconsAudioSvg.default},function(_apiPath){apiPath=_apiPath.apiPath}],execute:function(){styled.css`
2542
+ `.installLocal();_export("default",SignupPage=class SignupPage extends ContentPage{constructor(){super(...arguments);this.termsAgreed=false;this.model={name:"",username:"",password:"",passwordAgain:"",phoneNumber:"",country:"US",phoneNumberText:"",captcha:{code:""},phone:{code:""}}}init(){return __awaiter(this,void 0,void 0,(function*(){this.hideToolbar=true;this.element.className=css;this.title="Social Mail Signup";const{id}=yield FetchBuilder.put("/api/users/captcha").responseAsJson();this.model.captcha.id=id;this.renderer=XNode.create("div",null,XNode.create("div",null,XNode.create("div",{"data-max-width":"size-large"},XNode.create(Form,null,XNode.create(FormField,{label:"Your Name"},XNode.create("input",{autofocus:true,placeholder:"Display Name",value:Bind.twoWaysImmediate((()=>this.model.name))})),XNode.create(FormField,{label:"Email Address"},XNode.create("div",{"data-layout":"row","data-padding":"auto"},XNode.create("input",{"data-border":"none",placeholder:"first-last-name",style:"outline: none",type:"text",value:Bind.twoWaysImmediate((()=>this.model.username))}),XNode.create("span",{text:"@socialmail.me"}))),XNode.create("details",null,XNode.create("summary",null,"Username Policy"),"Please choose username that resembles your real legal name. Any other name will be banned and blocked permanently. And you will not be able to create new username with same phone number as well."),XNode.create(FormField,{label:"Password"},XNode.create("input",{type:"password",value:Bind.twoWaysImmediate((()=>this.model.password))})),XNode.create(FormField,{label:"Password Again"},XNode.create("input",{type:"password",value:Bind.twoWaysImmediate((()=>this.model.passwordAgain))})),XNode.create(FormField,{label:"Phone Number"},XNode.create("div",{"data-layout":"row"},XNode.create(CountrySelect,{value:Bind.twoWaysImmediate((()=>this.model.country))}),XNode.create(MaskedInput,{"data-mask":Bind.oneWayAsync((()=>formatForCountry(this.model.country))),value:Bind.twoWaysImmediate((()=>this.model.phoneNumberText))}))),XNode.create("div",null,"We require phone number verification to prevent misuse and fraud over the email. And it will also help you in setting up two factor authentication to prevent hackers from accessing your private emails."),XNode.create("br",null),XNode.create("br",null),XNode.create(FormField,{label:"Captcha"},XNode.create("img",{src:`/api/users/captcha/${id}`})),XNode.create(FormField,{label:"Enter 5 Digit Code"},XNode.create("input",{type:"tel",value:Bind.twoWaysImmediate((()=>this.model.captcha.code))})),XNode.create("div",{"data-layout":"row"},XNode.create("input",{type:"checkbox",checked:Bind.twoWaysImmediate((()=>this.termsAgreed))}),XNode.create("span",{text:"I agree the "}),XNode.create("a",{href:"https://socialmail.in/terms.html",target:"_blank"},"Terms & Conditions")),XNode.create("div",{"data-layout":"row"},XNode.create("button",{"data-layout":"go-button","data-submit-event":"signup"},"Signup"))))))}))}signup(){return __awaiter(this,void 0,void 0,(function*(){const{model}=this;if(!this.termsAgreed){throw new Error("You must agree to Terms & Conditions.")}if(!model.password){throw new Error("Password is required")}if(model.password.length<7){throw new Error("Password is cannot be less than 7 characters")}if(/\s/i.test(model.password)){throw new Error("Password must not any whitespace characters")}const isdCode=yield isdForCountry(model.country);const phoneNumber=model.phoneNumberText.replace(/[^0-9]/g,"");model.phoneNumber=isdCode.startsWith("+")?isdCode+phoneNumber:`+${isdCode}${phoneNumber}`;const{userID,phone={},captcha={}}=yield FetchBuilder.post("/api/users/signup").jsonBody(model).responseAsJson();if(userID){location.href="/";return}if(captcha){model.captcha.verified=captcha.verified}if(phone===null||phone===void 0?void 0:phone.verified){model.phone.verified=phone.verified}if(phone===null||phone===void 0?void 0:phone.id){model.phone.id=phone.id;model.phone.smsConfig=phone.smsConfig;yield this.askPhoneCode()}}))}askPhoneCode(){return __awaiter(this,void 0,void 0,(function*(){this.renderer=XNode.create("div",null,XNode.create("div",null,XNode.create("div",{"data-max-width":"size-large"},XNode.create(QRCodeControl,{smsConfig:this.model.phone.smsConfig}))));do{yield sleep(5e3);yield this.signup()}while(true)}))}});__decorate([Action({onEvent:"signup"}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Promise)],SignupPage.prototype,"signup",null)}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/page/users/SignupPage");System.register([],(function(_export,_context){"use strict";var FileTypes;_export("default",void 0);return{setters:[],execute:function(){_export("default",FileTypes=class FileTypes{static canPreview(file){if(/(image|video|audio)\//.test(file.contentType)){return true}return/\.(pdf|docx|docm|pptx|pptm|xlsx|xlsm|doc|xls|pdf|ppt|dot|xlst|sxw|sxc|sxd|sxi|sxm|sxg|txt)$/i.test(file.name)}static isMedia(file){return/^(audio|video)\//i.test(file.contentType)}static isImage(file){return/^image\//i.test(file.contentType)||/\.(jpg|png|bmp|gif|tif|tiff|jiff|jpg)$/i.test(file.name)}static isDocument(file){return/\.(pdf|docx|docm|pptx|pptm|xlsx|xlsm|doc|xls|pdf|ppt|dot|xlst|sxw|sxc|sxd|sxi|sxm|sxg|txt|md)$/i.test(file.name)}})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/services/FileTypes");System.register(["@web-atoms/core/dist/core/Command","../../common/commands/CommonCommands","../../services/FileTypes"],(function(_export,_context){"use strict";var Command,CommonCommands,FileTypes,AppCommands;_export("default",void 0);return{setters:[function(_webAtomsCoreDistCoreCommand){Command=_webAtomsCoreDistCoreCommand.default},function(_commonCommandsCommonCommands){CommonCommands=_commonCommandsCommonCommands.default},function(_servicesFileTypes){FileTypes=_servicesFileTypes.default}],execute:function(){_export("default",AppCommands=class AppCommands extends CommonCommands{static getPreviewCommand(p){if(FileTypes.isDocument(p)){return this.previewPdf}if(FileTypes.isImage(p)){return this.previewImage}if(FileTypes.isMedia(p)){return this.previewMedia}}});AppCommands.openHome=Command.create({route:"/",routeOrder:200,openPage:()=>_context.import("../page/home/HomePage")});AppCommands.openMailboxList=Command.create({route:"/mailboxes",routeOrder:100,openPage:()=>_context.import("../../common/pages/mailboxes/MailboxListPage")});AppCommands.openMails=Command.create({route:"/mails",routeOrder:100,openPage:()=>_context.import("../page/mails/MailboxContacts")});AppCommands.openFiles=Command.create({route:"/files/{id}",routeOrder:100,openPage:()=>_context.import("../page/files/FolderPage")});AppCommands.openTemplates=Command.create({route:"/templates",routeOrder:100,routeDefaults:{templates:true},openPage:()=>_context.import("../page/files/FolderPage")});AppCommands.previewImage=Command.create({route:"/social-mail/file-preview/image/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/image/PreviewImage")});AppCommands.previewHtml=Command.create({route:"/social-mail/file-preview/html/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/document/PreviewDocument")});AppCommands.previewPdf=Command.create({route:"/social-mail/file-preview/pdf/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/document/PreviewPDF")});AppCommands.previewMedia=Command.create({route:"/social-mail/file-preview/media/{appFileID}/{fileContentID}/{name}",pushPage:()=>_context.import("../page/files/preview/media/PreviewMedia")});AppCommands.signup=Command.create({route:"/social-mail/users/signup",openPage:()=>_context.import("../page/users/SignupPage")})}}}));AmdLoader.instance.setup("@social-mail/social-mail-client/dist/web/commands/AppCommands");System.register(["@web-atoms/core/dist/core/XNode","@web-atoms/core/dist/style/styled","../../NumberFormats","../../../web/commands/AppCommands","@social-mail/social-mail-client/content/icons/audio.svg","../../apiPath"],(function(_export,_context){"use strict";var XNode,styled,toFileSize,AppCommands,audioIcon,apiPath;function FilePreview(a){const size=a.fileSize&&toFileSize(a.fileSize);const{appFileID,name,fileContentID}=a;let src=apiPath(`/api/files/webp(300)/${appFileID}/${fileContentID}/${name}/${name}.300.webp`);const p={appFileID,name,fileContentID};if(/^audio\//i.test(a.contentType)){src=audioIcon}const command=AppCommands.getPreviewCommand(a);if(command){return XNode.create("a",{href:command.displayRoute(p),"data-click-event":"route",title:size?`${name} (${size})`:name,"data-file-preview":"file-preview"},XNode.create("img",{"data-element":"preview",src}),XNode.create("label",{"data-element":"file-name"},name))}return XNode.create("a",{href:a.downloadUrl,title:size?`${name} (${size})`:name,target:"_blank","data-file-preview":"attachment"},XNode.create("i",{class:"fas fa-paperclip"}),XNode.create("label",{"data-element":"file-name"},name))}_export("default",FilePreview);return{setters:[function(_webAtomsCoreDistCoreXNode){XNode=_webAtomsCoreDistCoreXNode.default},function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default},function(_NumberFormats){toFileSize=_NumberFormats.toFileSize},function(_webCommandsAppCommands){AppCommands=_webCommandsAppCommands.default},function(_socialMailSocialMailClientContentIconsAudioSvg){audioIcon=_socialMailSocialMailClientContentIconsAudioSvg.default},function(_apiPath){apiPath=_apiPath.apiPath}],execute:function(){styled.css`
2543
2543
  border: solid 2px lightgray;
2544
2544
  display: inline-grid;
2545
2545
  margin: 5px;